diff --git a/src/components/Header.vue b/src/components/Header.vue
index edeb954..4977b33 100644
--- a/src/components/Header.vue
+++ b/src/components/Header.vue
@@ -28,7 +28,6 @@ export default {
methods: {
getUserInfo(){
this.$get(this.api.queryUserInfoDetails).then(res => {
- console.log(res,'头像处理');
let userInfo = res.result.hrUserInfo
if(userInfo.userAvatars) this.$store.commit('userAvatar',{avatar: userInfo.userAvatars})
this.userName = userInfo.userName
diff --git a/src/views/data/Framework.vue b/src/views/data/Framework.vue
index 60b3887..9c40f78 100644
--- a/src/views/data/Framework.vue
+++ b/src/views/data/Framework.vue
@@ -5,9 +5,9 @@
-
+
- {{ node.label }}
+ {{ node.label }}
@@ -21,7 +21,7 @@
-
+
@@ -41,7 +41,7 @@
{{scope.row.dataSize}}M
-
+
预览
@@ -60,11 +60,15 @@
-
+
-
+
+
@@ -112,6 +116,7 @@ export default {
updateTime: '',
importVisible: false,
defaultTypeActive: [],
+ defaultTypeChecked: [],
listData: [],
keyword: '',
page: 1,
@@ -119,6 +124,7 @@ export default {
total: 0,
multipleSelection: [],
importTypeList: [],
+ importTypeIndex: 10000,
fieldData: [],
fieldHead: [],
tableName: '',
@@ -126,7 +132,8 @@ export default {
categoryIndex: 0,
previewVisible: false,
previewHead: [],
- previewData: []
+ previewData: [],
+ submited: false,
};
},
watch: {
@@ -164,7 +171,9 @@ export default {
this.categoryId = res[0].id
this.defaultActive = [res[0].id]
}
-
+ this.$nextTick(() => {
+ this.$refs.type.setCurrentKey(res[0].children[0].id)
+ })
this.getData()
}).catch(res => {})
},
@@ -285,51 +294,67 @@ export default {
}
},
getTable(n,i){
- this.$post(`${this.api.originalListById}?categoryId=${n.id}&showName=&pageNum=1&pageSize=10000`).then(res => {
+ this.$post(`${this.api.originalListById}?categoryId=${n.realId}&showName=&pageNum=1&pageSize=10000`).then(res => {
res.list.map(n => {
n.label = n.showName
n.id = String(n.id)
+ if(this.defaultTypeChecked.includes(n.id)){
+ n.disabled = true
+ }
})
+
n.children = res.list
- if(!i && !this.tableName){
- this.defaultTypeActive = [res.list[0].id]
- this.tableName = res.list[0].name
- this.curId = res.list[0].id
- }
+ // if(!i && !this.tableName){
+ // this.tableName = res.list[0].name
+ // this.curId = res.list[0].id
+ // }
}).catch(res => {})
},
batchImport(){
this.$post(this.api.originalList).then(res => {
res.map(n => {
- n.id = String(n.id)
+ this.importTypeIndex++
+ n.realId = n.id
+ n.id = String(this.importTypeIndex + n.id)
n.label = n.categoryName
n.children.map(n => {
- n.id = String(n.id)
+ n.realId = n.id
+ this.importTypeIndex++
+ n.id = String(this.importTypeIndex + n.id)
n.label = n.categoryName
n.children.map(n => {
- n.id = String(n.id)
+ this.importTypeIndex++
+ n.realId = n.id
+ n.id = String(this.importTypeIndex + 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){
- 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.$post(`${this.api.getIdQueryTable}?categoryId=${this.categoryId}&showName=${this.keyword}&pageNum=1&pageSize=10000&updateTime=${this.updateTime ? this.updateTime : ''}`).then(res1 => {
+ this.defaultTypeChecked = res1.list.map(n => n.copyId)
+
+ 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.defaultTypeActive = [res[0].id]
+ // if(res[0].children.length) this.defaultTypeActive.push(res[0].children[0].id)
+ // this.getFields()
+ },500)
+ }).catch(res => {})
+
this.importVisible = true
}).catch(res => {})
},
@@ -349,7 +374,6 @@ export default {
}
})
this.fieldData = data
- console.log(data,'data');
}).catch(res => {})
this.importVisible = true
},
@@ -361,19 +385,23 @@ export default {
}
},
closeImport(){
-
+ this.$refs.typeTree.setCheckedKeys([])
},
confirmImport(){
+ if(this.submited) return false
let list = this.$refs.typeTree.getCheckedNodes()
let names = []
let showNames = []
list.map(n => {
- if(n.name){
+ if(n.name && !n.disabled){
names.push(n.name)
showNames.push(n.showName)
}
})
+ console.log(11,names,showNames)
if(!names.length) return this.$message.warning('请选择数据')
+
+ this.submited = true
let data = []
let categoryId = Number(this.categoryId)
names.map((n,i) => {
@@ -385,9 +413,14 @@ export default {
})
this.$post(this.api.saveTable,data).then(res => {
this.$message.success('导入成功')
- this.getType()
+ this.getData()
this.importVisible = false
- }).catch(res => {})
+ setTimeout(() => {
+ this.submited = false
+ },1000)
+ }).catch(res => {
+ this.submited = false
+ })
},
}
};
diff --git a/src/views/data/Product.vue b/src/views/data/Product.vue
index cf20b91..e77e358 100644
--- a/src/views/data/Product.vue
+++ b/src/views/data/Product.vue
@@ -71,7 +71,7 @@
-
+
@@ -82,7 +82,11 @@
配置数据权限
-
+
+
+ {{ node.label }}
+
+