guanqb
2024-03-13 348a34381f2337beff8eb01d6bb6af8b9d6aee07
添加从业人员管理页面
2 files modified
1 files added
327 ■■■■■ changed files
src/router/page/index.js 8 ●●●●● patch | view | raw | blame | history
src/views/layout/index.vue 15 ●●●●● patch | view | raw | blame | history
src/views/practitionersManage/index.vue 304 ●●●●● patch | view | raw | blame | history
src/router/page/index.js
@@ -21,6 +21,7 @@
const policeInfor = () => import("../../views/policeInfor/index.vue")
const scanOrCode = () => import("../../views/scanOrCode/index.vue")
const positionManage = () => import("../../views/positionManage/index.vue")
const practitionersManage = () => import("../../views/practitionersManage/index.vue")
const intelligentSearch = () =>
    import("../../views/intelligentSearch/index.vue")
@@ -135,6 +136,13 @@
                },
                component: positionManage,
            },
            {
                path: "practitionersManage",
                meta: {
                    title: "从业人员管理",
                },
                component: practitionersManage,
            },
        ],
    },
    // {
src/views/layout/index.vue
@@ -58,9 +58,17 @@
                    <div class="triangle"></div>
                    <div class="userName">用户名:{{ currentUserInfo.user_name }}</div>
                    <div class="userBtn">
                        <div class="back-system" @click="goToZD">
                        <div class="back-system"
                            :style="{ color: currentUrl == '/layout/positionManage' ? '#fcbd56' : '#fff' }"
                            @click="goToZD">
                            <i class="el-icon-s-grid"></i>
                            阵地管理
                        </div>
                        <div class="back-system"
                            :style="{ color: currentUrl == '/layout/practitionersManage' ? '#fcbd56' : '#fff' }"
                            @click="goToCYRY">
                            <i class="el-icon-s-custom"></i>
                            从业人员管理
                        </div>
                        <div class="back-system" v-if="permission.operation_manager" @click="goToBack">
                            <i class="el-icon-user-back"></i>
@@ -363,6 +371,11 @@
            this.$router.push('/layout/positionManage')
        },
        // 跳转从业人员管理
        goToCYRY () {
            this.$router.push('/layout/practitionersManage')
        },
        /**
         * @description: 跳转运维管理平台
         * @return {*}
src/views/practitionersManage/index.vue
New file
@@ -0,0 +1,304 @@
<!--
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-08-18 16:18:17
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2024-02-08 17:51:12
 * @FilePath: \srs-police-affairs\src\views\site\index.vue
 * @Description: 辖区管理
 *
 * Copyright (c) 2022 by shuishen 1109946754@qq.com, All Rights Reserved.
-->
<template>
    <div class="site-page-home police-page container">
        <div v-show="boxShow" class="container-content" ref="containerContent">
            <div class="time-select" ref="timeSelect">
                <div class="search-item-box">
                    <span>关键字:</span>
                    <el-input style="flex: 1;" size="small" placeholder="请输入(姓名、联系电话、工作场所)" v-model="placeName"
                        @change="searchChange" clearable></el-input>
                </div>
                <div class="search-item-box" style="justify-content: center;">
                    <el-button @click="searchBtn" icon="el-icon-search" class="bjnr-btn">搜索</el-button>
                    <el-button @click="clearRow" icon="el-icon-delete" class="bjnr-btn">清除</el-button>
                </div>
                <div class="search-item-box" style="justify-content: center;">
                    <el-button @click="filterBtn" icon="el-icon-notebook-2" class="bjnr-btn">有前科(数量)</el-button>
                </div>
            </div>
            <div class="list police-info" ref="tableBox">
                <el-table :data="tableData" style="width: 100%"
                    :header-cell-style="{ 'text-align': 'center', 'background-color': '#203c60', 'borderColor': '#324e75' }"
                    :cell-style="{ 'text-align': 'center', 'borderColor': '#324e75', 'cursor': 'default' }"
                    :row-class-name="tableRowClassName" class="police-infor-table">
                    <el-table-column prop="placeName" :show-overflow-tooltip="true" label="姓名"></el-table-column>
                    <el-table-column prop="location" :show-overflow-tooltip="true" label="联系电话"></el-table-column>
                    <el-table-column prop="frontName" :show-overflow-tooltip="true" label="工作场所"></el-table-column>
                    <el-table-column width="80" label="操作" align="center">
                        <template slot-scope="scope">
                            <el-button type="text" size="small" title="定位" :disabled="positionDisabled(scope.row)"
                                @click="rowClick(scope.row)">
                                <i class="el-icon-location" :style="{ color: positionColor(scope.row) }"></i>
                            </el-button>
                        </template>
                    </el-table-column>
                </el-table>
                <div class="pages all-pagination-sty" ref="tablePagination">
                    <el-pagination background layout="prev, pager, next" :page-size="pages.size" :total="pages.total"
                        :pager-count="4" :current-page="pages.current"
                        @current-change="handleCurrentChange"></el-pagination>
                </div>
            </div>
        </div>
        <PomDialogPopup ref="PomDialogPopup"></PomDialogPopup>
    </div>
</template>
<script>
import { initMapPosition } from '@/utils/mapPositionInit'
import { getFrontTypeTree, getFrontPage } from "@/api/site/index.js"
let loading = null
export default {
    inject: ['userInfo'],
    data () {
        return {
            boxShow: false,
            placeName: '',
            typeValue: '',
            typeOptions: [],
            tableData: [],
            pages: {
                current: 1,
                size: 22,
                total: 0,
                count: 0,
            },
        }
    },
    created () {
        this.getFrontTypeTree()
        this.getFrontPage()
        const that = this
        that.$nextTick(() => {
            initMapPosition()
        })
    },
    mounted () {
        this.$parent.$parent.resize('400px', true)
        this.$nextTick(() => {
            this.$EventBus.$emit('closeMxTileset')
        })
    },
    computed: {
        positionColor () {
            return (row) => {
                if (row.X && row.X != 0 || row.lng && row.lng != 0 || row.longitude && row.longitude != 0 || row.x && row.x != 0) {
                    return "#1AFA29"
                } else {
                    return "#ccc"
                }
            }
        },
        positionDisabled () {
            return (row) => {
                if (row.X && row.X != 0 || row.lng && row.lng != 0 || row.longitude && row.longitude != 0 || row.x && row.x != 0) {
                    return false
                } else {
                    return true
                }
            }
        },
    },
    methods: {
        // 有前科筛选按钮
        filterBtn () {
        },
        getFrontTypeTree () {
            getFrontTypeTree().then(res => {
                this.typeOptions = res.data.data
            })
        },
        // 切换登记类型
        typeChange () {
            this.pages.current = 1
            this.getFrontPage()
        },
        searchChange () {
            if (this.placeName.trim() == '') {
                this.pages.current = 1
                this.getFrontPage()
            }
        },
        searchBtn () {
            this.pages.current = 1
            this.getFrontPage()
        },
        resetSearch () {
            this.pages.current = 1
            this.typeValue = ''
            this.placeName = ''
            this.getFrontPage()
        },
        // 分页处理
        handleCurrentChange (current) {
            this.pages.current = current
            this.getFrontPage()
        },
        // 加载动画
        loading () {
            loading = this.$loading({
                lock: true,
                text: '拼命加载中',
                spinner: 'el-icon-loading',
                background: 'rgba(0, 0, 0, 0.5)'
            })
        },
        getFrontPage () {
            this.loading()
            getFrontPage({
                current: this.pages.current,
                size: this.pages.size,
                frontType: this.typeValue,
                isFront: 1,
                placeName: this.placeName
            }).then(res => {
                const data = res.data.data
                data.records.forEach(element => {
                    this.typeOptions.forEach(item => {
                        if (item.key == element.frontType) {
                            element.frontName = item.title
                        }
                    })
                })
                this.tableData = data.records
                this.pages.total = data.total
                setTimeout(() => {
                    loading && loading.close()
                }, 300)
            }).catch(error => {
                setTimeout(() => {
                    loading && loading.close()
                }, 300)
            })
        },
        // 点击定位
        rowClick (row) {
            let lng = global.DC.CoordTransform.GCJ02ToWGS84(row.lng, row.lat)[0]
            let lat = global.DC.CoordTransform.GCJ02ToWGS84(row.lng, row.lat)[1]
            this.$EventBus.$emit('toPosition', {
                siteJd: lng,
                siteWd: lat,
                siteGd: 2000
            })
            this.$EventBus.$emit('mapClearLayer', {
                layerName: 'scanLayer',
                type: 'VectorLayer'
            })
            this.$EventBus.$emit('layerPointAdd', {
                layerName: 'scanLayer',
                type: "billboard",
                params: {
                    ...row,
                    lng: lng,
                    lat: lat,
                    alt: 1,
                    size: [25.8, 32.4],
                    url: `/img/icon/site.png`,
                },
                incident: this.siteClick
            })
            this.$refs.PomDialogPopup.initOpen(row)
        },
        siteClick (e) {
            this.$refs.PomDialogPopup.initOpen(e.overlay.attrParams)
        },
        // 清空按钮-清除图标图层
        clearRow () {
            this.$EventBus.$emit('mapClearLayer', {
                layerName: 'scanLayer',
                type: 'VectorLayer'
            })
            this.$store.commit('SET_DIALOGDETAILPOPUP', false)
            this.resetSearch()//重置列表
        },
        // 大小重置
        boxResize (val) {
            this.boxShow = val
        },
    },
    destroyed () {
        loading && loading.close()
        this.$parent.$parent.resize('0px')
        this.clearRow()
    }
}
</script>
<style scoped lang="scss">
.container {
    position: relative;
    width: 100%;
    height: 100%;
    &-content {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100%;
        color: #fff;
        background: $bg-color;
    }
}
.list {
    display: flex;
    flex-direction: column;
    .pages {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
</style>