Browse Source

Merge branch 'dev-shuju' of http://git.elinkit.com.cn:7070/r/epmet-oper-gov into dev-shuju

shibei_master
jiangyy 4 years ago
parent
commit
ba0f16fead
  1. 2
      src/router/index.js
  2. 118
      src/views/modules/visual/basicinfo/cpts/people-more.vue

2
src/router/index.js

@ -82,7 +82,7 @@ export const moduleShujuRoutes = {
component: () => import("@/views/main-shuju/main"), component: () => import("@/views/main-shuju/main"),
name: "main-shuju", name: "main-shuju",
redirect: { redirect: {
name: "visual-basicinfo-basicInfoMain", path: "/main-shuju/visual-basicinfo-basicInfoMain",
}, },
meta: { meta: {
title: "主入口布局", title: "主入口布局",

118
src/views/modules/visual/basicinfo/cpts/people-more.vue

@ -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
> >
@ -81,27 +90,83 @@
</div> </div>
<div <div
class="list"
:key="'group' + index" :key="'group' + index"
v-show="groupIndex % groupList.length == index" v-show="groupIndex % groupList.length == index"
v-for="(group, index) in groupList" v-for="(group, index) in groupList"
> >
<div class="item" :key="field.itemId" v-for="field in group.itemList"> <div v-if="group.tableName == 'ic_resi_demand' && Array.isArray(allInfo.ic_resi_demand) && allInfo.ic_resi_demand.length>0">
<div
class="list"
:key="'ic_resi_demand' + infoIndex"
v-for="(infoItem, infoIndex) in allInfo.ic_resi_demand"
>
<div
class="item"
:key="field.itemId"
v-for="field in group.itemList"
>
<span class="item-field">{{ field.label }}</span>
<span
v-if="
field.itemType == 'select' ||
field.itemType == 'radio' ||
field.itemType == 'checkbox' ||
field.itemType == 'cascader'
"
>{{
infoItem[field.columnName] == null
? "--"
: getOptionLabel(
field.options,
infoItem[field.columnName],
field.itemType
)
}}</span
>
<span v-else>{{
infoItem[field.columnName] == null
? "--"
: infoItem[field.columnName]
}}</span>
</div>
</div>
</div>
<div class="list" v-else>
<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>
</div>
</cpt-card> </cpt-card>
</div> </div>
</div> </div>
@ -214,7 +279,7 @@ export default {
watch: { watch: {
userId() { userId() {
this.getInfo(); this.getApiData();
}, },
}, },
@ -252,12 +317,36 @@ 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 (type == "cascader") {
if (valueArr.length > 0) {
let level1 = options.find((item) => item.value == valueArr[0]);
console.log("----------------------- cascader", options);
if (level1) {
if (valueArr.length > 1 && level1.children) {
let level2 = level1.children.find(
(item) => item.value == valueArr[1]
);
if (level2) {
return level1.label + "-" + level2.label;
}
}
return level1.label;
}
}
} else {
return valueArr
.map((val) => {
let item = options.find((item) => item.value == val);
if (item && item.label) { if (item && item.label) {
return item.label; return item.label;
} }
return "--";
})
.join("、");
}
} }
return "--"; return "--";
}, },
@ -327,14 +416,13 @@ 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) => {
if (item.optionSourceType == "remote" && item.optionSourceValue) { if (item.optionSourceType == "remote" && item.optionSourceValue) {
this.groupList[index].itemList.options = await this.getOptions( this.groupList[index].itemList[subIndex].options =
item.optionSourceValue await this.getOptions(item.optionSourceValue);
);
} }
}); });
}); });

Loading…
Cancel
Save