ludc
2023-07-14 7602a824e39e19260ae32bb45e799e6ce43300ac
Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue
@@ -6,6 +6,7 @@
      :visible.sync="isShowReferConfigForm"
      width="90%"
      id="refer-config-form"
      destroy-on-close
      @close="recoveryDataAndForm('initData')"
      style="height: 115vh; margin-top: -14vh; overflow-y: hidden">
        <div style="width: 100%; overflow-y: auto; height: 70vh">
@@ -141,38 +142,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%"
@@ -200,7 +177,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
@@ -251,8 +235,9 @@
<script>
    import func from "@/util/func";
    export default {
        name: "referConfigDialog",
        name: "referConfigFormDialog",
        props: {
        },
        data() {
            let element = '';
@@ -261,6 +246,7 @@
                labelWidth: '150',   // 标题宽度
                isShowReferConfigForm: false,  // 第一层对话框显示隐藏控制
                referTypeIsReadOnly: false,
                // 表单对象
                form: {
                    referTypeName: '', //显示的值
@@ -281,7 +267,7 @@
                    isPersistence: true, // 是否持久化
                    id: '',
                    name: '',
                     // 查询条件列表
                    // 查询条件列表
                    // limit: '15',
                    // sortField: '',
                    // sortType: 'asc',
@@ -430,21 +416,21 @@
                            type: "select",
                            cell: true,
                            clearable: false,
                            dicData: [{
                                value: 'like', label: '包含'
                            }, {
                                value: '=', label: '等于'
                            }, {
                                value: '>', label: '大于'
                            }, {
                                value: '<', label: '小于'
                            }, {
                                value: '!=', label: '不等于'
                            }, {
                                value: '>=', label: '大于等于'
                            }, {
                                value: '<=', label: '小于等于'
                            }]
                            dicData: [
                                {
                                    value: '_like', label: '包含'
                                },{
                                    value: "_notlike", label: "不包含",
                                }, {
                                    value: '_equal', label: '等于'
                                }, {
                                    value: '_notequal', label: '不等于'
                                }, {
                                    value: '_ge', label: '大于'
                                }, {
                                    value: '_le', label: '小于'
                                }
                            ]
                        },{
                            label: "筛选值",
                            prop: "filterValue",
@@ -461,212 +447,21 @@
                activeName: 'first', //当前活动的tabs
                //为【参照的业务类型】选取值对话框
                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'
                    }],
                /** 参照引用的业务类型对话框相关参数 */
                referBtmDialogParams: {
                    ref: 'crudReferBtm',
                    selectReferBtmSettingBox: false,
                },
                selectReferBtmTypeLoading: false,
                selectReferBtmTypeData: [],
                selectReferBtmTypePage: {
                    pageSize: 10,
                    currentPage: 1,
                    total: 0
                /** 选择关联的业务类型属性相关的对话框相关参数 */
                selectedBtmTypeAttrParams: {
                    ref: 'selectedBtmTypeAttrCrud',
                    selectedBtmTypeAttrSettingBox: false,
                },
                referBtmTypeQuery: {},
                isShowReferBtmType: false,
                referBtmTypeSelectRowData: '',
                referBtmTypeSelectRow: '',
                // 为【排序字段】选取值对话框
                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'
                    }],
                seletedBtmTypeAttrOptions: {
                    title: '', //对话框显示的标题
                    condition: '',  //当前打开对话框的类型
                    btmTypeId: '', //查询条件,业务类型id
                },
                selectSortFieldLoading: false,
                selectSortFieldData: [],
                selectSortFieldPage: {
                    pageSize: 10,
                    currentPage: 1,
                    total: 0
                },
                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'
                    }],
                },
                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: '',
@@ -802,7 +597,7 @@
                                            this.isDisabledTabs = false;
                                        } else if(value == 'default' || value == 'grid'){
                                            addFrom = {
                                                limit: '15',
                                                limit: 15,
                                                sortField: '',
                                                sortType: 'asc',
                                            };
@@ -833,32 +628,35 @@
                                        // 合并两个表单
                                        this.form = Object.assign(addFrom,this.form);
                                        // console.log("endFilter",this.form.type);
                                        //console.log(this.form);
                                        // console.log(this.form);
                                    },
                                },{
                                    label: '是否开启持久化',
                                    label: '是否持久化参照配置',
                                    prop: 'isPersistence',
                                    labelWidth: '142',
                                    tip: 'true:开启持久化,对当前定义的参照配置进行持久化存储,下次可直接选取;false:仅对当前次码段新增生效。',
                                    tipPlacement: 'bottom',
                                    span: 6,
                                    type: 'switch',
                                },{
                                    display: this.form.isPersistence | this.form.isPersistence=='true',
                                    label: '编号',
                                    label: '参照配置编号',
                                    prop: 'id',
                                    tip: '设置该参照配置持久化存储时的编号。',
                                    rules: [{
                                        required: true,
                                        message: "(开始持久化时编号)必填项不能为空",
                                        message: "(开启持久化时编号)必填项不能为空",
                                        trigger: "blur",
                                    }],
                                    span: 6,
                                },{
                                    display: this.form.isPersistence | this.form.isPersistence=='true',
                                    label: '名称',
                                    label: '参照配置名称',
                                    prop: 'name',
                                    tip: '设置该参照配置持久化存储时的名称。',
                                    rules: [{
                                        required: true,
                                        message: "(开始持久化时名称)必填项不能为空",
                                        message: "(开启持久化时名称)必填项不能为空",
                                        trigger: "blur",
                                    }],
                                    span: 6,
@@ -977,7 +775,7 @@
                                    prop: 'limit',
                                    span: 8,
                                    tip: '分页时每页显示的数量,不分页填-1',
                                    //value: 15,
                                    value: 15,
                                    tipPlacement: 'right',
                                },{
                                    label: '排序字段',
@@ -1100,14 +898,10 @@
            },
        },
        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) && 
                   this.preClickAttrRow != '') {
                   this.preClickAttrRow.$cellEdit = false;
@@ -1122,56 +916,16 @@
            // 贼坑,切换类型时表格,隐藏再显示就会出现表格错位问题,
            'form.type'(value) {
                this.onloadAttrData();
            },
            // 监听父组件传的窗口显示隐藏的值
            isShowReferConfigForm (){
                if(this.isShowReferConfigForm){
                    this.onloadAttrData();
                }
            }
        },
        methods: {
            // 单击表格实现表格行编辑
            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;
                this.preClickAttrRow = row;
            },
            // 属性表格行编辑失去焦点时保存方法
            // updateAttrBlur(value){
                //console.log(this.codeShowFieldConfigVOS[0]);
            // },
            // 单击表格实现表格行编辑
            clickAddSearchCondtionEdit(row, column, event){
                if(this.preClickAddSearchConditionRow && this.preClickAddSearchConditionRow != row){
                    //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);
                if(func.notEmpty(val.referConfig)){
                    this.form = JSON.parse(val.referConfig);
                    // console.log(this.form);
                    this.form.isPersistence = this.form.isPersistence == 'true' ? 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;
                }
                if(func.notEmpty(val.referType)){
                    this.form.referTypeName = val.referTypeName;
                    this.form.referType = val.referType;
                    this.referTypeIsReadOnly = true;
                    return;
                }
                //console.log(localStorage.getItem("userId"));
            },
            // 选择完参照配置之后点击保存按钮触发
            async selectedListReferConfig(){
                // 标记所有表单是否通过校验的变量
@@ -1199,6 +953,52 @@
                    this.isShowReferConfigForm = false;
                }
            },
            // 单击表格实现表格行编辑
            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;
                this.preClickAttrRow = row;
            },
            // 属性表格行编辑失去焦点时保存方法
            // updateAttrBlur(value){
                //console.log(this.codeShowFieldConfigVOS[0]);
            // },
            // 单击表格实现表格行编辑
            clickAddSearchCondtionEdit(row, column, event){
                if(this.preClickAddSearchConditionRow && this.preClickAddSearchConditionRow != row){
                    //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.referConfig);
                if(func.notEmpty(val.referConfig)){
                    this.form = JSON.parse(val.referConfig);
                    // 参照引用的业务类型不可选
                    // 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;
                    this.form.referType = val.referType;
                    this.referTypeIsReadOnly = true;
                    return;
                }
                //console.log(localStorage.getItem("userId"));
            },
            /** 其实选取属性表格的默认数据不需要加载,
             但是弹窗打开会有表格错行问题所以需要在这调用doLayout方法*/
            onloadAttrData(){
@@ -1225,9 +1025,9 @@
                        $cellEdit: false
                    }
                ];
                this.$nextTick(() => {
                    this.$refs.crudAttr.doLayout()
                })
                // this.$nextTick(() => {
                //     this.$refs.crudAttr.doLayout()
                // })
            },
            // 属性选择表格中的移除按钮功能
            removeCurrentRow(row,condition){
@@ -1340,28 +1140,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'){
@@ -1371,257 +1150,87 @@
                    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;
            },
            /** 为【参照引用的业务类型】选取值之后的内容回显时调用 */
            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
                            }
                        )
                    })
                }
            },
            // 为【参照的业务类型】选取值
            referBtmTypeOnLoad(page, params = {}){
                this.selectReferBtmTypeLoading = true;
                // 调用api请求
                const data = {
                    total: 2,
                    data: [{
                        id: 't2',
                        name: 'test2',
                        description: 'test2',
                    }, {
                        id: 't3',
                        name: 'test3',
                        description: 'test3',
                    }]
                }
                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.codeShowFieldConfigVOS.push(
                        {
                            field: item.id,
                            title: item.id,
                            fieldType: item.attrType,
                            fieldTypeText: item.attrTypeText,
                            sort: false,
                            attrSortField: 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.form.codeSrchCondConfigVOS.push(
                        {
                            filterField: item.id,
                            filterType: '=',
                            filterTypeText: item.name,
                            filterValue: '',
                            $cellEdit: false
                        }
                    )
                })
                this.isShowSearchCondition = false;
            },
        }
    };