From 05d45bd440ffc92e14e6c8728ac8956a0488c0ab Mon Sep 17 00:00:00 2001
From: xiejun <xj@2023>
Date: 星期四, 07 十二月 2023 17:20:26 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/UBCS-WEB/src/views/modeling/Business.vue |  303 +++++++++++++++++++++++++++++--------------------
 1 files changed, 179 insertions(+), 124 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/modeling/Business.vue b/Source/UBCS-WEB/src/views/modeling/Business.vue
index 40ccabe..fb9fdec 100644
--- a/Source/UBCS-WEB/src/views/modeling/Business.vue
+++ b/Source/UBCS-WEB/src/views/modeling/Business.vue
@@ -1,21 +1,33 @@
 <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>
+<!--    <el-header class="businessHeader" style="height: 40px;padding:0 8px">-->
+
+<!--    </el-header>-->
     <el-container>
-      <el-aside width="240px">
-        <basic-container>
-          <avue-tree id="basic" :data="treeData" :option="treeOption" @node-click="nodeClick">
-            <span class="el-tree-node__label" slot-scope="{ node, data }">
+      <el-aside style="width: 20%">
+        <basic-container class="businessTreeContainer">
+          <div class="app">
+            <div style="display: flex;margin-bottom: 10px;justify-content: space-around;">
+              <el-button v-if="permissionList.addBtn"  size="mini" type="primary" @click="businessAdd" plain style="width: 60px">
+                鏂板
+              </el-button>
+              <el-button v-if="permissionList.editBtn"  size="mini" type="primary" @click="businessEdit" plain style="width: 60px">
+                淇敼
+              </el-button>
+              <el-button v-if="permissionList.table"  size="mini" type="primary"
+                         @click="selectFromTable" plain> 浠庡凡鏈変腑鑾峰彇
+              </el-button>
+            </div>
+            <avue-tree :data="treeData" :option="treeOption" class="businessTree" @node-click="nodeClick" style="width: fit-content;">
+            <template slot-scope="{ node, data }" class="el-tree-node__label">
               <span>
-                <i class="el-icon-star-on"></i>
+                <i :class="(node || {}).level === 2 ? 'el-icon-star-off' : 'el-icon-folder-opened'"></i>
                 {{ (node || {}).label }}
               </span>
-            </span>
-          </avue-tree>
+            </template>
+            </avue-tree>
+          </div>
+
         </basic-container>
       </el-aside>
       <el-container>
@@ -23,70 +35,69 @@
           <!--鍩烘湰淇℃伅-->
           <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 :column="3" :size="size" border class="margin-top">
+              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+                                    :labelStyle="descriptionOption.labelStyle">
                 <template slot="label">
-                  <i class="el-icon-finished"></i>
+                  <i :class="icons.key"></i>
                   鑻辨枃鍚嶇О
                 </template>
                 {{ obj.id }}
               </el-descriptions-item>
-              <el-descriptions-item>
+              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+                                    :labelStyle="descriptionOption.labelStyle">
                 <template slot="label">
-                  <i class="el-icon-info"></i>
+                  <i :class="icons.name"></i>
                   涓枃鍚嶇О
                 </template>
                 {{ obj.name }}
               </el-descriptions-item>
               <el-descriptions-item>
-                <template slot="label">
-                  <i class="el-icon-date"></i>
+                <template slot="label" :contentStyle="descriptionOption.contentStyle"
+                          :labelStyle="descriptionOption.labelStyle">
+                  <i :class="icons.tableName"></i>
                   鏁版嵁搴撹〃鍚�
                 </template>
                 {{ obj.tableName }}
               </el-descriptions-item>
-              <el-descriptions-item>
+              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+                                    :labelStyle="descriptionOption.labelStyle">
                 <template slot="label">
-                  <i class="el-icon-folder-opened"></i>
+                  <i :class="icons.domain"></i>
                   鎵�灞為鍩�
                 </template>
-                {{ obj.domain }}
+                <el-tag v-if="obj.domainText" size="small">
+                  {{ obj.domainText }}
+                </el-tag>
+                <span v-else></span>
               </el-descriptions-item>
-              <!-- <el-descriptions-item>
-            <template slot="label">
-              <i class="el-icon-s-ticket"></i>
-              鏍囩
-            </template>
-            {{obj.hashtag}}
-          </el-descriptions-item> -->
-              <!-- <el-descriptions-item>
-            <template slot="label">
-              <i class="el-icon-arrow-up"></i>
-              缁ф壙鑷�
-            </template>
-            {{ obj.sss }}
-          </el-descriptions-item> -->
-              <el-descriptions-item>
+              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+                                    :labelStyle="descriptionOption.labelStyle">
                 <template slot="label">
-                  <i class="el-icon-s-check"></i>
+                  <i :class="icons.revisionRule"></i>
                   鐗堟湰瑙勫垯
                 </template>
-                {{ obj.versionRule }}
+                {{ obj.revisionRuleName ? obj.revisionRuleName + '(' + obj.revisionRuleId + ')' : '' }}
               </el-descriptions-item>
-              <el-descriptions-item>
+              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+                                    :labelStyle="descriptionOption.labelStyle">
                 <template slot="label">
-                  <i class="el-icon-refresh-right"></i>
+                  <i :class="icons.lifeCycle"></i>
                   鐢熷懡鍛ㄦ湡
                 </template>
-                {{ obj.lifeCycleId }}
+                {{ obj.lifeCycleName ? obj.lifeCycleName + '(' + obj.lifeCycleId + ')' : '' }}
               </el-descriptions-item>
-              <el-descriptions-item>
-                <template slot="label">
-                  <i class="el-icon-view"></i>
-                  瑙嗗浘
-                </template>
-                {{ obj.viewFlag }}
-              </el-descriptions-item>
+<!--              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"-->
+<!--                                    :labelStyle="descriptionOption.labelStyle">-->
+<!--                <template slot="label">-->
+<!--                  <i :class="icons.view"></i>-->
+<!--                  瑙嗗浘-->
+<!--                </template>-->
+<!--                <el-tag v-if="obj.viewText" size="small">-->
+<!--                  {{ obj.viewText }}-->
+<!--                </el-tag>-->
+<!--                <span v-else></span>-->
+<!--              </el-descriptions-item>-->
               <!-- <el-descriptions-item>
             <template slot="label">
               <i class="el-icon-arrow-down"></i>
@@ -94,9 +105,10 @@
             </template>
             {{ obj.implClass }}
           </el-descriptions-item> -->
-              <el-descriptions-item>
+              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+                                    :labelStyle="descriptionOption.labelStyle">
                 <template slot="label">
-                  <i class="el-icon-chat-line-square"></i>
+                  <i :class="icons.desc"></i>
                   鎻忚堪
                 </template>
                 {{ obj.description }}
@@ -106,16 +118,24 @@
           <!-- 灞炴�у垪琛�-->
           <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 v-model="obj" :data="obj.attributes" :option="loadOption" class="attributeCrud">
+              <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-dialog :visible="ref.visible" append-to-body title="浠庢暟鎹簱涓坊鍔�" width="700px" @close="dialoghandelfalse" top="9vh">
           閫夋嫨棰嗗煙锛�
-          <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="璇烽�夋嫨" size="small" @change="refOnLoad">
+            <el-option v-for="item in domainOptions" :key="item.value" :label="item.label" :value="item.value">
             </el-option>
           </el-select>
-          <avue-crud class="businessCrud" v-model="ref.form" :option="ref.option" :data="ref.data" @selection-change="selectionChange">
+          <div class="sep" style="height:7px">
+
+          </div>
+          <avue-crud ref="businessCrud" v-model="ref.form" :data="ref.data" :option="ref.option" class="businessCrud"
+                     @selection-change="selectionChange">
           </avue-crud>
           <span slot="footer" class="dialog-footer">
             <el-button @click="dialoghandelfalse">鍙� 娑�</el-button>
@@ -124,8 +144,9 @@
         </el-dialog>
       </el-container>
     </el-container>
-    <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions">
-  </business-add>
+    <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions" :icons="icons"
+                  @refreshTable="initTreeOnLoad">
+    </business-add>
   </el-container>
 </template>
 <script>
@@ -136,6 +157,8 @@
   saveFromTable,
   getDetail
 } from "@/api/omd/btmType"
+import {mapGetters} from "vuex";
+
 export default {
   name: "Business",
   data() {
@@ -148,41 +171,44 @@
       selectionList: [],
       treeData: [],
       treeOption: {
-        defaultExpandAll: true,
+        defaultExpandAll: false,
         title: '涓氬姟绫诲瀷鏍�',
+        addBtn: false,
+        menu: false,
         props: {
           labelText: '',
-          label: 'name',
+          label: 'label',
           value: 'oid',
           children: 'childList',
         }
       },
-      addOption:{
-        btmType:{},
+      addOption: {
+        btmType: {},
       },
       loadOption: {
+        height:'auto',
         border: true,
-        height: 466,
         editBtn: false,
         addBtn: false,
         menu: false,
         highlightCurrentRow: true,
-        refreshBtn:false,
-        columnBtn:false,
+        refreshBtn: false,
+        columnBtn: false,
         column: [
           {
-            label: '灞炴�ц嫳鏂囧悕绉�',
+            label: '鑻辨枃鍚嶇О',
             prop: 'id',
             align: 'center'
           }, {
-            label: '灞炴�т腑鏂囧悕绉�',
+            label: '涓枃鍚嶇О',
             prop: 'name',
             align: 'center'
           },
           {
-            label: "灞炴�х被鍨�",
-            prop: "attrDataType",
-            align: 'center'
+            label: "绫诲瀷",
+            prop: "attrDataTypeText",
+            align: 'center',
+            slot: true
           },
           {
             label: "榛樿鍊�",
@@ -196,8 +222,23 @@
           }
         ]
       },
+      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-tickets',
+        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',
+        referType: 'el-icon-search'
+      },
       ref: {
         // 浠庤〃涓�夋嫨dialog鐘舵��
         visible: false,
@@ -228,10 +269,17 @@
             }
           ]
         },
-        data: [{
-          tableName: '1',
-          description: '2'
-        }]
+        data: [],
+      }
+    }
+  },
+  computed: {
+    ...mapGetters(["permission"]),
+    permissionList() {
+      return {
+        addBtn: this.vaildData(this.permission.modeling_Business.Business_add, false),
+        table: this.vaildData(this.permission.modeling_Business.Business_table, false),
+        editBtn: this.vaildData(this.permission.modeling_Business.Business_edit, false),
       }
     }
   },
@@ -240,42 +288,14 @@
     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, node, leaf) {
+      if (data.oid) {
+        getDetail(data.oid).then(res => {
+          this.obj = res.data.data;
+        })
+      } else {
+        this.$message.warning('璇风偣鍑诲瓙鑺傜偣');
       }
-    },
-    nodeClick(data) {
-      getDetail(data.oid).then(res => {
-        this.obj = res.data.data;
-      })
     },
     //  鍩烘湰淇℃伅娣诲姞
     basicSave(row, done, loading) {
@@ -302,7 +322,6 @@
       })
     },
     selectFromTable() {
-      console.log('鑾峰彇');
       this.ref.visible = true;
     },
     refOnLoad(domain) {
@@ -312,7 +331,6 @@
     },
     initTreeOnLoad() {
       initTree().then(res => {
-        console.log('123');
         this.treeData = res.data.data;
       });
     },
@@ -323,41 +341,78 @@
     },
     selectionChange(list) {
       this.selectionList = list;
-      console.log(this.selectionList);
     },
     dialoghandelfalse() {
       this.ref.visible = false;
+      this.$refs.businessCrud.toggleSelection()
       this.selectionList = [];
       this.domain = null;
     },
     dialoghandeltrue() {
+      if (this.selectionList.length < 1) {
+        this.$message.warning('璇烽�夋嫨鏁版嵁');
+        return false;
+      }
       saveFromTable(this.selectionList, this.domain).then(res => {
         this.$message.success('淇濆瓨鎴愬姛');
         this.dialoghandelfalse();
         this.initTreeOnLoad();
       })
     },
-    businessAdd(){
+    businessAdd() {
       this.$refs.btmAdd.showSubmitDialog = true;
-      console.log('娣诲姞');
+      this.$refs.btmAdd.btmType = {};
+      this.ifRefreshBtmAddRefresh();
     },
-    businessEdit(){
-      this.addOption.btmType = this.obj;
-      this.$refs.addOption.showSubmitDialog = true;
-      console.log('缂栬緫');
+    businessEdit() {
+      if (!this.obj.oid) {
+        this.$message.warning("璇烽�夋嫨涓�鏉″彾瀛愯妭鐐圭殑涓氬姟绫诲瀷");
+        return;
+      }
+      const json = JSON.stringify(this.obj);
+      this.$refs.btmAdd.btmType = JSON.parse(json);
+      this.$refs.btmAdd.showSubmitDialog = true;
+      this.ifRefreshBtmAddRefresh();
+    },
+    ifRefreshBtmAddRefresh() {
+      // this.$refs.btmAdd.refreshAttrTable();
     }
   },
 }
 </script>
 
-<style lang="scss">
-#basic {
-  height: 770px;
-  border-radius: 10px;
+<style lang="scss" scoped>
+
+.businessCrud > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu {
+  display: none !important;
 }
 
-.businessCrud > .el-card > .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;
 }
 
+
+.app {
+  overflow: auto;
+  height: 84.3vh;
+}
+
+.app::-webkit-scrollbar {
+  height: 15px; // 绾靛悜婊氬姩鏉� 蹇呭啓
+  background: white;
+  border: white;
+  width: 10px;
+
+}
+
+// 婊氬姩鏉$殑婊戝潡
+.app::-webkit-scrollbar-thumb {
+  width: 10px;
+  height: 10px;
+  background-color: #ececec;
+  border-radius: 20px;
+  border: #ececec;
+}
+
+
 </style>

--
Gitblit v1.9.3