From 22bbdc4cf63f0c82cafd445bc475e2128fcd43c3 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Thu, 16 Sep 2021 09:41:23 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/zhba_regulatory
---
src/views/securityUnitOperation/operationAnalysis.vue | 474 +++++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 350 insertions(+), 124 deletions(-)
diff --git a/src/views/securityUnitOperation/operationAnalysis.vue b/src/views/securityUnitOperation/operationAnalysis.vue
index 6879482..ebaee46 100644
--- a/src/views/securityUnitOperation/operationAnalysis.vue
+++ b/src/views/securityUnitOperation/operationAnalysis.vue
@@ -6,29 +6,27 @@
<div class="rowTitle">
<img src="../../../public/img/bajgxt/u1618.png" />
<span>数据概览</span>
-
- <!-- <el-select class="select0" v-model="value0" placeholder="请选择">
- <el-option
- v-for="item in options0"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select> -->
- <el-select
+ <avue-input-tree
class="select1"
+ default-expand-all
v-model="value1"
- placeholder="请选择"
- @change="fenjuChange"
- >
- <el-option
- v-for="item in options1"
- :key="item.id"
- :label="item.title"
- :value="item.id"
- ></el-option>
- </el-select>
- <el-select
+ placeholder="请选择内容"
+ type="tree"
+ :dic="options1"
+ :props="props"
+ @change="handleNodeClick"
+ ></avue-input-tree>
+ <avue-input-tree
+ class="select2"
+ default-expand-all
+ v-model="value2"
+ placeholder="请选择公司"
+ type="tree"
+ :dic="options2"
+ :props="props2"
+ @change="changeCompanys"
+ ></avue-input-tree>
+ <!-- <el-select
class="select2"
v-model="value2"
placeholder="请选择"
@@ -40,7 +38,7 @@
:label="item.enterpriseName"
:value="item.departmentid"
></el-option>
- </el-select>
+ </el-select> -->
<el-button @click="toOperationTable">进入数据统计表</el-button>
</div>
@@ -60,11 +58,11 @@
<span>{{ card.czBaoan }}</span>
<span>较上月增加{{ card.addczBaoan }}人</span>
</div>
- <div class="box-card">
+ <!-- <div class="box-card">
<span>过考保安员</span>
<span>{{ card.gkBaoan }}</span>
<span>较上月增加{{ card.addgkBaoan }}人</span>
- </div>
+ </div> -->
<div class="box-card">
<span>服务客户</span>
<span>{{ card.kh }}</span>
@@ -111,19 +109,19 @@
<div class="leftEchartTitle qing">
<div class="block1"></div>
<span>青年</span>
- <span>11</span>
+ <span>{{ ageData.qing }}</span>
<span>人</span>
</div>
<div class="leftEchartTitle zhong">
<div class="block1"></div>
<span>中年</span>
- <span>321</span>
+ <span>{{ ageData.zhong }}</span>
<span>人</span>
</div>
<div class="leftEchartTitle lao">
<div class="block1"></div>
<span>老年</span>
- <span>123</span>
+ <span>{{ ageData.lao }}</span>
<span>人</span>
</div>
<div id="bottomEchart1"></div>
@@ -136,12 +134,13 @@
<script>
import * as echarts from "echarts";
import echartJs from "./securityEchart.js";
-import { lazyTreeJu } from "../../api/index/index";
+import { lazyTreeJu, lazyTrees } from "../../api/index/index";
import {
queryCounts,
getCompanys,
queryYearKh,
- queryYearG
+ queryYearG,
+ selectAge
} from "../../api/securityUnitOperation/securityUnitOperation";
export default {
data() {
@@ -203,20 +202,55 @@
middleEchart2: null,
bottomEchart: null,
bottomEchart1: null
- }
+ },
+ ageData: {
+ qing: 0,
+ zhong: 0,
+ lao: 0
+ },
+ props: {
+ children: "children",
+ label: "title",
+ value: "id"
+ },
+ props2: {
+ children: "children",
+ label: "enterpriseName",
+ value: "departmentid"
+ },
+ node: {} //选中的记录
};
},
methods: {
- setEchart() {
- let data = [];
-
- let data1 = [];
- if (!this.echartDom.bottomEchart1) {
- this.echartDom.bottomEchart1 = echarts.init(
- document.getElementById("bottomEchart1")
- );
- this.echartDom.bottomEchart1.setOption(echartJs.bottomOption2(data1));
- }
+ //点击节点
+ handleNodeClick(id) {
+ this.value1 = id;
+ this.getCompanys();
+ },
+ setAgeEchart() {
+ this.loading4 = true;
+ let params = {
+ jurisdiction: this.value1,
+ deptid: this.value2
+ };
+ selectAge(params).then(res => {
+ if (res.data.code === 200) {
+ if (!this.echartDom.bottomEchart1) {
+ this.echartDom.bottomEchart1 = echarts.init(
+ document.getElementById("bottomEchart1")
+ );
+ }
+ this.echartDom.bottomEchart1.setOption(
+ echartJs.bottomOption2(res.data.data)
+ );
+ this.ageData.qing = res.data.data.qcount;
+ this.ageData.zhong = res.data.data.zcount;
+ this.ageData.lao = res.data.data.lcount;
+ } else {
+ this.$message.error(res.data.msg);
+ }
+ this.loading4 = false;
+ });
},
toOperationTable() {
this.$router.push({
@@ -232,19 +266,19 @@
getFenju() {
this.options1 = [];
this.value1 = "";
- lazyTreeJu().then(res => {
+ this.node = {};
+ lazyTrees().then(res => {
if (res.data.code === 200) {
this.options1 = res.data.data;
this.value1 = this.options1[0] ? this.options1[0].id : "";
+ this.node = this.options1[0];
this.getCompanys();
} else {
this.$message.error(res.msg);
}
});
},
- fenjuChange() {
- this.getCompanys();
- },
+
getCompanys() {
getCompanys({ jurisdiction: this.value1 }).then(res => {
if (res.data.code === 200) {
@@ -352,6 +386,11 @@
baoanPq: 0,
addbaoanPq: 0
};
+ this.ageData = {
+ qing: 0,
+ zhong: 0,
+ lao: 0
+ };
},
changeCompanys() {
this.options2.forEach(item => {
@@ -363,15 +402,280 @@
this.getQueryCounts();
this.getQueryYearKh();
this.getQueryYearG();
+ this.setAgeEchart();
}
},
mounted() {
- this.setEchart();
this.getFenju();
}
};
</script>
<style lang="scss" scoped>
+@media screen and (max-width: 1280px) {
+ .box-card {
+ font-size: 15px;
+ width: 128px;
+ background: #00aaf1;
+ height: 117px;
+ text-align: center;
+ margin-right: 28px;
+ box-shadow: 5px 5px 5px rgba($color: #000, $alpha: 0.35);
+ line-height: 36px;
+ span:nth-child(2) {
+ color: #06ffff;
+ font-size: 31px;
+ }
+ }
+ .col-content {
+ margin-top: 39px !important;
+ }
+ .leftEchartTitle.qing {
+ right: 10px;
+ margin-top: 42px;
+ .block1 {
+ background: #73c0de;
+ margin-top: 11px;
+ width: 10px;
+ height: 10px;
+ border-radius: 100%;
+ }
+ span:nth-child(2) {
+ color: #fff;
+ font-size: 12px;
+ margin: 0px 3px 0px 3px;
+ }
+ span:nth-child(3) {
+ color: #73c0de;
+ font-size: 15px;
+ width: 45px;
+ }
+ span:nth-child(4) {
+ font-size: 12px;
+ color: #73c0de;
+ }
+ }
+ .leftEchartTitle.zhong {
+ right: 10px;
+ margin-top: 83px;
+ .block1 {
+ width: 10px;
+ height: 10px;
+ border-radius: 100%;
+ background: #fac858;
+ margin-top: 11px;
+ }
+ span:nth-child(2) {
+ color: #fff;
+ font-size: 12px;
+ margin: 0px 3px 0px 3px;
+ }
+ span:nth-child(3) {
+ color: #fac858;
+ font-size: 15px;
+ width: 45px;
+ }
+ span:nth-child(4) {
+ font-size: 12px;
+ color: #fac858;
+ }
+ }
+ .leftEchartTitle.lao {
+ right: 10px;
+ margin-top: 125px;
+ .block1 {
+ width: 10px;
+ height: 10px;
+ border-radius: 100%;
+ background: #91cc75;
+ margin-top: 11px;
+ }
+ span:nth-child(2) {
+ color: #fff;
+ font-size: 12px;
+ margin: 0px 3px 0px 3px;
+ }
+ span:nth-child(3) {
+ color: #91cc75;
+ font-size: 15px;
+ width: 45px;
+ }
+ span:nth-child(4) {
+ font-size: 12px;
+ color: #91cc75;
+ }
+ }
+}
+// 适配分辨率1600*900
+@media screen and (min-width: 1281px) and (max-width: 1600px) {
+ .box-card {
+ font-size: 15px;
+ width: 128px;
+ background: #00aaf1;
+ height: 117px;
+ text-align: center;
+ margin-right: 66px;
+ box-shadow: 5px 5px 5px rgba($color: #000, $alpha: 0.35);
+ line-height: 36px;
+ span:nth-child(2) {
+ color: #06ffff;
+ font-size: 31px;
+ }
+ }
+ .leftEchartTitle.qing {
+ right: 37px;
+ margin-top: 42px;
+ .block1 {
+ width: 10px;
+ height: 10px;
+ background: #73c0de;
+ margin-top: 10px;
+ border-radius: 100%;
+ }
+ span:nth-child(2) {
+ color: #fff;
+ font-size: 13px;
+ }
+ span:nth-child(3) {
+ color: #73c0de;
+ font-size: 17px;
+ }
+ span:nth-child(4) {
+ font-size: 13px;
+ color: #73c0de;
+ }
+ }
+ .leftEchartTitle.zhong {
+ right: 37px;
+ margin-top: 83px;
+ .block1 {
+ width: 10px;
+ height: 10px;
+ background: #fac858;
+ margin-top: 10px;
+ border-radius: 100%;
+ }
+ span:nth-child(2) {
+ color: #fff;
+ font-size: 13px;
+ }
+ span:nth-child(3) {
+ color: #fac858;
+ font-size: 17px;
+ }
+ span:nth-child(4) {
+ font-size: 13px;
+ color: #fac858;
+ }
+ }
+ .leftEchartTitle.lao {
+ right: 37px;
+ margin-top: 125px;
+ .block1 {
+ width: 10px;
+ height: 10px;
+ background: #91cc75;
+ margin-top: 10px;
+ border-radius: 100%;
+ }
+ span:nth-child(2) {
+ color: #fff;
+ font-size: 13px;
+ }
+ span:nth-child(3) {
+ color: #91cc75;
+ font-size: 17px;
+ }
+ span:nth-child(4) {
+ font-size: 13px;
+ color: #91cc75;
+ }
+ }
+}
+@media screen and (min-width: 1601px) and (max-width: 1920px) {
+ .box-card {
+ width: 150px;
+ background: #00aaf1;
+ height: 135px;
+ text-align: center;
+ margin-right: 66px;
+ box-shadow: 5px 5px 5px rgba($color: #000, $alpha: 0.35);
+ line-height: 40px;
+ span:nth-child(2) {
+ color: #06ffff;
+ font-size: 34px;
+ }
+ }
+ .leftEchartTitle.qing {
+ right: 37px;
+ margin-top: 42px;
+ .block1 {
+ width: 10px;
+ height: 10px;
+ background: #73c0de;
+ margin-top: 10px;
+ border-radius: 100%;
+ }
+ span:nth-child(2) {
+ color: #fff;
+ font-size: 13px;
+ }
+ span:nth-child(3) {
+ color: #73c0de;
+ font-size: 17px;
+ }
+ span:nth-child(4) {
+ font-size: 13px;
+ color: #73c0de;
+ }
+ }
+ .leftEchartTitle.zhong {
+ right: 37px;
+ margin-top: 83px;
+ .block1 {
+ width: 10px;
+ height: 10px;
+ background: #fac858;
+ margin-top: 10px;
+ border-radius: 100%;
+ }
+ span:nth-child(2) {
+ color: #fff;
+ font-size: 13px;
+ }
+ span:nth-child(3) {
+ color: #fac858;
+ font-size: 17px;
+ }
+ span:nth-child(4) {
+ font-size: 13px;
+ color: #fac858;
+ }
+ }
+ .leftEchartTitle.lao {
+ right: 37px;
+ margin-top: 125px;
+ .block1 {
+ width: 10px;
+ height: 10px;
+ background: #91cc75;
+ margin-top: 10px;
+ border-radius: 100%;
+ }
+ span:nth-child(2) {
+ color: #fff;
+ font-size: 13px;
+ }
+ span:nth-child(3) {
+ color: #91cc75;
+ font-size: 17px;
+ }
+ span:nth-child(4) {
+ font-size: 13px;
+ color: #91cc75;
+ }
+ }
+}
+
.page1 {
height: 100%;
width: 100%;
@@ -410,23 +714,11 @@
font-weight: 600;
}
}
-.box-card {
- width: 150px;
- background: #00aaf1;
- height: 135px;
- text-align: center;
- margin-right: 66px;
- box-shadow: 5px 5px 5px rgba($color: #000, $alpha: 0.35);
- line-height: 40px;
-}
+
.box-card span {
display: block;
width: 100%;
color: #fff;
-}
-.box-card span:nth-child(2) {
- color: #06ffff;
- font-size: 34px;
}
.rowTitle {
height: 40px;
@@ -498,72 +790,6 @@
span:nth-child(4) {
font-size: 13px;
color: #2ec7c9;
- }
-}
-.leftEchartTitle.qing {
- right: 37px;
- margin-top: 42px;
- .block1 {
- width: 30px;
- height: 15px;
- background: #73c0de;
- margin-top: 7px;
- }
- span:nth-child(2) {
- color: #fff;
- font-size: 13px;
- }
- span:nth-child(3) {
- color: #73c0de;
- font-size: 17px;
- }
- span:nth-child(4) {
- font-size: 13px;
- color: #73c0de;
- }
-}
-.leftEchartTitle.zhong {
- right: 37px;
- margin-top: 83px;
- .block1 {
- width: 30px;
- height: 15px;
- background: #fac858;
- margin-top: 7px;
- }
- span:nth-child(2) {
- color: #fff;
- font-size: 13px;
- }
- span:nth-child(3) {
- color: #fac858;
- font-size: 17px;
- }
- span:nth-child(4) {
- font-size: 13px;
- color: #fac858;
- }
-}
-.leftEchartTitle.lao {
- right: 37px;
- margin-top: 125px;
- .block1 {
- width: 30px;
- height: 15px;
- background: #91cc75;
- margin-top: 7px;
- }
- span:nth-child(2) {
- color: #fff;
- font-size: 13px;
- }
- span:nth-child(3) {
- color: #91cc75;
- font-size: 17px;
- }
- span:nth-child(4) {
- font-size: 13px;
- color: #91cc75;
}
}
</style>
--
Gitblit v1.9.3