From c7bd6db3190ff5c4b55d004db0b9fa944604925f Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期五, 18 十月 2024 11:09:15 +0800 Subject: [PATCH] Merge branch 'lsf-topTask' --- src/components/form/FYForm.vue | 45 ++++++++++++++++++++++++++++++++------------- 1 files changed, 32 insertions(+), 13 deletions(-) diff --git a/src/components/form/FYForm.vue b/src/components/form/FYForm.vue index 9c5405e..f8654cc 100644 --- a/src/components/form/FYForm.vue +++ b/src/components/form/FYForm.vue @@ -9,10 +9,16 @@ > <slot name="form-item" :formObj="formObj"></slot> <el-form-item v-if="showButtons"> - <el-button :disabled="!edit" type="primary" @click="onSubmit" :loading="loading" - >鎻愪氦</el-button + <el-button + :disabled="!edit" + type="primary" + @click="onSubmit" + :loading="loading" + >{{ submitName }}</el-button > - <el-button v-if="useReset" :disabled="!edit" @click="onReset">閲嶇疆</el-button> + <el-button v-if="useReset" :disabled="!edit" @click="onReset" + >閲嶇疆</el-button + > <el-button v-if="useCancel" @click="onCancel">鍙栨秷</el-button> </el-form-item> </el-form> @@ -26,7 +32,15 @@ * 鍙紶鍏ュ垵濮嬭〃鍗曟暟鎹甪ormInfo锛岃〃鍗曟牎楠岃鍒檙ules * 瀹炵幇submit鍜宑ancel瑙﹀彂鍑芥暟 */ -import { defineProps, defineEmits, reactive, ref, watch, computed, defineExpose } from 'vue'; +import { + defineProps, + defineEmits, + reactive, + ref, + watch, + computed, + defineExpose +} from 'vue'; import { useFormConfirm } from '@/composables/formConfirm'; const props = defineProps({ @@ -42,6 +56,10 @@ showButtons: { type: Boolean, default: true + }, + submitName: { + type: String, + default: '鎻愪氦' }, //鍙栨秷鎸夐挳鏄惁鍙敤 useCancel: Boolean, @@ -81,14 +99,15 @@ }); //琛ㄥ崟鎿嶄綔鍑芥暟 -const { formObj, formRef, edit, onSubmit, onCancel, onReset, clear } = useFormConfirm({ - submit: { - do: submit - }, - cancel: { - do: cancel - } -}); +const { formObj, formRef, edit, onSubmit, onCancel, onReset, clear } = + useFormConfirm({ + submit: { + do: submit + }, + cancel: { + do: cancel + } + }); //鍔犺浇鐘舵�� const loading = ref(false); @@ -106,7 +125,7 @@ }, (err) => { loading.value = false; - reject(err); + reject(err ? err : ''); } ); }); -- Gitblit v1.9.3