ludc
2023-09-08 caeb0c1b3666655e2e05292c2fcaef82a9808cd1
Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue
@@ -6,6 +6,8 @@
      :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 +18,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 +30,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 +50,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 +111,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 +233,13 @@
    </el-dialog>
</template>
<script>
    import func from "@/util/func";
    export default {
        name: "referConfigFormDialog",
        props: {
        },
        data() {
            let element = '';
@@ -312,20 +314,20 @@
                    dialogClickModal: false,
                    highlightCurrentRow: true,
                    indexFixed: false,
                    menuFixed: false,
                    menuFixed: false,
                    column: [
                        {
                            label: "列字段(*)",
                            prop: "field",
                            cell: true,
                            clearable: false,
                            blur: (value) => this.updateAttrBlur(value),
                            // blur: (value) => this.updateAttrBlur(value),
                        },{
                            label: "列名(*)",
                            prop: "title",
                            cell: true,
                            clearable: false,
                            blur: (value) => this.updateAttrBlur(value),
                            // blur: (value) => this.updateAttrBlur(value),
                        },{
                            label: "字段类型(*)",
                            prop: "fieldTypeText",
@@ -346,7 +348,7 @@
                            }, {
                                value: 'textarea', label: '文本域'
                            }],
                            blur: (value) => this.updateAttrBlur(value),
                            // blur: (value) => this.updateAttrBlur(value),
                        },{
                            label: "列表可排序",
                            prop: "sort",
@@ -355,19 +357,19 @@
                            type:"switch",
                            width: '80px',
                            value: true,
                            blur: (value) => this.updateAttrBlur(value),
                            // blur: (value) => this.updateAttrBlur(value),
                        },{
                            label: "排序字段",
                            prop: "attrSortField",
                            cell: true,
                            clearable: false,
                            blur: (value) => this.updateAttrBlur(value),
                            // blur: (value) => this.updateAttrBlur(value),
                        },{
                            label: "字段宽度",
                            prop: "width",
                            cell: true,
                            clearable: false,
                            blur: (value) => this.updateAttrBlur(value),
                            // blur: (value) => this.updateAttrBlur(value),
                        },{
                            label: "列固定位置",
                            prop: "fixedPosition",
@@ -376,13 +378,13 @@
                            clearable: false,
                            value: 'noFixed',
                            dicData: [{value: 'noFixed', label: '不固定'}, {value: 'left', label: '左边'}, {value: 'right', label: '右边'}],
                            blur: (value) => this.updateAttrBlur(value),
                            // blur: (value) => this.updateAttrBlur(value),
                        },{
                            label: "js显示代码",
                            prop: "templet",
                            cell: true,
                            clearable: false,
                            blur: (value) => this.updateAttrBlur(value),
                            // blur: (value) => this.updateAttrBlur(value),
                        },
                    ]
                },
@@ -486,7 +488,7 @@
                    emptyBtn: false,
                    labelWidth: '145', //默认标签宽度
                    group: [
                        {
                        {
                            // 基础表单信息展示区域
                            //display: this.form.type=='default'||this.form.type=='grid',
                            icon: 'el-icon-info',
@@ -586,7 +588,7 @@
                                    change: ({ value, column }) => {
                                        // console.log("start",value);
                                        // 复原表单,因为其他分组中如果存在值,在切换时,会保留输入的字段值所以需要还原
                                        let addFrom = {};
                                        let addFrom = {};
                                        this.activeName = 'first'; // 默认切换至第一个tab
                                        //根据类型对form表单属性进行调整
                                        if(value == 'stand'){
@@ -639,7 +641,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 +652,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 +663,10 @@
                                    }],
                                    span: 6,
                                }
                            ]
                        },
                        {
                        {
                            icon: 'el-icon-info',
                            label: '页面参数配置',
                            collapse: false,
@@ -716,7 +718,7 @@
                                }
                            ]
                        },
                        {
                        {
                            icon: 'el-icon-info',
                            label: '后台参数配置',
                            collapse: false,
@@ -725,7 +727,7 @@
                                {
                                label: '自定义的后台路径',
                                prop: 'url',
                                tip: '通常为空;如果是列表,后台必须返回DataGrid,如果是树,后台必须返回List<Tree>',
                                tip: '通常为空;如果是列表,后台必须返回DataGrid,如果是树,后台必须返回List<Theme>',
                                tipPlacement: 'right',
                                span: 7,
                                },{
@@ -763,7 +765,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 +802,7 @@
                                }
                            ]
                        },
                        {
                        {
                            display: this.form.type=='stand',
                            icon: 'el-icon-info',
                            label: 'stand(平台配置)参照',
@@ -823,7 +825,7 @@
                                },
                            ]
                        },
                        {
                        {
                            display: this.form.type=='tree',
                            icon: 'el-icon-info',
                            label: '树形参照信息',
@@ -902,11 +904,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 +921,13 @@
            },
            // 监听父组件传的窗口显示隐藏的值
            isShowReferConfigForm (){
                if(this.isShowReferConfigForm){
                if(this.isShowReferConfigForm && this.codeShowFieldConfigVOS.length <= 0){
                    this.onloadAttrData();
                }
            }
        },
        methods: {
            // 选择完参照配置之后点击保存按钮触发
            async selectedListReferConfig(){
                // 标记所有表单是否通过校验的变量
@@ -940,7 +942,7 @@
                            }
                            isValid = false;
                            //console.log(valid);
                        }
                        }
                        done();
                    })
                })
@@ -965,7 +967,7 @@
            // 属性表格行编辑失去焦点时保存方法
            // updateAttrBlur(value){
                //console.log(this.codeShowFieldConfigVOS[0]);
            // },
            // 单击表格实现表格行编辑
@@ -982,6 +984,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 +1051,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 +1075,8 @@
                    'useFormKey',
                    'paramForFormKey',
                    'isMuti',
                    'mapFields',
                    'codeSrchCondConfigVOS',
                    'mapFields',
                    'codeSrchCondConfigVOS',
                    'isOpenGlobal', //是否开启全局
                    'isPersistence',
                ];
@@ -1084,9 +1089,9 @@
                    addArray = ['limit', 'sortField', 'sortType'];
                } else if(oldForm.type == 'tree'){
                    addArray = [
                        "parentFieldName",
                        "parentFieldName",
                        'parentUsedField',
                        'parentValue',
                        'parentValue',
                        'loadType',
                        'onlyLeaf',
                        'sortField',
@@ -1094,7 +1099,7 @@
                    ];
                }
                // 开启持久化参照配置
                if(oldForm.isPersistence=='true' | oldForm.isPersistence){
                if(oldForm.isPersistence=='true' || oldForm.isPersistence){
                    submittDefaultForm =  submittDefaultForm.concat(['id','name'])
                }
                submittDefaultForm = submittDefaultForm.concat(addArray);
@@ -1111,7 +1116,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 +1188,7 @@
                this.$refs[this.selectedBtmTypeAttrParams.ref].selectedBtmTypeAttrOnLoad(params);
                this.selectedBtmTypeAttrParams.selectedBtmTypeAttrSettingBox = true;
            },
            /** 为【参照引用的业务类型】选取值之后的内容回显时调用 */
            echoReferBtmType(content){
                // 实现回显
@@ -1202,7 +1207,7 @@
                            {
                                filterField: item.id,
                                filterType: '_equal',
                                filterTypeText: item.name,
                                filterTypeText: item.name,
                                filterValue: '',
                                $cellEdit: false
                            }
@@ -1231,7 +1236,6 @@
                }
            },
        }
    };
</script>
@@ -1253,5 +1257,5 @@
        -webkit-transition:opacity .0s !important;
        transition:opacity .0s !important;
    }
</style>
</style>