This commit is contained in:
2024-03-29 19:03:35 +08:00
parent 84a2eab9ad
commit 8cdcb7a073
15 changed files with 485 additions and 146 deletions

View File

@@ -1,5 +1,12 @@
<template>
<a-modal v-model:visible="modal.visible" :on-before-ok="modal.submit" unmount-on-close @cancel="modal.cancel" :width="width">
<a-modal
v-model:visible="modal.visible"
:on-before-ok="modal.submit"
unmount-on-close
@cancel="modal.cancel"
:width="width"
:on-before-cancel="modal.customCancel"
>
<template #title>
{{ prop.title }}
</template>
@@ -25,7 +32,9 @@ const prop = defineProps({
default_visible: { type: Boolean, default: false }, // 默认隐藏
options: { type: Object, default: {} }, // ma-form 属性
submit: { type: Function, default: () => {} },
width :{ type:String, default:("1000"+'px')}
width: { type: String, default: "1000" + "px" },
// 自定义异步取消参数
customCancel: { type: Function, default: null }
})
const maFormRef = ref()
@@ -50,6 +59,12 @@ const modal = reactive({
}
return prop.submit(form._rawValue)
},
customCancel() {
if(prop.customCancel){
return prop.customCancel()
}
return true
},
cancel() {
emit("cancel")
}