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/code/Match.vue |  245 +++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 195 insertions(+), 50 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/code/Match.vue b/Source/UBCS-WEB/src/views/code/Match.vue
index c81ff91..4b79c58 100644
--- a/Source/UBCS-WEB/src/views/code/Match.vue
+++ b/Source/UBCS-WEB/src/views/code/Match.vue
@@ -1,36 +1,112 @@
 <template>
-<basic-container>
-  <avue-crud :option="option"
-             :table-loading="loading"
-             :data="data"
-             ref="crud"
-             v-model="form"
-             :page.sync="page"
-             @row-del="rowDel"
-             @row-update="rowUpdate"
-             @row-save="rowSave"
-             @selection-change="selectionChange"
-             @current-change="currentChange"
-             @size-change="sizeChange"
-             @refresh-change="refreshChange"
-             @on-load="onLoad">
-  </avue-crud>
-</basic-container>
+  <basic-container>
+    <avue-crud ref="crud"
+               v-model="form"
+               :data="data"
+               :option="option"
+               :page.sync="page"
+               :table-loading="loading"
+               :permission="permissionList"
+               @row-del="rowDel"
+               @row-update="rowUpdate"
+               @row-save="rowSave"
+               @selection-change="selectionChange"
+               @current-change="currentChange"
+               @size-change="sizeChange"
+               @refresh-change="refreshChange"
+               @on-load="onLoad">
+      <template slot="menuLeft" slot-scope="scope">
+        <el-button icon="el-icon-search"
+                   plain
+                   size="small"
+                   v-if="permissionList.search"
+                   type="primary" @click="searchHandler">鏌� 璇�
+        </el-button>
+        <advanced-query :options="options" :visible.sync="findvisible"
+                        @echoContion="echoContion"></advanced-query>
+        <el-button icon="el-icon-delete"
+                   plain
+                   size="small"
+                   v-if="permissionList.delBtn"
+                   type="danger" @click="deleteHandler">鍒� 闄�
+        </el-button>
+        <el-button icon="el-icon-edit"
+                   plain
+                   size="small"
+                   v-if="permissionList.editBtn"
+                   type="success" @click="editHandler">淇� 鏀�
+        </el-button>
+        <el-button icon="el-icon-refresh-right"
+                   plain
+                   size="small"
+                   v-if="permissionList.breakBtn"
+                   type="primary" @click="onLoad">鍒� 鏂�
+        </el-button>
+      </template>
+    </avue-crud>
+  </basic-container>
 </template>
 
 <script>
-import {getList,add,editSave,deleteData} from "@/api/code/codeMatch";
+import {getList, add, editSave, deleteData} from "@/api/code/codeMatch";
+import {mapGetters} from "vuex";
 export default {
-name: "Match",
-  data(){
-    return{
-      option:{
-        height:700,
-        calcHeight: 80,
+  name: "Match",
+  data() {
+    return {
+      options: [
+        {
+          fieid: 'id',
+          title: '缂栧彿',
+          fieldType: 'text',
+          queryField: 'id'
+        },
+        {
+          fieid: 'name',
+          title: '鍚嶇О',
+          fieldType: 'text',
+          queryField: 'name'
+        },
+        {
+          fieid: 'ignoreallspaceflag',
+          title: '蹇界暐鍏ㄩ儴绌烘牸',
+          fieldType: 'truefalse',
+          queryField: 'ignoreallspaceflag'
+        },
+        {
+          fieid: 'ignorecaseflag',
+          title: '蹇界暐澶у皬鍐�',
+          fieldType: 'truefalse',
+          queryField: 'ignorecaseflag'
+        },
+        {
+          fieid: 'ignorespaceflag',
+          title: '蹇界暐绌烘牸',
+          fieldType: 'truefalse',
+          queryField: 'ignorespaceflag'
+        },
+        {
+          fieid: 'ignorewidthflag',
+          title: '蹇界暐鍏ㄥ崐瑙�',
+          fieldType: 'truefalse',
+          queryField: 'ignorewidthflag'
+        },
+        {
+          fieid: 'linkCharacter',
+          title: '蹇界暐杩炴帴瀛楃',
+          fieldType: 'text',
+          queryField: 'linkCharacter'
+        },
+      ],
+      findvisible: false,
+      selectRow: [],
+      option: {
+        height: 'auto',
+        calcHeight: 20,
         tip: false,
         searchShow: true,
         searchMenuSpan: 6,
-        columnBtn:false,
+        columnBtn: false,
         border: true,
         index: true,
         selection: true,
@@ -68,8 +144,8 @@
               label: '鏄�',
               value: 'true'
             }],
-            formatter:function(row){
-              return row.ignoreallspaceflag ==='true' ? '鏄�' : '鍚�'
+            formatter: function (row) {
+              return row.ignoreallspaceflag === 'true' ? '鏄�' : '鍚�'
             }
           },
           {
@@ -83,8 +159,8 @@
               label: '鏄�',
               value: 'true'
             }],
-            formatter:function(row){
-              return row.ignorecaseflag ==='true' ? '鏄�' : '鍚�'
+            formatter: function (row) {
+              return row.ignorecaseflag === 'true' ? '鏄�' : '鍚�'
             }
           },
           {
@@ -99,8 +175,8 @@
               label: '鏄�',
               value: 'true'
             }],
-            formatter:function(row){
-              return row.ignorespaceflag ==='true' ? '鏄�' : '鍚�'
+            formatter: function (row) {
+              return row.ignorespaceflag === 'true' ? '鏄�' : '鍚�'
             }
           },
           {
@@ -114,8 +190,8 @@
               label: '鏄�',
               value: 'true'
             }],
-            formatter:function(row){
-              return row.ignorewidthflag ==='true' ? '鏄�' : '鍚�'
+            formatter: function (row) {
+              return row.ignorewidthflag === 'true' ? '鏄�' : '鍚�'
             }
           },
           {
@@ -123,26 +199,91 @@
             prop: "linkCharacter",
             type: 'textarea',
             labelWidth: 100,
-            span:24
+            span: 24
 
           }
         ]
       },
-      loading:true,
-      data:[],
-      form:{},
+      loading: true,
+      data: [],
+      form: {},
       page: {
         pageSize: 10,
         currentPage: 1,
         total: 0
       },
-   }
+    }
   },
   created() {
     this.onLoad()
   },
-  methods:{
-    rowDel(row){
+  computed:{
+    ...mapGetters(["permission"]),
+    permissionList(){
+      return{
+        search:this.vaildData(this.permission.match.math_search,false),
+        delBtn:this.vaildData(this.permission.match.math_delete,false),
+        addBtn:this.vaildData(this.permission.match.math_add,false),
+        editBtn:this.vaildData(this.permission.match.math_edit,false),
+        breakBtn:this.vaildData(this.permission.match.math_break,false),
+      }
+    },
+  },
+  methods: {
+    searchHandler() {
+      this.findvisible = true;
+    },
+    echoContion(val) {
+      console.log(...val)
+      // FindData({
+      //   templateOid: this.templateOid,
+      //   codeClassifyOid: this.codeClassifyOid,
+      //   ...val,
+      // }).then((res) => {
+      //   this.tableData = res.data.data;
+      //   this.page.total = res.data.total
+      // });
+    },
+    deleteHandler() {
+      const length = this.selectRow.length;
+      if (length > 1) {
+        this.$message.warning('鍙兘閫夋嫨涓�鏉℃暟鎹紒');
+        return;
+      }
+      if (length <= 0) {
+        this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹�! ');
+        return;
+      }
+      this.$confirm("纭畾灏嗛�夋嫨鏁版嵁鍒犻櫎?", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      })
+        .then(() => {
+          return deleteData(this.selectRow[0])
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "鎿嶄綔鎴愬姛!"
+          });
+        });
+
+    },
+    editHandler() {
+      const length = this.selectRow.length;
+      if (length > 1) {
+        this.$message.warning('鍙兘閫夋嫨涓�鏉℃暟鎹紒');
+        return;
+      }
+      if (length <= 0) {
+        this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹�! ');
+        return;
+      }
+      this.$refs.crud.rowEdit(this.selectRow[0]);
+    },
+    rowDel(row) {
       this.$confirm("纭畾灏嗛�夋嫨鏁版嵁鍒犻櫎?", {
         confirmButtonText: "纭畾",
         cancelButtonText: "鍙栨秷",
@@ -159,7 +300,7 @@
           });
         });
     },
-    rowUpdate(row, index, done, loading){
+    rowUpdate(row, index, done, loading) {
       console.log(row)
       editSave(row).then(() => {
         this.onLoad(this.page);
@@ -186,8 +327,9 @@
         loading();
       });
     },
-    selectionChange(row){
-      console.log(row)
+    selectionChange(row) {
+      // console.log(row)
+      this.selectRow = row;
     },
     currentChange(currentPage) {
       this.page.currentPage = currentPage;
@@ -196,15 +338,18 @@
       this.page.pageSize = pageSize;
     },
     refreshChange() {
-      this.onLoad( this.page.currentPage,this.page.pageSize);
+      this.onLoad(this.page.currentPage, this.page.pageSize);
     },
-    onLoad(page){
-      getList( this.page.currentPage,this.page.pageSize).then(res=>{
-        this.page.total = res.data.total;
-        this.data = res.data.data;
+    onLoad(page) {
+      this.loading = true;
+      getList(this.page.currentPage, this.page.pageSize).then(res => {
+        if (res.data && res.data.data.length > 0) {
+          this.page.total = res.data.total;
+          this.data = res.data.data;
+        }
         this.loading = false;
-      })
-    },
+      });
+    }
   }
 }
 </script>

--
Gitblit v1.9.3