BUG修改

This commit is contained in:
a0049873 2022-07-15 16:16:50 +08:00
parent 3acee93e23
commit e8b741077e
3 changed files with 51 additions and 45 deletions

View File

@ -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) {

View File

@ -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: 算法上架
-->
<template>
@ -31,12 +31,14 @@
></put-on-the-shelf>
<put-on-the-shelf
v-else-if="showView === '算法优势'"
ref="sfys"
:refData="refData"
:dataFrom="dataFrom"
:configure="sfys"
></put-on-the-shelf>
<put-on-the-shelf
v-else-if="showView === '应用场景'"
ref="yycj"
:refData="refData"
:dataFrom="dataFrom"
:configure="yycj"
@ -80,6 +82,7 @@
></algorithm-deployment-use> -->
</div>
<div class="btn" :class="showView === '基本信息' ? 'first' : ''">
<button @click="close()">取消</button>
<button v-show="showView !== '基本信息'" @click="back()">上一步</button>
<button v-show="showView === '部署与使用'" @click="preview()">
预览
@ -216,6 +219,9 @@
getUser().then((res) => {
dataFrom.value.deptId = res.data.data.deptId
})
const close = () => {
window.close()
}
const back = () => {
navList.value.forEach((val, index) => {
if (val.key === showView.value && index > 0) {
@ -446,8 +452,8 @@
}
.btn {
display: flex;
justify-content: space-between;
padding: 10px 400px 0;
justify-content: space-around;
padding: 10px 350px 0;
button {
cursor: pointer;
width: 80px;
@ -467,7 +473,7 @@
}
}
.first {
justify-content: center;
justify-content: space-around;
}
}
</style>

View File

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua
* @Date: 2022-06-17 14:11:08
* @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-07-15 11:51:18
* @LastEditTime: 2022-07-15 14:57:15
* @Description: 上架
-->
<template>
@ -111,7 +111,7 @@
></upload>
</div>
<div class="submit">
<a-button type="primary" @click="add(title.name)">提交</a-button>
<a-button type="primary" @click="add(title.name)">添加</a-button>
</div>
</div>
</template>