修改推送搜索接口

This commit is contained in:
qq787203167
2022-03-31 12:01:09 +08:00
parent 94d427579a
commit 5151f0d336
+28 -10
View File
@@ -10,7 +10,10 @@
:visible="visible" :visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;"> style="height: 100%;overflow: auto;padding-bottom: 53px;">
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<a-input-search style="margin-bottom: 8px" v-model="searchModel" :placeholder="$t('NodeQuickLookup')" @change="onChange"/> <a-input-search style="margin-bottom: 8px" v-model="searchModel"
@search="onSearch"
allowClear
:placeholder="$t('NodeQuickLookup')"/>
<div class="drawer-content"> <div class="drawer-content">
<a-tree <a-tree
v-if="visibleTree" v-if="visibleTree"
@@ -49,7 +52,7 @@
data() { data() {
return { return {
gData: [], gData: [],
searchModel:"", searchModel: '',
autoExpandParent: true, autoExpandParent: true,
expandedKeys: [], expandedKeys: [],
visible: false, visible: false,
@@ -81,11 +84,13 @@
this.selectedKey = selectedKeys this.selectedKey = selectedKeys
}, },
onExpand(selectedKeys, val) { onExpand(selectedKeys, val) {
if (val.expanded) { if (this.searchModel != '') {
if (this.departId == val.node.value) { if (val.expanded) {
} else { if (this.departId == val.node.value) {
this.departId = val.node.value } else {
this.queryDepartUserTreeList() this.departId = val.node.value
this.queryDepartUserTreeList()
}
} }
} }
}, },
@@ -93,7 +98,6 @@
this.visible = false this.visible = false
this.visibleTree = false this.visibleTree = false
}, },
//String departIds,String userIds,String documentIds
handleSubmit() { handleSubmit() {
let query = { let query = {
documentIds: this.tableKey.join(','), documentIds: this.tableKey.join(','),
@@ -117,8 +121,22 @@
} }
}) })
}, },
onChange(e) { onSearch(e) {
const value = e.target.value console.log(e)
if (e) {
this.getUserAndDepart()
} else {
this.queryDepartUserTreeList()
}
},
getUserAndDepart() {
getAction('sys/user/getUserAndDepart', { name: this.searchModel }).then((res) => {
if (res.success) {
this.gData = res || []
} else {
this.gData = []
}
})
}, },
queryDepartUserTreeList() { queryDepartUserTreeList() {
let gData = JSON.parse(JSON.stringify(this.gData)) let gData = JSON.parse(JSON.stringify(this.gData))