From 9d792bbd1fa6ef7136dcca1cc2bd907dba9e6f57 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 03 Sep 2021 16:20:43 +0800
Subject: [PATCH] 视频相关更改
---
src/views/securityUnitOperation/operationAnalysis.vue | 104 ++++++++++++++++++++++++++++++++++++---------------
1 files changed, 73 insertions(+), 31 deletions(-)
diff --git a/src/views/securityUnitOperation/operationAnalysis.vue b/src/views/securityUnitOperation/operationAnalysis.vue
index 6879482..3da4c0b 100644
--- a/src/views/securityUnitOperation/operationAnalysis.vue
+++ b/src/views/securityUnitOperation/operationAnalysis.vue
@@ -17,16 +17,20 @@
</el-select> -->
<el-select
class="select1"
- v-model="value1"
+ ref="treeForm"
+ v-model="node.title"
placeholder="请选择"
- @change="fenjuChange"
>
- <el-option
- v-for="item in options1"
- :key="item.id"
- :label="item.title"
- :value="item.id"
- ></el-option>
+ <el-option style="height: auto;" :value="node">
+ <el-tree
+ :data="options1"
+ default-expand-all
+ node-key="id"
+ @node-click="handleNodeClick"
+ :props="props"
+ >
+ </el-tree>
+ </el-option>
</el-select>
<el-select
class="select2"
@@ -60,11 +64,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 +115,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 +140,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 +208,52 @@
middleEchart2: null,
bottomEchart: null,
bottomEchart1: null
- }
+ },
+ ageData: {
+ qing: 0,
+ zhong: 0,
+ lao: 0
+ },
+ props: {
+ children: "children",
+ label: "title",
+ value: "id"
+ },
+ 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(data) {
+ this.node = data;
+ this.value1 = data.id;
+ this.$refs.treeForm.blur();
+ 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 +269,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 +389,11 @@
baoanPq: 0,
addbaoanPq: 0
};
+ this.ageData = {
+ qing: 0,
+ zhong: 0,
+ lao: 0
+ };
},
changeCompanys() {
this.options2.forEach(item => {
@@ -363,10 +405,10 @@
this.getQueryCounts();
this.getQueryYearKh();
this.getQueryYearG();
+ this.setAgeEchart();
}
},
mounted() {
- this.setEchart();
this.getFenju();
}
};
--
Gitblit v1.9.3