修改禅道已知bug
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
|
||||
export default {
|
||||
name: 'index',
|
||||
props: ['query', 'value', 'personneQuery', 'isSingleChoice', 'isInput', 'isClass','isDelete'],
|
||||
props: ['query', 'value', 'personneQuery', 'isSingleChoice', 'isInput', 'isClass', 'isDelete'],
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
@@ -74,6 +74,7 @@
|
||||
searchModel: '',
|
||||
defaultExpandedKeys: [],
|
||||
defaultCheckedKeys: [],
|
||||
defaultCheckedKeysName: [],
|
||||
content: []
|
||||
}
|
||||
},
|
||||
@@ -90,10 +91,10 @@
|
||||
this.queryDepartUserTreeList()
|
||||
this.visible = true
|
||||
},
|
||||
standardDelete(){
|
||||
standardDelete() {
|
||||
this.$emit('input', null)
|
||||
this.$forceUpdate()
|
||||
this.$emit('deleteData',this.query.db_field_name)
|
||||
this.$emit('deleteData', this.query.db_field_name)
|
||||
},
|
||||
// onSelect(selectedKeys, info) {
|
||||
// console.log(selectedKeys)
|
||||
@@ -101,9 +102,17 @@
|
||||
// },
|
||||
|
||||
onCheck(checkedKeys, info) {
|
||||
console.log(checkedKeys)
|
||||
this.userIds = checkedKeys.checked
|
||||
this.userName = []
|
||||
if (this.userIds.length > 0) {
|
||||
for (let i = 0; i < this.userIds.length; i++) {
|
||||
for (let j = 0; j < this.defaultCheckedKeysName.length; j++) {
|
||||
if (this.userIds[i] == this.defaultCheckedKeysName[j].id) {
|
||||
this.userName.push(this.defaultCheckedKeysName[j].name)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (info.checkedNodes && info.checkedNodes.length > 0) {
|
||||
info.checkedNodes.forEach(res => {
|
||||
if (res.data.props.dataRef.key) {
|
||||
@@ -136,6 +145,16 @@
|
||||
})
|
||||
})
|
||||
}
|
||||
if (this.userName.length > 0){
|
||||
for (let i = 0; i < this.userName.length; i++) {
|
||||
for (let j = i + 1; j < this.userName.length; j++) {
|
||||
if (this.userName[i] == this.userName[j]) {
|
||||
this.userName.splice(j, 1)
|
||||
j--
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleCancel() {
|
||||
this.visible = false
|
||||
@@ -151,8 +170,9 @@
|
||||
}
|
||||
let userIds = JSON.parse(JSON.stringify(this.userIds))
|
||||
let userName = JSON.parse(JSON.stringify(this.userName))
|
||||
console.log(userName)
|
||||
this.$emit('input', userName.join(','))
|
||||
this.$emit('change', this.query.db_field_name, userIds.join(','),this.query.subscript)
|
||||
this.$emit('change', this.query.db_field_name, userIds.join(','), this.query.subscript)
|
||||
this.visible = false
|
||||
this.treeVisible = false
|
||||
// } else {
|
||||
@@ -179,8 +199,8 @@
|
||||
},
|
||||
getUserAndDepart() {
|
||||
getAction('sys/user/getUserAndDepart', { name: this.searchModel }).then((res) => {
|
||||
if (res){
|
||||
this.gData = res.filter(ele => ele.flag === 'DEPART');
|
||||
if (res) {
|
||||
this.gData = res.filter(ele => ele.flag === 'DEPART')
|
||||
} else {
|
||||
this.gData = []
|
||||
}
|
||||
@@ -234,6 +254,15 @@
|
||||
}
|
||||
}
|
||||
this.defaultCheckedKeys = this.userIds
|
||||
this.defaultCheckedKeysName = []
|
||||
if (this.defaultCheckedKeys.length > 0) {
|
||||
for (let i = 0; i < this.defaultCheckedKeys.length; i++) {
|
||||
this.defaultCheckedKeysName.push({
|
||||
id: this.defaultCheckedKeys[i],
|
||||
name: this.userName[i]
|
||||
})
|
||||
}
|
||||
}
|
||||
this.treeVisible = true
|
||||
} else {
|
||||
this.gData = []
|
||||
|
||||
Reference in New Issue
Block a user