[fix 87598] 拆分-导入拆分结果-选择标准来源调整
This commit is contained in:
@@ -151,6 +151,20 @@ export default {
|
||||
this.loadStandardStructureTree()
|
||||
},
|
||||
methods: {
|
||||
// 获取树结构没有被禁用的value值
|
||||
getValuesWhereNotDisabled (tree = []) {
|
||||
const values = []
|
||||
function traverse (node) {
|
||||
if (!node.disabled) { // 只处理 disabled 不为 true 的节点
|
||||
values.push(node.value)
|
||||
}
|
||||
if (node.children && node.children.length > 0) {
|
||||
node.children.forEach(child => traverse(child))
|
||||
}
|
||||
}
|
||||
tree.forEach(node => traverse(node))
|
||||
return values
|
||||
},
|
||||
getQueryParams () {
|
||||
// 获取查询条件
|
||||
const sqp = {}
|
||||
@@ -162,18 +176,23 @@ export default {
|
||||
param.field = this.getQueryField()
|
||||
param.pageNo = this.ipagination.current
|
||||
param.pageSize = this.ipagination.pageSize
|
||||
if (Array.isArray(param.standardSystem)) {
|
||||
if (Array.isArray(param.standardSystem) && param.standardSystem.length) {
|
||||
param.standardSystem = param.standardSystem.map(item => item.value).join(',')
|
||||
} else {
|
||||
param.standardSystem = this.getValuesWhereNotDisabled(this.standardStructureTree).join(',')
|
||||
}
|
||||
return filterObj(param)
|
||||
},
|
||||
// 加载标准结构树
|
||||
loadStandardStructureTree () {
|
||||
// option 不传显示我的收藏,1不显示我的收藏
|
||||
getForeignStandardTree({ option: 1 }).then(res => {
|
||||
// option 不传显示我的收藏,1不显示我的收藏, 2只能选二级中国及中国下三级,和欧盟EU
|
||||
getForeignStandardTree({ option: 2 }).then(res => {
|
||||
if (res.success) {
|
||||
console.log(res.result)
|
||||
this.standardStructureTree = res.result || []
|
||||
const data = res.result || []
|
||||
this.standardStructureTree = data.map(item => {
|
||||
item.disabled = true
|
||||
return item
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user