chore(form): form-dialog放到body下

This commit is contained in:
roymondchen 2022-09-15 19:09:14 +08:00 committed by jia000
parent 3b4a57fa94
commit 39cd7d8ab7
2 changed files with 48 additions and 48 deletions

View File

@ -1,52 +1,52 @@
<template> <template>
<div> <teleport to="body">
<el-dialog <div class="m-form-dialog" v-show="dialogVisible">
v-model="dialogVisible" <el-dialog
class="m-form-dialog" v-model="dialogVisible"
top="20px" top="20px"
:title="title" :title="title"
:appendToBody="true" :width="width"
:width="width" :fullscreen="fullscreen"
:fullscreen="fullscreen" :close-on-click-modal="false"
:close-on-click-modal="false" @close="closeHandler"
@close="closeHandler" >
> <div class="m-dialog-body" :style="`max-height: ${bodyHeight}; overflow-y: auto; overflow-x: hidden;`">
<div class="m-dialog-body" :style="`max-height: ${bodyHeight}; overflow-y: auto; overflow-x: hidden;`"> <m-form
<m-form v-model="stepActive"
v-model="stepActive" ref="form"
ref="form" :size="size"
:size="size" :config="config"
:config="config" :init-values="values"
:init-values="values" :label-width="labelWidth"
:label-width="labelWidth" @change="changeHandler"
@change="changeHandler" ></m-form>
></m-form> <slot></slot>
<slot></slot> </div>
</div>
<template #footer> <template #footer>
<el-row class="dialog-footer"> <el-row class="dialog-footer">
<el-col :span="12" style="text-align: left"> <el-col :span="12" style="text-align: left">
<div style="min-height: 1px"> <div style="min-height: 1px">
<slot name="left"></slot> <slot name="left"></slot>
</div> </div>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<slot name="footer"> <slot name="footer">
<el-button @click="cancel" size="small"> </el-button> <el-button @click="cancel" size="small"> </el-button>
<el-button v-if="hasStep && stepActive > 1" type="info" size="small" @click="preStep">上一步</el-button> <el-button v-if="hasStep && stepActive > 1" type="info" size="small" @click="preStep">上一步</el-button>
<el-button v-if="hasStep && stepCount > stepActive" type="info" size="small" @click="nextStep" <el-button v-if="hasStep && stepCount > stepActive" type="info" size="small" @click="nextStep"
>下一步</el-button >下一步</el-button
> >
<el-button v-else type="primary" size="small" :loading="saveFetch" @click="save">{{ <el-button v-else type="primary" size="small" :loading="saveFetch" @click="save">{{
confirmText confirmText
}}</el-button> }}</el-button>
</slot> </slot>
</el-col> </el-col>
</el-row> </el-row>
</template> </template>
</el-dialog> </el-dialog>
</div> </div>
</teleport>
</template> </template>
<script lang="ts"> <script lang="ts">

View File

@ -97,7 +97,7 @@ export interface ContainerCommonConfig {
export interface Rule { export interface Rule {
message?: string; message?: string;
/** 系统提供的验证器类型。有string,number,boolean,method,regexp,integer,float,array,object,enum,date,url,hex,email,any */ /** 系统提供的验证器类型。有string,number,boolean,method,regexp,integer,float,array,object,enum,date,url,hex,email,any */
type: string; type?: string;
/** 是否必填 */ /** 是否必填 */
required?: boolean; required?: boolean;
/** 自定义验证器 */ /** 自定义验证器 */