|
|
|
@ -279,7 +279,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
async getTable(n,i){ |
|
|
|
|
let res = await this.$post(`${this.api.getIdQueryTable}?categoryId=${n.id}&showName=&pageNum=1&pageSize=10000&updateTime=`) |
|
|
|
|
let res = await this.$post(`${this.api.originalListById}?categoryId=${n.id}&showName=&pageNum=1&pageSize=10000`) |
|
|
|
|
res.list.map(n => { |
|
|
|
|
n.label = n.showName |
|
|
|
|
n.id = String(n.id) |
|
|
|
@ -292,26 +292,39 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
batchImport(){ |
|
|
|
|
let list = JSON.parse(JSON.stringify(this.typeList)) |
|
|
|
|
list.map((n,i) => { |
|
|
|
|
if(n.children.length){ |
|
|
|
|
this.$post(this.api.originalList).then(res => { |
|
|
|
|
res.map(n => { |
|
|
|
|
n.id = String(n.id) |
|
|
|
|
n.label = n.categoryName |
|
|
|
|
n.children.map(n => { |
|
|
|
|
if(n.children.length){ |
|
|
|
|
n.children.map(n => this.getTable(n,i)) |
|
|
|
|
}else{ |
|
|
|
|
this.getTable(n,i) |
|
|
|
|
} |
|
|
|
|
n.id = String(n.id) |
|
|
|
|
n.label = n.categoryName |
|
|
|
|
n.children.map(n => { |
|
|
|
|
n.id = String(n.id) |
|
|
|
|
n.label = n.categoryName |
|
|
|
|
n.isThird = true |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
this.getTable(n,i) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.importTypeList = list |
|
|
|
|
console.log(11,this.importTypeList) |
|
|
|
|
this.getFields() |
|
|
|
|
},500) |
|
|
|
|
this.importVisible = true |
|
|
|
|
}) |
|
|
|
|
res.map((n,i) => { |
|
|
|
|
if(n.children.length){ |
|
|
|
|
n.children.map(n => { |
|
|
|
|
if(n.children.length){ |
|
|
|
|
n.children.map(n => this.getTable(n,i)) |
|
|
|
|
}else{ |
|
|
|
|
this.getTable(n,i) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
this.getTable(n,i) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.importTypeList = res |
|
|
|
|
this.getFields() |
|
|
|
|
},500) |
|
|
|
|
this.importVisible = true |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
getFields(){ |
|
|
|
|
this.$get(`${this.api.previewData}?tableName=${this.tableName}&tableId=${this.curId}`).then(res => { |
|
|
|
|