ludc
2023-09-08 caeb0c1b3666655e2e05292c2fcaef82a9808cd1
Source/UBCS-WEB/src/components/code-dialog-page/referSelectBtmAttrDialog.vue
@@ -4,6 +4,8 @@
        append-to-body
        :visible.sync="crudParams.isShowDialog"
        width="65%"
        top="0"
        class= "avue-dialog avue-dialog--top"
        destroy-on-close
        @close="clearTableRowSelection"
        style="height: 110vh; margin-top: -12vh; overflow-y: hidden">
@@ -60,6 +62,7 @@
                    addBtn: false,
                    menu: false,
                    // refreshBtn: false,
                    disablePage: false,
                    searchShowBtn: false,
                    columnBtn: false,
                    dialogClickModal: false,
@@ -84,11 +87,11 @@
                    },{
                        label: '属性长度',
                        search: false,
                        prop: 'attrLength'
                        prop: 'attributeLength'
                    },{
                        label: '属性类型',
                        search: false,
                        prop: 'attrType'
                        prop: 'attrDataTypeText'
                    }],
                },
                crudData: [],
@@ -114,32 +117,38 @@
            this.options = params;
            this.crudParams.crudLoading = true;
            // 调用api请求
            const data = {
                total: 2,
                data: [{
                    id: 'test',
                    name: '测试',
                    attrLength: 11,
                    attrType: '字符串'
                }, {
                    id: 'test1',
                    name: '测试1',
                    attrLength: 12,
                    attrType: '数字'
                }]
            }
            // const data = {
            //     total: 2,
            //     data: [{
            //         id: 'test',
            //         name: '测试',
            //         attrLength: 11,
            //         attrType: '字符串'
            //     }, {
            //         id: 'test1',
            //         name: '测试1',
            //         attrLength: 12,
            //         attrType: '数字'
            //     }]
            // }
            let param = {};
            // 多个conditionMap这样传参
            if(this.crudParams.crudQuery){
                Object.keys(crudParams.crudQuery).forEach(key=>{
                    param['conditionMap['+key+']'] = crudParams.crudQuery[key];
                Object.keys(this.crudParams.crudQuery).forEach(key=>{
                    param['conditionMap['+key+']'] = this.crudParams.crudQuery[key];
                });
            }
            param['conditionMap[btmTypeId]'] = this.options.btmTypeId;
            gridAttributesByBtmId(1,-1,param).then(res=>{
                console.log(res);
                const data = res.data;
                // console.log(data.data.records);
                this.crudParams.crudData = data.data.records;
                this.crudParams.crudLoading = false;
                this.$nextTick(()=>{
                    this.$refs[this.crudParams.ref].doLayout();
                })
            })
            this.crudParams.crudData = data.data;
            this.crudParams.crudLoading = false;
        },
        selectedBtmTypeAttrSrchChange(params, done){
            this.crudParams.crudQuery = params;