From f39675fad28f66dd32aee1d3ee805ad99007bce5 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期五, 02 六月 2023 21:13:16 +0800
Subject: [PATCH] 代码整合

---
 Source/UBCS-WEB/src/views/modeling/Business.vue |  113 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 57 insertions(+), 56 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/modeling/Business.vue b/Source/UBCS-WEB/src/views/modeling/Business.vue
index ce72565..476fe62 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>
@@ -50,7 +53,9 @@
                   <i class="el-icon-folder-opened"></i>
                   鎵�灞為鍩�
                 </template>
-                {{ obj.domain }}
+                  <el-tag size="small">
+                    {{ obj.domainText }}
+                  </el-tag> 
               </el-descriptions-item>
               <!-- <el-descriptions-item>
             <template slot="label">
@@ -85,7 +90,9 @@
                   <i class="el-icon-view"></i>
                   瑙嗗浘
                 </template>
-                {{ obj.viewFlag }}
+               <el-tag size="small">
+                  {{ obj.viewText }}
+               </el-tag>
               </el-descriptions-item>
               <!-- <el-descriptions-item>
             <template slot="label">
@@ -106,15 +113,22 @@
           <!-- 灞炴�у垪琛�-->
           <basic-container>
             <p style="margin-top: 10px;font-weight: 570;font-size: 19px">灞炴�у垪琛�</p>
-            <avue-crud v-model="obj" :data="obj.attributes" :option="loadOption" @row-save="loadSave"></avue-crud>
+            <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>
+            </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-option v-for="item in domainOptions" :key="item" :label="item" :value="item">
+          <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>
           <span slot="footer" class="dialog-footer">
@@ -124,7 +138,7 @@
         </el-dialog>
       </el-container>
     </el-container>
-    <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions">
+    <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions" :icons="icons" @refreshTable="initTreeOnLoad">
   </business-add>
   </el-container>
 </template>
@@ -150,6 +164,7 @@
       treeOption: {
         defaultExpandAll: true,
         title: '涓氬姟绫诲瀷鏍�',
+        addBtn: false,
         props: {
           labelText: '',
           label: 'name',
@@ -171,18 +186,19 @@
         columnBtn:false,
         column: [
           {
-            label: '灞炴�ц嫳鏂囧悕绉�',
+            label: '鑻辨枃鍚嶇О',
             prop: 'id',
             align: 'center'
           }, {
-            label: '灞炴�т腑鏂囧悕绉�',
+            label: '涓枃鍚嶇О',
             prop: 'name',
             align: 'center'
           },
           {
-            label: "灞炴�х被鍨�",
+            label: "绫诲瀷",
             prop: "attrDataType",
-            align: 'center'
+            align: 'center',
+            slot: true
           },
           {
             label: "榛樿鍊�",
@@ -198,6 +214,16 @@
       },
       domain: null,
       domainOptions: [],
+      icons:{
+        key: 'el-icon-finished',
+        name: 'el-icon-info',
+        tableName: 'el-icon-date',
+        domain: 'el-icon-folder-opened',
+        revisionRule: 'el-icon-s-check',
+        lifeCycle: 'el-icon-refresh-right',
+        view: 'el-icon-view',
+        desc: 'el-icon-chat-line-square'
+      },
       ref: {
         // 浠庤〃涓�夋嫨dialog鐘舵��
         visible: false,
@@ -240,38 +266,6 @@
     this.initDomainOption();
   },
   methods: {
-    //鐢熷懡鍛ㄦ湡瀵硅瘽妗嗗彇娑堢偣鍑讳簨浠�
-    dialoghandelfalse() {
-      this.packageLifeBox = false
-    },
-    //鐢熷懡鍛ㄦ湡瀵硅瘽妗嗙‘瀹氱偣鍑讳簨浠�
-    dialoghandeltrue() {
-      this.packageLifeBox = false
-    },
-    //閫夋嫨鐢熷懡鍛ㄦ湡瀵硅瘽妗�
-    handelLife() {
-      this.packageLifeBox = true
-    },
-    //鐗堟湰瑙勫垯鎵嬪姩杈撳叆鍜岄�夋嫨妗嗙殑鐘舵�佸彇鍙�
-    handelRules() {
-      this.rulesFalg = !this.rulesFalg
-    },
-    //鐗堟湰瑙勫垯涓変釜鎸夐挳鐨勬樉绀洪殣钘�
-    radioChange(val) {
-      if (val.value == 0) {
-        this.basicOption.group[1].column[1].display = false;
-        this.basicOption.group[1].column[2].display = false;
-        this.basicOption.group[1].column[3].display = false;
-      } else if (val.value == 1) {
-        this.basicOption.group[1].column[1].display = true;
-        this.basicOption.group[1].column[2].display = true;
-        this.basicOption.group[1].column[3].display = false;
-      } else if (val.value == 2) {
-        this.basicOption.group[1].column[1].display = true;
-        this.basicOption.group[1].column[2].display = true;
-        this.basicOption.group[1].column[3].display = true;
-      }
-    },
     nodeClick(data) {
       getDetail(data.oid).then(res => {
         this.obj = res.data.data;
@@ -312,7 +306,6 @@
     },
     initTreeOnLoad() {
       initTree().then(res => {
-        console.log('123');
         this.treeData = res.data.data;
       });
     },
@@ -323,7 +316,6 @@
     },
     selectionChange(list) {
       this.selectionList = list;
-      console.log(this.selectionList);
     },
     dialoghandelfalse() {
       this.ref.visible = false;
@@ -339,12 +331,15 @@
     },
     businessAdd(){
       this.$refs.btmAdd.showSubmitDialog = true;
-      console.log('娣诲姞');
+      this.ifRefreshBtmAddRefresh();
     },
     businessEdit(){
-      this.addOption.btmType = this.obj;
-      this.$refs.addOption.showSubmitDialog = true;
-      console.log('缂栬緫');
+      this.$refs.btmAdd.btmType = this.obj;
+      this.$refs.btmAdd.showSubmitDialog = true;
+      this.ifRefreshBtmAddRefresh();
+    },
+    ifRefreshBtmAddRefresh(){
+      // this.$refs.btmAdd.refreshAttrTable();
     }
   },
 }
@@ -356,7 +351,13 @@
   border-radius: 10px;
 }
 
-.businessCrud > .el-card > .el-card__body > .avue-crud_menu{
-  display: none!important;
+.businessCrud > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu{
+        display: none !important;
+}
+.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