From 9b4433fddf5b401edb0aace8a404ac733b122702 Mon Sep 17 00:00:00 2001
From: 田源 <tianyuan@vci-tech.com>
Date: 星期四, 03 四月 2025 14:35:02 +0800
Subject: [PATCH] 添加非密字段显示

---
 Source/UBCS-WEB/src/views/modeling/Business.vue |  237 ++++++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 144 insertions(+), 93 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/modeling/Business.vue b/Source/UBCS-WEB/src/views/modeling/Business.vue
index 12bf821..5e8f486 100644
--- a/Source/UBCS-WEB/src/views/modeling/Business.vue
+++ b/Source/UBCS-WEB/src/views/modeling/Business.vue
@@ -1,25 +1,42 @@
 <template>
   <el-container>
-    <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-header class="businessHeader" style="height: 40px;padding:0 8px">-->
+
+    <!--    </el-header>-->
     <el-container>
-      <el-aside width="240px">
+      <el-aside style="width: 300px">
         <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>
+          <div class="app"style="height: calc(100vh - 145px);">
+            <div style="display: flex;margin-bottom: 10px;justify-content: space-around;">
+              <el-button v-if="permissionList.addBtn" plain size="mini"  type="primary"
+                         @click="businessAdd">
+                鏂板
+              </el-button>
+              <el-button v-if="permissionList.editBtn" plain size="mini"  type="primary"
+                         @click="businessEdit">
+                淇敼
+              </el-button>
+              <el-button v-if="permissionList.table" plain size="mini"
+                         type="primary" @click="selectFromTable"> 浠庡凡鏈変腑鑾峰彇
+              </el-button>
+            </div>
+            <div style="height:  calc(100vh - 220px);overflow: auto">
+              <avue-tree :data="treeData" :option="treeOption" class="businessTree"
+                         @node-click="nodeClick">
+                <template slot-scope="{ node, data }" class="el-tree-node__label">
+                  <el-tooltip :content="$createElement('div', { domProps: { innerHTML: node.label } })" class="item" effect="dark"
+                              open-delay="250"
+                              placement="top-start">
+                <span style="font-size: 15px;">
+                <i :class="(node || {}).level === 2 ? 'el-icon-star-off' : 'el-icon-folder-opened'"></i>
                 {{ (node || {}).label }}
               </span>
-            </span>
-          </avue-tree>
+                  </el-tooltip>
+                </template>
+              </avue-tree>
+            </div>
+          </div>
+
         </basic-container>
       </el-aside>
       <el-container>
@@ -27,17 +44,17 @@
           <!--鍩烘湰淇℃伅-->
           <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 :labelStyle="descriptionOption.labelStyle"
-                :contentStyle="descriptionOption.contentStyle">
+            <el-descriptions :column="3" :size="size" border class="margin-top">
+              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+                                    :labelStyle="descriptionOption.labelStyle">
                 <template slot="label">
                   <i :class="icons.key"></i>
                   鑻辨枃鍚嶇О
                 </template>
                 {{ obj.id }}
               </el-descriptions-item>
-              <el-descriptions-item :labelStyle="descriptionOption.labelStyle"
-                :contentStyle="descriptionOption.contentStyle">
+              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+                                    :labelStyle="descriptionOption.labelStyle">
                 <template slot="label">
                   <i :class="icons.name"></i>
                   涓枃鍚嶇О
@@ -45,72 +62,42 @@
                 {{ obj.name }}
               </el-descriptions-item>
               <el-descriptions-item>
-                <template slot="label" :labelStyle="descriptionOption.labelStyle"
-                  :contentStyle="descriptionOption.contentStyle">
+                <template slot="label" :contentStyle="descriptionOption.contentStyle"
+                          :labelStyle="descriptionOption.labelStyle">
                   <i :class="icons.tableName"></i>
                   鏁版嵁搴撹〃鍚�
                 </template>
                 {{ obj.tableName }}
               </el-descriptions-item>
-              <el-descriptions-item :labelStyle="descriptionOption.labelStyle"
-                :contentStyle="descriptionOption.contentStyle">
+              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+                                    :labelStyle="descriptionOption.labelStyle">
                 <template slot="label">
                   <i :class="icons.domain"></i>
                   鎵�灞為鍩�
                 </template>
-                <el-tag size="small">
+                <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 :labelStyle="descriptionOption.labelStyle"
-                :contentStyle="descriptionOption.contentStyle">
+              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+                                    :labelStyle="descriptionOption.labelStyle">
                 <template slot="label">
                   <i :class="icons.revisionRule"></i>
                   鐗堟湰瑙勫垯
                 </template>
-                {{ obj.revisionRuleName + '(' + obj.revisionRuleId + ')' }}
+                {{ obj.revisionRuleName ? obj.revisionRuleName + '(' + obj.revisionRuleId + ')' : '' }}
               </el-descriptions-item>
-              <el-descriptions-item :labelStyle="descriptionOption.labelStyle"
-                :contentStyle="descriptionOption.contentStyle">
+              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+                                    :labelStyle="descriptionOption.labelStyle">
                 <template slot="label">
                   <i :class="icons.lifeCycle"></i>
                   鐢熷懡鍛ㄦ湡
                 </template>
-                {{ obj.lifeCycleName + '(' + obj.lifeCycleId + ')' }}
+                {{ obj.lifeCycleName ? obj.lifeCycleName + '(' + obj.lifeCycleId + ')' : '' }}
               </el-descriptions-item>
-              <el-descriptions-item :labelStyle="descriptionOption.labelStyle"
-                :contentStyle="descriptionOption.contentStyle">
-                <template slot="label">
-                  <i :class="icons.view"></i>
-                  瑙嗗浘
-                </template>
-                <el-tag size="small">
-                  {{ obj.viewText }}
-                </el-tag>
-              </el-descriptions-item>
-              <!-- <el-descriptions-item>
-            <template slot="label">
-              <i class="el-icon-arrow-down"></i>
-              瀹炵幇绫�
-            </template>
-            {{ obj.implClass }}
-          </el-descriptions-item> -->
-              <el-descriptions-item :labelStyle="descriptionOption.labelStyle"
-                :contentStyle="descriptionOption.contentStyle">
+              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+                                    :labelStyle="descriptionOption.labelStyle">
                 <template slot="label">
                   <i :class="icons.desc"></i>
                   鎻忚堪
@@ -122,24 +109,26 @@
           <!-- 灞炴�у垪琛�-->
           <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">
+<!--            style="height: calc(100vh - 435px)"-->
+            <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="浠庢暟鎹簱涓坊鍔�" top="4vh" width="600px"
+                   @close="dialoghandelfalse">
           閫夋嫨棰嗗煙锛�
-          <el-select v-model="domain" placeholder="璇烽�夋嫨" @change="refOnLoad" size="small">
+          <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>
           <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 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>
@@ -148,9 +137,13 @@
         </el-dialog>
       </el-container>
     </el-container>
-    <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions" :icons="icons"
-      @refreshTable="initTreeOnLoad">
+    <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions" :icons="icons" :type="type"
+                  @refreshTable="initTreeOnLoad">
     </business-add>
+    <business-edit ref="btmEdit" :btmType="addOption.btmEditType" :domainOption="domainOptions" :icons="icons" :type="type"
+                   @refreshTable="initTreeOnLoad">
+
+    </business-edit>
   </el-container>
 </template>
 <script>
@@ -161,10 +154,13 @@
   saveFromTable,
   getDetail
 } from "@/api/omd/btmType"
+import {mapGetters} from "vuex";
+
 export default {
   name: "Business",
   data() {
     return {
+      type: "",
       //鐢熷懡鍛ㄦ湡瀵硅瘽妗嗙姸鎬�
       packageLifeBox: false,
       //鐗堟湰瑙勫垯鐘舵��
@@ -173,9 +169,11 @@
       selectionList: [],
       treeData: [],
       treeOption: {
-        defaultExpandAll: true,
+        height:'auto',
+        defaultExpandAll: false,
         title: '涓氬姟绫诲瀷鏍�',
         addBtn: false,
+        menu: false,
         props: {
           labelText: '',
           label: 'label',
@@ -184,11 +182,17 @@
         }
       },
       addOption: {
-        btmType: {},
+        btmType: {
+          attributes:[]
+        },
+        btmEditType:{
+          attributes:[]
+        }
       },
       loadOption: {
+        height: 'auto',
+        calcHeight: 0,
         border: true,
-        height: 466,
         editBtn: false,
         addBtn: false,
         menu: false,
@@ -237,7 +241,8 @@
         revisionRule: 'el-icon-s-check',
         lifeCycle: 'el-icon-refresh-right',
         view: 'el-icon-view',
-        desc: 'el-icon-chat-line-square'
+        desc: 'el-icon-chat-line-square',
+        referType: 'el-icon-search'
       },
       ref: {
         // 浠庤〃涓�夋嫨dialog鐘舵��
@@ -253,6 +258,7 @@
           tabs: true,
           addBtn: false,
           menu: false,
+          refreshBtn:false,
           highlightCurrentRow: true,
           column: [
             {
@@ -273,17 +279,39 @@
       }
     }
   },
+  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),
+      }
+    }
+  },
   created() {
     this.initTreeOnLoad();
     this.initDomainOption();
   },
   methods: {
-    nodeClick(data) {
+    nodeClick(data, node, leaf) {
       if (data.oid) {
         getDetail(data.oid).then(res => {
           this.obj = res.data.data;
+          this.addOption.btmEditType = res.data.data;
+          // if(this.addOption.btmEditType.domainText){
+          //   this.$refs.btmEdit.getDefaultData('reVersionRule', 'ruleData', 'ruleFirstSelection');
+          // }
+          // //鐗堟湰瑙勫垯
+          // if(this.addOption.btmEditType.revisionRuleName && this.addOption.btmEditType.revisionRuleId){
+          //   this.$refs.btmEdit.getDefaultData('reVersionRule', 'ruleData', 'ruleFirstSelection');
+          // }
+          // //鐢熷懡鍛ㄦ湡
+          // if(this.addOption.btmEditType.lifeCycleId && this.addOption.btmEditType.lifeCycleName){
+          //   this.$refs.btmEdit.getDefaultData('lifeCycle', 'lifeData', 'lifeCycleSelection')
+          // }
         })
-      }else{
+      } else {
         this.$message.warning('璇风偣鍑诲瓙鑺傜偣');
       }
     },
@@ -312,7 +340,6 @@
       })
     },
     selectFromTable() {
-      console.log('鑾峰彇');
       this.ref.visible = true;
     },
     refOnLoad(domain) {
@@ -335,10 +362,15 @@
     },
     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();
@@ -347,16 +379,19 @@
     },
     businessAdd() {
       this.$refs.btmAdd.showSubmitDialog = true;
+      this.$refs.btmAdd.btmType = {};
+      this.type = 'add';
       this.ifRefreshBtmAddRefresh();
     },
     businessEdit() {
-      if (!this.obj.oid){
+      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;
+      // const json = JSON.stringify(this.obj);
+      // this.$refs.btmAdd.btmType = JSON.parse(json);
+      this.$refs.btmEdit.showSubmitDialog = true;
+      this.type = 'edit'
       this.ifRefreshBtmAddRefresh();
     },
     ifRefreshBtmAddRefresh() {
@@ -366,20 +401,36 @@
 }
 </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 {
+.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 {
+.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>
+
+
+
+//
+//.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