融合服务 组合能力逻辑修改

This commit is contained in:
a0049873 2023-01-09 17:00:11 +08:00
parent 628e654a3e
commit 809f6ff437
2 changed files with 31 additions and 14 deletions

View File

@ -323,12 +323,25 @@ export default {
add: 'post', add: 'post',
update: 'put' update: 'put'
} }
this.dataForm.fuseResourceList = this.getFuseResourceList() // this.dataForm.fuseResourceList = this.getFuseResourceList()
if (this.imageUrl == '') { if (this.imageUrl == '') {
this.$message.error('请上传图片!') this.$message.error('请上传图片!')
return return
} }
this.dataForm.fuseAttrList.find(v => v.attrType == '服务图片').attrValue = this.imageUrl || '' this.dataForm.fuseAttrList.find(v => v.attrType == '服务图片').attrValue = this.imageUrl || ''
this.dataForm.fuseResourceList = []
for (const key in this.abilityListObj) {
this.abilityListObj[key].map((val, index) => {
this.dataForm.fuseResourceList.push({
type: key,
typeSecond: val.type,
resourceName: val.name,
deptName: val.dept,
sequence: index + 1
})
})
}
console.log('提交', this.dataForm, this.abilityListObj)
this.$http this.$http
[methodsObj[this.modalType]]('/fuse', this.dataForm) [methodsObj[this.modalType]]('/fuse', this.dataForm)
.then(({ data: res }) => { .then(({ data: res }) => {
@ -366,13 +379,15 @@ export default {
this.imageUrl = _imgObj.attrValue this.imageUrl = _imgObj.attrValue
// //
Object.keys(this.getListParams).map(k => { Object.keys(this.getListParams).map((k, index) => {
const arr = data.fuseResourceList.filter(v => v.type == k) // const arr = data.fuseResourceList.filter(v => v.type == k)
const arr2 = [] // const arr2 = []
arr.map(v => { // arr.map(v => {
arr2.push(v.resourceId) // arr2.push(v.resourceId)
}) // })
this.abilityListObj[k] = arr2 // console.log('2', arr2)
// this.abilityListObj[k] = arr2
this.$refs['abilityAdd' + (index + 1)].getDataInfo(data)
}) })
console.log('this.dataForm----详情-------->', this.dataForm) console.log('this.dataForm----详情-------->', this.dataForm)

View File

@ -1,7 +1,6 @@
<template> <template>
<div> <div>
<div class="info-title">{{ title }}</div> <div class="info-title">{{ title }}</div>
<el-form :inline="true"> <el-form :inline="true">
<el-form-item label="使用总数"> <el-form-item label="使用总数">
<el-input <el-input
@ -153,11 +152,14 @@ export default {
this.count = dataForm.dataSourceCount this.count = dataForm.dataSourceCount
} }
const fuseAttrList = dataForm.fuseAttrList || [] const fuseAttrList = dataForm.fuseResourceList || []
const obj = fuseAttrList.find((v) => v.attrType === this.title) || {} const obj = fuseAttrList.filter((v) => v.type === this.title)
const attrValue = JSON.parse(obj.attrValue || '[]') console.log('回显数据=======>', obj)
if (attrValue.length > 0) { if (obj.length > 0) {
attrValue.map((v) => { obj.map((v) => {
v.name = v.resourceName
v.dept = v.deptName
v.type = v.typeSecond
arr.push(v) arr.push(v)
}) })
} else { } else {