97 lines
1.6 KiB
Vue
97 lines
1.6 KiB
Vue
<template>
|
|
<tpx-dialog :show="show" :title="title" @onClose="handleCloseModal()" rootStyle="min-height:auto;">
|
|
<view :style="cptStyle">
|
|
<tpx-layout>
|
|
<template v-slot:body>
|
|
<slot v-if="show" :value="submitVals"></slot>
|
|
</template>
|
|
|
|
<template v-slot:footer>
|
|
<view class="blcok-white-noradius" style="margin-top: 0;margin-bottom: 0;">
|
|
<u-button @click="handleSubmitValue()" type="primary" size="large" shape="circle"
|
|
custom-style="height:80rpx;font-size: 30rpx;"
|
|
>确认</u-button>
|
|
</view>
|
|
</template>
|
|
</tpx-layout>
|
|
</view>
|
|
</tpx-dialog>
|
|
</template>
|
|
|
|
<script>
|
|
|
|
export default {
|
|
computed:{
|
|
cptStyle(){
|
|
let sty = `position: relative;height: calc(${this.percentHeight}vh);`
|
|
return sty
|
|
}
|
|
},
|
|
components: { },
|
|
watch: {
|
|
show(v){
|
|
if(v) {
|
|
this.submitVals = JSON.parse(JSON.stringify(this.value))
|
|
}
|
|
}
|
|
},
|
|
props: {
|
|
title: {
|
|
default () {
|
|
return ''
|
|
}
|
|
},
|
|
percentHeight: {
|
|
default () {
|
|
return 60
|
|
}
|
|
},
|
|
show: {
|
|
default () {
|
|
return false
|
|
}
|
|
},
|
|
value: {
|
|
default () {
|
|
return {
|
|
}
|
|
}
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
submitVals: {}
|
|
}
|
|
},
|
|
created() {
|
|
|
|
},
|
|
onHide() {
|
|
},
|
|
unmounted() {
|
|
},
|
|
|
|
methods: {
|
|
handleCloseModal() {
|
|
this.$emit('update:show', false)
|
|
this.$emit('onClose')
|
|
},
|
|
handleSubmitValue() {
|
|
const val = this.submitVals
|
|
this.$emit('onSure', val)
|
|
this.$emit('update:value', val)
|
|
this.handleCloseModal()
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.shet-cont{
|
|
padding: 10rpx 0 30rpx 0;
|
|
}
|
|
.jsfm-item{
|
|
margin-top: 30rpx;
|
|
}
|
|
|
|
</style> |