# 对话框

# 新增/修改/查看对话框

封装好的新增/修改/查看数据处理逻辑

查看对话框Dialog40代码 复制
 
打开对话框[查看] 打开对话框[新增] 打开对话框[修改]

<template>
    <div>
        <el-row style="margin-bottom:5px;" >
            <ShowRemoteCodeDialog codeRawUrl="https://gitee.com/shoukaiseki/sks-plugin-el-erp/blob/master/docs/.vuepress/example/dialog/Dialog40.vue" button-label="查看对话框Dialog40代码"/>
        </el-row>
        <el-row>
        <el-button type="primary" @click="handleInfo()">打开对话框[查看]</el-button>
        <el-button type="primary" @click="handleAdd()">打开对话框[新增]</el-button>
        <el-button type="primary" @click="handleEdit()">打开对话框[修改]</el-button>
        </el-row>
        <Dialog40 ref="dialog40Ref"/>
    </div>
</template>
<script>
    export default {
        mixins: [
        ],
        data() {
            return {}
        },
        methods: {
            handleAdd({data,title='新增'}={}){
                this.$refs.dialog40Ref.show({
                    form:this.sksUtils.mergeFromObject({},data,{
                        payMode: 1,
                        virtualChangeBitFlag: this.sksUtils.CHANGE_BIT_FLAG.add,

                    }),
                    dialogInfo:{
                        title: title,
                        submitCallbackSuccess:({resData}={})=>{
                            this.sksUtils.msgSuccess(`新增后回调`+JSON.stringify(resData,null))
                        },
                    }
                })
            },
            handleEdit(){
                this.$refs.dialog40Ref.showByUniqueId({
                    uniqueId: 1,
                    dialogInfo: {
                       title: '修改' 
                    },
                    virtualChangeBitFlag: this.sksUtils.CHANGE_BIT_FLAG.modify,
                })
            },
            handleInfo(){
                this.$refs.dialog40Ref.showByUniqueId({
                    uniqueId: 1,
                    dialogInfo: {
                        title: '查看'
                    },
                    virtualChangeBitFlag: this.sksUtils.CHANGE_BIT_FLAG.none,
                })
            },
        }
    }
</script>
<!--

-->
显示代码 复制代码
最后更新时间: 2022/8/30 17:16:22