|
@ -36,11 +36,20 @@ |
|
|
<span class="item-field">{{ field.label }}:</span> |
|
|
<span class="item-field">{{ field.label }}:</span> |
|
|
|
|
|
|
|
|
<span |
|
|
<span |
|
|
v-if="field.itemType == 'select' || field.itemType == 'radio'" |
|
|
v-if=" |
|
|
|
|
|
field.itemType == 'select' || |
|
|
|
|
|
field.itemType == 'radio' || |
|
|
|
|
|
field.itemType == 'checkbox' || |
|
|
|
|
|
field.itemType == 'cascader' |
|
|
|
|
|
" |
|
|
>{{ |
|
|
>{{ |
|
|
info[field.columnName] == null |
|
|
info[field.columnName] == null |
|
|
? "--" |
|
|
? "--" |
|
|
: getOptionLabel(field.options, info[field.columnName]) |
|
|
: getOptionLabel( |
|
|
|
|
|
field.options, |
|
|
|
|
|
info[field.columnName], |
|
|
|
|
|
field.itemType |
|
|
|
|
|
) |
|
|
}}</span |
|
|
}}</span |
|
|
> |
|
|
> |
|
|
|
|
|
|
|
@ -89,16 +98,29 @@ |
|
|
<div class="item" :key="field.itemId" v-for="field in group.itemList"> |
|
|
<div class="item" :key="field.itemId" v-for="field in group.itemList"> |
|
|
<span class="item-field">{{ field.label }}:</span> |
|
|
<span class="item-field">{{ field.label }}:</span> |
|
|
<span |
|
|
<span |
|
|
v-if="field.itemType == 'select' || field.itemType == 'radio'" |
|
|
v-if=" |
|
|
|
|
|
field.itemType == 'select' || |
|
|
|
|
|
field.itemType == 'radio' || |
|
|
|
|
|
field.itemType == 'checkbox' || |
|
|
|
|
|
field.itemType == 'cascader' |
|
|
|
|
|
" |
|
|
>{{ |
|
|
>{{ |
|
|
!allInfo[group.tableName] || allInfo[group.tableName][0][field.columnName] == null |
|
|
!allInfo[group.tableName] || |
|
|
|
|
|
allInfo[group.tableName][0][field.columnName] == null |
|
|
? "--" |
|
|
? "--" |
|
|
: getOptionLabel(field.options, allInfo[group.tableName][0][field.columnName]) |
|
|
: getOptionLabel( |
|
|
|
|
|
field.options, |
|
|
|
|
|
allInfo[group.tableName][0][field.columnName], |
|
|
|
|
|
field.itemType |
|
|
|
|
|
) |
|
|
}}</span |
|
|
}}</span |
|
|
> |
|
|
> |
|
|
|
|
|
|
|
|
<span v-else>{{ |
|
|
<span v-else>{{ |
|
|
!allInfo[group.tableName] || allInfo[group.tableName][0][field.columnName] == null ? "--" : allInfo[group.tableName][0][field.columnName] |
|
|
!allInfo[group.tableName] || |
|
|
|
|
|
allInfo[group.tableName][0][field.columnName] == null |
|
|
|
|
|
? "--" |
|
|
|
|
|
: allInfo[group.tableName][0][field.columnName] |
|
|
}}</span> |
|
|
}}</span> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -214,7 +236,7 @@ export default { |
|
|
|
|
|
|
|
|
watch: { |
|
|
watch: { |
|
|
userId() { |
|
|
userId() { |
|
|
this.getInfo(); |
|
|
this.getApiData(); |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -252,12 +274,35 @@ export default { |
|
|
this.getHomeList(); |
|
|
this.getHomeList(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getOptionLabel(options, value) { |
|
|
getOptionLabel(options, value, type = "") { |
|
|
if (Array.isArray(options)) { |
|
|
if (Array.isArray(options)) { |
|
|
let item = options.find((item) => item.value == value); |
|
|
let valueArr = value.split(","); |
|
|
if (item && item.label) { |
|
|
return valueArr |
|
|
return item.label; |
|
|
.map((val) => { |
|
|
} |
|
|
if (type != "cascader") { |
|
|
|
|
|
let item = options.find((item) => item.value == val); |
|
|
|
|
|
if (item && item.label) { |
|
|
|
|
|
return item.label; |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
let idx, subIdx; |
|
|
|
|
|
options.forEach((item, index) => { |
|
|
|
|
|
if (item.children) { |
|
|
|
|
|
item.children.forEach((subitem, subIndex) => { |
|
|
|
|
|
if (subitem.value == val) { |
|
|
|
|
|
idx = index; |
|
|
|
|
|
subIdx = subIndex; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
if (idx && subIdx) { |
|
|
|
|
|
return options[idx].children[subIdx].label; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return "--"; |
|
|
|
|
|
}) |
|
|
|
|
|
.join("、"); |
|
|
} |
|
|
} |
|
|
return "--"; |
|
|
return "--"; |
|
|
}, |
|
|
}, |
|
@ -327,7 +372,7 @@ export default { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
console.log('1111111111111111111111111',this.groupList); |
|
|
console.log("1111111111111111111111111", this.groupList); |
|
|
|
|
|
|
|
|
this.groupList.forEach((subList, index) => { |
|
|
this.groupList.forEach((subList, index) => { |
|
|
subList.itemList.forEach(async (item, subIndex) => { |
|
|
subList.itemList.forEach(async (item, subIndex) => { |
|
|