emis-app/components/buns-edit-sheet/buns-edit-sheet.vue

102 lines
1.7 KiB
Vue
Raw Normal View History

2023-12-18 16:30:33 +00:00
<template>
2024-06-11 03:25:41 +00:00
<tpx-dialog :show="show" :title="title" @onClose="handleCloseModal()" rootStyle="min-height:auto;">
<view :style="cptStyle">
2023-12-18 16:30:33 +00:00
<tpx-layout>
<template v-slot:body>
2024-01-30 07:40:49 +00:00
<slot v-if="show" :value="submitVals"></slot>
2023-12-18 16:30:33 +00:00
</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>
2024-01-30 07:40:49 +00:00
2023-12-18 16:30:33 +00:00
export default {
2024-06-11 03:25:41 +00:00
computed:{
cptStyle(){
let sty = `position: relative;height: calc(${this.percentHeight}vh);`
return sty
}
},
2024-01-30 07:40:49 +00:00
components: { },
2024-01-29 06:07:42 +00:00
watch: {
2024-01-29 07:03:57 +00:00
show(v){
if(v) {
this.submitVals = JSON.parse(JSON.stringify(this.value))
}
2024-01-29 06:07:42 +00:00
}
},
2023-12-18 16:30:33 +00:00
props: {
2024-01-30 07:40:49 +00:00
title: {
default () {
return ''
}
},
percentHeight: {
default () {
return 60
}
},
2023-12-18 16:30:33 +00:00
show: {
default () {
return false
}
},
value: {
default () {
2024-01-29 06:07:42 +00:00
return {
}
2023-12-18 16:30:33 +00:00
}
2024-06-13 08:06:13 +00:00
},
okCloseModal: {
default () {
return true
}
},
2023-12-18 16:30:33 +00:00
},
data() {
return {
2024-01-29 06:07:42 +00:00
submitVals: {}
2023-12-18 16:30:33 +00:00
}
},
created() {
},
onHide() {
},
2024-01-29 06:07:42 +00:00
unmounted() {
},
2023-12-18 16:30:33 +00:00
methods: {
handleCloseModal() {
this.$emit('update:show', false)
2024-03-04 11:09:51 +00:00
this.$emit('onClose')
2023-12-18 16:30:33 +00:00
},
2024-01-29 06:07:42 +00:00
handleSubmitValue() {
const val = this.submitVals
this.$emit('onSure', val)
this.$emit('update:value', val)
2024-06-13 08:06:13 +00:00
this.okCloseModal && this.handleCloseModal()
2023-12-18 16:30:33 +00:00
}
}
}
</script>
<style scoped lang="scss">
.shet-cont{
padding: 10rpx 0 30rpx 0;
}
.jsfm-item{
margin-top: 30rpx;
}
</style>