优化editDialog.vm模板,添加重置表单
This commit is contained in:
parent
5988869763
commit
6918575663
@ -15,7 +15,7 @@
|
|||||||
}
|
}
|
||||||
<template>
|
<template>
|
||||||
<div class="@(@Model.LowerClassName)-container">
|
<div class="@(@Model.LowerClassName)-container">
|
||||||
<el-dialog v-model="state.isShowDialog" :width="800" draggable="" :close-on-click-modal="false">
|
<el-dialog v-model="state.isShowDialog" :width="800" draggable="" :close-on-click-modal="false" :before-close="cancel">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div style="color: #fff">
|
<div style="color: #fff">
|
||||||
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>
|
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>
|
||||||
@ -324,13 +324,20 @@ const openDialog = async (row: any) => {
|
|||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
emit("reloadTable");
|
emit("reloadTable");
|
||||||
state.isShowDialog = false;
|
state.isShowDialog = false;
|
||||||
|
resetForm();
|
||||||
};
|
};
|
||||||
|
|
||||||
// 取消
|
// 取消
|
||||||
const cancel = () => {
|
const cancel = () => {
|
||||||
state.isShowDialog = false;
|
state.isShowDialog = false;
|
||||||
|
resetForm();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 重置表单
|
||||||
|
const resetForm = () => {
|
||||||
|
ruleFormRef.value.resetFields();
|
||||||
|
}
|
||||||
|
|
||||||
// 提交
|
// 提交
|
||||||
const submit = async () => {
|
const submit = async () => {
|
||||||
ruleFormRef.value.validate(async (isValid: boolean, fields?: any) => {
|
ruleFormRef.value.validate(async (isValid: boolean, fields?: any) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user