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

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',
update: 'put'
}
this.dataForm.fuseResourceList = this.getFuseResourceList()
// this.dataForm.fuseResourceList = this.getFuseResourceList()
if (this.imageUrl == '') {
this.$message.error('请上传图片!')
return
}
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
[methodsObj[this.modalType]]('/fuse', this.dataForm)
.then(({ data: res }) => {
@ -366,13 +379,15 @@ export default {
this.imageUrl = _imgObj.attrValue
//
Object.keys(this.getListParams).map(k => {
const arr = data.fuseResourceList.filter(v => v.type == k)
const arr2 = []
arr.map(v => {
arr2.push(v.resourceId)
})
this.abilityListObj[k] = arr2
Object.keys(this.getListParams).map((k, index) => {
// const arr = data.fuseResourceList.filter(v => v.type == k)
// const arr2 = []
// arr.map(v => {
// arr2.push(v.resourceId)
// })
// console.log('2', arr2)
// this.abilityListObj[k] = arr2
this.$refs['abilityAdd' + (index + 1)].getDataInfo(data)
})
console.log('this.dataForm----详情-------->', this.dataForm)

View File

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