From 90bc8df34f290907a3ee01d05a9df5ca62b2cacc Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期三, 05 七月 2023 17:47:39 +0800
Subject: [PATCH] 修改列表展示

---
 Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue |   70 +++++++++++++++++++++++------------
 1 files changed, 46 insertions(+), 24 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue b/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue
index bb1501a..7e4f639 100644
--- a/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue
+++ b/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue
@@ -1,5 +1,5 @@
 <template>
-    <el-dialog 
+    <el-dialog
     title="涓氬姟绫诲瀷"
     :visible.sync="showSubmitDialog"
     append-to-body
@@ -7,9 +7,8 @@
     width="70%"
     style="height: 115vh;"
     >
-        <el-form ref="form" :model="btmType" show-message="true" inline size="medium" label-suffix=":" class="btmTypeForm">
-                
-            <el-form-item label="鑻辨枃鍚嶇О" label-width="100px" required="true">
+        <el-form ref="form" :model="btmType" show-message="true" inline size="medium" label-suffix=":" class="btmTypeForm" :rules="rules" @resetFields="resetForm" status-icon="true">
+            <el-form-item label="鑻辨枃鍚嶇О" label-width="100px" required="true" prop="id">
                 <el-input v-model="btmType.id" :prefix-icon="icons.key"></el-input>
             </el-form-item>
             <el-form-item label="涓枃鍚嶇О" label-width="100px">
@@ -18,7 +17,7 @@
             <el-form-item label="鏁版嵁搴撹〃鍚�" label-width="100px">
                 <el-input v-model="btmType.tableName" :prefix-icon="icons.tableName"></el-input>
             </el-form-item>
-            <el-form-item label="鎵�灞為鍩�" label-width="100px">
+            <el-form-item label="鎵�灞為鍩�" label-width="100px" prop="domain">
                 <el-select v-model="btmType.domain" :prefix-icon="icons.domain">
                     <el-option v-for="item in domainOption"
                     :label="item.label" :value="item.value" :key="item.value"></el-option>
@@ -44,16 +43,16 @@
             </el-form-item>
         </div>
             <el-form-item label="鎻忚堪" label-width="100px" class="description">
-                <el-input v-model="btmType.description" 
-                :prefix-icon="icons.desc" 
+                <el-input v-model="btmType.description"
+                :prefix-icon="icons.desc"
                 class="descClass"
                 id="descId"
                 ></el-input>
             </el-form-item>
         </el-form>
-        <avue-crud :option="option" 
-        :data="btmType.attributes" 
-        :page.sync="page" 
+        <avue-crud :option="option"
+        :data="btmType.attributes"
+        :page.sync="page"
         ref="attrTable"
         @cell-mouse-enter="cellEditClick"
         @cell-mouse-leave="cellEditSave">
@@ -63,7 +62,7 @@
                 size="small"
                 @click="rowAdd()">灞炴�ч�夋嫨</el-button>
             </template>
-            
+
         </avue-crud>
         <div slot="footer" class="dialog-footer">
             <el-button type="primary" @click="submitBtmType">纭畾</el-button>
@@ -77,16 +76,16 @@
             @close="closeAttrDialog"
             width="80%"
         >
-            <avue-crud class="attrRef" 
-            :option="attrRef.option" 
-            :data="attrRef.data" 
+            <avue-crud class="attrRef"
+            :option="attrRef.option"
+            :data="attrRef.data"
             :page.sync="attrRef.page"
             ref="attrRef"
             @on-load="attrRefOnLoad"
             @search-change="attrRefSearch"
             @selection-change="selectionChange">
-                <template slot="name" slot-scope="scope" >
-                    <el-tag>{{scope}}</el-tag>
+                <template slot="typeValue" slot-scope="scope" >
+                    <el-tag>{{scope.row.typeValue}}</el-tag>
                 </template>
             </avue-crud>
             <div slot="footer" class="dialog-footer">
@@ -99,7 +98,7 @@
             :visible.sync="revisionRef.visible"
             append-to-body
             width="80%">
-            
+
             <avue-crud class="revisionRef"
              :option="revisionRef.option"
              :data="revisionRef.data"
@@ -204,22 +203,24 @@
                     reserveSelection: true,
                     searchMenuSpan:8,
                     highlightCurrentRow: true,
+                    rowKey: 'id',
                     column: [
                         {
                         label: '鑻辨枃鍚嶇О',
-                        prop: 'key',
+                        prop: 'id',
                         align: 'left',
                         search: true,
                         width: 230
                     }, {
                         label: '涓枃鍚嶇О',
-                        prop: 'label',
+                        prop: 'name',
                         align: 'center',
                     },
                     {
                         label: "绫诲瀷",
                         prop: "typeValue",
-                        align: 'center'
+                        align: 'center',
+                        slot: true,
                     },
                     {
                         label: "榛樿鍊�",
@@ -315,6 +316,16 @@
                     ]
                 },
             },
+            rules: {
+                id: [
+                    { required: true, message: '璇疯緭鍏ヤ笟鍔$被鍨嬬紪鍙�', trigger: 'blur' },
+                    { pattern: /^[A-Za-z]+$/, message: '涓氬姟绫诲瀷缂栧彿鍙兘涓鸿嫳鏂�', trigger: 'blur' },
+                    { min: 2, max: 20, message: '闀垮害鍦�2鍒�20涓瓧绗�', trigger: 'blur' }
+                ],
+                domain: [
+                    { required: true, message: '璇烽�夋嫨鎵�灞為鍩�', trigger: 'blur' }
+                ]
+            },
         }
     },
     created() {
@@ -328,6 +339,7 @@
             this.btmType = {};
             this.attrRef.selectData = [];
             this.attrRef.queryNotIn = null;
+            this.resetForm();
         },
         // 鍏抽棴灞炴�ф睜鏌ヨ寮圭獥
         closeAttrDialog(){
@@ -362,7 +374,9 @@
         },
         // 纭灞炴�ф睜鍕鹃��
         confirmSelectAttr(){
-            this.btmType.attributes = [];
+            if(!this.btmType.attributes){
+                this.btmType.attributes = [];
+            }
             this.attrRef.queryNotIn = "";
             this.attrRef.selectData.forEach(item => {
                 this.btmType.attributes.push({
@@ -370,10 +384,14 @@
                     name: item.name,
                     typeValue: item.typeValue,
                     typeKey: item.typeValue,
-                    attrDataType : item.typeValue,
+                    attrDataType : item.typeKey,
                     defaultValue: item.defaultValue,
                     description: item.description,
-                    attributeLength: item.maxLength
+                    attributeLength: item.maxLength,
+                    referBtmTypeId: item.referTypeCode,
+                    referBtmTypeName: item.referToName,
+                    enumId: item.dictCode,
+                    // enumName: item,
                 });
                 this.attrRef.queryNotIn += (item.id + ",")
             });
@@ -406,7 +424,7 @@
                 this.$refs.attrTable.refreshTable();
             })
         },
-        // 
+        //
         viewChange(){
 
         },
@@ -465,6 +483,10 @@
             this.$delete(this.btmType,'revisionRuleId');
             this.$delete(this.btmType,'revisionRuleName');
             this.$delete(this.btmType,'inputRevisionFlag');
+       },
+       resetForm(){
+        this.btmType = {};
+        this.$refs.form.resetFields();
        }
     }
 }

--
Gitblit v1.9.3