|
|
|
@ -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) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|