From 37bdbfe57736dda2b2ee368f90ac7e27f26bacda Mon Sep 17 00:00:00 2001
From: zrj <646384940@qq.com>
Date: Fri, 07 Jun 2024 13:55:52 +0800
Subject: [PATCH] 环境api 修改

---
 src/views/task/index.vue |   64 +++++++++++++++++++++----------
 1 files changed, 43 insertions(+), 21 deletions(-)

diff --git a/src/views/task/index.vue b/src/views/task/index.vue
index a31be2e..e3f52e3 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)">任务分发
@@ -25,7 +30,7 @@
 </template>
 
 <script>
-import { getList, remove, update, add, getReportForRepairs } from "@/api/task/reportForRepairs"
+import { getList, remove, update, add, getReportForRepairs } from "@/ssoapi/task/reportForRepairs"
 import { mapGetters } from "vuex"
 import website from '@/config/website'
 
@@ -54,13 +59,16 @@
             datetime: "",
             selectionList: [],
             option: {
+                labelWidth: 120,
+                searchLabelWidth: 66,
+                searchShow: true,
+                searchMenuSpan: 3,
+                menuWidth: 160,
+
                 height: "auto",
                 calcHeight: 54,
                 dialogWidth: 950,
                 tip: false,
-                searchShow: true,
-                searchMenuSpan: 3,
-                menuWidth: 280,
                 border: true,
                 //stripe:true,
                 index: true,
@@ -75,41 +83,40 @@
                     {
                         label: "类型",
                         prop: "type",
-                        span: 12,
+                        span: 24,
                         searchSpan: 4,
                         dataType: "number",
                         type: "select",
                         width: 100,
                         editDisabled: true,
-                        dicUrl: "/api/blade-system/dict-biz/dictionary?code=reportForRepairsType",
+                        dicUrl: "/ssoapi/blade-system/dict-biz/dictionary?code=reportForRepairsType",
                         props: {
                             label: "dictValue",
                             value: "dictKey",
                         },
                         search: true,
-                        span: 15,
+                        searchLabelWidth: 46,
                         row: true,
-                        labelWidth: 110,
                     },
                     {
+                        width: 110,
                         label: "姓名",
                         prop: "realName",
                         span: 12,
                         searchSpan: 4,
-                        width: 100,
                         search: true,
                         editDisabled: true,
-                        labelWidth: 110,
                     },
                     {
+                        width: 120,
                         label: "手机号",
                         prop: "phone",
                         span: 12,
-                        width: 100,
                         searchSpan: 4,
+                        searchLabelWidth: 76,
                         search: true,
                         editDisabled: true,
-                        labelWidth: 110,
+                        slot: true
                     },
                     {
                         width: 110,
@@ -119,7 +126,7 @@
                         listType: "picture-card",
                         dataType: "string",
                         multiple: true,
-                        action: "/api/blade-resource/oss/endpoint/put-file",
+                        action: "/ssoapi/blade-resource/oss/endpoint/put-file",
                         propsHttp: {
                             res: "data",
                             name: 'name',
@@ -127,14 +134,12 @@
                         },
                         span: 24,
                         editDisabled: true,
-                        labelWidth: 110,
                     },
                     {
+                        overHidden: true,
                         label: "上报事发地址",
                         prop: "address",
-                        overHidden: true,
                         editDisabled: true,
-                        labelWidth: 110,
                         span: 24
                     },
                     // {
@@ -143,32 +148,30 @@
                     //   overHidden:true
                     // },
                     {
+                        width: 144,
                         label: "上报时间",
                         prop: "createTime",
-                        width: 160,
                         addDisplay: false,
                         editDisplay: false,
                         type: "date",
                         format: "yyyy-MM-dd HH:mm:ss",
                         valueFormat: "yyyy-MM-dd HH:mm:ss",
                         editDisabled: true,
-                        labelWidth: 110,
                     },
                     {
+                        overHidden: true,
                         label: "描述",
                         prop: "remark",
                         type: "textarea",
                         span: 24,
                         editDisabled: true,
-                        labelWidth: 110,
                     },
                     {
                         label: "接收员",
                         prop: "userIds",
                         type: "tree",
                         hide: true,
-                        labelWidth: 110,
-                        dicUrl: "/api/blade-gridman/gridman/getGridmanList",
+                        dicUrl: "/ssoapi/blade-gridman/gridman/getGridmanList",
                         props: {
                             label: "gridmanName",
                             value: "id",
@@ -198,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
@@ -361,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