From 3c6f60c23a7ba9e45075c13fdb5c496722fb18ec Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Wed, 27 Dec 2023 10:41:00 +0800
Subject: [PATCH] 显示内容调整,弹窗

---
 src/views/place/index.vue |  299 +++++++++--------------------------------------------------
 1 files changed, 49 insertions(+), 250 deletions(-)

diff --git a/src/views/place/index.vue b/src/views/place/index.vue
index 95963e2..846e911 100644
--- a/src/views/place/index.vue
+++ b/src/views/place/index.vue
@@ -17,24 +17,9 @@
             </template>
         </avue-crud>
 
-        <el-dialog title="场所维护" append-to-body :visible.sync="roleBox" center>
-            <h3>基本信息:</h3>
-            <avue-form :option="optionDetail" v-model="placeForm"></avue-form>
-
-            <div style="display: flex; justify-content: center;">
-                <el-button size="small" @click="roleBox = false">取 消</el-button>
-                <el-button size="small" type="primary" @click="submitRole">提 交</el-button>
-            </div>
-
-            <h3>从业人员:</h3>
-            <avue-crud :option="placeOption" :search.sync="search" :table-loading="loading" :data="placeExt" ref="crud"
-                v-model="houseHoldForm" :permission="permissionList" @row-del="houseHoldRowDel"
-                @row-update="houseHoldRowUpdate" @row-save="houseHoldRowSave" :page.sync="holdPage"
-                @current-change="holdCurrentChange" @size-change="holdSizeChange" @refresh-change="refreshHoldChange"
-                @on-load="holdOnLoad">
-            </avue-crud>
+        <el-dialog class="place-info-box" title="场所维护" append-to-body :visible.sync="roleBox" center @close="roleBoxClose">
+            <baseAllInfo></baseAllInfo>
         </el-dialog>
-
     </basic-container>
 </template>
 
@@ -46,121 +31,25 @@
     add,
     getPlace,
     getPlaceExt,
-    updatePlaceExt,
-    holdRemove,
-    holdAdd,
-    holdUpdate,
-    getHoldList
 } from "@/api/place/place"
+
 import {
     mapGetters
 } from "vuex"
+
 import website from '@/config/website'
+
+import baseAllInfo from './components/baseAllInfo'
+
 export default {
     data () {
         return {
+            curRow: {},
+            roleBox: false,
+
             form: {},
             query: {},
             loading: true,
-            roleBox: false,
-            placeForm: {},
-            optionDetail: {
-                submitBtn: false,
-                emptyBtn: false,
-                column: [
-                    {
-                        label: '场所名称',
-                        prop: 'placeName',
-                    },
-                    {
-                        label: '法人信息',
-                        prop: 'legalPerson'
-                    },
-                    {
-                        label: '法人电话',
-                        prop: 'legalTel'
-                    },
-                    {
-                        label: '场所位置',
-                        prop: 'localtion'
-                    },
-
-                    {
-                        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,
-                    },
-
-                    {
-                        label: "场所平面图",
-                        prop: "planImageUrls",
-                        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,
-                    },
-
-                ]
-            },
-            rowPlace: {},
-            placeExt: [],
-
-            houseHoldForm: {},
-            placeOption: {
-                menu: true,
-                height: 300,
-                calcHeight: 54,
-                dialogWidth: 950,
-                tip: false,
-                searchShow: false,
-                addBtn: true,
-                delBtn: true,
-                editBtn: true,
-                border: true,
-                index: true,
-                dialogClickModal: false,
-                column: [{
-                    label: "名称",
-                    prop: "name",
-                    searchSpan: 4,
-                    search: true,
-                }, {
-                    label: "电话",
-                    prop: "telephone",
-                    searchSpan: 4,
-                    search: true,
-                }, {
-                    label: "暂住地",
-                    prop: "tempAddress",
-                    searchSpan: 4,
-                    search: true,
-                },]
-            },
-            holdPage: {
-                pageSize: 20,
-                currentPage: 1,
-                total: 0,
-            },
-
 
             page: {
                 pageSize: 10,
@@ -176,11 +65,12 @@
                 tip: false,
                 searchShow: true,
                 searchMenuSpan: 3,
-                menuWidth: 280,
+                menuWidth: 240,
                 border: true,
                 //stripe:true,
                 index: true,
                 viewBtn: true,
+                editBtn: false,
                 selection: true,
                 dialogClickModal: false,
                 column: [
@@ -386,7 +276,17 @@
             data: [],
         }
     },
+
+    provide () {
+        return {
+            placeElement: this,
+        }
+    },
+
+    components: { baseAllInfo },
+
     watch: {},
+
     computed: {
         ...mapGetters(["permission", "userInfo"]),
         permissionList () {
@@ -406,130 +306,24 @@
         },
     },
     methods: {
-        houseHoldRowUpdate (row, index, done, loading) {
-            holdUpdate(row).then(
-                () => {
-                    this.holdOnLoad(this.holdPage)
-                    this.$message({
-                        type: "success",
-                        message: "操作成功!",
-                    })
-                    done()
-                },
-                (error) => {
-                    window.console.log(error)
-                    loading()
-                }
-            )
+        roleBoxClose () {
+            this.curRow = {}
         },
 
-        houseHoldRowDel (row) {
-            this.$confirm("确定将选择数据删除?", {
-                confirmButtonText: "确定",
-                cancelButtonText: "取消",
-                type: "warning",
-            })
-                .then(() => {
-                    return holdRemove(row.id)
-                })
-                .then(() => {
-                    this.holdOnLoad(this.holdPage)
+        handleClick () {
 
-                    this.$message({
-                        type: "success",
-                        message: "操作成功!",
-                    })
-                })
-        },
-
-        houseHoldRowSave (row, done, loading) {
-            holdAdd({
-                ...row,
-                placeId: this.placeForm.placeId
-            }).then(
-                () => {
-                    this.holdOnLoad(this.holdPage)
-
-                    this.$message({
-                        type: "success",
-                        message: "操作成功!",
-                    })
-                    done()
-                },
-                (error) => {
-                    window.console.log(error)
-                    loading()
-                }
-            )
-        },
-
-        refreshChange () {
-            this.holdOnLoad(this.holdPage)
-        },
-
-        holdOnLoad (holdPage, params = {}) {
-            if (!this.placeForm.placeId) return
-
-            let values = {
-                ...params,
-                placeId: this.placeForm.placeId
-            }
-
-            getHoldList(holdPage.currentPage, holdPage.pageSize, values).then((res) => {
-                const data = res.data.data
-
-                this.page.total = data.total
-                this.placeExt = data.records
-
-                this.loading = false
-            })
-        },
-
-        holdCurrentChange (currentPage) {
-            this.page.currentPage = currentPage
-        },
-        holdSizeChange (pageSize) {
-            this.page.pageSize = pageSize
         },
 
         ManageTenants (item) {
+            this.curRow = item
             this.roleBox = true
-            this.rowPlace = item
-            this.placeForm = {
-                placeName: '',
-                legalPerson: '',
-                legalTel: '',
-                localtion: '',
-                confirmFlag: '',
-                imageUrls: '',
-                planImageUrls: ''
-            }
-            this.placeExt = []
-            this.onLoadPlaceExt()
+            // this.onLoadPlaceExt(item.id)
         },
 
-        submitRole () {
-            updatePlaceExt(this.placeForm).then(
-                () => {
-                    this.$message({
-                        type: "success",
-                        message: "操作成功!",
-                    })
-                    this.roleBox = false
-                },
-                (error) => {
-                    window.console.log(error)
-                    loading()
-                }
-            )
-        },
-
-        onLoadPlaceExt () {
-            let params = {
-                placeId: this.rowPlace.id,
-            }
-            getPlaceExt(Object.assign(params)).then(res => {
+        onLoadPlaceExt (placeId) {
+            getPlaceExt({ placeId }).then(res => {
                 const data = res.data.data
+
                 if (data) {
                     let imageUrls = data.imageUrls
                     let planImageUrls = data.planImageUrls
@@ -629,6 +423,7 @@
                 })
                 .then(() => {
                     this.onLoad(this.page)
+
                     this.$message({
                         type: "success",
                         message: "操作成功!",
@@ -650,7 +445,9 @@
         },
         selectionClear () {
             this.selectionList = []
-            this.$refs.crud.toggleSelection()
+            this.$nextTick(() => {
+                this.$refs.crud && this.$refs.crud.toggleSelection()
+            })
         },
         handleDelete () {
             if (this.selectionList.length === 0) {
@@ -703,8 +500,8 @@
             } else {
                 done()
             }
-
         },
+
         currentChange (currentPage) {
             this.page.currentPage = currentPage
         },
@@ -715,9 +512,7 @@
             this.onLoad(this.page, this.query)
         },
         onLoad (page, params = {}) {
-            const {
-                dateTime
-            } = this.query
+            const { dateTime } = this.query
             let values = {
                 ...params,
             }
@@ -730,23 +525,27 @@
                 }
                 values.dateTime = null
             }
+
             this.loading = true
+
             getList(page.currentPage, page.pageSize, values).then((res) => {
                 const data = res.data.data
+
                 this.page.total = data.total
+
                 this.data = data.records
+
                 this.data.forEach(item => {
-                    if (item.imageUrls) {
-                        if (item.imageUrls.length > 0) {
-                            var urls = []
-                            var names = item.imageUrls.split(",").filter(item => item != '')
-                            names.forEach(name => {
-                                urls.push(website.minioUrl + name)
-                            })
-                            item.imageUrls = urls.join(",")
-                        }
+                    if (item.imageUrls && item.imageUrls != '' && item.imageUrls != null && item.imageUrls.length) {
+                        var urls = []
+                        var names = item.imageUrls.split(",").filter(item => item != '')
+                        names.forEach(name => {
+                            urls.push(website.minioUrl + name)
+                        })
+                        item.imageUrls = urls.join(",")
                     }
                 })
+
                 this.loading = false
                 this.selectionClear()
             })

--
Gitblit v1.9.3