+
{{ field.label }}:
- {{
+ ">{{
!allInfo[group.tableName] ||
allInfo[group.tableName][0][field.columnName] == null
? "--"
@@ -200,8 +170,7 @@
allInfo[group.tableName][0][field.columnName],
field.itemType
)
- }}
+ }}
{{
!allInfo[group.tableName] ||
@@ -240,7 +209,7 @@ export default {
cptTb,
},
- data() {
+ data () {
return {
fieldList: [],
groupList: [],
@@ -348,11 +317,11 @@ export default {
},
computed: {
- isShundeju() {
+ isShundeju () {
return this.$store.state.user.customerId == "1550309684576591874";
},
- xiaoquName() {
+ xiaoquName () {
const {
xiaoquList,
info: { VILLAGE_ID },
@@ -365,7 +334,7 @@ export default {
}
return "";
},
- louName() {
+ louName () {
const {
louList,
info: { BUILD_ID },
@@ -378,7 +347,7 @@ export default {
}
return "";
},
- danyuanName() {
+ danyuanName () {
const {
danyuanList,
info: { UNIT_ID },
@@ -391,7 +360,7 @@ export default {
}
return "";
},
- danyuanName() {
+ danyuanName () {
const {
danyuanList,
info: { UNIT_ID },
@@ -404,7 +373,7 @@ export default {
}
return "";
},
- homeName() {
+ homeName () {
const {
homeList,
info: { HOME_ID },
@@ -420,17 +389,17 @@ export default {
},
watch: {
- userId() {
+ userId () {
this.getApiData();
},
},
- mounted() {
+ mounted () {
this.getApiData();
},
methods: {
- addStartGroupIndex() {
+ addStartGroupIndex () {
const { startGroupIndex, groupList } = this;
if (startGroupIndex < groupList.length - 9) {
this.startGroupIndex = startGroupIndex + 1;
@@ -438,7 +407,7 @@ export default {
this.startGroupIndex = groupList.length - 9;
}
},
- subStartGroupIndex() {
+ subStartGroupIndex () {
const { startGroupIndex, groupList } = this;
if (startGroupIndex > 0) {
this.startGroupIndex = startGroupIndex - 1;
@@ -446,11 +415,11 @@ export default {
this.startGroupIndex = 0;
}
},
- handleClose() {
+ handleClose () {
this.$emit("close");
},
- async getApiData() {
+ async getApiData () {
await this.getField();
await this.getInfo();
this.getDetailList();
@@ -460,24 +429,14 @@ export default {
this.getHomeList();
},
- getOptionLabel(options, value, type = "") {
+ getOptionLabel (options, value, type = "") {
+ console.log(options, value, type)
if (Array.isArray(options)) {
let valueArr = value.split(",");
if (type == "cascader") {
- if (valueArr.length > 0) {
- let level1 = options.find((item) => item.value == valueArr[0]);
- 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;
- }
- }
+ let finalValue = [];
+ this.getNodePath(options, value, finalValue);
+ return finalValue.join("-");
} else {
return valueArr
.map((val) => {
@@ -493,8 +452,27 @@ export default {
return "--";
},
+ getNodePath (node, val, path) {
+ // node:所有数据,val:后台返回的id, path:要渲染的数组id
+ for (let i = 0; i < node.length; i++) {
+ const ele = node[i];
+ if (ele.value === val) {
+ path.push(ele.label);
+ return path;
+ } else if (ele.children && ele.children.length > 0) {
+ if (ele.children.some((row) => row.value === val)) {
+ path.unshift(ele.label);
+ this.getNodePath(ele.children, val, path);
+ } else {
+ this.getNodePath(ele.children, val, path);
+ }
+ }
+ }
+ return path;
+ },
+
//加载组织数据
- async getField() {
+ async getField () {
const url = "/oper/customize/icform/getcustomerform";
const { data, code, msg } = await requestPost(url, {
@@ -534,7 +512,7 @@ export default {
},
//加载组织数据
- async getInfo() {
+ async getInfo () {
const url = "/epmetuser/icresiuser/detail";
const { data, code, msg } = await requestPost(url, {
@@ -608,7 +586,7 @@ export default {
}
},
- async getDetailList() {
+ async getDetailList () {
const url = "/epmetuser/epidemicPrevention/info";
let params = {
id: this.userId,
@@ -654,7 +632,7 @@ export default {
},
//加载组织数据
- async getOptions(url) {
+ async getOptions (url) {
if (!url) return [];
const { data, code, msg } = await requestPost(url, {});
@@ -666,7 +644,7 @@ export default {
}
},
- async getXiaoquList() {
+ async getXiaoquList () {
const url = "/gov/org/icneighborhood/neighborhoodoption";
const { data, code, msg } = await requestPost(url, {
@@ -680,7 +658,7 @@ export default {
this.$message.error(msg);
}
},
- async getLouList() {
+ async getLouList () {
const url = "/gov/org/icbuilding/buildingoption";
const { data, code, msg } = await requestPost(url, {
@@ -693,7 +671,7 @@ export default {
this.$message.error(msg);
}
},
- async getDanyuanList() {
+ async getDanyuanList () {
const url = "/gov/org/icbuildingunit/unitoption";
const { data, code, msg } = await requestPost(url, {
@@ -706,7 +684,7 @@ export default {
this.$message.error(msg);
}
},
- async getHomeList() {
+ async getHomeList () {
const url = "/gov/org/ichouse/houseoption";
const { data, code, msg } = await requestPost(url, {