From 0a8e4f9371a403db92f2894a78363600e5583908 Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期四, 15 十二月 2022 22:12:08 +0800
Subject: [PATCH] 优化
---
src/views/intelligentPatrol/studyJudge/index.vue | 35 +++---
src/components/map/index.vue | 2
src/views/intelligentPatrol/trendAnalysis/index.vue | 216 +++++++++++++++++++++++++------------------
3 files changed, 145 insertions(+), 108 deletions(-)
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index 3377fbe..f16b949 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -27,7 +27,7 @@
// console.log("_zoom---", that.zoom);
// console.log("_point---", JSON.stringify(that.point));
- that.map.setZoomAndCenter(that._zoom, [that.point.x, that.point.y]);
+ that.map.setZoomAndCenter(that.zoom, [that.point.x, that.point.y]);
if (that.mark) {
// 鍒涘缓涓�涓� Marker 瀹炰緥锛�
var marker = new AMap.Marker({
diff --git a/src/views/intelligentPatrol/studyJudge/index.vue b/src/views/intelligentPatrol/studyJudge/index.vue
index 305858c..b9e8b1c 100644
--- a/src/views/intelligentPatrol/studyJudge/index.vue
+++ b/src/views/intelligentPatrol/studyJudge/index.vue
@@ -31,7 +31,7 @@
<!-- <span>{{ currentEvent.address }}</span>-->
<!-- </div>-->
<span @click="openDialogTable" class="count-data-span"
- >鎮ㄦ湁{{ countData.review }}鏉″緟瀹℃牳鎶ヨ淇℃伅,浠婃棩绔嬫{{
+ >鎮ㄦ湁{{ countData.review }}鏉″緟瀹℃牳鎶ヨ淇℃伅,浠婃棩绔嬫{{
countData.register
}}鏉�,鍐嶅涔爗{ countData.study }}鏉�</span
>
@@ -229,7 +229,7 @@
</div>
</el-dialog>
<el-dialog :visible.sync="isShowTable" title="鎶ヨ淇℃伅" width="1200px">
- <inspection-table/>
+ <inspection-table />
</el-dialog>
</div>
</template>
@@ -245,17 +245,11 @@
import MyMap from "@/components/map";
export default {
- components: { MyDispatch, MyMap,InspectionTable },
+ components: { MyDispatch, MyMap, InspectionTable },
created() {
this.getInspectionData();
this.initEventParams();
- basecase
- .getInspectionCountData()
- .then((res) => {
- this.countData = res;
- })
- .catch((err) => this.$message.error(err));
-
+ this.getInspectionCount();
getStoreInfoList({ current: 1, size: 100 })
.then(({ list }) => {
this.storeList = list;
@@ -280,7 +274,7 @@
},
mounted() {
this.timer = setInterval(() => {
- setTimeout(this.getInspectionData, 0);
+ this.getInspectionCount();
}, 1000 * 10);
},
data() {
@@ -296,7 +290,7 @@
}
};
return {
- isShowTable:false,
+ isShowTable: false,
timer: null,
countData: {
study: 0,
@@ -374,8 +368,18 @@
};
},
methods: {
- openDialogTable(){
- this.isShowTable = true
+ getInspectionCount() {
+ basecase
+ .getInspectionCountData({
+ showLoading: false,
+ })
+ .then((res) => {
+ this.countData = res;
+ })
+ .catch((err) => this.$message.error(err));
+ },
+ openDialogTable() {
+ this.isShowTable = true;
},
pageChange(type) {
if (type === "next") {
@@ -689,13 +693,12 @@
.sjm-content-left {
line-height: 4.8vh;
- .count-data-span{
+ .count-data-span {
cursor: pointer;
color: #66b1ff;
}
.left-form > ::v-deep.el-form-item__label {
font-size: 16px !important;
-
}
.img-item {
display: flex;
diff --git a/src/views/intelligentPatrol/trendAnalysis/index.vue b/src/views/intelligentPatrol/trendAnalysis/index.vue
index 5d5a93a..dc2095e 100644
--- a/src/views/intelligentPatrol/trendAnalysis/index.vue
+++ b/src/views/intelligentPatrol/trendAnalysis/index.vue
@@ -1,67 +1,83 @@
<template>
- <div class="trend-analysis">
- <!-- 渚ц竟鏍� -->
- <div class="trend-side">
- <!-- 杈撳叆鍖哄煙 -->
- <div class="trend-input-area">
- <span class="trend-title">瓒嬪娍鍒嗘瀽</span>
- <el-form ref="form" :model="search" label-width="6vw">
-<!-- <el-form-item label="绫诲瀷鏌ヨ">-->
-<!-- <el-select v-model="search.type" @change="searchList" placeholder="鍐呭淇℃伅">-->
-<!-- <el-option v-for="option in categoryOptions" :key="option.value" :value="option.value" :label="option.label" ></el-option>-->
-<!-- </el-select>-->
-<!-- </el-form-item>-->
- <el-form-item class="time-area" label="鏃堕棿鑼冨洿">
- <el-date-picker @change="searchList" start-placeholder="寮�濮嬫椂闂�" end-placeholder="缁撴潫鏃堕棿" v-model="search.timeRange"
- type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss">
- </el-date-picker>
- </el-form-item>
- </el-form>
- </div>
- <!-- 鏁版嵁灞曠ず -->
- <div class="trend-data-show">
- <!-- 鐐逛綅鍒囨崲 -->
- <div class="trend-data-header">
- <el-button type="text" @click="tabChange(1)">楂樺彂鐐逛綅</el-button>
- <el-button type="text" @click="tabChange(2)">棣栨杩濊鐐逛綅</el-button>
+ <div style="height: 95%">
+ <div class="trend-title">瓒嬪娍鍒嗘瀽</div>
+ <div class="trend-analysis">
+ <div class="trend-side">
+ <!-- 杈撳叆鍖哄煙 -->
+ <div class="trend-input-area">
+ <el-form ref="form" :model="search" label-width="6vw">
+ <!-- <el-form-item label="绫诲瀷鏌ヨ">-->
+ <!-- <el-select v-model="search.type" @change="searchList" placeholder="鍐呭淇℃伅">-->
+ <!-- <el-option v-for="option in categoryOptions" :key="option.value" :value="option.value" :label="option.label" ></el-option>-->
+ <!-- </el-select>-->
+ <!-- </el-form-item>-->
+ <el-form-item class="time-area" label="鏃堕棿鑼冨洿">
+ <el-date-picker
+ @change="searchList"
+ start-placeholder="寮�濮嬫椂闂�"
+ end-placeholder="缁撴潫鏃堕棿"
+ v-model="search.timeRange"
+ type="datetimerange"
+ value-format="yyyy-MM-dd HH:mm:ss"
+ >
+ </el-date-picker>
+ </el-form-item>
+ </el-form>
</div>
- <!-- 瀵瑰簲鏁版嵁 -->
- <div class="trend-data-main">
- <div class="point-item" v-for="item in trendAnalysisList" :key="item.id" @click="pointClick(item)">
- <span class="point-name">{{ item.name }}</span>
- <span>{{ item.count }}</span>
+ <!-- 鏁版嵁灞曠ず -->
+ <div class="trend-data-show">
+ <!-- 鐐逛綅鍒囨崲 -->
+ <div class="trend-data-header">
+ <el-button type="text" @click="tabChange(1)">楂樺彂鐐逛綅</el-button>
+ <el-button type="text" @click="tabChange(2)"
+ >棣栨杩濊鐐逛綅</el-button
+ >
+ </div>
+ <!-- 瀵瑰簲鏁版嵁 -->
+ <div class="trend-data-main">
+ <div
+ class="point-item"
+ v-for="item in trendAnalysisList"
+ :key="item.id"
+ @click="pointClick(item)"
+ >
+ <span class="point-name">{{ item.name }}</span>
+ <span>{{ item.count }}</span>
+ </div>
</div>
</div>
</div>
- </div>
- <div class="trend-main">
-
- <div class="map">
- <MyMap :point="point" :zoom="zoom" :mark="mark" @fatherMethod="fatherMethod"></MyMap>
+ <div class="trend-main">
+ <div class="map">
+ <MyMap
+ :point="point"
+ :zoom="zoom"
+ :mark="mark"
+ @fatherMethod="fatherMethod"
+ ></MyMap>
+ </div>
</div>
-
- </div>
- <el-dialog
- title="鎻愮ず"
+ <el-dialog
+ title="瓒嬪娍鍥�"
:visible.sync="echartsDialogVisible"
- width="30%"
- :before-close="handleClose">
- <div style="height: 500px;width: 500px;" id="echarts">
- </div>
- </el-dialog>
+ :before-close="handleClose"
+ >
+ <div style="height: 500px; width: 500px" id="echarts"></div>
+ </el-dialog>
+ </div>
</div>
</template>
<script>
-import * as echarts from 'echarts'
+import * as echarts from "echarts";
import basecase from "@/api/operate/basecase";
import { CATEGOTY } from "@/utils/helper";
import MyMap from "@/components/map";
export default {
- components :{MyMap},
+ components: { MyMap },
created() {
- this.searchList()
+ this.searchList();
},
mounted() {
@@ -71,16 +87,17 @@
computed: {
categoryOptions() {
return CATEGOTY;
- }
+ },
},
data() {
return {
- echartsList:null,
- echartsDialogVisible:false,
+ echartsDateList: [],
+ echartsDataList: null,
+ echartsDialogVisible: false,
search: {
type: null,
- timeRange: null
+ timeRange: null,
},
timeRangeFlag: false,
trendAnalysisList: [],
@@ -89,40 +106,39 @@
pointName: null,
point: { x: "119.27179890", y: "28.59027084" },
mark: null,
- zoom: 15,
- }
+ zoom: 13,
+ };
},
methods: {
- fatherMethod(){
- console.log('7777')
- this.echartsDialogVisible=true
- this.$nextTick(function (){
- this.renderEchart(this.echartsList);
-
- })
+ fatherMethod() {
+ this.echartsDialogVisible = true;
+ this.$nextTick(function () {
+ this.renderEchart(this.echartsDateList, this.echartsDataList);
+ });
},
- handleClose(){
- this.echartsDialogVisible = false
+ handleClose() {
+ this.echartsDialogVisible = false;
},
- renderEchart(dataList) {
+ renderEchart(dateTimeList, dataList) {
if (!this.echarts) {
- this.echarts = echarts.init(document.getElementById('echarts'));
+ this.echarts = echarts.init(document.getElementById("echarts"));
}
// 缁樺埗鍥捐〃
this.echarts.setOption({
xAxis: {
- name: '鏃�/鍛�',
+ name: "鏃�/鍛�",
+ data: dateTimeList,
},
yAxis: {
- name: '鎶ヨ閲�(娆�)',
+ name: "鎶ヨ閲�(娆�)",
},
series: [
{
data: dataList,
- type: 'line',
- smooth: true
- }
- ]
+ type: "line",
+ smooth: true,
+ },
+ ],
});
},
async searchList() {
@@ -130,10 +146,11 @@
const trendAnalysisParam = {
startTime,
endTime,
- type: this.search.type
- }
- this.trendAnalysisList = this.highFlag ? await basecase.getTrendAnalysisData(trendAnalysisParam)
- : await basecase.getFirstTrendAnalysisData(trendAnalysisParam);
+ type: this.search.type,
+ };
+ this.trendAnalysisList = this.highFlag
+ ? await basecase.getTrendAnalysisData(trendAnalysisParam)
+ : await basecase.getFirstTrendAnalysisData(trendAnalysisParam);
},
tabChange(params) {
@@ -144,27 +161,43 @@
pointClick(data) {
this.pointName = data.name;
this.point = {
- x: data.longitude,
- y: data.latitude,
- };
+ x: data.longitude,
+ y: data.latitude,
+ };
this.zoom = 19;
this.mark = { title: data.address };
- basecase.getPointTrendAnalysisData({ longitude: data.longitude,latitude: data.latitude })
- .then(res => {
- // const countList = res.map(item => +item.count);
- this.echartsList= res.map(item => +item.count);
- // this.renderEchart(countList);
- })
- .catch(err => this.$message.error(err))
- }
+ basecase
+ .getPointTrendAnalysisData({
+ longitude: data.longitude,
+ latitude: data.latitude,
+ })
+ .then((res) => {
+ // const countList = res.map(item => +item.count);
+ this.echartsDataList = [];
+ this.echartsDateList = [];
+ res.forEach((item) => {
+ this.echartsDataList.push(item.count);
+ this.echartsDateList.push(item.dateTime);
+ });
+ // this.renderEchart(countList);
+ })
+ .catch((err) => this.$message.error(err));
+ },
},
-}
+};
</script>
<style lang="scss" scoped>
+.trend-title {
+ color: #4b9bb7;
+ line-height: 40px;
+ font-size: 26px;
+ text-align: left;
+ margin-left: 20px;
+}
.trend-analysis {
height: 100%;
- padding: 10vh 0vw;
+ padding: 10px 0px;
color: #4b9bb7;
display: flex;
@@ -179,7 +212,7 @@
flex-direction: column;
padding: 0 2vw;
- &>span {
+ & > span {
line-height: 40px;
}
@@ -202,7 +235,7 @@
border: 2px solid #09152f;
}
- .el-button+.el-button {
+ .el-button + .el-button {
margin: 0;
}
}
@@ -212,7 +245,7 @@
display: flex;
padding: 0 2vw;
justify-content: space-between;
- .point-name{
+ .point-name {
cursor: pointer;
color: #66b1ff;
}
@@ -225,6 +258,7 @@
flex: 1;
border: 1px solid #09152f;
display: flex;
+ margin-left: 20px;
.trend-main-echarts {
width: 500px;
height: 400px;
@@ -239,6 +273,6 @@
}
.map {
height: 100%;
- min-width: 80%;
+ width: 98%;
}
</style>
--
Gitblit v1.8.0