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/task/index.vue |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/src/views/task/index.vue b/src/views/task/index.vue
index 09e97d0..69cb516 100644
--- a/src/views/task/index.vue
+++ b/src/views/task/index.vue
@@ -11,6 +11,11 @@
                     除
                 </el-button>
             </template>
+            <template slot-scope="{row, size}" slot="phone">
+                <el-button :size="size" type="text" @click="showStringDispose(row, 'phoneflag')"
+                    v-text="textDispose(row, 'phoneflag', 'phone')">
+                </el-button>
+            </template>
             <!-- <template slot-scope="scope" slot="menu">
         <el-button type="text" icon="el-icon-circle-plus-outline" size="small"
           @click="taskApply(scope.row)">任务分发
@@ -111,6 +116,7 @@
                         searchLabelWidth: 76,
                         search: true,
                         editDisabled: true,
+                        slot: true
                     },
                     {
                         width: 110,
@@ -195,8 +201,26 @@
             })
             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]
+        },
+
         // 任务派发
         taskApply (row) {
             var that = this
@@ -358,6 +382,7 @@
                 this.page.total = data.total
                 this.data = data.records
                 this.data.forEach(item => {
+                    this.$set(item, 'phoneflag', false)
                     if (item.imageUrls) {
                         if (item.imageUrls.length > 0) {
                             var urls = []

--
Gitblit v1.9.3