zhongrj
2024-04-26 b7c5748e83434492138d71ca0916ab54c5270bf6
矛盾纠纷统计新增
3 files modified
139 ■■■■ changed files
src/api/contradictionEventShow/index.js 16 ●●●●● patch | view | raw | blame | history
src/api/site/index.js 13 ●●●●● patch | view | raw | blame | history
src/views/contradictionEventShow/index.vue 110 ●●●● patch | view | raw | blame | history
src/api/contradictionEventShow/index.js
@@ -14,4 +14,20 @@
        },
        params: params,
    })
}
/**
 * 矛盾纠纷记录表 统计
 * @param {*} params
 * @returns
 */
export const getStatistic = (params) => {
    return request({
        url: "/api/blade-disputeRecord/disputeRecord/getStatistic",
        method: "get",
        meta: {
            isToken: true,
        },
        params: params,
    })
}
src/api/site/index.js
@@ -10,6 +10,19 @@
 */
import request from "@/router/axios.js"
/**
 * 获取字典表
 * @returns
 */
export const getDictBizTree = (param) => {
    return request({
        url: "/api/blade-system/dict-biz/tree",
        method: "get",
        params:param
    })
}
/**
 * 获取九小场所字典表
 * @param {*} page 页数
src/views/contradictionEventShow/index.vue
@@ -3,9 +3,28 @@
        <div v-show="boxShow" class="container-content" ref="containerContent">
            <div class="time-select" ref="timeSelect">
                <div class="search-item-box">
                    <el-input size="small" placeholder="请输入(地址、内容)" v-model="searchKey" clearable></el-input>
                    <span>矛盾纠纷类型:</span>
                    <el-select clearable style="flex: 1;" size="small" v-model="typeValue" @change="typeChange"
                        placeholder="请选择矛盾纠纷类型">
                        <el-option v-for="item in typeOptions" :key="item.dictKey" :label="item.dictValue"
                            :value="item.dictKey"></el-option>
                    </el-select>
                </div>
                <div class="search-item-box">
                    <el-input size="small" placeholder="请输入(地址、纠纷内容)" v-model="searchKey" clearable></el-input>
                    <el-button @click="searchBtn" icon="el-icon-search" class="bjnr-btn">搜索</el-button>
                    <el-button @click="resetBtn" icon="el-icon-delete" class="bjnr-btn">清除</el-button>
                </div>
                <div class="search-item-box" style="overflow-wrap: break-word;">
                    <el-button @click="filterBtn(1)" class="bjnr-btn"
                        :class="{ isOneClick: criminalRecordFlag == 1 }">已化解({{ yhj ? yhj :
            '0'
                        }})</el-button>
                    <el-button @click="filterBtn(2)" class="bjnr-btn"
                        :class="{ isOneClick: criminalRecordFlag == 1 }">未化解({{ whj ? whj :
            '0'
                        }})</el-button>
                </div>
            </div>
@@ -48,7 +67,7 @@
<script>
import { initMapPosition } from '@/utils/mapPositionInit'
import {
    getDisputeRecordList
    getDisputeRecordList,getStatistic
} from "@/api/contradictionEventShow/index.js"
import { getDictionaryListByCode } from "@/api/rentalInfo/index.js"
@@ -61,34 +80,40 @@
    components: { detailDialog },
    data () {
    data() {
        return {
            handleResult:null,
            yhj:0,
            whj:0,
            typeValue: '',
            typeOptions: [],
            searchKey: '',
            currentTableHeight: 0,
            tableData: [],
            boxShow: false,
            pages: {
                current: 1,
                total: 0,
                pageSize: 22,
                count: 0,
                currentPage: 1
            },
            disputeTypeList: [],
            disputeSourceList: []
        }
    },
    created () {
    created() {
        const that = this
        that.$nextTick(() => {
            initMapPosition()
            that.getDictionaryListByCode()
            that.getStatistic()
            that.getList()
        })
    },
    mounted () {
    mounted() {
        this.$parent.$parent.resize('400px', true)
        this.$nextTick(() => {
@@ -101,7 +126,7 @@
    },
    computed: {
        positionColor () {
        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"
@@ -111,7 +136,7 @@
            }
        },
        positionDisabled () {
        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
@@ -123,18 +148,33 @@
    },
    methods: {
        // 统计
        getStatistic(){
            var that = this;
            getStatistic({
                disputeType: this.typeValue,
                searchKey: this.searchKey
            }).then(res=>{
                that.yhj = res.data.data.yhj
                that.whj = res.data.data.whj
            })
        },
        // 获取字典列表
        getDictionaryListByCode () {
        getDictionaryListByCode() {
            getDictionaryListByCode('disputeType').then(res => {
                this.disputeTypeList = res.data.data
            })
            getDictionaryListByCode('disputeSource').then(res => {
                this.disputeSourceList = res.data.data
            })
            // 矛盾纠纷类型获取
            getDictionaryListByCode('disputeType').then(res => {
                this.typeOptions = res.data.data
            })
        },
        // 点击定位
        rowClick (row) {
        rowClick(row) {
            this.$EventBus.$emit('toPosition', {
                siteJd: row.lng,
                siteWd: row.lat,
@@ -158,7 +198,7 @@
        },
        // 点击详情
        goDetail (row) {
        goDetail(row) {
            let detailList = []
            let title = '矛盾纠纷事件详情'
@@ -243,21 +283,28 @@
            this.$refs.detailDialog.initOpen(detailList, title, [], [])
        },
        // 切换登记类型
        typeChange() {
            this.pages.current = 1
            this.getList()
            this.getStatistic()
        },
        // 获取列表
        getList () {
        getList() {
            this.loading()
            let params = {
                handleResult:this.handleResult,
                disputeType: this.typeValue,
                searchKey: this.searchKey,
                size: this.pages.pageSize,
                current: this.pages.currentPage
                current: this.pages.current
            }
            this.getDisputeRecordList(params)
        },
        // 矛盾纠纷列表
        getDisputeRecordList (params) {
        getDisputeRecordList(params) {
            getDisputeRecordList(params).then(res => {
                this.tableData = res.data.data.records
                this.pages.total = res.data.data.total
@@ -272,30 +319,39 @@
        },
        // 搜索按钮
        searchBtn () {
            this.pages.currentPage = 1
        searchBtn() {
            this.pages.current = 1
            this.getList()
            this.getStatistic()
        },
        // 清空按钮
        resetBtn () {
        resetBtn() {
            this.searchKey = ''
            this.pages.currentPage = 1
            this.typeValue = null;
            this.handleResult = null;
            this.pages.current = 1
            this.getList()
            this.getStatistic()
            this.$EventBus.$emit('mapClearLayer', {
                layerName: 'searchAILayer',
                type: 'VectorLayer'
            })
        },
        // 分页处理
        handleCurrentChange (currentPage) {
            this.pages.currentPage = currentPage
        filterBtn(handleResult){
            this.handleResult = handleResult
            this.getList()
        },
        // 分页处理
        handleCurrentChange(currentPage) {
            this.pages.current = currentPage
            this.getList()
            this.getStatistic()
        },
        // 加载动画
        loading () {
        loading() {
            loading = this.$loading({
                lock: true,
                text: '拼命加载中',
@@ -305,17 +361,17 @@
        },
        // 表格高度
        setTableHeight () {
        setTableHeight() {
            this.currentTableHeight = this.$refs.containerContent.offsetHeight - this.$refs.timeSelect.offsetHeight
        },
        // 大小重置
        boxResize (val) {
        boxResize(val) {
            this.boxShow = val
        },
    },
    destroyed () {
    destroyed() {
        loading && loading.close()
        window.removeEventListener('resize', this.setTableHeight)