Commit 301e7ed8 authored by jingnan's avatar jingnan 👀

合并产品【10500】设置全路径,支持组织名称模糊查询,弹框宽度加宽展示内容,支持名称模糊查询

parent c6fa12ce
......@@ -70,7 +70,13 @@ export default {
loadTreeData() {
let handler = null
if (this.selectScope === 'currentUser') {
handler = http.get('/DxOrganization/getUserOrganizations?userId=' + this.userInfo.id)
const params = {
userId: this.userInfo.id
}
if (this.orgNameCopy) {
params.fuzzOrgName = this.fuzzOrgName
}
handler = http.get('/DxOrganization/getUserOrganizations', params)
.then(res => res.items)
} else if (this.selectScope === 'specified') {
const params = {
......@@ -121,13 +127,13 @@ export default {
.then(res => res.items.content)
}
handler.then(items => {
this.treeData = this.setNodeFullPath(items)
this.treeData = items
this.setCheckedData()
})
},
onQuery() {
const orgName = (this.orgName || '').trim()
if (this.orgNameCopy !== orgName) {
if (this.orgNameCopy !== orgName || !orgName) {
this.orgNameCopy = orgName
this.loadTreeData()
}
......@@ -161,17 +167,6 @@ export default {
this.updateCheckedData()
})
},
// 设置节点全路径
setNodeFullPath(children, parent) {
let parentPath = this.$utils._get(parent, 'fullPath') || ''
if (parentPath) {
parentPath += '/'
}
children.forEach(data => {
data.fullPath = parentPath + (data.name || '')
})
return children
},
// 回显已勾选数据
setCheckedData() {
if (!(Array.isArray(this.checkedData) && this.checkedData.length > 0)) return
......
......@@ -100,11 +100,11 @@ export default {
}
}
if (this.orgNameCopy) {
params.searchItems.items.push({
params.searchItems.items[0] = {
'fieldName': 'name',
'operator': 'LIKE',
'value': this.orgNameCopy
})
}
}
this.$api.searchApi('DxOrganization', params).then(pres => {
resolve(pres.items.content)
......@@ -129,7 +129,9 @@ export default {
'fieldName': 'id',
'operator': 'IN',
'value': this.specifiedOrg
}] },
}
]
},
'pageFrom': this.pageFrom,
'pageSize': 20
}
......@@ -163,11 +165,11 @@ export default {
'pageSize': 20
}
if (this.orgNameCopy) {
params.searchItems.items.push({
params.searchItems.items[0] = {
'fieldName': 'name',
'operator': 'LIKE',
'value': this.orgNameCopy
})
}
}
this.$api.searchApi('DxOrganization', params).then(res => {
if (res.items.last) {
......@@ -191,7 +193,7 @@ export default {
] }
}
this.$api.searchApi('DxOrganization', params).then(res => {
const content = this.setNodeFullPath(res.items.content, node.data)
const content = res.items.content
resolve(content)
this.setCheckedData()
})
......@@ -207,7 +209,9 @@ export default {
'fieldName': 'id',
'operator': 'IN',
'value': this.specifiedOrg
}] },
}
]
},
'pageFrom': this.pageFrom,
'pageSize': 20
}
......@@ -233,6 +237,13 @@ export default {
'pageFrom': this.pageFrom,
'pageSize': 20
}
if (this.orgNameCopy) {
params.searchItems.items[0] = {
'fieldName': 'name',
'operator': 'LIKE',
'value': this.orgNameCopy
}
}
this.$api.searchApi('DxOrganization', params).then(res => {
if (res.items.last) {
this.isLoadMore = false
......@@ -246,10 +257,10 @@ export default {
},
onQuery() {
const orgName = (this.orgName || '').trim()
if (this.orgNameCopy !== orgName) {
if (this.orgNameCopy !== orgName || !orgName) {
this.orgNameCopy = orgName
// 重置执行懒加载根节点数据
this.$refs.tree.loaded = false
this.$refs.tree.root.loaded = false
this.$refs.tree.root.expand()
}
},
......@@ -282,17 +293,6 @@ export default {
this.updateCheckedData()
})
},
// 设置节点全路径
setNodeFullPath(children, parent) {
let parentPath = this.$utils._get(parent, 'fullPath') || ''
if (parentPath) {
parentPath += '/'
}
children.forEach(data => {
data.fullPath = parentPath + (data.name || '')
})
return children
},
// 回显已勾选数据
setCheckedData() {
if (!(Array.isArray(this.checkedData) && this.checkedData.length > 0)) return
......
......@@ -20,7 +20,7 @@
/>
</el-select>
<!-- 弹出框 -->
<dee-dialog title="选择组织" :dialog-visible="showDialog" :destroy-on-close="true" @handleClose="onClose">
<dee-dialog width="60%" title="选择组织" :dialog-visible="showDialog" :destroy-on-close="true" @handleClose="onClose">
<div class="OrgLazyLoadSelectCmp_dialog">
<div class="wrap-left">
<!-- 独立组织树 -->
......@@ -290,13 +290,13 @@ export default {
border: 1px solid #E1E1E1;
overflow: hidden;
.wrap-left {
width: 300px;
width: 400px;
height: 100%;
padding-right: 5px;
border-right: 1px solid #E1E1E1;
}
.wrap-right {
width: calc(100% - 300px);
width: calc(100% - 400px);
height: 100%;
padding: 0 5px;
}
......
......@@ -37,7 +37,7 @@ export default {
title: '操作',
key: 'operate',
hideTip: true,
minWidth: '50',
width: '60px',
align: 'center',
component: {
show: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment