fix : 组件服务获取列表传参

This commit is contained in:
guoyue 2022-08-10 15:47:24 +08:00
parent b3769f2415
commit 607e119c61
1 changed files with 9 additions and 32 deletions

View File

@ -23,20 +23,7 @@
</template>
</el-dialog>
<DisplayList></DisplayList>
<div class="show-box" v-if="displayList.length > 0">
<div class="list-box">
<div v-for="(item, i) in displayList" :key="i">
<el-tooltip popper-class="testTooltip" effect="dark" :content="item.name || '--'" placement="top">
<div class="list-item">
{{ item.name || '--' }}
</div>
</el-tooltip>
</div>
</div>
</div>
<DisplayList :displayList="displayList" showKey="name"></DisplayList>
</div>
</template>
@ -149,8 +136,8 @@ let keyObj = {
nameKey: 'zyname'
},
'组件服务': {
idKey: 'zycode',
nameKey: 'zyname'
idKey: 'id',
nameKey: 'name'
},
}
@ -204,15 +191,15 @@ export default {
let attrValue = dataForm.fuseResourceList.filter(v => v.type == this.type);
if (attrValue.length > 0) {
attrValue.map(val => {
let item = this.allData.find(v => v.id == val.resourceId) || {};
let _obj = {
type: val.type,
id: val.resourceId,
name: item.name
name: val.resource && val.resource.name
};
arr.push(_obj);
});
}
//
this.displayList = JSON.parse(JSON.stringify(arr));
//
@ -223,27 +210,17 @@ export default {
},
//
getData() {
// this.allData = [];
// this.transferData = [];
// let arr = JSON.parse(JSON.stringify(sjzyArray));
// arr.map(v => {
// this.transferData.push({
// type: this.type,
// id: v[keyObj[this.type].idKey],
// name: v[keyObj[this.type].nameKey] || "--"
// });
// });
// this.allData = JSON.parse(JSON.stringify(this.transferData));
// return;
if (this.getDataParams.url === '') {
return;
}
this.$http[this.getDataParams.methods](this.getDataParams.url, this.getDataParams.postData).then(res => {
this.$http[this.getDataParams.methods](this.getDataParams.url, {
params: this.getDataParams.postData
}).then(res => {
console.log('res.data----获取列表-------->', res.data);
if (res.data.code !== 0) {
return this.$message.error(res.msg);
}
this.transferData = []; // allData
this.transferData = [];
this.allData = [];
(res.data.data || []).map(v => {
this.transferData.push({