Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue
@@ -1,21 +1,25 @@
<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">
        <div style="width: 100%; overflow-y: auto; height: 70vh">
            <el-row>
                <avue-form ref="form" :option="formOption" v-model="form" class="referTypeForm">
                <avue-form :ref="formRefs[0]" :option="formOption" v-model="form" class="referTypeForm">
                    <template #referTypeName="{disabled,size}">
                        <el-input :disabled="disabled"
                            :size="size"
                            v-model="form.referTypeName"
                            ref="referTypeName"
                            ref="referTypeName"
                            placeholder="请选择 参照的业务类型"
                            prefix-icon="el-icon-search"
                            readonly="true"
@@ -27,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"
@@ -37,76 +41,101 @@
                    </template>
                </avue-form>
            </el-row>
            <el-row v-show="form.type=='default' || form.type=='grid'">
                <avue-crud
                    ref="crudAttr"
                    class="crud-attr"
                    :option="attrOption"
                    @cell-click="clickAttrEdit"
                    :data="attrData">
                    <!-- 表格内操作按钮 -->
                    <template slot="menu" slot-scope="scope">
                        <el-button type="text"
                            size="small"
                            icon="el-icon-search"
                            plain
                            @click="scope.row.isquery=!scope.row.isquery">
                            {{scope.row.isquery ? "取消快速查询":"快速查询"}}
                        </el-button>
                        <el-button type="text"
                            size="small"
                            icon="el-icon-minus"
                            plain
                            @click="removeCurrentRow(scope.row,'removeAttr')">移除
                        </el-button>
                    </template>
                    <!-- 表格左上方按钮区域 -->
                    <template slot="menuLeft" slot-scope="scope">
                        <el-button type="primary"
                            size="small"
                            icon="el-icon-plus"
                            @click="openSelectionTable('selectAttr')">选择属性
                        </el-button>
                        <div class="tag-group" style="display: inline">
                            <el-tag
                                v-for="item in attrData"
                                v-show="item.isquery && item.title!=''"
                                style="margin-left: 3px"
                                :key="item.title"
                                type="info"
                                size="small"
                                effect="dark">
                                {{ item.title }}
                            </el-tag>
                        </div>
                    </template>
                </avue-crud>
            </el-row>
            <el-row style="margin-top: 10px">
                <avue-crud
                    ref="crudAddCondition"
                    :option="addSearchCondtionOption"
                    @cell-click="clickAddSearchCondtionEdit"
                    :data="addSearchCondtionData">
                    <!-- 表格内操作按钮 -->
                    <template slot="menu" slot-scope="scope">
                        <el-button type="text"
                            size="small"
                            icon="el-icon-minus"
                            plain
                            @click="removeCurrentRow(scope.row,'removeaddSearchCondtion')">移除
                        </el-button>
                    </template>
                    <!-- 表格左上方按钮区域 -->
                    <template slot="menuLeft" slot-scope="scope">
                        <el-button type="primary"
                            size="small"
                            icon="el-icon-plus"
                            @click="openSelectionTable('addSearchCondition')">
                            添加查询条件
                        </el-button>
                    </template>
                </avue-crud>
            <el-row>
                <el-tabs type="border-card" v-model="activeName">
                    <el-tab-pane name="first" :disabled="isDisabledTabs">
                        <span slot="label"><i class="el-icon-monitor"></i>显示的属性与其他配置</span>
                        <el-row>
                            <avue-form :ref="formRefs[1]" :option="formOtherOption" v-model="form" class="referTypeForm">
                                <template #sortField="{disabled,size}">
                                    <el-input :disabled="disabled"
                                        :size="size"
                                        v-model="form.sortField"
                                        ref="sortField"
                                        placeholder="请选择 排序字段"
                                        prefix-icon="el-icon-search"
                                        readonly="true"
                                        @focus="openSelectionTable('sortField')">
                                        <i slot="suffix" class="el-icon-circle-close" @click="clearSelectionTable('sortField')" style="margin-right: 5px;cursor: pointer;"></i>
                                    </el-input>
                                </template>
                            </avue-form>
                        </el-row>
                        <el-row v-show="form.type=='default' || form.type=='grid'">
                            <el-divider content-position="left" style="margin-bottom: -40px;">配置显示的属性</el-divider>
                            <avue-crud
                                ref="crudAttr"
                                class="crud-attr"
                                :option="attrOption"
                                @cell-click="clickAttrEdit"
                                :data="codeShowFieldConfigVOS">
                                <!-- 表格内操作按钮 -->
                                <template slot="menu" slot-scope="scope">
                                    <el-button type="text"
                                        size="small"
                                        icon="el-icon-search"
                                        plain
                                        @click="scope.row.isquery=!scope.row.isquery">
                                        {{scope.row.isquery ? "取消快速查询":"快速查询"}}
                                    </el-button>
                                    <el-button type="text"
                                        size="small"
                                        icon="el-icon-minus"
                                        plain
                                        @click="removeCurrentRow(scope.row,'removeAttr')">移除
                                    </el-button>
                                </template>
                                <!-- 表格左上方按钮区域 -->
                                <template slot="menuLeft" slot-scope="scope">
                                    <el-button type="primary"
                                        size="small"
                                        icon="el-icon-plus"
                                        @click="openSelectionTable('selectAttr')">选择属性
                                    </el-button>
                                    <div class="tag-group" style="display: inline">
                                        <el-tag
                                            v-for="item in codeShowFieldConfigVOS"
                                            v-show="item.isquery && item.title!=''"
                                            style="margin-left: 3px"
                                            :key="item.title"
                                            type="info"
                                            size="small"
                                            effect="dark">
                                            {{ item.title }}
                                        </el-tag>
                                    </div>
                                </template>
                            </avue-crud>
                        </el-row>
                    </el-tab-pane>
                    <el-tab-pane name="second">
                        <span slot="label"><i class="el-icon-search"></i>添加查询条件</span>
                        <avue-crud
                            ref="crudAddCondition"
                            :option="addSearchCondtionOption"
                            @cell-click="clickAddSearchCondtionEdit"
                            :data="form.codeSrchCondConfigVOS">
                            <!-- 表格内操作按钮 -->
                            <template slot="menu" slot-scope="scope">
                                <el-button type="text"
                                    size="small"
                                    icon="el-icon-minus"
                                    plain
                                    @click="removeCurrentRow(scope.row,'removeaddSearchCondtion')">移除
                                </el-button>
                            </template>
                            <!-- 表格左上方按钮区域 -->
                            <template slot="menuLeft" slot-scope="scope">
                                <el-button type="primary"
                                    size="small"
                                    icon="el-icon-plus"
                                    @click="openSelectionTable('addSearchCondition')">
                                    添加查询条件
                                </el-button>
                            </template>
                        </avue-crud>
                    </el-tab-pane>
                </el-tabs>
            </el-row>
        </div>
@@ -116,38 +145,14 @@
            <el-button @click="isShowReferConfigForm = false">取 消</el-button>
        </div>
        <el-dialog title="为【参照的业务类型】选取值"
            append-to-body
            :visible.sync="isShowReferBtmType"
            width="70%"
            destroy-on-close
            @close="clearTableRowSelection('referType')"
            style="height: 110vh; margin-top: -12vh; overflow-y: hidden">
            <avue-crud :option="selectionReferBtmTypeOption"
                :table-loading="selectReferBtmTypeLoading"
                :data="selectReferBtmTypeData"
                :page.sync="selectReferBtmTypePage"
                ref="selectReferBtmTypeCrud"
                class="referBtmType-crud"
                @row-click="referBtmTypeRowClick"
                @search-change="referBtmTypeSearchChange"
                @search-reset="referBtmTypeSearchReset"
                @current-change="referBtmTypeCurrentChange"
                @size-change="referBtmTypeSizeChange">
                <template #radio="{row}">
                    <el-radio v-model="referBtmTypeSelectRow"
                        :label="row.$index">
                        &nbsp;
                    </el-radio>
                </template>
            </avue-crud>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="selectedReferBtmType">确 定</el-button>
                <el-button @click="isShowReferBtmType = false">取 消</el-button>
            </div>
        </el-dialog>
        <!-- 对话框,为【参照引用的业务类型】选取值对话框 -->
        <refer-btm-type-crud-dialog
            :visible.sync="referBtmDialogParams.selectReferBtmSettingBox"
            :ref="referBtmDialogParams.ref"
            @echoReferBtmType="echoReferBtmType">
        </refer-btm-type-crud-dialog>
        <el-dialog title="为【排序字段】选取值"
        <!-- <el-dialog title="为【排序字段】选取值"
            append-to-body
            :visible.sync="isShowSortField"
            width="70%"
@@ -175,7 +180,14 @@
                <el-button type="primary" @click="selectedSortField">确 定</el-button>
                <el-button @click="isShowSortField = false">取 消</el-button>
            </div>
        </el-dialog>
        </el-dialog> -->
        <refer-select-btm-attr-dialog
            title="为【排序字段】选取值"
            :visible.sync="selectedBtmTypeAttrParams.selectedBtmTypeAttrSettingBox"
            :ref="selectedBtmTypeAttrParams.ref"
            @echoSelectedAttr="echoSelectedAttr">
        </refer-select-btm-attr-dialog>
        <el-dialog title="选择显示字段"
            append-to-body
@@ -220,23 +232,23 @@
        </el-dialog>
    </el-dialog>
</template>
<script>
    import func from "@/util/func";
    export default {
        name: "referConfigDialog",
        name: "referConfigFormDialog",
        props: {
        },
        data() {
            let element = '';
            return {
                activeName: 'first', //当前活动的tabs
                labelWidth: '150',   // 标题宽度
                isShowReferConfigForm: false,  // 第一层对话框显示隐藏控制
                referTypeIsReadOnly: false,
                // 表单对象
                form: {
                    referTypeName: '', //显示的值
@@ -252,7 +264,12 @@
                    paramForFormKey: '',
                    isMuti: false,
                    mapFields: '',
                     // 查询条件列表
                    isOpenGlobal: true, //是否开启全局
                    codeSrchCondConfigVOS: [],
                    isPersistence: true, // 是否持久化
                    id: '',
                    name: '',
                    // 查询条件列表
                    // limit: '15',
                    // sortField: '',
                    // sortType: 'asc',
@@ -264,7 +281,21 @@
                    // loadType: 'all',
                    // onlyLeaf: false,
                },
                attrData: [],
                // type切换时对form表单属性进行移除
                removeFormAttr: [
                    'limit',
                    'sortField',
                    'sortType',
                    'parentFieldName',
                    'parentUsedField',
                    'parentValue',
                    'loadType',
                    'onlyLeaf',
                    'sortType',
                    'referContent',
                    'displayTable',
                ],
                codeShowFieldConfigVOS: [],
                attrOption: {
                    height:'180',
                    tip: false,
@@ -282,19 +313,21 @@
                    columnBtn: false,
                    dialogClickModal: false,
                    highlightCurrentRow: true,
                    indexFixed: 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",
@@ -315,7 +348,7 @@
                            }, {
                                value: 'textarea', label: '文本域'
                            }],
                            blur: (value) => this.updateAttrBlur(value),
                            // blur: (value) => this.updateAttrBlur(value),
                        },{
                            label: "列表可排序",
                            prop: "sort",
@@ -324,38 +357,38 @@
                            type:"switch",
                            width: '80px',
                            value: true,
                            blur: (value) => this.updateAttrBlur(value),
                            // blur: (value) => this.updateAttrBlur(value),
                        },{
                            label: "排序字段",
                            prop: "sortField",
                            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: "fixedText",
                            prop: "fixedPosition",
                            cell: true,
                            type:"select",
                            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),
                        },
                    ]
                },
                addSearchCondtionData: [],
                // addSearchCondtionData: [],
                addSearchCondtionOption: {
                    height:'150',
                    tip: false,
@@ -385,21 +418,25 @@
                            type: "select",
                            cell: true,
                            clearable: false,
                            dicData: [{
                                value: 'like', label: '包含'
                            }, {
                                value: '=', label: '等于'
                            }, {
                                value: '>', label: '大于'
                            }, {
                                value: '<', label: '小于'
                            }, {
                                value: '!=', label: '不等于'
                            }, {
                                value: '>=', label: '大于等于'
                            }, {
                                value: '<=', label: '小于等于'
                            }]
                            dicData: [
                                {
                                    value: '_in', label: '存在于'
                                },{
                                    value: '_notin', label: '不存在于'
                                },{
                                    value: '_like', label: '包含'
                                },{
                                    value: "_notlike", label: "不包含",
                                }, {
                                    value: '_equal', label: '等于'
                                }, {
                                    value: '_notequal', label: '不等于'
                                }, {
                                    value: '_ge', label: '大于'
                                }, {
                                    value: '_le', label: '小于'
                                }
                            ]
                        },{
                            label: "筛选值",
                            prop: "filterValue",
@@ -408,213 +445,29 @@
                        }
                    ]
                },
                // 两个表单的ref
                formRefs: ['form','otherForm'],
                //为【参照的业务类型】选取值对话框
                selectionReferBtmTypeOption: {
                    border: true,
                    height: '260',
                    tip: false,
                    //searchShow: false,
                    index: true,
                    selection: false,
                    menu: false,
                    addBtn: false,
                    refreshBtn: false,
                    searchShowBtn: false,
                    columnBtn: false,
                    dialogClickModal: false,
                    highlightCurrentRow: true,
                    align: 'center',
                    menuAlign: 'center',
                    column: [{
                        label: '-',
                        prop: 'radio',
                        width: 60,
                        hide: false
                    },{
                        label: '业务类型编号',
                        width: 120,
                        search: true,
                        searchSpan: 8,
                        searchLabelWidth: 100,
                        prop: 'id'
                    },{
                        label: '业务类型名称',
                        search: true,
                        searchSpan: 8,
                        searchLabelWidth: 100,
                        prop: 'name'
                    },{
                        label: '描述',
                        search: false,
                        prop: 'description'
                    }],
                },
                selectReferBtmTypeLoading: false,
                selectReferBtmTypeData: [],
                selectReferBtmTypePage: {
                    pageSize: 10,
                    currentPage: 1,
                    total: 0
                },
                referBtmTypeQuery: {},
                isShowReferBtmType: false,
                referBtmTypeSelectRowData: '',
                referBtmTypeSelectRow: '',
                // tabs控制
                isDisabledTabs: false,
                activeName: 'first', //当前活动的tabs
                // 为【排序字段】选取值对话框
                isShowSortField: false,
                selectionSortFieldOption: {
                    border: true,
                    height: '220px',
                    tip: false,
                    //searchShow: false,
                    index: true,
                    selection: false,
                    addBtn: false,
                    menu: false,
                    refreshBtn: false,
                    searchShowBtn: false,
                    columnBtn: false,
                    dialogClickModal: false,
                    highlightCurrentRow: true,
                    align: 'center',
                    menuAlign: 'center',
                    border: true,
                    column: [{
                        label: '-',
                        prop: 'radio',
                        width: 60,
                        hide: false
                    },{
                        label: '属性英文编号',
                        width: 120,
                        search: true,
                        searchSpan: 8,
                        searchLabelWidth: 100,
                        prop: 'id'
                    },{
                        label: '属性中文名称',
                        search: true,
                        searchSpan: 8,
                        searchLabelWidth: 100,
                        prop: 'name'
                    },{
                        label: '属性长度',
                        search: false,
                        prop: 'attrLength'
                    },{
                        label: '属性类型',
                        search: false,
                        prop: 'attrType'
                    }],
                /** 参照引用的业务类型对话框相关参数 */
                referBtmDialogParams: {
                    ref: 'crudReferBtm',
                    selectReferBtmSettingBox: false,
                },
                selectSortFieldLoading: false,
                selectSortFieldData: [],
                selectSortFieldPage: {
                    pageSize: 10,
                    currentPage: 1,
                    total: 0
                /** 选择关联的业务类型属性相关的对话框相关参数 */
                selectedBtmTypeAttrParams: {
                    ref: 'selectedBtmTypeAttrCrud',
                    selectedBtmTypeAttrSettingBox: false,
                },
                sortFieldQuery: {},
                sortFieldSelectRow: '',
                sortFieldSelectRowData: '',
                //选择显示字段
                isShowShowField: false,
                selectionShowFieldOption:  {
                    border: true,
                    height: '220px',
                    tip: false,
                    //searchShow: false,
                    index: true,
                    selection: true,
                    addBtn: false,
                    menu: false,
                    refreshBtn: false,
                    searchShowBtn: false,
                    columnBtn: false,
                    dialogClickModal: false,
                    highlightCurrentRow: true,
                    align: 'center',
                    menuAlign: 'center',
                    border: true,
                    column: [{
                        label: '属性英文编号',
                        width: 120,
                        search: true,
                        searchSpan: 8,
                        searchLabelWidth: 100,
                        prop: 'id'
                    },{
                        label: '属性中文名称',
                        search: true,
                        searchSpan: 8,
                        searchLabelWidth: 100,
                        prop: 'name'
                    },{
                        label: '属性长度',
                        search: false,
                        prop: 'attrLength'
                    },{
                        label: '属性类型',
                        search: false,
                        prop: 'attrType'
                    }],
                seletedBtmTypeAttrOptions: {
                    title: '', //对话框显示的标题
                    condition: '',  //当前打开对话框的类型
                    btmTypeId: '', //查询条件,业务类型id
                },
                showFieldQuery: {},
                selectShowFieldLoading: false,
                selectShowFieldData: [],
                showFieldSelectList: [],
                //添加查询条件
                isShowSearchCondition: false,
                selectionSearchConditionOption: {
                    border: true,
                    height: '220px',
                    tip: false,
                    //searchShow: false,
                    index: true,
                    selection: true,
                    addBtn: false,
                    menu: false,
                    refreshBtn: false,
                    searchShowBtn: false,
                    columnBtn: false,
                    dialogClickModal: false,
                    highlightCurrentRow: true,
                    align: 'center',
                    menuAlign: 'center',
                    border: true,
                    column: [{
                        label: '属性英文编号',
                        width: 120,
                        search: true,
                        searchSpan: 8,
                        searchLabelWidth: 100,
                        prop: 'id'
                    },{
                        label: '属性中文名称',
                        search: true,
                        searchSpan: 8,
                        searchLabelWidth: 100,
                        prop: 'name'
                    },{
                        label: '属性长度',
                        search: false,
                        prop: 'attrLength'
                    },{
                        label: '属性类型',
                        search: false,
                        prop: 'attrType'
                    }],
                },
                selectSearchConditionLoading: false,
                selectSearchConditionData: [],
                searchConditionQuery: {},
                searchConditionSelectList: [],
                //上一次点击的行编辑数据
                preClickAttrRow: '',
@@ -624,368 +477,447 @@
        },
        // 表单界面显示内容配置
        computed: {
            formOption() {
                /** 检验是否为数字 */
                let validateNumber = "";
                validateNumber = (rule, value,callback) => {
                    if(/[^\d]/g.test(value)){
                        callback(new Error('窗口显示的高度必须为数值类型'));
                    }else {
                        callback();
                    }
                };
                return {
                    submitBtn: false,
                    emptyBtn: false,
                    labelWidth: '145', //默认标签宽度
                    // 基础表单信息展示区域
                    column: [
                        {
                            label: '参照的业务类型',
                            prop: 'referTypeName',
                            span: 7,
                            disabled: this.referTypeIsReadOnly,
                            clearable: !this.referTypeIsReadOnly,
                            tip: '参照数据查询的业务类型。',
                            tipPlacement: 'right',
                            rules: [{
                                required: true,
                                message: "(参照的业务类型)必填项不能为空",
                                trigger: ["blur","change"],
                            }],
                        },{
                            label: '显示的属性',
                            prop: 'textField',
                            tip: '选择数据后,显示到字段上的信息所属的属性,一般都是name,如果是多个属性使用逗号分割,如id,name。',
                            tipPlacement: 'right',
                            span: 7,
                            value: 'name',
                            rules: [{
                                required: true,
                                message: "(显示的属性)必填项不能为空",
                                trigger: "blur",
                            }],
                        },{
                            label: '存储值的属性',
                            prop: 'valueField',
                            tip: '选择数据后,保存到数据库里的属性,一般都是oid或者id,如果是多个属性使用逗号分割,如oid ,id',
                            value: 'oid',
                            tipPlacement: 'right',
                            span: 7,
                            rules: [{
                                required: true,
                                message: "(存储值的属性)必填项不能为空",
                                trigger: "blur",
                            }],
                        },{
                            label: '参照窗口类型',
                            prop: 'type',
                            tip: 'default:默认的参照窗口样式; stand:UI上下文配置的方式; classify:分类+档案的显示; 自定义的参照直接写js的组件路径;tree:树形展示;grid:列表展示',
                            tipPlacement: 'right',
                            span: 7,
                            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 }) => {
                                // 复原表单,因为其他分组中如果存在值,在切换时,会保留输入的字段值所以需要还原
                                let oldForm = this.form;
                                this.form = {};  // 表单对象赋空
                                this.form.referType = oldForm.referType
                                this.form.textField = oldForm.textField
                                this.form.valueField = oldForm.valueField
                                this.form.type = oldForm.type //参照窗口类型
                                this.form.url =  oldForm.url
                                this.form.backPath =  oldForm.backPath
                                this.form.method =  oldForm.method
                                this.form.height =  oldForm.height
                                this.form.useFormKey =  oldForm.useFormKey
                                this.form.paramForFormKey =  oldForm.paramForFormKey
                                this.form.isMuti =  oldForm.isMuti
                                this.form.mapFields =  oldForm.mapFields
                                let addFrom = {};  //根据类型需要添加的不同属性
                                if(value == 'stand'){
                                    addFrom = {
                                        referContent: '',
                                        displayTable: '',
                                    }
                                } else if(value == 'default' || value == 'grid'){
                                    addFrom = {
                                        limit: '15',
                                        sortField: '',
                                        sortType: 'asc',
                                    }
                                } else if(value == 'tree'){
                                    addFrom = {
                                        parentFieldName: '',
                                        parentUsedField: 'oid',
                                        parentValue: '',
                                        loadType: 'all',
                                        onlyLeaf: false,
                                        sortField: '',
                                        sortType: 'asc',
                                    }
                                }
                                // 合并两个表单
                                this.form = Object.assign(addFrom,this.form);
                                //console.log(this.form);
                            },
                        },{
                            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"
                            }],
                        },{
                            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: '是否多选',
                            type: 'switch',
                            prop: 'isMuti',
                            value: false,
                            span: 7,
                            row: true,
                        },{
                            label: '映射其他属性',
                            prop: 'mapFields',
                            tip: '选择数据后,将选择的数据拷贝到表单里的其他属性,书写格式为{当前表单上的属性:选择数据里的属性,XXXXx:yyyy}',
                            tipPlacement: 'right',
                            span: 18,
          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';
                        }
                    ],
                    // 变动的表单区域
                    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: 7,
                                    tip: '分页时每页显示的数量,不分页填-1',
                                    //value: 15,
                                    tipPlacement: 'right',
                                },{
                                    label: '排序字段',
                                    prop: 'sortField',
                                    span: 7,
                                    tip: '查询数据时的排序字段',
                                    //clearable: false,
                                    tipPlacement: 'right',
                                },{
                                    label: '排序类型',
                                    prop: 'sortType',
                                    span: 7,
                                    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: 7,
                                    tip: '只有参照窗口类型是stand时才必须设置,且在stand类型下才能生效',
                                    tipPlacement: 'right',
                                },
                                {
                                    label: '平台的表格编号',
                                    prop: 'displayTable',
                                    span: 7,
                                    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: 'onlyLeaf',
                                    span: 7,
                                    value: false,
                                    type: 'switch',
                                },{
                                    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'
                                    }],
                                },
                            ]
                        },
                    ]
                }
            },
                        // 类型切换时,对不需要的属性进行筛除
                        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<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;">
                //console.log(e.target);
                // console.log(this.$refs.crudAttr);
                // console.log(this.$refs.crudAttr.$el.contains(e.target));
                //console.log(!this.$refs.crudAttr.$el.contains(e.target) && this.preClickAttrRow != null);
                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;
                }
@@ -993,44 +925,79 @@
        },
        watch: {
            // 贼坑,切换类型时表格,隐藏再显示就会出现表格错位问题,
            'form.type'(val) {
                //console.log(val);
            'form.type'(value) {
                this.onloadAttrData();
            },
            // 监听父组件传的窗口显示隐藏的值
            isShowReferConfigForm (){
                if(this.isShowReferConfigForm && this.codeShowFieldConfigVOS.length <= 0){
                    this.onloadAttrData();
                }
            }
        },
        methods: {
            // 选择完参照配置之后点击保存按钮触发
            async selectedListReferConfig(){
                // 标记所有表单是否通过校验的变量
                let isValid = true;
                // 遍历表单数组,依次对每个表单进行校验
                await this.formRefs.forEach(ref => {
                    this.$refs[ref].validate((valid, done, msg) => {
                        if (!valid) {
                            for(let attr in msg) {
                                this.$message.warning(msg[attr][0].message);
                                break;
                            }
                            isValid = false;
                        }
                        done();
                    })
                })
                // 如果所有表单都校验通过,执行提交操作
                if (isValid) {
                    // 根据类型对form表单中的参数进行过滤,只保留非空且需要的属性
                    let submitForm = this.filterForm();
                    this.$emit('echoReferConfig', submitForm) // 触发update:data将子组件值传递给父组件
                    this.isShowReferConfigForm = false;
                }
            },
            // 单击表格实现表格行编辑
            clickAttrEdit(row, column, event){
                if(this.preClickAttrRow && this.preClickAttrRow != row){
                    //console.log(this.attrData[this.preClickAttrRow.$index]);
                    this.attrData[this.preClickAttrRow.$index].$cellEdit = false;
                    this.codeShowFieldConfigVOS[this.preClickAttrRow.$index].$cellEdit = false;
                }
                row.$cellEdit = true;
                this.preClickAttrRow = row;
            },
            // 属性表格行编辑失去焦点时保存方法
            // updateAttrBlur(value){
                //console.log(this.attrData[0]);
                //console.log(this.codeShowFieldConfigVOS[0]);
            // },
            // 单击表格实现表格行编辑
            clickAddSearchCondtionEdit(row, column, event){
                if(this.preClickAddSearchConditionRow && this.preClickAddSearchConditionRow != row){
                    //console.log(this.attrData[this.preClickAttrRow.$index]);
                    this.addSearchCondtionData[this.preClickAddSearchConditionRow.$index].$cellEdit = false;
                    //console.log(this.codeShowFieldConfigVOS[this.preClickAttrRow.$index]);
                    this.form.codeSrchCondConfigVOS[this.preClickAddSearchConditionRow.$index].$cellEdit = false;
                }
                row.$cellEdit = true;
                this.preClickAddSearchConditionRow = row;
            },
            //上一个页面已经选中参照应用的业务类型的情况,和上一次已经配置过参照配置的情况下进行页面初始化渲染
            initPageData(val){
                //console.log(val);
                // console.log(val.referConfig);
                if(func.notEmpty(val.referConfig)){
                    this.form = JSON.parse(val.referConfig);
                    //console.log(val);
                    this.referTypeIsReadOnly = true;
                    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)){
                        this.codeShowFieldConfigVOS = this.form.codeShowFieldConfigVOS;
                    }
                    return;
                }else {
                    this.onloadAttrData()
                }
                if(func.notEmpty(val.referType)){
                    this.form.referTypeName = val.referTypeName;
@@ -1040,38 +1007,17 @@
                }
                //console.log(localStorage.getItem("userId"));
            },
            // 选择完参照配置之后点击保存按钮触发
            selectedListReferConfig(){
                //表单验证
                this.$refs.form.validate((valid, done, msg) => {
                    if (valid) {
                        // 根据类型对form表单中的参数进行过滤,只保留非空且需要的属性
                        let submitForm = this.filterForm();
                        //console.log(submitForm);
                        this.$emit('echoReferConfig', submitForm) // 触发update:data将子组件值传递给父组件
                        this.isShowReferConfigForm = false;
                        done()
                    } else {
                        for(let attr in msg) {
                            //console.log(msg[attr][0].message);
                            this.$message.warning(msg[attr][0].message);
                            break;
                        }
                        return false;
                    }
                })
            },
            /** 其实选取属性表格的默认数据不需要加载,
             但是弹窗打开会有表格错行问题所以需要在这调用doLayout方法*/
            onloadAttrData(){
                this.attrData = [
                this.codeShowFieldConfigVOS = [
                    {
                        field: 'id',
                        title: '编号',
                        fieldType: 'text',
                        fieldTypeText: '文本框',
                        sort: true,
                        sortField: 'id',
                        attrSortField: 'id',
                        width: '150',
                        isquery: true,
                        $cellEdit: false
@@ -1081,23 +1027,23 @@
                        fieldType: 'text',
                        fieldTypeText: '文本框',
                        sort: true,
                        sortField: 'name',
                        attrSortField: 'name',
                        width: '180',
                        isquery: true,
                        $cellEdit: false
                    }
                ];
                this.$nextTick(() => {
                    this.$refs.crudAttr.doLayout()
                })
                // this.$nextTick(() => {
                //     this.$refs.crudAttr.doLayout()
                // })
            },
            // 属性选择表格中的移除按钮功能
            removeCurrentRow(row,condition){
                if(condition=='removeAttr'){
                    this.$delete(this.attrData, row.$index);
                    this.$delete(this.codeShowFieldConfigVOS, row.$index);
                    return;
                }
                this.$delete(this.addSearchCondtionData, row.$index);
                this.$delete(this.form.codeSrchCondConfigVOS, row.$index);
            },
            // 该界面的数据进行初始化复原
            recoveryDataAndForm(condition){
@@ -1110,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(){
@@ -1132,8 +1080,10 @@
                    'useFormKey',
                    'paramForFormKey',
                    'isMuti',
                    'mapFields',
                    'searchCondition',
                    'mapFields',
                    'codeSrchCondConfigVOS',
                    'isOpenGlobal', //是否开启全局
                    'isPersistence',
                ];
                let addArray = [];
                let newForm ={};
@@ -1144,33 +1094,37 @@
                    addArray = ['limit', 'sortField', 'sortType'];
                } else if(oldForm.type == 'tree'){
                    addArray = [
                        "parentFieldName",
                        "parentFieldName",
                        'parentUsedField',
                        'parentValue',
                        'parentValue',
                        'loadType',
                        'onlyLeaf',
                        'sortField',
                        'sortType'
                    ];
                }
                // 开启持久化参照配置
                if(oldForm.isPersistence=='true' || oldForm.isPersistence){
                    submittDefaultForm =  submittDefaultForm.concat(['id','name'])
                }
                submittDefaultForm = submittDefaultForm.concat(addArray);
                if(!this.checkArrayIsUndefined(this.addSearchCondtionData)){
                if(!this.checkArrayIsUndefined(this.form.codeSrchCondConfigVOS)){
                    newForm = {
                        searchCondition: this.addSearchCondtionData,
                        codeSrchCondConfigVOS: this.form.codeSrchCondConfigVOS,
                    }
                }
                if((oldForm.type == 'default' || oldForm.type  == 'grid') && (this.attrData.length >= 0 && !this.checkArrayIsUndefined(this.addSearchCondtionData))){
                    newForm = Object.assign(newForm,{attrData:this.attrData});
                if((oldForm.type == 'default' || oldForm.type  == 'grid') && (this.codeShowFieldConfigVOS.length >= 0 && !this.checkArrayIsUndefined(this.codeShowFieldConfigVOS))){
                    newForm = Object.assign(newForm,{codeShowFieldConfigVOS:this.codeShowFieldConfigVOS});
                }
                // 过滤出空值属性和不需要的属性
                submittDefaultForm.forEach(item=>{
                    // 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);
                //console.log(newForm);
                return newForm;
            },
            /**
@@ -1196,28 +1150,7 @@
            checkArrayIsUndefined(val){
                return typeof val === 'array' && (val.length === 0 ||val === null || typeof val === 'undefined');
            },
            // 打开表格选择框
            openSelectionTable(condition){
                if (condition == 'referType'){
                    this.isShowReferBtmType = true;
                    this.referBtmTypeOnLoad();
                }else if (condition == 'sortField'){
                    this.isShowSortField = true;
                    this.sortFieldOnLoad();
                }else {
                    if(this.form.referType == '' || this.form.referType == null){
                        this.$message.warning("请输入参照的业务类型")
                        return;
                    }
                    if(condition == 'addSearchCondition'){
                        this.isShowSearchCondition = true;
                        this.selectSearchConditionDataOnload();
                    }else {
                        this.isShowShowField = true;
                        this.selectShowFieldDataOnload();
                    }
                }
            },
            // 清空表格选择框
            clearSelectionTable(condition){
                if(condition == 'referType'){
@@ -1227,255 +1160,85 @@
                    this.form.sortField = '';
                }
            },
            // 关闭对话框时对选中内容进行清空,并解绑全局监听事件
            clearTableRowSelection(condition){
            // 打开表格选择框
            openSelectionTable(condition){
                // 打开选择参照引用对话框
                if (condition == 'referType'){
                    this.referBtmDialogParams.selectReferBtmSettingBox = true;
                    // console.log(this.referBtmDialogParams.ref);
                    // 调用子组件刷新表格数据
                    this.$refs[this.referBtmDialogParams.ref].referBtmOnLoad();
                    return;
                }
                // 提示
                if(this.form.referType == '' || this.form.referType == null){
                    this.$message.warning("请输入参照的业务类型")
                    return;
                }
                let params = this.seletedBtmTypeAttrOptions;
                params.btmTypeId = this.form.referType
                // 选择排序字段
                if(condition == 'sortField'){
                    this.sortFieldSelectRow = '';
                    this.sortFieldSelectRowData = '';
                }else if(condition == 'referType'){
                    this.referBtmTypeSelectRow='';
                    this.referBtmTypeSelectRowData = '';
                    params.title = '为【排序字段】选取值对话框';
                    params.condition = 'sortField';
                }else if(condition == 'addSearchCondition'){
                    // 选择查询条件
                    params.title = '选择查询条件';
                    params.condition = 'addSearchCondition';
                }else{
                    // 选择属性
                    params.title = '选择显示字段';
                    params.condition = 'selectAttr';
                }
                this.$refs[this.selectedBtmTypeAttrParams.ref].selectedBtmTypeAttrOnLoad(params);
                this.selectedBtmTypeAttrParams.selectedBtmTypeAttrSettingBox = true;
            },
            // 为【参照的业务类型】选取值
            referBtmTypeOnLoad(page, params = {}){
                this.selectReferBtmTypeLoading = true;
                // 调用api请求
                const data = {
                    total: 2,
                    data: [{
                        id: 't2',
                        name: 'test2',
                        description: 'test2',
                    }, {
                        id: 't3',
                        name: 'test3',
                        description: 'test3',
                    }]
            /** 为【参照引用的业务类型】选取值之后的内容回显时调用 */
            echoReferBtmType(content){
                // 实现回显
                this.form.referTypeName = content.name || content.id;
                this.form.referType = content.id || '';
            },
            /** 排序字段、显示的属性、查询条件的表格行选择之后回显 */
            echoSelectedAttr(data){
                // console.log(data);
                // 为【排序字段】选取值
                if(data.condition === 'sortField'){
                    this.form.sortField = data.selectedArrary[0].id;
                }else if(data.condition === 'addSearchCondition') {
                    data.selectedArrary.forEach(item => {
                        this.form.codeSrchCondConfigVOS.push(
                            {
                                filterField: item.id,
                                filterType: '_equal',
                                filterTypeText: item.name,
                                filterValue: '',
                                $cellEdit: false
                            }
                        )
                    })
                }else{
                    // 选择显示字段
                    data.selectedArrary.forEach(item => {
                        // console.log(item);
                        this.codeShowFieldConfigVOS.push(
                            {
                                field: item.id,
                                title: item.name,
                                // fieldType: item.attrType,
                                // fieldTypeText: item.attrTypeText,
                                fieldType: 'text',
                                fieldTypeText: '文本框',
                                sort: false,
                                attrSortField: item.id,
                                width: item.attributeLength,
                                isquery: false,
                                $cellEdit: false
                            }
                        )
                    })
                }
                this.selectReferBtmTypeData = data.data;
                this.selectReferBtmTypePage.total = data.total;
                this.selectReferBtmTypeLoading = false;
            },
            referBtmTypeSizeChange(pageSize){
                this.selectReferBtmTypePage.pageSize = pageSize;
            },
            referBtmTypeSearchChange(params, done){
                this.referBtmTypeQuery = params;
                this.selectReferBtmTypePage.currentPage = 1;
                this.referBtmTypeOnLoad(this.page, params);
                done();
            },
            referBtmTypeSearchReset(){
                this.referBtmTypeQuery = {};
                this.referBtmTypeOnLoad(this.selectReferBtmTypePage);
            },
            referBtmTypeRowClick(row){
                this.referBtmTypeSelectRowData = row;
                this.referBtmTypeSelectRow = row.$index
                //console.log( this.referBtmTypeSelectRowData);
            },
            referBtmTypeCurrentChange(currentPage){
                this.selectReferBtmTypePage.currentPage = currentPage;
            },
            selectedReferBtmType(){
                if(!this.referBtmTypeSelectRowData) {
                    this.$message.warning("请选择一条数据");
                    return;
                }
                this.form.referTypeName = this.referBtmTypeSelectRowData.name;
                this.form.referType = this.referBtmTypeSelectRowData.id;
                this.isShowReferBtmType = false;
            },
            // 为【排序字段】选取值
            sortFieldOnLoad(page, params = {}){
                this.selectSortFieldLoading = true;
                // 调用api请求
                const data = {
                    total: 2,
                    data: [{
                        id: 'test',
                        name: '测试',
                        attrLength: 11,
                        attrType: '字符串'
                    }, {
                        id: 'test1',
                        name: '测试1',
                        attrLength: 12,
                        attrType: '数字'
                    }]
                }
                this.selectSortFieldData = data.data;
                this.selectSortFieldPage.total = data.total;
                this.selectSortFieldLoading = false;
            },
            sortFieldSizeChange(pageSize){
                this.selectSortFieldPage.pageSize = pageSize;
            },
            sortFieldSearchChange(params, done){
                this.sortFieldQuery = params;
                this.selectSortFieldPage.currentPage = 1;
                this.sortFieldOnLoad(this.page, params);
                done();
            },
            sortFieldSearchReset(){
                this.sortFieldQuery = {};
                this.sortFieldOnLoad(this.selectSortFieldPage);
            },
            sortFieldRowClick(row){
                this.sortFieldSelectRowData = row;
                this.sortFieldSelectRow = row.$index
                //console.log( this.sortFieldSelectRowData);
            },
            sortFieldCurrentChange(currentPage){
                this.selectReferBtmTypePage.currentPage = currentPage;
            },
            selectedSortField(){
                if(!this.sortFieldSelectRowData) {
                    this.$message.warning("请选择一条数据");
                    return;
                }
                this.form.sortField = this.sortFieldSelectRowData.id;
                this.isShowSortField = false;
            },
            // 选择显示字段
            selectShowFieldDataOnload(params = {}){
                this.selectShowFieldLoading = true;
                // 调用api请求
                const data = {
                    total: 2,
                    data: [{
                        id: 'test',
                        name: '测试',
                        attrLength: 11,
                        attrType: 'text',
                        attrTypeText: '文本框'
                    }, {
                        id: 'test1',
                        name: '测试1',
                        attrLength: 12,
                        attrType: 'number',
                        attrTypeText: '数字'
                    }, {
                        id: 'test2',
                        name: '测试2',
                        attrLength: 13,
                        attrType: 'date',
                        attrTypeText: '日期'
                    }]
                }
                this.selectShowFieldData = data.data;
                this.selectShowFieldLoading = false;
            },
            selectionShowFieldDataChange(list){
                this.showFieldSelectList = list;
                this.$refs.selectShowFieldCrud.setCurrentRow(this.showFieldSelectList[list.length-1]);
            },
            showFieldRowClick(row){
                //this.showFieldSelectList.push(row);
                this.$refs.selectShowFieldCrud.setCurrentRow(row);
                this.$refs.selectShowFieldCrud.toggleRowSelection(row); //选中当前行
            },
            showFieldSearchChange(params, done){
                this.showFieldQuery = params;
                this.selectShowFieldDataOnload(params);
                done();
            },
            showFieldSearchReset(){
                this.showFieldQuery = {};
                this.sortFieldOnLoad();
            },
            selectedShowField(){
                //console.log(this.showFieldSelectList);
                if(this.showFieldSelectList.length <= 0) {
                    this.$message.warning("请至少选择一条数据");
                    return;
                }
                //this.showFieldSelectList;
                this.showFieldSelectList.forEach(item => {
                    this.attrData.push(
                        {
                            field: item.id,
                            title: item.id,
                            fieldType: item.attrType,
                            fieldTypeText: item.attrTypeText,
                            sort: false,
                            sortField: item.id,
                            width: item.attrLength,
                            isquery: false,
                            $cellEdit: false
                        }
                    )
                })
                this.isShowShowField = false;
            },
            // 选择查询条件
            selectSearchConditionDataOnload(params = {}){
                this.selectSearchConditionLoading = true;
                // 调用api请求
                this.selectSearchConditionData = [{
                        id: 'test',
                        name: '测试',
                        attrLength: 11,
                        attrType: '字符串',
                        $cellEdit: false,
                    }, {
                        id: 'test1',
                        name: '测试1',
                        attrLength: 12,
                        attrType: '数字',
                        $cellEdit: false,
                    }, {
                        id: 'test2',
                        name: '测试2',
                        attrLength: 13,
                        attrType: '日期',
                        $cellEdit: false,
                }];
                this.selectSearchConditionLoading = false;
            },
            searchConditionRowClick(row){
                this.$refs.selectSearchConditionCrud.setCurrentRow(row);
                this.$refs.selectSearchConditionCrud.toggleRowSelection(row); //选中当前行
            },
            searchConditionDataChange(list){
                this.searchConditionSelectList = list;
                this.$refs.selectSearchConditionCrud.setCurrentRow(this.searchConditionSelectList[list.length-1]);
            },
            searchConditionSearchChange(params, done){
                this.searchConditionQuery = params;
                this.selectSearchConditionDataOnload(params);
                done();
            },
            searchConditionSearchReset(){
                this.searchConditionQuery = {};
                this.sortFieldOnLoad();
            },
            selectedSearchCondition(){
                console.log(this.searchConditionSelectList);
                if(this.searchConditionSelectList.length <= 0) {
                    this.$message.warning("请至少选择一条数据");
                    return;
                }
                this.searchConditionSelectList.forEach(item => {
                    this.addSearchCondtionData.push(
                        {
                            filterField: item.id,
                            filterType: '=',
                            filterValue: '',
                            $cellEdit: false
                        }
                    )
                })
                this.isShowSearchCondition = false;
            },
        }
@@ -1499,5 +1262,5 @@
        -webkit-transition:opacity .0s !important;
        transition:opacity .0s !important;
    }
</style>
</style>