From 4baa142fd3e19aad5d65082f58e782309b707637 Mon Sep 17 00:00:00 2001
From: lihang <lihang@vci-tech.com>
Date: 星期三, 05 七月 2023 18:39:41 +0800
Subject: [PATCH] 对象建模部分页面bug修正

---
 Source/UBCS-WEB/src/views/modeling/original.vue    |    6 +++---
 Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue |   48 ++++++++++++++++++++++++++++++++++--------------
 Source/UBCS-WEB/src/views/modeling/LinkTypeAdd.vue |    2 +-
 Source/UBCS-WEB/src/views/modeling/Version.vue     |    3 ++-
 4 files changed, 40 insertions(+), 19 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue b/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue
index 7e4f639..38699eb 100644
--- a/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue
+++ b/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue
@@ -53,16 +53,18 @@
         <avue-crud :option="option"
         :data="btmType.attributes"
         :page.sync="page"
-        ref="attrTable"
-        @cell-mouse-enter="cellEditClick"
-        @cell-mouse-leave="cellEditSave">
+        ref="attrTable">
             <template slot-scope="scope" slot="menuLeft">
                 <el-button type="danger"
                 icon="el-icon-plus"
                 size="small"
                 @click="rowAdd()">灞炴�ч�夋嫨</el-button>
             </template>
-
+          <template slot="menu" slot-scope="{row,index}">
+            <el-button icon="el-icon-edit" size="small" type="text" v-if="!row.$cellEdit" @click="cellEditClick(row)">缂栬緫</el-button>
+            <el-button icon="el-icon-delete" size="small" type="text" v-if="!row.$cellEdit" @click="removeFormAttrTable(row,index)">绉婚櫎</el-button>
+            <el-button icon="el-icon-check" size="small" type="text" v-if="row.$cellEdit" @click="cellEditSave(row,index)">淇濆瓨</el-button>
+          </template>
         </avue-crud>
         <div slot="footer" class="dialog-footer">
             <el-button type="primary" @click="submitBtmType">纭畾</el-button>
@@ -83,7 +85,8 @@
             ref="attrRef"
             @on-load="attrRefOnLoad"
             @search-change="attrRefSearch"
-            @selection-change="selectionChange">
+            @selection-change="selectionChange"
+            v-loading="attrRef.loading">
                 <template slot="typeValue" slot-scope="scope" >
                     <el-tag>{{scope.row.typeValue}}</el-tag>
                 </template>
@@ -145,13 +148,16 @@
             showSubmitDialog : false,
             option: {
                 height: "330px",
-                selection: true,
+                selection: false,
                 headerAlign: 'center',
                 border: true,
                 index: true,
                 rowKey: 'id',
                 tabs: true,
-                menu: false,
+                menu: true,
+                editBtn: false,
+                delBtn: false,
+                menuWidth: 150,
                 addBtn:false,
                 highlightCurrentRow: true,
                 column: [
@@ -191,6 +197,7 @@
                     currentPage:1,
                     pageSize:10,
                 },
+                loading: false,
                 key: null,
                 option:{
                     height: 360,
@@ -251,7 +258,7 @@
                     ]
                 },
                 data: [],
-                queryNotIn: null
+                queryNotIn: ''
             },
             revisionRef: {
                 visible: false,
@@ -345,18 +352,22 @@
         closeAttrDialog(){
             this.attrRef.visible = false;
         },
-        // 娣诲姞
-        rowAdd(){
+        // 灞炴�ч�夋嫨娣诲姞
+        async rowAdd() {
+            await this.attrRefOnLoad();
             this.attrRef.visible = true;
-            this.attrRefOnLoad();
         },
         // 灞炴�ф睜鍔犺浇
         attrRefOnLoad(){
+            this.attrRef.loading = true;
             queryPage(this.attrRef.key,this.attrRef.queryNotIn,this.attrRef.page.currentPage, this.attrRef.page.pageSize).then(res => {
                 const data = res.data.data;
                 this.attrRef.page.total = data.total;
                 this.attrRef.data = data.records;
             });
+            setTimeout(() => {
+              this.attrRef.loading = false;
+            },600)
             this.$nextTick(() => {
                 this.$refs.attrRef.refreshTable();
             });
@@ -368,16 +379,23 @@
             done();
             this.attrRef.key = null;
         },
+        // 浠庡睘鎬ф睜涓Щ闄�
+        removeFormAttrTable(row,index){
+          this.btmType.attributes.splice(index,1);
+          this.attrRef.queryNotIn = "";
+          this.btmType.attributes.forEach(item => {
+            this.attrRef.queryNotIn += (item.id + ",")
+          })
+        },
         // 灞炴�ф睜鍕鹃�変簨浠�
         selectionChange(list){
             this.attrRef.selectData = list;
         },
         // 纭灞炴�ф睜鍕鹃��
         confirmSelectAttr(){
-            if(!this.btmType.attributes){
-                this.btmType.attributes = [];
+            if(!this.btmType.attributes) {
+              this.btmType.attributes = [];
             }
-            this.attrRef.queryNotIn = "";
             this.attrRef.selectData.forEach(item => {
                 this.btmType.attributes.push({
                     id: item.id,
@@ -395,6 +413,7 @@
                 });
                 this.attrRef.queryNotIn += (item.id + ",")
             });
+            this.attrRef.data = [];
             this.closeAttrDialog();
         },
         // 鍙栨秷灞炴�ф睜鍕鹃��
@@ -430,6 +449,7 @@
         },
         // 鍒楄〃缂栬緫
         cellEditClick(cell){
+          console.log(cell);
             cell.$cellEdit = true;
         },
         // 鍒楄〃缂栬緫淇濆瓨
diff --git a/Source/UBCS-WEB/src/views/modeling/LinkTypeAdd.vue b/Source/UBCS-WEB/src/views/modeling/LinkTypeAdd.vue
index 4f1ea88..050c526 100644
--- a/Source/UBCS-WEB/src/views/modeling/LinkTypeAdd.vue
+++ b/Source/UBCS-WEB/src/views/modeling/LinkTypeAdd.vue
@@ -315,7 +315,7 @@
                 this.$refs.attrTable.refreshTable();
             })
         },
-        // 
+        //
         viewChange() {
 
         },
diff --git a/Source/UBCS-WEB/src/views/modeling/Version.vue b/Source/UBCS-WEB/src/views/modeling/Version.vue
index 2aaa39c..f1fc3ae 100644
--- a/Source/UBCS-WEB/src/views/modeling/Version.vue
+++ b/Source/UBCS-WEB/src/views/modeling/Version.vue
@@ -75,6 +75,7 @@
           {
             label:'鑻辨枃鍚嶇О',
             prop: 'id',
+            editDisabled: true,
             rules: [
               {
                 required: true,
@@ -211,7 +212,7 @@
         this.data = data.records;
       });
       if (done) {
-       done(); 
+       done();
       }
     },
     refreshChange() {
diff --git a/Source/UBCS-WEB/src/views/modeling/original.vue b/Source/UBCS-WEB/src/views/modeling/original.vue
index 6588c67..73f81c0 100644
--- a/Source/UBCS-WEB/src/views/modeling/original.vue
+++ b/Source/UBCS-WEB/src/views/modeling/original.vue
@@ -17,7 +17,7 @@
             </el-button>
             <el-button size="small" plain type="primary" icon="el-icon-zoom-in" @click="applyRangeOpen">鏌ョ湅浣跨敤鑼冨洿
             </el-button>
-            <el-input placeholder="鎸夊睘鎬ц嫳鏂囧悕绉版煡璇�" v-model="searchId" clearable prefix-icon="el-icon-search" class="attrSearch"
+            <el-input placeholder="鎸夊睘鎬х紪鍙锋煡璇�" v-model="searchId" clearable prefix-icon="el-icon-search" class="attrSearch"
               size="small" @change="doSearch" type="text"></el-input>
             <el-button size="small" plain type="primary" icon="el-icon-search" @click="doSearch">&nbsp;鎼滅储</el-button>
           </template>
@@ -279,14 +279,14 @@
       this.$refs.originalAdd.activeName = this.itemForm.activeName;
       this.$refs.originalAdd.enumInitFlag = this.itemForm.enumInitFlag;
       this.$refs.originalAdd.referInitFlag = this.itemForm.referInitFlag;
-      this.refreshChange()
+      // this.refreshChange()
     },
     deleteSave(row,index) {
       console.log(row);
       remove(row.oid).then(res => {
         this.$message.success("鍒犻櫎鎴愬姛");
+        this.refreshChange();
       });
-      this.refreshChange();
     },
     onLoad(page, params = {}) {
       this.loading = true;

--
Gitblit v1.9.3