export const commonMixin = {
    data() {
        return {
            // 修改时的数据源
            editParams: null,
        }
    },
    methods: {
        /** 新建 */
        handleAddData() {
            this.editParams = null
            this.dialogConfig.outerTitle = this.addDialogTitle
            this.dialogConfig.outerVisible = true
        },
        /** 删除 */
        handleDeleteData(data) {
            this.$modal.confirm('是否确定删除').then(() => {
                console.log('确定删除--')
            })
        },
        /** 编辑 */
        handleEditData(data) {
            this.editParams = data
            this.dialogConfig.outerTitle = this.editDialogTitle
            this.dialogConfig.outerVisible = true
        },
        /** 导入数据 */
        handleImportData() {
            console.log('导入--')
        },
        /** 导出数据 */
        handleExportData() {
            console.log('导出--')
        },
        /** 关闭外侧弹框 */
        closeDialogOuter() {
            this.dialogConfig.outerVisible = false
        },
        /** 关闭内侧弹框 */
        closeDialogInner() {
            this.dialogConfig.innerVisible = false
        },

        /** 关闭弹框  由表单组件通知父组件关闭弹框的自定义事件 */
        closeDialog() {
            this.dialogConfig.outerVisible = false
        },
    }
} 