新增数据修复

dev
Jo 3 years ago
parent 0d8e6c5ca9
commit 13b26d6c13
  1. 13
      src/views/data/Framework.vue

@ -194,7 +194,7 @@ export default {
previewData: [],
curComment: [],
submited: false,
names: [],
categorys: [],
nameVisible: false,
curRow: {},
headVisible: false,
@ -563,7 +563,7 @@ export default {
},
closeImport(){
this.$refs.typeTree.setCheckedKeys([])
this.names = []
this.categorys = []
},
// namesshowNames,
getNames(list){
@ -576,7 +576,7 @@ export default {
delete e.id
e.categoryId = categoryId
})
this.names = list
this.categorys = list
resolve()
}).catch(res => {})
})
@ -594,9 +594,14 @@ export default {
delete e.id
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) {
this.getNames(typeIds).then(() => {
const data = this.names
const allIds = [...this.categorys, ...tableIds]
const data = uniq(allIds, 'name')
const dataList = []
for (let i = 0, len = data.length; i < len; i += 2000) {
dataList.push(data.slice(i, i + 2000))

Loading…
Cancel
Save