myCourseWatchLog.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807
  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="qwUserId">
  5. <el-select v-model="queryParams.qwUserId" placeholder="企微账号" clearable size="small" @change="updateQwuser()">
  6. <el-option
  7. v-for="dict in myQwUserList"
  8. :key="dict.dictValue"
  9. :label="dict.dictLabel + '('+dict.corpName+')'"
  10. :value="dict.dictValue"
  11. />
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="客户ID" prop="qwExternalContactId">
  15. <el-input
  16. v-model="queryParams.qwExternalContactId"
  17. placeholder="请输入会员ID"
  18. clearable
  19. size="small"
  20. @keyup.enter.native="handleQuery"
  21. />
  22. </el-form-item>
  23. <el-form-item label="会员ID" prop="userId">
  24. <el-input
  25. v-model="queryParams.userId"
  26. placeholder="请输入会员ID"
  27. clearable
  28. size="small"
  29. @keyup.enter.native="handleQuery"
  30. />
  31. </el-form-item>
  32. <el-form-item label="会员昵称" prop="nickName">
  33. <el-input
  34. v-model="queryParams.nickName"
  35. placeholder="请输入会员昵称"
  36. clearable
  37. size="small"
  38. @keyup.enter.native="handleQuery"
  39. />
  40. </el-form-item>
  41. <el-form-item label="企微客户昵称" prop="nickName">
  42. <el-input
  43. v-model="queryParams.externalUserName"
  44. placeholder="请输入企微客户昵称"
  45. clearable
  46. size="small"
  47. @keyup.enter.native="handleQuery"
  48. />
  49. </el-form-item>
  50. <el-form-item label="课程" prop="courseId">
  51. <el-select filterable v-model="queryParams.courseId" placeholder="请选择课程" clearable size="small" @change="courseChange(queryParams.courseId)">
  52. <el-option
  53. v-for="dict in courseLists"
  54. :key="dict.dictValue"
  55. :label="dict.dictLabel"
  56. :value="dict.dictValue"
  57. />
  58. </el-select>
  59. </el-form-item>
  60. <el-form-item label="小节" prop="videoId">
  61. <el-select filterable v-model="queryParams.videoId" placeholder="请选择小节" clearable size="small">
  62. <el-option
  63. v-for="dict in videoList"
  64. :key="dict.dictValue"
  65. :label="dict.dictLabel"
  66. :value="dict.dictValue"
  67. />
  68. </el-select>
  69. </el-form-item>
  70. <el-form-item label="创建时间" prop="createTime">
  71. <el-date-picker v-model="createTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="change"></el-date-picker>
  72. </el-form-item>
  73. <el-table-column label="完课时间" align="center" prop="finishTime" />
  74. <el-table-column label="营期时间" align="center" prop="campPeriodTime" />
  75. <el-form-item>
  76. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  77. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  78. </el-form-item>
  79. </el-form>
  80. <el-row :gutter="10" class="mb8">
  81. <el-col :span="1.5">
  82. <el-button
  83. type="warning"
  84. plain
  85. icon="el-icon-download"
  86. size="mini"
  87. :loading="exportLoading"
  88. @click="handleExport"
  89. v-hasPermi="['course:courseWatchLog:myExport']"
  90. >导出</el-button>
  91. </el-col>
  92. <el-col :span="1.5">
  93. <el-button
  94. type="primary"
  95. plain
  96. size="mini"
  97. @click="addUserTag"
  98. v-hasPermi="['qw:externalContact:addTag']"
  99. >批量添加标签</el-button>
  100. </el-col>
  101. <el-col :span="1.5">
  102. <el-button
  103. type="primary"
  104. plain
  105. size="mini"
  106. @click="delUserTag"
  107. v-hasPermi="['qw:externalContact:delTag']"
  108. >批量移除标签</el-button>
  109. </el-col>
  110. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  111. </el-row>
  112. <el-tabs type="card" v-model="queryParams.logType" @tab-click="handleClickX">
  113. <el-tab-pane label="全部" name="10"></el-tab-pane>
  114. <el-tab-pane v-for="(item,index) in logTypeOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
  115. </el-tabs>
  116. <el-table border v-loading="loading" :data="courseWatchLogList" @selection-change="handleSelectionChange">
  117. <el-table-column type="selection" width="55" align="center" />
  118. <el-table-column label="记录编号" align="center" prop="logId" />
  119. <el-table-column label="企微客户" align="center" prop="externalUserName"/>
  120. <el-table-column label="客户头像" align="center" prop="externalUserAvatar">
  121. <template slot-scope="scope">
  122. <el-popover
  123. placement="right"
  124. trigger="hover">
  125. <img slot="reference" :src="scope.row.externalUserAvatar" style="width: 40px;height: 40px">
  126. <img :src="scope.row.externalUserAvatar" style="max-width: 250px;max-height: 250px">
  127. </el-popover>
  128. </template>
  129. </el-table-column>
  130. <el-table-column label="会员ID" align="center" prop="userId" />
  131. <el-table-column label="会员昵称" align="center" prop="fsNickName">
  132. <template slot-scope="scope">
  133. <div style="display: flex;white-space: nowrap">
  134. <div style="margin: auto">
  135. {{scope.row.fsNickName}}
  136. </div>
  137. <el-popover
  138. placement="right"
  139. title=""
  140. trigger="hover">
  141. <img slot="reference" :src="scope.row.fsAvatar" style="width: 30px;height: 30px">
  142. <img :src="scope.row.fsAvatar" style="max-width: 200px;max-height: 200px">
  143. </el-popover>
  144. </div>
  145. </template>
  146. </el-table-column>
  147. <el-table-column label="课程名称" align="center" prop="courseName" />
  148. <el-table-column label="小节名称" align="center" prop="videoName" />
  149. <el-table-column label="记录类型" align="center" prop="logType">
  150. <template slot-scope="scope">
  151. <dict-tag :options="logTypeOptions" :value="scope.row.logType"/>
  152. </template>
  153. </el-table-column>
  154. <el-table-column label="播放时长" align="center" prop="duration" />
  155. <el-table-column label="所属销售" align="center" prop="companyUserName" />
  156. <el-table-column label="所属公司" align="center" prop="companyName" />
  157. <el-table-column label="企微员工名称" align="center" prop="qwUserName" />
  158. <el-table-column label="企微账号" align="center" prop="qwUserName" />
  159. <el-table-column label="所属发送方式" align="center" prop="sendType" />
  160. <el-table-column label="创建时间" align="center" prop="createTime" />
  161. <!-- <el-table-column label="更新时间" align="center" prop="updateTime" />-->
  162. <el-table-column label="完课时间" align="center" prop="lastHeartbeatTime" />
  163. </el-table>
  164. <pagination
  165. v-show="total>0"
  166. :total="total"
  167. :page.sync="queryParams.pageNum"
  168. :limit.sync="queryParams.pageSize"
  169. @pagination="getList"
  170. />
  171. <el-dialog title="批量添加标签" :visible.sync="tagOpen" width="800px" append-to-body>
  172. <div>搜索标签:
  173. <el-input v-model="tagChange.tagName" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
  174. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(tagChange.tagName)">搜索</el-button>
  175. <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
  176. </div>
  177. <el-form ref="form" :model="addTagFormByWatch" label-width="80px">
  178. <div v-for="item in tagGroupList" :key="item.id" >
  179. <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
  180. <span class="name-background">{{ item.name }}</span>
  181. </div>
  182. <!-- 添加外层滚动容器 -->
  183. <div class="scroll-wrapper">
  184. <div class="tag-container">
  185. <a
  186. v-for="tagItem in item.tag"
  187. class="tag-box"
  188. @click="tagSelection(tagItem)"
  189. :class="{ 'tag-selected': tagItem.isSelected }"
  190. >
  191. {{ tagItem.name }}
  192. </a>
  193. </div>
  194. </div>
  195. </div>
  196. </el-form>
  197. <pagination
  198. v-show="tagTotal>0"
  199. :total="tagTotal"
  200. :page.sync="queryTagParams.pageNum"
  201. :limit.sync="queryTagParams.pageSize"
  202. @pagination="getPageListTagGroup"
  203. />
  204. <div slot="footer" class="dialog-footer">
  205. <el-button type="primary" @click="addTagSubmitForm()">确 定</el-button>
  206. <el-button @click="addTagCancel">取 消</el-button>
  207. </div>
  208. </el-dialog>
  209. <el-dialog title="批量移除标签" :visible.sync="tagDelOpen" width="800px" append-to-body>
  210. <div>搜索标签:
  211. <el-input v-model="tagChange.tagName" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
  212. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(tagChange.tagName)">搜索</el-button>
  213. <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
  214. </div>
  215. <el-form ref="form" :model="addTagFormByWatch" label-width="80px">
  216. <div v-for="item in tagGroupList" :key="item.id" >
  217. <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
  218. <span class="name-background">{{ item.name }}</span>
  219. </div>
  220. <!-- 添加外层滚动容器 -->
  221. <div class="scroll-wrapper">
  222. <div class="tag-container">
  223. <a
  224. v-for="tagItem in item.tag"
  225. class="tag-box"
  226. @click="tagSelection(tagItem)"
  227. :class="{ 'tag-selected': tagItem.isSelected }"
  228. >
  229. {{ tagItem.name }}
  230. </a>
  231. </div>
  232. </div>
  233. </div>
  234. </el-form>
  235. <pagination
  236. v-show="tagTotal>0"
  237. :total="tagTotal"
  238. :page.sync="queryTagParams.pageNum"
  239. :limit.sync="queryTagParams.pageSize"
  240. @pagination="getPageListTagGroup"
  241. />
  242. <div slot="footer" class="dialog-footer">
  243. <el-button type="primary" @click="tagDelSubmitForm()">确 定</el-button>
  244. <el-button @click="DelTagCancel">取 消</el-button>
  245. </div>
  246. </el-dialog>
  247. <el-dialog
  248. :title="resultTitle"
  249. :visible.sync="resultDialogVisible"
  250. width="50%"
  251. custom-class="feedback-dialog"
  252. >
  253. <pre style="white-space: pre-wrap; font-family: inherit;">{{ resultMessage }}</pre>
  254. <span slot="footer" class="dialog-footer">
  255. <el-button @click="resultDialogVisible = false">关闭</el-button>
  256. </span>
  257. </el-dialog>
  258. </div>
  259. </template>
  260. <script>
  261. import { myListCourseWatchLog, getCourseWatchLog, delCourseWatchLog, addCourseWatchLog, updateCourseWatchLog, exportCourseWatchLog } from "@/api/course/courseWatchLog";
  262. import { courseList,videoList } from '@/api/course/courseRedPacketLog'
  263. import {getMyQwUserList} from "@/api/qw/user";
  264. import {allListTagGroup} from "../../../api/qw/tagGroup";
  265. import {searchTags} from "../../../api/qw/tag";
  266. import {addTagByWatch, delTagByWatch} from "../../../api/qw/externalContact";
  267. export default {
  268. name: "CourseWatchLog",
  269. data() {
  270. return {
  271. resultDialogVisible: false,
  272. resultMessage: '',
  273. resultTitle:'',
  274. createTime:null,
  275. courseLists:[],
  276. videoList:[],
  277. myQwUserList:[],
  278. logTypeOptions:[],
  279. // 遮罩层
  280. loading: true,
  281. // 导出遮罩层
  282. exportLoading: false,
  283. // 选中数组
  284. ids: [],
  285. // 非单个禁用
  286. single: true,
  287. // 非多个禁用
  288. multiple: true,
  289. // 显示搜索条件
  290. showSearch: true,
  291. // 总条数
  292. total: 0,
  293. // 短链课程看课记录表格数据
  294. courseWatchLogList: [],
  295. // 弹出层标题
  296. title: "",
  297. // 是否显示弹出层
  298. open: false,
  299. tagOpen:false,
  300. //标签弹窗选择
  301. tagChange:{
  302. open:false,
  303. index:null,
  304. },
  305. addTagFormByWatch:{
  306. logId:[],
  307. tagIds:[]
  308. },
  309. tagGroupList: [],
  310. tagTotal:0,
  311. tagDelOpen:false,
  312. queryTagParams:{
  313. pageNum: 1,
  314. pageSize: 5,
  315. total:0,
  316. name:null,
  317. corpId:null,
  318. },
  319. // 查询参数
  320. queryParams: {
  321. pageNum: 1,
  322. pageSize: 10,
  323. userId: null,
  324. videoId: null,
  325. nickName:null,
  326. logType: "10",
  327. qwExternalContactId: null,
  328. externalUserName:null,
  329. duration: null,
  330. qwUserId: null,
  331. companyUserId: null,
  332. companyId: null,
  333. courseId: null,
  334. sTime:null,
  335. eTime:null,
  336. scheduleStartTime: null,
  337. scheduleEndTime: null,
  338. },
  339. // 表单参数
  340. form: {},
  341. // 表单校验
  342. rules: {
  343. }
  344. };
  345. },
  346. created() {
  347. courseList().then(response => {
  348. this.courseLists = response.list;
  349. });
  350. this.getList();
  351. this.getDicts("sys_course_watch_log_type").then(response => {
  352. this.logTypeOptions = response.data;
  353. });
  354. getMyQwUserList().then(response => {
  355. this.myQwUserList = response.data;
  356. });
  357. },
  358. methods: {
  359. courseChange(row){
  360. this.queryParams.videoId=null;
  361. if(row === ''){
  362. this.videoList=[];
  363. return
  364. }
  365. videoList(row).then(response => {
  366. this.videoList=response.list
  367. });
  368. },
  369. updateQwuser(){
  370. for (const user of this.myQwUserList) {
  371. if (user.dictValue == this.queryParams.qwUserId) {
  372. this.queryParams.corpId=user.corpId;
  373. break;
  374. }
  375. }
  376. this.getList();
  377. },
  378. change() {
  379. if (this.createTime != null) {
  380. this.queryParams.sTime = this.createTime[0];
  381. this.queryParams.eTime = this.createTime[1];
  382. } else {
  383. this.queryParams.sTime = null;
  384. this.queryParams.eTime = null;
  385. }
  386. },
  387. handleClickX(tab){
  388. if(tab.name==="10"){
  389. this.queryParams.logType=null;
  390. }else{
  391. this.queryParams.logType=tab.name;
  392. }
  393. this.getList()
  394. },
  395. /** 查询短链课程看课记录列表 */
  396. getList() {
  397. this.loading = true;
  398. myListCourseWatchLog(this.queryParams).then(response => {
  399. this.courseWatchLogList = response.rows;
  400. this.total = response.total;
  401. this.loading = false;
  402. });
  403. },
  404. // 取消按钮
  405. cancel() {
  406. this.open = false;
  407. this.reset();
  408. },
  409. // 表单重置
  410. reset() {
  411. this.form = {
  412. logId: null,
  413. userId: null,
  414. videoId: null,
  415. logType: null,
  416. createTime: null,
  417. updateTime: null,
  418. qwExternalContactId: null,
  419. externalUserName:null,
  420. duration: null,
  421. qwUserId: null,
  422. companyUserId: null,
  423. companyId: null,
  424. courseId: null,
  425. scheduleStartTime: null,
  426. scheduleEndTime: null,
  427. };
  428. this.scheduleTime=null;
  429. this.resetForm("form");
  430. },
  431. /** 搜索按钮操作 */
  432. handleQuery() {
  433. this.queryParams.pageNum = 1;
  434. this.getList();
  435. },
  436. /** 重置按钮操作 */
  437. resetQuery() {
  438. this.resetForm("queryForm");
  439. this.createTime = null;
  440. this.queryParams.sTime = null;
  441. this.queryParams.eTime = null;
  442. this.queryParams.scheduleStartTime = null;
  443. this.queryParams.scheduleEndTime = null;
  444. this.scheduleTime=null;
  445. this.handleQuery();
  446. },
  447. // 多选框选中数据
  448. handleSelectionChange(selection) {
  449. this.ids = selection.map(item => item.logId)
  450. this.single = selection.length!==1
  451. this.multiple = !selection.length
  452. },
  453. /** 新增按钮操作 */
  454. handleAdd() {
  455. this.reset();
  456. this.open = true;
  457. this.title = "添加短链课程看课记录";
  458. },
  459. /** 修改按钮操作 */
  460. handleUpdate(row) {
  461. this.reset();
  462. const logId = row.logId || this.ids
  463. getCourseWatchLog(logId).then(response => {
  464. this.form = response.data;
  465. this.open = true;
  466. this.title = "修改短链课程看课记录";
  467. });
  468. },
  469. /** 提交按钮 */
  470. submitForm() {
  471. this.$refs["form"].validate(valid => {
  472. if (valid) {
  473. if (this.form.logId != null) {
  474. updateCourseWatchLog(this.form).then(response => {
  475. this.msgSuccess("修改成功");
  476. this.open = false;
  477. this.getList();
  478. });
  479. } else {
  480. addCourseWatchLog(this.form).then(response => {
  481. this.msgSuccess("新增成功");
  482. this.open = false;
  483. this.getList();
  484. });
  485. }
  486. }
  487. });
  488. },
  489. /** 删除按钮操作 */
  490. handleDelete(row) {
  491. const logIds = row.logId || this.ids;
  492. this.$confirm('是否确认删除短链课程看课记录编号为"' + logIds + '"的数据项?', "警告", {
  493. confirmButtonText: "确定",
  494. cancelButtonText: "取消",
  495. type: "warning"
  496. }).then(function() {
  497. return delCourseWatchLog(logIds);
  498. }).then(() => {
  499. this.getList();
  500. this.msgSuccess("删除成功");
  501. }).catch(() => {});
  502. },
  503. /** 导出按钮操作 */
  504. handleExport() {
  505. const queryParams = this.queryParams;
  506. this.$confirm('是否确认导出所有短链课程看课记录数据项?', "警告", {
  507. confirmButtonText: "确定",
  508. cancelButtonText: "取消",
  509. type: "warning"
  510. }).then(() => {
  511. this.exportLoading = true;
  512. return exportCourseWatchLog(queryParams);
  513. }).then(response => {
  514. this.download(response.msg);
  515. this.exportLoading = false;
  516. }).catch(() => {});
  517. },
  518. addUserTag(){
  519. if(this.ids==null||this.ids==""){
  520. return this.$message('请选择需要添加标签的客户');
  521. }
  522. this.getPageListTagGroup();
  523. setTimeout(() => {
  524. for (let i = 0; i < this.tagGroupList.length; i++) {
  525. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  526. this.tagGroupList[i].tag[x].isSelected=false;
  527. }
  528. }
  529. }, 200);
  530. this.tagOpen = true;
  531. },
  532. delUserTag(){
  533. if(this.ids==null||this.ids==""){
  534. return this.$message('请选择需要移除标签的客户');
  535. }
  536. this.getPageListTagGroup();
  537. setTimeout(() => {
  538. for (let i = 0; i < this.tagGroupList.length; i++) {
  539. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  540. this.tagGroupList[i].tag[x].isSelected=false;
  541. }
  542. }
  543. }, 200);
  544. this.tagDelOpen = true;
  545. },
  546. getPageListTagGroup(){
  547. this.queryTagParams.corpId=this.queryParams.corpId
  548. allListTagGroup(this.queryTagParams).then(response => {
  549. this.tagGroupList = response.rows;
  550. this.tagTotal = response.total;
  551. });
  552. },
  553. tagSelection(row){
  554. row.isSelected= !row.isSelected;
  555. this.$forceUpdate();
  556. },
  557. handleSearchTags(name){
  558. if (!name){
  559. return this.$message.error("请输入要搜索的标签")
  560. }
  561. this.queryTagParams.name=name;
  562. this.queryTagParams.corpId=this.queryParams.corpId;
  563. searchTags(this.queryTagParams).then(response => {
  564. this.tagGroupList = response.rows;
  565. });
  566. // searchTags({name:name,corpId:this.queryParams.corpId}).then(response => {
  567. // this.tagGroupList = response.rows;
  568. // });
  569. },
  570. cancelSearchTags(){
  571. this.resetSearchQueryTag()
  572. this.getPageListTagGroup();
  573. },
  574. resetSearchQueryTag(){
  575. this.queryTagParams= {
  576. pageNum: 1,
  577. pageSize: 5,
  578. total:0,
  579. name:null,
  580. };
  581. },
  582. addTagSubmitForm(){
  583. for (let i = 0; i < this.tagGroupList.length; i++) {
  584. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  585. if(this.tagGroupList[i].tag[x].isSelected==true){
  586. this.addTagFormByWatch.tagIds.push(this.tagGroupList[i].tag[x].tagId)
  587. }
  588. }
  589. }
  590. if(this.addTagFormByWatch.tagIds==[]||this.addTagFormByWatch.tagIds==null||this.addTagFormByWatch.tagIds==""){
  591. return this.$message('请选择标签');
  592. }
  593. this.addTagFormByWatch.logIds=this.ids;
  594. let loadingRock = this.$loading({
  595. lock: true,
  596. text: '正在执行中请稍后~~请不要刷新页面!!',
  597. spinner: 'el-icon-loading',
  598. background: 'rgba(0, 0, 0, 0.7)'
  599. });
  600. addTagByWatch(this.addTagFormByWatch).then(response => {
  601. // this.msgSuccess(response.msg);
  602. this.resultMessage = response.msg;
  603. this.resultDialogVisible = true; // 显示弹窗
  604. this.resultTitle = '批量添加标签结果';
  605. this.tagOpen = false;
  606. loadingRock.close();
  607. this.addTagFormByWatch={
  608. logIds:[],
  609. tagIds:[]
  610. };
  611. this.getList()
  612. }).finally(res=>{
  613. loadingRock.close();
  614. });
  615. },
  616. tagDelSubmitForm(){
  617. for (let i = 0; i < this.tagGroupList.length; i++) {
  618. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  619. if(this.tagGroupList[i].tag[x].isSelected==true){
  620. this.addTagFormByWatch.tagIds.push(this.tagGroupList[i].tag[x].tagId)
  621. }
  622. }
  623. }
  624. if(this.addTagFormByWatch.tagIds==[]||this.addTagFormByWatch.tagIds==null||this.addTagFormByWatch.tagIds==""){
  625. return this.$message('请选择标签');
  626. }
  627. this.addTagFormByWatch.corpId=this.queryParams.corpId
  628. this.addTagFormByWatch.logIds=this.ids;
  629. let loadingRock = this.$loading({
  630. lock: true,
  631. text: '正在执行中请稍后~~请不要刷新页面!!',
  632. spinner: 'el-icon-loading',
  633. background: 'rgba(0, 0, 0, 0.7)'
  634. });
  635. delTagByWatch(this.addTagFormByWatch).then(response => {
  636. // this.msgSuccess(response.msg);
  637. this.resultMessage = response.msg;
  638. this.resultDialogVisible = true; // 显示弹窗
  639. this.resultTitle = '批量移除标签结果';
  640. this.tagDelOpen = false;
  641. loadingRock.close();
  642. this.addTagFormByWatch={
  643. userIds:[],
  644. tagIds:[]
  645. };
  646. this.getList()
  647. }).finally(res=>{
  648. loadingRock.close();
  649. });
  650. },
  651. addTagCancel() {
  652. this.tagOpen = false;
  653. this.addTagFormByWatch={
  654. logIds:[],
  655. tagIds:[]
  656. };
  657. },
  658. DelTagCancel() {
  659. this.tagDelOpen = false;
  660. this.addTagFormByWatch={
  661. logIds:[],
  662. tagIds:[]
  663. };
  664. },
  665. }
  666. };
  667. </script>
  668. <style scoped>
  669. /* CSS 样式 */
  670. .tag-container {
  671. display: flex;
  672. flex-wrap: wrap; /* 超出宽度时自动换行 */
  673. gap: 8px; /* 设置标签之间的间距 */
  674. }
  675. .name-background {
  676. display: inline-block;
  677. background-color: #abece6; /* 背景颜色 */
  678. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  679. border-radius: 4px; /* 可选:设置圆角 */
  680. }
  681. /* CSS 样式 */
  682. .tag-container {
  683. display: flex;
  684. flex-wrap: wrap; /* 超出宽度时自动换行 */
  685. gap: 8px; /* 设置标签之间的间距 */
  686. }
  687. .name-background {
  688. display: inline-block;
  689. background-color: #abece6; /* 背景颜色 */
  690. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  691. border-radius: 4px; /* 可选:设置圆角 */
  692. }
  693. .tag-box {
  694. padding: 8px 12px;
  695. border: 1px solid #989797;
  696. border-radius: 4px;
  697. cursor: pointer;
  698. display: inline-block;
  699. }
  700. .tag-selected {
  701. background-color: #00bc98;
  702. color: #fff;
  703. border-color: #00bc98;
  704. }
  705. .el-tag + .el-tag {
  706. margin-left: 10px;
  707. }
  708. .button-new-tag {
  709. margin-left: 10px;
  710. height: 32px;
  711. line-height: 30px;
  712. padding-top: 0;
  713. padding-bottom: 0;
  714. }
  715. .input-new-tag {
  716. width: 90px;
  717. margin-left: 10px;
  718. vertical-align: bottom;
  719. }
  720. /* 新增的滚动容器样式(不影响原有样式) */
  721. .scroll-wrapper {
  722. max-height: 130px; /* 大约三行的高度 */
  723. overflow-y: auto; /* 垂直滚动 */
  724. padding-right: 5px; /* 为滚动条留出空间 */
  725. }
  726. /* 美化滚动条(可选) */
  727. .scroll-wrapper::-webkit-scrollbar {
  728. width: 6px;
  729. }
  730. .scroll-wrapper::-webkit-scrollbar-thumb {
  731. background: rgba(0, 0, 0, 0.2);
  732. border-radius: 3px;
  733. }
  734. </style>