From b8886034cbd7a43911d6b24e322f604f557c1e02 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期二, 23 五月 2023 20:35:59 +0800
Subject: [PATCH] 增加referconfig的相关接口

---
 Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue |  434 +++++++++++++++--------------------------------------
 1 files changed, 126 insertions(+), 308 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/code-dialog-page/referConfigDialog.vue b/Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue
similarity index 80%
rename from Source/UBCS-WEB/src/components/code-dialog-page/referConfigDialog.vue
rename to Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue
index 23f3bcc..40d4f9d 100644
--- a/Source/UBCS-WEB/src/components/code-dialog-page/referConfigDialog.vue
+++ b/Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue
@@ -3,139 +3,117 @@
     <el-dialog
       title="鍙傜収閰嶇疆"
       append-to-body
-      :visible.sync="isShowReferConfig"
+      :visible.sync="isShowReferConfigForm"
       width="90%"
-      id="refer-config"
+      id="refer-config-form"
       @close="recoveryDataAndForm('initData')"
       style="height: 115vh; margin-top: -14vh; overflow-y: hidden">
-        <el-tabs v-model="activeName" @tab-click="handleClick">
-            <el-tab-pane label="鑷畾涔夊弬鐓ч厤缃�" name="first">
-                <div style="width: 100%; overflow-y: auto; height: 65vh">
-                    <el-row>
-                        <avue-form ref="form" :option="formOption" v-model="form" class="referTypeForm">
-                            <template #referTypeName="{disabled,size}">
-                                <el-input :disabled="disabled"
-                                    :size="size"
-                                    v-model="form.referTypeName"
-                                    ref="referTypeName" 
-                                    placeholder="璇烽�夋嫨 鍙傜収鐨勪笟鍔$被鍨�"
-                                    prefix-icon="el-icon-search"
-                                    readonly="true"
-                                    @focus="openSelectionTable('referType')">
-                                    <i v-show="!disabled" slot="suffix" class="el-icon-circle-close" @click="clearSelectionTable('referType')" style="margin-right: 5px;cursor: pointer;"></i>
-                                </el-input>
-                            </template>
-                            <template #sortField="{disabled,size}">
-                                <el-input :disabled="disabled"
-                                    :size="size"
-                                    v-model="form.sortField"
-                                    ref="sortField" 
-                                    placeholder="璇烽�夋嫨 鎺掑簭瀛楁"
-                                    prefix-icon="el-icon-search"
-                                    readonly="true"
-                                    @focus="openSelectionTable('sortField')">
-                                    <i slot="suffix" class="el-icon-circle-close" @click="clearSelectionTable('sortField')" style="margin-right: 5px;cursor: pointer;"></i>
-                                </el-input>
-                            </template>
-                        </avue-form>
-                    </el-row>
-                    <el-row v-show="form.type=='default' || form.type=='grid'">
-                        <avue-crud
-                            ref="crudAttr"
-                            class="crud-attr"
-                            :option="attrOption"
-                            @cell-click="clickAttrEdit"
-                            :data="attrData">
-                            <!-- 琛ㄦ牸鍐呮搷浣滄寜閽� -->
-                            <template slot="menu" slot-scope="scope">
-                                <el-button type="text"
-                                    size="small"
-                                    icon="el-icon-search"
-                                    plain
-                                    @click="scope.row.isquery=!scope.row.isquery">
-                                    {{scope.row.isquery ? "鍙栨秷蹇�熸煡璇�":"蹇�熸煡璇�"}}
-                                </el-button>
-                                <el-button type="text"
-                                    size="small"
-                                    icon="el-icon-minus"
-                                    plain
-                                    @click="removeCurrentRow(scope.row,'removeAttr')">绉婚櫎
-                                </el-button>
-                            </template>
-                            <!-- 琛ㄦ牸宸︿笂鏂规寜閽尯鍩� -->
-                            <template slot="menuLeft" slot-scope="scope">
-                                <el-button type="primary"
-                                    size="small"
-                                    icon="el-icon-plus"
-                                    @click="openSelectionTable('selectAttr')">閫夋嫨灞炴��
-                                </el-button>
-                                <div class="tag-group" style="display: inline">
-                                    <el-tag
-                                        v-for="item in attrData"
-                                        v-show="item.isquery && item.title!=''"
-                                        style="margin-left: 3px"
-                                        :key="item.title"
-                                        type="info"
-                                        size="small"
-                                        effect="dark">
-                                        {{ item.title }}
-                                    </el-tag>
-                                </div>
-                            </template>
-                        </avue-crud>
-                    </el-row>
-                    <el-row style="margin-top: 10px">
-                        <avue-crud
-                            ref="crudAddCondition"
-                            :option="addSearchCondtionOption" 
-                            @cell-click="clickAddSearchCondtionEdit"
-                            :data="addSearchCondtionData">
-                            <!-- 琛ㄦ牸鍐呮搷浣滄寜閽� -->
-                            <template slot="menu" slot-scope="scope">
-                                <el-button type="text"
-                                    size="small"
-                                    icon="el-icon-minus"
-                                    plain
-                                    @click="removeCurrentRow(scope.row,'removeaddSearchCondtion')">绉婚櫎
-                                </el-button>
-                            </template>
-                            <!-- 琛ㄦ牸宸︿笂鏂规寜閽尯鍩� -->
-                            <template slot="menuLeft" slot-scope="scope">
-                                <el-button type="primary"
-                                    size="small"
-                                    icon="el-icon-plus"
-                                    @click="openSelectionTable('addSearchCondition')">
-                                    娣诲姞鏌ヨ鏉′欢
-                                </el-button>
-                            </template>
-                        </avue-crud>
-                    </el-row>
-                </div>
-            </el-tab-pane>
-            <el-tab-pane label="鐩存帴閫夊彇鍙傜収閰嶇疆" name="second">
-                <div style="width: 100%; overflow-y: auto; height: 65vh">
-                    <avue-crud
-                        :option="selectReferConfigOption"
-                        :table-loading="selectReferConfigLoading"
-                        :data="selectReferConfigData"
-                        :page.sync="selectReferConfigPage"
-                        ref="selectReferConfigCrud"
-                        @row-click="codeRuleRowClick"
-                        @search-change="searchChange"
-                        @search-reset="searchReset"
-                        @selection-change="selectionChange"
-                        @current-change="currentChange"
-                        @size-change="sizeChange"
-                        @refresh-change="refreshChange"
-                        @on-load="onLoad">
-                    </avue-crud>
-                </div>
-            </el-tab-pane>
-        </el-tabs>
+        <div style="width: 100%; overflow-y: auto; height: 70vh">
+            <el-row>
+                <avue-form ref="form" :option="formOption" v-model="form" class="referTypeForm">
+                    <template #referTypeName="{disabled,size}">
+                        <el-input :disabled="disabled"
+                            :size="size"
+                            v-model="form.referTypeName"
+                            ref="referTypeName" 
+                            placeholder="璇烽�夋嫨 鍙傜収鐨勪笟鍔$被鍨�"
+                            prefix-icon="el-icon-search"
+                            readonly="true"
+                            @focus="openSelectionTable('referType')">
+                            <i v-show="!disabled" slot="suffix" class="el-icon-circle-close" @click="clearSelectionTable('referType')" style="margin-right: 5px;cursor: pointer;"></i>
+                        </el-input>
+                    </template>
+                    <template #sortField="{disabled,size}">
+                        <el-input :disabled="disabled"
+                            :size="size"
+                            v-model="form.sortField"
+                            ref="sortField" 
+                            placeholder="璇烽�夋嫨 鎺掑簭瀛楁"
+                            prefix-icon="el-icon-search"
+                            readonly="true"
+                            @focus="openSelectionTable('sortField')">
+                            <i slot="suffix" class="el-icon-circle-close" @click="clearSelectionTable('sortField')" style="margin-right: 5px;cursor: pointer;"></i>
+                        </el-input>
+                    </template>
+                </avue-form>
+            </el-row>
+            <el-row v-show="form.type=='default' || form.type=='grid'">
+                <avue-crud
+                    ref="crudAttr"
+                    class="crud-attr"
+                    :option="attrOption"
+                    @cell-click="clickAttrEdit"
+                    :data="attrData">
+                    <!-- 琛ㄦ牸鍐呮搷浣滄寜閽� -->
+                    <template slot="menu" slot-scope="scope">
+                        <el-button type="text"
+                            size="small"
+                            icon="el-icon-search"
+                            plain
+                            @click="scope.row.isquery=!scope.row.isquery">
+                            {{scope.row.isquery ? "鍙栨秷蹇�熸煡璇�":"蹇�熸煡璇�"}}
+                        </el-button>
+                        <el-button type="text"
+                            size="small"
+                            icon="el-icon-minus"
+                            plain
+                            @click="removeCurrentRow(scope.row,'removeAttr')">绉婚櫎
+                        </el-button>
+                    </template>
+                    <!-- 琛ㄦ牸宸︿笂鏂规寜閽尯鍩� -->
+                    <template slot="menuLeft" slot-scope="scope">
+                        <el-button type="primary"
+                            size="small"
+                            icon="el-icon-plus"
+                            @click="openSelectionTable('selectAttr')">閫夋嫨灞炴��
+                        </el-button>
+                        <div class="tag-group" style="display: inline">
+                            <el-tag
+                                v-for="item in attrData"
+                                v-show="item.isquery && item.title!=''"
+                                style="margin-left: 3px"
+                                :key="item.title"
+                                type="info"
+                                size="small"
+                                effect="dark">
+                                {{ item.title }}
+                            </el-tag>
+                        </div>
+                    </template>
+                </avue-crud>
+            </el-row>
+            <el-row style="margin-top: 10px">
+                <avue-crud
+                    ref="crudAddCondition"
+                    :option="addSearchCondtionOption" 
+                    @cell-click="clickAddSearchCondtionEdit"
+                    :data="addSearchCondtionData">
+                    <!-- 琛ㄦ牸鍐呮搷浣滄寜閽� -->
+                    <template slot="menu" slot-scope="scope">
+                        <el-button type="text"
+                            size="small"
+                            icon="el-icon-minus"
+                            plain
+                            @click="removeCurrentRow(scope.row,'removeaddSearchCondtion')">绉婚櫎
+                        </el-button>
+                    </template>
+                    <!-- 琛ㄦ牸宸︿笂鏂规寜閽尯鍩� -->
+                    <template slot="menuLeft" slot-scope="scope">
+                        <el-button type="primary"
+                            size="small"
+                            icon="el-icon-plus"
+                            @click="openSelectionTable('addSearchCondition')">
+                            娣诲姞鏌ヨ鏉′欢
+                        </el-button>
+                    </template>
+                </avue-crud>
+            </el-row>
+        </div>
+
         <div slot="footer" class="dialog-footer">
             <el-button type="primary" @click="selectedListReferConfig">纭� 瀹�</el-button>
             <el-button @click="recoveryDataAndForm('initForm')">娓呯┖鍐呭</el-button>
-            <el-button @click="isShowReferConfig = false">鍙� 娑�</el-button>
+            <el-button @click="isShowReferConfigForm = false">鍙� 娑�</el-button>
         </div>
 
         <el-dialog title="涓恒�愬弬鐓х殑涓氬姟绫诲瀷銆戦�夊彇鍊�"
@@ -159,7 +137,7 @@
                 <template #radio="{row}">
                     <el-radio v-model="referBtmTypeSelectRow"
                         :label="row.$index">
-                        -
+                        &nbsp;
                     </el-radio>
                 </template>
             </avue-crud>
@@ -189,7 +167,7 @@
                 <template #radio="{row}">
                     <el-radio v-model="sortFieldSelectRow"
                         :label="row.$index">
-                        -
+                        &nbsp;
                     </el-radio>
                 </template>
             </avue-crud>
@@ -246,47 +224,18 @@
 </template>
     
 <script>
+    import func from "@/util/func";
     export default {
         name: "referConfigDialog",
         props: {
-            //鏈満鏅彉閲�
-            thisSceneTableData: {
-                type: Array,
-            },
         },
         data() {
             let element = '';
             return {
-                //娴嬭瘯琛ㄦ牸琛岀紪杈戞晥鏋�
-                // tableData:[{
-                //         field: 'id',
-                //         title: '缂栧彿',
-                //         fieldType: 'text',
-                //         fieldTypeText: '鏂囨湰妗�',
-                //         sort: true,
-                //         sortField: 'id',
-                //         width: '150',
-                //         isquery: true,
-                //         $cellEdit: false
-                // },{
-                //         field: 'name',
-                //         title: '鍚嶇О',
-                //         fieldType: 'text',
-                //         fieldTypeText: '鏂囨湰妗�',
-                //         sort: true,
-                //         sortField: 'name',
-                //         width: '180',
-                //         isquery: true,
-                //         $cellEdit: false
-                // }],
-                // tableOption:{
-                //     tableData:[], //琛ㄦ牸鏁版嵁
-                //     options:[] //琛ㄦ牸閰嶇疆椤逛俊鎭紙琛ㄥご锛宭abel瀹藉害绛夛級
-                // },
 
                 activeName: 'first', //褰撳墠娲诲姩鐨則abs
                 labelWidth: '150',   // 鏍囬瀹藉害
-                isShowReferConfig: false,  // 绗竴灞傚璇濇鏄剧ず闅愯棌鎺у埗
+                isShowReferConfigForm: false,  // 绗竴灞傚璇濇鏄剧ず闅愯棌鎺у埗
                 referTypeIsReadOnly: false,
                 // 琛ㄥ崟瀵硅薄
                 form: {
@@ -459,80 +408,6 @@
                         }
                     ]
                 },
-
-                selectReferConfigOption: {
-                    height:'auto',
-                    tip: false,
-                    addBtn: false,
-                    editBtn: false,
-                    //searchShow: false,
-                    searchMenuSpan: 6,
-                    border: false,
-                    index: true,
-                    viewBtn: false,
-                    delBtn: false,
-                    //selection: false,
-                    //disablePage: false,
-                    //refreshBtn: false,
-                    //columnBtn: false,
-                    dialogClickModal: false,
-                    highlightCurrentRow: true,
-                    column: [
-                        {
-                            label: "鍒楀瓧娈�(*)",
-                            prop: "field",
-                        },{
-                            label: "鍒楀悕(*)",
-                            prop: "title",
-                        },{
-                            label: "瀛楁绫诲瀷(*)",
-                            prop: "fieldTypeText",
-                        },{
-                            label: "鍒楄〃鍙帓搴�",
-                            prop: "sort",
-                        },{
-                            label: "鎺掑簭瀛楁",
-                            prop: "sortField",
-                        },{
-                            label: "瀛楁瀹藉害",
-                            prop: "width",
-                        },{
-                            label: "鍒楀浐瀹氫綅缃�",
-                            prop: "fixedText",
-                        },{
-                            label: "js鏄剧ず浠g爜",
-                            prop: "templet",
-                        },
-                    ]
-                },
-                selectReferConfigLoading: false,
-                selectReferConfigData: [
-                    {
-                        field: 'id',
-                        title: '缂栧彿',
-                        fieldType: 'text',
-                        fieldTypeText: '鏂囨湰妗�',
-                        sort: "true",
-                        sortField: 'id',
-                        width: '150',
-                        isquery: true,
-                    },{
-                        field: 'name',
-                        title: '鍚嶇О',
-                        fieldType: 'text',
-                        fieldTypeText: '鏂囨湰妗�',
-                        sort: "true",
-                        sortField: 'name',
-                        width: '180',
-                        isquery: true,
-                    }
-                ],
-                selectReferConfigPage: {
-                    pageSize: 10,
-                    currentPage: 1,
-                    total: 0
-                },
-                selectReferConfigQuery: {},
 
                 //涓恒�愬弬鐓х殑涓氬姟绫诲瀷銆戦�夊彇鍊煎璇濇
                 selectionReferBtmTypeOption: {
@@ -1079,32 +954,6 @@
                                     //type: 'table',
                                     tip: '鏌ヨ鏁版嵁鏃剁殑鎺掑簭瀛楁',
                                     tipPlacement: 'right',
-                                    // children: {
-                                    //     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'
-                                    //     }],
-                                    // },
-                                    // 杩欏効闇�瑕佹坊鍔犱笟鍔$被鍨嬫帴鍙h姹傚疄鐜板脊绐楃晫闈㈣〃鏍兼覆鏌�
                                 },{
                                     label: '鎺掑簭绫诲瀷',
                                     prop: 'sortType',
@@ -1122,11 +971,10 @@
                     ]
                 }
             },
-            
         },
         mounted() {
             // 楹荤殑杩欎釜鍦版柟璋冩鎴戜簡
-            this.element = document.getElementById('refer-config');
+            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);
@@ -1162,10 +1010,10 @@
                 this.preClickAttrRow = row;
             },
             // 灞炴�ц〃鏍艰缂栬緫澶卞幓鐒︾偣鏃朵繚瀛樻柟娉�
-            updateAttrBlur(value){
+            // updateAttrBlur(value){
                 //console.log(this.attrData[0]);
                 
-            },
+            // },
             // 鍗曞嚮琛ㄦ牸瀹炵幇琛ㄦ牸琛岀紪杈�
             clickAddSearchCondtionEdit(row, column, event){
                 if(this.preClickAddSearchConditionRow && this.preClickAddSearchConditionRow != row){
@@ -1177,21 +1025,20 @@
             },
             //涓婁竴涓〉闈㈠凡缁忛�変腑鍙傜収搴旂敤鐨勪笟鍔$被鍨嬬殑鎯呭喌锛屽拰涓婁竴娆″凡缁忛厤缃繃鍙傜収閰嶇疆鐨勬儏鍐典笅杩涜椤甸潰鍒濆鍖栨覆鏌�
             initPageData(val){
-                let value = JSON.parse(val);
-                if(value != null || value != 'undefined' ){
-                    this.form = value;
+                //console.log(val);
+                if(func.notEmpty(val.referConfig)){
+                    this.form = JSON.parse(val.referConfig);
                     //console.log(val);
                     this.referTypeIsReadOnly = true;
+                    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"));
-            },
-            // 鍒囨崲褰撳墠娲诲姩鐨則abs
-            handleClick(tab, event) {
-                if(tab.index=='0'){
-                    this.onloadAttrData(); 
-                }else{
-                    //this.onloadSelectReferConfigData();
-                }
             },
             // 閫夋嫨瀹屽弬鐓ч厤缃箣鍚庣偣鍑讳繚瀛樻寜閽Е鍙�
             selectedListReferConfig(){
@@ -1202,7 +1049,7 @@
                         let submitForm = this.filterForm();
                         //console.log(submitForm);
                         this.$emit('echoReferConfig', submitForm) // 瑙﹀彂update:data灏嗗瓙缁勪欢鍊间紶閫掔粰鐖剁粍浠�
-                        this.isShowReferConfig = false;
+                        this.isShowReferConfigForm = false;
                         done()
                     } else {
                         for(let attr in msg) {
@@ -1214,17 +1061,9 @@
                     }
                 })
             },
-            //浠庣紦瀛樹腑閭orm琛ㄥ崟瀵硅薄
-            getLocalStoregeForm(){
-                localStorage.getItem("userId");
-
-            },
             /** 鍏跺疄閫夊彇灞炴�ц〃鏍肩殑榛樿鏁版嵁涓嶉渶瑕佸姞杞斤紝
              浣嗘槸寮圭獥鎵撳紑浼氭湁琛ㄦ牸閿欒闂鎵�浠ラ渶瑕佸湪杩欒皟鐢╠oLayout鏂规硶*/
             onloadAttrData(){
-                this.$nextTick(() => {
-                    this.$refs.crudAttr.doLayout()
-                })
                 this.attrData = [
                     {
                         field: 'id',
@@ -1248,6 +1087,9 @@
                         $cellEdit: false
                     }
                 ];
+                this.$nextTick(() => {
+                    this.$refs.crudAttr.doLayout()
+                })
             },
             // 灞炴�ч�夋嫨琛ㄦ牸涓殑绉婚櫎鎸夐挳鍔熻兘
             removeCurrentRow(row,condition){
@@ -1353,30 +1195,6 @@
              */
             checkArrayIsUndefined(val){
                 return typeof val === 'array' && (val.length === 0 ||val === null || typeof val === 'undefined');
-            },
-            onloadSelectReferConfigData(){
-                this.$nextTick(() => {
-                    this.$refs.selectReferConfigCrud.doLayout()
-                })
-                this.selectReferConfigData = [{
-                    field: 'id',
-                    title: '缂栧彿',
-                    fieldType: 'text',
-                    fieldTypeText: '鏂囨湰妗�',
-                    sort: "true",
-                    sortField: 'id',
-                    width: '150',
-                    isquery: true,
-                },{
-                    field: 'name',
-                    title: '鍚嶇О',
-                    fieldType: 'text',
-                    fieldTypeText: '鏂囨湰妗�',
-                    sort: "true",
-                    sortField: 'name',
-                    width: '180',
-                    isquery: true,
-                }];
             },
             // 鎵撳紑琛ㄦ牸閫夋嫨妗�
             openSelectionTable(condition){

--
Gitblit v1.9.3