1
shuishen
2022-10-18 b243ad38a2acc819b1d4b812dc976be1df4223f3
1
5 files modified
106 ■■■■ changed files
src/assets/data/housingData.js 2 ●●● patch | view | raw | blame | history
src/styles/element-ui/element-ui.scss 5 ●●●●● patch | view | raw | blame | history
src/utils/search.js 16 ●●●●● patch | view | raw | blame | history
src/views/house/index.vue 38 ●●●● patch | view | raw | blame | history
src/views/police/index.vue 45 ●●●● patch | view | raw | blame | history
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: 
 * 
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;
}
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
}
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 {
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;
            }
        }
    }
}