emis-sapp/components/buns-edit-sheet/buns-edit-sheet.vue
2024-06-13 16:08:39 +08:00

102 lines
1.7 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 {
}
}
},
okCloseModal: {
default () {
return true
}
},
},
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.okCloseModal && this.handleCloseModal()
}
}
}
</script>
<style scoped lang="scss">
.shet-cont{
padding: 10rpx 0 30rpx 0;
}
.jsfm-item{
margin-top: 30rpx;
}
</style>