|
@@ -1,87 +1,109 @@
|
|
<template>
|
|
<template>
|
|
- <div class="item-table">
|
|
|
|
- <div class="table-list" v-for="item in tableNames" :key="item">
|
|
|
|
- <div class="lable">{{ item.lable }}</div>
|
|
|
|
- <span class="text" v-if="!!item.format && item.const">{{ item.format()}}</span>
|
|
|
|
- <span class="text" v-else-if="!!item.format && !!item.const">{{ item.format(params.data[item['prop']]) || '--' }}</span>
|
|
|
|
- <div class="text" v-else-if="item.prop === 'nation'">{{ tabDatas['nation'] | matchingVal(nationArray) }}</div>
|
|
|
|
- <div class="text" v-else-if="item.prop === 'communityId'">{{ tabDatas['communityId'] | matchingVal(communityArray) }}</div>
|
|
|
|
- <div class="text" v-else-if="!!item.typeArray">{{ tabDatas[item.prop] | matchingVal(item.typeArray) }}</div>
|
|
|
|
- <div class="text" v-else>{{ tabDatas[item.prop] || ' --' }}</div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div class="item-table">
|
|
|
|
+ <div
|
|
|
|
+ class="table-list"
|
|
|
|
+ v-for="item in tableNames"
|
|
|
|
+ :key="item"
|
|
|
|
+ >
|
|
|
|
+ <div class="lable">{{ item.lable }}</div>
|
|
|
|
+ <span
|
|
|
|
+ class="text"
|
|
|
|
+ v-if="!!item.format && item.const"
|
|
|
|
+ >{{ item.format()}}</span>
|
|
|
|
+ <span
|
|
|
|
+ class="text"
|
|
|
|
+ v-else-if="!!item.format && !!item.const"
|
|
|
|
+ >{{ item.format(params.data[item['prop']]) || '--' }}</span>
|
|
|
|
+ <div
|
|
|
|
+ class="text"
|
|
|
|
+ v-else-if="item.prop === 'nation'"
|
|
|
|
+ >{{ tabDatas['nation'] | matchingVal(nationArray) }}</div>
|
|
|
|
+ <div
|
|
|
|
+ class="text"
|
|
|
|
+ v-else-if="item.prop === 'communityId'"
|
|
|
|
+ >{{ tabDatas['communityId'] | matchingVal(communityArray) }}</div>
|
|
|
|
+ <div
|
|
|
|
+ class="text"
|
|
|
|
+ v-else-if="!!item.typeArray"
|
|
|
|
+ >{{ tabDatas[item.prop] | matchingVal(item.typeArray) }}</div>
|
|
|
|
+ <div
|
|
|
|
+ class="text"
|
|
|
|
+ v-else
|
|
|
|
+ >{{ tabDatas[item.prop] || ' --' }}</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import Vue from 'vue';
|
|
import Vue from 'vue';
|
|
let _this = this;
|
|
let _this = this;
|
|
export default {
|
|
export default {
|
|
- name: 'householdTable',
|
|
|
|
- data() {
|
|
|
|
- return {};
|
|
|
|
|
|
+ name: 'householdTable',
|
|
|
|
+ data () {
|
|
|
|
+ return {};
|
|
|
|
+ },
|
|
|
|
+ props: {
|
|
|
|
+ tableName: {
|
|
|
|
+ type: Array
|
|
},
|
|
},
|
|
- props: {
|
|
|
|
- tableName: {
|
|
|
|
- type: Array
|
|
|
|
- },
|
|
|
|
- tabData: {
|
|
|
|
- type: Object
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- filters: {
|
|
|
|
- matchingVal(val, arr) {
|
|
|
|
- // let v = '--';
|
|
|
|
- // if (!!val) {
|
|
|
|
- // arr.forEach((item) => {
|
|
|
|
- // if (!!item.code && item.code === val) {
|
|
|
|
- // v = item.name;
|
|
|
|
- // } else if (item.type === val) {
|
|
|
|
- // v = item.lable;
|
|
|
|
- // } else if (!!item.communityName && item.id === val) {
|
|
|
|
- // v = item.communityName;
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- // }
|
|
|
|
- // return v;
|
|
|
|
|
|
+ tabData: {
|
|
|
|
+ type: Object
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ filters: {
|
|
|
|
+ matchingVal (val, arr) {
|
|
|
|
+ // let v = '--';
|
|
|
|
+ // if (!!val) {
|
|
|
|
+ // arr.forEach((item) => {
|
|
|
|
+ // if (!!item.code && item.code === val) {
|
|
|
|
+ // v = item.name;
|
|
|
|
+ // } else if (item.type === val) {
|
|
|
|
+ // v = item.lable;
|
|
|
|
+ // } else if (!!item.communityName && item.id === val) {
|
|
|
|
+ // v = item.communityName;
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
+ // return v;
|
|
|
|
|
|
- let v = '--';
|
|
|
|
- let newDa;
|
|
|
|
- if (!!val) {
|
|
|
|
- try {
|
|
|
|
- v = '';
|
|
|
|
- newDa = val.split(':');
|
|
|
|
- newDa.forEach((item, index) => {
|
|
|
|
- v += item + arr[index].lable;
|
|
|
|
- });
|
|
|
|
- } catch (e) {}
|
|
|
|
|
|
+ let v = '--';
|
|
|
|
+ let newDa;
|
|
|
|
+ if (!!val) {
|
|
|
|
+ try {
|
|
|
|
+ v = '';
|
|
|
|
+ newDa = val.split(':');
|
|
|
|
+ newDa.forEach((item, index) => {
|
|
|
|
+ v += item + arr[index].lable;
|
|
|
|
+ });
|
|
|
|
+ } catch (e) { }
|
|
|
|
|
|
- arr.forEach((item) => {
|
|
|
|
- if (!!item.code && item.code === val) {
|
|
|
|
- v = item.name;
|
|
|
|
- } else if (item.type === val) {
|
|
|
|
- v = item.lable;
|
|
|
|
- } else if (!!item.communityName && item.id === val) {
|
|
|
|
- v = item.communityName;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- return v;
|
|
|
|
- }
|
|
|
|
|
|
+ arr.forEach((item) => {
|
|
|
|
+ if (!!item.code && item.code === val) {
|
|
|
|
+ v = item.name;
|
|
|
|
+ } else if (item.type === val) {
|
|
|
|
+ v = item.lable;
|
|
|
|
+ } else if (!!item.communityName && item.id === val) {
|
|
|
|
+ v = item.communityName;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ return v;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ tableNames () {
|
|
|
|
+ return this.tableName;
|
|
|
|
+ },
|
|
|
|
+ tabDatas () {
|
|
|
|
+ return this.tabData;
|
|
},
|
|
},
|
|
- computed: {
|
|
|
|
- tableNames() {
|
|
|
|
- return this.tableName;
|
|
|
|
- },
|
|
|
|
- tabDatas() {
|
|
|
|
- return this.tabData;
|
|
|
|
- },
|
|
|
|
- nationArray() {
|
|
|
|
- return this.$store.getters['getNationArray'];
|
|
|
|
- },
|
|
|
|
- communityArray() {
|
|
|
|
- return this.$store.getters['getCommunityArray'];
|
|
|
|
- }
|
|
|
|
|
|
+ nationArray () {
|
|
|
|
+ return this.$store.getters['getNationArray'];
|
|
},
|
|
},
|
|
- created() {}
|
|
|
|
|
|
+ communityArray () {
|
|
|
|
+ return this.$store.getters['getCommunityArray'];
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ created () { }
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
<style lang='scss' scoped >
|
|
<style lang='scss' scoped >
|