|
@@ -364,15 +364,15 @@
|
|
|
v-model="participantsFilterText">
|
|
|
</el-input>
|
|
|
|
|
|
- <div v-if="user.userNameNeedTranslate == '1' && false">
|
|
|
- <el-input placeholder="请输入内容" v-model.trim="wxFilterText" class="input-with-select">
|
|
|
+ <div v-if="user.userNameNeedTranslate == '1'">
|
|
|
+ <el-input placeholder="请输输入关键字过滤" v-model.trim="participantsFilterText" class="input-with-select">
|
|
|
<el-button slot="append" icon="el-icon-search" @click="echartDepartment()"></el-button>
|
|
|
</el-input>
|
|
|
</div>
|
|
|
|
|
|
<el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
|
|
|
ref="chooseMembTree2" @check-change="onTreeItemChange" :default-checked-keys="alreadyPartArray"
|
|
|
- highlight-current :filter-node-method="filterNode">
|
|
|
+ highlight-current :filter-node-method="filterNode" v-loading="filterNodeFlag">
|
|
|
<span class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
<span v-if="user.userNameNeedTranslate == '1'">
|
|
|
<span v-if="node.data.children">
|
|
@@ -1494,13 +1494,22 @@
|
|
|
|
|
|
hideCompleted: false,
|
|
|
|
|
|
- wxFilterText: ''
|
|
|
+ wxFilterText: '',
|
|
|
+
|
|
|
+ filterNodeFlag: false,
|
|
|
+ filterNodePersonnel: []
|
|
|
};
|
|
|
|
|
|
},
|
|
|
watch: {
|
|
|
participantsFilterText(val) {
|
|
|
- this.$refs.chooseMembTree2.filter(val);
|
|
|
+ let { userNameNeedTranslate } = JSON.parse(sessionStorage.getItem("user"))
|
|
|
+ if(userNameNeedTranslate != 1) {
|
|
|
+ this.$refs.chooseMembTree2.filter(val);
|
|
|
+ }
|
|
|
+ if(!val) {
|
|
|
+ this.$refs.chooseMembTree2.filter(val);
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -1671,8 +1680,13 @@
|
|
|
},
|
|
|
// 筛选逻辑
|
|
|
filterNode(value, data) {
|
|
|
+ let { userNameNeedTranslate } = this.user
|
|
|
if (!value) return true;
|
|
|
- return data.label.indexOf(value) !== -1;
|
|
|
+ if(userNameNeedTranslate != '1') {
|
|
|
+ return data.label.indexOf(value) !== -1;
|
|
|
+ } else {
|
|
|
+ return this.filterNodePersonnel.some(item => item.includes(data.label))
|
|
|
+ }
|
|
|
},
|
|
|
// 选中改变
|
|
|
onTreeItemChange() {
|
|
@@ -3714,25 +3728,33 @@
|
|
|
// 企业微信搜索
|
|
|
echartDepartment() {
|
|
|
console.log('我点击了搜索')
|
|
|
- if(this.wxFilterText != '') {
|
|
|
- this.http.post("/department/listAllMemb", {
|
|
|
- keyword: this.wxFilterText,
|
|
|
- cursor: ''
|
|
|
+ if(this.participantsFilterText != '') {
|
|
|
+ this.filterNodeFlag = true
|
|
|
+ this.http.post("/user/getEmployeeList", {
|
|
|
+ keyword: this.participantsFilterText,
|
|
|
+ cursor: '',
|
|
|
+ departmentId: -1,
|
|
|
+ pageIndex: 1,
|
|
|
+ pageSize: 1000
|
|
|
},
|
|
|
res => {
|
|
|
if (res.code == "ok") {
|
|
|
- var list = res.data.data;
|
|
|
- this.setUserToDept(list);
|
|
|
- this.deptMembData = list;
|
|
|
- this.$forceUpdate()
|
|
|
+ // var list = res.data.data;
|
|
|
+ // this.setUserToDept(list);
|
|
|
+ // this.deptMembData = list;
|
|
|
+ // this.$forceUpdate()
|
|
|
+ this.filterNodePersonnel = res.data.records.map(item => item.name)
|
|
|
+ this.$refs.chooseMembTree2.filter(this.participantsFilterText);
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
|
type: "error"
|
|
|
});
|
|
|
}
|
|
|
+ this.filterNodeFlag = false
|
|
|
},
|
|
|
error => {
|
|
|
+ this.filterNodeFlag = false
|
|
|
this.$message({
|
|
|
message: error,
|
|
|
type: "error"
|