From b32f6916283f35672ea3e70a5e26f22d62bcbe8e Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Thu, 16 Feb 2023 10:53:23 +0800
Subject: [PATCH] 警情动态样式微调,首页弹框分页逻辑调整

---
 src/styles/base/index.scss  |    5 --
 src/styles/media/index.scss |    8 ++++
 src/views/home/index.vue    |   65 ++++++++++++++++++++++----------
 3 files changed, 52 insertions(+), 26 deletions(-)

diff --git a/src/styles/base/index.scss b/src/styles/base/index.scss
index c64278c..e2688e7 100644
--- a/src/styles/base/index.scss
+++ b/src/styles/base/index.scss
@@ -363,11 +363,6 @@
         left: 50% !important;
         transform: translate(-50%, -50%);
 
-        .el-dialog__header {
-            height: 40px;
-            line-height: 40px;
-        }
-
         .el-table__header-wrapper {
             height: 60px;
             line-height: 60px;
diff --git a/src/styles/media/index.scss b/src/styles/media/index.scss
index 14636e0..72f8b6d 100644
--- a/src/styles/media/index.scss
+++ b/src/styles/media/index.scss
@@ -932,6 +932,14 @@
                                     }
                                 }
 
+                                .el-table__body-wrapper {
+                                    td.cell {
+                                        display: flex;
+                                        justify-content: center;
+                                        align-items: center;
+                                    }
+                                }
+
                                 .el-table__empty-text {
                                     font-size: countSizeVh(16);
                                 }
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 80d4211..94cdd1e 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -2,7 +2,7 @@
  * @Author: shuishen 1109946754@qq.com
  * @Date: 2022-08-18 16:18:17
  * @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2023-02-15 15:54:57
+ * @LastEditTime: 2023-02-16 10:43:03
  * @FilePath: \srs-police-affairs\src\views\home\index.vue
  * @Description: 小区-栋-层-房屋
  *
@@ -153,6 +153,11 @@
                 :header-cell-style="{ 'text-align': 'center', 'background-color': '#203c60', 'borderColor': '#324e75' }"
                 :cell-style="{ 'text-align': 'center', 'borderColor': '#324e75', 'cursor': 'pointer' }"
             >
+                <el-table-column label="序号" type="index" align="center">
+                    <template slot-scope="scope">
+                        <span>{{(peoplePage.currentPage - 1) * peoplePage.pageSize + scope.$index + 1}}</span>
+                    </template>
+                </el-table-column>
                 <el-table-column :show-overflow-tooltip="true" prop="realName" label="姓名"></el-table-column>
                 <el-table-column :show-overflow-tooltip="true" prop="address" label="地址"></el-table-column>
                 <el-table-column :show-overflow-tooltip="true" prop="phone" label="电话"></el-table-column>
@@ -208,6 +213,11 @@
                 :header-cell-style="{ 'text-align': 'center', 'background-color': '#203c60', 'borderColor': '#324e75' }"
                 :cell-style="{ 'text-align': 'center', 'borderColor': '#324e75', 'cursor': 'pointer' }"
             >
+                <el-table-column label="序号" type="index" align="center">
+                    <template slot-scope="scope">
+                        <span>{{(peoplePage.currentPage - 1) * peoplePage.pageSize + scope.$index + 1}}</span>
+                    </template>
+                </el-table-column>
                 <el-table-column :show-overflow-tooltip="true" prop="zdryxl" label="重点人员类型"></el-table-column>
                 <el-table-column :show-overflow-tooltip="true" prop="realName" label="姓名"></el-table-column>
                 <el-table-column :show-overflow-tooltip="true" prop="address" label="地址"></el-table-column>
@@ -257,12 +267,11 @@
                 :cell-style="{ 'text-align': 'center', 'borderColor': '#324e75' }"
                 :row-class-name="tableRowClassName"
             >
-                <el-table-column
-                    :show-overflow-tooltip="true"
-                    type="index"
-                    :index="indexMethod"
-                    label="序号"
-                ></el-table-column>
+                <el-table-column label="序号" type="index" align="center">
+                    <template slot-scope="scope">
+                        <span>{{(currentPage - 1) * pagesize + scope.$index + 1}}</span>
+                    </template>
+                </el-table-column>
                 <el-table-column :show-overflow-tooltip="true" prop="channelId" label="通道编号"></el-table-column>
                 <el-table-column :show-overflow-tooltip="true" prop="deviceId" label="设备编号"></el-table-column>
                 <el-table-column :show-overflow-tooltip="true" prop="name" label="设备名称"></el-table-column>
@@ -324,7 +333,7 @@
                 :header-cell-style="{ 'text-align': 'center', 'background-color': '#203c60', 'borderColor': '#324e75' }"
                 :cell-style="{ 'text-align': 'center', 'borderColor': '#324e75', 'cursor': 'pointer' }"
             >
-                <el-table-column label="序号" type="index" width="50" align="center">
+                <el-table-column label="序号" type="index" align="center">
                     <template slot-scope="scope">
                         <span>{{(landPage.currentPage - 1) * landPage.pageSize + scope.$index + 1}}</span>
                     </template>
@@ -349,8 +358,8 @@
                 <el-pagination
                     background
                     layout="prev, pager, next, total"
-                    :page-size="landPage.pageSize"
                     :total="landPage.total"
+                    :page-size="landPage.pageSize"
                     :current-page="landPage.currentPage"
                     @current-change="landHandleCurrentChange"
                 ></el-pagination>
@@ -733,7 +742,7 @@
             callPhone: '',
             landPage: {
                 total: 0,
-                pageSize: 10,
+                pageSize: 15,
                 currentPage: 1
             },
             peoplePoliceName: '',
@@ -1746,14 +1755,22 @@
                 current: this.peoplePage.currentPage,
                 size: this.peoplePage.pageSize
             }).then(res => {
+                this.keyPersonDetailArr = []
+                this.peopleInfoList = []
+                this.peoplePage.total = 0
 
-                this.peoplePage.total = res.data.data.total
-                if (status === 2) {
-                    this.keyPersonDetailArr = res.data.data.records
+                if (res.data.data.records.length > 0) {
+                    this.peoplePage.total = res.data.data.total
+                    if (status === 2) {
+                        this.keyPersonDetailArr = res.data.data.records
+                    } else {
+                        this.peopleInfoList = res.data.data.records
+                    }
                 } else {
-                    this.peopleInfoList = res.data.data.records
+                    this.keyPersonDetailArr = []
+                    this.peopleInfoList = []
+                    this.peoplePage.total = 0
                 }
-
             })
         },
 
@@ -1861,19 +1878,25 @@
         },
 
         getLandDetail (type, id, current, policeName = '', phone = '') {
-            this.landDetailArr = []
-            this.landPage.total = 0
-
             getLandDetail({
                 type,
                 policeStationId: this.policeStaionID == '1123598813738675201' || this.policeStaionID == '' ? id : '',
                 areaId: this.policeStaionID != '1123598813738675201' && this.policeStaionID != '' ? id : '',
                 current,
                 policeName,
-                phone
+                phone,
+                size: this.landPage.pageSize
             }).then(res => {
-                this.landDetailArr = res.data.data.records
-                this.landPage.total = res.data.data.total
+                this.landDetailArr = []
+                this.landPage.total = 0
+
+                if (res.data.data.records.length > 0) {
+                    this.landDetailArr = res.data.data.records
+                    this.landPage.total = res.data.data.total
+                } else {
+                    this.landDetailArr = []
+                    this.landPage.total = 0
+                }
             })
         },
 

--
Gitblit v1.9.3