From e9b405657b6117a8dcfcf8505cfd5d6eccd39cc8 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期二, 30 五月 2023 18:32:57 +0800
Subject: [PATCH] code服务中部分do转vo时显示值转换改为缓存中拿值

---
 Source/UBCS-WEB/src/components/code-dialog-page/referConfigCrudDialog.vue |  283 ++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 204 insertions(+), 79 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/code-dialog-page/referConfigCrudDialog.vue b/Source/UBCS-WEB/src/components/code-dialog-page/referConfigCrudDialog.vue
index 54f330f..a992916 100644
--- a/Source/UBCS-WEB/src/components/code-dialog-page/referConfigCrudDialog.vue
+++ b/Source/UBCS-WEB/src/components/code-dialog-page/referConfigCrudDialog.vue
@@ -8,7 +8,7 @@
         style="height: 115vh; margin-top: -14vh; overflow-y: hidden">
         <div style="width: 100%; overflow-y: auto; height: 70vh">
             <el-row style="width: 100%; height:70%">
-                <el-col :style="toggleCrudWidth">
+                <el-col :style="toggleBasicCrudWidth">
                     <basic-container style="width: 100%;">
                         <avue-crud :option="referConfigCrudOption"
                             class="refer-config-crud"
@@ -42,8 +42,9 @@
                     </basic-container>
                 </el-col>
             </el-row>
-            <el-row style="width: 100%; height:30%; margin-top: 130px" v-show="srchCondParams.isShow && showAttrParams.isShow">
-                <el-col v-show="srchCondParams.isShow" style="width: 40%;">
+            <el-row style="width: 100%; height:30%; margin-top: 130px">
+                <el-col 
+                    :style="toggleSrchCrudWidth">
                     <basic-container style="width: 100%; height:100%;">
                         <avue-crud :option="srchCondOption"
                             class="refer-srchcond-crud"
@@ -53,7 +54,7 @@
                         </avue-crud>
                     </basic-container>
                 </el-col>
-                <el-col v-show="showAttrParams.isShow" style="width: 60%;">
+                <el-col v-show="showAttrParams.isShow" style="width: 60%; height: 100%;">
                     <basic-container style="width: 100%; height:100%;">
                         <avue-crud :option="showAttrOption"
                             class="refer-attr-crud"
@@ -121,7 +122,7 @@
                         },{
                             label: '鍙傜収鐨勪笟鍔$被鍨�',
                             search: false,
-                            prop: 'referType'
+                            prop: 'referTypeName'
                         },{
                             label: '鏄剧ず鐨勫睘鎬�',
                             search: false,
@@ -156,67 +157,67 @@
                     emptyBtn: false,
                     labelWidth: '150', //榛樿鏍囩瀹藉害
                     // 榛樿閰嶇疆灏变负鏍戝舰绫诲瀷锛屾敼浜嗕細鍑虹幇闂
-                    column: [{
-                        label: '鏍戝舰鐨勪笂绾у睘鎬�',
-                        prop: 'parentFieldName',
-                        span: 24,
-                        disabled: true,
-                        row: true,
-                        placeholder: ' ',
-                    },{
-                        label: '涓婄骇灞炴�у�煎搴斿睘鎬�',
-                        prop: 'parentUsedField',
-                        span: 24,
-                        disabled: true,
-                        row: true,
-                        placeholder: ' ',
-                    },{
-                        label: '鏍硅妭鐐圭殑鍊�',
-                        prop: 'parentValue',
-                        span: 24,
-                        disabled: true,
-                        row: true,
-                        placeholder: ' ',
-                    },
-                    {
-                        label: '鏍戝姞杞芥柟寮�',
-                        prop: 'loadType',
-                        span: 24,
-                        disabled: true,
-                        row: true,
-                        placeholder: ' ',
-                        dicData: [{
-                            label: '鍏ㄩ儴', value: 'all'
-                        }, {
-                            label: '閫愮骇鍔犺浇', value: 'node'
-                        }],
-                    },{
-                        label: '鏄惁鍙兘閫夋嫨鍙跺瓙鑺傜偣',
-                        prop: 'onlyLeaf',
-                        span: 24,
-                        disabled: true,
-                        row: true,
-                        placeholder: ' ',
-                    },{
-                        label: '鎺掑簭瀛楁',
-                        prop: 'sortField',
-                        span: 24,
-                        disabled: true,
-                        row: true,
-                        placeholder: ' ',
-                    },{
-                        label: '鎺掑簭绫诲瀷',
-                        prop: 'sortType',
-                        span: 24,
-                        disabled: true,
-                        row: true,
-                        placeholder: ' ',
-                        dicData: [{
-                            label: '鍗囧簭', value: 'asc'
-                        }, {
-                            label: '闄嶅簭', value: 'desc'
-                        }],
-                    },
+                    column: [
+                        {
+                            label: '鏍戝舰鐨勪笂绾у睘鎬�',
+                            prop: 'parentFieldName',
+                            span: 24,
+                            disabled: true,
+                            row: true,
+                            placeholder: ' ',
+                        },{
+                            label: '涓婄骇灞炴�у�煎搴斿睘鎬�',
+                            prop: 'parentUsedField',
+                            span: 24,
+                            disabled: true,
+                            row: true,
+                            placeholder: ' ',
+                        },{
+                            label: '鏍硅妭鐐圭殑鍊�',
+                            prop: 'parentValue',
+                            span: 24,
+                            disabled: true,
+                            row: true,
+                            placeholder: ' ',
+                        },{
+                            label: '鏍戝姞杞芥柟寮�',
+                            prop: 'loadType',
+                            span: 24,
+                            disabled: true,
+                            row: true,
+                            placeholder: ' ',
+                            dicData: [{
+                                label: '鍏ㄩ儴', value: 'all'
+                            }, {
+                                label: '閫愮骇鍔犺浇', value: 'node'
+                            }],
+                        },{
+                            label: '鏄惁鍙兘閫夋嫨鍙跺瓙鑺傜偣',
+                            prop: 'onlyLeaf',
+                            span: 24,
+                            disabled: true,
+                            row: true,
+                            placeholder: ' ',
+                        },{
+                            label: '鎺掑簭瀛楁',
+                            prop: 'sortField',
+                            span: 24,
+                            disabled: true,
+                            row: true,
+                            placeholder: ' ',
+                        },{
+                            label: '鎺掑簭绫诲瀷',
+                            prop: 'sortType',
+                            span: 24,
+                            disabled: true,
+                            row: true,
+                            placeholder: ' ',
+                            dicData: [{
+                                label: '鍗囧簭', value: 'asc'
+                            }, {
+                                label: '闄嶅簭', value: 'desc'
+                            }],
+                        },
                     ],
                 },
                 referConfigForm:{},
@@ -371,6 +372,10 @@
                     srchCondData: [],
                     isShow: true,
                 },
+                toggleSrchCrudWidth: {
+                    width: '40%',
+                    height: '100%',
+                },
 
                 //鏄剧ず鐨勫睘鎬ц〃鏍奸厤缃尯鍩�
                 showAttrOption: {
@@ -409,19 +414,19 @@
                                     prop: 'title'
                                 },{
                                     label: '瀛楁绫诲瀷',
-                                    prop: 'fieldType'
+                                    prop: 'fieldTypeText'
                                 },{
                                     label: '鍒楄〃鍙帓搴�',
                                     prop: 'sort' 
                                 },{
                                     label: '鎺掑簭瀛楁',
-                                    prop: 'sortField' 
+                                    prop: 'attrSortField' 
                                 },{
                                     label: '瀛楁瀹藉害',
                                     prop: 'width' 
                                 },{
                                     label: '鍒楀浐瀹氫綅缃�',
-                                    prop: 'fixedText' 
+                                    prop: 'fixedPositionText' 
                                 },{
                                     label: 'js鏄剧ず浠g爜',
                                     prop: 'templet' 
@@ -442,10 +447,14 @@
 
                 // 鏄惁鏄剧ず鍙樺姩鐨勮〃鍗曞尯鍩�
                 isShowForm: true,
-                toggleCrudWidth: {
+                toggleBasicCrudWidth: {
                     height: '100%',
                     width: '70%',
                 },
+                
+                // 鏄惁鏄剧ず灞炴�ц〃鏍�
+                isShowAttrCrud: true,
+                
                 defaultOrGridForm: ['limit','sortField','sortType'],
                 standForm: ['referContent','displayTable'],
                 treeForm: [
@@ -469,11 +478,107 @@
                     this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹紒");
                     return;
                 }
+                let filterForm = this.filterForm(currentSeletedRow);
                 if(condition == "selectedSave"){
-                    //console.log(currentSeletedRow);
+                    // 鐩存帴淇濆瓨,鎵�浠ョ洿鎺ヨ皟鐢╟ode鐣岄潰鐨勭晫闈㈠洖鏄� 
+                    this.$emit('echoReferConfig',filterForm);
+                    // console.log(filterForm);
                 }else {
-                    //console.log(currentSeletedRow);
+                    // 閫夋嫨骞朵慨鏀�,鎵цcode鏈嶅姟涓殑鎵撳紑鐣岄潰锛屾墍浠ヨ鍏堟瀯閫犲嚭鎵�闇�鐨勬暟鎹�
+                    let submitForm = {
+                        referBtmName: filterForm.referType,
+                        referBtmId: filterForm.referTypeName,
+                        referConfig:  JSON.stringify(filterForm),
+                    }
+                    this.$emit('openReconfigInterFace',submitForm);
                 }
+                this.isShowReferConfigCrud = false;
+            },
+            // 杩囨护鍑哄綋鍓嶇被鍨嬫墍闇�瑕佺殑灞炴��
+            filterForm(currentRow){
+                // 闇�瑕佷繚鐣欑殑鍩虹灞炴��
+                let submittDefaultForm = [
+                    'referTypeName',
+                    'referType',
+                    'textField',
+                    'valueField',
+                    'type', //鍙傜収绐楀彛绫诲瀷
+                    'url',
+                    'backPath',
+                    'method',
+                    'height',
+                    'useFormKey',
+                    'paramForFormKey',
+                    'isMuti',
+                    'mapFields', 
+                    'isOpenGlobal', //鏄惁寮�鍚叏灞�
+                    'isPersistence',
+                    'id',
+                    'name',
+                ];
+                // 闇�瑕佹牴鎹被鍨嬫坊鍔犵殑灞炴��
+                let addArray = [];
+                let newForm ={};
+                // 鏍规嵁涓嶅悓绫诲瀷杩囨护鍑轰笉鍚岀殑鐨勮〃鍗曞睘鎬�
+                if(currentRow.type == 'stand'){
+                    addArray = ['referContent', 'displayTable'];
+                } else if(currentRow.type == 'default' || currentRow.type == 'grid'){
+                    addArray = ['limit', 'sortField', 'sortType'];
+                } else if(currentRow.type == 'tree'){
+                    addArray = [
+                        "parentFieldName", 
+                        'parentUsedField',
+                        'parentValue', 
+                        'loadType',
+                        'onlyLeaf',
+                        'sortField',
+                        'sortType'
+                    ];
+                }
+                // 鎷兼帴涓や釜鏁扮粍
+                submittDefaultForm = submittDefaultForm.concat(addArray);
+                if(currentRow.codeSrchCondConfigVOS.length > 0){
+                    //console.log(currentRow.codeSrchCondConfigVOS);
+                    newForm = {
+                        codeSrchCondConfigVOS: currentRow.codeSrchCondConfigVOS,
+                    }
+                }
+                if((currentRow.type == 'default' || currentRow.type  == 'grid') && currentRow.codeShowFieldConfigVOS.length >= 0){
+                    newForm = Object.assign(newForm,{codeShowFieldConfigVOS: currentRow.codeShowFieldConfigVOS});
+                }
+                // 杩囨护鍑虹┖鍊煎睘鎬у拰涓嶉渶瑕佺殑灞炴��
+                submittDefaultForm.forEach(item=>{
+                    // console.log(!this.checkStringIsEmpty(currentRow[item]) || !this.checkArrayIsUndefined(currentRow[item]));
+                    if((item == 'isMuti' || item == 'onlyLeaf') || (!this.checkStringIsEmpty(currentRow[item]) || !this.checkArrayIsUndefined(currentRow[item]))){
+                        //console.log(item,currentRow[item]);
+                        newForm = Object.assign(newForm,{[item]:currentRow[item]});  
+                    }
+                });
+                // console.log(newForm);
+                return newForm;
+            },
+             /**
+             * 涓虹┖
+             * @param val
+             * @returns {boolean}
+            */
+            checkStringIsEmpty(val){
+                if (
+                    val === null ||
+                    typeof val === 'undefined' ||
+                    (typeof val === 'string' && val === "" && val !== 'undefined')
+                ) {
+                    return true;
+                }
+                    return false;
+            },
+             /**
+             * 鏄惁涓哄畾涔�
+             * @param val
+             * @returns {boolean}
+             */
+            checkArrayIsUndefined(val){
+                return typeof val === 'array' && (val.length === 0 || val === null || typeof val === 'undefined' || val === []);
             },
             referConfigOnload(){
                 let refer = this.referConfigParams;
@@ -494,12 +599,16 @@
                     this.referConfigParams.referConfigPage.total = data.total;
                     this.referConfigParams.referConfigData = data.records;
                     this.referConfigParams.referConfigLoading = false;
-                    //console.log(this.referConfigParams.referConfigData.length > 0);     
+                    //console.log(this.referConfigParams.referConfigData.length > 0); 
+                    // 娓叉煋鍏朵粬鍖哄煙鏁版嵁    
                     if(this.referConfigParams.referConfigData.length > 0) {      
                         this.$nextTick(() => {
+                            // 琛ㄦ牸閿欒闂
                             this.$refs[this.referConfigParams.ref].doLayout()
+                            // 榛樿閫変腑绗竴琛�
                             this.referConfigParams.referConfigSelectedRow = 0;
                             this.$refs[this.referConfigParams.ref].setCurrentRow(this.referConfigParams.referConfigData[0]);
+                            this.referConfigParams.referConfigSelectedRowData = this.referConfigParams.referConfigData[0];
                             this.attrAndSrchCondOnload(this.referConfigParams.referConfigData[0]);
                             this.loadDefaultOrGridOrStandOrTreeForm(this.referConfigParams.referConfigData[0]);
                         }) 
@@ -544,14 +653,15 @@
                    currentFormData.type != 'grid') {
                     //鎺у埗鍙傜収閰嶇疆琛ㄦ牸鍜岃〃鍗曟樉绀烘瘮渚�
                     this.isShowForm = false;
-                    this.toggleCrudWidth.width = '100%';
+                    this.toggleBasicCrudWidth.width = '100%';
                 }else {
                     this.isShowForm = true;
-                    this.toggleCrudWidth.width = '70%';
+                    this.toggleBasicCrudWidth.width = '70%';
                     this.toggleFormOption(currentFormData);
                 }
+                this.toggleCurdWidth(currentFormData);
                 //console.log(this.isShowForm);
-                //console.log(this.toggleCrudWidth.width);
+                //console.log(this.toggleBasicCrudWidth.width);
             },
 
             // 鏍规嵁type鐨勫彉鍔ㄥ垏鎹㈣〃鍗曠殑閰嶇疆option
@@ -560,7 +670,7 @@
                 let currentForm = '';
                 if(data.type=='default' || data.type=='grid'){
                     this.formOption.column = this.sortColumn;
-                    currentForm = 'defaultOrGridForm'
+                    currentForm = 'defaultOrGridForm';
                 }else if(data.type == 'stand'){
                     this.formOption.column = this.standColumn;
                     currentForm = 'standForm';
@@ -569,12 +679,26 @@
                     currentForm = 'treeForm'
                 }
                 this.referConfigForm = {},
-                console.log( this.formOption);
+                //console.log( this.formOption);
                 this[currentForm].forEach(item=>{
                     Vue.set(this.referConfigForm, item, data[item])
                     //this.referConfigForm = Object.assign(this.referConfigForm,{[item]:data[item]})
                 })
-                console.log(this.referConfigForm);
+                // console.log(this.referConfigForm);
+            },
+            // 鏍规嵁type鐨勫彉鍔ㄥ垏鎹ttr琛ㄦ牸鐨勬樉绀洪殣钘忥紝璋冩暣鏌ヨ鏉′欢琛ㄦ牸鐨勫搴�
+            toggleCurdWidth(data) {
+                if(data.type=='default' || data.type=='grid'){
+                    this.showAttrParams.isShow = true;
+                    // 涓嶉渶瑕佹樉绀哄睘鎬ц〃鏍兼墍鏈夐渶瑕佸皢鏌ヨ璋冧环琛ㄦ牸缂╁皬涓�100%
+                    this.toggleSrchCrudWidth.width = '40%';
+                }else {
+                    this.showAttrParams.isShow = false;
+                    // 涓嶉渶瑕佹樉绀哄睘鎬ц〃鏍兼墍鏈夐渶瑕佸皢鏌ヨ璋冧环琛ㄦ牸缂╁皬涓�100%
+                    this.toggleSrchCrudWidth.width = '100%';
+                }
+                // console.log(this.toggleSrchCrudWidth);
+                // console.log(this.showAttrParams.isShow);
             },
 
             // 鏄剧ず鐨勫睘鎬у拰鏌ヨ鏉′欢鐩稿叧鏂规硶
@@ -587,6 +711,7 @@
                 });
                 this.srchCondParams.srchCondData = row.codeSrchCondConfigVOS
                 this.showAttrParams.showAttrData = row.codeShowFieldConfigVOS
+                //console.log(this.showAttrParams.showAttrData);
                 this.srchCondParams.srchCondLoading = false;
                 this.showAttrParams.showAttrLoading = false;
             },

--
Gitblit v1.9.3