Преглед изворни кода

Merge branch 'master' of http://94.191.59.107:3000/houwenfeng/ybxf-security-ui

“yueshang” пре 1 година
родитељ
комит
d3ab8a879d

+ 11 - 0
src/api/backend/smallNine.js

@@ -0,0 +1,11 @@
+import request from '@/utils/request'
+function getAllPeople(data){//监督员质态统计
+    return request({
+        url:`/backend/watcher/page`,
+        method:"get",
+        params:data
+    })
+}
+export default{
+    getAllPeople,
+}

+ 2 - 1
src/main.js

@@ -24,7 +24,8 @@ import RightToolbar from "@/components/RightToolbar"
 // import hljs from 'highlight.js'
 // import 'highlight.js/styles/github-gist.css'
 import {DICT_TYPE, getDictDataLabel, getDictDatas, getDictDatas2} from "@/utils/dict";
-
+import echarts from 'echarts'
+Vue.prototype.$echarts = echarts;
 // 全局方法挂载
 Vue.prototype.getDicts = getDicts
 Vue.prototype.getConfigKey = getConfigKey

+ 331 - 0
src/views/backend/stacisticsNine/StatisticsNine.vue

@@ -0,0 +1,331 @@
+<template>
+    <div>
+        <div class="bigBox">
+            <div class="threeBox">
+                <div class="allBag" ref="nine" id="nine">
+
+                </div>
+                <div class="allBag" id="myself">
+
+                </div>
+                <div class="allBag" id="bigTeam">
+
+                </div>
+            </div>
+            <div class="twoBox">
+                <div class="lastBag" id="people">
+
+                </div>
+                <div class="lastBag" id="unity">
+
+                </div>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script>
+import smallNine from '../../../api/backend/smallNine';
+export default {
+    data: {
+        nine: null,
+        peopleList: [],//监督员
+        peopleNum: [],//质态
+        peopleDash:[]
+    },
+    created() {
+        this.initList()
+    },
+    mounted() {
+
+    },
+    methods: {
+        lineSmall() {//九小单位数量
+            let nine = this.$echarts.init(document.getElementById('nine'))
+            nine.setOption({
+                title: {
+                    text: '九小单位数量',
+                    textStyle: {
+                        fontSize: 12
+                    }
+                },
+                xAxis: {
+                    type: 'category',
+                    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
+                },
+                yAxis: {
+                    type: 'value',
+                    min: 0,
+                    max: 1200,
+                },
+                series: [
+                    {
+                        data: [
+                            {
+                                value: 120,
+                            },
+                            {
+                                value: 200,
+                            },
+                            {
+                                value: 120,
+                            },
+                            {
+                                value: 120,
+                            },
+                            {
+                                value: 120,
+                            },
+                            {
+                                value: 120,
+                            },
+                            {
+                                value: 120,
+                            },
+                        ],
+                        type: 'bar',
+                        barWidth: 30
+                    }
+                ],
+                color: "#0147EB"
+            })
+        },
+        myBit() {//自查数量
+            let myself = this.$echarts.init(document.getElementById('myself'))
+            myself.setOption({
+                title: {
+                    text: '自查数量',
+                    textStyle: {
+                        fontSize: 12
+                    }
+                },
+                xAxis: {
+                    type: 'category',
+                    boundaryGap: false,
+                    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
+                },
+                yAxis: {
+                    type: 'value',
+                    min: 0,
+                    max: 120,
+                },
+                tooltip: {
+                    trigger: 'axis'
+                },
+                series: [
+                    {
+                        data: [82, 93, 90, 93, 32, 13, 32],
+                        type: 'line',
+                        areaStyle: {},
+                        barWidth: 30,
+                        markPoint: {
+                            data: [
+                                { type: 'max', name: 'Max' },
+                                { type: 'min', name: 'Min' },
+                            ]
+                        },
+                    }
+                ],
+                color: '#0147EB'
+            })
+        },
+        bitTeam() {//各大队检查数及活跃度
+            let bigTeam = this.$echarts.init(document.getElementById("bigTeam"))
+            bigTeam.setOption({
+                title: {
+                    text: '各大队检查活跃度',
+                    textStyle: {
+                        fontSize: 12
+                    }
+                },
+                textStyle: {
+                    fontSize: 12
+                },
+                tooltip: {
+                    trigger: 'axis',
+                    axisPointer: {
+                        type: 'shadow'
+                    }
+                },
+                legend: {},
+                grid: {
+                    left: '3%',
+                    right: '4%',
+                    bottom: '3%',
+                    containLabel: true
+                },
+                xAxis: {
+                    type: 'category',
+                    data: ['Brazil', 'Indonesia', 'USA', 'India', 'China', 'World']
+                },
+                yAxis: {
+                    type: 'value',
+                    boundaryGap: [0, 0.01],
+                    min: 0,
+                    max: 1200,
+                },
+                series: [
+                    {
+                        name: '活跃度',
+                        type: 'bar',
+                        data: [200, 480, 900, 490, 740, 300],
+                        color: '#0147EB',
+                        // barWidth: 30
+                    },
+                    {
+                        name: '检查总数',
+                        type: 'bar',
+                        data: [19, 43, 31, 11, 41, 67],
+                        color: "#01BCEB",
+                        // barWidth: 30
+                    },
+                ]
+            })
+        },
+        casePeople() {//监察员事态统计
+            let people = this.$echarts.init(document.getElementById('people'))
+            people.setOption({
+                title: {
+                    text: '监督员质态统计',
+                    textStyle: {
+                        fontSize: 12
+                    }
+                },
+                tooltip: {
+                    trigger: 'axis',
+                    axisPointer: {
+                        type: 'shadow'
+                    },
+                    formatter: function (params) {
+                        var tar = params[0];
+                        return '监督人:' + tar.name + '<br/>' + '质态' + ' : ' + tar.value;
+                    }
+                },
+                xAxis: {
+                    type: 'category',
+                    data: this.peopleList
+                },
+                yAxis: {
+                    type: 'value',
+                    min: 0,
+                    max: 50,
+                },
+                series: [
+                    {
+                        data: this.peopleNum,
+                        type: 'bar',
+                        barWidth: 30
+                    }
+                ],
+                color: "#0147EB"
+            })
+        },
+        caseUnity() {//负责单位数量
+            let unity = this.$echarts.init(document.getElementById('unity'))
+            unity.setOption({
+                title: {
+                    text: '负责单位数量',
+                    textStyle: {
+                        fontSize: 12
+                    }
+                },
+                tooltip: {
+                    trigger: 'axis',
+                    axisPointer: {
+                        type: 'shadow'
+                    },
+                    formatter: function (params) {
+                        var tar = params[0];
+                        return '监督人:' + tar.name + '<br/>' + '单位数' + ' : ' + tar.value;
+                    }
+                },
+                xAxis: {
+                    type: 'category',
+                    data: this.peopleList
+                },
+                yAxis: {
+                    type: 'value',
+                    min: 0,
+                    max: 50,
+                },
+                series: [
+                    {
+                        data: this.peopleDash,
+                        type: 'bar',
+                        barWidth: 30
+                    }
+                ],
+                color: "#01BCEB"
+            })
+        },
+        initList() {
+            this.$message({
+                message: "加载数据中",
+                type: "info",
+                duration: 50000
+            })
+            smallNine.getAllPeople({}).then(res => {
+                this.peopleList = res.data.list.map(item => {
+                    return item.watcher
+                })
+                this.peopleNum = res.data.list.map(item => {
+                    return item.quality
+                })
+                this.peopleDash = res.data.list.map(item=>{
+                    return item.servorg
+                })
+                if (this.peopleList.length > 0 && this.peopleNum.length > 0) {
+                    // this.$nextTick(() => {
+                    this.$message.closeAll()
+                    this.lineSmall();
+                    this.myBit()
+                    this.bitTeam()
+                    this.casePeople()
+                    this.caseUnity()
+                    // });
+                }
+            })
+        }
+    }
+}
+</script>
+
+<style scoped>
+.bigBox {
+    width: 100%;
+    height: calc(100vh - 180px);
+    /* border: 1px solid black; */
+}
+
+.threeBox {
+    width: 100%;
+    height: auto;
+    display: flex;
+    justify-content: space-around;
+    align-items: center;
+    padding-top: 10px;
+}
+
+.allBag {
+    width: 33%;
+    height: calc(100vh - 500px);
+    /* border: 1px dashed #01BCEB; */
+    background-color: white;
+}
+
+.twoBox {
+    width: 100%;
+    height: auto;
+    display: flex;
+    justify-content: space-around;
+    align-items: center;
+    margin-top: 5px;
+}
+
+.lastBag {
+    width: 49.5%;
+    height: calc(100vh - 450px);
+    /* border: 1px solid red; */
+    background-color: white;
+}
+</style>

+ 6 - 2
src/views/backend/statistics/index.vue

@@ -10,15 +10,19 @@
     <div v-if="open == 1 || open == 0" style="width: 100%">
       <statisticsFire></statisticsFire>
     </div>
-    <div v-if="open == 2" >2</div>
+    <div v-if="open == 2" style="background-color: #F3F5F9;">
+      <StatisticsNine></StatisticsNine>
+    </div>
   </div>
 </template>
 <script>
 import { getDdlist } from "@/api/backend/statistics";
 import statisticsFire from "@/views/backend/statisticsFire/index";
+import StatisticsNine from "../stacisticsNine/StatisticsNine.vue";
 export default {
   components: {
-    statisticsFire
+    statisticsFire,
+    StatisticsNine,
   },
   data() {
     return {

+ 57 - 8
src/views/backend/tongjiBroad/index.vue

@@ -4,7 +4,10 @@
     <!-- 搜索工作栏 -->
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="消防大队" prop="deptid">
-        <el-input v-model="queryParams.deptid" ref="ksd" placeholder="请输入消防大队" clearable @keyup.enter.native="handleQuery"/>
+        <!-- <el-input v-model="queryParams.deptid" ref="ksd" placeholder="请输入消防大队" clearable @keyup.enter.native="handleQuery"/> -->
+        <el-select v-model="queryParams.deptid" clearable placeholder="请选择消防大队">
+            <el-option :label="item.deptName" :value="item.id" v-for="item in deptData" :key="item.id"></el-option>
+          </el-select>
       </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
@@ -28,7 +31,11 @@
     <!-- 列表 -->
     <el-table v-loading="loading" :data="list">
       <el-table-column label="id序号" align="center" prop="id" />
-      <el-table-column label="消防大队" align="center" prop="deptid" />
+      <el-table-column label="消防大队" align="center" prop="deptid" >
+        <template v-slot="scope">
+          {{deptList(scope.row.deptid)}}
+        </template>
+        </el-table-column>
       <el-table-column label="部门编码" align="center" prop="orgCode" />
       <el-table-column label="填报日期" align="center" prop="reportDate" />
       <el-table-column label="隐患整改时间统计" align="center" prop="adjustcount" />
@@ -67,13 +74,15 @@
     <el-dialog :title="title" :visible.sync="open" width="700px" v-dialogDrag append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="160px">
         <el-form-item label="消防大队" prop="deptid">
-          <el-input v-model="form.deptid" placeholder="请输入消防大队" />
+           <el-select v-model="form.deptid" placeholder="请选择消防大队">
+            <el-option :label="item.deptName" :value="item.id" v-for="item in deptData" :key="item.id"></el-option>
+          </el-select>
         </el-form-item>
         <el-form-item label="部门编码" prop="orgCode">
           <el-input v-model="form.orgCode" placeholder="请输入部门编码" />
         </el-form-item>
         <el-form-item label="填报日期" prop="reportDate">
-          <el-date-picker clearable v-model="form.reportDate" type="date" value-format="timestamp" placeholder="选择填报日期" />
+          <el-date-picker clearable v-model="form.reportDate" type="date" value-format="yyyy-MM-dd" placeholder="选择填报日期" />
         </el-form-item>
         <el-form-item label="隐患整改时间统计" prop="adjustcount">
           <el-input v-model="form.adjustcount" placeholder="请输入隐患整改时间统计" />
@@ -103,9 +112,7 @@
           <el-input v-model="form.dengerfixavg" placeholder="请输入隐患整改平均时间" />
         </el-form-item>
         <el-form-item label="日均扫描设备类型数" prop="avgdatedevtype">
-          <el-select v-model="form.avgdatedevtype" placeholder="请选择日均扫描设备类型数">
-            <el-option label="请选择字典生成" value="" />
-          </el-select>
+          <el-input v-model="form.avgdatedevtype" type="number" placeholder="请输入日均扫描设备类型数" />
         </el-form-item>
         <el-form-item label="设备扫码量" prop="devscantotal">
           <el-input v-model="form.devscantotal" placeholder="请输入设备扫码量" />
@@ -145,6 +152,7 @@
 
 <script>
 import { createTongjiBroad, updateTongjiBroad, deleteTongjiBroad, getTongjiBroad, getTongjiBroadPage, exportTongjiBroadExcel } from "@/api/backend/tongjiBroad";
+import { getDdlist } from "@/api/backend/statistics";
 
 export default {
   name: "TongjiBroad",
@@ -175,11 +183,13 @@ export default {
       form: {},
       // 表单校验
       rules: {
-      }
+      },
+      deptData:[]
     };
   },
   created() {
     this.getList();
+    this.getDeptData()
     this.$nextTick(()=>{
       console.log('this.$refs', this.$refs)
     })
@@ -229,6 +239,43 @@ export default {
       };
       this.resetForm("form");
     },
+    /** 获取消防大队下拉框数据 */
+    getDeptData() {
+      getDdlist().then(res=>{
+        this.deptData = res.data
+        console.log('deptData',this.deptData);
+      })
+    },
+    /** 列表消防大队转换 id2name*/
+    deptList(id) {
+      let thisDept
+      const arr = JSON.parse(JSON.stringify(this.deptData))
+      arr.forEach(item=>{
+          if(item.id == id){
+              thisDept = item
+          }
+      })
+      if(thisDept){
+        return thisDept.deptName
+      }else{
+        return ''
+      }
+    },
+    /** 列表消防大队转换 name2id*/
+    deptListName(name) {
+      let thisDept
+      const arr = JSON.parse(JSON.stringify(this.deptData))
+      arr.forEach(item=>{
+          if(item.deptName == name){
+              thisDept = item
+          }
+      })
+      if(thisDept){
+        return thisDept.id
+      }else{
+        return name
+      }
+    },
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.pageNo = 1;
@@ -251,6 +298,7 @@ export default {
       const id = row.id;
       getTongjiBroad(id).then(response => {
         this.form = response.data;
+        this.form.deptid = this.deptList(this.form.deptid)
         this.open = true;
         this.title = "修改 统计面板设置";
       });
@@ -263,6 +311,7 @@ export default {
         }
         // 修改的提交
         if (this.form.id != null) {
+          this.form.deptid = this.deptListName(this.form.deptid)
           updateTongjiBroad(this.form).then(response => {
             this.$modal.msgSuccess("修改成功");
             this.open = false;

+ 57 - 6
src/views/backend/watcher/index.vue

@@ -6,8 +6,11 @@
       <el-form-item label="监督员名称" prop="watcher">
         <el-input v-model="queryParams.watcher" placeholder="请输入监督员名称" clearable @keyup.enter.native="handleQuery"/>
       </el-form-item>
-      <el-form-item label="所属大队" prop="servorg">
-        <el-input v-model="queryParams.deptid" placeholder="请选择所属大队" clearable @keyup.enter.native="handleQuery"/>
+      <el-form-item label="所属大队" prop="deptid">
+        <!-- <el-input v-model="queryParams.deptid" placeholder="请选择所属大队" clearable @keyup.enter.native="handleQuery"/> -->
+         <el-select v-model="queryParams.deptid" clearable placeholder="请选择消防大队">
+            <el-option :label="item.deptName" :value="item.id" v-for="item in deptData" :key="item.id"></el-option>
+          </el-select>
       </el-form-item>
       <el-form-item label="质态" prop="quality">
         <el-input v-model="queryParams.quality" placeholder="请输入质态" clearable @keyup.enter.native="handleQuery"/>
@@ -38,7 +41,11 @@
     <el-table v-loading="loading" :data="list">
       <el-table-column label="id" align="center" prop="id" />
       <el-table-column label="监督员名称" align="center" prop="watcher" />
-      <el-table-column label="所属大队" align="center" prop="deptid" />
+      <el-table-column label="所属大队" align="center" prop="deptid">
+        <template v-slot="scope">
+          {{deptList(scope.row.deptid)}}
+        </template>
+        </el-table-column>
       <el-table-column label="质态" align="center" prop="quality" />
       <el-table-column label="负责单位数" align="center" prop="servorg" />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@@ -61,7 +68,10 @@
           <el-input v-model="form.watcher" placeholder="请输入监督员名称" />
         </el-form-item>
         <el-form-item label="所属大队" prop="quality">
-          <el-input v-model="form.deptid" placeholder="请选择大队" />
+          <!-- <el-input v-model="form.deptid" placeholder="请选择大队" /> -->
+          <el-select v-model="form.deptid" placeholder="请选择消防大队">
+            <el-option :label="item.deptName" :value="item.id" v-for="item in deptData" :key="item.id"></el-option>
+          </el-select>
         </el-form-item>
         <el-form-item label="质态" prop="quality">
           <el-input v-model="form.quality" placeholder="请输入质态" />
@@ -80,7 +90,7 @@
 
 <script>
 import { createWatcher, updateWatcher, deleteWatcher, getWatcher, getWatcherPage, exportWatcherExcel } from "@/api/backend/watcher";
-
+import { getDdlist } from "@/api/backend/statistics";
 export default {
   name: "Watcher",
   components: {
@@ -114,11 +124,13 @@ export default {
       form: {},
       // 表单校验
       rules: {
-      }
+      },
+      deptData:[]
     };
   },
   created() {
     this.getList();
+    this.getDeptData()
   },
   methods: {
     /** 查询列表 */
@@ -131,6 +143,43 @@ export default {
         this.loading = false;
       });
     },
+    /** 获取消防大队下拉框数据 */
+    getDeptData() {
+      getDdlist().then(res=>{
+        this.deptData = res.data
+        console.log('deptData',this.deptData);
+      })
+    },
+    /** 列表消防大队转换 id2name*/
+    deptList(id) {
+      let thisDept
+      const arr = JSON.parse(JSON.stringify(this.deptData))
+      arr.forEach(item=>{
+          if(item.id == id){
+              thisDept = item
+          }
+      })
+      if(thisDept){
+        return thisDept.deptName
+      }else{
+        return ''
+      }
+    },
+    /** 列表消防大队转换 name2id*/
+    deptListName(name) {
+      let thisDept
+      const arr = JSON.parse(JSON.stringify(this.deptData))
+      arr.forEach(item=>{
+          if(item.deptName == name){
+              thisDept = item
+          }
+      })
+      if(thisDept){
+        return thisDept.id
+      }else{
+        return name
+      }
+    },
     /** 取消按钮 */
     cancel() {
       this.open = false;
@@ -169,6 +218,7 @@ export default {
       const id = row.id;
       getWatcher(id).then(response => {
         this.form = response.data;
+        this.form.deptid = this.deptList(this.form.deptid)
         this.open = true;
         this.title = "修改监督员质态统计";
       });
@@ -181,6 +231,7 @@ export default {
         }
         // 修改的提交
         if (this.form.id != null) {
+          this.form.deptid = this.deptListName(this.form.deptid)
           updateWatcher(this.form).then(response => {
             this.$modal.msgSuccess("修改成功");
             this.open = false;

Разлика између датотеке није приказан због своје велике величине
+ 336 - 341
yarn.lock


Неке датотеке нису приказане због велике количине промена