Commit 301e7ed8 authored by jingnan's avatar jingnan 👀

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

parent c6fa12ce
...@@ -70,7 +70,13 @@ export default { ...@@ -70,7 +70,13 @@ export default {
loadTreeData() { loadTreeData() {
let handler = null let handler = null
if (this.selectScope === 'currentUser') { 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) .then(res => res.items)
} else if (this.selectScope === 'specified') { } else if (this.selectScope === 'specified') {
const params = { const params = {
...@@ -121,13 +127,13 @@ export default { ...@@ -121,13 +127,13 @@ export default {
.then(res => res.items.content) .then(res => res.items.content)
} }
handler.then(items => { handler.then(items => {
this.treeData = this.setNodeFullPath(items) this.treeData = items
this.setCheckedData() this.setCheckedData()
}) })
}, },
onQuery() { onQuery() {
const orgName = (this.orgName || '').trim() const orgName = (this.orgName || '').trim()
if (this.orgNameCopy !== orgName) { if (this.orgNameCopy !== orgName || !orgName) {
this.orgNameCopy = orgName this.orgNameCopy = orgName
this.loadTreeData() this.loadTreeData()
} }
...@@ -161,17 +167,6 @@ export default { ...@@ -161,17 +167,6 @@ export default {
this.updateCheckedData() 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() { setCheckedData() {
if (!(Array.isArray(this.checkedData) && this.checkedData.length > 0)) return if (!(Array.isArray(this.checkedData) && this.checkedData.length > 0)) return
......
...@@ -100,11 +100,11 @@ export default { ...@@ -100,11 +100,11 @@ export default {
} }
} }
if (this.orgNameCopy) { if (this.orgNameCopy) {
params.searchItems.items.push({ params.searchItems.items[0] = {
'fieldName': 'name', 'fieldName': 'name',
'operator': 'LIKE', 'operator': 'LIKE',
'value': this.orgNameCopy 'value': this.orgNameCopy
}) }
} }
this.$api.searchApi('DxOrganization', params).then(pres => { this.$api.searchApi('DxOrganization', params).then(pres => {
resolve(pres.items.content) resolve(pres.items.content)
...@@ -129,7 +129,9 @@ export default { ...@@ -129,7 +129,9 @@ export default {
'fieldName': 'id', 'fieldName': 'id',
'operator': 'IN', 'operator': 'IN',
'value': this.specifiedOrg 'value': this.specifiedOrg
}] }, }
]
},
'pageFrom': this.pageFrom, 'pageFrom': this.pageFrom,
'pageSize': 20 'pageSize': 20
} }
...@@ -163,11 +165,11 @@ export default { ...@@ -163,11 +165,11 @@ export default {
'pageSize': 20 'pageSize': 20
} }
if (this.orgNameCopy) { if (this.orgNameCopy) {
params.searchItems.items.push({ params.searchItems.items[0] = {
'fieldName': 'name', 'fieldName': 'name',
'operator': 'LIKE', 'operator': 'LIKE',
'value': this.orgNameCopy 'value': this.orgNameCopy
}) }
} }
this.$api.searchApi('DxOrganization', params).then(res => { this.$api.searchApi('DxOrganization', params).then(res => {
if (res.items.last) { if (res.items.last) {
...@@ -191,7 +193,7 @@ export default { ...@@ -191,7 +193,7 @@ export default {
] } ] }
} }
this.$api.searchApi('DxOrganization', params).then(res => { this.$api.searchApi('DxOrganization', params).then(res => {
const content = this.setNodeFullPath(res.items.content, node.data) const content = res.items.content
resolve(content) resolve(content)
this.setCheckedData() this.setCheckedData()
}) })
...@@ -207,7 +209,9 @@ export default { ...@@ -207,7 +209,9 @@ export default {
'fieldName': 'id', 'fieldName': 'id',
'operator': 'IN', 'operator': 'IN',
'value': this.specifiedOrg 'value': this.specifiedOrg
}] }, }
]
},
'pageFrom': this.pageFrom, 'pageFrom': this.pageFrom,
'pageSize': 20 'pageSize': 20
} }
...@@ -233,6 +237,13 @@ export default { ...@@ -233,6 +237,13 @@ export default {
'pageFrom': this.pageFrom, 'pageFrom': this.pageFrom,
'pageSize': 20 'pageSize': 20
} }
if (this.orgNameCopy) {
params.searchItems.items[0] = {
'fieldName': 'name',
'operator': 'LIKE',
'value': this.orgNameCopy
}
}
this.$api.searchApi('DxOrganization', params).then(res => { this.$api.searchApi('DxOrganization', params).then(res => {
if (res.items.last) { if (res.items.last) {
this.isLoadMore = false this.isLoadMore = false
...@@ -246,10 +257,10 @@ export default { ...@@ -246,10 +257,10 @@ export default {
}, },
onQuery() { onQuery() {
const orgName = (this.orgName || '').trim() const orgName = (this.orgName || '').trim()
if (this.orgNameCopy !== orgName) { if (this.orgNameCopy !== orgName || !orgName) {
this.orgNameCopy = orgName this.orgNameCopy = orgName
// 重置执行懒加载根节点数据 // 重置执行懒加载根节点数据
this.$refs.tree.loaded = false this.$refs.tree.root.loaded = false
this.$refs.tree.root.expand() this.$refs.tree.root.expand()
} }
}, },
...@@ -282,17 +293,6 @@ export default { ...@@ -282,17 +293,6 @@ export default {
this.updateCheckedData() 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() { setCheckedData() {
if (!(Array.isArray(this.checkedData) && this.checkedData.length > 0)) return if (!(Array.isArray(this.checkedData) && this.checkedData.length > 0)) return
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
/> />
</el-select> </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="OrgLazyLoadSelectCmp_dialog">
<div class="wrap-left"> <div class="wrap-left">
<!-- 独立组织树 --> <!-- 独立组织树 -->
...@@ -290,13 +290,13 @@ export default { ...@@ -290,13 +290,13 @@ export default {
border: 1px solid #E1E1E1; border: 1px solid #E1E1E1;
overflow: hidden; overflow: hidden;
.wrap-left { .wrap-left {
width: 300px; width: 400px;
height: 100%; height: 100%;
padding-right: 5px; padding-right: 5px;
border-right: 1px solid #E1E1E1; border-right: 1px solid #E1E1E1;
} }
.wrap-right { .wrap-right {
width: calc(100% - 300px); width: calc(100% - 400px);
height: 100%; height: 100%;
padding: 0 5px; padding: 0 5px;
} }
......
...@@ -37,7 +37,7 @@ export default { ...@@ -37,7 +37,7 @@ export default {
title: '操作', title: '操作',
key: 'operate', key: 'operate',
hideTip: true, hideTip: true,
minWidth: '50', width: '60px',
align: 'center', align: 'center',
component: { component: {
show: true, 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