From e8b741077e44a079dd99725d45a53214c4bd7621 Mon Sep 17 00:00:00 2001 From: a0049873 <79py69t9wb@privaterelay.appleid.com> Date: Fri, 15 Jul 2022 16:16:50 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/modules/ability/bsabilityai.vue | 78 +++++++++---------- .../views/capacityOnTheShelf/Algorithm.vue | 14 +++- .../components/PutOnTheShelf.vue | 4 +- 3 files changed, 51 insertions(+), 45 deletions(-) diff --git a/back/src/views/modules/ability/bsabilityai.vue b/back/src/views/modules/ability/bsabilityai.vue index 513a0fc3..930685e1 100644 --- a/back/src/views/modules/ability/bsabilityai.vue +++ b/back/src/views/modules/ability/bsabilityai.vue @@ -510,45 +510,45 @@ export default { }) }) this.submitFrom.infoList = this.submitFrom.infoList.sort((a, b) => arr.indexOf(a.attrType) - arr.indexOf(b.attrType)) - // if (this.submitFrom.id) { - // // 解决编辑无组件类型 - // this.submitFrom.infoList.map(val => { - // if (val.attrType === '组件类型') { - // val.attrValue = this.radio - // } - // }) - // console.log('编辑===============>', this.submitFrom) - // console.log(this.submitFrom.infoList, '===============abc') - // // 去重 - // const newArr = this.submitFrom.infoList.filter((element, index, self) => { - // return self.findIndex(x => x.attrType === element.attrType) === index - // }) - // this.submitFrom.infoList = newArr - // console.log(this.submitFrom.infoList, '====================================wpwpwp') - // this.$http - // .put('/resource/update', this.submitFrom) - // .then(({ data: res }) => { - // if (res.code !== 0) { - // this.$message.error('修改失败!') - // } else { - // this.$message.success('修改成功!') - // this.clear() - // } - // }) - // .catch(() => {}) - // } else { - // this.$http - // .post('/resource/insert?source= b', this.submitFrom) - // .then(({ data: res }) => { - // if (res.code !== 0) { - // this.$message.error('上架失败!') - // } else { - // this.$message.success('上架成功!') - // this.clear() - // } - // }) - // .catch(() => {}) - // } + if (this.submitFrom.id) { + // 解决编辑无组件类型 + this.submitFrom.infoList.map(val => { + if (val.attrType === '组件类型') { + val.attrValue = this.radio + } + }) + console.log('编辑===============>', this.submitFrom) + console.log(this.submitFrom.infoList, '===============abc') + // 去重 + const newArr = this.submitFrom.infoList.filter((element, index, self) => { + return self.findIndex(x => x.attrType === element.attrType) === index + }) + this.submitFrom.infoList = newArr + console.log(this.submitFrom.infoList, '====================================wpwpwp') + this.$http + .put('/resource/update', this.submitFrom) + .then(({ data: res }) => { + if (res.code !== 0) { + this.$message.error('修改失败!') + } else { + this.$message.success('修改成功!') + this.clear() + } + }) + .catch(() => {}) + } else { + this.$http + .post('/resource/insert?source= b', this.submitFrom) + .then(({ data: res }) => { + if (res.code !== 0) { + this.$message.error('上架失败!') + } else { + this.$message.success('上架成功!') + this.clear() + } + }) + .catch(() => {}) + } }, // 新修改 UpdateData (item) { diff --git a/front/src/views/capacityOnTheShelf/Algorithm.vue b/front/src/views/capacityOnTheShelf/Algorithm.vue index dc8a25ca..cf63b3c2 100644 --- a/front/src/views/capacityOnTheShelf/Algorithm.vue +++ b/front/src/views/capacityOnTheShelf/Algorithm.vue @@ -2,7 +2,7 @@ * @Author: hisense.liangjunhua * @Date: 2022-06-13 10:22:27 * @LastEditors: hisense.liangjunhua - * @LastEditTime: 2022-07-15 11:50:22 + * @LastEditTime: 2022-07-15 16:13:40 * @Description: 算法上架 -->