|
|
|
@ -138,6 +138,8 @@ export default { |
|
|
|
|
previewHead: [], |
|
|
|
|
previewData: [], |
|
|
|
|
submited: false, |
|
|
|
|
names: [], |
|
|
|
|
showNames: [] |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
@ -331,11 +333,12 @@ export default { |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if(isConcat){ |
|
|
|
|
n.typeTreePage++ |
|
|
|
|
n.children = n.children.concat(list) |
|
|
|
|
}else{ |
|
|
|
|
n.children = list |
|
|
|
|
n.tableLen = res.list.total |
|
|
|
|
} |
|
|
|
|
n.typeTreePage++ |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
batchImport(){ |
|
|
|
@ -420,18 +423,43 @@ export default { |
|
|
|
|
}, |
|
|
|
|
closeImport(){ |
|
|
|
|
this.$refs.typeTree.setCheckedKeys([]) |
|
|
|
|
this.names = [] |
|
|
|
|
this.showNames = [] |
|
|
|
|
}, |
|
|
|
|
confirmImport(){ |
|
|
|
|
if(this.submited) return false |
|
|
|
|
getNames(){ |
|
|
|
|
let list = this.$refs.typeTree.getCheckedNodes() |
|
|
|
|
let names = [] |
|
|
|
|
let showNames = [] |
|
|
|
|
return new Promise((resolve,reject) => { |
|
|
|
|
let getLen = 0 |
|
|
|
|
list.map(n => { |
|
|
|
|
if(n.name && !n.disabled){ |
|
|
|
|
names.push(n.name) |
|
|
|
|
showNames.push(n.showName) |
|
|
|
|
if(n.tableLen && n.tableLen > n.children.length) getLen++ |
|
|
|
|
}) |
|
|
|
|
list.map((n,i) => { |
|
|
|
|
if(n.tableLen && n.tableLen > n.children.length){ |
|
|
|
|
this.$post(`${this.api.originalListById}?categoryId=${n.realId}&pageNum=1&pageSize=10000`).then(res => { |
|
|
|
|
let tableList = res.list.records |
|
|
|
|
getLen-- |
|
|
|
|
tableList.map(n => { |
|
|
|
|
if(!this.defaultTypeChecked.includes(String(n.id))){ |
|
|
|
|
this.names.push(n.name) |
|
|
|
|
this.showNames.push(n.showName) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if(!getLen) resolve() |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}else if(n.name && !n.disabled && !this.names.includes(n.name)){ |
|
|
|
|
this.names.push(n.name) |
|
|
|
|
this.showNames.push(n.showName) |
|
|
|
|
if(!getLen) resolve() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
confirmImport(){ |
|
|
|
|
if(this.submited) return false |
|
|
|
|
if(!this.$refs.typeTree.getCheckedNodes().length) return this.$message.warning('请选择数据') |
|
|
|
|
this.getNames().then(() => { |
|
|
|
|
let names = Array.from(new Set(this.names)) |
|
|
|
|
let showNames = Array.from(new Set(this.showNames)) |
|
|
|
|
if(!names.length) return this.$message.warning('请选择数据') |
|
|
|
|
|
|
|
|
|
this.submited = true |
|
|
|
@ -454,6 +482,7 @@ export default { |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.submited = false |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|