更新
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="generalDetails_body">
|
||||
<div class="generalDetails_body pft14">
|
||||
<div class="generalDetails_header" v-if="isHeader">
|
||||
<slot name="generalDetails_header">
|
||||
{{ title }}
|
||||
@@ -79,8 +79,8 @@ export default {
|
||||
name: "generalDetails",
|
||||
props: {
|
||||
sourceData: {
|
||||
type: Object,
|
||||
default: () => null,
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
mappingData: {
|
||||
type: Array,
|
||||
@@ -101,6 +101,7 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// return console.log("this.sourceData", this.sourceData);
|
||||
this.sourceData !== null && this.mappingData.length !== 0 && this.init();
|
||||
},
|
||||
methods: {
|
||||
@@ -114,18 +115,44 @@ export default {
|
||||
this.$emit("close");
|
||||
},
|
||||
init() {
|
||||
this.dataPage = this.mappingData.map((item) => {
|
||||
this.dataPage = this.mappingData.map(
|
||||
(mappingDataItem, mappingDataIndex) => {
|
||||
let shineData = this.sourceData[mappingDataIndex];
|
||||
return {
|
||||
title: mappingDataItem.carTitle,
|
||||
iconClass: mappingDataItem.iconClass || "iconjichuziliao",
|
||||
isFold: mappingDataItem.isFold || true,
|
||||
listData: mappingDataItem.carItems.map((carItem) => {
|
||||
return {
|
||||
label: carItem.label,
|
||||
value:
|
||||
(typeof carItem.value == "function" &&
|
||||
carItem.value(shineData)) ||
|
||||
shineData[carItem.value] ||
|
||||
carItem.fieldDefault ||
|
||||
"暂无数据",
|
||||
field: carItem.value,
|
||||
remark: carItem.remark,
|
||||
isCopy: carItem.isCopy || false,
|
||||
};
|
||||
}),
|
||||
};
|
||||
}
|
||||
);
|
||||
console.log("this.dataPage", this.dataPage);
|
||||
return;
|
||||
this.dataPage = this.mappingData.map((item, index) => {
|
||||
return {
|
||||
title: item.carTitle,
|
||||
iconClass: item.iconClass || "iconjichuziliao",
|
||||
isFold: item.isFold || true,
|
||||
listData: item.carItems.map((carItem, index) => {
|
||||
listData: item.carItems.map((carItem) => {
|
||||
return {
|
||||
label: carItem.label,
|
||||
value:
|
||||
(typeof carItem.value == "function" &&
|
||||
carItem.value(this.sourceData)) ||
|
||||
this.sourceData[carItem.value] ||
|
||||
carItem.value(this.sourceData[index])) ||
|
||||
this.sourceData[index][carItem.value] ||
|
||||
carItem.fieldDefault ||
|
||||
"暂无数据",
|
||||
field: carItem.value,
|
||||
@@ -140,7 +167,7 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style lang="scss" scoped>
|
||||
.title_bottom {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user