index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="148px">
  4. <el-form-item label="外部联系人名称" prop="extName">
  5. <el-input
  6. v-model="queryParams.extName"
  7. placeholder="请输入外部联系人名称"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="企微用户名称" prop="qwUserName">
  14. <el-input
  15. v-model="queryParams.qwUserName"
  16. placeholder="请输入企微用户名称"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <!-- <el-form-item label="标题" prop="title">
  23. <el-input
  24. v-model="queryParams.title"
  25. placeholder="请输入标题"
  26. clearable
  27. size="small"
  28. @keyup.enter.native="handleQuery"
  29. />
  30. </el-form-item>-->
  31. <el-form-item label="通话状态" prop="status">
  32. <el-select v-model="queryParams.status" placeholder="请选择通话状态" clearable size="small">
  33. <el-option
  34. v-for="dict in statusOptions"
  35. :key="dict.dictValue"
  36. :label="dict.dictLabel"
  37. :value="dict.dictValue"
  38. />
  39. </el-select>
  40. </el-form-item>
  41. <!-- <el-form-item label="企微id" prop="corpId">
  42. <el-input
  43. v-model="queryParams.corpId"
  44. placeholder="请输入企微id"
  45. clearable
  46. size="small"
  47. @keyup.enter.native="handleQuery"
  48. />
  49. </el-form-item>-->
  50. <el-form-item label="公司名称" prop="companyName">
  51. <el-input
  52. v-model="queryParams.companyName"
  53. placeholder="请输入公司名称"
  54. clearable
  55. size="small"
  56. @keyup.enter.native="handleQuery"
  57. />
  58. </el-form-item>
  59. <el-form-item label="销售用户名称" prop="companyUserName">
  60. <el-input
  61. v-model="queryParams.companyUserName"
  62. placeholder="请输入销售用户名称"
  63. clearable
  64. size="small"
  65. @keyup.enter.native="handleQuery"
  66. />
  67. </el-form-item>
  68. <!-- <el-form-item label="时长秒" prop="duration">
  69. <el-input
  70. v-model="queryParams.duration"
  71. placeholder="请输入时长秒"
  72. clearable
  73. size="small"
  74. @keyup.enter.native="handleQuery"
  75. />
  76. </el-form-item>-->
  77. <el-form-item label="标签" prop="tagIds">
  78. <div @click="hangleChangeTags()" style="cursor: pointer; border: 1px solid #e6e6e6; background-color: white; overflow: hidden; flex-grow: 1;width: 250px">
  79. <div style="min-height: 35px; max-height: 200px; overflow-y: auto;" :key="selectTags.length">
  80. <el-tag type="success"
  81. closable
  82. :disable-transitions="false"
  83. v-for="list in this.selectTags"
  84. :key="list.tagId"
  85. @close="handleCloseTags(list)"
  86. style="margin: 3px;"
  87. >{{list.name}}
  88. </el-tag>
  89. </div>
  90. </div>
  91. </el-form-item>
  92. <el-form-item label="创建时间" prop="createTime">
  93. <el-date-picker v-model="createTime" size="small" style="width: 215px"
  94. value-format="yyyy-MM-dd" type="daterange" range-separator="-"
  95. start-placeholder="开始日期" end-placeholder="结束日期"
  96. @change="changeTime"></el-date-picker>
  97. </el-form-item>
  98. <el-form-item>
  99. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  100. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  101. </el-form-item>
  102. </el-form>
  103. <el-row :gutter="10" class="mb8">
  104. <!-- <el-col :span="1.5">
  105. <el-button
  106. type="primary"
  107. plain
  108. icon="el-icon-plus"
  109. size="mini"
  110. @click="handleAdd"
  111. v-hasPermi="['qw:qwUserVoiceLog:add']"
  112. >新增</el-button>
  113. </el-col>
  114. <el-col :span="1.5">
  115. <el-button
  116. type="success"
  117. plain
  118. icon="el-icon-edit"
  119. size="mini"
  120. :disabled="single"
  121. @click="handleUpdate"
  122. v-hasPermi="['qw:qwUserVoiceLog:edit']"
  123. >修改</el-button>
  124. </el-col>
  125. <el-col :span="1.5">
  126. <el-button
  127. type="danger"
  128. plain
  129. icon="el-icon-delete"
  130. size="mini"
  131. :disabled="multiple"
  132. @click="handleDelete"
  133. v-hasPermi="['qw:qwUserVoiceLog:remove']"
  134. >删除</el-button>
  135. </el-col>-->
  136. <el-col :span="1.5">
  137. <el-button
  138. type="warning"
  139. plain
  140. icon="el-icon-download"
  141. size="mini"
  142. :loading="exportLoading"
  143. @click="handleExport"
  144. v-hasPermi="['qw:qwUserVoiceLog:export']"
  145. >导出</el-button>
  146. </el-col>
  147. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  148. </el-row>
  149. <el-table border v-loading="loading" :data="qwUserVoiceLogList" @selection-change="handleSelectionChange">
  150. <el-table-column type="selection" width="55" align="center" />
  151. <el-table-column label="id" align="center" width="80" prop="id" />
  152. <el-table-column label="外部联系人名称" align="center" prop="qwExternalContact.name" />
  153. <el-table-column label="企微用户名称" align="center" prop="qwUser.qwUserName" />
  154. <el-table-column label="时长秒" align="center" prop="duration" />
  155. <el-table-column label="标题" align="center" width="80" prop="title" />
  156. <el-table-column label="通话状态" align="center" prop="status">
  157. <template slot-scope="scope">
  158. <dict-tag :options="statusOptions" :value="scope.row.status"/>
  159. </template>
  160. </el-table-column>
  161. <el-table-column label="标签" align="center" prop="tagIdsName" width="250px">
  162. <template slot-scope="scope">
  163. <div v-for="name in scope.row.tagIdsName" style="display: inline;">
  164. <el-tag type="success">{{ name }}</el-tag>
  165. </div>
  166. </template>
  167. </el-table-column>
  168. <el-table-column label="企微id" align="center" width="80" prop="corpId" />
  169. <el-table-column label="公司名称" align="center" prop="company.companyName" />
  170. <el-table-column label="销售用户名称" align="center" prop="companyUser.userName" />
  171. <el-table-column label="创建时间" align="center" prop="createTime" />
  172. <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  173. <template slot-scope="scope">
  174. <el-button
  175. size="mini"
  176. type="text"
  177. icon="el-icon-edit"
  178. @click="handleUpdate(scope.row)"
  179. v-hasPermi="['qw:qwUserVoiceLog:edit']"
  180. >修改</el-button>
  181. <el-button
  182. size="mini"
  183. type="text"
  184. icon="el-icon-delete"
  185. @click="handleDelete(scope.row)"
  186. v-hasPermi="['qw:qwUserVoiceLog:remove']"
  187. >删除</el-button>
  188. </template>
  189. </el-table-column>-->
  190. </el-table>
  191. <pagination
  192. v-show="total>0"
  193. :total="total"
  194. :page.sync="queryParams.pageNum"
  195. :limit.sync="queryParams.pageSize"
  196. @pagination="getList"
  197. />
  198. <!-- 搜索标签 -->
  199. <el-dialog :title="changeTagDialog.title" :visible.sync="changeTagDialog.open" width="1000px" append-to-body>
  200. <div>搜索标签:
  201. <el-input v-model="queryTagParams.name" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
  202. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(queryTagParams.name)">搜索</el-button>
  203. <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
  204. </div>
  205. <div v-for="item in tagGroupList" :key="item.id" >
  206. <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
  207. <span class="name-background">{{ item.name }}</span>
  208. </div>
  209. <!-- 添加外层滚动容器 -->
  210. <div class="scroll-wrapper">
  211. <div class="tag-container">
  212. <a
  213. v-for="tagItem in item.tag"
  214. class="tag-box"
  215. @click="tagSelection(tagItem)"
  216. :class="{ 'tag-selected': tagItem.isSelected }"
  217. >
  218. {{ tagItem.name }}
  219. </a>
  220. </div>
  221. </div>
  222. </div>
  223. <pagination
  224. v-show="tagTotal>0"
  225. :total="tagTotal"
  226. :page.sync="queryTagParams.pageNum"
  227. :limit.sync="queryTagParams.pageSize"
  228. @pagination="getPageListTagGroup"
  229. />
  230. <div slot="footer" class="dialog-footer">
  231. <el-button type="primary" @click="tagSubmitForm()">确 定</el-button>
  232. <el-button @click="tagCancel()">取消</el-button>
  233. </div>
  234. </el-dialog>
  235. <!-- 添加或修改企微用户通话记录对话框 -->
  236. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  237. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  238. <el-form-item label="外部联系人id" prop="extId">
  239. <el-input v-model="form.extId" placeholder="请输入外部联系人id" />
  240. </el-form-item>
  241. <el-form-item label="企微用户id" prop="qwUserId">
  242. <el-input v-model="form.qwUserId" placeholder="请输入企微用户id" />
  243. </el-form-item>
  244. <el-form-item label="时长秒" prop="duration">
  245. <el-input v-model="form.duration" placeholder="请输入时长秒" />
  246. </el-form-item>
  247. <el-form-item label="标题" prop="title">
  248. <el-input v-model="form.title" placeholder="请输入标题" />
  249. </el-form-item>
  250. <el-form-item label="1接听 2未接">
  251. <el-radio-group v-model="form.status">
  252. <el-radio
  253. v-for="dict in statusOptions"
  254. :key="dict.dictValue"
  255. :label="parseInt(dict.dictValue)"
  256. >{{dict.dictLabel}}</el-radio>
  257. </el-radio-group>
  258. </el-form-item>
  259. <el-form-item label="企微id" prop="corpId">
  260. <el-input v-model="form.corpId" placeholder="请输入企微id" />
  261. </el-form-item>
  262. <el-form-item label="公司id" prop="companyId">
  263. <el-input v-model="form.companyId" placeholder="请输入公司id" />
  264. </el-form-item>
  265. <el-form-item label="销售用户id" prop="companyUserId">
  266. <el-input v-model="form.companyUserId" placeholder="请输入销售用户id" />
  267. </el-form-item>
  268. </el-form>
  269. <div slot="footer" class="dialog-footer">
  270. <el-button type="primary" @click="submitForm">确 定</el-button>
  271. <el-button @click="cancel">取 消</el-button>
  272. </div>
  273. </el-dialog>
  274. </div>
  275. </template>
  276. <script>
  277. import { listQwUserVoiceLog, getQwUserVoiceLog, delQwUserVoiceLog, addQwUserVoiceLog, updateQwUserVoiceLog, exportQwUserVoiceLog } from "@/api/qw/qwUserVoiceLog";
  278. import {allListTagGroup} from "@/api/qw/tagGroup";
  279. import {searchTags} from "@/api/qw/tag";
  280. export default {
  281. name: "QwUserVoiceLog",
  282. data() {
  283. return {
  284. // 遮罩层
  285. loading: true,
  286. // 导出遮罩层
  287. exportLoading: false,
  288. // 选中数组
  289. ids: [],
  290. // 非单个禁用
  291. single: true,
  292. // 非多个禁用
  293. multiple: true,
  294. // 显示搜索条件
  295. showSearch: true,
  296. //时间范围
  297. createTime:null,
  298. beginTime:null,
  299. endTime:null,
  300. // 总条数
  301. total: 0,
  302. // 企微用户通话记录表格数据
  303. qwUserVoiceLogList: [],
  304. selectTags:[],
  305. queryTagParams:{
  306. pageNum: 1,
  307. pageSize: 5,
  308. total:0,
  309. name:null,
  310. corpId:null,
  311. },
  312. //标签
  313. changeTagDialog:{
  314. title:"",
  315. open:false,
  316. },
  317. tagTotal:0,
  318. tagGroupList: [],
  319. addTagForm:{
  320. userIds:[],
  321. tagIds:[]
  322. },
  323. // 弹出层标题
  324. title: "",
  325. // 是否显示弹出层
  326. open: false,
  327. // 1接听 2未接字典
  328. statusOptions: [],
  329. // 查询参数
  330. queryParams: {
  331. pageNum: 1,
  332. pageSize: 10,
  333. extId: null,
  334. extName:null,
  335. qwUserId: null,
  336. qwUserName: null,
  337. duration: null,
  338. title: null,
  339. status: null,
  340. corpId: null,
  341. companyId: null,
  342. companyName: null,
  343. companyUserId: null,
  344. companyUserName: null,
  345. createTime:null,
  346. beginTime:null,
  347. endTime:null,
  348. tagIds: null,
  349. },
  350. // 表单参数
  351. form: {},
  352. // 表单校验
  353. rules: {
  354. }
  355. };
  356. },
  357. created() {
  358. this.getList();
  359. this.getDicts("sys_qw_user_voice_status").then(response => {
  360. this.statusOptions = response.data;
  361. });
  362. },
  363. methods: {
  364. tagSubmitForm(){
  365. for (let i = 0; i < this.tagGroupList.length; i++) {
  366. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  367. if (this.tagGroupList[i].tag[x].isSelected === true) {
  368. if (!this.selectTags) {
  369. this.selectTags = [];
  370. }
  371. // 检查当前 tag 是否已经存在于 tagListFormIndex[index] 中
  372. let tagExists = this.selectTags.some(
  373. tag => tag.id === this.tagGroupList[i].tag[x].id
  374. );
  375. // 如果 tag 不存在于 tagListFormIndex[index] 中,则新增
  376. if (!tagExists) {
  377. this.selectTags.push(this.tagGroupList[i].tag[x]);
  378. }
  379. }
  380. }
  381. }
  382. if (!this.selectTags || this.selectTags.length === 0) {
  383. return this.$message('请选择标签');
  384. }
  385. this.changeTagDialog.open = false;
  386. },
  387. //取消选择标签
  388. tagCancel(){
  389. this.changeTagDialog.open = false;
  390. },
  391. tagSelection(row){
  392. row.isSelected= !row.isSelected;
  393. this.$forceUpdate();
  394. },
  395. handleSearchTags(name){
  396. if (!name){
  397. return this.$message.error("请输入要搜索的标签")
  398. }
  399. this.queryTagParams.name=name;
  400. this.queryTagParams.corpId=this.queryParams.corpId;
  401. searchTags(this.queryTagParams).then(response => {
  402. this.tagGroupList = response.rows;
  403. });
  404. // searchTags({name:name,corpId:this.queryParams.corpId}).then(response => {
  405. // this.tagGroupList = response.rows;
  406. // });
  407. },
  408. cancelSearchTags(){
  409. this.resetSearchQueryTag()
  410. this.getPageListTagGroup();
  411. },
  412. //删除一些选择的标签
  413. handleCloseTags(list){
  414. const ls = this.selectTags.findIndex(t => t.tagId === list.tagId);
  415. if (ls !== -1) {
  416. this.selectTags.splice(ls, 1);
  417. this.selectTags = [...this.selectTags];
  418. }
  419. if (this.selectTags!=null && this.selectTags.length>0){
  420. // 确保 this.form.tags 是数组
  421. if (!this.queryParams.tagIds) {
  422. this.queryParams.tagIds = []; // 如果未定义,初始化
  423. } else {
  424. this.queryParams.tagIds = []; // 清空已有数据
  425. }
  426. // 遍历并添加 tagId
  427. this.selectTags.forEach(tag => {
  428. if (tag.tagId) { // 确保 tagId 存在
  429. this.queryParams.tagIds.push(tag.tagId);
  430. }
  431. });
  432. console.log(this.queryParams.tagIds)
  433. this.queryParams.tagIds=this.queryParams.tagIds.join(",");
  434. }else {
  435. this.queryParams.tagIds=null;
  436. }
  437. },
  438. getPageListTagGroup(){
  439. this.queryTagParams.corpId=this.queryParams.corpId
  440. allListTagGroup(this.queryTagParams).then(response => {
  441. this.tagGroupList = response.rows;
  442. this.tagTotal = response.total;
  443. });
  444. },
  445. //搜索的标签
  446. hangleChangeTags(){
  447. this.changeTagDialog.title="搜索的标签"
  448. this.changeTagDialog.open=true;
  449. // 获取 tagListFormIndex 中的所有 tagId,用于快速查找
  450. const selectedTagIds = new Set(
  451. (this.selectTags || []).map(tagItem => tagItem?.tagId)
  452. );
  453. this.queryTagParams.name=null;
  454. this.getPageListTagGroup();
  455. setTimeout(() => {
  456. for (let i = 0; i < this.tagGroupList.length; i++) {
  457. for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
  458. this.tagGroupList[i].tag[x].isSelected = selectedTagIds.has(this.tagGroupList[i].tag[x].tagId);
  459. }
  460. }
  461. }, 200);
  462. },
  463. /** 查询企微用户通话记录列表 */
  464. getList() {
  465. this.loading = true;
  466. const { qwUserName, ...queryParams } = this.queryParams;
  467. listQwUserVoiceLog(queryParams).then(response => {
  468. this.qwUserVoiceLogList = response.rows;
  469. this.total = response.total;
  470. this.loading = false;
  471. });
  472. },
  473. changeTime(){
  474. if(this.createTime!=null){
  475. this.queryParams.beginTime=this.createTime[0];
  476. this.queryParams.endTime=this.createTime[1];
  477. }else{
  478. this.queryParams.beginTime=null;
  479. this.queryParams.endTime=null;
  480. }
  481. },
  482. // 取消按钮
  483. cancel() {
  484. this.open = false;
  485. this.reset();
  486. },
  487. // 表单重置
  488. reset() {
  489. this.form = {
  490. id: null,
  491. extId: null,
  492. qwUserId: null,
  493. duration: null,
  494. title: null,
  495. status: 0,
  496. corpId: null,
  497. companyId: null,
  498. companyUserId: null,
  499. createTime:null,
  500. beginTime:null,
  501. endTime:null,
  502. };
  503. this.resetForm("form");
  504. },
  505. /** 搜索按钮操作 */
  506. handleQuery() {
  507. if (this.selectTags!=null && this.selectTags.length>0){
  508. // 确保 this.form.tags 是数组
  509. if (!this.queryParams.tagIds) {
  510. this.queryParams.tagIds = []; // 如果未定义,初始化
  511. } else {
  512. this.queryParams.tagIds = []; // 清空已有数据
  513. }
  514. // 遍历并添加 tagId
  515. this.selectTags.forEach(tag => {
  516. if (tag.tagId) { // 确保 tagId 存在
  517. this.queryParams.tagIds.push(tag.tagId);
  518. }
  519. });
  520. //this.queryParams.tagIds=this.queryParams.tagIds.join(",");
  521. }else {
  522. this.queryParams.tagIds=null;
  523. }
  524. this.queryParams.pageNum = 1;
  525. this.getList();
  526. },
  527. /** 重置按钮操作 */
  528. resetQuery() {
  529. this.resetForm("queryForm");
  530. if (this.myQwCompanyList && this.myQwCompanyList.length > 0) {
  531. this.queryParams.corpId = this.myQwCompanyList[0].dictValue;
  532. } else {
  533. this.queryParams.corpId = null; // 或设置默认值
  534. }
  535. this.selectTags=[];
  536. this.createTime=null;
  537. this.queryParams.sTime=null;
  538. this.queryParams.eTime=null;
  539. this.queryParams.tagIds=null;
  540. this.$forceUpdate();
  541. this.handleQuery();
  542. },
  543. // 多选框选中数据
  544. handleSelectionChange(selection) {
  545. this.ids = selection.map(item => item.id)
  546. this.single = selection.length!==1
  547. this.multiple = !selection.length
  548. },
  549. /** 新增按钮操作 */
  550. handleAdd() {
  551. this.reset();
  552. this.open = true;
  553. this.title = "添加企微用户通话记录";
  554. },
  555. /** 修改按钮操作 */
  556. handleUpdate(row) {
  557. this.reset();
  558. const id = row.id || this.ids
  559. getQwUserVoiceLog(id).then(response => {
  560. this.form = response.data;
  561. this.open = true;
  562. this.title = "修改企微用户通话记录";
  563. });
  564. },
  565. /** 提交按钮 */
  566. submitForm() {
  567. this.$refs["form"].validate(valid => {
  568. if (valid) {
  569. if (this.form.id != null) {
  570. updateQwUserVoiceLog(this.form).then(response => {
  571. this.msgSuccess("修改成功");
  572. this.open = false;
  573. this.getList();
  574. });
  575. } else {
  576. addQwUserVoiceLog(this.form).then(response => {
  577. this.msgSuccess("新增成功");
  578. this.open = false;
  579. this.getList();
  580. });
  581. }
  582. }
  583. });
  584. },
  585. /** 删除按钮操作 */
  586. handleDelete(row) {
  587. const ids = row.id || this.ids;
  588. this.$confirm('是否确认删除企微用户通话记录编号为"' + ids + '"的数据项?', "警告", {
  589. confirmButtonText: "确定",
  590. cancelButtonText: "取消",
  591. type: "warning"
  592. }).then(function() {
  593. return delQwUserVoiceLog(ids);
  594. }).then(() => {
  595. this.getList();
  596. this.msgSuccess("删除成功");
  597. }).catch(() => {});
  598. },
  599. /** 导出按钮操作 */
  600. handleExport() {
  601. const queryParams = this.queryParams;
  602. this.$confirm('是否确认导出所有企微用户通话记录数据项?', "警告", {
  603. confirmButtonText: "确定",
  604. cancelButtonText: "取消",
  605. type: "warning"
  606. }).then(() => {
  607. this.exportLoading = true;
  608. return exportQwUserVoiceLog(queryParams);
  609. }).then(response => {
  610. this.download(response.msg);
  611. this.exportLoading = false;
  612. }).catch(() => {});
  613. }
  614. }
  615. };
  616. </script>
  617. <style scoped>
  618. /* CSS 样式 */
  619. .tag-container {
  620. display: flex;
  621. flex-wrap: wrap; /* 超出宽度时自动换行 */
  622. gap: 8px; /* 设置标签之间的间距 */
  623. }
  624. .name-background {
  625. display: inline-block;
  626. background-color: #abece6; /* 背景颜色 */
  627. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  628. border-radius: 4px; /* 可选:设置圆角 */
  629. }
  630. /* CSS 样式 */
  631. .tag-container {
  632. display: flex;
  633. flex-wrap: wrap; /* 超出宽度时自动换行 */
  634. gap: 8px; /* 设置标签之间的间距 */
  635. }
  636. .name-background {
  637. display: inline-block;
  638. background-color: #abece6; /* 背景颜色 */
  639. padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
  640. border-radius: 4px; /* 可选:设置圆角 */
  641. }
  642. .tag-box {
  643. padding: 8px 12px;
  644. border: 1px solid #989797;
  645. border-radius: 4px;
  646. cursor: pointer;
  647. display: inline-block;
  648. }
  649. .tag-selected {
  650. background-color: #00bc98;
  651. color: #fff;
  652. border-color: #00bc98;
  653. }
  654. .el-tag + .el-tag {
  655. margin-left: 10px;
  656. }
  657. .suggestion-box {
  658. position: absolute;
  659. z-index: 999;
  660. background: #fff;
  661. border: 1px solid #ddd;
  662. max-height: 200px;
  663. overflow-y: auto;
  664. width: 100%;
  665. }
  666. .suggestion-item {
  667. padding: 10px;
  668. cursor: pointer;
  669. }
  670. .suggestion-item:hover {
  671. background-color: #f5f7fa;
  672. }
  673. .button-new-tag {
  674. margin-left: 10px;
  675. height: 32px;
  676. line-height: 30px;
  677. padding-top: 0;
  678. padding-bottom: 0;
  679. }
  680. .input-new-tag {
  681. width: 90px;
  682. margin-left: 10px;
  683. vertical-align: bottom;
  684. }
  685. .feedback-dialog {
  686. width: 100%;
  687. max-width: 1000px;
  688. max-height: 80vh; /* 限制最大高度为视窗高度的 80% */
  689. overflow-y: auto; /* 超出时显示垂直滚动条 */
  690. padding: 20px;
  691. box-sizing: border-box; /* 确保 padding 不影响总宽度 */
  692. }
  693. /* 新增的滚动容器样式(不影响原有样式) */
  694. .scroll-wrapper {
  695. max-height: 130px; /* 大约三行的高度 */
  696. overflow-y: auto; /* 垂直滚动 */
  697. padding-right: 5px; /* 为滚动条留出空间 */
  698. }
  699. /* 美化滚动条(可选) */
  700. .scroll-wrapper::-webkit-scrollbar {
  701. width: 6px;
  702. }
  703. .scroll-wrapper::-webkit-scrollbar-thumb {
  704. background: rgba(0, 0, 0, 0.2);
  705. border-radius: 3px;
  706. }
  707. </style>