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: 算法上架 -->