From 8e357feadbb4720b99a3ab485e73cb72b66ea3ad Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Sat, 23 Dec 2023 11:37:24 +0800
Subject: [PATCH] 小区、住户、房屋、场所等页面调整,皮肤更换功能隐藏

---
 src/views/userHouse/houseList.vue     |  193 +++++++++++++++-
 src/api/userHouse/list/house.js       |    4 
 src/page/index/top/index.vue          |    6 
 src/views/place/index.vue             |  197 +++++++++++------
 src/views/userHouse/houseHoldList.vue |   71 +++---
 src/views/cGovernance/punchCard.vue   |   32 ++
 src/views/district/index.vue          |   99 +++++---
 7 files changed, 424 insertions(+), 178 deletions(-)

diff --git a/src/api/userHouse/list/house.js b/src/api/userHouse/list/house.js
index d040707..f2013dc 100644
--- a/src/api/userHouse/list/house.js
+++ b/src/api/userHouse/list/house.js
@@ -36,7 +36,7 @@
 
 export const add = (row) => {
   return request({
-    url: '/api/blade-house/house/submit',
+    url: '/api/blade-house/house/saveOrUpdateHouse',
     method: 'post',
     data: row
   })
@@ -52,7 +52,7 @@
 
 export const getDetatil = (params) => {
   return request({
-    url: '/api/blade-house/house/detail',
+    url: '/api/blade-house/house/getHouseDetail',
     method: 'get',
     params: params
   })
diff --git a/src/page/index/top/index.vue b/src/page/index/top/index.vue
index a9c377e..a2bc11f 100644
--- a/src/page/index/top/index.vue
+++ b/src/page/index/top/index.vue
@@ -43,11 +43,11 @@
                     <i style="font-size: 18px;" class="el-icon-search" @click="searchShow = !searchShow"></i>
                 </div>
             </el-tooltip>
-            <el-tooltip v-if="showTheme" effect="dark" :content="$t('navbar.theme')" placement="bottom">
+            <!-- <el-tooltip v-if="showTheme" effect="dark" :content="$t('navbar.theme')" placement="bottom">
                 <div class="top-bar__item top-bar__item--show">
                     <top-theme></top-theme>
                 </div>
-            </el-tooltip>
+            </el-tooltip> -->
             <el-tooltip effect="dark" :content="$t('navbar.notice')" placement="bottom">
                 <div class="top-bar__item top-bar__item--show">
                     <top-notice></top-notice>
@@ -94,6 +94,7 @@
     </div>
 </template>
 <script>
+import { setTheme } from "@/util/util"
 import { resetRouter } from '@/router/router'
 import { mapGetters, mapState } from "vuex"
 import { fullscreenToggel, listenfullscreen } from "@/util/util"
@@ -172,6 +173,7 @@
     },
     filters: {},
     created () {
+        setTheme('theme-white')
     },
     mounted () {
         listenfullscreen(this.setScreen)
diff --git a/src/views/cGovernance/punchCard.vue b/src/views/cGovernance/punchCard.vue
index e25a82a..46d0315 100644
--- a/src/views/cGovernance/punchCard.vue
+++ b/src/views/cGovernance/punchCard.vue
@@ -45,9 +45,30 @@
                 dialogClickModal: false,
                 column: [
                     {
+                        width: 96,
                         label: "打卡人员",
                         prop: "name",
-                        search: true
+                        search: true,
+                        searchSpan: 4
+                    },
+                    {
+                        label: "打卡时间",
+                        prop: "dateTime",
+                        type: "daterange",
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd",
+                        searchSpan: 5,
+                        searchRange: true,
+                        hide: true,
+                        addDisplay: false,
+                        editDisplay: false,
+                        viewDisplay: false,
+                        search: true,
+                        rules: [{
+                            required: true,
+                            message: "请选择发布时间",
+                            trigger: "blur",
+                        },],
                     },
                     {
                         label: "打卡时间",
@@ -151,6 +172,15 @@
         onLoad (page, params = {}) {
             this.loading = true
 
+            const { dateTime } = this.query
+
+            if (dateTime) {
+                this.query = {
+                    startTime: dateTime[0],
+                    endTime: dateTime[1],
+                }
+            }
+
             getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
                 const data = res.data.data
                 this.page.total = data.total
diff --git a/src/views/district/index.vue b/src/views/district/index.vue
index 66d5cd9..c4f0139 100644
--- a/src/views/district/index.vue
+++ b/src/views/district/index.vue
@@ -50,7 +50,7 @@
                         parent: false,
                         label: "小区名称",
                         prop: "name",
-                        searchSpan: 5,
+                        searchSpan: 4,
                         search: true,
                         type: 'tree',
                         dicUrl: `/api/blade-district/district/getDistrictTree`,
@@ -70,6 +70,51 @@
                                 trigger: "blur",
                             },
                         ],
+                    },
+
+
+                    {
+                        parent: false,
+                        addDisplay: false,
+                        editDisplay: false,
+                        viewDisplay: false,
+                        width: 96,
+                        label: "所属街道",
+                        prop: "townStreetName",
+                        search: true,
+                        searchSpan: 4
+                    },
+
+                    {
+                        parent: false,
+                        label: "所属社区",
+                        prop: "communityCode",
+                        search: true,
+                        searchSpan: 4,
+                        searchType: 'input',
+                        width: 150,
+                        type: "tree",
+                        dicUrl: "/api/blade-system/region/tree",
+                        props: {
+                            label: "name",
+                            value: "id"
+                        },
+                        rules: [
+                            {
+                                required: true,
+                                message: "请选择所属社区",
+                                trigger: "blur",
+                            },
+                        ],
+                    },
+
+                    {
+                        addDisplay: false,
+                        editDisplay: false,
+                        viewDisplay: false,
+                        width: 96,
+                        label: "所属网格",
+                        prop: "gridName",
                     },
 
                     {
@@ -100,45 +145,6 @@
                         hide: true,
                         minRows: 6,
                         span: 24,
-                    },
-
-                    {
-                        addDisplay: false,
-                        editDisplay: false,
-                        viewDisplay: false,
-                        width: 96,
-                        label: "所属街道",
-                        prop: "townStreetName",
-                    },
-
-                    {
-                        label: "所属社区",
-                        prop: "communityCode",
-                        search: true,
-                        searchSpan: 4,
-                        width: 150,
-                        type: "tree",
-                        dicUrl: "/api/blade-system/region/tree",
-                        props: {
-                            label: "name",
-                            value: "id"
-                        },
-                        rules: [
-                            {
-                                required: true,
-                                message: "请选择所属社区",
-                                trigger: "blur",
-                            },
-                        ],
-                    },
-
-                    {
-                        addDisplay: false,
-                        editDisplay: false,
-                        viewDisplay: false,
-                        width: 96,
-                        label: "所属网格",
-                        prop: "gridName",
                     },
 
                     {
@@ -313,10 +319,11 @@
             this.onLoad(this.page, this.query)
         },
         onLoad (page, params = {}) {
-            const { dateTime } = this.query
+            const { dateTime, communityCode } = this.query
             let values = {
                 ...params,
             }
+
             if (dateTime) {
                 values = {
                     ...params,
@@ -326,6 +333,16 @@
                 }
                 values.dateTime = null
             }
+
+            if (communityCode) {
+                values = {
+                    ...values,
+                    communityName: communityCode
+                }
+
+                delete values.communityCode
+            }
+
             this.loading = true
             getList(page.currentPage, page.pageSize, values).then((res) => {
                 const data = res.data.data
diff --git a/src/views/place/index.vue b/src/views/place/index.vue
index 555f94d..335cbf2 100644
--- a/src/views/place/index.vue
+++ b/src/views/place/index.vue
@@ -77,20 +77,6 @@
                 {
                     label: '场所位置',
                     prop: 'localtion'
-                }, {
-                    label: '审核状态',
-                    prop: 'confirmFlag',
-                    type: 'radio',
-                    dicData: [{
-                        label: '待审核',
-                        value: 0
-                    }, {
-                        label: '审核通过',
-                        value: 1
-                    }, {
-                        label: '审核不通过',
-                        value: 2
-                    }]
                 }
                 ]
             },
@@ -170,6 +156,92 @@
                             trigger: "blur",
                         },],
                     },
+                    {
+                        addDisplay: false,
+                        editDisplay: false,
+                        viewDisplay: false,
+                        width: 96,
+                        label: "所属街道",
+                        prop: "townStreetName",
+                        search: true,
+                        searchSpan: 4
+                    },
+                    {
+                        addDisplay: false,
+                        editDisplay: false,
+                        viewDisplay: false,
+                        label: "所属社区",
+                        prop: "neiName",
+                        search: true,
+                        searchSpan: 4,
+                        width: 150,
+                        rules: [
+                            {
+                                required: true,
+                                message: "请选择所属社区",
+                                trigger: "blur",
+                            },
+                        ],
+                    },
+                    {
+                        hide: true,
+                        label: "所属社区",
+                        prop: "neiCode",
+                        search: false,
+                        width: 150,
+                        type: "tree",
+                        dicUrl: "/api/blade-system/region/tree",
+                        props: {
+                            label: "name",
+                            value: "id",
+                        },
+                        parent: false,
+                        cascader: ["gridId"],
+                        rules: [
+                            {
+                                required: true,
+                                message: "请选择所属社区",
+                                trigger: "blur",
+                            },
+                        ],
+                    },
+
+                    {
+                        addDisplay: false,
+                        editDisplay: false,
+                        viewDisplay: false,
+                        label: "所属网格",
+                        prop: "gridName",
+                        width: 150,
+                        rules: [
+                            {
+                                required: true,
+                                message: "请选择所属网格",
+                                trigger: "blur",
+                            },
+                        ],
+                    },
+
+                    {
+                        hide: true,
+                        label: "所属网格",
+                        prop: "gridId",
+                        type: "tree",
+                        cell: true,
+                        props: {
+                            label: "gridName",
+                            value: "id",
+                        },
+                        dicUrl:
+                            "/api/blade-grid/grid/getGridList?communityCode={{neiCode}}",
+                        rules: [
+                            {
+                                required: true,
+                                message: "请选择所属网格",
+                                trigger: "blur",
+                            },
+                        ],
+                    },
 
                     {
                         label: "场所标签",
@@ -204,33 +276,14 @@
                     },
 
                     {
-                        label: "联系电话",
+                        width: 110,
+                        label: "电话",
                         prop: "principalPhone",
-                        searchSpan: 4,
                         search: true,
-                        rules: [{
-                            required: false,
-                            message: "请输入联系电话",
-                            trigger: "blur",
-                        },],
+                        searchSpan: 4,
+                        slot: true,
                     },
 
-                    {
-                        label: "审核状态",
-                        prop: "confirmFlag",
-                        searchSpan: 4,
-                        search: true,
-                        dicData: [{
-                            label: '待审核',
-                            value: 0,
-                        }, {
-                            label: '审核通过',
-                            value: 1,
-                        }, {
-                            label: '审核不通过',
-                            value: 2,
-                        }],
-                    },
                     {
                         label: "场所照片",
                         prop: "imageUrls",
@@ -249,41 +302,34 @@
                     },
 
                     {
-                        addDisplay: false,
-                        editDisplay: false,
-                        viewDisplay: false,
-                        width: 96,
-                        label: "所属街道",
-                        prop: "townStreetName",
-                    },
-                    {
-                        addDisplay: false,
-                        editDisplay: false,
-                        viewDisplay: false,
-                        width: 160,
-                        label: "所属社区",
-                        prop: "neiName",
-                    },
-                    {
-                        addDisplay: false,
-                        editDisplay: false,
-                        viewDisplay: false,
-                        width: 96,
-                        label: "所属网格",
-                        prop: "gridName",
-                    },
-
-                    {
                         label: "位置",
                         prop: "localtion",
                         span: 24,
                         minWidth: 220,
                         overHidden: true,
-                        rules: [{
-                            required: true,
-                            message: "请输入区域",
-                            trigger: "blur",
-                        },],
+                        // rules: [{
+                        //     required: true,
+                        //     message: "请输入区域",
+                        //     trigger: "blur",
+                        // },],
+                    },
+                    {
+                        addDisplay: false,
+                        editDisplay: false,
+                        viewDisplay: false,
+                        label: '审核状态',
+                        prop: 'confirmFlag',
+                        type: 'radio',
+                        dicData: [{
+                            label: '待审核',
+                            value: 0
+                        }, {
+                            label: '审核通过',
+                            value: 1
+                        }, {
+                            label: '审核不通过',
+                            value: 2
+                        }]
                     }
                 ],
             },
@@ -357,7 +403,6 @@
         },
 
         rowSave (row, done, loading) {
-            console.log(row, 9999)
             if (row.imageUrls.length > 0) {
                 var urls = []
                 var split = row.imageUrls.split(",")
@@ -489,14 +534,16 @@
                             this.form.imageUrls = urls.join(",")
                         }
                     }
-                    if (this.form.placePoiLabelVOList) {
-                        var arr = []
-                        this.form.placePoiLabelVOList.forEach(item => {
-                            arr.push(item.poiCode)
-                        })
-                        this.form.label = arr.join(",")
+
+                    if (this.form.placePoiLabelVOList.length) {
+                        this.form.label = this.form.placePoiLabelVOList.find(item => {
+                            return item.type == 2
+                        }).poiCode
+
+                        this.form.smallLabel = this.form.placePoiLabelVOList.find(item => {
+                            return item.type == 3
+                        }).poiCode
                     }
-                    console.log(this.form, 888888)
                 })
             }
             // con
diff --git a/src/views/userHouse/houseHoldList.vue b/src/views/userHouse/houseHoldList.vue
index 4f2c580..e93ed36 100644
--- a/src/views/userHouse/houseHoldList.vue
+++ b/src/views/userHouse/houseHoldList.vue
@@ -149,7 +149,7 @@
 import { lintOnSave } from "../../../vue.config"
 
 export default {
-    data() {
+    data () {
         return {
             labelData: [],
             form: {},
@@ -170,7 +170,7 @@
                 calcHeight: 80,
                 tip: false,
                 searchShow: true,
-                searchMenuSpan: 6,
+                searchMenuSpan: 3,
                 border: true,
                 index: true,
                 selection: true,
@@ -187,15 +187,14 @@
                         prop: "name",
                         labelWidth: 120,
                         search: true,
-                        searchSpan: 4,
+                        searchSpan: 3,
                     },
                     {
-                        width: 106,
+                        width: 110,
                         label: "电话",
                         prop: "phoneNumber",
-                        labelWidth: 120,
                         search: true,
-                        searchSpan: 4,
+                        searchSpan: 3,
                         slot: true,
                     },
                     {
@@ -267,6 +266,8 @@
                         width: 96,
                         label: "所属街道",
                         prop: "townStreetName",
+                        search: true,
+                        searchSpan: 4
                     },
                     {
                         addDisplay: false,
@@ -275,6 +276,8 @@
                         width: 160,
                         label: "所属社区",
                         prop: "neiName",
+                        search: true,
+                        searchSpan: 4
                     },
                     {
                         addDisplay: false,
@@ -323,12 +326,6 @@
                             label: "dictValue",
                             value: "dictKey",
                         },
-                    },
-                    {
-                        label: "身份证号",
-                        prop: "idCard",
-                        labelWidth: 120,
-                        hide: true,
                     },
                     {
                         label: "生日",
@@ -534,7 +531,7 @@
     watch: {},
     computed: {
         ...mapGetters(["userInfo", "permission"]),
-        permissionList() {
+        permissionList () {
             return {
                 addBtn: this.vaildData(this.permission.household_add, false),
                 viewBtn: this.vaildData(this.permission.household_view, true),
@@ -543,7 +540,7 @@
             }
         },
 
-        textDispose() {
+        textDispose () {
             return (row, flag, type) => {
                 if (row[flag] || row[type] == null) {
                     return row[type]
@@ -557,15 +554,15 @@
             }
         },
 
-        labelDispose() {
+        labelDispose () {
             return (list) => {
                 return list.map(item => item.labelName).join(',')
             }
         }
     },
-    mounted() { },
+    mounted () { },
     methods: {
-        onsubmit() {
+        onsubmit () {
             if (this.labelForm.color === '#EBEDF0') {
                 let params = {
                     householdId: this.currentRow.id,
@@ -602,13 +599,13 @@
             }
         },
 
-        changLabel(item) {
+        changLabel (item) {
             this.editLabelFlge = true
             this.currentLabel = item
             this.labelForm.color = item.color
             this.labelForm.remark = item.remark
         },
-        manageLabel(item) {
+        manageLabel (item) {
             this.currentRow = item
             this.loading = true
             this.labelFlag = true
@@ -640,7 +637,7 @@
                 })
             })
         },
-        rowSave(row, done, loading) {
+        rowSave (row, done, loading) {
             add(row).then(() => {
                 this.initFlag = false
                 this.onLoad(this.page)
@@ -654,7 +651,7 @@
                 loading()
             })
         },
-        rowUpdate(row, index, done, loading) {
+        rowUpdate (row, index, done, loading) {
             update(row).then(() => {
                 this.initFlag = false
                 this.onLoad(this.page)
@@ -668,7 +665,7 @@
                 loading()
             })
         },
-        rowDel(row) {
+        rowDel (row) {
             this.$confirm("确定将选择数据删除?", {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消",
@@ -685,25 +682,25 @@
                     })
                 })
         },
-        searchReset() {
+        searchReset () {
             this.query = {}
             this.treeDeptId = ''
             this.onLoad(this.page)
         },
-        searchChange(params, done) {
+        searchChange (params, done) {
             this.query = params
             this.page.currentPage = 1
             this.onLoad(this.page, params)
             done()
         },
-        selectionChange(list) {
+        selectionChange (list) {
             this.selectionList = list
         },
-        selectionClear() {
+        selectionClear () {
             this.selectionList = []
             // this.$refs.crud.toggleSelection();
         },
-        handleDelete() {
+        handleDelete () {
             if (this.selectionList.length === 0) {
                 this.$message.warning("请选择至少一条数据")
                 return
@@ -725,16 +722,16 @@
                     this.$refs.crud.toggleSelection()
                 })
         },
-        handleImport() {
+        handleImport () {
             this.excelBox = true
         },
-        uploadAfter(res, done, loading, column) {
+        uploadAfter (res, done, loading, column) {
             window.console.log(column)
             this.excelBox = false
             this.refreshChange()
             done()
         },
-        handleExport() {
+        handleExport () {
             this.$confirm("是否导出住户数据?", "提示", {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消",
@@ -753,12 +750,12 @@
                 })
             })
         },
-        handleTemplate() {
+        handleTemplate () {
             exportBlob(`/api/blade-system/user/export-template?${this.website.tokenHeader}=${getToken()}`).then(res => {
                 downloadXls(res.data, "住户数据模板.xlsx")
             })
         },
-        beforeOpen(done, type) {
+        beforeOpen (done, type) {
             if (["edit", "view"].includes(type)) {
                 getDetatil(this.form.id).then(res => {
                     this.form = res.data.data
@@ -767,17 +764,17 @@
             this.initFlag = true
             done()
         },
-        currentChange(currentPage) {
+        currentChange (currentPage) {
             this.page.currentPage = currentPage
         },
-        sizeChange(pageSize) {
+        sizeChange (pageSize) {
             this.page.pageSize = pageSize
         },
-        refreshChange() {
+        refreshChange () {
             this.onLoad(this.page, this.query)
         },
 
-        onLoad(page, params = {}) {
+        onLoad (page, params = {}) {
             this.loading = true
             getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
                 const data = {
@@ -798,7 +795,7 @@
             })
         },
 
-        showStringDispose(row, type) {
+        showStringDispose (row, type) {
             row[type] = !row[type]
         }
     }
diff --git a/src/views/userHouse/houseList.vue b/src/views/userHouse/houseList.vue
index 587102b..7140834 100644
--- a/src/views/userHouse/houseList.vue
+++ b/src/views/userHouse/houseList.vue
@@ -40,6 +40,12 @@
                         <el-tag>{{ row.userTypeName }}</el-tag>
                     </template>
 
+                    <template slot-scope="{row}" slot="phone">
+                        <el-button type="text" @click="showStringDispose(row, 'phoneflag')">
+                            {{ textDispose(row, 'phoneflag', 'phone') }}
+                        </el-button>
+                    </template>
+
                     <template slot-scope="{row}" slot="userHouseLabelVOList">
                         {{ labelDispose(row.userHouseLabelVOList) }}
                     </template>
@@ -58,8 +64,8 @@
 
                 <el-dialog title="标签管理" append-to-body :visible.sync="labelFlag" center width="600px">
                     <div id="" class="grid-container2">
-                        <div class="grid-item" :style="{ backgroundColor: item.color }" v-for="(item, index) in labelData "
-                            @click="changLabel(item)">
+                        <div class="grid-item" :style="{ backgroundColor: item.color }" v-for="(item, index) in labelData"
+                            :key="index" @click="changLabel(item)">
                             {{ item.name }}
                         </div>
                     </div>
@@ -196,7 +202,7 @@
                 calcHeight: 80,
                 tip: false,
                 searchShow: true,
-                searchMenuSpan: 6,
+                searchMenuSpan: 3,
                 border: true,
                 index: true,
                 selection: true,
@@ -218,17 +224,25 @@
                         width: 180,
                         display: false
                     },
+
                     {
-                        width: 132,
-                        label: "小区",
+                        parent: false,
+                        label: "小区名称",
                         prop: "districtName",
+                        searchSpan: 4,
                         search: true,
-                        rules: [{
-                            required: true,
-                            message: "请选择小区",
-                            trigger: "blur",
-                        },],
+                        type: 'tree',
+                        dicUrl: `/api/blade-district/district/getDistrictTree`,
+                        props: {
+                            label: "name",
+                            value: "id"
+                        },
+                        defaultExpandedKeys: ["361102003"],
+                        span: 12,
+                        width: 220,
+                        overHidden: true,
                     },
+
                     {
                         addDisplay: false,
                         editDisplay: false,
@@ -236,7 +250,10 @@
                         width: 96,
                         label: "所属街道",
                         prop: "townStreetName",
+                        search: true,
+                        searchSpan: 4
                     },
+
                     {
                         addDisplay: false,
                         editDisplay: false,
@@ -244,7 +261,38 @@
                         width: 160,
                         label: "所属社区",
                         prop: "neiName",
+                        search: true,
+                        searchSpan: 4,
+                        rules: [{
+                            required: true,
+                            message: "请选择所属社区",
+                            trigger: "blur",
+                        }],
                     },
+
+                    {
+                        hide: true,
+                        label: "所属社区",
+                        prop: "neiCode",
+                        search: false,
+                        width: 150,
+                        type: "tree",
+                        dicUrl: "/api/blade-system/region/tree",
+                        props: {
+                            label: "name",
+                            value: "id",
+                        },
+                        parent: false,
+                        cascader: ["gridId"],
+                        rules: [
+                            {
+                                required: true,
+                                message: "请选择所属社区",
+                                trigger: "blur",
+                            },
+                        ],
+                    },
+
                     {
                         addDisplay: false,
                         editDisplay: false,
@@ -252,30 +300,68 @@
                         width: 96,
                         label: "所属网格",
                         prop: "gridName",
-                    },
-                    {
-                        label: "手机",
-                        prop: "phone",
                         rules: [{
                             required: true,
-                            message: "请输入绑定手机",
+                            message: "请选择所属网格",
                             trigger: "blur",
-                        },],
+                        }],
+                    },
+
+                    {
+                        hide: true,
+                        label: "所属网格",
+                        prop: "gridId",
+                        type: "tree",
+                        cell: true,
+                        props: {
+                            label: "gridName",
+                            value: "id",
+                        },
+                        dicUrl:
+                            "/api/blade-grid/grid/getGridList?communityCode={{neiCode}}",
+                        rules: [
+                            {
+                                required: true,
+                                message: "请选择所属网格",
+                                trigger: "blur",
+                            },
+                        ],
+                    },
+
+                    {
+                        label: "房屋照片",
+                        prop: "imageUrls",
+                        width: 80,
+                        type: "upload",
+                        listType: "picture-card",
+                        dataType: "string",
+                        multiple: true,
+                        action: "/api/blade-resource/oss/endpoint/put-file",
+                        propsHttp: {
+                            res: "data",
+                            name: 'name',
+                            url: "link",
+                        },
+                        span: 24,
+                    },
+
+                    {
+                        width: 110,
+                        label: "电话",
+                        prop: "phone",
+                        slot: true,
                     },
                     {
                         label: "幢",
                         prop: "building",
-                        hide: true
                     },
                     {
                         label: "单元",
                         prop: "unit",
-                        hide: true
                     },
                     {
                         label: "室",
                         prop: "room",
-                        hide: true
                     },
                     {
                         label: "楼层",
@@ -375,6 +461,20 @@
             }
         },
 
+        textDispose () {
+            return (row, flag, type) => {
+                if (row[flag] || row[type] == null) {
+                    return row[type]
+                } else {
+                    if (type == 'idCard') {
+                        return row[type].replace(/^(.{6})(?:\d+)(.{4})$/, "$1******$2")
+                    } else {
+                        return row[type].replace(/^(.{3})(?:\d+)(.{4})$/, "$1****$2")
+                    }
+                }
+            }
+        },
+
         labelDispose () {
             return (list) => {
                 return list.map(item => item.labelName).join(',')
@@ -463,6 +563,16 @@
             })
         },
         rowSave (row, done, loading) {
+            if (row.imageUrls.length > 0) {
+                var urls = []
+                var split = row.imageUrls.split(",")
+                split.forEach(url => {
+                    var names = url.split("jczz/")
+                    urls.push(names[1])
+                })
+                row.imageUrls = urls.join(",")
+            }
+
             add(row).then(() => {
                 this.initFlag = false
                 this.onLoad(this.page)
@@ -477,6 +587,16 @@
             })
         },
         rowUpdate (row, index, done, loading) {
+            if (row.imageUrls.length > 0) {
+                var urls = []
+                var split = row.imageUrls.split(",")
+                split.forEach(url => {
+                    var names = url.split("jczz/")
+                    urls.push(names[1])
+                })
+                row.imageUrls = urls.join(",")
+            }
+
             update(row).then(() => {
                 this.initFlag = false
                 this.onLoad(this.page)
@@ -586,6 +706,17 @@
                     id: this.form.id
                 }).then(res => {
                     this.form = res.data.data
+
+                    if (this.form.imageUrls) {
+                        if (this.form.imageUrls.length > 0) {
+                            var urls = []
+                            var names = this.form.imageUrls.split(",")
+                            names.forEach(name => {
+                                urls.push(website.minioUrl + name)
+                            })
+                            this.form.imageUrls = urls.join(",")
+                        }
+                    }
                 })
             }
             this.initFlag = true
@@ -603,12 +734,34 @@
         onLoad (page, params = {}) {
             this.loading = true
             getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
-                const data = res.data.data
+                const data = {
+                    ...res.data.data,
+                    records: res.data.data.records.map(item => {
+                        if (item.imageUrls) {
+                            if (item.imageUrls.length > 0) {
+                                var urls = []
+                                var names = item.imageUrls.split(",")
+                                names.forEach(name => {
+                                    urls.push(website.minioUrl + name)
+                                })
+                                item.imageUrls = urls.join(",")
+                            }
+                        }
+
+                        return {
+                            ...item,
+                            'phoneflag': false,
+                        }
+                    })
+                }
                 this.page.total = data.total
                 this.data = data.records
                 this.loading = false
                 this.selectionClear()
             })
+        },
+        showStringDispose (row, type) {
+            row[type] = !row[type]
         }
     }
 }

--
Gitblit v1.9.3