|
|
@@ -165,14 +165,6 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="标签" prop="tagIds">
|
|
|
-<!-- <el-select v-model="selectTags" remote multiple placeholder="请选择" filterable style="width: 100%;">-->
|
|
|
-<!-- <el-option-->
|
|
|
-<!-- v-for="dict in tagList"-->
|
|
|
-<!-- :label="dict.name"-->
|
|
|
-<!-- :value="dict.tagId">-->
|
|
|
-<!-- </el-option>-->
|
|
|
-<!-- </el-select>-->
|
|
|
-
|
|
|
<div @click="hangleChangeTags()" style="cursor: pointer; border: 1px solid #e6e6e6; background-color: white; overflow: hidden; flex-grow: 1;width: 250px">
|
|
|
<div style="min-height: 35px; max-height: 200px; overflow-y: auto;">
|
|
|
<el-tag type="success"
|
|
|
@@ -186,8 +178,23 @@
|
|
|
</el-tag>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
-
|
|
|
+ <el-form-item label="排除标签" prop="outTagIds">
|
|
|
+ <div @click="hangleChangeOutTags()"
|
|
|
+ style="cursor: pointer; border: 1px solid #e6e6e6; background-color: white; overflow: hidden; flex-grow: 1;width: 250px">
|
|
|
+ <div style="min-height: 35px; max-height: 200px; overflow-y: auto;">
|
|
|
+ <el-tag type="success"
|
|
|
+ closable
|
|
|
+ :disable-transitions="false"
|
|
|
+ v-for="list in this.outSelectTags"
|
|
|
+ :key="list.tagId"
|
|
|
+ @close="handleCloseOutTags(list)"
|
|
|
+ style="margin: 3px;"
|
|
|
+ >{{ list.name }}
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
<el-input
|
|
|
@@ -596,8 +603,8 @@
|
|
|
@pagination="getPageListTagGroup"
|
|
|
/>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="tagSubmitForm()">确 定</el-button>
|
|
|
- <el-button @click="tagCancel()">取消</el-button>
|
|
|
+ <el-button type="primary" @click="tagSubmitForm(changeTagDialog.type)">确 定</el-button>
|
|
|
+ <el-button @click="tagCancel(changeTagDialog.type)">取消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
@@ -1097,6 +1104,7 @@ export default {
|
|
|
changeTagDialog:{
|
|
|
title:"",
|
|
|
open:false,
|
|
|
+ type: null,
|
|
|
},
|
|
|
|
|
|
queryTagParams:{
|
|
|
@@ -1123,6 +1131,7 @@ export default {
|
|
|
gender: null,
|
|
|
description: null,
|
|
|
tagIds: null,
|
|
|
+ outTagIds: null,
|
|
|
remark:null,
|
|
|
remarkMobiles: null,
|
|
|
remarkCorpName: null,
|
|
|
@@ -1144,7 +1153,10 @@ export default {
|
|
|
companyUser:null,
|
|
|
userRepeat: null
|
|
|
},
|
|
|
+ //选择的标签
|
|
|
selectTags:[],
|
|
|
+ //排除的标签
|
|
|
+ outSelectTags:[],
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
tagList:[],
|
|
|
@@ -1499,6 +1511,7 @@ export default {
|
|
|
|
|
|
this.changeTagDialog.title="搜索的标签"
|
|
|
this.changeTagDialog.open=true;
|
|
|
+ this.changeTagDialog.type = 1;
|
|
|
|
|
|
// 获取 tagListFormIndex 中的所有 tagId,用于快速查找
|
|
|
const selectedTagIds = new Set(
|
|
|
@@ -1517,6 +1530,31 @@ export default {
|
|
|
}
|
|
|
}, 200);
|
|
|
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ //选择排除标签
|
|
|
+ hangleChangeOutTags() {
|
|
|
+ this.changeTagDialog.title="搜索的标签"
|
|
|
+ this.changeTagDialog.open=true;
|
|
|
+ this.changeTagDialog.type = 2;
|
|
|
+
|
|
|
+ // 获取 tagListFormIndex 中的所有 tagId,用于快速查找
|
|
|
+ const selectedTagIds = new Set(
|
|
|
+ (this.outSelectTags || []).map(tagItem => tagItem?.tagId)
|
|
|
+ );
|
|
|
+
|
|
|
+ this.queryTagParams.name=null;
|
|
|
+
|
|
|
+ this.getPageListTagGroup();
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ for (let i = 0; i < this.tagGroupList.length; i++) {
|
|
|
+ for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
|
|
|
+ this.tagGroupList[i].tag[x].isSelected = selectedTagIds.has(this.tagGroupList[i].tag[x].tagId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, 200);
|
|
|
|
|
|
},
|
|
|
|
|
|
@@ -1549,6 +1587,35 @@ export default {
|
|
|
|
|
|
},
|
|
|
|
|
|
+ //删除一些排除的标签
|
|
|
+ handleCloseOutTags(list){
|
|
|
+ const ls = this.outSelectTags.findIndex(t => t.tagId === list.tagId);
|
|
|
+ if (ls !== -1) {
|
|
|
+ this.outSelectTags.splice(ls, 1);
|
|
|
+ this.outSelectTags = [...this.selectTags];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.outSelectTags!=null && this.outSelectTags.length>0){
|
|
|
+ // 确保 this.form.tags 是数组
|
|
|
+ if (!this.queryParams.outTagIds) {
|
|
|
+ this.queryParams.outTagIds = []; // 如果未定义,初始化
|
|
|
+ } else {
|
|
|
+ this.queryParams.outTagIds = []; // 清空已有数据
|
|
|
+ }
|
|
|
+
|
|
|
+ // 遍历并添加 tagId
|
|
|
+ this.outSelectTags.forEach(tag => {
|
|
|
+ if (tag.tagId) { // 确保 tagId 存在
|
|
|
+ this.queryParams.outTagIds.push(tag.tagId);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.queryParams.outTagIds=this.queryParams.outTagIds.join(",");
|
|
|
+ }else {
|
|
|
+ this.queryParams.outTagIds=null;
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
//重新获取页面数据
|
|
|
refreshList(){
|
|
|
this.getList();
|
|
|
@@ -1740,6 +1807,25 @@ export default {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ if (this.outSelectTags!=null && this.outSelectTags.length>0){
|
|
|
+ // 确保 this.form.tags 是数组
|
|
|
+ if (!this.queryParams.outTagIds) {
|
|
|
+ this.queryParams.outTagIds = []; // 如果未定义,初始化
|
|
|
+ } else {
|
|
|
+ this.queryParams.outTagIds = []; // 清空已有数据
|
|
|
+ }
|
|
|
+
|
|
|
+ // 遍历并添加 tagId
|
|
|
+ this.outSelectTags.forEach(tag => {
|
|
|
+ if (tag.tagId) { // 确保 tagId 存在
|
|
|
+ this.queryParams.outTagIds.push(tag.tagId);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.queryParams.outTagIds=this.queryParams.outTagIds.join(",");
|
|
|
+ }else {
|
|
|
+ this.queryParams.outTagIds=null;
|
|
|
+ }
|
|
|
+
|
|
|
this.queryParams.pageNum = 1;
|
|
|
this.getList();
|
|
|
},
|
|
|
@@ -1765,32 +1851,57 @@ export default {
|
|
|
this.getPageListTagGroup();
|
|
|
},
|
|
|
//确定选择标签
|
|
|
- tagSubmitForm(){
|
|
|
+ tagSubmitForm(type){
|
|
|
|
|
|
- for (let i = 0; i < this.tagGroupList.length; i++) {
|
|
|
- for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
|
|
|
- if (this.tagGroupList[i].tag[x].isSelected === true) {
|
|
|
+ if (type==1){
|
|
|
+ for (let i = 0; i < this.tagGroupList.length; i++) {
|
|
|
+ for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
|
|
|
+ if (this.tagGroupList[i].tag[x].isSelected === true) {
|
|
|
+
|
|
|
+ if (!this.selectTags) {
|
|
|
+ this.selectTags = [];
|
|
|
+ }
|
|
|
+
|
|
|
+ // 检查当前 tag 是否已经存在于 tagListFormIndex[index] 中
|
|
|
+ let tagExists = this.selectTags.some(
|
|
|
+ tag => tag.id === this.tagGroupList[i].tag[x].id
|
|
|
+ );
|
|
|
|
|
|
- if (!this.selectTags) {
|
|
|
- this.selectTags = [];
|
|
|
+ // 如果 tag 不存在于 tagListFormIndex[index] 中,则新增
|
|
|
+ if (!tagExists) {
|
|
|
+ this.selectTags.push(this.tagGroupList[i].tag[x]);
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!this.selectTags || this.selectTags.length === 0) {
|
|
|
+ return this.$message('请选择标签');
|
|
|
+ }
|
|
|
+ }else if (type == 2) {
|
|
|
+ for (let i = 0; i < this.tagGroupList.length; i++) {
|
|
|
+ for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
|
|
|
+ if (this.tagGroupList[i].tag[x].isSelected === true) {
|
|
|
|
|
|
- // 检查当前 tag 是否已经存在于 tagListFormIndex[index] 中
|
|
|
- let tagExists = this.selectTags.some(
|
|
|
- tag => tag.id === this.tagGroupList[i].tag[x].id
|
|
|
- );
|
|
|
+ if (!this.outSelectTags) {
|
|
|
+ this.outSelectTags = [];
|
|
|
+ }
|
|
|
|
|
|
- // 如果 tag 不存在于 tagListFormIndex[index] 中,则新增
|
|
|
- if (!tagExists) {
|
|
|
- this.selectTags.push(this.tagGroupList[i].tag[x]);
|
|
|
+ // 检查当前 tag 是否已经存在于 tagListFormIndex[index] 中
|
|
|
+ let tagExists = this.outSelectTags.some(
|
|
|
+ tag => tag.id === this.tagGroupList[i].tag[x].id
|
|
|
+ );
|
|
|
+
|
|
|
+ // 如果 tag 不存在于 tagListFormIndex[index] 中,则新增
|
|
|
+ if (!tagExists) {
|
|
|
+ this.outSelectTags.push(this.tagGroupList[i].tag[x]);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if (!this.outSelectTags || this.outSelectTags.length === 0) {
|
|
|
+ return this.$message('请选择标签');
|
|
|
+ }
|
|
|
}
|
|
|
- if (!this.selectTags || this.selectTags.length === 0) {
|
|
|
- return this.$message('请选择标签');
|
|
|
- }
|
|
|
-
|
|
|
this.changeTagDialog.open = false;
|
|
|
},
|
|
|
|
|
|
@@ -1815,6 +1926,7 @@ export default {
|
|
|
this.queryParams.transferStatus=null;
|
|
|
this.queryParams.corpId= this.myQwCompanyList[0].dictValue;
|
|
|
this.selectTags=[];
|
|
|
+ this.outSelectTags=[];
|
|
|
this.createTime=null;
|
|
|
this.queryParams.sTime=null;
|
|
|
this.queryParams.eTime=null;
|