jinlin
2023-12-12 0dff85a422669f41ef6d8e88fa24bf26ca164cbd
web/packages/components/zt-dialog/src/zt-dialog.vue
@@ -25,13 +25,13 @@
              <el-button type="warning" @click="formSubmit('zc')">暂存</el-button>
              <el-button type="warning" @click="formSubmit('bl')">办理</el-button>
            </template>
            <el-button type="primary" @click="formSubmit('qd')" v-preventReClick v-else-if="editAble && hasConfirm">{{
        <el-button v-else-if="editAble && hasConfirm" type="primary" @click="formSubmit('qd')" v-preventReClick>{{
                $t('confirm') }}
            </el-button>
            <el-button type="warning" @click="formSubmit('bc')" v-else-if="editAble">保存
        <el-button v-else-if="editAble" type="warning" @click="formSubmit('bc')">保存
            </el-button>
            <el-button @click="visible = false" v-if="editAble||stepMarker">{{ $t('cancel') }}</el-button>
        <el-button type="info" @click="visible = false" v-if="editAble||stepMarker">{{ $t('cancel') }}</el-button>
            <el-button type="info" @click="close()" v-else>{{ $t('close') }}</el-button>
          </template>
            <slot name="footer"></slot>
@@ -60,7 +60,7 @@
            },
            editAble: {
                type: Boolean,
                default: true
        default: false
            },
            hasSubmit: {
                type: Boolean,
@@ -75,7 +75,7 @@
            return {
                dataFormBack: null,
                visible: false,
                isView:true,
        isView: false,
                //editAble: true // 是否可编辑
            }
        },
@@ -95,6 +95,7 @@
        },
        methods: {
            init(id, row, isView) {
        this.isView = isView
                this.$nextTick(() => {
                    // 清空表单校验
                    console.log(this.$parent.$refs.dataForm, id, row, isView, 'this.$parent.$refs.dataForm')
@@ -102,9 +103,8 @@
                        this.$parent.$refs.dataForm.resetFields()
                    }
                    // this.editAble = isView !== true // 是否可编辑
          this.editAble = isView !== true // 是否可编辑
                    // 设置dialog父页面初始化表单
                    this.$parent.dataForm = cloneDeep(this.dataFormBack)
                    if (this.$parent.dataForm) {
                        this.$parent.dataForm.id = id