|
|
@ -194,7 +194,7 @@ export default { |
|
|
|
previewData: [], |
|
|
|
previewData: [], |
|
|
|
curComment: [], |
|
|
|
curComment: [], |
|
|
|
submited: false, |
|
|
|
submited: false, |
|
|
|
names: [], |
|
|
|
categorys: [], |
|
|
|
nameVisible: false, |
|
|
|
nameVisible: false, |
|
|
|
curRow: {}, |
|
|
|
curRow: {}, |
|
|
|
headVisible: false, |
|
|
|
headVisible: false, |
|
|
@ -563,7 +563,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
closeImport(){ |
|
|
|
closeImport(){ |
|
|
|
this.$refs.typeTree.setCheckedKeys([]) |
|
|
|
this.$refs.typeTree.setCheckedKeys([]) |
|
|
|
this.names = [] |
|
|
|
this.categorys = [] |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 获取names和showNames,提交的时候需要 |
|
|
|
// 获取names和showNames,提交的时候需要 |
|
|
|
getNames(list){ |
|
|
|
getNames(list){ |
|
|
@ -576,7 +576,7 @@ export default { |
|
|
|
delete e.id |
|
|
|
delete e.id |
|
|
|
e.categoryId = categoryId |
|
|
|
e.categoryId = categoryId |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.names = list |
|
|
|
this.categorys = list |
|
|
|
resolve() |
|
|
|
resolve() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
}) |
|
|
|
}) |
|
|
@ -594,9 +594,14 @@ export default { |
|
|
|
delete e.id |
|
|
|
delete e.id |
|
|
|
e.categoryId = categoryId |
|
|
|
e.categoryId = categoryId |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
function uniq (arr, val) { |
|
|
|
|
|
|
|
const res = new Map() |
|
|
|
|
|
|
|
return arr.filter(e => !res.has(e[val]) && res.set(e[val], 1)) |
|
|
|
|
|
|
|
} |
|
|
|
if (typeIds.length) { |
|
|
|
if (typeIds.length) { |
|
|
|
this.getNames(typeIds).then(() => { |
|
|
|
this.getNames(typeIds).then(() => { |
|
|
|
const data = this.names |
|
|
|
const allIds = [...this.categorys, ...tableIds] |
|
|
|
|
|
|
|
const data = uniq(allIds, 'name') |
|
|
|
const dataList = [] |
|
|
|
const dataList = [] |
|
|
|
for (let i = 0, len = data.length; i < len; i += 2000) { |
|
|
|
for (let i = 0, len = data.length; i < len; i += 2000) { |
|
|
|
dataList.push(data.slice(i, i + 2000)) |
|
|
|
dataList.push(data.slice(i, i + 2000)) |
|
|
|