数据架构导入

dev
yujialong 3 years ago
parent 5145a14277
commit 34ebf16f17
  1. 23
      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){
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,8 +292,21 @@ export default {
}
},
batchImport(){
let list = JSON.parse(JSON.stringify(this.typeList))
list.map((n,i) => {
this.$post(this.api.originalList).then(res => {
res.map(n => {
n.id = String(n.id)
n.label = n.categoryName
n.children.map(n => {
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
})
})
})
res.map((n,i) => {
if(n.children.length){
n.children.map(n => {
if(n.children.length){
@ -307,11 +320,11 @@ export default {
}
})
setTimeout(() => {
this.importTypeList = list
console.log(11,this.importTypeList)
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 => {

@ -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',

@ -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`,

Loading…
Cancel
Save