|
|
|
@ -9,9 +9,9 @@ |
|
|
|
|
<slot name="title_bottom"></slot> |
|
|
|
|
</div> |
|
|
|
|
<div class="generalDetails_card_container"> |
|
|
|
|
<div v-for="(item, index) in dataPage" :key="index"> |
|
|
|
|
<div name v-for="(item, index) in dataPage" :key="index"> |
|
|
|
|
<el-card class="generalDetails_card"> |
|
|
|
|
<div @click="isShow(item)" class="generalDetails_card_header" slot="header"> |
|
|
|
|
<div @click="isShow(item)" class="generalDetails_card_header" slot="header"> |
|
|
|
|
<div> |
|
|
|
|
<span class="generalDetails-card-header-icon"> |
|
|
|
|
<svg-icon style="color: #118dde" :icon-class="item.iconClass" /> |
|
|
|
@ -19,30 +19,37 @@ |
|
|
|
|
<span class="generalDetails-card-header-text">{{ item.title }}</span> |
|
|
|
|
</div> |
|
|
|
|
<div class="fold"> |
|
|
|
|
<i :style="{ transform: `rotate(${item.isFold ? 0 : 180}deg)` }" |
|
|
|
|
class="el-icon-arrow-down generalDetails_card_arrow_down"></i> |
|
|
|
|
<i |
|
|
|
|
:style="{ |
|
|
|
|
transform: `rotate(${item.isFold ? 0 : 180}deg)` |
|
|
|
|
}" |
|
|
|
|
class="el-icon-arrow-down generalDetails_card_arrow_down" |
|
|
|
|
></i> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div :style="{ maxHeight: item.isFold ? '100vh' : '0px' }" class="my-cell"> |
|
|
|
|
<div v-for="(i, x) in item.listData " :key="x" class="cell-item"> |
|
|
|
|
<span :title="i.remark" class="color-999 test-tst"> |
|
|
|
|
{{ i.label }} |
|
|
|
|
<i v-if="i.remark" class="header-icon el-icon-info"></i> |
|
|
|
|
<i @click="isCopy(i.value, $event)" v-if="i.isCopy" class="el-icon-document-copy"></i> |
|
|
|
|
</span> |
|
|
|
|
<br /> |
|
|
|
|
<slot class="inner-data" :name="`${i.field}`"> |
|
|
|
|
<span class="inner-data">{{ i.value }}</span> |
|
|
|
|
</slot> |
|
|
|
|
<slot :name="`${index}_car`" :item="item"> |
|
|
|
|
<div :style="{ maxHeight: item.isFold ? '100vh' : '0px' }" class="my-cell"> |
|
|
|
|
<div v-for="(i, x) in item.listData" :key="x" class="cell-item"> |
|
|
|
|
<span :title="i.remark" class="color-999 test-tst"> |
|
|
|
|
{{ i.label }} |
|
|
|
|
<i v-if="i.remark" class="header-icon el-icon-info"></i> |
|
|
|
|
<i @click="isCopy(i.value, $event)" v-if="i.isCopy" class="el-icon-document-copy"></i> |
|
|
|
|
</span> |
|
|
|
|
<br /> |
|
|
|
|
<slot class="inner-data" :name="`${i.field}`"> |
|
|
|
|
<span class="inner-data">{{ i.value }}</span> |
|
|
|
|
</slot> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</slot> |
|
|
|
|
</el-card> |
|
|
|
|
<div> |
|
|
|
|
<div > |
|
|
|
|
<slot :name="`${index}card_bottom`"></slot> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="generalDetails_footer"> |
|
|
|
|
|
|
|
|
|
<slot name="footer"> |
|
|
|
|
<el-button @click="close" type="primary" :size="$store.getters.size">关闭</el-button> |
|
|
|
|
</slot> |
|
|
|
@ -78,8 +85,10 @@ export default { |
|
|
|
|
dataPage: [] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
created() { |
|
|
|
|
(this.sourceData !== null) && (this.mappingData.length !== 0) && (this.init()) |
|
|
|
|
console.log('created') |
|
|
|
|
this.sourceData !== null && this.mappingData.length !== 0 && this.init() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
isShow(item) { |
|
|
|
@ -100,14 +109,32 @@ export default { |
|
|
|
|
listData: item.carItems.map((carItem, index) => { |
|
|
|
|
return { |
|
|
|
|
label: carItem.label, |
|
|
|
|
value: (typeof carItem.value =='function')&&(carItem.value(this.sourceData)) || this.sourceData[carItem.value] || carItem.fieldDefault || '暂无数据', |
|
|
|
|
value: |
|
|
|
|
(typeof carItem.value == 'function' && carItem.value(this.sourceData)) || |
|
|
|
|
(Array.isArray(carItem.value) && |
|
|
|
|
carItem.value.reduce((prev, current, index, _arr) => |
|
|
|
|
index == 1 |
|
|
|
|
? this.sourceData[prev] |
|
|
|
|
? this.sourceData[prev][current] !== null && this.sourceData[prev][current] !== undefined |
|
|
|
|
? this.sourceData[prev][current] |
|
|
|
|
: '暂无数据' |
|
|
|
|
: '暂无数据' |
|
|
|
|
: typeof prev == 'object' |
|
|
|
|
? prev[current] |
|
|
|
|
: prev |
|
|
|
|
)) || |
|
|
|
|
(this.sourceData[carItem.value] !== null && this.sourceData[carItem.value] !== undefined |
|
|
|
|
? String(this.sourceData[carItem.value]) |
|
|
|
|
: false) || |
|
|
|
|
carItem.fieldDefault || |
|
|
|
|
'暂无数据', |
|
|
|
|
field: carItem.value, |
|
|
|
|
remark: carItem.remark, |
|
|
|
|
isCopy: carItem.isCopy || false |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
console.log(this.dataPage) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -115,9 +142,10 @@ export default { |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style scoped> |
|
|
|
|
.title_bottom{ |
|
|
|
|
.title_bottom { |
|
|
|
|
margin-top: 20px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.fold { |
|
|
|
|
/* position: absolute; |
|
|
|
|
bottom: 0px; |
|
|
|
@ -130,7 +158,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.generalDetails_card_arrow_down { |
|
|
|
|
transition: all .9s; |
|
|
|
|
transition: all 0.9s; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.generalDetails_card_header { |
|
|
|
@ -156,7 +184,7 @@ title { |
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
max-height: 100vh; |
|
|
|
|
overflow: hidden; |
|
|
|
|
transition: all .9s; |
|
|
|
|
transition: all 0.9s; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.color-999 { |
|
|
|
@ -196,6 +224,7 @@ title { |
|
|
|
|
padding: 15px 20px; |
|
|
|
|
box-sizing: border-box; |
|
|
|
|
border-top: solid 1px #e5e5e5; |
|
|
|
|
z-index: 999999; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.generalDetails_header { |
|
|
|
|