From 636fdf1a73e9549a2ac4e5cba13cdebfe241afa5 Mon Sep 17 00:00:00 2001
From: guanqb <18720758508@163.com>
Date: Tue, 18 Oct 2022 15:14:45 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/srs-police-affairs

---
 src/utils/search.js                   |   16 +++++--
 src/views/police/index.vue            |   45 +++++++++++++++++++---
 src/assets/data/housingData.js        |    2 
 src/views/house/index.vue             |   38 +++++++++++++++----
 src/styles/element-ui/element-ui.scss |    5 ++
 5 files changed, 85 insertions(+), 21 deletions(-)

diff --git a/src/assets/data/housingData.js b/src/assets/data/housingData.js
index d4c330d..a523ed6 100644
--- a/src/assets/data/housingData.js
+++ b/src/assets/data/housingData.js
@@ -2,7 +2,7 @@
  * @Author: shuishen 1109946754@qq.com
  * @Date: 2022-10-17 16:03:02
  * @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2022-10-17 17:37:09
+ * @LastEditTime: 2022-10-18 11:10:55
  * @FilePath: \srs-police-affairs\src\assets\data\housingData.js
  * @Description: 
  * 
diff --git a/src/styles/element-ui/element-ui.scss b/src/styles/element-ui/element-ui.scss
index 41d5a0a..dc7a606 100644
--- a/src/styles/element-ui/element-ui.scss
+++ b/src/styles/element-ui/element-ui.scss
@@ -289,4 +289,9 @@
         height: calc(100% - 40px);
         color: #fff;
     }
+}
+
+.el-table,
+.el-table__expanded-cell {
+    background-color: rgba(20, 50, 123, 1.0) !important;
 }
\ No newline at end of file
diff --git a/src/utils/search.js b/src/utils/search.js
index 2af33e6..1434bef 100644
--- a/src/utils/search.js
+++ b/src/utils/search.js
@@ -2,7 +2,7 @@
  * @Author: shuishen 1109946754@qq.com
  * @Date: 2022-10-17 09:55:22
  * @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2022-10-17 14:53:08
+ * @LastEditTime: 2022-10-18 11:22:55
  * @FilePath: \srs-police-affairs\src\utils\search.js
  * @Description: 
  * 
@@ -24,15 +24,21 @@
 }
 
 // 精准查询
-export function accurateSearch (dataArray, searchValue, keyValue) {
+export function accurateSearch (dataArray, searchValue, keyValue, dataType = []) {
 
-    let valArray = []
+    let val = dataType
 
     dataArray.forEach(item => {
         if (item[keyValue] == searchValue) {
-            valArray.push(item)
+
+            if (Array.isArray(val)) {
+                val.push(item)
+            } else {
+                val = item
+            }
+
         }
     })
 
-    return valArray
+    return val
 }
\ No newline at end of file
diff --git a/src/views/house/index.vue b/src/views/house/index.vue
index a557520..c743a6d 100644
--- a/src/views/house/index.vue
+++ b/src/views/house/index.vue
@@ -2,7 +2,7 @@
  * @Author: shuishen 1109946754@qq.com
  * @Date: 2022-08-18 16:18:17
  * @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2022-10-17 17:05:59
+ * @LastEditTime: 2022-10-18 11:23:11
  * @FilePath: \srs-police-affairs\src\views\house\index.vue
  * @Description: 小区-栋-层-房屋
  * 
@@ -29,28 +29,28 @@
         <div class="result-content">
             <div class="housing-estate-info">
                 <div class="housing-title">
-                    书苑名家
+                    {{housingData.name}}
                     <div class="progress"></div>
                 </div>
                 <div class="housing-bg">
-                    <img style="width: 100%; height: 100%;" src="/img/bg.png" alt />
+                    <img style="width: 100%; height: 100%;" :src="housingData.img" alt />
                 </div>
                 <div class="housing-introduce">
                     <div>
                         <div class="l">分类属性:</div>
-                        <div class="r">住宅小区</div>
+                        <div class="r">{{housingData.classify}}</div>
                     </div>
                     <div>
                         <div class="l">所属辖区:</div>
-                        <div class="r">xxxxxxx警务室</div>
+                        <div class="r">{{housingData.area}}</div>
                     </div>
                     <div>
                         <div class="l">责任民警:</div>
-                        <div class="r">---------</div>
+                        <div class="r">{{housingData.principal}}</div>
                     </div>
                     <div>
                         <div class="l">标准地址:</div>
-                        <div class="r">江苏省苏州市吴江区江林街道五星路xxxxxxxxxxxxxxxxx</div>
+                        <div class="r">{{housingData.address}}</div>
                     </div>
                 </div>
             </div>
@@ -497,6 +497,8 @@
 
 import villageHousesList from '@/assets/data/villageHouse.js'
 
+import housingData from '@/assets/data/housingData.js'
+
 import house from '../../assets/data/house'
 
 export default {
@@ -605,6 +607,15 @@
             nextFloorShow: true,
             levelList: [],
             houseDate: {},
+
+            housingData: {
+                name: '信美家园',
+                img: '/img/housing/one.jpg',
+                classify: '住宅区',
+                area: 'xxx警务室',
+                principal: '王敦顿',
+                address: '江西省上饶市市广信区信美路18号'
+            },
 
             searchValue: '',
             searchArray: [],
@@ -746,19 +757,29 @@
         searchChange () {
             if (this.searchValue == '') {
                 this.searchValBoxShow = false
+
                 this.searchArray = []
             } else {
                 this.searchValBoxShow = true
+
+                this.searchArray = listQuery(housingData, this.searchValue, 'name')
             }
         },
 
         searchClick () {
             this.searchValBoxShow = false
+
+            this.housingData = accurateSearch(housingData, this.searchValue, 'name', {})
+
+            this.searchValue = ''
         },
 
         searchVlaClick (item) {
             this.searchValBoxShow = false
-            this.searchArray = []
+
+            this.housingData = item
+
+            this.searchValue = ''
         }
     },
 
@@ -886,6 +907,7 @@
 
             .housing-introduce {
                 & > div {
+                    padding: 0 10px;
                     display: flex;
 
                     .l {
diff --git a/src/views/police/index.vue b/src/views/police/index.vue
index d88252b..31431e1 100644
--- a/src/views/police/index.vue
+++ b/src/views/police/index.vue
@@ -2,7 +2,7 @@
  * @Author: shuishen 1109946754@qq.com
  * @Date: 2022-08-18 16:18:17
  * @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2022-10-17 15:18:20
+ * @LastEditTime: 2022-10-18 14:40:16
  * @FilePath: \srs-police-affairs\src\views\police\index.vue
  * @Description: 辖区管理
  * 
@@ -31,7 +31,7 @@
             </div>
         </div>
 
-        <div class="list-show">
+        <div class="list-show" ref="tableBox">
             <div class="car-list" v-show="navType == 1">
                 <div class="list-box">
                     <el-table
@@ -40,17 +40,28 @@
                         :header-cell-style="{'text-align':'center','background-color':'#203c60','borderColor':'#324e75'}"
                         :cell-style="{'text-align':'center','borderColor':'#324e75', 'cursor':'pointer'}"
                         @cell-click="rowClick"
+                        :height="currentTableHeight"
                     >
                         <el-table-column type="index" label="序号" width="50">
                             <template slot-scope="scope">
                                 <span>{{(currentPage - 1) * pagesize + scope.$index + 1}}</span>
                             </template>
                         </el-table-column>
-                        <el-table-column prop="name" label="名称" width="170"></el-table-column>
-                        <el-table-column prop="carType" label="警车类型" width="180"></el-table-column>
-                        <!-- <el-table-column prop="position" label="经纬度"></el-table-column> -->
+                        <el-table-column prop="name" label="名称" width="140"></el-table-column>
+                        <el-table-column prop="carType" label="警车类型" width="120"></el-table-column>
+                        <el-table-column label="操作">
+                            <template slot-scope="scope">
+                                <el-button
+                                    @click="handleClick(scope.row)"
+                                    type="text"
+                                    size="small"
+                                >查看</el-button>
+                                <el-button type="text" size="small">编辑</el-button>
+                            </template>
+                        </el-table-column>
                     </el-table>
                 </div>
+
                 <div class="pages">
                     <el-pagination
                         background
@@ -71,6 +82,7 @@
                         :header-cell-style="{'text-align':'center','background-color':'#203c60','borderColor':'#324e75'}"
                         :cell-style="{'text-align':'center','borderColor':'#324e75', 'cursor':'pointer'}"
                         @cell-click="rowClick"
+                        :height="currentTableHeight"
                     >
                         <el-table-column type="index" label="序号" width="50">
                             <template slot-scope="scope">
@@ -176,16 +188,28 @@
             phoneVisible: false,
             searchValue: '',
             searchArray: [],
-            searchValBoxShow: false
+            searchValBoxShow: false,
+            currentTableHeight: 0
         }
     },
     created () {
         this.carList = carList
         this.phoneList = phoneList
+        const that = this
+
+        this.$nextTick(() => {
+            that.currentTableHeight = that.$refs.tableBox.offsetHeight - 40
+        })
+
+        window.addEventListener('resize', () => {
+            that.currentTableHeight = that.$refs.tableBox.offsetHeight - 40
+        })
     },
     mounted () {
+
     },
     updated () {
+
     },
     methods: {
         handleCurrentChange: function (currentPage) {
@@ -424,7 +448,7 @@
     }
 
     .list-show {
-        flex: 1;
+        height: calc(100% - 50px - 48px);
 
         & > div {
             height: 100%;
@@ -435,6 +459,13 @@
             .list-box {
                 flex: 1;
             }
+
+            .pages {
+                height: 40px;
+                display: flex;
+                align-items: center;
+                justify-content: center;
+            }
         }
     }
 }

--
Gitblit v1.9.3