From 65b071ba84eaa35ee4b3362464d5e076535f2cd2 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Thu, 1 Jul 2021 15:35:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/api.js | 1 + src/views/data/Framework.vue | 13 ++++++++++--- src/views/data/Introduce.vue | 1 - src/views/data/Product.vue | 35 +++++++++++++++++++---------------- 4 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/utils/api.js b/src/utils/api.js index 2b844e4..147d51e 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -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`, } \ No newline at end of file diff --git a/src/views/data/Framework.vue b/src/views/data/Framework.vue index de435af..8dc3113 100644 --- a/src/views/data/Framework.vue +++ b/src/views/data/Framework.vue @@ -56,7 +56,7 @@ - + @@ -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 } diff --git a/src/views/data/Introduce.vue b/src/views/data/Introduce.vue index 6562e4f..8d256b0 100644 --- a/src/views/data/Introduce.vue +++ b/src/views/data/Introduce.vue @@ -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){ diff --git a/src/views/data/Product.vue b/src/views/data/Product.vue index 82d8796..6961614 100644 --- a/src/views/data/Product.vue +++ b/src/views/data/Product.vue @@ -94,7 +94,7 @@ - + @@ -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) } } };