diff --git a/src/components/page/Framework.vue b/src/components/page/Framework.vue index 5df3012..183bd9d 100644 --- a/src/components/page/Framework.vue +++ b/src/components/page/Framework.vue @@ -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 => { diff --git a/src/router/index.js b/src/router/index.js index afbc038..3fa245d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -71,6 +71,11 @@ let router = new Router({ component: () => import(/* webpackChunkName: "form" */ '../components/page/AddLink.vue'), meta: { title: '添加环节' } }, + { + path: '/data', + component: () => import(/* webpackChunkName: "form" */ '../components/page/Data.vue'), + meta: { title: '数据管理' } + }, { // 国际化组件 path: '/i18n', diff --git a/src/utils/api.js b/src/utils/api.js index 4805142..c05972f 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -99,6 +99,8 @@ export default { getIdQueryTable:`${host1}/data/huoran/data/table/getIdQueryTable`, getTableByClassification:`${host1}/data/huoran/data/table/getTableByClassification`, 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`, saveTable:`${host1}/data/huoran/data/table/saveTable`, updateCategory:`${host1}/data/huoran/data/table/updateCategory`,