From da6cc144cc4d60805e4693e4adc5ebdf78b5b37d Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期一, 18 九月 2023 16:44:50 +0800
Subject: [PATCH] 集成系统-查询字段修改

---
 Source/UBCS-WEB/src/views/modeling/Business.vue |  231 ++++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 137 insertions(+), 94 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/modeling/Business.vue b/Source/UBCS-WEB/src/views/modeling/Business.vue
index 87d1d21..fbcd5bd 100644
--- a/Source/UBCS-WEB/src/views/modeling/Business.vue
+++ b/Source/UBCS-WEB/src/views/modeling/Business.vue
@@ -1,17 +1,21 @@
 <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;padding:0 8px">
+      <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>
+                <i :class="(node || {}).level === 2 ? 'el-icon-star-off' : 'el-icon-folder-opened'"></i>
                 {{ (node || {}).label }}
               </span>
             </span>
@@ -24,14 +28,16 @@
           <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,18 +45,23 @@
                 {{ 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>
                   鎵�灞為鍩�
                 </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">
@@ -66,26 +77,32 @@
             </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 }}
+                {{ obj.revisionRuleName ? obj.revisionRuleName+ '(' + obj.revisionRuleId + ')' : ''}}
               </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 }}
+                {{ obj.lifeCycleName ? obj.lifeCycleName + '(' + 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>
                   瑙嗗浘
                 </template>
-                {{ obj.viewFlag }}
+                <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">
@@ -94,7 +111,8 @@
             </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>
                   鎻忚堪
@@ -106,22 +124,35 @@
           <!-- 灞炴�у垪琛�-->
           <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"></avue-crud>
+            <avue-crud class="attributeCrud" v-model="obj" :data="obj.attributes" :option="loadOption">
+              <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-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>
-          <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 class="businessCrud" ref="businessCrud" v-model="ref.form" :option="ref.option" :data="ref.data"
+            @selection-change="selectionChange">
           </avue-crud>
+          <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>
-    <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions" :icons="icons" @refreshTable="initTreeOnLoad">
-  </business-add>
+    <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions" :icons="icons"
+      @refreshTable="initTreeOnLoad">
+    </business-add>
   </el-container>
 </template>
 <script>
@@ -146,41 +177,42 @@
       treeOption: {
         defaultExpandAll: true,
         title: '涓氬姟绫诲瀷鏍�',
+        addBtn: false,
+        menu:false,
         props: {
           labelText: '',
-          label: 'name',
+          label: 'label',
           value: 'oid',
           children: 'childList',
         }
       },
-      addOption:{
-        btmType:{},
+      addOption: {
+        btmType: {},
       },
       loadOption: {
         border: true,
-        height: 466,
+        height: 478,
         editBtn: false,
-        index: true,
-        rowKey:'oid',
         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: "榛樿鍊�",
@@ -194,17 +226,22 @@
           }
         ]
       },
+      descriptionOption: {
+        labelStyle: 'text-align:center;width:120px',
+        contentStyle: 'width:240px;text-align:center;word-break;break-all;'
+      },
       domain: null,
       domainOptions: [],
-      icons:{
+      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',
         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鐘舵��
@@ -216,7 +253,7 @@
           headerAlign: 'center',
           border: true,
           index: true,
-          rowKey: 'oid',
+          rowKey: 'id',
           tabs: true,
           addBtn: false,
           menu: false,
@@ -236,10 +273,7 @@
             }
           ]
         },
-        data: [{
-          tableName: '1',
-          description: '2'
-        }]
+        data: [],
       }
     }
   },
@@ -248,44 +282,38 @@
     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) {
-      if(data.oid){
+    nodeClick(data,node,leaf) {
+      if (data.oid) {
         getDetail(data.oid).then(res => {
           this.obj = res.data.data;
         })
+      }else{
+        this.$message.warning('璇风偣鍑诲瓙鑺傜偣');
       }
+    },
+    //  鍩烘湰淇℃伅娣诲姞
+    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() {
       this.ref.visible = true;
@@ -297,7 +325,6 @@
     },
     initTreeOnLoad() {
       initTree().then(res => {
-        console.log('123');
         this.treeData = res.data.data;
       });
     },
@@ -308,29 +335,41 @@
     },
     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;
-      this.$refs.btmAdd.refreshAttrTable();
-      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();
     }
   },
 }
@@ -342,10 +381,14 @@
   border-radius: 10px;
 }
 
-.businessCrud > .el-card:nth-of-type(2) > .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;
+
+.attributeCrud>.el-card:nth-of-type(2)>.el-card__body>.avue-crud__menu {
+  display: none !important;
 }
-</style>
+
+.businessTreeContainer>.el-card>.el-card__body {
+  height: 775px;
+}</style>

--
Gitblit v1.9.3