myCourseWatchLog.vue 25 KB

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