From 73dbe864eb18a1a4df4f41caed1dd128faf1b2ec Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期五, 02 六月 2023 19:11:27 +0800
Subject: [PATCH] 引用码段关于业务类型接口的联调,重复使用的界面抽离成单独组件

---
 Source/UBCS-WEB/src/components/code-dialog-page/referConfigCrudDialog.vue | 1038 +++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 666 insertions(+), 372 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 2ea5f05..e755f1a 100644
--- a/Source/UBCS-WEB/src/components/code-dialog-page/referConfigCrudDialog.vue
+++ b/Source/UBCS-WEB/src/components/code-dialog-page/referConfigCrudDialog.vue
@@ -3,13 +3,13 @@
         title="閫夋嫨鍙傜収閰嶇疆"
         append-to-body
         :visible.sync="isShowReferConfigCrud"
-        width="94%"
+        width="95%"
         id="refer-config-dialog"
         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="width: 70%; height: 100%;">
-                    <basic-container style="width: 100%; ">
+                <el-col :style="toggleBasicCrudWidth">
+                    <basic-container style="width: 100%;">
                         <avue-crud :option="referConfigCrudOption"
                             class="refer-config-crud"
                             :page.sync="referConfigParams.referConfigPage"
@@ -17,9 +17,11 @@
                             :data="referConfigParams.referConfigData"
                             :ref= "referConfigParams.ref"
                             @row-click="referConfigRowClick"
-                            @selection-change="referConfigDataChange"
                             @search-change="referConfigSearchChange"
-                            @search-reset="referConfigSearchReset">
+                            @search-reset="referConfigSearchReset"
+                            @current-change="referConfigCurrentChange"
+                            @size-change="referConfigSizeChange"
+                            @on-load="referConfigOnload">
                             <template #radio="{row}">
                                 <el-radio v-model="referConfigParams.referConfigSelectedRow"
                                     :label="row.$index">
@@ -29,26 +31,39 @@
                         </avue-crud>
                     </basic-container>
                 </el-col>
-                <el-col v-show="true" style="width: 30%; height: 100%;">
-                    <basic-container style="width: 100%;">
+                <el-col v-show="isShowForm" style="height: 100%; width: 30%;">
+                    <basic-container style="width: 100%; height: 100vh; overflow-y: hidden">
                         <avue-form ref="refereConfigForm" 
-                        style="height: 65vh;"
-                        :option="formOption" 
-                        class="refer-confg-form"
-                        ></avue-form>
+                            style="height: 65vh; overflow-y: auto;"
+                            :option="formOption"
+                            v-model="referConfigForm"
+                            class="refer-confg-form">
+                        </avue-form>
                     </basic-container>
                 </el-col>
             </el-row>
             <el-row style="width: 100%; height:30%; margin-top: 130px">
-                <basic-container style="width: 100%; height:100%;">
-                    <avue-crud :option="attrAndSrchCondOption"
-                        class="refer-attrorsrchcond-crud"
-                        :table-loading="attrAndSrchCondParams.attrAndSrchCondLoading"
-                        :data="attrAndSrchCondParams.attrAndSrchCondData"
-                        :ref= "attrAndSrchCondParams.ref"
-                        @row-click="attrAndSrchCondRowClick">
-                    </avue-crud>
-                </basic-container>
+                <el-col 
+                    :style="toggleSrchCrudWidth">
+                    <basic-container style="width: 100%; height:100%;">
+                        <avue-crud :option="srchCondOption"
+                            class="refer-srchcond-crud"
+                            :table-loading="srchCondParams.srchCondLoading"
+                            :data="srchCondParams.srchCondData"
+                            :ref= "srchCondParams.ref">
+                        </avue-crud>
+                    </basic-container>
+                </el-col>
+                <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"
+                            :table-loading="showAttrParams.showAttrLoading"
+                            :data="showAttrParams.showAttrData"
+                            :ref= "showAttrParams.ref">
+                        </avue-crud>
+                    </basic-container>
+                </el-col>
             </el-row>
         </div>
         <div slot="footer" class="dialog-footer">
@@ -60,372 +75,648 @@
 
 <script>
 //import func from "@/util/func";
+import { getReferConfigPage } from "@/api/code/codeReferConfig";
 export default {
     name: "referConfigDialog",
-        props: {
-        },
-        data() {
-            return{
-                isShowReferConfigCrud:false,
-                referConfigCrudOption: {
-                    border: true,
-                    height: '56vh',
-                    tip: false,
-                    searchShow: true,
-                    searchMenuSpan: 6,
-                    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: 9,
-                            searchLabelWidth: 100,
-                            prop: 'id'
-                        },{
-                            label: '鍙傜収閰嶇疆鍚嶇О',
-                            search: true,
-                            searchSpan: 9,
-                            searchLabelWidth: 100,
-                            prop: 'name'
-                        },{
-                            label: '鍙傜収鐨勪笟鍔$被鍨�',
-                            search: false,
-                            prop: 'referType'
-                        },{
-                            label: '鏄剧ず鐨勫睘鎬�',
-                            search: false,
-                            prop: 'textField' 
-                        },{
-                            label: '瀛樺偍鍊肩殑灞炴��',
-                            search: false,
-                            prop: 'valueField' 
-                        },{
-                            label: '鍙傜収绐楀彛绫诲瀷',
-                            search: false,
-                            prop: 'typeText' 
-                        }
-                    ],
-                },
-                referConfigParams: {
-                    ref: "referConfigCrud",
-                    referConfigLoading: false,
-                    referConfigData: [],
-                    referConfigPage: {
-                        pageSize: 10,
-                        currentPage: 1,
-                        total: 0
-                    },
-                    referConfigQuery: {},
-                    referConfigSelectedRowData: '',
-                    // 褰撳墠閫変腑琛�
-                    referConfigSelectedRow: '',
-                },
-                formOption: {
-                    submitBtn: false,
-                    emptyBtn: false,
-                    labelWidth: '110', //榛樿鏍囩瀹藉害
-                    column: [{            
-                            label: '姣忛〉鏄剧ず鏉℃暟',
-                            prop: 'limit',
-                            span: 24,
-                            disabled: true,
-                            row: true,
-                            placeholder: ' ',
-                        },{
-                            label: '鎺掑簭瀛楁',
-                            prop: 'sortField',
-                            span: 24,
-                            disabled: true,
-                            row: true,
-                            placeholder: ' ',
-                        },{
-                            label: '鎺掑簭绫诲瀷',
-                            prop: 'sortType',
-                            span: 24,
-                            dicData: [{
-                                label: '鍗囧簭', value: 'asc'
-                            }, {
-                                label: '闄嶅簭', value: 'desc'
-                            }],
-                            type: 'select',
-                            disabled: true,
-                            row: true,
-                            placeholder: ' ',
-                        }
-                    ]
-                },
-                // 鎺掑簭绫诲瀷鐨勮〃鍗曢厤缃�
-                sortColumn:[{            
-                    label: '姣忛〉鏄剧ず鏉℃暟',
-                    prop: 'limit',
-                    span: 24,
-                    disabled: true,
-                    row: true,
-                    placeholder: ' ',
-                },{
-                    label: '鎺掑簭瀛楁',
-                    prop: 'sortField',
-                    span: 24,
-                    disabled: true,
-                    row: true,
-                    placeholder: ' ',
-                },{
-                    label: '鎺掑簭绫诲瀷',
-                    prop: 'sortType',
-                    span: 24,
-                    dicData: [{
-                        label: '鍗囧簭', value: 'asc'
-                    }, {
-                        label: '闄嶅簭', value: 'desc'
-                    }],
-                    type: 'select',
-                    disabled: true,
-                    row: true,
-                    placeholder: ' ',
-                }],
-                // 鏍戝舰绫诲瀷鐨勮〃鍗曢厤缃�
-                treeColumn:[{
-                    label: '鏍戝舰鐨勪笂绾у睘鎬�',
-                    prop: 'parentFieldName',
-                    span: 7,
-                    tip: '鏍戝舰灞曠ず鐨勬椂鍊欙紝涓婁笅绾у叧绯绘煡鎵剧殑灞炴�с��',
-                    tipPlacement: 'right',
-                    rules: [{
-                        required: true,
-                        message: "(鏍戝舰鐨勪笂绾у睘鎬�)蹇呭~椤逛笉鑳戒负绌�",
-                        trigger: "blur",
-                    }],
-                },{
-                    label: '涓婄骇灞炴�у�煎搴斿睘鎬�',
-                    prop: 'parentUsedField',
-                    span: 7,
-                    tip: '涓婄骇灞炴�у瓨鍌ㄧ殑鍊�,鏄笂绾ф暟鎹殑浠�涔堝睘鎬с�備竴鑸兘鏄痮id銆�',
-                    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'
-                    }],
-                },],
-                // 骞冲彴绫诲瀷鐨勮〃鍗曢厤缃�
-                standColumn:[{
-                    label: '鍙傝�冪殑UI涓婁笅鏂�',
-                    prop: 'referContent',
-                    span: 7,
-                    tip: '鍙湁鍙傜収绐楀彛绫诲瀷鏄痵tand鏃舵墠蹇呴』璁剧疆,涓斿湪stand绫诲瀷涓嬫墠鑳界敓鏁�',
-                    tipPlacement: 'right',
-                },
-                {
-                    label: '骞冲彴鐨勮〃鏍肩紪鍙�',
-                    prop: 'displayTable',
-                    span: 7,
-                    tip: '涓庡弬鐓х殑UI涓婁笅鏂囦簰鏂ワ紝鍙湁鍙傜収绐楀彛绫诲瀷鏄痵tand鏃舵墠蹇呴』璁剧疆锛屼笖鍦╯tand绫诲瀷涓嬫墠鑳界敓鏁�',
-                    tipPlacement: 'right',
-                }],
-
-                // 鏄剧ず鐨勫睘鎬у拰鏌ヨ鏉′欢琛ㄦ牸鍖哄煙
-                attrAndSrchCondOption: {
-                    border: true,
-                    height: '40vh',
-                    tip: false,
-                    searchShow: false,
-                    searchMenuSpan: 6,
-                    index: true,
-                    selection: false,
-                    menu: false,
-                    addBtn: false,
-                    refreshBtn: false,
-                    searchShowBtn: false,
-                    columnBtn: false,
-                    dialogClickModal: false,
-                    highlightCurrentRow: true,
-                    align: 'center',
-                    menuAlign: 'center',
-                    column: [
-                        {
-                            label: '鏌ヨ鏉′欢',
-                            children: [
-                                {
-                                    label: '绛涢�夊瓧娈�',
-                                    prop: 'filterField',
-                                },{
-                                    label: '绛涢�夌被鍨�',
-                                    prop: 'filterType',
-                                },{
-                                    label: '绛涢�夌殑鍊�',
-                                    prop: 'filterValue',
-                                }
-                            ],
-                        },{
-                            label: '鏄剧ず鐨勫睘鎬�',
-                            children: [
-                                {
-                                    label: '鍒楀瓧娈�',
-                                    // width: 120,
-                                    prop: 'field',
-                                     //type: 'select',
-                                    // props: {
-                                    //     label: 'name',
-                                    //     value: 'code'
-                                    // },
-                                    // dicUrl: 'https://cli.avuejs.com/api/area/getProvince'
-                                },{
-                                    label: '鍒楀悕',
-                                    prop: 'title'
-                                },{
-                                    label: '瀛楁绫诲瀷',
-                                    prop: 'fieldType'
-                                },{
-                                    label: '鍒楄〃鍙帓搴�',
-                                    prop: 'sort' 
-                                },{
-                                    label: '鎺掑簭瀛楁',
-                                    prop: 'sortField' 
-                                },{
-                                    label: '瀛楁瀹藉害',
-                                    prop: 'width' 
-                                },{
-                                    label: '鍒楀浐瀹氫綅缃�',
-                                    prop: 'fixedText' 
-                                },{
-                                    label: 'js鏄剧ず浠g爜',
-                                    prop: 'templet' 
-                                }
-                            ]
-                        }, 
-                    ],
-                },
-                attrAndSrchCondParams: {
-                    ref: "attrOrSrchCondCrud",
-                    attrAndSrchCondLoading: false,
-                    attrAndSrchCondData: [],
-                },
-                
-            }
-        },
-        methods: {
-            // 涓嬩竴姝ヨ杩涜鐨勬搷浣滈�夋嫨骞朵繚瀛樻垨閫夋嫨骞朵慨鏀�
-            selectedreferConfig(condition) {
-                // 褰撳墠閫変腑鐨勫弬鐓ч厤缃
-                let currentSeletedRow = this.referConfigParams.referConfigSelectedRowData;
-                if(!currentSeletedRow){
-                    this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹紒");
-                    return;
-                }
-                if(condition == "selectedSave"){
-                    console.log(currentSeletedRow);
-                }else {
-                    console.log(currentSeletedRow);
-                }
-            },
-            referConfigOnload(page, params = {}){
-                this.referConfigParams.referConfigLoading = true;
-                this.referConfigParams.referConfigData = [
+    props: {
+    },
+    data() {
+        return{
+            isShowReferConfigCrud:false,
+            referConfigCrudOption: {
+                border: true,
+                height: '45vh',
+                tip: false,
+                searchShow: true,
+                searchMenuSpan: 6,
+                index: true,
+                selection: false,
+                menu: false,
+                addBtn: false,
+                refreshBtn: false,
+                searchShowBtn: false,
+                columnBtn: false,
+                dialogClickModal: false,
+                highlightCurrentRow: true,
+                align: 'center',
+                menuAlign: 'center',
+                column: [
                     {
-                        id: 'test',
-                        name: '娴嬭瘯',
-                        referType: 'test',
-                        textField: 'test',
-                        valueField: 'test',
-                        typeText:'榛樿閰嶇疆',
+                        label: '-',
+                        prop: 'radio',
+                        width: 60,
+                        hide: false
                     },{
-                        id: 'test1',
-                        name: '娴嬭瘯1',
-                        referType: 'test1',
-                        textField: 'test1',
-                        valueField: 'test1',
-                        typeText:'骞冲彴閰嶇疆',
+                        label: '鍙傜収閰嶇疆缂栧彿',
+                        width: 120,
+                        search: true,
+                        searchSpan: 9,
+                        searchLabelWidth: 100,
+                        prop: 'id'
+                    },{
+                        label: '鍙傜収閰嶇疆鍚嶇О',
+                        search: true,
+                        searchSpan: 9,
+                        searchLabelWidth: 100,
+                        prop: 'name'
+                    },{
+                        label: '鍙傜収鐨勪笟鍔$被鍨�',
+                        search: false,
+                        prop: 'referTypeName'
+                    },{
+                        label: '鏄剧ず鐨勫睘鎬�',
+                        search: false,
+                        prop: 'textField' 
+                    },{
+                        label: '瀛樺偍鍊肩殑灞炴��',
+                        search: false,
+                        prop: 'valueField' 
+                    },{
+                        label: '鍙傜収绐楀彛绫诲瀷',
+                        search: false,
+                        prop: 'typeText',
                     }
-                ];
-                this.$nextTick(() => {
-                    this.$refs[this.referConfigParams.ref].doLayout()
-                })
-                this.referConfigParams.referConfigLoading = false;
+                ],
             },
-            referBtmTypeSizeChange(pageSize){
-                this.referConfigParams.referConfigPage.pageSize = pageSize;
+            referConfigParams: {
+                ref: "referConfigCrud",
+                referConfigLoading: false,
+                referConfigData: [],
+                referConfigPage: {
+                    pageSize: 10,
+                    currentPage: 1,
+                    total: 0
+                },
+                referConfigQuery: {},
+                referConfigSelectedRowData: '',
+                // 褰撳墠閫変腑琛�
+                referConfigSelectedRow: '',
             },
-            referBtmTypeCurrentChange(currentPage){
-                this.referConfigParams.referConfigPage.currentPage = currentPage;
+            formOption: {
+                submitBtn: false,
+                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'
+                        }],
+                    },
+                ],
             },
-            referConfigRowClick(row){
-                this.referConfigParams.referConfigSelectedRowData = row;
-                this.referConfigParams.referConfigSelectedRow = row.$index
-                this.attrAndSrchCondOnload(row);
+            referConfigForm:{},
+            // 鎺掑簭绫诲瀷鐨勮〃鍗曢厤缃�
+            sortColumn:[{            
+                label: '姣忛〉鏄剧ず鏉℃暟',
+                prop: 'limit',
+                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'
+                }],
+            }],
+            // 鏍戝舰绫诲瀷鐨勮〃鍗曢厤缃�
+            treeColumn:[{
+                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: ' ',
             },
-            referConfigDataChange(params, done){
-                this.referConfigParams.referConfigQuery = params;
-                this.referConfigParams.referConfigPage.currentPage = 1;
-                this.referConfigOnload(this.referConfigParams.referConfigPage, params);
-                done();
+            {
+                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'
+                }],
             },
-            referConfigSearchReset(){
-                this.referConfigParams.referConfigQuery = {};
-                this.referConfigOnload(this.referConfigParams.referConfigPage);
+            ],
+            // 骞冲彴绫诲瀷鐨勮〃鍗曢厤缃�
+            standColumn:[{
+                label: '鍙傝�冪殑UI涓婁笅鏂�',
+                prop: 'referContent',
+                span: 24,
+                disabled: true,
+                row: true,
+                placeholder: ' ',
+            },
+            {
+                label: '骞冲彴鐨勮〃鏍肩紪鍙�',
+                prop: 'displayTable',
+                span: 24,
+                disabled: true,
+                row: true,
+                placeholder: ' ',
+            }],
+
+            // 鏌ヨ鏉′欢琛ㄦ牸鍖哄煙
+            srchCondOption: {
+                border: true,
+                height: '40vh',
+                tip: false,
+                searchShow: false,
+                searchMenuSpan: 6,
+                index: true,
+                selection: false,
+                menu: false,
+                addBtn: false,
+                refreshBtn: false,
+                searchShowBtn: false,
+                columnBtn: false,
+                dialogClickModal: false,
+                highlightCurrentRow: true,
+                align: 'center',
+                menuAlign: 'center',
+                column: [
+                    {
+                        label: '鏌ヨ鏉′欢',
+                        children: [
+                            {
+                                label: '绛涢�夊瓧娈�',
+                                prop: 'filterField',
+                            },{
+                                label: '绛涢�夌被鍨�',
+                                prop: 'filterType',
+                            },{
+                                label: '绛涢�夌殑鍊�',
+                                prop: 'filterValue',
+                            }
+                        ],
+                    }, 
+                ],
+            },
+            srchCondParams: {
+                ref: "srchCondCrud",
+                srchCondLoading: false,
+                srchCondData: [],
+                isShow: true,
+            },
+            toggleSrchCrudWidth: {
+                width: '40%',
+                height: '100%',
             },
 
-
-            // 鏄剧ず鐨勫睘鎬у拰鏌ヨ鏉′欢鐩稿叧鏂规硶
-            attrAndSrchCondOnload(row){
-                this.attrAndSrchCondParams.attrAndSrchCondLoading = true;
-                this.attrAndSrchCondParams.attrAndSrchCondParams = row.attrAndSrchCondParams
-                this.attrAndSrchCondParams.attrAndSrchCondLoading = false;
+            //鏄剧ず鐨勫睘鎬ц〃鏍奸厤缃尯鍩�
+            showAttrOption: {
+                border: true,
+                height: '40vh',
+                tip: false,
+                searchShow: false,
+                searchMenuSpan: 6,
+                index: true,
+                selection: false,
+                menu: false,
+                addBtn: false,
+                refreshBtn: false,
+                searchShowBtn: false,
+                columnBtn: false,
+                dialogClickModal: false,
+                highlightCurrentRow: true,
+                align: 'center',
+                menuAlign: 'center',
+                column: [
+                    {
+                        label: '鏄剧ず鐨勫睘鎬�',
+                        children: [
+                            {
+                                label: '鍒楀瓧娈�',
+                                // width: 120,
+                                prop: 'field',
+                                    //type: 'select',
+                                // props: {
+                                //     label: 'name',
+                                //     value: 'code'
+                                // },
+                                // dicUrl: 'https://cli.avuejs.com/api/area/getProvince'
+                            },{
+                                label: '鍒楀悕',
+                                prop: 'title'
+                            },{
+                                label: '瀛楁绫诲瀷',
+                                prop: 'fieldTypeText'
+                            },{
+                                label: '鍒楄〃鍙帓搴�',
+                                prop: 'sort' 
+                            },{
+                                label: '鎺掑簭瀛楁',
+                                prop: 'attrSortField' 
+                            },{
+                                label: '瀛楁瀹藉害',
+                                prop: 'width' 
+                            },{
+                                label: '鍒楀浐瀹氫綅缃�',
+                                prop: 'fixedPositionText' 
+                            },{
+                                label: 'js鏄剧ず浠g爜',
+                                prop: 'templet' 
+                            },{
+                                label: '鏄惁蹇�熸煡璇�',
+                                prop: 'isQuery' 
+                            }
+                        ]
+                    }, 
+                ],
+            },
+            showAttrParams: {
+                ref: "showAttrCrud",
+                showAttrLoading: false,
+                showAttrData: [],
+                isShow: true,
             },
 
+            // 鏄惁鏄剧ず鍙樺姩鐨勮〃鍗曞尯鍩�
+            isShowForm: true,
+            toggleBasicCrudWidth: {
+                height: '100%',
+                width: '70%',
+            },
+            
+            // 鏄惁鏄剧ず灞炴�ц〃鏍�
+            isShowAttrCrud: true,
+            
+            defaultOrGridForm: ['limit','sortField','sortType'],
+            standForm: ['referContent','displayTable'],
+            treeForm: [
+                'parentFieldName',
+                'parentUsedField',
+                'parentValue',
+                'loadType',
+                'onlyLeaf',
+                'sortField',
+                'sortType'
+            ],
+        }
+    },
+    methods: {
+
+        // 涓嬩竴姝ヨ杩涜鐨勬搷浣滈�夋嫨骞朵繚瀛樻垨閫夋嫨骞朵慨鏀�
+        selectedreferConfig(condition) {
+            // 褰撳墠閫変腑鐨勫弬鐓ч厤缃
+            let currentSeletedRow = this.referConfigParams.referConfigSelectedRowData;
+            if(!currentSeletedRow){
+                this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹紒");
+                return;
+            }
+            let filterForm = this.filterForm(currentSeletedRow);
+            if(condition == "selectedSave"){
+                // 鐩存帴淇濆瓨,鎵�浠ョ洿鎺ヨ皟鐢╟ode鐣岄潰鐨勭晫闈㈠洖鏄� 
+                this.$emit('echoReferConfig',filterForm);
+                // console.log(filterForm);
+            }else {
+                // 閫夋嫨骞朵慨鏀�,鎵ц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;
+            refer.referConfigLoading = true;
+            let param = {};
+            // 澶氫釜conditionMap杩欐牱浼犲弬
+            if(refer.referConfigQuery){
+                Object.keys(refer.referConfigQuery).forEach(key=>{
+                    param['conditionMap['+key+']'] = refer.referConfigQuery[key];
+                });
+            }
+            getReferConfigPage(
+                refer.referConfigPage.currentPage, 
+                refer.referConfigPage.pageSize,
+                param
+            ).then(res=>{
+                const data = res.data.data;
+                this.referConfigParams.referConfigPage.total = data.total;
+                this.referConfigParams.referConfigData = data.records;
+                this.referConfigParams.referConfigLoading = false;
+                //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]);
+                    }) 
+                }
+            });
+        },
+        referBtmTypeSizeChange(pageSize){
+            this.referConfigParams.referConfigPage.pageSize = pageSize;
+        },
+        referBtmTypeCurrentChange(currentPage){
+            this.referConfigParams.referConfigPage.currentPage = currentPage;
+        },
+        referConfigRowClick(row){
+            // 瀵瑰綋鍓嶉�変腑琛岃繘琛岃褰�
+            this.referConfigParams.referConfigSelectedRowData = row;
+            // 鍗曢�夋閫変腑
+            this.referConfigParams.referConfigSelectedRow = row.$index
+            this.attrAndSrchCondOnload(row);
+            this.loadDefaultOrGridOrStandOrTreeForm(row);
+        },
+        referConfigSearchChange(params, done){
+            this.referConfigParams.referConfigQuery = params;
+            this.referConfigParams.referConfigPage.currentPage = 1;
+            this.referConfigOnload();
+            done();
+        },
+        referConfigSearchReset(){
+            this.referConfigParams.referConfigQuery = {};
+            this.referConfigOnload(this.referConfigParams.referConfigPage);
+        },
+        referConfigCurrentChange(currentPage){
+            this.referConfigParams.referConfigPage.currentPage = currentPage;               
+        },
+        referConfigSizeChange(pageSize){
+            this.referConfigParams.referConfigPage.pageSize = pageSize;
+        },
+        // 鍔犺浇琛ㄥ崟鏄剧ず鍐呭
+        loadDefaultOrGridOrStandOrTreeForm(currentFormData){
+            if(currentFormData.type != 'tree' & 
+                currentFormData.type != 'stand' &
+                currentFormData.type != 'default'&
+                currentFormData.type != 'grid') {
+                //鎺у埗鍙傜収閰嶇疆琛ㄦ牸鍜岃〃鍗曟樉绀烘瘮渚�
+                this.isShowForm = false;
+                this.toggleBasicCrudWidth.width = '100%';
+            }else {
+                this.isShowForm = true;
+                this.toggleBasicCrudWidth.width = '70%';
+                this.toggleFormOption(currentFormData);
+            }
+            this.toggleCurdWidth(currentFormData);
+            //console.log(this.isShowForm);
+            //console.log(this.toggleBasicCrudWidth.width);
+        },
+
+        // 鏍规嵁type鐨勫彉鍔ㄥ垏鎹㈣〃鍗曠殑閰嶇疆option
+        toggleFormOption(data){
+            //console.log(data);
+            let currentForm = '';
+            if(data.type=='default' || data.type=='grid'){
+                this.formOption.column = this.sortColumn;
+                currentForm = 'defaultOrGridForm';
+            }else if(data.type == 'stand'){
+                this.formOption.column = this.standColumn;
+                currentForm = 'standForm';
+            }else if(data.type == 'tree'){
+                this.formOption.column = this.treeColumn;
+                currentForm = 'treeForm'
+            }
+            this.referConfigForm = {},
+            //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);
+        },
+        // 鏍规嵁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);
+        },
+
+        // 鏄剧ず鐨勫睘鎬у拰鏌ヨ鏉′欢鐩稿叧鏂规硶
+        attrAndSrchCondOnload(row){
+            this.srchCondParams.srchCondLoading = true;
+            this.showAttrParams.showAttrLoading = true;
+            this.$nextTick(() => {
+                this.$refs[this.srchCondParams.ref].doLayout()
+                this.$refs[this.showAttrParams.ref].doLayout()
+            });
+            this.srchCondParams.srchCondData = row.codeSrchCondConfigVOS
+            this.showAttrParams.showAttrData = row.codeShowFieldConfigVOS
+            //console.log(this.showAttrParams.showAttrData);
+            this.srchCondParams.srchCondLoading = false;
+            this.showAttrParams.showAttrLoading = false;
+        },
+
+    },
 }
 </script>
 
@@ -434,7 +725,10 @@
     .refer-config-crud > .el-card > .el-card__body > .avue-crud__menu {
         display: none!important;
     }
-    .refer-attrorsrchcond-crud > .el-card > .el-card__body > .avue-crud__menu {
+    .refer-srchcond-crud > .el-card > .el-card__body > .avue-crud__menu  {
+        display: none!important;
+    }
+    .refer-attr-crud > .el-card > .el-card__body > .avue-crud__menu {
         display: none!important;
     }
 

--
Gitblit v1.9.3