diff --git a/src/router/index.js b/src/router/index.js index 0babe9dc..74034c36 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -82,7 +82,7 @@ export const moduleShujuRoutes = { component: () => import("@/views/main-shuju/main"), name: "main-shuju", redirect: { - name: "visual-basicinfo-basicInfoMain", + path: "/main-shuju/visual-basicinfo-basicInfoMain", }, meta: { title: "主入口布局", diff --git a/src/views/modules/visual/basicinfo/cpts/people-more.vue b/src/views/modules/visual/basicinfo/cpts/people-more.vue index dda9d374..e035760c 100644 --- a/src/views/modules/visual/basicinfo/cpts/people-more.vue +++ b/src/views/modules/visual/basicinfo/cpts/people-more.vue @@ -36,11 +36,20 @@ {{ field.label }}: {{ info[field.columnName] == null ? "--" - : getOptionLabel(field.options, info[field.columnName]) + : getOptionLabel( + field.options, + info[field.columnName], + field.itemType + ) }} @@ -81,25 +90,81 @@
-
- {{ field.label }}: - {{ - !allInfo[group.tableName] || allInfo[group.tableName][0][field.columnName] == null - ? "--" - : getOptionLabel(field.options, allInfo[group.tableName][0][field.columnName]) - }} +
+
+ {{ field.label }}: + {{ + infoItem[field.columnName] == null + ? "--" + : getOptionLabel( + field.options, + infoItem[field.columnName], + field.itemType + ) + }} + + {{ + infoItem[field.columnName] == null + ? "--" + : infoItem[field.columnName] + }} +
+
+
+
+
+ {{ field.label }}: + {{ + !allInfo[group.tableName] || + allInfo[group.tableName][0][field.columnName] == null + ? "--" + : getOptionLabel( + field.options, + allInfo[group.tableName][0][field.columnName], + field.itemType + ) + }} - {{ - !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] + }} +
@@ -214,7 +279,7 @@ export default { watch: { userId() { - this.getInfo(); + this.getApiData(); }, }, @@ -252,11 +317,35 @@ export default { this.getHomeList(); }, - getOptionLabel(options, value) { + getOptionLabel(options, value, type = "") { if (Array.isArray(options)) { - let item = options.find((item) => item.value == value); - if (item && item.label) { - return item.label; + 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) { + return item.label; + } + return "--"; + }) + .join("、"); } } return "--"; @@ -327,14 +416,13 @@ export default { } }); }); - console.log('1111111111111111111111111',this.groupList); + console.log("1111111111111111111111111", this.groupList); this.groupList.forEach((subList, index) => { subList.itemList.forEach(async (item, subIndex) => { if (item.optionSourceType == "remote" && item.optionSourceValue) { - this.groupList[index].itemList.options = await this.getOptions( - item.optionSourceValue - ); + this.groupList[index].itemList[subIndex].options = + await this.getOptions(item.optionSourceValue); } }); });