<template>
<view class="cu-form-group">
<view style="width: 20px; height: 20px;">
</view>
<view class="title">77777{{title}}</view>
<view class="regions" @tap="showModal">
{{formType}}
{{formType !== 'query'?'请编辑':'请查看'}}
{{itemOption}}
batchResult{{batchResult}}
</view>
<text class="cuIcon-right"></text>
</view>
</template>
<script>
import {
mapActions,
mapGetters
} from 'vuex'
export default {
model: {
prop: 'batchValue',
event: 'moduleBatchEvent'
},
props: {
//标题
title: {
type: String,
default: 'fffff'
},
//详情 query 编辑 edit
formType: {
type: String,
default: ''
},
//配置信息
itemOption: {
type: Object,
default () {
return {}
}
},
//联动ref,下拉
itemRef: {
type: String,
default: ''
},
//值
batchValue: { type: Array, default:()=>([])}
},
computed: {
...mapGetters({cusmoduleMap:'cusmoduleMap'})
},
watch:{
batchValue: {
handler: function(val) {
console.log('20210818===batchValue:', val)
this.batchResult = val
},
deep: true,
immediate: true
},
formType: {
handler: function(val) {
console.log('20210818===batchValue:', val)
//this.batchResult = val
},
deep: true,
immediate: true
}
},
data() {
return {
// batchResult: this.batchValue
batchResult:'sssss',
title:'33333'
}
},
methods: {
...mapActions([]),
showModal() {
const thiz = this
const params = encodeURIComponent(JSON.stringify({
title: this.title,
otherTableRelation: this.itemOption.otherTableRelation,
curFormType: this.itemOption.words?'detail':'edit',
alas: this.itemOption.alas,
batchRef: this.itemRef
}));
console.log('--itemOption===:', this.itemOption, thiz.batchValue)
uni.navigateTo({
url:/components/module-form/module-batchentry/MBatchentry?params=${params}
,
success(res) {
res.eventChannel.emit('acceptDataFromOpenerPage', { data: thiz.batchValue })
}
})
},
setBatchValue(res) {
this.$emit('moduleBatchEvent', res)
}
}
}
</script>
其中title为undefined
0 个回复