|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<el-row>
|
|
|
- <el-col v-for="(item, index) in customs" :key="index" :span="12" class="Layout_space_between">
|
|
|
- <span v-show="item.bools" class="parent-style">
|
|
|
+ <el-col v-for="(item, index) in data.customFields" :key="index" :span="12" class="Layout_space_between">
|
|
|
+ <span v-show="item.bool" class="parent-style">
|
|
|
<span class="parent-fieldName">{{ item.fieldName }}:</span>
|
|
|
<span v-if="item.type !== 4">{{ item.content }}</span>
|
|
|
<span v-else>{{ item.contents.join(',') }}</span>
|
|
@@ -14,42 +14,42 @@
|
|
|
export default {
|
|
|
props: {
|
|
|
data: { type: Object, required: true }
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- customs: []
|
|
|
- }
|
|
|
- },
|
|
|
- watch: {
|
|
|
- data: {
|
|
|
- handler(newV) {
|
|
|
- if (newV.customFields) {
|
|
|
- this.customs = newV.customFields.map(item => ({
|
|
|
- ...item,
|
|
|
- bools: item.conditions === '默认展示' || this.getBoolValue(item.conditions)
|
|
|
- }))
|
|
|
- }
|
|
|
- },
|
|
|
- immediate: true
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- getBoolValue(conditions) {
|
|
|
- const checkList = []
|
|
|
- this.customs.forEach(item => {
|
|
|
- if (item.content && item.type < 4) {
|
|
|
- checkList.push(`${item.fieldKey}_${item.content}`)
|
|
|
- }
|
|
|
- if (item.contents && item.type === 4) {
|
|
|
- item.contents.forEach(contentItem => {
|
|
|
- checkList.push(`${item.fieldKey}_${contentItem}`)
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- console.log(checkList.indexOf(conditions) !== -1)
|
|
|
- return checkList.indexOf(conditions) !== -1
|
|
|
- }
|
|
|
}
|
|
|
+ // data() {
|
|
|
+ // return {
|
|
|
+ // customs: []
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // watch: {
|
|
|
+ // data: {
|
|
|
+ // handler(newV) {
|
|
|
+ // if (newV.customFields) {
|
|
|
+ // this.customs = newV.customFields.map(item => ({
|
|
|
+ // ...item,
|
|
|
+ // bools: item.conditions === '默认展示' || this.getBoolValue(item.conditions)
|
|
|
+ // }))
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // immediate: true
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // methods: {
|
|
|
+ // getBoolValue(conditions) {
|
|
|
+ // const checkList = []
|
|
|
+ // this.customs.forEach(item => {
|
|
|
+ // if (item.content && item.type < 4) {
|
|
|
+ // checkList.push(`${item.fieldKey}_${item.content}`)
|
|
|
+ // }
|
|
|
+ // if (item.contents && item.type === 4) {
|
|
|
+ // item.contents.forEach(contentItem => {
|
|
|
+ // checkList.push(`${item.fieldKey}_${contentItem}`)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // console.log(checkList.indexOf(conditions) !== -1)
|
|
|
+ // return checkList.indexOf(conditions) !== -1
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
</script>
|
|
|
|