组件服务修改

This commit is contained in:
unknown 2022-10-13 20:11:01 +08:00
parent eb563cd3dd
commit 5ec0d81181
2 changed files with 34 additions and 15 deletions

View File

@ -163,15 +163,14 @@ export const modalTypeText = {
}
export const getFuseResourceList = (abilityListObj) => {
debugger
console.log('abilityListObjabilityListObj',abilityListObj);
const arr = []
let length = 0
for (const key in abilityListObj) {
if (Object.hasOwnProperty.call(abilityListObj, key)) {
const itemArray = abilityListObj[key]
debugger
if(key=='数据资源'){
itemArray.map((v, i) => {
itemArray.map((v, i) => {
const index = (i + 1) + length
arr.push({
resourceId: v.id,
@ -332,6 +331,7 @@ export default {
},
//
updateDataForm (data) {
console.log('datadatadata',data);
if (Object.keys(this.getListParams).includes(data.title)) {
this.abilityListObj[data.title] = data.list
} else {
@ -420,11 +420,15 @@ export default {
// --
Object.keys(this.getListParams).map(k => {
const arr = data.fuseResourceList.filter(v => v.type == k)
const arr2 = []
let arr = data.fuseResourceList.filter(v => v.type == k)
let arr2 = [];
if(k === "数据资源"){
arr2 = JSON.parse(JSON.stringify(arr));
}else{
arr.map(v => {
arr2.push(v.resourceId)
})
}
this.abilityListObj[k] = arr2
})
})

View File

@ -227,15 +227,24 @@ export default {
await this.getData()
const arr = []
const attrValue = dataForm.fuseResourceList.filter(v => v.type == this.type);
console.log('attrValue',attrValue);
console.log('attrValue22',attrValue);
if (attrValue.length > 0) {
attrValue.map(val => {
const _obj = {
if(val.type==="数据资源"){
const _obj = {
type: val.type,
id: val.resourceId,
name: val.resource && val.resource.resourceName,
}
arr.push(_obj)
}else{
const _obj = {
type: val.type,
id: val.resourceId,
name: val.resource && val.resource.name,
}
arr.push(_obj)
}
})
}
//
@ -305,8 +314,9 @@ export default {
return item.name && item.name.indexOf(query) > -1
},
confirmSubmitHandle () {
console.log('lllooooo',this.selectedArray);
//
debugger
if(this.type === "数据资源"){
//
let selectedObjectList = [];
this.selectedArray.forEach((item)=>{
let filterData = [];
@ -314,7 +324,16 @@ export default {
//console.log('filterDatafilterData',filterData);
selectedObjectList.push(filterData[0]);
});
console.log('selectedObjectListselectedObjectList',selectedObjectList);
this.$emit('update', {
title: this.type,
list: selectedObjectList
})
}else{
this.$emit('update', {
title: this.type,
list: this.selectedArray
})
}
if (this.selectedArray.length > this.maxNum) {
return this.$message.error('最多选择十条数据!')
}
@ -325,14 +344,10 @@ export default {
this.displayList.push(v)
}
})
this.$emit('update', {
title: this.type,
list: selectedObjectList
})
console.log(this.selectedArray, this.displayList, 'this.displayList')
},
handleChange(){
console.log('222222',this.selectedArray);
//console.log('222222',this.selectedArray);
},
getDisplay (displayList) {
this.displayList = []