index.vue 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  4. <el-form-item label="企微主体" prop="corpId">
  5. <el-select v-model="queryParams.corpId" placeholder="企微主体" size="small" @change="updateCorpId()">
  6. <el-option
  7. v-for="dict in myQwCompanyList"
  8. :key="dict.dictValue"
  9. :label="dict.dictLabel"
  10. :value="dict.dictValue"
  11. />
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="企微账号" prop="qwUserId">
  15. <el-input
  16. v-model="queryParams.qwUserId"
  17. placeholder="请输入企微账号"
  18. clearable
  19. size="small"
  20. @keyup.enter.native="handleQuery"
  21. />
  22. </el-form-item>
  23. <el-form-item label="企微昵称" prop="qwUserName">
  24. <el-input
  25. v-model="queryParams.qwUserName"
  26. placeholder="请输入企微昵称"
  27. clearable
  28. size="small"
  29. @keyup.enter.native="handleQuery"
  30. />
  31. </el-form-item>
  32. <el-form-item label="授权码" prop="appKey">
  33. <el-input
  34. v-model="queryParams.appKey"
  35. placeholder="请输入授权码"
  36. clearable
  37. size="small"
  38. @keyup.enter.native="handleQuery"
  39. />
  40. </el-form-item>
  41. <el-form-item label="员工状态" prop="isDel">
  42. <el-select v-model="queryParams.isDel" placeholder="请选择员工状态" clearable>
  43. <el-option
  44. v-for="item in optionsStatus"
  45. :key="item.value"
  46. :label="item.label"
  47. :value="item.value">
  48. </el-option>
  49. </el-select>
  50. </el-form-item>
  51. <el-form-item>
  52. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  53. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  54. </el-form-item>
  55. </el-form>
  56. <el-row :gutter="10" class="mb8">
  57. <el-col :span="1.5">
  58. <el-button
  59. type="primary"
  60. :disabled="multiple"
  61. plain
  62. icon="el-icon-edit"
  63. size="mini"
  64. @click="updateSendType"
  65. >修改发送方式
  66. </el-button>
  67. </el-col>
  68. <el-col :span="1.5">
  69. <el-button
  70. type="warning"
  71. plain
  72. icon="el-icon-download"
  73. size="mini"
  74. :loading="exportLoading"
  75. @click="handleExport"
  76. v-hasPermi="['qw:user:export']"
  77. >导出</el-button>
  78. </el-col>
  79. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  80. </el-row>
  81. <el-table border v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
  82. <el-table-column type="selection" width="55" align="center" />
  83. <el-table-column label="企微成员ID" align="center" prop="id" />
  84. <el-table-column label="企微账号" align="center" prop="qwUserId" />
  85. <el-table-column label="企微昵称" align="center" prop="qwUserName" />
  86. <el-table-column label="员工称呼" align="center" prop="welcomeText" />
  87. <el-table-column label="所属部门" align="center" prop="isDel">
  88. <template slot-scope="scope">
  89. <el-tag v-if="scope.row.isDel == 0" type="success">正常</el-tag>
  90. <el-tag v-else type="error">离职</el-tag>
  91. </template>
  92. </el-table-column>
  93. <el-table-column label="联系我二维码" align="center" prop="contactWay" >
  94. <template slot-scope="scope">
  95. <el-image
  96. v-if="scope.row.contactWay!=null"
  97. style="width: 100px; height: 100px"
  98. :src="scope.row.contactWay"
  99. fit="contain"
  100. @click="openImageViewer(scope.row.contactWay)"/>
  101. </template>
  102. </el-table-column>
  103. <el-table-column label="绑定的AI客服" align="center" prop="fastGptRoleName" />
  104. <el-table-column label="授权码" align="center" prop="appKey" />
  105. <el-table-column label="发送方式" align="center" prop="sendMsgType">
  106. <template slot-scope="scope">
  107. <el-tag v-if="scope.row.sendMsgType == 0">方式一</el-tag>
  108. <el-tag v-if="scope.row.sendMsgType == 1" type="success">方式二</el-tag>
  109. <el-tag v-if="scope.row.sendMsgType == 2" type="warning">掉线通知</el-tag>
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="UUID" align="center" prop="uid" />
  113. <el-table-column label="ai状态" align="center" prop="loginStatus">
  114. <template slot-scope="scope">
  115. <el-tag v-if="scope.row.ipadStatus == 1" type="success">在线</el-tag>
  116. <el-tag v-else type="danger">离线</el-tag>
  117. </template>
  118. </el-table-column>
  119. <!-- <el-table-column label="插件状态" align="center" prop="toolStatus">-->
  120. <!-- <template slot-scope="scope">-->
  121. <!-- <el-tag v-if="scope.row.toolStatus == 1" type="success">在线</el-tag>-->
  122. <!-- <el-tag v-else type="danger">离线</el-tag>-->
  123. <!-- </template>-->
  124. <!-- </el-table-column>-->
  125. <!-- <el-table-column label="插件版本" align="center" prop="version"/>-->
  126. <el-table-column label="服务器地址" align="center" prop="loginCodeUrl">
  127. <template slot-scope="scope">
  128. <el-tooltip class="item" effect="dark" :content="scope.row.loginCodeUrl" placement="top">
  129. <div style="display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; text-overflow: ellipsis;">
  130. <span>{{ scope.row.loginCodeUrl }}</span>
  131. </div>
  132. </el-tooltip>
  133. </template>
  134. </el-table-column>
  135. <el-table-column label="自动发课" align="center" prop="isAuto">
  136. <template slot-scope="scope">
  137. <dict-tag :options="isAutoOptions" :value="scope.row.isAuto"/>
  138. </template>
  139. </el-table-column>
  140. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
  141. <template slot-scope="scope">
  142. <el-button
  143. size="mini"
  144. type="text"
  145. icon="el-icon-user-solid"
  146. plain
  147. @click="handleAppellation(scope.row)"
  148. >
  149. 修改员工称呼
  150. </el-button>
  151. <el-button
  152. size="mini"
  153. type="text"
  154. icon="el-icon-user-solid"
  155. plain
  156. @click="handleAutoRemark(scope.row)"
  157. >
  158. 完课备注修改
  159. </el-button>
  160. <el-button
  161. v-if="scope.row.serverStatus==1&&scope.row.ipadStatus!=1"
  162. size="mini"
  163. type="text"
  164. icon="el-icon-sunny"
  165. plain
  166. @click="handleLoginQwCode(scope.row)"
  167. v-hasPermi="['qw:user:login']"
  168. >
  169. 登录企微
  170. </el-button>
  171. <el-button
  172. v-if="scope.row.serverStatus==1&&scope.row.ipadStatus==1"
  173. size="mini"
  174. type="text"
  175. icon="el-icon-moon"
  176. plain
  177. @click="handleLoginOutQwStatus(scope.row)"
  178. v-hasPermi="['qw:user:login']"
  179. >
  180. 退出企微
  181. </el-button>
  182. <el-button
  183. v-if="scope.row.ipadStatus==1"
  184. size="mini"
  185. type="text"
  186. icon="el-icon-moon"
  187. plain
  188. @click="handleTwoCode(scope.row)"
  189. v-hasPermi="['qw:user:login']">
  190. 二次验证
  191. </el-button>
  192. <el-button
  193. v-if="scope.row.serverStatus!=1"
  194. size="mini"
  195. type="text"
  196. icon="el-icon-moon"
  197. plain
  198. @click="handleGetQwIpad(scope.row)"
  199. v-hasPermi="['qw:user:login']"
  200. >
  201. 获取Ai主机
  202. </el-button>
  203. <el-button
  204. v-if="scope.row.serverStatus==1 && scope.row.ipadStatus!=1"
  205. size="mini"
  206. type="text"
  207. icon="el-icon-moon"
  208. plain
  209. @click="handleDelQwIpad(scope.row)"
  210. v-hasPermi="['qw:user:login']"
  211. >
  212. 解绑Ai主机
  213. </el-button>
  214. <el-button
  215. v-if="scope.row.isAuto=='00'"
  216. size="mini"
  217. type="text"
  218. icon="el-icon-moon"
  219. plain
  220. @click="handleUpdateIsAuto(scope.row,'01')"
  221. v-hasPermi="['qw:user:isauto']"
  222. >
  223. 启用插件
  224. </el-button>
  225. <el-button
  226. v-if="scope.row.isAuto=='01'"
  227. size="mini"
  228. type="text"
  229. icon="el-icon-moon"
  230. plain
  231. @click="handleUpdateIsAuto(scope.row,'00')"
  232. v-hasPermi="['qw:user:isauto']"
  233. >
  234. 禁用插件
  235. </el-button>
  236. </template>
  237. </el-table-column>
  238. <el-table-column label="主机" align="center" class-name="small-padding fixed-width" width="110px" fixed="right">
  239. <template slot-scope="scope">
  240. <el-button
  241. v-if="scope.row.appKey==null"
  242. size="mini"
  243. type="text"
  244. icon="el-icon-s-check"
  245. plain
  246. v-hasPermi="['qw:user:authAppKey']"
  247. @click="uploadAuthorizeKey2(scope.row)"
  248. >授权key
  249. </el-button>
  250. <el-button
  251. v-if="scope.row.loginCodeUrl==null && scope.row.appKey !=null"
  252. size="mini"
  253. type="text"
  254. icon="el-icon-sunny"
  255. plain
  256. @click="handleBindCloudHost(scope.row)"
  257. v-hasPermi="['qw:user:loginIp']"
  258. >
  259. 绑定主机
  260. </el-button>
  261. <!-- <el-button-->
  262. <!-- v-if="scope.row.loginCodeUrl!=null"-->
  263. <!-- size="mini"-->
  264. <!-- type="text"-->
  265. <!-- icon="el-icon-video-camera-solid"-->
  266. <!-- plain-->
  267. <!-- @click="handleCloudAP(scope.row.loginCodeUrl)"-->
  268. <!-- v-hasPermi="['qw:user:cloudAP']"-->
  269. <!-- >-->
  270. <!-- 获取主机帐密-->
  271. <!-- </el-button>-->
  272. <el-button
  273. v-if="scope.row.loginCodeUrl!=null"
  274. size="mini"
  275. type="text"
  276. icon="el-icon-moon"
  277. plain
  278. @click="handleUnbindCloudHost(scope.row)"
  279. v-hasPermi="['qw:user:loginIpOut']"
  280. >
  281. 解除主机
  282. </el-button>
  283. <el-button
  284. size="mini"
  285. type="text"
  286. :icon="scope.row.videoGetStatus == 0 ? 'el-icon-circle-check' : 'el-icon-remove-outline'"
  287. plain
  288. @click="changeVideoStatus(scope.row)"
  289. >
  290. {{ scope.row.videoGetStatus == 0 ? "开启" : "禁用" }}视频号接收
  291. </el-button>
  292. </template>
  293. </el-table-column>
  294. <el-table-column label="AI客服" align="center" class-name="small-padding fixed-width" width="100px" fixed="right">
  295. <template slot-scope="scope">
  296. <el-button
  297. size="mini"
  298. type="text"
  299. icon="el-icon-connection"
  300. plain
  301. v-if="scope.row.fastGptRoleName!=null"
  302. @click="bindFastGptRole(scope.row)"
  303. >换绑AI客服</el-button>
  304. <el-button
  305. size="mini"
  306. type="text"
  307. plain
  308. icon="el-icon-link"
  309. v-else
  310. @click="bindFastGptRole(scope.row)"
  311. >绑定AI客服</el-button>
  312. <el-button
  313. size="mini"
  314. type="text"
  315. icon="el-icon-unlock"
  316. plain
  317. v-if="scope.row.fastGptRoleName!=null"
  318. @click="relieveFastGptRole(scope.row)"
  319. >解绑AI客服</el-button>
  320. </template>
  321. </el-table-column>
  322. </el-table>
  323. <pagination
  324. v-show="total>0"
  325. :total="total"
  326. :page.sync="queryParams.pageNum"
  327. :limit.sync="queryParams.pageSize"
  328. @pagination="getList"
  329. />
  330. <!-- 绑定AI客服-->
  331. <el-dialog :title="bindAiTitle" :visible.sync="bindAiOpen" width="1200px" append-to-body>
  332. <fast-gpt-role ref="fastGptRole" @refreshFastGptList="refreshFastGptList" ></fast-gpt-role>
  333. </el-dialog>
  334. <!-- <el-dialog :visible.sync="updateIp.open" width="600px" append-to-body>-->
  335. <!-- <el-form ref="updateIpForm" :model="updateIpForm" :rules="updateIpRule" label-width="100px">-->
  336. <!-- <el-form-item label="新云主机IP" prop="Ip">-->
  337. <!-- <el-input v-model="updateIpForm.newIp" placeholder="请输入新IP" />-->
  338. <!-- </el-form-item>-->
  339. <!-- </el-form>-->
  340. <!-- <div slot="footer" class="dialog-footer" >-->
  341. <!-- <el-button type="primary" @click="submitUpdateIpForm">确 定</el-button>-->
  342. <!-- </div>-->
  343. <!-- </el-dialog>-->
  344. <el-dialog title="云主机信息" :visible.sync="cloudAPOpen.open" append-to-body>
  345. <el-card class="box-card">
  346. <div slot="header" class="clearfix">
  347. <span>账号:{{cloudAPOpen.admin}}</span>
  348. </div>
  349. <div slot="header" class="clearfix">
  350. <span>密码:{{cloudAPOpen.passWord}}</span>
  351. </div>
  352. </el-card>
  353. </el-dialog>
  354. <el-dialog :title="callOpen.title" :visible.sync="callOpen.open" width="500px" append-to-body>
  355. <el-form ref="callOpenFrom" :model="callOpenFrom" :rules="callOpenRule" label-width="110px">
  356. <el-form-item label="员工称呼" prop="welcomeText">
  357. <el-input v-model="callOpenFrom.welcomeText" placeholder="请输入员工称呼" />
  358. </el-form-item>
  359. </el-form>
  360. <div slot="footer" class="dialog-footer" >
  361. <el-button type="primary" @click="submitCallOpenFrom">确 定</el-button>
  362. </div>
  363. </el-dialog>
  364. <el-dialog :title="editRemarkOpen.title" :visible.sync="editRemarkOpen.open" width="500px" append-to-body>
  365. <el-form ref="callOpenFrom" :model="editRemarkOpen" label-width="110px">
  366. <el-radio-group v-model="editRemarkOpen.isSendMsg">
  367. <el-card>
  368. <el-row :gutter="20">
  369. <el-col>
  370. <el-radio
  371. :label="1"
  372. style="font-size: 16px; margin: 10px 0;"
  373. >添加【完课备注】在最【旧备注-(前面)】</el-radio>
  374. </el-col>
  375. <el-col>
  376. <el-radio
  377. :label="2"
  378. style="font-size: 16px; margin: 10px 0;"
  379. >添加【完课备注】在最【旧备注-(后面)】</el-radio>
  380. </el-col>
  381. <el-col>
  382. <el-radio
  383. :label="3"
  384. style="font-size: 16px; margin: 10px 0;"
  385. >使用简洁版备注【*日期完】,在【旧备注-前面】</el-radio>
  386. </el-col>
  387. <el-col>
  388. <el-radio
  389. :label="4"
  390. style="font-size: 16px; margin: 10px 0;"
  391. >使用简洁版备注【*日期完】,在【旧备注-后面】</el-radio>
  392. </el-col>
  393. <el-col>
  394. <el-radio
  395. :label="5"
  396. style="font-size: 16px; margin: 10px 0;"
  397. >不用完课备注</el-radio>
  398. </el-col>
  399. </el-row>
  400. </el-card>
  401. </el-radio-group>
  402. </el-form>
  403. <div slot="footer" class="dialog-footer">
  404. <el-button type="primary" @click="submitEditRemarkOpenFrom">确 定</el-button>
  405. </div>
  406. </el-dialog>
  407. <el-dialog title="授权key" :visible.sync="authorizeKeyOpen" width="500px" append-to-body>
  408. <el-form ref="authorizeKeyFrom" :model="authorizeKeyFrom" :rules="authorizeKeyRule" label-width="110px">
  409. <el-form-item label="授权的key值" prop="appKey">
  410. <el-input v-model="authorizeKeyFrom.appKey" placeholder="请输入授权key" type="Number"/>
  411. </el-form-item>
  412. </el-form>
  413. <div slot="footer" class="dialog-footer" >
  414. <el-button type="primary" @click="submitAuthorizeKeyForm">确 定</el-button>
  415. </div>
  416. </el-dialog>
  417. <!--二维码 -->
  418. <el-dialog
  419. title="企微二次认证"
  420. :visible.sync="qwLoginTwo.open"
  421. width="600px"
  422. append-to-body
  423. custom-class="qr-login-dialog"
  424. >
  425. <div class="qr-login-container">
  426. <div class="image-wrapper" v-loading="imageLoading" >
  427. <el-image
  428. :src="'data:image/png;base64,' +qwLoginTwo.codeUrl"
  429. style="display: block; margin: 0 auto; width: 300px; height: 300px;"
  430. />
  431. </div>
  432. <p class="qr-login-instructions">二次验证二维码</p>
  433. </div>
  434. <div slot="footer" class="dialog-footer" >
  435. <el-button type="primary" @click="qwLoginTwo.open=false">确 定</el-button>
  436. </div>
  437. </el-dialog>
  438. <el-dialog
  439. :title="qwLogin.title"
  440. :visible.sync="qwLogin.open"
  441. width="600px"
  442. append-to-body
  443. custom-class="qr-login-dialog"
  444. >
  445. <div class="qr-login-container">
  446. <div class="image-wrapper" v-loading="imageLoading" >
  447. <el-image
  448. :src="'data:image/png;base64,' +qwLogin.codeUrl"
  449. style="display: block; margin: 0 auto; width: 300px; height: 300px;"
  450. />
  451. </div>
  452. <p class="qr-login-instructions">使用企业微信扫码授权登录</p>
  453. </div>
  454. </el-dialog>
  455. <el-dialog
  456. title="输入企微验证码"
  457. :visible.sync="qwCode.open"
  458. width="600px"
  459. append-to-body>
  460. <el-form :model="qwCode" label-width="80px" @submit.native.prevent="handleSubmit">
  461. <el-form-item label="验证码" prop="companyName">
  462. <el-input v-model="qwCode.code" placeholder="输入企微6位验证码" />
  463. </el-form-item>
  464. </el-form>
  465. <div slot="footer" class="dialog-footer">
  466. <el-button type="primary" @click="submitCodeForm">确 定</el-button>
  467. </div>
  468. </el-dialog>
  469. <!-- 大图预览对话框 -->
  470. <el-dialog
  471. :visible.sync="dialogVisible"
  472. :modal="false"
  473. width="1200"
  474. append-to-body>
  475. <img
  476. :src="this.dialogImageUrl"
  477. style="display: block; max-width: 100%; margin: 0 auto"
  478. />
  479. </el-dialog>
  480. <el-dialog
  481. :visible.sync="updateSendOpen"
  482. width="1000px"
  483. append-to-body>
  484. <el-form label-width="80px">
  485. <p>是否修改企微账号发送方式:
  486. <el-tag style="margin-left: 10px" v-for="name in names">{{ name }}</el-tag>
  487. </p>
  488. <el-form-item label="发送方式" prop="type">
  489. <el-radio-group v-model="type">
  490. <el-radio
  491. :label="0"
  492. >方式一
  493. </el-radio>
  494. <el-radio
  495. :label="1"
  496. >方式二
  497. </el-radio>
  498. <el-radio
  499. :label="2"
  500. >掉线通知
  501. </el-radio>
  502. </el-radio-group>
  503. </el-form-item>
  504. </el-form>
  505. <div slot="footer" class="dialog-footer">
  506. <el-button type="primary" @click="submitUpdateSendTypeForm">确 定</el-button>
  507. </div>
  508. </el-dialog>
  509. </div>
  510. </template>
  511. <script>
  512. import {
  513. updateIsAuto,
  514. updateUser,
  515. exportUser,
  516. getMyQwCompanyList,
  517. relieveFastGptRoleById,
  518. loginQwIpad,
  519. loginQwCodeMsg,
  520. twoCode,
  521. twoCodeStatus,
  522. qrCodeStatus,
  523. updateSendType,
  524. getQwIpad,
  525. delQwIpad,
  526. qrCodeVerify,
  527. outLoginQwIpad,
  528. changeVideoStatus,
  529. handleAllocateRemoteHost,
  530. qwBindCloudHost, qwUnbindCloudHost, handleAuthAppKey, handleInputAuthAppKey, selectCloudAP, staffListUser
  531. } from '../../../api/qw/user'
  532. import fastGptRole from "@/views/fastGpt/fastGptRole/fastGptRole";
  533. export default {
  534. name: "cuDeptIdIndex",
  535. components: { fastGptRole},
  536. data() {
  537. return {
  538. isAutoOptions:[],
  539. updateIp:{
  540. open:false,
  541. title: "修改云主机IP"
  542. },
  543. updateIpForm:{
  544. id:null,
  545. newIp:null,
  546. },
  547. authorizeKeyOpen:false,
  548. authorizeKeyFrom:{
  549. id:null,
  550. appKey:null,
  551. qwUserId:null,
  552. qwUserName:null
  553. },
  554. updateIpRule:{},
  555. newIp:null,
  556. //放大图片
  557. dialogImageUrl:null,
  558. dialogVisible:false,
  559. optionsStatus: [{
  560. value: 0,
  561. label: '正常'
  562. }, {
  563. value: 2,
  564. label: '离职'
  565. }],
  566. // 遮罩层
  567. loading: true,
  568. names: [],
  569. // 导出遮罩层
  570. exportLoading: false,
  571. // 选中数组
  572. ids: [],
  573. // 非单个禁用
  574. single: true,
  575. // 非多个禁用
  576. multiple: true,
  577. // 显示搜索条件
  578. showSearch: true,
  579. updateSendOpen: false,
  580. // 总条数
  581. total: 0,
  582. //公司列表
  583. myQwCompanyList:[],
  584. // 企微用户表格数据
  585. userList: [],
  586. allowSelectOptions:[],
  587. // 弹出层标题
  588. bindAiTitle: "",
  589. bindAiOpen: false,
  590. qwLogin:{
  591. title:"",
  592. open:false,
  593. codeUrl:null,
  594. code:null,
  595. appKey:null,
  596. },
  597. qwLoginTwo:{
  598. title:"",
  599. open:false,
  600. codeUrl:null,
  601. code:null,
  602. appKey:null,
  603. },
  604. qwCode:{
  605. title:"",
  606. open:false,
  607. code:null,
  608. },
  609. cloudAPOpen:{
  610. open:false,
  611. admin:null,
  612. passWord:null,
  613. },
  614. callOpen:{
  615. open:false,
  616. title: '修改员工称呼',
  617. },
  618. callOpenFrom:{
  619. id:null,
  620. welcomeText:null,
  621. },
  622. isAutoForm:{
  623. id:null,
  624. isAuto:null,
  625. },
  626. editRemarkOpen: {
  627. open: false,
  628. title: '修改员工自动给完课客户打备注的规则',
  629. id:null,
  630. isSendMsg:null,
  631. },
  632. twoCodeInterval:null,
  633. type: 0,
  634. loginQwInterval:null,
  635. imageLoading: true, // 控制加载状态
  636. // 查询参数
  637. queryParams: {
  638. pageNum: 1,
  639. pageSize: 10,
  640. qwUserId: null,
  641. corpId: null,
  642. qwUserName: null,
  643. },
  644. qwUserId:null,
  645. companyUserList:[],
  646. // 表单参数
  647. form: {
  648. isSendMsg: '2',
  649. },
  650. authorizeKeyRule:{
  651. appKey:[{required:true,message:"授权码不能为空",trigger:"blur"}]
  652. },
  653. callOpenRule:{
  654. welcomeText:[{required:true,message:"员工称呼不能为空",trigger:"blur"}]
  655. },
  656. // 表单校验
  657. rules: {
  658. },
  659. //欢迎语表单校验
  660. weclomeRules:{
  661. welcomeText:[{required:true,message:"消息文本不能为空",trigger:"blur"}]
  662. },
  663. };
  664. },
  665. created() {
  666. this.getDicts("qw_user_is_auto").then(response => {
  667. this.isAutoOptions = response.data;
  668. });
  669. getMyQwCompanyList().then(response => {
  670. this.myQwCompanyList = response.data;
  671. if(this.myQwCompanyList!=null){
  672. this.queryParams.corpId=this.myQwCompanyList[0].dictValue;
  673. this.getList();
  674. }
  675. });
  676. },
  677. watch: {
  678. // 监听弹窗的可见性变化
  679. 'qwLogin.open'(newVal) {
  680. if (!newVal) {
  681. // 如果弹窗关闭,清除定时器
  682. clearInterval(this.loginQwInterval);
  683. }
  684. },
  685. },
  686. methods: {
  687. getList() {
  688. this.loading = true;
  689. staffListUser(this.queryParams).then(response => {
  690. this.userList = response.rows;
  691. this.total = response.total;
  692. this.loading = false;
  693. });
  694. },
  695. updateCorpId() {
  696. this.reset();
  697. this.getList();
  698. },
  699. changeVideoStatus(val){
  700. changeVideoStatus(val.id).then(res => {
  701. this.$message.success("修改状态成功");
  702. this.getList()
  703. })
  704. },
  705. //绑定AI客服
  706. bindFastGptRole(row) {
  707. this.bindAiTitle = "绑定AI客服";
  708. this.bindAiOpen = true;
  709. setTimeout(() => {
  710. this.$refs.fastGptRole.handleBindAiData(row)
  711. }, 200);
  712. },
  713. handleAppellation(val) {
  714. this.callOpen.open = true;
  715. this.callOpenFrom.welcomeText = val.welcomeText;
  716. this.callOpenFrom.id = val.id;
  717. },
  718. handleAutoRemark(val) {
  719. this.editRemarkOpen.open = true;
  720. this.editRemarkOpen.id = val.id;
  721. this.editRemarkOpen.isSendMsg = val.isSendMsg;
  722. },
  723. //登录
  724. handleLoginQwCode(val) {
  725. if (val.appKey == null || val.appKey === '') {
  726. return this.$message.warning("没有授权码,无法登录企业微信,请授权");
  727. }
  728. loginQwIpad({qwUserId: val.id}).then(res => {
  729. this.qwUserId = val.id;
  730. this.qwLogin.code = null;
  731. this.imageLoading = false;
  732. console.log(res)
  733. if (res.msg == "success") {
  734. this.qwLogin.codeUrl = res.qrCode64
  735. this.qwLogin.open = true;
  736. this.loginQwPolling();
  737. } else {
  738. this.$message.success(res.msg);
  739. this.getList()
  740. }
  741. })
  742. },
  743. handleTwoCode(val) {
  744. twoCode({qwUserId: val.id}).then(res => {
  745. console.log(res)
  746. this.qwLoginTwo.open = true;
  747. this.qwLoginTwo.codeUrl = res.qrCode
  748. });
  749. },
  750. twoCodePolling() {
  751. this.twoCodeInterval = setInterval(() => {
  752. twoCodeStatus({qwUserId: this.qwUserId}).then(res => {
  753. console.log(res)
  754. if (res.msg == 104001) {
  755. this.$message.success('登录成功');
  756. this.clearDl()
  757. clearInterval(this.loginQwInterval);
  758. } else if (res.msg == 100004) {
  759. this.clearDl()
  760. }
  761. });
  762. }, 3000);
  763. },
  764. loginQwPolling() {
  765. this.loginQwInterval = setInterval(() => {
  766. qrCodeStatus({qwUserId: this.qwUserId}).then(res => {
  767. console.log(res)
  768. if (res.msg == 22) {
  769. this.$message.success('账号企业不一致请重新扫码登录');
  770. this.clearDl();
  771. }
  772. if (res.msg == 104001) {
  773. this.$message.success('登录成功');
  774. this.clearDl()
  775. } else if (res.msg == 100004) {
  776. this.qwCode.open = true;
  777. clearInterval(this.loginQwInterval);
  778. }
  779. });
  780. }, 3000);
  781. },
  782. submitCodeForm() {
  783. qrCodeVerify({code: this.qwCode.code, qwUserId: this.qwUserId}).then(res => {
  784. console.log(res)
  785. this.$message.success('验证成功账号信息确认中。。。。');
  786. this.qwCode.open = false;
  787. this.loginQwInterval = setTimeout(() => {
  788. qrCodeStatus({qwUserId: this.qwUserId}).then(res => {
  789. console.log(res);
  790. if (res.msg == 23) {
  791. this.$message.error('账号不一致请重新扫码登录');
  792. this.clearDl();
  793. }
  794. if (res.msg == 22) {
  795. this.$message.error('账号企业不一致请重新扫码登录');
  796. this.clearDl();
  797. }
  798. if (res.msg == 104001) {
  799. this.$message.success('登录成功');
  800. this.clearDl();
  801. }
  802. });
  803. }, 4000);
  804. });
  805. },
  806. clearDl() {
  807. this.qwCode.open = false;
  808. this.qwLogin.open = false;
  809. clearInterval(this.loginQwInterval);
  810. this.getList()
  811. },
  812. //退出
  813. handleLoginOutQwStatus(val) {
  814. outLoginQwIpad({qwUserId: val.id}).then(res => {
  815. this.$message.success("退出登录成功");
  816. this.getList()
  817. })
  818. },
  819. handleGetQwIpad(val) {
  820. getQwIpad({qwUserId: val.id}).then(res => {
  821. this.$message.success("获取主机成功");
  822. this.getList();
  823. }).catch(error => {
  824. console.log(error);
  825. if (error.code === 501) {
  826. this.$confirm(
  827. '当前区域没有多余的名额,将为你分配异地名额,会导致企业微信需要扫脸重新登录,并且半个小时后需要进行验证',
  828. '提示',
  829. {
  830. confirmButtonText: '确定',
  831. cancelButtonText: '取消',
  832. type: 'warning',
  833. dangerouslyUseHTMLString: true
  834. }
  835. ).then(() => {
  836. return handleAllocateRemoteHost({qwUserId: val.id});
  837. }).then(res => {
  838. this.$message.success('异地主机分配成功');
  839. this.getList();
  840. }).catch(() => {
  841. this.$message.info('已取消异地主机分配');
  842. });
  843. } else {
  844. this.$message.error('获取主机失败');
  845. }
  846. });
  847. },
  848. handleDelQwIpad(val) {
  849. delQwIpad({qwUserId: val.id}).then(res => {
  850. this.$message.success("解绑主机成功");
  851. this.getList()
  852. })
  853. },
  854. handleUpdateIsAuto(val,code) {
  855. this.isAutoForm={
  856. id:val.id,
  857. isAuto:code
  858. }
  859. updateIsAuto(this.isAutoForm).then(res => {
  860. if (code==='00'){
  861. this.$message.success('禁用成功');
  862. }else {
  863. this.$message.success('启用成功');
  864. }
  865. this.getList();
  866. });
  867. },
  868. //传验证码
  869. handleLoginQwCodeMsg() {
  870. loginQwCodeMsg({appKey: this.qwLogin.appKey, code: this.qwLogin.code}).then(res => {
  871. this.qwLogin.open = false;
  872. this.$message.success("登录成功");
  873. })
  874. },
  875. validateCode() {
  876. // 只允许输入数字并限制长度为6
  877. this.qwLogin.code = this.qwLogin.code.replace(/\D/g, "").slice(0, 6);
  878. },
  879. handleCloudAP(urlAP) {
  880. selectCloudAP({ipAddress: urlAP}).then(res => {
  881. this.cloudAPOpen.open = true
  882. this.cloudAPOpen.admin = res.data.apAdmin;
  883. this.cloudAPOpen.passWord = res.data.apPassword;
  884. })
  885. },
  886. handleUnbindCloudHost(val) {
  887. const appKey = val.appKey;
  888. this.$confirm(
  889. '确定要给企微账号:<span style="color: green;">' + val.qwUserId + '' +
  890. '</span><br>企微昵称:<span style="color: red;">【' + val.qwUserName + '】</span>' +
  891. '</span><br><span style="color: orange;">解绑【Ps:解绑后此云主机可能会分配给他人】</span></span>',
  892. "警告",
  893. {
  894. confirmButtonText: "确定",
  895. cancelButtonText: "取消",
  896. type: "warning",
  897. dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
  898. }
  899. ).then(() => {
  900. return qwUnbindCloudHost(appKey);
  901. }).then(response => {
  902. this.$message.success('解绑成功');
  903. }).finally(res => {
  904. this.getList();
  905. })
  906. },
  907. handleAuthorizeKey(val) {
  908. this.authorizeKeyFrom.id = val.id;
  909. this.authorizeKeyFrom.qwUserId = val.qwUserId;
  910. this.authorizeKeyFrom.qwUserName = val.qwUserName;
  911. this.authorizeKeyOpen = true;
  912. },
  913. submitAuthorizeKeyForm() {
  914. this.$refs["authorizeKeyFrom"].validate(valid => {
  915. if (valid) {
  916. if (this.authorizeKeyFrom.id != null && this.authorizeKeyFrom.appKey != null) {
  917. this.uploadAuthorizeKey();
  918. }
  919. }
  920. });
  921. },
  922. submitCallOpenFrom() {
  923. this.$refs["callOpenFrom"].validate(valid => {
  924. if (valid) {
  925. if (this.callOpenFrom.id != null && this.callOpenFrom.welcomeText != null) {
  926. updateUser(this.callOpenFrom).then(res => {
  927. this.$message.success('修改成功');
  928. this.callOpen.open = false;
  929. this.getList();
  930. });
  931. }
  932. }
  933. });
  934. },
  935. submitEditRemarkOpenFrom() {
  936. if (this.editRemarkOpen.id != null && this.editRemarkOpen.isSendMsg != null) {
  937. updateUser(this.editRemarkOpen).then(res => {
  938. this.$message.success('修改成功');
  939. this.editRemarkOpen.open = false;
  940. this.getList();
  941. });
  942. } else {
  943. this.$message.error("请选择条件")
  944. }
  945. },
  946. uploadAuthorizeKey() {
  947. this.$confirm(
  948. '确定要给企微账号:<span style="color: green;">' + this.authorizeKeyFrom.qwUserId + '' +
  949. '</span><br>企微昵称:<span style="color: red;">【' + this.authorizeKeyFrom.qwUserName + '】</span>' +
  950. '</span><br>授权key:<span style="color: #04adf6;">【' + this.authorizeKeyFrom.appKey + '】</span>?',
  951. "警告",
  952. {
  953. confirmButtonText: "确定",
  954. cancelButtonText: "取消",
  955. type: "warning",
  956. dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
  957. }
  958. ).then(() => {
  959. this.authorizeKeyOpen = false;
  960. return handleInputAuthAppKey(this.authorizeKeyFrom);
  961. }).then(response => {
  962. this.msgSuccess("授权key完成");
  963. }).finally(res => {
  964. this.resetAuthorizeKeyFrom();
  965. this.getList();
  966. })
  967. },
  968. uploadAuthorizeKey2(val) {
  969. const id = val.id;
  970. this.$confirm(
  971. '确定要给企微账号:<span style="color: green;">' + val.qwUserId + '' +
  972. '</span><br>企微昵称:<span style="color: red;">【' + val.qwUserName + '】</span>' +
  973. '</span><br>授权key</span>?',
  974. "警告",
  975. {
  976. confirmButtonText: "确定",
  977. cancelButtonText: "取消",
  978. type: "warning",
  979. dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
  980. }
  981. ).then(() => {
  982. return handleAuthAppKey({id: id});
  983. }).then(response => {
  984. this.msgSuccess("授权key完成");
  985. }).finally(res => {
  986. this.resetAuthorizeKeyFrom();
  987. this.getList();
  988. })
  989. },
  990. handleBindCloudHost(val) {
  991. if (val.appKey == null || val.appKey == '') {
  992. return this.$message.warning('没有授权码,无法绑定主机,请联系管理员');
  993. }
  994. const appKey = val.appKey;
  995. this.$confirm(
  996. '确定要给企微账号:<span style="color: green;">' + val.qwUserId + '' +
  997. '</span><br>企微昵称:<span style="color: red;">【' + val.qwUserName + '】</span>' +
  998. '</span><br><span style="color: dodgerblue;">绑定云主机?</span></span>',
  999. "警告",
  1000. {
  1001. confirmButtonText: "确定",
  1002. cancelButtonText: "取消",
  1003. type: "warning",
  1004. dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
  1005. }
  1006. ).then(() => {
  1007. return qwBindCloudHost(appKey);
  1008. }).then(response => {
  1009. this.$message.success('绑定成功,请登录云主机进行配置~~');
  1010. }).finally(res => {
  1011. this.getList();
  1012. })
  1013. },
  1014. openImageViewer(url) {
  1015. // 打开大图预览对话框
  1016. this.dialogImageUrl = url
  1017. this.dialogVisible = true;
  1018. },
  1019. //刷新页面
  1020. refreshFastGptList() {
  1021. this.bindAiOpen = false;
  1022. this.getList();
  1023. },
  1024. // 取消按钮
  1025. cancel() {
  1026. this.open = false;
  1027. this.reset();
  1028. },
  1029. // 表单重置
  1030. reset() {
  1031. this.form = {
  1032. id: null,
  1033. qwUserId: null,
  1034. corpId: null,
  1035. qwUserName: null,
  1036. };
  1037. this.resetForm("form");
  1038. },
  1039. //重置授权
  1040. resetAuthorizeKeyFrom() {
  1041. this.authorizeKeyFrom = {
  1042. id: null,
  1043. appKey: null,
  1044. qwUserId: null,
  1045. qwUserName: null
  1046. };
  1047. },
  1048. //重置登录
  1049. resetQwLogin() {
  1050. this.qwLogin = {
  1051. title: "",
  1052. open: false,
  1053. codeUrl: null,
  1054. code: null,
  1055. corpId: null,
  1056. qwUserId: null,
  1057. }
  1058. this.qwLogin.open = false;
  1059. this.loading = false;
  1060. this.getList();
  1061. },
  1062. //解绑AI客服
  1063. relieveFastGptRole(row) {
  1064. this.$confirm('是否确认解绑AI客服?', "警告", {
  1065. confirmButtonText: "确定",
  1066. cancelButtonText: "取消",
  1067. type: "warning"
  1068. }).then(function () {
  1069. return relieveFastGptRoleById(row.id);
  1070. }).then(() => {
  1071. this.getList();
  1072. this.msgSuccess("解绑成功");
  1073. })
  1074. },
  1075. /** 搜索按钮操作 */
  1076. handleQuery() {
  1077. this.queryParams.pageNum = 1;
  1078. this.getList();
  1079. },
  1080. /** 重置按钮操作 */
  1081. resetQuery() {
  1082. this.resetForm("queryForm");
  1083. this.queryParams.corpId = this.myQwCompanyList[0].dictValue;
  1084. this.handleQuery();
  1085. },
  1086. // 多选框选中数据
  1087. handleSelectionChange(selection) {
  1088. this.ids = selection.map(item => item.id)
  1089. this.names = selection.map(item => item.qwUserName)
  1090. this.single = selection.length !== 1
  1091. this.multiple = !selection.length
  1092. },
  1093. /** 提交按钮 */
  1094. submitForm() {
  1095. this.$refs["form"].validate(valid => {
  1096. if (valid) {
  1097. if (this.form.id != null) {
  1098. // updateUser(this.form).then(response => {
  1099. // this.msgSuccess("绑定成功");
  1100. // this.open = false;
  1101. // this.getList();
  1102. //
  1103. // });
  1104. } else {
  1105. // addUser(this.form).then(response => {
  1106. // this.msgSuccess("新增成功");
  1107. // this.open = false;
  1108. // this.getList();
  1109. // });
  1110. }
  1111. }
  1112. });
  1113. },
  1114. /** 导出按钮操作 */
  1115. handleExport() {
  1116. const queryParams = this.queryParams;
  1117. this.$confirm('是否确认导出所有企微用户数据项?', "警告", {
  1118. confirmButtonText: "确定",
  1119. cancelButtonText: "取消",
  1120. type: "warning"
  1121. }).then(() => {
  1122. this.exportLoading = true;
  1123. return exportUser(queryParams);
  1124. }).then(response => {
  1125. this.download(response.msg);
  1126. this.exportLoading = false;
  1127. }).catch(() => {
  1128. });
  1129. },
  1130. updateSendType() {
  1131. this.updateSendOpen = true;
  1132. },
  1133. cleanUpdateSendType() {
  1134. this.updateSendOpen = false;
  1135. },
  1136. submitUpdateSendTypeForm(){
  1137. updateSendType({ids: this.ids, type: this.type}).then(e => {
  1138. this.updateSendOpen = false;
  1139. this.$message.success("修改成功");
  1140. this.getList();
  1141. });
  1142. },
  1143. }
  1144. };
  1145. </script>
  1146. <style>
  1147. .text-container {
  1148. max-height: 7.5em; /* 设置最大高度为6行,根据字体大小调整 */
  1149. overflow-y: auto; /* 内容超出时显示滚动条 */
  1150. line-height: 1.5em; /* 行高设置,确保每行高度一致 */
  1151. }
  1152. .qr-login-dialog .el-dialog__body {
  1153. display: flex;
  1154. flex-direction: column;
  1155. align-items: center;
  1156. text-align: center;
  1157. padding: 20px;
  1158. }
  1159. .qr-login-container {
  1160. width: 100%;
  1161. }
  1162. .qr-login-instructions {
  1163. font-size: 14px;
  1164. color: #666;
  1165. margin: 10px 0;
  1166. }
  1167. .verification-code-input {
  1168. margin-top: 15px;
  1169. width: 80%;
  1170. }
  1171. </style>