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">
                            <!-- 表格内操作按钮 -->
@@ -229,15 +232,14 @@
        </el-dialog>
    </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),
                        },
                    ]
                },
@@ -417,7 +419,11 @@
                            cell: true,
                            clearable: false,
                            dicData: [
                                {
                                {
                                    value: '_in', label: '存在于'
                                },{
                                    value: '_notin', label: '不存在于'
                                },{
                                    value: '_like', label: '包含'
                                },{
                                    value: "_notlike", label: "不包含",
@@ -471,442 +477,447 @@
        },
        // 表单界面显示内容配置
        computed: {
            formOption() {
                /** 检验是否为数字 */
                let validateNumber = "";
                validateNumber = (rule, value,callback) => {
                    if(/[^\d]/g.test(value)){
                        callback(new Error('窗口显示的高度必须为数值类型'));
                    }else {
                        callback();
          formOption() {
            /** 检验是否为数字 */
            let validateNumber = "";
            validateNumber = (rule, value, callback) => {
              if (/[^\d]/g.test(value)) {
                callback(new Error('窗口显示的高度必须为数值类型'));
              } else {
                callback();
              }
            };
            return {
              submitBtn: false,
              emptyBtn: false,
              labelWidth: '145', //默认标签宽度
              group: [
                {
                  // 基础表单信息展示区域
                  //display: this.form.type=='default'||this.form.type=='grid',
                  icon: 'el-icon-info',
                  label: '必填的参照配置',
                  collapse: true,
                  labelWidth: '115',
                  prop: 'groupDdefaultOrGrid',
                  column: [
                    {
                      label: '参照的业务类型',
                      prop: 'referTypeName',
                      span: 6,
                      labelWidth: '130',
                      disabled: this.referTypeIsReadOnly,
                      clearable: !this.referTypeIsReadOnly,
                      tip: '参照数据查询的业务类型。',
                      tipPlacement: 'bottom',
                      rules: [{
                        required: true,
                        message: "(参照的业务类型)必填项不能为空",
                        trigger: ["blur", "change"],
                      }],
                    }, {
                      label: '显示的属性',
                      prop: 'textField',
                      tip: '选择数据后,显示到字段上的信息所属的属性,一般都是name,如果是多个属性使用逗号分割,如id,name。',
                      tipPlacement: 'bottom',
                      span: 6,
                      value: 'name',
                      rules: [{
                        required: true,
                        message: "(显示的属性)必填项不能为空",
                        trigger: "blur",
                      }],
                    }, {
                      label: '存储值的属性',
                      prop: 'valueField',
                      tip: '选择数据后,保存到数据库里的属性,一般都是oid或者id,如果是多个属性使用逗号分割,如oid ,id',
                      value: 'oid',
                      tipPlacement: 'bottom',
                      span: 6,
                      rules: [{
                        required: true,
                        message: "(存储值的属性)必填项不能为空",
                        trigger: "blur",
                      }],
                    }, {
                      label: '参照窗口类型',
                      prop: 'type',
                      tip: 'default:默认的参照窗口样式; stand:UI上下文配置的方式; classify:分类+档案的显示; 自定义的参照直接写js的组件路径;tree:树形展示;grid:列表展示',
                      tipPlacement: 'bottom',
                      span: 6,
                      value: 'default',
                      type: 'select',
                      dicData: [{
                        label: '默认样式',
                        value: 'default'
                      }, {
                        label: '平台配置',
                        value: 'stand'
                      }, {
                        label: '树形',
                        value: 'tree'
                      }, {
                        label: '列表',
                        value: 'grid'
                      }, {
                        label: '部门树',
                        value: 'refer/OrgDepartmentRefer'
                      }, {
                        label: '部门列表',
                        value: 'refer/OrgDepartmentGridRefers'
                      }, {
                        label: '用户',
                        value: 'refer/SmUserRefer'
                      }, {
                        label: '用户列表',
                        value: 'refer/SmUserGridRefer'
                      }, {
                        label: '角色列表',
                        value: 'refer/SmRoleRefer'
                      }, {
                        label: '职务',
                        value: 'refer/OrgDutyRefer'
                      }, {
                        label: '工种',
                        value: 'refer/SmWorkTypeRefer'
                      }, {
                        label: '流程模板',
                        value: 'refer/WfProcessTemplateRefer'
                      }],
                      rules: [{
                        required: true,
                        message: "(参照窗口类型)必填项不能为空",
                        trigger: "blur",
                      }],
                      change: ({value, column}) => {
                        // console.log("start",value);
                        // 复原表单,因为其他分组中如果存在值,在切换时,会保留输入的字段值所以需要还原
                        let addFrom = {};
                        this.activeName = 'first'; // 默认切换至第一个tab
                        //根据类型对form表单属性进行调整
                        if (value == 'stand') {
                          addFrom = {
                            referContent: '',
                            displayTable: '',
                          };
                          this.isDisabledTabs = false;
                        } else if (value == 'default' || value == 'grid') {
                          addFrom = {
                            limit: 15,
                            sortField: '',
                            sortType: 'asc',
                          };
                          this.isDisabledTabs = false;
                        } else if (value == 'tree') {
                          addFrom = {
                            parentFieldName: '',
                            parentUsedField: 'oid',
                            parentValue: '',
                            loadType: 'all',
                            onlyLeaf: false,
                            sortField: '',
                            sortType: 'asc',
                          };
                          // 不知道为什么type为tree的时候会触发两次change事件
                          // 导致type切换失败
                          this.form.type = 'tree';
                          this.isDisabledTabs = false;
                        } else {
                          this.isDisabledTabs = true;
                          this.activeName = 'second';
                        }
                        // 类型切换时,对不需要的属性进行筛除
                        this.removeFormAttr.forEach(attr => {
                          // console.log(attr);
                          this.$delete(this.form, attr)
                        })
                        // 合并两个表单
                        this.form = Object.assign(addFrom, this.form);
                        // console.log("endFilter",this.form.type);
                        // console.log(this.form);
                      },
                    }, {
                      label: '是否持久化参照配置',
                      prop: 'isPersistence',
                      labelWidth: '142',
                      tip: 'true:开启持久化,对当前定义的参照配置进行持久化存储,下次可直接选取;false:仅对当前次码段新增生效。',
                      tipPlacement: 'bottom',
                      span: 6,
                      type: 'switch',
                    }, {
                      display: this.form.isPersistence || this.form.isPersistence == 'true',
                      label: '参照配置编号',
                      prop: 'id',
                      tip: '设置该参照配置持久化存储时的编号。',
                      rules: [{
                        required: true,
                        message: "(开启持久化时编号)必填项不能为空",
                        trigger: "blur",
                      }],
                      span: 6,
                    }, {
                      display: this.form.isPersistence || this.form.isPersistence == 'true',
                      label: '参照配置名称',
                      prop: 'name',
                      tip: '设置该参照配置持久化存储时的名称。',
                      rules: [{
                        required: true,
                        message: "(开启持久化时名称)必填项不能为空",
                        trigger: "blur",
                      }],
                      span: 6,
                    }
                };
                return {
                    submitBtn: false,
                    emptyBtn: false,
                    labelWidth: '145', //默认标签宽度
                    group: [
                        {
                            // 基础表单信息展示区域
                            //display: this.form.type=='default'||this.form.type=='grid',
                            icon: 'el-icon-info',
                            label: '必填的参照配置',
                            collapse: true,
                            labelWidth: '115',
                            prop: 'groupDdefaultOrGrid',
                            column: [
                                {
                                    label: '参照的业务类型',
                                    prop: 'referTypeName',
                                    span: 6,
                                    labelWidth: '130',
                                    disabled: this.referTypeIsReadOnly,
                                    clearable: !this.referTypeIsReadOnly,
                                    tip: '参照数据查询的业务类型。',
                                    tipPlacement: 'bottom',
                                    rules: [{
                                        required: true,
                                        message: "(参照的业务类型)必填项不能为空",
                                        trigger: ["blur","change"],
                                    }],
                                },{
                                    label: '显示的属性',
                                    prop: 'textField',
                                    tip: '选择数据后,显示到字段上的信息所属的属性,一般都是name,如果是多个属性使用逗号分割,如id,name。',
                                    tipPlacement: 'bottom',
                                    span: 6,
                                    value: 'name',
                                    rules: [{
                                        required: true,
                                        message: "(显示的属性)必填项不能为空",
                                        trigger: "blur",
                                    }],
                                },{
                                    label: '存储值的属性',
                                    prop: 'valueField',
                                    tip: '选择数据后,保存到数据库里的属性,一般都是oid或者id,如果是多个属性使用逗号分割,如oid ,id',
                                    value: 'oid',
                                    tipPlacement: 'bottom',
                                    span: 6,
                                    rules: [{
                                        required: true,
                                        message: "(存储值的属性)必填项不能为空",
                                        trigger: "blur",
                                    }],
                                },{
                                    label: '参照窗口类型',
                                    prop: 'type',
                                    tip: 'default:默认的参照窗口样式; stand:UI上下文配置的方式; classify:分类+档案的显示; 自定义的参照直接写js的组件路径;tree:树形展示;grid:列表展示',
                                    tipPlacement: 'bottom',
                                    span: 6,
                                    value: 'default',
                                    type: 'select',
                                    dicData: [{
                                        label: '默认样式',
                                        value: 'default'
                                    }, {
                                        label: '平台配置',
                                        value: 'stand'
                                    }, {
                                        label: '树形',
                                        value: 'tree'
                                    }, {
                                        label: '列表',
                                        value: 'grid'
                                    }, {
                                        label: '部门树',
                                        value: 'refer/OrgDepartmentRefer'
                                    }, {
                                        label: '部门列表',
                                        value: 'refer/OrgDepartmentGridRefers'
                                    }, {
                                        label: '用户',
                                        value: 'refer/SmUserRefer'
                                    }, {
                                        label: '用户列表',
                                        value: 'refer/SmUserGridRefer'
                                    }, {
                                        label: '角色列表',
                                        value: 'refer/SmRoleRefer'
                                    }, {
                                        label: '职务',
                                        value: 'refer/OrgDutyRefer'
                                    }, {
                                        label: '工种',
                                        value: 'refer/SmWorkTypeRefer'
                                    }, {
                                        label: '流程模板',
                                        value: 'refer/WfProcessTemplateRefer'
                                    }],
                                    rules: [{
                                        required: true,
                                        message: "(参照窗口类型)必填项不能为空",
                                        trigger: "blur",
                                    }],
                                    change: ({ value, column }) => {
                                        // console.log("start",value);
                                        // 复原表单,因为其他分组中如果存在值,在切换时,会保留输入的字段值所以需要还原
                                        let addFrom = {};
                                        this.activeName = 'first'; // 默认切换至第一个tab
                                        //根据类型对form表单属性进行调整
                                        if(value == 'stand'){
                                            addFrom = {
                                                referContent: '',
                                                displayTable: '',
                                            };
                                            this.isDisabledTabs = false;
                                        } else if(value == 'default' || value == 'grid'){
                                            addFrom = {
                                                limit: 15,
                                                sortField: '',
                                                sortType: 'asc',
                                            };
                                            this.isDisabledTabs = false;
                                        } else if(value == 'tree'){
                                            addFrom = {
                                                parentFieldName: '',
                                                parentUsedField: 'oid',
                                                parentValue: '',
                                                loadType: 'all',
                                                onlyLeaf: false,
                                                sortField: '',
                                                sortType: 'asc',
                                            };
                                            // 不知道为什么type为tree的时候会触发两次change事件
                                            // 导致type切换失败
                                            this.form.type = 'tree';
                                            this.isDisabledTabs = false;
                                        }else {
                                            this.isDisabledTabs = true;
                                            this.activeName = 'second';
                                        }
                                       // 类型切换时,对不需要的属性进行筛除
                                        this.removeFormAttr.forEach(attr=>{
                                            // console.log(attr);
                                            this.$delete(this.form,attr)
                                        })
                                        // 合并两个表单
                                        this.form = Object.assign(addFrom,this.form);
                                        // console.log("endFilter",this.form.type);
                                        // console.log(this.form);
                                    },
                                },{
                                    label: '是否持久化参照配置',
                                    prop: 'isPersistence',
                                    labelWidth: '142',
                                    tip: 'true:开启持久化,对当前定义的参照配置进行持久化存储,下次可直接选取;false:仅对当前次码段新增生效。',
                                    tipPlacement: 'bottom',
                                    span: 6,
                                    type: 'switch',
                                },{
                                    display: this.form.isPersistence | this.form.isPersistence=='true',
                                    label: '参照配置编号',
                                    prop: 'id',
                                    tip: '设置该参照配置持久化存储时的编号。',
                                    rules: [{
                                        required: true,
                                        message: "(开启持久化时编号)必填项不能为空",
                                        trigger: "blur",
                                    }],
                                    span: 6,
                                },{
                                    display: this.form.isPersistence | this.form.isPersistence=='true',
                                    label: '参照配置名称',
                                    prop: 'name',
                                    tip: '设置该参照配置持久化存储时的名称。',
                                    rules: [{
                                        required: true,
                                        message: "(开启持久化时名称)必填项不能为空",
                                        trigger: "blur",
                                    }],
                                    span: 6,
                                }
                            ]
                        },
                        {
                            icon: 'el-icon-info',
                            label: '页面参数配置',
                            collapse: false,
                            prop: 'webConfig',
                            column: [
                                {
                                    label: '窗口显示的高度',
                                    prop: 'height',
                                    tip: '默认空着,设置后表示强制显示这样的高度',
                                    tipPlacement: 'right',
                                    span: 7,
                                    rules:[{
                                        validator: validateNumber,
                                        message: "窗口显示的高度必须为数值类型",
                                        trigger: "blur",
                                    }]
                                },{
                                    label: '过滤(级联)属性',
                                    prop: 'useFormKey',
                                    tip: '获取表单上的其他属性的属性的值来过滤,或者使用某个属性来级联选择',
                                    tipPlacement: 'right',
                                    span: 7,
                                },{
                                    label: '过滤属性请求参数',
                                    prop: 'paramForFormKey',
                                    tip: '使用过滤属性时,发送给后台的请求参数',
                                    tipPlacement: 'right',
                                    span: 7,
                                },{
                                    label: '映射其他属性',
                                    prop: 'mapFields',
                                    tip: '选择数据后,将选择的数据拷贝到表单里的其他属性,书写格式为{当前表单上的属性:选择数据里的属性,XXXXx:yyyy}',
                                    tipPlacement: 'right',
                                    span: 7,
                                },{
                                    label: '是否开启全局',
                                    prop: 'isOpenGlobal',
                                    tip: '开启全局之后对全部参照配置数据进行查询,默认根据租户进行查询。',
                                    tipPlacement: 'right',
                                    type: 'switch',
                                    span: 7,
                                },{
                                    label: '是否多选',
                                    type: 'switch',
                                    prop: 'isMuti',
                                    value: false,
                                    span: 7,
                                    row: true,
                                }
                            ]
                        },
                        {
                            icon: 'el-icon-info',
                            label: '后台参数配置',
                            collapse: false,
                            prop: 'backstageConfig',
                            column: [
                                {
                                label: '自定义的后台路径',
                                prop: 'url',
                                tip: '通常为空;如果是列表,后台必须返回DataGrid,如果是树,后台必须返回List<Tree>',
                                tipPlacement: 'right',
                                span: 7,
                                },{
                                    label: '服务的地址',
                                    prop: 'backPath',
                                    tip: '通常为空,在支持微服务或者分布式部署的时候才配置',
                                    tipPlacement: 'right',
                                    span: 7,
                                },{
                                    label: '请求后台的协议方式',
                                    prop: 'method',
                                    tip: 'HTTP的协议方式,支持POST,PUT,GET,一般都是GET',
                                    tipPlacement: 'right',
                                    span: 7,
                                    value: 'GET',
                                    type: 'select',
                                    dicData: [{
                                        label:'GET',value: "GET"
                                    },{
                                        label:'PUT',value: "PUT"
                                    },
                                    {
                                        label:'POST',value: "POST"
                                    }],
                                },
                            ]
                        },
                    ]
                }
            },
            formOtherOption(){
                return {
                    // 变动的表单区域
                    submitBtn: false,
                    emptyBtn: false,
                    labelWidth: '145', //默认标签宽度
                    group: [
                        {
                            display: this.form.type=='default'||this.form.type=='grid',
                            icon: 'el-icon-info',
                            label: this.form.type=='default' ? '默认参照的配置(下方列表)':'列表参照的配置(下方列表)',
                            collapse: true,
                            prop: 'groupDdefaultOrGrid',
                            column: [
                                {
                                    label: '每页显示条数',
                                    prop: 'limit',
                                    span: 8,
                                    tip: '分页时每页显示的数量,不分页填-1',
                                    value: 15,
                                    tipPlacement: 'right',
                                },{
                                    label: '排序字段',
                                    prop: 'sortField',
                                    span: 8,
                                    tip: '查询数据时的排序字段',
                                    //clearable: false,
                                    tipPlacement: 'right',
                                },{
                                    label: '排序类型',
                                    prop: 'sortType',
                                    span: 8,
                                    dicData: [{
                                        label: '升序', value: 'asc'
                                    }, {
                                        label: '降序', value: 'desc'
                                    }],
                                    //value: 'asc',
                                    type: 'select',
                                    tip: '查询数据时的排序类型',
                                    tipPlacement: 'right',
                                }
                            ]
                        },
                        {
                            display: this.form.type=='stand',
                            icon: 'el-icon-info',
                            label: 'stand(平台配置)参照',
                            collapse: true,
                            prop: 'groupStand',
                            column: [
                                {
                                    label: '参考的UI上下文',
                                    prop: 'referContent',
                                    span: 8,
                                    tip: '只有参照窗口类型是stand时才必须设置,且在stand类型下才能生效',
                                    tipPlacement: 'right',
                                },
                                {
                                    label: '平台的表格编号',
                                    prop: 'displayTable',
                                    span: 8,
                                    tip: '与参照的UI上下文互斥,只有参照窗口类型是stand时才必须设置,且在stand类型下才能生效',
                                    tipPlacement: 'right',
                                },
                            ]
                        },
                        {
                            display: this.form.type=='tree',
                            icon: 'el-icon-info',
                            label: '树形参照信息',
                            collapse: true,
                            prop: 'groupTree',
                            labelWidth: '158',
                            column: [
                                {
                                    label: '树形的上级属性',
                                    prop: 'parentFieldName',
                                    span: 7,
                                    tip: '树形展示的时候,上下级关系查找的属性。',
                                    tipPlacement: 'right',
                                    rules: [{
                                        required: true,
                                        message: "(树形的上级属性)必填项不能为空",
                                        trigger: "blur",
                                    }],
                                },{
                                    label: '上级属性值对应属性',
                                    prop: 'parentUsedField',
                                    span: 7,
                                    tip: '上级属性存储的值,是上级数据的什么属性。一般都是oid。',
                                    value: 'oid',
                                    tipPlacement: 'right',
                                },{
                                    label: '根节点的值',
                                    prop: 'parentValue',
                                    span: 7,
                                    tip: '树形展示的时候,上级的值。',
                                    tipPlacement: 'right',
                                },{
                                    label: '树加载方式',
                                    prop: 'loadType',
                                    span: 7,
                                    value: 'all',
                                    dicData: [{
                                        label: '全部', value: 'all'
                                    }, {
                                        label: '逐级加载', value: 'node'
                                    }],
                                    type: 'select',
                                },{
                                    label: '排序字段',
                                    prop: 'sortField',
                                    span: 7,
                                    //type: 'table',
                                    tip: '查询数据时的排序字段',
                                    tipPlacement: 'right',
                                },{
                                    label: '排序类型',
                                    prop: 'sortType',
                                    span: 7,
                                    type: 'select',
                                    value: 'asc',
                                    dicData: [{
                                        label: '升序', value: 'asc'
                                    }, {
                                        label: '降序', value: 'desc'
                                    }],
                                },{
                                    label: '是否只能选择叶子节点',
                                    prop: 'onlyLeaf',
                                    span: 7,
                                    value: false,
                                    type: 'switch',
                                }
                            ]
                        },
                    ],
                }
            },
                  ]
                },
                {
                  icon: 'el-icon-info',
                  label: '页面参数配置',
                  collapse: false,
                  prop: 'webConfig',
                  column: [
                    {
                      label: '窗口显示的高度',
                      prop: 'height',
                      tip: '默认空着,设置后表示强制显示这样的高度',
                      tipPlacement: 'right',
                      span: 7,
                      rules: [{
                        validator: validateNumber,
                        message: "窗口显示的高度必须为数值类型",
                        trigger: "blur",
                      }]
                    }, {
                      label: '过滤(级联)属性',
                      prop: 'useFormKey',
                      tip: '获取表单上的其他属性的属性的值来过滤,或者使用某个属性来级联选择',
                      tipPlacement: 'right',
                      span: 7,
                    }, {
                      label: '过滤属性请求参数',
                      prop: 'paramForFormKey',
                      tip: '使用过滤属性时,发送给后台的请求参数',
                      tipPlacement: 'right',
                      span: 7,
                    }, {
                      label: '映射其他属性',
                      prop: 'mapFields',
                      tip: '选择数据后,将选择的数据拷贝到表单里的其他属性,书写格式为{当前表单上的属性:选择数据里的属性,"XXXXx":"yyyy"}',
                      tipPlacement: 'right',
                      span: 7,
                    }, {
                      label: '是否开启全局',
                      prop: 'isOpenGlobal',
                      tip: '开启全局之后对全部参照配置数据进行查询,默认根据租户进行查询。',
                      tipPlacement: 'right',
                      type: 'switch',
                      span: 7,
                    }, {
                      label: '是否多选',
                      type: 'switch',
                      prop: 'isMuti',
                      value: false,
                      span: 7,
                      row: true,
                    }
                  ]
                },
                {
                  icon: 'el-icon-info',
                  label: '后台参数配置',
                  collapse: false,
                  prop: 'backstageConfig',
                  column: [
                    {
                      label: '自定义的后台路径',
                      prop: 'url',
                      tip: '通常为空;如果是列表,后台必须返回DataGrid,如果是树,后台必须返回List<Theme>',
                      tipPlacement: 'right',
                      span: 7,
                    }, {
                      label: '服务的地址',
                      prop: 'backPath',
                      tip: '通常为空,在支持微服务或者分布式部署的时候才配置',
                      tipPlacement: 'right',
                      span: 7,
                    }, {
                      label: '请求后台的协议方式',
                      prop: 'method',
                      tip: 'HTTP的协议方式,支持POST,PUT,GET,一般都是GET',
                      tipPlacement: 'right',
                      span: 7,
                      value: 'GET',
                      type: 'select',
                      dicData: [{
                        label: 'GET', value: "GET"
                      }, {
                        label: 'PUT', value: "PUT"
                      },
                        {
                          label: 'POST', value: "POST"
                        }],
                    },
                  ]
                },
              ]
            }
          },
          formOtherOption() {
            return {
              // 变动的表单区域
              submitBtn: false,
              emptyBtn: false,
              labelWidth: '145', //默认标签宽度
              group: [
                {
                  display: this.form.type == 'default' || this.form.type == 'grid',
                  icon: 'el-icon-info',
                  label: this.form.type == 'default' ? '默认参照的配置(下方列表)' : '列表参照的配置(下方列表)',
                  collapse: true,
                  prop: 'groupDdefaultOrGrid',
                  column: [
                    {
                      label: '每页显示条数',
                      prop: 'limit',
                      span: 8,
                      tip: '分页时每页显示的数量,不分页填-1',
                      value: 15,
                      rules: [{
                        required: true,
                        message: "必填项不能为空",
                        trigger: "blur",
                      }],
                      tipPlacement: 'right',
                    }, {
                      label: '排序字段',
                      prop: 'sortField',
                      span: 8,
                      tip: '查询数据时的排序字段',
                      //clearable: false,
                      tipPlacement: 'right',
                    }, {
                      label: '排序类型',
                      prop: 'sortType',
                      span: 8,
                      dicData: [{
                        label: '升序', value: 'asc'
                      }, {
                        label: '降序', value: 'desc'
                      }],
                      //value: 'asc',
                      type: 'select',
                      tip: '查询数据时的排序类型',
                      tipPlacement: 'right',
                    }
                  ]
                },
                {
                  display: this.form.type == 'stand',
                  icon: 'el-icon-info',
                  label: 'stand(平台配置)参照',
                  collapse: true,
                  prop: 'groupStand',
                  column: [
                    {
                      label: '参考的UI上下文',
                      prop: 'referContent',
                      span: 8,
                      tip: '只有参照窗口类型是stand时才必须设置,且在stand类型下才能生效',
                      tipPlacement: 'right',
                    },
                    {
                      label: '平台的表格编号',
                      prop: 'displayTable',
                      span: 8,
                      tip: '与参照的UI上下文互斥,只有参照窗口类型是stand时才必须设置,且在stand类型下才能生效',
                      tipPlacement: 'right',
                    },
                  ]
                },
                {
                  display: this.form.type == 'tree',
                  icon: 'el-icon-info',
                  label: '树形参照信息',
                  collapse: true,
                  prop: 'groupTree',
                  labelWidth: '158',
                  column: [
                    {
                      label: '树形的上级属性',
                      prop: 'parentFieldName',
                      span: 7,
                      tip: '树形展示的时候,上下级关系查找的属性。',
                      tipPlacement: 'right',
                      rules: [{
                        required: true,
                        message: "(树形的上级属性)必填项不能为空",
                        trigger: "blur",
                      }],
                    }, {
                      label: '上级属性值对应属性',
                      prop: 'parentUsedField',
                      span: 7,
                      tip: '上级属性存储的值,是上级数据的什么属性。一般都是oid。',
                      value: 'oid',
                      tipPlacement: 'right',
                    }, {
                      label: '根节点的值',
                      prop: 'parentValue',
                      span: 7,
                      tip: '树形展示的时候,上级的值。',
                      tipPlacement: 'right',
                    }, {
                      label: '树加载方式',
                      prop: 'loadType',
                      span: 7,
                      value: 'all',
                      dicData: [{
                        label: '全部', value: 'all'
                      }, {
                        label: '逐级加载', value: 'node'
                      }],
                      type: 'select',
                    }, {
                      label: '排序字段',
                      prop: 'sortField',
                      span: 7,
                      //type: 'table',
                      tip: '查询数据时的排序字段',
                      tipPlacement: 'right',
                    }, {
                      label: '排序类型',
                      prop: 'sortType',
                      span: 7,
                      type: 'select',
                      value: 'asc',
                      dicData: [{
                        label: '升序', value: 'asc'
                      }, {
                        label: '降序', value: 'desc'
                      }],
                    }, {
                      label: '是否只能选择叶子节点',
                      prop: 'onlyLeaf',
                      span: 7,
                      value: false,
                      type: 'switch',
                    }
                  ]
                },
              ],
            }
          },
        },
        mounted() {
            // 事件监听,实现表格行编辑点击表格区域外内容时退出编辑状态
            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 +930,12 @@
            },
            // 监听父组件传的窗口显示隐藏的值
            isShowReferConfigForm (){
                if(this.isShowReferConfigForm){
                if(this.isShowReferConfigForm && this.codeShowFieldConfigVOS.length <= 0){
                    this.onloadAttrData();
                }
            }
        },
        methods: {
            // 选择完参照配置之后点击保存按钮触发
            async selectedListReferConfig(){
                // 标记所有表单是否通过校验的变量
@@ -939,8 +949,7 @@
                                break;
                            }
                            isValid = false;
                            //console.log(valid);
                        }
                        }
                        done();
                    })
                })
@@ -948,7 +957,6 @@
                if (isValid) {
                    // 根据类型对form表单中的参数进行过滤,只保留非空且需要的属性
                    let submitForm = this.filterForm();
                    // console.log(submitForm);
                    this.$emit('echoReferConfig', submitForm) // 触发update:data将子组件值传递给父组件
                    this.isShowReferConfigForm = false;
                }
@@ -956,7 +964,6 @@
            // 单击表格实现表格行编辑
            clickAttrEdit(row, column, event){
                if(this.preClickAttrRow && this.preClickAttrRow != row){
                    //console.log(this.codeShowFieldConfigVOS[this.preClickAttrRow.$index]);
                    this.codeShowFieldConfigVOS[this.preClickAttrRow.$index].$cellEdit = false;
                }
                row.$cellEdit = true;
@@ -965,7 +972,7 @@
            // 属性表格行编辑失去焦点时保存方法
            // updateAttrBlur(value){
                //console.log(this.codeShowFieldConfigVOS[0]);
            // },
            // 单击表格实现表格行编辑
@@ -982,6 +989,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 +1056,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 +1080,8 @@
                    'useFormKey',
                    'paramForFormKey',
                    'isMuti',
                    'mapFields',
                    'codeSrchCondConfigVOS',
                    'mapFields',
                    'codeSrchCondConfigVOS',
                    'isOpenGlobal', //是否开启全局
                    'isPersistence',
                ];
@@ -1084,9 +1094,9 @@
                    addArray = ['limit', 'sortField', 'sortType'];
                } else if(oldForm.type == 'tree'){
                    addArray = [
                        "parentFieldName",
                        "parentFieldName",
                        'parentUsedField',
                        'parentValue',
                        'parentValue',
                        'loadType',
                        'onlyLeaf',
                        'sortField',
@@ -1094,7 +1104,7 @@
                    ];
                }
                // 开启持久化参照配置
                if(oldForm.isPersistence=='true' | oldForm.isPersistence){
                if(oldForm.isPersistence=='true' || oldForm.isPersistence){
                    submittDefaultForm =  submittDefaultForm.concat(['id','name'])
                }
                submittDefaultForm = submittDefaultForm.concat(addArray);
@@ -1111,7 +1121,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 +1193,7 @@
                this.$refs[this.selectedBtmTypeAttrParams.ref].selectedBtmTypeAttrOnLoad(params);
                this.selectedBtmTypeAttrParams.selectedBtmTypeAttrSettingBox = true;
            },
            /** 为【参照引用的业务类型】选取值之后的内容回显时调用 */
            echoReferBtmType(content){
                // 实现回显
@@ -1202,7 +1212,7 @@
                            {
                                filterField: item.id,
                                filterType: '_equal',
                                filterTypeText: item.name,
                                filterTypeText: item.name,
                                filterValue: '',
                                $cellEdit: false
                            }
@@ -1211,7 +1221,7 @@
                }else{
                    // 选择显示字段
                    data.selectedArrary.forEach(item => {
                        console.log(item);
                        // console.log(item);
                        this.codeShowFieldConfigVOS.push(
                            {
                                field: item.id,
@@ -1230,7 +1240,6 @@
                    })
                }
            },
        }
    };
@@ -1253,5 +1262,5 @@
        -webkit-transition:opacity .0s !important;
        transition:opacity .0s !important;
    }
</style>
</style>