数据管理

dev
yujialong 3 years ago
parent 2e4f0302b4
commit 65b071ba84
  1. 1
      src/utils/api.js
  2. 13
      src/views/data/Framework.vue
  3. 1
      src/views/data/Introduce.vue
  4. 35
      src/views/data/Product.vue

@ -115,4 +115,5 @@ export default {
listByEntity:`${host1}/data/product/listByEntity`,
saveProduct:`${host1}/data/product/save`,
updateProduct:`${host1}/data/product/update`,
saveRecord:`${host1}/data/dataRecord/saveRecord`,
}

@ -56,7 +56,7 @@
<el-dialog title="导入" :visible.sync="importVisible" width="80%" center @close="closeImport" class="dialog" :close-on-click-modal="false">
<el-container style="padding: 20px 0 20px 20px;background-color: #f0f0f0;">
<el-aside width="300px">
<el-tree style="margin: 10px;" ref="typeTree" :data="importTypeList" node-key="id" accordion :default-expanded-keys="defaultTypeActive" show-checkbox :props="defaultProps" highlight-current @node-click="importTypeClick"></el-tree>
<el-tree style="margin: 10px;" ref="typeTree" :data="importTypeList" node-key="id" accordion :default-expanded-keys="defaultTypeActive" :current-node-key="curId" show-checkbox :props="defaultProps" highlight-current @node-click="importTypeClick"></el-tree>
</el-aside>
<el-main style="padding-top: 0;padding-bottom: 0;">
<el-card shadow="hover">
@ -94,6 +94,7 @@
export default {
data() {
return {
schoolId: 1001,
typeList: [],
defaultProps: {
children: 'children',
@ -226,7 +227,13 @@ export default {
},
preview(row){
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => {
this.$post(`${this.api.saveRecord}?platformUserId=4&tableId=${row.id}&type=2&schoolId=1`).then(res => {}).catch(res => {})
this.$post(this.api.saveRecord,{
platformUserId: 4,
tableId: row.id,
type: 2,
schoolId: this.schoolId,
}).then(res => {}).catch(res => {})
let comment = res.comment
let previewHead = []
comment.map(n => {
@ -288,7 +295,7 @@ export default {
})
n.children = res.list
if(!i && !this.tableName){
this.defaultTypeActive = res.list[0].id
this.defaultTypeActive = [res.list[0].id]
this.tableName = res.list[0].name
this.curId = res.list[0].id
}

@ -85,7 +85,6 @@ export default {
this.defaultActive = [res[0].id]
this.introduceText = res[0].introduce
}
console.log(11,this.defaultActive)
}).catch(res => {})
},
typeClick(data,node){

@ -94,7 +94,7 @@
<el-dialog title="数据配置" :visible.sync="configVisible" width="70%" center @close="closeConfig" :close-on-click-modal="false">
<el-container style="padding: 20px 0 20px 20px;background-color: #f0f0f0;">
<el-aside width="300px">
<el-tree style="margin: 10px;" ref="typeConfig" :data="typeConfigList" show-checkbox node-key="id" accordion :default-expanded-keys="defaultActive" :current-node-key="categoryId" :props="defaultProps" highlight-current @current-change="typeConfigClick"></el-tree>
<el-tree style="margin: 10px;" ref="typeConfig" :data="typeConfigList" show-checkbox node-key="id" accordion :default-expanded-keys="configIds" :default-checked-keys="configIds" :current-node-key="categoryId" :props="defaultProps" highlight-current @current-change="typeConfigClick"></el-tree>
</el-aside>
<el-main style="padding-top: 0;padding-bottom: 0;">
@ -144,6 +144,7 @@
export default {
data() {
return {
schoolId: 1001,
userId: this.$store.state.userLoginId,
userName: this.$store.state.userName,
keyword: '',
@ -185,7 +186,7 @@ export default {
configChecked: [],
configCheckedTableId: [],
categoryId: '',
defaultActive: [],
configIds: [],
updateTime: '',
keywordConfig: '',
typeConfigList: [],
@ -307,9 +308,7 @@ export default {
let data = res.product
this.productName = data.productName
this.market = data.market
// console.log(22,data.tableId,this.typeList)
this.checkedIds = this.handleType(data.tableId.split(','),this.typeList)
console.log(this.checkedIds)
this.$refs.type.setCheckedNodes(this.checkedIds)
}).catch(res => {})
},
@ -428,6 +427,13 @@ export default {
configData(){
this.configVisible = true
this.getConfigType()
let list = this.$refs.type.getCheckedNodes()
let configIds = []
list.map(n => {
if(!n.name) configIds.push(n.originId)
})
this.configIds = configIds
},
typeConfigClick(data,node){
this.categoryId = data.id
@ -454,10 +460,8 @@ export default {
this.typeConfigList = res
if(res[0].children.length){
this.categoryId = res[0].children[0].id
this.defaultActive = [res[0].children[0].id]
}else{
this.categoryId = res[0].id
this.defaultActive = [res[0].id]
}
this.getConfigTable()
}).catch(res => {})
@ -478,7 +482,13 @@ export default {
},
previewConfig(row){
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => {
this.$post(`${this.api.saveRecord}?platformUserId=4&tableId=${row.id}&type=2&schoolId=1`).then(res => {}).catch(res => {})
this.$post(this.api.saveRecord,{
platformUserId: 4,
tableId: row.id,
type: 2,
schoolId: this.schoolId,
}).then(res => {}).catch(res => {})
let comment = res.comment
let previewHead = []
comment.map(n => {
@ -512,16 +522,9 @@ export default {
confirmConfig(){
this.configChecked = this.$refs.typeConfig.getCheckedKeys().map(n => Number(n))
this.getTableId(this.typeList)
let data = Array.from(new Set(this.configCheckedTableId))
// console.log(this.$refs.type.setCheckedNodes,Array.from(new Set(this.configCheckedTableId)))
// setTimeout(() => {
// this.$refs.type.setCheckedNodes(Array.from(new Set(this.configCheckedTableId)))
// },500)
this.checkedIds = Array.from(new Set(this.configCheckedTableId))
this.configVisible = false
this.$nextTick(() => {
console.log(data,this.typeList)
this.$refs.type.setCheckedNodes(data)
})
this.$refs.type.setCheckedNodes(this.checkedIds)
}
}
};

Loading…
Cancel
Save