From 80b41ff3018d9acdc2f48ce63ada3c0ca4a37b57 Mon Sep 17 00:00:00 2001
From: guanqb <18720758508@163.com>
Date: Tue, 20 Feb 2024 11:47:45 +0800
Subject: [PATCH] 手机号隐藏显示:1.E呼即办2.报事报修3.走访日志4.文章评论4.消防检查记录5.代办事务6.办结事务

---
 src/views/work/todo.vue |   33 ++++++++++++++++++++++++++++++++-
 1 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/src/views/work/todo.vue b/src/views/work/todo.vue
index 88dc91e..6181cc6 100644
--- a/src/views/work/todo.vue
+++ b/src/views/work/todo.vue
@@ -17,6 +17,11 @@
             <template slot-scope="{row, size}" slot="processDefinitionVersion">
                 <el-tag :size="size">v{{ row.processDefinitionVersion }}</el-tag>
             </template>
+            <template slot-scope="{row, size}" slot="linkPhone">
+                <el-button :size="size" type="text" @click="showStringDispose(row, 'linkPhoneflag')"
+                    v-text="textDispose(row, 'linkPhoneflag', 'linkPhone')">
+                </el-button>
+            </template>
         </avue-crud>
         <flow-design is-dialog :is-display.sync="flowBox" :process-instance-id="processInstanceId"></flow-design>
     </basic-container>
@@ -120,6 +125,7 @@
                         label: '联系电话',
                         prop: 'linkPhone',
                         // search: true,
+                        slot: true
                     },
                     {
                         label: '项目名称',
@@ -155,8 +161,25 @@
             })
             return ids.join(",")
         },
+        textDispose () {
+            return (row, flag, type) => {
+                if (row[flag] || row[type] == null) {
+                    return row[type]
+                } else {
+                    if (type == 'principalIdCard') {
+                        return row[type].replace(/^(.{6})(?:\d+)(.{4})$/, "$1******$2")
+                    } else {
+                        return row[type].replace(/^(.{3})(?:\d+)(.{4})$/, "$1****$2")
+                    }
+                }
+            }
+        }
     },
     methods: {
+        showStringDispose (row, type) {
+            row[type] = !row[type]
+        },
+
         searchReset () {
             this.query = {}
             this.onLoad(this.page)
@@ -204,7 +227,15 @@
             }
             this.loading = true
             todoList(page.currentPage, page.pageSize, Object.assign(params, query)).then(res => {
-                const data = res.data.data
+                const data = {
+                    ...res.data.data,
+                    records: res.data.data.records.map(item => {
+                        return {
+                            ...item,
+                            'linkPhoneflag': false
+                        }
+                    })
+                }
                 this.page.total = data.total
                 this.data = data.records
                 this.loading = false

--
Gitblit v1.9.3