From 5ec2f793898d4bbfd37f73b11688aeab9cc04cf2 Mon Sep 17 00:00:00 2001
From: yuxc <653031404@qq.com>
Date: 星期二, 13 六月 2023 17:54:20 +0800
Subject: [PATCH] 1、以前一些表名是写固定的,现在调业务类型服务进行获取的表名

---
 Source/UBCS-WEB/src/views/modeling/Business.vue |  109 +++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 71 insertions(+), 38 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/modeling/Business.vue b/Source/UBCS-WEB/src/views/modeling/Business.vue
index 3b59829..807155a 100644
--- a/Source/UBCS-WEB/src/views/modeling/Business.vue
+++ b/Source/UBCS-WEB/src/views/modeling/Business.vue
@@ -1,14 +1,17 @@
 <template>
   <el-container>
-    <el-header>
-      <el-button type="primary" @click="businessAdd">鏂板</el-button>
-      <el-button type="primary" @click="businessEdit">淇敼</el-button>
-      <el-button type="primary" @click="selectFromTable">浠庡凡鏈変腑鑾峰彇</el-button>
+    <el-header class="businessHeader" style="height: 40px;">
+      <el-button-group>
+        <el-button type="primary" @click="businessAdd" size="small"> <i class="el-icon-plus"></i>&nbsp; 鏂板</el-button>
+        <el-button type="primary" @click="businessEdit" size="small"><i class="el-icon-edit"></i>&nbsp; 淇敼</el-button>
+        <el-button type="primary" @click="selectFromTable" size="small"><i class="el-icon-thumb"></i>&nbsp; 浠庡凡鏈変腑鑾峰彇</el-button>
+      </el-button-group>
     </el-header>
     <el-container>
       <el-aside width="240px">
-        <basic-container>
-          <avue-tree id="basic" :data="treeData" :option="treeOption" @node-click="nodeClick">
+        <basic-container class="businessTreeContainer">
+          <p style="margin-top: 10px;font-weight: 570;font-size: 19px">{{ treeOption.title }}</p>
+          <avue-tree id="basic" :data="treeData" :option="treeOption" @node-click="nodeClick" class="businessTree">
             <span class="el-tree-node__label" slot-scope="{ node, data }">
               <span>
                 <i class="el-icon-star-on"></i>
@@ -24,14 +27,14 @@
           <basic-container>
             <p style="margin-top: 10px;font-weight: 570;font-size: 19px">鍩烘湰淇℃伅</p>
             <el-descriptions class="margin-top" :column="3" :size="size" border>
-              <el-descriptions-item>
+              <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle">
                 <template slot="label">
                   <i :class="icons.key"></i>
                   鑻辨枃鍚嶇О
                 </template>
                 {{ obj.id }}
               </el-descriptions-item>
-              <el-descriptions-item>
+              <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle">
                 <template slot="label">
                   <i :class="icons.name"></i>
                   涓枃鍚嶇О
@@ -39,13 +42,13 @@
                 {{ obj.name }}
               </el-descriptions-item>
               <el-descriptions-item>
-                <template slot="label">
+                <template slot="label" :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle">
                   <i :class="icons.tableName"></i>
                   鏁版嵁搴撹〃鍚�
                 </template>
                 {{ obj.tableName }}
               </el-descriptions-item>
-              <el-descriptions-item>
+              <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle">
                 <template slot="label">
                   <i :class="icons.domain"></i>
                   鎵�灞為鍩�
@@ -68,21 +71,21 @@
             </template>
             {{ obj.sss }}
           </el-descriptions-item> -->
-              <el-descriptions-item>
+              <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle">
                 <template slot="label">
                   <i :class="icons.revisionRule"></i>
                   鐗堟湰瑙勫垯
                 </template>
                 {{ obj.versionRule }}
               </el-descriptions-item>
-              <el-descriptions-item>
+              <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle">
                 <template slot="label">
                   <i :class="icons.lifeCycle"></i>
                   鐢熷懡鍛ㄦ湡
                 </template>
                 {{ obj.lifeCycleId }}
               </el-descriptions-item>
-              <el-descriptions-item>
+              <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle">
                 <template slot="label">
                   <i :class="icons.view"></i>
                   瑙嗗浘
@@ -98,7 +101,7 @@
             </template>
             {{ obj.implClass }}
           </el-descriptions-item> -->
-              <el-descriptions-item>
+              <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle">
                 <template slot="label">
                   <i :class="icons.desc"></i>
                   鎻忚堪
@@ -111,24 +114,27 @@
           <basic-container>
             <p style="margin-top: 10px;font-weight: 570;font-size: 19px">灞炴�у垪琛�</p>
             <avue-crud class="attributeCrud" v-model="obj" :data="obj.attributes" :option="loadOption">
-              <template slot="attrDataType" slot-scope="{row}" >
-                    <el-tag>{{row.attrDataType}}</el-tag>
+              <template slot="attrDataTypeText" slot-scope="{row}" >
+                    <el-tag>{{row.attrDataTypeText}}</el-tag>
                 </template>
             </avue-crud>
           </basic-container>
         </el-main>
         <el-dialog :visible="ref.visible" title="浠庢暟鎹簱涓坊鍔�" width="700px" append-to-body @close="dialoghandelfalse">
           閫夋嫨棰嗗煙锛�
-          <el-select v-model="domain" placeholder="璇烽�夋嫨" @change="refOnLoad">
+          <el-select v-model="domain" placeholder="璇烽�夋嫨" @change="refOnLoad" size="small">
             <el-option v-for="item in domainOptions" :key="item.value" :label="item.label" :value="item.value">
             </el-option>
           </el-select>
+          <div class="sep" style="height:7px">
+
+          </div>
           <avue-crud class="businessCrud" v-model="ref.form" :option="ref.option" :data="ref.data" @selection-change="selectionChange">
           </avue-crud>
-          <div slot="footer" class="dialog-footer">
-                <el-button @click="dialoghandeltrue">纭畾</el-button>
-                <el-button @click="dialoghandelfalse">鍙栨秷</el-button>
-            </div>
+          <span slot="footer" class="dialog-footer">
+            <el-button @click="dialoghandelfalse">鍙� 娑�</el-button>
+            <el-button type="primary" @click="dialoghandeltrue">纭� 瀹�</el-button>
+          </span>
         </el-dialog>
       </el-container>
     </el-container>
@@ -158,9 +164,10 @@
       treeOption: {
         defaultExpandAll: true,
         title: '涓氬姟绫诲瀷鏍�',
+        addBtn: false,
         props: {
           labelText: '',
-          label: 'name',
+          label: 'label',
           value: 'oid',
           children: 'childList',
         }
@@ -172,8 +179,6 @@
         border: true,
         height: 466,
         editBtn: false,
-        index: true,
-        rowKey:'oid',
         addBtn: false,
         menu: false,
         highlightCurrentRow: true,
@@ -191,7 +196,7 @@
           },
           {
             label: "绫诲瀷",
-            prop: "attrDataType",
+            prop: "attrDataTypeText",
             align: 'center',
             slot: true
           },
@@ -207,11 +212,15 @@
           }
         ]
       },
+      descriptionOption: {
+        labelStyle:'text-align:center;width:120px',
+        contentStyle: 'width:240px;text-align:center;word-break;break-all;'
+      },
       domain: null,
       domainOptions: [],
       icons:{
         key: 'el-icon-finished',
-        name: 'el-icon-info',
+        name: 'el-icon-tickets',
         tableName: 'el-icon-date',
         domain: 'el-icon-folder-opened',
         revisionRule: 'el-icon-s-check',
@@ -229,7 +238,7 @@
           headerAlign: 'center',
           border: true,
           index: true,
-          rowKey: 'oid',
+          rowKey: 'id',
           tabs: true,
           addBtn: false,
           menu: false,
@@ -249,10 +258,7 @@
             }
           ]
         },
-        data: [{
-          tableName: '1',
-          description: '2'
-        }]
+        data: [],
       }
     }
   },
@@ -262,13 +268,36 @@
   },
   methods: {
     nodeClick(data) {
-      if(data.oid){
-        getDetail(data.oid).then(res => {
-          this.obj = res.data.data;
-        })
-      }
+      getDetail(data.oid).then(res => {
+        this.obj = res.data.data;
+      })
+    },
+    //  鍩烘湰淇℃伅娣诲姞
+    basicSave(row, done, loading) {
+      add(Object.assign({
+        createUser: this.userInfo.name
+      }, row)).then(() => {
+        this.$message.success('鏂板鎴愬姛')
+        done();
+        this.getList();
+      }).catch(() => {
+        loading()
+      })
+    },
+    //灞炴�ф坊鍔�
+    loadSave(row, done, loading) {
+      add(Object.assign({
+        createUser: this.userInfo.name
+      }, row)).then(() => {
+        this.$message.success('鏂板鎴愬姛')
+        done();
+        this.getList();
+      }).catch(() => {
+        loading()
+      })
     },
     selectFromTable() {
+      console.log('鑾峰彇');
       this.ref.visible = true;
     },
     refOnLoad(domain) {
@@ -306,12 +335,13 @@
       this.ifRefreshBtmAddRefresh();
     },
     businessEdit(){
-      this.$refs.btmAdd.btmType = this.obj;
+      var json = JSON.stringify(this.obj);
+      this.$refs.btmAdd.btmType = JSON.parse(json);
       this.$refs.btmAdd.showSubmitDialog = true;
       this.ifRefreshBtmAddRefresh();
     },
     ifRefreshBtmAddRefresh(){
-      this.$refs.btmAdd.refreshAttrTable();
+      // this.$refs.btmAdd.refreshAttrTable();
     }
   },
 }
@@ -329,4 +359,7 @@
 .attributeCrud > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu{
         display: none !important;
 }
+.businessTreeContainer > .el-card > .el-card__body {
+  height: 775px;
+}
 </style>

--
Gitblit v1.9.3