Your Name
2022-08-26 b1bdac435d4aa9fe34bde1a859490842166b47f7
statistics
已修改5个文件
已添加1个文件
211 ■■■■ 文件已修改
config/dev.env.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/inspectStatistics.js 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/doublePreventAction/hiddenDanger/inspectionRecord/index.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionComplete/index.vue 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionPerson/index.vue 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/doublePreventAction/hiddenDanger/inspectionStatistics/index.vue 118 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/dev.env.js
@@ -16,14 +16,14 @@
  //     IMG_API: '"https://sinanoaq.com:8100/upload/"',
  //       BASE_API: '"http://220.171.99.118:4100"',
  //       IMG_API: '"http://220.171.99.118:4100/upload/"',
  //     BASE_API: '"http://192.168.0.35:8006"',
  //     IMG_API: '"http://192.168.0.35:8006/upload/"',
      BASE_API: '"http://192.168.0.35:8006"',
      IMG_API: '"http://192.168.0.35:8006/upload/"',
    // BASE_API: '"http://192.168.0.8:8006"',
    // IMG_API: '"http://192.168.0.8:8006/upload/"',
    //
    BASE_API: '"http://192.168.0.69:8006"',
    IMG_API: '"http://192.168.0.69:8006/upload/"',
    // BASE_API: '"http://192.168.0.69:8006"',
    // IMG_API: '"http://192.168.0.69:8006/upload/"',
    // BASE_API: '"http://192.168.0.35:8006"',
    // IMG_API: '"http://192.168.0.35:8006/upload/"',
src/api/inspectStatistics.js
对比新文件
@@ -0,0 +1,24 @@
import {getToken} from "../utils/auth";
import request from '@/utils/request'
export function getInspectPerson(data) {
    return request({
        headers: {
            'Authorization': getToken()
        },
        url: process.env.BASE_API + '/prevent/riskEvent/statistics/inspectors',
        method: 'post',
        data
    })
}
export function getInspectComplete(data) {
    return request({
        headers: {
            'Authorization': getToken()
        },
        url: process.env.BASE_API + '/prevent/riskEvent/statistics/inspection-completed',
        method: 'post',
        data
    })
}
src/views/doublePreventAction/hiddenDanger/inspectionRecord/index.vue
@@ -64,6 +64,9 @@
                        {{ parseNumber(scope.row.taskBelong, '认领状态') }}
                    </template>
                </el-table-column>
                <el-table-column prop="startTime" label="开始时间" show-overflow-tooltip></el-table-column>
                <el-table-column prop="validTime" label="有效时间" show-overflow-tooltip></el-table-column>
                <el-table-column prop="execUserName" label="执行人" show-overflow-tooltip></el-table-column>
                <el-table-column prop="createUserName" label="创建人" show-overflow-tooltip></el-table-column>
                <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column>
                <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column>
src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionComplete/index.vue
@@ -5,6 +5,8 @@
<script>
import {getInspectComplete} from "../../../../../../api/inspectStatistics";
export default {
    name: 'index',
    data(){
@@ -14,18 +16,32 @@
        }
    },
    mounted() {
        this.drawTodayLine()
    },
    methods:{
        async updateData(val){
            let res = await getInspectComplete(val)
            if(res.data.code === '200'){
                this.numData = res.data.data.map(item =>{
                    return item.num
                })
                this.timeData = res.data.data.map(item =>{
                    return item.taskDate
                })
            }else{
                this.$message({
                    type:'warning',
                    message:res.data.message
                })
            }
            this.drawTodayLine()
        },
        async drawTodayLine(){
            this.timeData = [1,2,3,4,]
            this.numData = [2,5,7,9]
            let myChart = this.$echarts.init(document.getElementById('inspectionComplete'))
            myChart.setOption({
                xAxis: {
                type: 'category',
                boundaryGap: false,
                data: ['2022-4-1', '2022-4-2', '2022-4-4', '2022-4-4', '2022-4-5', '2022-4-6', '2022-4-7']
                data:this.timeData
                },
                yAxis: {
                    type: 'value'
@@ -33,7 +49,7 @@
                color:'#5470c6',
                series: [
                    {
                    data: [820, 932, 901, 934, 1290, 1330, 1320],
                    data: this.numData,
                    type: 'line',
                    smooth: true
                    }
src/views/doublePreventAction/hiddenDanger/inspectionStatistics/components/inspectionPerson/index.vue
@@ -5,6 +5,8 @@
<script>
import {getInspectPerson} from "../../../../../../api/inspectStatistics";
export default {
    name: "index",
    data(){
@@ -14,17 +16,25 @@
        }
    },
    mounted(){
        this.drawLine()
    },
    methods:{
        // setCount(val){
        //         this.numData = val.map(item =>{
        //             return item.num
        //         })
        //         this.timeData = val.map(item =>{
        //             return item.errorTaskIdList
        //         })
        // },
        async updateData(val){
            let res = await getInspectPerson(val)
            if(res.data.code === '200'){
                this.numData = res.data.data.map(item =>{
                    return item.num
                })
                this.timeData = res.data.data.map(item =>{
                    return item.taskDate
                })
            }else{
                this.$message({
                    type:'warning',
                    message:res.data.message
                })
            }
            this.drawLine()
        },
        async drawLine(){
            this.myChart = this.$echarts.init(document.getElementById('inspectionPerson'))
            this.myChart.setOption({
@@ -38,14 +48,14 @@
                color:'#fac858',
                xAxis: {
                    type: 'category',
                    data: ['2022-4-1', '2022-4-2', '2022-4-4', '2022-4-4', '2022-4-5', '2022-4-6', '2022-4-7']
                    data: this.timeData
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                {
                    data: [120, 200, 150, 80, 70, 110, 130],
                    data: this.numData,
                    type: 'bar',
                    showBackground: true,
                    backgroundStyle: {
src/views/doublePreventAction/hiddenDanger/inspectionStatistics/index.vue
@@ -4,35 +4,74 @@
            <div class="inspectionStatistics_part_person">
                <div class="inspectionStatistics_part_title">{{"巡检人员统计"}}</div>
                <div class="inspectionStatistics_part_time">       
                    <el-select v-model="personListQuery.depId" @change="changeInspectionPerson">
                        <el-option
                            v-for="item in departmentList"
                            :key="item.id"
                            :value="item.id"
                            :label="item.department"
                        >
                        </el-option>
                    </el-select>
                </div>
                <div class="inspectionStatistics_part_time">
                    <el-date-picker
                    v-model="value1"
                    type="daterange"
                    range-separator="至"
                    start-placeholder="开始日期"
                    @change="changeInspectionPerson"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    :default-time="['00:00:00','23:59:59']"
                    @change="changeTimeInspectionPerson"
                    end-placeholder="结束日期">
                    </el-date-picker></div>
                    <el-divider></el-divider>
                <div class="inspectionStatistics_part_body">
                    <inspection-person></inspection-person>
                    <inspection-person ref="inspectionPerson"></inspection-person>
                </div>
            </div>
        </div>
        <div class="inspectionStatistics_part">
            <div class="inspectionStatistics_part_complete">
                <div class="inspectionStatistics_part_title">{{"巡检完成统计"}}</div>
                <div class="inspectionStatistics_part_time" style="width:150px">
                    <el-select v-model="completeListQuery.depId" @change="changeInspectionComplete">
                        <el-option
                            v-for="item in departmentList"
                            :key="item.id"
                            :value="item.id"
                            :label="item.department"
                        >
                        </el-option>
                    </el-select>
                </div>
                <div class="inspectionStatistics_part_time" style="width:100px">
                    <el-select v-model="completeListQuery.status" @change="changeInspectionComplete">
                        <el-option
                            v-for="item in stateList"
                            :key="item.id"
                            :value="item.id"
                            :label="item.name"
                        >
                        </el-option>
                    </el-select>
                </div>
                <div class="inspectionStatistics_part_time">       
                    <el-date-picker
                    v-model="value2"
                    type="daterange"
                    range-separator="至"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    :default-time="['00:00:00','23:59:59']"
                    @change="changeCompleteTimeInspectionPerson"
                    start-placeholder="开始日期"
                    end-placeholder="结束日期">
                    </el-date-picker>
                </div>
                <el-divider></el-divider>
                <div class="inspectionStatistics_part_body">
                    <inspection-complete></inspection-complete>
                    <inspection-complete ref="inspectionComplete"></inspection-complete>
                </div>
            </div>
        </div>
@@ -72,6 +111,7 @@
    import inspectionUnusual from './components/inspectionUnusual/index'
    import todayUnusual from './components/todayUnusual/index'
import { getInspectionCount } from '../../../../api/inspectionTask'
    import {getDepartmentList} from "../../../../api/departmentManage";
    export default {
        name: "index",
        data() {
@@ -79,13 +119,30 @@
                value1:['',''],
                value2:['',''],
                value3:['',''],
                departmentList:[],
                listQuery:{
                "dateList": [
                ],
                "endDate": "",
                "execUid": null,
                "startDate": ""
                }
                },
                personListQuery:{
                    depId:41,
                    startTime:'',
                    endTime:'',
                },
                completeListQuery:{
                    depId:41,
                    startTime:'',
                    endTime:'',
                    status:1,
                },
                stateList:[
                    {id:1,name:'正常'},
                    {id:2,name:'存在隐患'},
                    {id:3,name:'未处理'}
                ]
            }
        },
        components : {
@@ -95,24 +152,54 @@
            todayUnusual
        },
        created() {
            this.getDepartment()
        },
        mounted() {
            this.setTimeValue()
            this.getInspectionCount()
        },
        methods: {
            setTimeValue() {
                let newTime =  new Date()
                this.value1 = [(newTime.getFullYear()+ '-' + (newTime.getMonth() + 1) + '-' +  1).toString() + ' '  + '00:00:00',(newTime.getFullYear()+ '-' + (newTime.getMonth() + 1) + '-' + newTime.getDate()).toString() + ' ' + '23:59:59']
                this.value2 = [(newTime.getFullYear()+ '-' + (newTime.getMonth() + 1) + '-' +  1).toString() + ' '  + '00:00:00',(newTime.getFullYear()+ '-' + (newTime.getMonth() + 1) + '-' + newTime.getDate()).toString() + ' ' + '23:59:59']
                this.value1 = [(newTime.getFullYear()+ '-' + ((newTime.getMonth() + 1) < 10 ? '0' + (newTime.getMonth() + 1) : (newTime.getMonth() + 1)) + '-' +  '01').toString() + ' '  + '00:00:00',(newTime.getFullYear()+ '-' + ((newTime.getMonth() + 1) < 10 ? '0' + (newTime.getMonth() + 1) : (newTime.getMonth() + 1)) + '-' + newTime.getDate()).toString() + ' ' + '23:59:59']
                this.personListQuery.startTime = this.value1[0]
                this.personListQuery.endTime = this.value1[1]
                this.$refs.inspectionPerson.updateData(this.personListQuery)
                this.value2 = [(newTime.getFullYear()+ '-' + ((newTime.getMonth() + 1) < 10 ? '0' + (newTime.getMonth() + 1) : (newTime.getMonth() + 1)) + '-' +  '01').toString() + ' '  + '00:00:00',(newTime.getFullYear()+ '-' + ((newTime.getMonth() + 1) < 10 ? '0' + (newTime.getMonth() + 1) : (newTime.getMonth() + 1)) + '-' + newTime.getDate()).toString() + ' ' + '23:59:59']
                this.completeListQuery.startTime = this.value1[0]
                this.completeListQuery.endTime = this.value1[1]
                this.$refs.inspectionComplete.updateData(this.completeListQuery)
                this.value3 = [(newTime.getFullYear()+ '-' + (newTime.getMonth() + 1) + '-' +  1).toString() + ' '  + '00:00:00',(newTime.getFullYear()+ '-' + (newTime.getMonth() + 1) + '-' + newTime.getDate()).toString() + ' ' + '23:59:59']
            },
            async getInspectionCount() {
                this.listQuery.startDate = this.value1[0]
                this.listQuery.endDate = this.value1[1]
                let res = await getInspectionCount(this.listQuery)
                // this.$refs.inspectionPerson.setCount(res.data.result)
            changeTimeInspectionPerson() {
                if(this.value1 !== null){
                    this.personListQuery.startTime = this.value1[0]
                    this.personListQuery.endTime = this.value1[1]
                }
                this.$refs.inspectionPerson.updateData(this.personListQuery)
            },
            async changeInspectionPerson() {
                let res = await getInspectionCount(this.listQuery)
            changeCompleteTimeInspectionPerson() {
                if(this.value2 !== null){
                    this.completeListQuery.startTime = this.value2[0]
                    this.completeListQuery.endTime = this.value2[1]
                }
                this.$refs.inspectionComplete.updateData(this.completeListQuery)
            },
            changeInspectionPerson() {
                this.$refs.inspectionPerson.updateData(this.personListQuery)
            },
            changeInspectionComplete() {
                this.$refs.inspectionComplete.updateData(this.completeListQuery)
            },
            async getDepartment(){
                let res = await getDepartmentList({pageSize:1000,pageIndex:1})
                if(res.data.code === '200'){
                    this.departmentList = res.data.result.result
                }else{
                    this.$message({
                        message:res.data.message,
                        type:'warning'
                    })
                }
            },
        }
    }
@@ -144,7 +231,7 @@
        line-height: 60px;
        padding-left:20px;
        display: inline-block;
        width:50%;
        width:20%;
    }
    .inspectionStatistics_part_body{
        width:100%;
@@ -152,6 +239,5 @@
    }
    .inspectionStatistics_part_time{
        display: inline-block;
    }
</style>