ludc
2023-09-13 13f2d9d9b067d571f37fc14fe8ea4399eaad2547
Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue
@@ -1,11 +1,14 @@
<template>
    <!-- 第二层对话框,属性码段,公式编辑框弹窗 -->
    <el-dialog
      :close-on-click-modal="false"
      title="参照配置"
      append-to-body
      :visible.sync="isShowReferConfigForm"
      width="90%"
      id="refer-config-form"
      top="0"
      class= "avue-dialog avue-dialog--top"
      destroy-on-close
      @close="recoveryDataAndForm('initData')"
      style="height: 115vh; margin-top: -14vh; overflow-y: hidden">
@@ -16,7 +19,7 @@
                        <el-input :disabled="disabled"
                            :size="size"
                            v-model="form.referTypeName"
                            ref="referTypeName"
                            ref="referTypeName"
                            placeholder="请选择 参照的业务类型"
                            prefix-icon="el-icon-search"
                            readonly="true"
@@ -28,7 +31,7 @@
                        <el-input :disabled="disabled"
                            :size="size"
                            v-model="form.sortField"
                            ref="sortField"
                            ref="sortField"
                            placeholder="请选择 排序字段"
                            prefix-icon="el-icon-search"
                            readonly="true"
@@ -48,7 +51,7 @@
                                    <el-input :disabled="disabled"
                                        :size="size"
                                        v-model="form.sortField"
                                        ref="sortField"
                                        ref="sortField"
                                        placeholder="请选择 排序字段"
                                        prefix-icon="el-icon-search"
                                        readonly="true"
@@ -109,7 +112,7 @@
                        <span slot="label"><i class="el-icon-search"></i>添加查询条件</span>
                        <avue-crud
                            ref="crudAddCondition"
                            :option="addSearchCondtionOption"
                            :option="addSearchCondtionOption"
                            @cell-click="clickAddSearchCondtionEdit"
                            :data="form.codeSrchCondConfigVOS">
                            <!-- 表格内操作按钮 -->
@@ -231,13 +234,13 @@
    </el-dialog>
</template>
<script>
    import func from "@/util/func";
    export default {
        name: "referConfigFormDialog",
        props: {
        },
        data() {
            let element = '';
@@ -312,7 +315,7 @@
                    dialogClickModal: false,
                    highlightCurrentRow: true,
                    indexFixed: false,
                    menuFixed: false,
                    menuFixed: false,
                    column: [
                        {
                            label: "列字段(*)",
@@ -486,7 +489,7 @@
                    emptyBtn: false,
                    labelWidth: '145', //默认标签宽度
                    group: [
                        {
                        {
                            // 基础表单信息展示区域
                            //display: this.form.type=='default'||this.form.type=='grid',
                            icon: 'el-icon-info',
@@ -586,7 +589,7 @@
                                    change: ({ value, column }) => {
                                        // console.log("start",value);
                                        // 复原表单,因为其他分组中如果存在值,在切换时,会保留输入的字段值所以需要还原
                                        let addFrom = {};
                                        let addFrom = {};
                                        this.activeName = 'first'; // 默认切换至第一个tab
                                        //根据类型对form表单属性进行调整
                                        if(value == 'stand'){
@@ -639,7 +642,7 @@
                                    span: 6,
                                    type: 'switch',
                                },{
                                    display: this.form.isPersistence | this.form.isPersistence=='true',
                                    display: this.form.isPersistence || this.form.isPersistence=='true',
                                    label: '参照配置编号',
                                    prop: 'id',
                                    tip: '设置该参照配置持久化存储时的编号。',
@@ -650,7 +653,7 @@
                                    }],
                                    span: 6,
                                },{
                                    display: this.form.isPersistence | this.form.isPersistence=='true',
                                    display: this.form.isPersistence || this.form.isPersistence=='true',
                                    label: '参照配置名称',
                                    prop: 'name',
                                    tip: '设置该参照配置持久化存储时的名称。',
@@ -661,10 +664,10 @@
                                    }],
                                    span: 6,
                                }
                            ]
                        },
                        {
                        {
                            icon: 'el-icon-info',
                            label: '页面参数配置',
                            collapse: false,
@@ -716,7 +719,7 @@
                                }
                            ]
                        },
                        {
                        {
                            icon: 'el-icon-info',
                            label: '后台参数配置',
                            collapse: false,
@@ -725,7 +728,7 @@
                                {
                                label: '自定义的后台路径',
                                prop: 'url',
                                tip: '通常为空;如果是列表,后台必须返回DataGrid,如果是树,后台必须返回List<Tree>',
                                tip: '通常为空;如果是列表,后台必须返回DataGrid,如果是树,后台必须返回List<Theme>',
                                tipPlacement: 'right',
                                span: 7,
                                },{
@@ -763,7 +766,7 @@
                    emptyBtn: false,
                    labelWidth: '145', //默认标签宽度
                    group: [
                        {
                        {
                            display: this.form.type=='default'||this.form.type=='grid',
                            icon: 'el-icon-info',
                            label: this.form.type=='default' ? '默认参照的配置(下方列表)':'列表参照的配置(下方列表)',
@@ -800,7 +803,7 @@
                                }
                            ]
                        },
                        {
                        {
                            display: this.form.type=='stand',
                            icon: 'el-icon-info',
                            label: 'stand(平台配置)参照',
@@ -823,7 +826,7 @@
                                },
                            ]
                        },
                        {
                        {
                            display: this.form.type=='tree',
                            icon: 'el-icon-info',
                            label: '树形参照信息',
@@ -902,11 +905,11 @@
            this.element = document.getElementById('refer-config-form');
            this.element.addEventListener("click", (e) => {
                //<table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 911px;">
                if (!this.$refs.crudAttr.$el.contains(e.target) &&
                if (!this.$refs.crudAttr.$el.contains(e.target) &&
                   this.preClickAttrRow != '') {
                   this.preClickAttrRow.$cellEdit = false;
                }
                if (!this.$refs.crudAddCondition.$el.contains(e.target) &&
                if (!this.$refs.crudAddCondition.$el.contains(e.target) &&
                   this.preClickAddSearchConditionRow != '') {
                   this.preClickAddSearchConditionRow.$cellEdit = false;
                }
@@ -919,13 +922,13 @@
            },
            // 监听父组件传的窗口显示隐藏的值
            isShowReferConfigForm (){
                if(this.isShowReferConfigForm){
                if(this.isShowReferConfigForm && this.codeShowFieldConfigVOS.length <= 0){
                    this.onloadAttrData();
                }
            }
        },
        methods: {
            // 选择完参照配置之后点击保存按钮触发
            async selectedListReferConfig(){
                // 标记所有表单是否通过校验的变量
@@ -940,7 +943,7 @@
                            }
                            isValid = false;
                            //console.log(valid);
                        }
                        }
                        done();
                    })
                })
@@ -965,7 +968,7 @@
            // 属性表格行编辑失去焦点时保存方法
            // updateAttrBlur(value){
                //console.log(this.codeShowFieldConfigVOS[0]);
            // },
            // 单击表格实现表格行编辑
@@ -982,6 +985,7 @@
                // console.log(val.referConfig);
                if(func.notEmpty(val.referConfig)){
                    this.form = JSON.parse(val.referConfig);
                    this.form.isPersistence = this.form.isPersistence == 'true'||this.form.isPersistence ? true:false;
                    // 参照引用的业务类型不可选
                    // this.referTypeIsReadOnly = true;
                    if((this.form.type == 'default' || this.form.type  == 'grid') && (this.form.codeShowFieldConfigVOS != undefined && this.form.codeShowFieldConfigVOS.length > 0)){
@@ -1048,11 +1052,13 @@
                    // this.form.displayTable = '';
                    return;
                }
                Object.assign(this.$data,this.$options.data());
                Object.assign(this.$data,this.$options.data());
                //this.preClickAttrRow.$cellEdit = false;
                //console.log(this.preClickAttrRow.$cellEdit);
                // 移除绑定在该页面对话框上的全局监听事件
                if(this.element != ''){
                   let te = window.removeEventListener('click', this.element)
                }
                }
            },
            // 提交表单之前过滤掉空或不需要的表单数据
            filterForm(){
@@ -1070,8 +1076,8 @@
                    'useFormKey',
                    'paramForFormKey',
                    'isMuti',
                    'mapFields',
                    'codeSrchCondConfigVOS',
                    'mapFields',
                    'codeSrchCondConfigVOS',
                    'isOpenGlobal', //是否开启全局
                    'isPersistence',
                ];
@@ -1084,9 +1090,9 @@
                    addArray = ['limit', 'sortField', 'sortType'];
                } else if(oldForm.type == 'tree'){
                    addArray = [
                        "parentFieldName",
                        "parentFieldName",
                        'parentUsedField',
                        'parentValue',
                        'parentValue',
                        'loadType',
                        'onlyLeaf',
                        'sortField',
@@ -1094,7 +1100,7 @@
                    ];
                }
                // 开启持久化参照配置
                if(oldForm.isPersistence=='true' | oldForm.isPersistence){
                if(oldForm.isPersistence=='true' || oldForm.isPersistence){
                    submittDefaultForm =  submittDefaultForm.concat(['id','name'])
                }
                submittDefaultForm = submittDefaultForm.concat(addArray);
@@ -1111,7 +1117,7 @@
                    // console.log(!this.checkStringIsEmpty(oldForm[item]) || !this.checkArrayIsUndefined(oldForm[item]));
                    if((item == 'isMuti' || item == 'onlyLeaf') || (!this.checkStringIsEmpty(oldForm[item]) || !this.checkArrayIsUndefined(oldForm[item]))){
                        //console.log(item,oldForm[item]);
                        newForm = Object.assign(newForm,{[item]:oldForm[item]});
                        newForm = Object.assign(newForm,{[item]:oldForm[item]});
                    }
                });
                //console.log(newForm);
@@ -1183,7 +1189,7 @@
                this.$refs[this.selectedBtmTypeAttrParams.ref].selectedBtmTypeAttrOnLoad(params);
                this.selectedBtmTypeAttrParams.selectedBtmTypeAttrSettingBox = true;
            },
            /** 为【参照引用的业务类型】选取值之后的内容回显时调用 */
            echoReferBtmType(content){
                // 实现回显
@@ -1202,7 +1208,7 @@
                            {
                                filterField: item.id,
                                filterType: '_equal',
                                filterTypeText: item.name,
                                filterTypeText: item.name,
                                filterValue: '',
                                $cellEdit: false
                            }
@@ -1231,7 +1237,6 @@
                }
            },
        }
    };
</script>
@@ -1253,5 +1258,5 @@
        -webkit-transition:opacity .0s !important;
        transition:opacity .0s !important;
    }
</style>
</style>