数据管理

dev
yujialong 4 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`, listByEntity:`${host1}/data/product/listByEntity`,
saveProduct:`${host1}/data/product/save`, saveProduct:`${host1}/data/product/save`,
updateProduct:`${host1}/data/product/update`, 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-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-container style="padding: 20px 0 20px 20px;background-color: #f0f0f0;">
<el-aside width="300px"> <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-aside>
<el-main style="padding-top: 0;padding-bottom: 0;"> <el-main style="padding-top: 0;padding-bottom: 0;">
<el-card shadow="hover"> <el-card shadow="hover">
@ -94,6 +94,7 @@
export default { export default {
data() { data() {
return { return {
schoolId: 1001,
typeList: [], typeList: [],
defaultProps: { defaultProps: {
children: 'children', children: 'children',
@ -226,7 +227,13 @@ export default {
}, },
preview(row){ preview(row){
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => { 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 comment = res.comment
let previewHead = [] let previewHead = []
comment.map(n => { comment.map(n => {
@ -288,7 +295,7 @@ export default {
}) })
n.children = res.list n.children = res.list
if(!i && !this.tableName){ if(!i && !this.tableName){
this.defaultTypeActive = res.list[0].id this.defaultTypeActive = [res.list[0].id]
this.tableName = res.list[0].name this.tableName = res.list[0].name
this.curId = res.list[0].id this.curId = res.list[0].id
} }

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

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

Loading…
Cancel
Save