shuishen
2024-02-19 9dc5385c2a11246d96ebb09eebb0918dd338433f
首页九小场所显示调整
2 files modified
278 ■■■■■ changed files
src/api/home/index.js 107 ●●●● patch | view | raw | blame | history
src/views/home/components/leftContainer.vue 171 ●●●●● patch | view | raw | blame | history
src/api/home/index.js
@@ -2,22 +2,22 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-12-27 14:19:19
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-06-26 14:24:51
 * @LastEditTime: 2024-02-19 14:34:52
 * @FilePath: \srs-police-affairs\src\api\home\index.js
 * @Description:
 *
 * Copyright (c) 2023 by shuishen 1109946754@qq.com, All Rights Reserved.
 */
import request from "@/router/axios.js"
import request from "@/router/axios.js";
let equipmentNum = ""
let equipmentNum = "";
if (process.env.NODE_ENV == "development") {
    // 开发
    equipmentNum = window.BASE_URL_CONFIG.VUE_APP_OUTER_NET_EQUIPMENT
  equipmentNum = window.BASE_URL_CONFIG.VUE_APP_OUTER_NET_EQUIPMENT;
} else {
    // 部署
    equipmentNum = window.BASE_URL_CONFIG.VUE_APP_INTRANET_EQUIPMENT
  equipmentNum = window.BASE_URL_CONFIG.VUE_APP_INTRANET_EQUIPMENT;
}
/**
@@ -35,8 +35,8 @@
            // current: current,
            // size: size
        },
    })
}
  });
};
/**
 * 获取值班单位集合信息
@@ -48,24 +48,24 @@
        url: `/api/scheduling/scheduling/getSchedulingDeptList`,
        method: "get",
        params: params,
    })
}
  });
};
export const getAnswerPolices = (params) => {
    return request({
        url: `/api/doorplate/doorplate/acceptAlarmList`,
        method: "get",
        params: params,
    })
}
  });
};
export const getCallPolices = () => {
    return request({
        url: `/api/doorplate/doorplate/setOutAlarmList`,
        method: "get",
        params: {},
    })
}
  });
};
// 获取接警历史记录
export const getAlarmList = (params) => {
@@ -75,8 +75,8 @@
        params: {
            ...params,
        },
    })
}
  });
};
// 获取接警历史记录统计数据
export const getAlarmStatistics = (params) => {
@@ -86,8 +86,8 @@
        params: {
            ...params,
        },
    })
}
  });
};
// 获取处警历史
export const getActAsPoliceList = (alarmID, cjdwbh = "") => {
@@ -100,8 +100,8 @@
            alarmID,
            cjdwbh,
        },
    })
}
  });
};
// 案件统计数量接口查询
export const getCaseAll = (start, end, jjdwbh = "") => {
@@ -113,8 +113,8 @@
            end,
            jjdwbh,
        },
    })
}
  });
};
// 案件统计社区排行接口查询
export const getCaseRanking = (start, end, dwbh = "") => {
@@ -126,8 +126,8 @@
            end,
            dwbh,
        },
    })
}
  });
};
// 案件统计辖区排行接口查询
export const getCaseRankingArea = (start, end, dwbh = "") => {
@@ -139,8 +139,8 @@
            end,
            dwbh,
        },
    })
}
  });
};
// 获取设备统计数据
export const getEquipment = (jjdwbh = "") => {
@@ -150,8 +150,8 @@
        params: {
            jjdwbh,
        },
    })
}
  });
};
// 派出所责任区小区-获取三级区域数据
export const getPoliceStationTree = (type, id) => {
@@ -162,8 +162,8 @@
            type,
            id,
        },
    })
}
  });
};
// 现有小区模块
export const getAreaStatisticInfo = (type, deptId) => {
@@ -174,8 +174,8 @@
            type,
            deptId,
        },
    })
}
  });
};
// 获取设备分页数据
export const getEquipmentPaging = (params) => {
@@ -186,8 +186,8 @@
        params: {
            ...params,
        },
    })
}
  });
};
// 获取设备数据
export const getEquipmentAll = (params) => {
@@ -198,8 +198,8 @@
            ...params,
            deviceId: equipmentNum,
        },
    })
}
  });
};
// 获取现有小区详情弹窗
export const getLandDetail = (params) => {
@@ -207,8 +207,8 @@
        url: `/api/policeStationInfo/policeStationInfo/page`,
        method: "get",
        params: params,
    })
}
  });
};
//实有房屋统计
export const getVillageStatisticData = (params) => {
@@ -216,8 +216,8 @@
        url: `/api/villageDetail/villageDetail/getVillageStatisticData`,
        method: "get",
        params: params,
    })
}
  });
};
//实有房屋统计--详情
export const getVillageStatisticDetail = (params) => {
@@ -225,8 +225,8 @@
        url: `/api/villageDetail/villageDetail/page`,
        method: "get",
        params: params,
    })
}
  });
};
//关注场所统计
export const getPlaceOfConcernStatisticData = (params) => {
@@ -234,8 +234,8 @@
        url: `/api/placeOfConcern/placeOfConcern/getPlaceOfConcernStatisticData`,
        method: "get",
        params: params,
    })
}
  });
};
//关注场所统计--详情
export const getPlaceOfConcernStatisticDetail = (params) => {
@@ -243,8 +243,8 @@
        url: `/api/placeOfConcern/placeOfConcern/page`,
        method: "get",
        params: params,
    })
}
  });
};
//实有住宅和关注场所统计总数
export const getVillageDetailAndPlaceStatisticNumber = (params) => {
@@ -252,8 +252,8 @@
        url: `/api/placeOfConcern/placeOfConcern/getVillageDetailAndPlaceStatisticNumber`,
        method: "get",
        params: params,
    })
}
  });
};
//酒店住户列表
export const getCheckInInfo = (params) => {
@@ -261,5 +261,14 @@
        url: `/api/checkInInfo/checkInInfo/page`,
        method: "get",
        params,
    })
}
  });
};
// 九小场所相关数量
export const getNineStatistics = (params) => {
  return request({
    url: `/api/blade-place/place/getNineStatistics`,
    method: "get",
    params,
  });
};
src/views/home/components/leftContainer.vue
@@ -78,11 +78,11 @@
                    <div class="sub-tab">
                        <div class="tab" :class="{ 'select-on-tab': tabTypeTwo == 0 }" @click="houseTabClick(0)">
                            <div class="tab-title-small">场所数量:</div>
                            <div class="tab-title-small">1754</div>
                            <div class="tab-title-small">{{ placeNum }}</div>
                        </div>
                        <div class="tab" :class="{ 'select-on-tab': tabTypeTwo == 1 }" @click="houseTabClick(1)">
                            <div class="tab-title-small">隐患数量:</div>
                            <div class="tab-title-small">2465</div>
                            <div class="tab-title-small">{{ dangerNum }}</div>
                        </div>
                    </div>
                    <div id="houseEcharts" class="echarts-box"></div>
@@ -135,7 +135,15 @@
<script>
import { fontSize } from '@/utils/fontSize.js'
import { getAreaStatisticInfo, getVillageStatisticData, getVillageStatisticDetail, getPlaceOfConcernStatisticData, getPlaceOfConcernStatisticDetail, getVillageDetailAndPlaceStatisticNumber } from "@/api/home/index.js"
import {
    getAreaStatisticInfo,
    getVillageStatisticData,
    getVillageStatisticDetail,
    getPlaceOfConcernStatisticData,
    getPlaceOfConcernStatisticDetail,
    getVillageDetailAndPlaceStatisticNumber,
    getNineStatistics
} from "@/api/home/index.js"
import { schoolJSON } from '../homeleft/school'
import { hospitalJSON } from '../homeleft/hospital'
import { hotelJSON } from '../homeleft/hotel'
@@ -172,6 +180,8 @@
    data () {
        return {
            placeNum: 0,
            dangerNum: 0,
            tabType: 0,
            personEchartsLoading: false,
            houseEchartsLoading: false,
@@ -223,7 +233,7 @@
            window.addEventListener("resize", this.echartsResize)
        })
        this.getVillageDetailAndPlaceStatisticNumber({ deptId: this.userInfo.dept_id })
        // this.getVillageDetailAndPlaceStatisticNumber({ deptId: this.userInfo.dept_id })
    },
    methods: {
@@ -332,6 +342,7 @@
            this.tabType = 0//解决下拉选择派出所重点人员显示bug
            this.personTabClick(this.tabType)
            this.getNineStatistics(true)
            this.houseTabClick(this.tabTypeTwo)
            this.landTabClick(this.tabTypeThree)
@@ -690,54 +701,6 @@
            this.$parent.getAllPoliceStationCenter()
        },
        /**
         * @description: 获取现有住宅信息
         * @param {*} deptld
         * @param {*} isFollow
         * @return {*}
         */
        getHouseStatisticInfo (isFollow) {
            getHouseStatisticInfo(this.policeStaionID != '' ? this.policeStaionID : this.userInfo.dept_id, isFollow).then(res => {
                this.disposeHouseEchart()
                let xDate = []
                let yDate = []
                if (isFollow == 1) {
                    this.keyPlaceNum = res.data.data.count
                } else {
                    this.realHouseNum = res.data.data.count
                }
                res.data.data.data.forEach(item => {
                    xDate.push(item.name)
                    yDate.push(item.num)
                })
                if (this.userInfo.dept_id == '1596020515064381442') {
                    this.keyPlaceNum = 28
                    this.realHouseNum = 205
                    if (isFollow == 2) {
                        xDate = ['学校', '医院', '宾馆酒店', '房屋建筑业', '数字经济', '批发业', '零售业']
                        yDate = [34, 2, 33, 11, 22, 30, 14]
                        this.inithouseEcharts(xDate, yDate)
                    } else {
                        xDate = ['反恐重点目标', '危爆品', '重点服务对象', '困难儿童']
                        yDate = [14, 13, 10, 17]
                        this.inithouseEcharts(xDate, yDate)
                    }
                    this.clickHouseChart()
                } else {
                    this.inithouseEcharts(xDate, yDate)
                }
                setTimeout(() => {
                    this.houseEchartsLoading = false
                }, 500)
            }).catch(res => {
                setTimeout(() => {
                    this.houseEchartsLoading = false
                }, 500)
            })
        },
        // 现有住宅和关注场所统计总数
        getVillageDetailAndPlaceStatisticNumber (params) {
            getVillageDetailAndPlaceStatisticNumber(params).then(res => {
@@ -985,31 +948,108 @@
        },
        houseTabClick (type) {
            let typeData = ['小生产加工企业', '小美容洗浴场所', '小歌舞娱乐场所', '小餐饮场所', '小网吧', '小医院', '小学校', '小旅馆', '小商店',]
            this.tabTypeTwo = type
            this.houseEchartsLoading = true
            this.disposeHouseEchart()
            if (type == 1) {
            this.getNineStatistics()
            // 隐患数量
                // this.getHouseStatisticInfo(2)
                this.inithouseEcharts(
                    typeData,
                    [297, 130, 62, 376, 7, 26, 38, 45, 1484,]
                )
                // this.getVillageStatisticData({ deptId: this.userInfo.dept_id })
            } else {
            // 场所数量
                // this.getHouseStatisticInfo(1)
                this.inithouseEcharts(
                    typeData,
                    [513, 99, 23, 262, 6, 34, 35, 29, 753,]
                )
        },
                // this.getPlaceOfConcernStatisticData({ deptId: this.userInfo.dept_id })
        getNineStatistics (flag = false) {
            getNineStatistics({ deptId: this.policeStaionID != '' ? this.policeStaionID : this.userInfo.dept_id }).then(res => {
                let xDate = []
                let yDate = []
                this.realHouseNum = res.data.data.count
                let dangerList = res.data.data.dangerList.reverse()
                let placeList = res.data.data.placeList.reverse()
                if (flag) {
                    this.placeNum = placeList.reduce((pre, cur) => {
                        return pre + cur.num
                    }, 0)
                    this.dangerNum = dangerList.reduce((pre, cur) => {
                        return pre + cur.num
                    }, 0)
                    return
            }
                if (this.tabTypeTwo == 1) {
                    dangerList.forEach(item => {
                        xDate.push(item.nineTypeName)
                        yDate.push(item.num)
                    })
                } else {
                    placeList.forEach(item => {
                        xDate.push(item.nineTypeName)
                        yDate.push(item.num)
                    })
                }
                this.inithouseEcharts(xDate, yDate)
                setTimeout(() => {
            this.houseEchartsLoading = false
                }, 500)
            })
        },
        /**
        * @description: 获取现有住宅信息
        * @param {*} deptld
        * @param {*} isFollow
        * @return {*}
        */
        getHouseStatisticInfo (isFollow) {
            getHouseStatisticInfo(this.policeStaionID != '' ? this.policeStaionID : this.userInfo.dept_id, isFollow).then(res => {
                this.disposeHouseEchart()
                let xDate = []
                let yDate = []
                if (isFollow == 1) {
                    this.keyPlaceNum = res.data.data.count
                } else {
                    this.realHouseNum = res.data.data.count
                }
                res.data.data.data.forEach(item => {
                    xDate.push(item.name)
                    yDate.push(item.num)
                })
                if (this.userInfo.dept_id == '1596020515064381442') {
                    this.keyPlaceNum = 28
                    this.realHouseNum = 205
                    if (isFollow == 2) {
                        xDate = ['学校', '医院', '宾馆酒店', '房屋建筑业', '数字经济', '批发业', '零售业']
                        yDate = [34, 2, 33, 11, 22, 30, 14]
                        this.inithouseEcharts(xDate, yDate)
                    } else {
                        xDate = ['反恐重点目标', '危爆品', '重点服务对象', '困难儿童']
                        yDate = [14, 13, 10, 17]
                        this.inithouseEcharts(xDate, yDate)
                    }
                    this.clickHouseChart()
                } else {
                    this.inithouseEcharts(xDate, yDate)
                }
                setTimeout(() => {
                    this.houseEchartsLoading = false
                }, 500)
            }).catch(res => {
                setTimeout(() => {
                    this.houseEchartsLoading = false
                }, 500)
            })
        },
        initLandOptions (xDate, yDate) {
@@ -1564,6 +1604,7 @@
         */
        disposeHouseEchart () {
            if (houseMyChart != null && houseMyChart != '' && houseMyChart != undefined) {
                houseMyChart.clear()
                houseMyChart.dispose()
                houseMyChart.off('click')
            }