|
|
@ -138,6 +138,8 @@ export default { |
|
|
|
previewHead: [], |
|
|
|
previewHead: [], |
|
|
|
previewData: [], |
|
|
|
previewData: [], |
|
|
|
submited: false, |
|
|
|
submited: false, |
|
|
|
|
|
|
|
names: [], |
|
|
|
|
|
|
|
showNames: [] |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
@ -331,11 +333,12 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
if(isConcat){ |
|
|
|
if(isConcat){ |
|
|
|
n.typeTreePage++ |
|
|
|
|
|
|
|
n.children = n.children.concat(list) |
|
|
|
n.children = n.children.concat(list) |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
n.children = list |
|
|
|
n.children = list |
|
|
|
|
|
|
|
n.tableLen = res.list.total |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
n.typeTreePage++ |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
batchImport(){ |
|
|
|
batchImport(){ |
|
|
@ -420,18 +423,43 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
closeImport(){ |
|
|
|
closeImport(){ |
|
|
|
this.$refs.typeTree.setCheckedKeys([]) |
|
|
|
this.$refs.typeTree.setCheckedKeys([]) |
|
|
|
|
|
|
|
this.names = [] |
|
|
|
|
|
|
|
this.showNames = [] |
|
|
|
}, |
|
|
|
}, |
|
|
|
confirmImport(){ |
|
|
|
getNames(){ |
|
|
|
if(this.submited) return false |
|
|
|
|
|
|
|
let list = this.$refs.typeTree.getCheckedNodes() |
|
|
|
let list = this.$refs.typeTree.getCheckedNodes() |
|
|
|
let names = [] |
|
|
|
return new Promise((resolve,reject) => { |
|
|
|
let showNames = [] |
|
|
|
let getLen = 0 |
|
|
|
list.map(n => { |
|
|
|
list.map(n => { |
|
|
|
if(n.name && !n.disabled){ |
|
|
|
if(n.tableLen && n.tableLen > n.children.length) getLen++ |
|
|
|
names.push(n.name) |
|
|
|
}) |
|
|
|
showNames.push(n.showName) |
|
|
|
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('请选择数据') |
|
|
|
if(!names.length) return this.$message.warning('请选择数据') |
|
|
|
|
|
|
|
|
|
|
|
this.submited = true |
|
|
|
this.submited = true |
|
|
@ -454,6 +482,7 @@ export default { |
|
|
|
}).catch(res => { |
|
|
|
}).catch(res => { |
|
|
|
this.submited = false |
|
|
|
this.submited = false |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|