数据架构导入

dev
yujialong 3 years ago
parent 5145a14277
commit 34ebf16f17
  1. 51
      src/components/page/Framework.vue
  2. 5
      src/router/index.js
  3. 2
      src/utils/api.js

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

@ -71,6 +71,11 @@ let router = new Router({
component: () => import(/* webpackChunkName: "form" */ '../components/page/AddLink.vue'), component: () => import(/* webpackChunkName: "form" */ '../components/page/AddLink.vue'),
meta: { title: '添加环节' } meta: { title: '添加环节' }
}, },
{
path: '/data',
component: () => import(/* webpackChunkName: "form" */ '../components/page/Data.vue'),
meta: { title: '数据管理' }
},
{ {
// 国际化组件 // 国际化组件
path: '/i18n', path: '/i18n',

@ -99,6 +99,8 @@ export default {
getIdQueryTable:`${host1}/data/huoran/data/table/getIdQueryTable`, getIdQueryTable:`${host1}/data/huoran/data/table/getIdQueryTable`,
getTableByClassification:`${host1}/data/huoran/data/table/getTableByClassification`, getTableByClassification:`${host1}/data/huoran/data/table/getTableByClassification`,
getTableByCondition:`${host1}/data/huoran/data/table/getTableByCondition`, getTableByCondition:`${host1}/data/huoran/data/table/getTableByCondition`,
originalList:`${host1}/data/huoran/data/table/originalList`,
originalListById:`${host1}/data/huoran/data/table/originalListById`,
saveCategory:`${host1}/data/huoran/data/table/saveCategory`, saveCategory:`${host1}/data/huoran/data/table/saveCategory`,
saveTable:`${host1}/data/huoran/data/table/saveTable`, saveTable:`${host1}/data/huoran/data/table/saveTable`,
updateCategory:`${host1}/data/huoran/data/table/updateCategory`, updateCategory:`${host1}/data/huoran/data/table/updateCategory`,

Loading…
Cancel
Save