From f1f78fbd8e6fe50eb49b3170f1fc58e992a2ba44 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期一, 11 九月 2023 18:01:45 +0800
Subject: [PATCH] 集成日志 内容超出隐藏后双击单元格实现复制功能

---
 Source/UBCS-WEB/package.json                                      |    1 +
 Source/UBCS-WEB/src/views/docking/loge.vue                        |   15 +++++++++++++++
 Source/UBCS-WEB/src/components/dockingSearch/VciDockingSearch.vue |   26 ++++++++++++++------------
 Source/UBCS-WEB/src/main.js                                       |    3 +++
 4 files changed, 33 insertions(+), 12 deletions(-)

diff --git a/Source/UBCS-WEB/package.json b/Source/UBCS-WEB/package.json
index 97c27ce..7a6cde9 100644
--- a/Source/UBCS-WEB/package.json
+++ b/Source/UBCS-WEB/package.json
@@ -29,6 +29,7 @@
     "script-loader": "^0.7.2",
     "vue": "^2.6.10",
     "vue-axios": "^2.1.2",
+    "vue-clipboard2": "^0.3.3",
     "vue-flowchart-editor": "^1.0.2",
     "vue-i18n": "^8.7.0",
     "vue-router": "^3.0.1",
diff --git a/Source/UBCS-WEB/src/components/dockingSearch/VciDockingSearch.vue b/Source/UBCS-WEB/src/components/dockingSearch/VciDockingSearch.vue
index 82411d9..28df3b8 100644
--- a/Source/UBCS-WEB/src/components/dockingSearch/VciDockingSearch.vue
+++ b/Source/UBCS-WEB/src/components/dockingSearch/VciDockingSearch.vue
@@ -45,18 +45,20 @@
   },
   methods:{
     SelectChange(val){
-      if(this.SearchObject.type === 'loge'){
-        if(val === 5){
-          this.typeFlag=true;
-        }else {
-          this.typeFlag=false;
-        }
-        if(val === 6){
-          this.dateFlag=true;
-        }else {
-          this.dateFlag=false;
-        }
-      }
+      this.typeFlag = (this.SearchObject.type === 'loge' && val === 5);
+      this.dateFlag = (this.SearchObject.type === 'loge' && val === 6);
+      // if(this.SearchObject.type === 'loge'){
+      //   if(val === 5){
+      //     this.typeFlag=true;
+      //   }else {
+      //     this.typeFlag=false;
+      //   }
+      //   if(val === 6){
+      //     this.dateFlag=true;
+      //   }else {
+      //     this.dateFlag=false;
+      //   }
+      // }
     },
     SaveHandler(){
       let name = this.SearchObject.searchData[this.formInline.type].prop;
diff --git a/Source/UBCS-WEB/src/main.js b/Source/UBCS-WEB/src/main.js
index 32083d0..ab379e4 100644
--- a/Source/UBCS-WEB/src/main.js
+++ b/Source/UBCS-WEB/src/main.js
@@ -75,6 +75,9 @@
   calcHeight: 65,
   i18n: (key, value) => i18n.t(key, value)
 });
+//澶嶅埗鎻掍欢
+import VueClipboard from 'vue-clipboard2'
+Vue.use( VueClipboard )
 // 娉ㄥ唽鍏ㄥ眬瀹瑰櫒
 Vue.component('basicContainer', basicContainer);
 Vue.component('basicBlock', basicBlock);
diff --git a/Source/UBCS-WEB/src/views/docking/loge.vue b/Source/UBCS-WEB/src/views/docking/loge.vue
index 64d7cce..136ec29 100644
--- a/Source/UBCS-WEB/src/views/docking/loge.vue
+++ b/Source/UBCS-WEB/src/views/docking/loge.vue
@@ -7,6 +7,7 @@
                :page.sync="page"
                :permission="permissionList"
                ref="crud"
+               @cell-dblclick="cellDbClick"
                @search-change="searchChange"
                @search-reset="searchReset"
                @selection-change="selectionChange"
@@ -30,6 +31,7 @@
   name: "loge",
   data(){
     return {
+      value:'',
       SearchObject:{
         type:'loge',
         searchData:[
@@ -201,6 +203,19 @@
     }
   },
   methods: {
+    async cellDbClick(row, column, cell, event) {
+      for (const key in row) {
+        if (key === column.property) {
+          this.value = row[key];
+        }
+      }
+      try {
+        await this.$copyText(this.value);
+        this.$message.success('澶嶅埗鎴愬姛');
+      } catch (error) {
+        this.$message.warning('澶嶅埗澶辫触');
+      }
+    },
     searchReset() {
       this.query = {};
       this.onLoad(this.page);

--
Gitblit v1.9.3