fix:大屏联调接口,待验证完善

This commit is contained in:
SunTao 2024-11-18 13:49:59 +08:00
parent 13c6607cbd
commit 1590e2acc6
7 changed files with 564 additions and 87 deletions

View File

@ -35,7 +35,7 @@ export function roadToday(query) {
}); });
} }
// 今日巡查弹窗 // 今日巡查病害弹窗
export function roadTodayDetail(query) { export function roadTodayDetail(query) {
return request({ return request({
url: "/bigscreen/v2/getInspectionDetailInfo", url: "/bigscreen/v2/getInspectionDetailInfo",
@ -90,6 +90,15 @@ export function getMileage(query) {
}); });
} }
// 获取巡查里程弹窗数据
export function getMileageDetail(query) {
return request({
url: "/bigscreen/v2/getTaskDetailInfo",
method: "get",
params: query,
});
}
// 获取巡检车辆数据 // 获取巡检车辆数据
export function getCarList(query) { export function getCarList(query) {
return request({ return request({

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-24 15:03:28 * @Date: 2024-10-24 15:03:28
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-11-15 16:13:41 * @LastEditTime: 2024-11-18 10:09:30
* @FilePath: \znxjxt-ui\src\api\xj\screen\index.js * @FilePath: \znxjxt-ui\src\api\xj\screen\index.js
* @Description: 大屏首页接口 * @Description: 大屏首页接口
*/ */
@ -113,3 +113,11 @@ export function getRoadListTypes() {
method: "post", method: "post",
}); });
} }
// 获取病害类型筛选级联下拉
export function getDefectTypes() {
return request({
url: "/bigscreen/v2/getDefectTypesDrowDown",
method: "get",
});
}

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-21 09:59:32 * @Date: 2024-10-21 09:59:32
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-11-13 13:39:33 * @LastEditTime: 2024-11-18 13:37:03
* @FilePath: \znxjxt-ui\src\views\big-screen\traffic-components\traffic-safety.vue * @FilePath: \znxjxt-ui\src\views\big-screen\traffic-components\traffic-safety.vue
* @Description: 病害巡检大屏-今日巡查 * @Description: 病害巡检大屏-今日巡查
--> -->
@ -10,10 +10,10 @@
<template> <template>
<div class="content"> <div class="content">
<div class="traffic-left"> <div class="traffic-left">
<span>{{ today }}</span> <span @click="showDialog('today')">{{ today }}</span>
</div> </div>
<div class="traffic-right"> <div class="traffic-right">
<div class="right-sum" @click="showDialog"> <div class="right-sum" @click="showDialog('')">
<span>{{ all }}</span <span>{{ all }}</span
> >
</div> </div>
@ -33,8 +33,44 @@
@close="screenCancel" @close="screenCancel"
> >
<div class="today-content"> <div class="today-content">
<div ref="leftChart" class="dialog-div"></div> <div class="today-select">
<div ref="rightChart" class="dialog-div"></div> <div>
<el-select
:popper-append-to-body="false"
v-model="roadSelect"
@change="changeRoad"
clearable
placeholder="请选择路段"
>
<el-option
v-for="item in roadList"
:key="`${item.name}-${item.index}`"
:label="item.name"
:value="item.name"
/>
</el-select>
</div>
<div>
<el-select
:popper-append-to-body="false"
v-model="companySelect"
clearable
@change="changeCompany"
placeholder="请选择分公司"
>
<el-option
v-for="item in companyList"
:key="`${item.name}-${item.index}`"
:label="item.name"
:value="item.name"
/>
</el-select>
</div>
</div>
<div class="today-bottom">
<div ref="leftChart" class="dialog-div"></div>
<div ref="rightChart" class="dialog-div"></div>
</div>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
@ -62,8 +98,20 @@ export default {
scale: 0, scale: 0,
// //
showDialogVisible: false, showDialogVisible: false,
//
roadSelect: "",
//
roadList: [],
//
leftChartList: [],
// //
leftChartData: [], leftChartData: [],
//
companySelect: "",
//
companyList: [],
//
rightChartList: [],
// //
rightChartData: [], rightChartData: [],
}; };
@ -91,18 +139,58 @@ export default {
}, },
/* 点击打开弹窗 */ /* 点击打开弹窗 */
showDialog() { showDialog(item) {
this.getChartData(); this.getChartData(item);
this.showDialogVisible = true; this.showDialogVisible = true;
}, },
/* 弹窗路段修改事件 */
changeRoad(value) {
this.leftChartData = this.leftChartList.filter((item) => {
if (value) {
return item.name === value;
}
return item;
});
this.$nextTick(() => {
this.drawLeftChart();
});
},
/* 弹窗公司修改事件 */
changeCompany(value) {
this.rightChartData = this.rightChartList.filter((item) => {
if (value) {
return item.name === value;
}
return item;
});
this.$nextTick(() => {
this.drawRightChart();
});
},
/* 请求弹窗数据 */ /* 请求弹窗数据 */
getChartData() { getChartData(item) {
roadTodayDetail({ classType: this.bottomTipClick }).then( roadTodayDetail({ classType: this.bottomTipClick, type: item }).then(
({ code, data }) => { ({ code, data }) => {
if (code === 200) { if (code === 200) {
this.leftChartList = data[0];
this.leftChartData = data[0]; this.leftChartData = data[0];
this.roadList = data[0].map((item, index) => {
return {
...item,
index: index,
};
});
this.rightChartList = data[1];
this.rightChartData = data[1]; this.rightChartData = data[1];
this.companyList = data[1].map((item, index) => {
return {
...item,
index: index,
};
});
this.$nextTick(() => { this.$nextTick(() => {
this.drawLeftChart(); this.drawLeftChart();
this.drawRightChart(); this.drawRightChart();
@ -268,6 +356,51 @@ export default {
data: y4Data, data: y4Data,
}, },
], ],
dataZoom: [
{
//
show: false,
//
type: "slider",
//
backgroundColor: "rgba(225,225,225,0.2)",
//
fillerColor: "#ccc",
//
borderColor: "rgba(225,225,225,0.2)",
// detail
showDetail: false,
//
startValue: 0,
//
endValue: 6,
// empty
//
filterMode: "empty",
//
width: "80%",
//
height: 5,
//
left: "center",
//
zoomLoxk: true,
//
handleSize: 10,
// dataZoom-slider
bottom: 0,
},
{
//
//
type: "inside",
//
zoomOnMouseWheel: false,
//
moveOnMouseMove: true,
moveOnMouseWheel: true,
},
],
}); });
window.addEventListener("resize", () => { window.addEventListener("resize", () => {
chart.resize(); chart.resize();
@ -424,6 +557,51 @@ export default {
data: y4Data, data: y4Data,
}, },
], ],
dataZoom: [
{
//
show: false,
//
type: "slider",
//
backgroundColor: "rgba(225,225,225,0.2)",
//
fillerColor: "#ccc",
//
borderColor: "rgba(225,225,225,0.2)",
// detail
showDetail: false,
//
startValue: 0,
//
endValue: 6,
// empty
//
filterMode: "empty",
//
width: "80%",
//
height: 5,
//
left: "center",
//
zoomLoxk: true,
//
handleSize: 10,
// dataZoom-slider
bottom: 0,
},
{
//
//
type: "inside",
//
zoomOnMouseWheel: false,
//
moveOnMouseMove: true,
moveOnMouseWheel: true,
},
],
}); });
window.addEventListener("resize", () => { window.addEventListener("resize", () => {
chart.resize(); chart.resize();
@ -461,6 +639,7 @@ export default {
background-position: 100% 60%; background-position: 100% 60%;
span { span {
cursor: pointer;
font-family: "DouYu"; font-family: "DouYu";
background: linear-gradient( background: linear-gradient(
to bottom, to bottom,
@ -555,6 +734,81 @@ export default {
} }
} }
//
.today-content {
height: 30rem;
display: flex;
flex-direction: column;
.today-select {
width: 100%;
// height: 10%;
display: flex;
> div {
width: 50%;
padding: 0 2rem;
::v-deep .el-select {
width: 12rem;
.el-input .el-select__caret {
line-height: 1.5rem;
}
.el-input--medium .el-input__inner {
height: 1.5rem;
background-color: transparent;
color: #89c5e8;
border-color: #6991cd;
}
.el-select-dropdown {
background-color: #102649;
border-color: #08204f;
.el-scrollbar {
.el-select-dropdown__wrap {
.el-scrollbar__view {
.el-select-dropdown__item {
color: #aaabb8;
}
.el-select-dropdown__item:hover {
background-color: #2b4c7e;
}
.el-select-dropdown__item.selected {
background-color: #2b4c7e;
}
.el-select-dropdown__item.hover {
background-color: #2b4c7e;
}
}
.el-select-dropdown__list {
background-color: #102649;
}
}
}
}
}
}
}
.today-bottom {
width: 100%;
height: 100%;
display: flex;
.dialog-div {
width: 50%;
height: 90%;
margin: 0 1rem;
}
}
}
/* 修改弹窗样式 */ /* 修改弹窗样式 */
::v-deep .el-dialog__header { ::v-deep .el-dialog__header {
padding: 10px; padding: 10px;

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-21 10:06:24 * @Date: 2024-10-21 10:06:24
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-11-13 13:57:00 * @LastEditTime: 2024-11-18 13:47:54
* @FilePath: \znxjxt-ui\src\views\big-screen\traffic-components\traffic-statistic.vue * @FilePath: \znxjxt-ui\src\views\big-screen\traffic-components\traffic-statistic.vue
* @Description: 病害巡检大屏-病害统计 * @Description: 病害巡检大屏-病害统计
--> -->
@ -24,16 +24,21 @@
</div> </div>
<div ref="statisticChart" class="statistic-chart"></div> <div ref="statisticChart" class="statistic-chart"></div>
<div class="statistic-lenged"> <div class="statistic-lenged">
<div <fssm-scroll>
class="lenged-item" <div
v-for="(item, index) in echartList" class="lenged-item"
:key="`static-${index}`" v-for="(item, index) in echartList"
> :key="`static-${index}`"
<div class="index" :style="{ backgroundColor: colorList[index] }"></div> >
<div class="name">{{ item.name }}</div> <div
<div class="rate">{{ item.rate }}</div> class="index"
<div class="value">{{ item.value }}</div> :style="{ backgroundColor: colorList[index] }"
</div> ></div>
<div class="name">{{ item.name }}</div>
<div class="rate">{{ item.rate }}</div>
<div class="value">{{ item.value }}</div>
</div>
</fssm-scroll>
</div> </div>
</div> </div>
</template> </template>
@ -42,8 +47,10 @@
import * as echarts from "echarts"; import * as echarts from "echarts";
import { getDropList } from "@/api/xj/screen/disease-screen"; import { getDropList } from "@/api/xj/screen/disease-screen";
import { roadCurrent } from "@/api/xj/screen/traffic-screen"; import { roadCurrent } from "@/api/xj/screen/traffic-screen";
import fssmScroll from "@/components/scroll/fssm-scroll.vue";
export default { export default {
name: "TrafficStatistic", name: "TrafficStatistic",
components: { fssmScroll },
props: { props: {
select: { select: {
type: String, type: String,
@ -72,6 +79,15 @@ export default {
"#AE74F3", "#AE74F3",
"#4C21D5", "#4C21D5",
"#6669DB", "#6669DB",
"#18F7FF",
"#6FC36F",
"#4C83FF",
"#FFEA68",
"#FF8F5F",
"#FC5976",
"#AE74F3",
"#4C21D5",
"#6669DB",
], ],
// echart // echart
echartList: [], echartList: [],
@ -140,7 +156,7 @@ export default {
} }
}); });
}, },
/* 绘制echart图 */ /* 绘制echart图 */
drawChart() { drawChart() {
if (this.echart) { if (this.echart) {
@ -278,9 +294,11 @@ export default {
.statistic-lenged { .statistic-lenged {
width: 50%; width: 50%;
height: 100%; height: 100%;
padding: 2rem 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
overflow: hidden;
z-index: 0; z-index: 0;
.lenged-item { .lenged-item {

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-17 11:34:00 * @Date: 2024-10-17 11:34:00
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-11-15 17:40:06 * @LastEditTime: 2024-11-18 11:18:49
* @FilePath: \znxjxt-ui\src\views\big-screen\index.vue * @FilePath: \znxjxt-ui\src\views\big-screen\index.vue
* @Description: 大屏首页 * @Description: 大屏首页
--> -->
@ -110,25 +110,11 @@
<!-- 图背景下选择框 --> <!-- 图背景下选择框 -->
<div class="map-image-select"> <div class="map-image-select">
病害类型筛选 病害类型筛选
<!-- <el-select
:popper-append-to-body="false"
v-model="mapCareSelect"
placeholder="请选择"
@change="getMapCare"
clearable
>
<el-option
v-for="item in dieaseTypeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> -->
<el-cascader <el-cascader
v-model="mapCareSelect" v-model="mapCareSelect"
popper-class="screen-index-cascader" popper-class="screen-index-cascader"
:options="dieaseOptions" :options="dieaseOptions"
:props="{ checkStrictly: true, emitPath: false }" :props="{checkStrictly:true, emitPath: true, children: 'subTypes' }"
@change="getMapCare" @change="getMapCare"
clearable clearable
></el-cascader> ></el-cascader>
@ -274,6 +260,7 @@ import {
comppanyImg, comppanyImg,
getItemTypes, getItemTypes,
getRoadListTypes, getRoadListTypes,
getDefectTypes,
} from "@/api/xj/screen/index"; } from "@/api/xj/screen/index";
export default { export default {
name: "BigScreen", name: "BigScreen",
@ -368,7 +355,6 @@ export default {
// //
mapCareSelect: "", mapCareSelect: "",
// //
dieaseTypeList: [],
dieaseOptions: [ dieaseOptions: [
{ {
value: "zhinan", value: "zhinan",
@ -703,21 +689,26 @@ export default {
/* 获取图片背景左上角病害类型下拉 */ /* 获取图片背景左上角病害类型下拉 */
getDieaseTypeList() { getDieaseTypeList() {
getItemTypes().then(({ code, data }) => { getDefectTypes().then(({ code, data }) => {
if (code === 200) { if (code === 200) {
this.dieaseTypeList = data; this.dieaseOptions = data;
} }
}); });
}, },
/* 获取图片背景下坐标数据 */ /* 获取图片背景下坐标数据 */
getMapCare(value) { getMapCare(value) {
console.log(value,this.mapCareSelect, "获取图片背景下坐标数据"); const data = {
comppanyImg({ type: value }).then(({ code, data }) => { classType: value ? value[0] : "",
if (code === 200) { type: value ? (value.length > 1 ? value[1] : "") : "",
this.mapCareList = data; };
comppanyImg(data).then(
({ code, data }) => {
if (code === 200) {
this.mapCareList = data;
}
} }
}); );
}, },
/* 点击病害日志详情打开弹窗进行地图打点 */ /* 点击病害日志详情打开弹窗进行地图打点 */
@ -986,7 +977,10 @@ export default {
/* 获取icon多选数据 */ /* 获取icon多选数据 */
getIconType() { getIconType() {
this.mapLogeList = {}; this.mapLogeList = {};
getItemTypes({ classType: this.bottomTipClick,type:this.elementDiv }).then(({ code, data }) => { getItemTypes({
classType: this.bottomTipClick,
type: this.elementDiv,
}).then(({ code, data }) => {
if (code === 200) { if (code === 200) {
this.iconTypeList = data; this.iconTypeList = data;
this.iconType = data.map((item) => { this.iconType = data.map((item) => {

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-18 10:25:29 * @Date: 2024-10-18 10:25:29
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-11-14 16:16:56 * @LastEditTime: 2024-11-18 11:44:52
* @FilePath: \znxjxt-ui\src\views\big-screen\disease-components\work-order.vue * @FilePath: \znxjxt-ui\src\views\big-screen\disease-components\work-order.vue
* @Description: 总览大屏-巡查里程 * @Description: 总览大屏-巡查里程
--> -->
@ -35,13 +35,15 @@
<el-select <el-select
:popper-append-to-body="false" :popper-append-to-body="false"
v-model="companySelect" v-model="companySelect"
@change="changeSelect"
clearable
placeholder="请选择分公司" placeholder="请选择分公司"
> >
<el-option <el-option
v-for="item in companyList" v-for="item in companyList"
:key="item.value" :key="`${item.name}-${item.index}`"
:label="item.label" :label="item.name"
:value="item.value" :value="item.name"
/> />
</el-select> </el-select>
<div ref="patrolChart" class="dialog-div"></div> <div ref="patrolChart" class="dialog-div"></div>
@ -52,7 +54,7 @@
<script> <script>
import * as echarts from "echarts"; import * as echarts from "echarts";
import { getMileage } from "@/api/xj/screen/disease-screen"; import { getMileage, getMileageDetail } from "@/api/xj/screen/disease-screen";
export default { export default {
name: "PatrolOrder", name: "PatrolOrder",
data() { data() {
@ -65,6 +67,8 @@ export default {
companySelect: "", companySelect: "",
// //
companyList: [], companyList: [],
// echart
echartData: [],
}; };
}, },
created() { created() {
@ -114,16 +118,50 @@ export default {
this.getChartData(); this.getChartData();
}, },
/* 请求弹窗数据 */ /* 选择框绑定值修改 */
getChartData() { changeSelect(value) {
this.echartData = this.echartList.filter((item) => {
if (value) {
return item.name === value;
}
return item;
});
this.$nextTick(() => { this.$nextTick(() => {
this.drawChart(); this.drawChart();
}); });
}, },
/* 请求弹窗数据 */
getChartData() {
getMileageDetail().then(({ code, data }) => {
if (code === 200) {
this.companyList = data.map((item, index) => {
return {
...item,
index,
};
});
this.echartList = data;
this.echartData = data;
this.$nextTick(() => {
this.drawChart();
});
}
});
},
/* 绘制echart图 */ /* 绘制echart图 */
drawChart() { drawChart() {
if (this.$refs.patrolChart) { if (this.$refs.patrolChart) {
const xData = this.echartData.map((item) => {
return item.name;
});
const y1Data = this.echartData.map((item) => {
return item.len;
});
const y2Data = this.echartData.map((item) => {
return item.time;
});
const chart = echarts.init(this.$refs.patrolChart); const chart = echarts.init(this.$refs.patrolChart);
chart.setOption({ chart.setOption({
color: [ color: [
@ -219,35 +257,53 @@ export default {
axisLine: { axisLine: {
show: false, show: false,
}, },
data: ["dsds", "4ds", "5454", "sff"], data: xData,
}, },
yAxis: { yAxis: [
type: "value", {
axisLabel: { name: "单位km",
color: "rgba(255,255,255,0.65)", type: "value",
}, axisLabel: {
splitLine: { color: "rgba(255,255,255,0.65)",
lineStyle: { },
color: "rgba(255,255,255,0.2)", splitLine: {
lineStyle: {
color: "rgba(255,255,255,0.2)",
},
},
nameTextStyle: {
color: "rgba(255,255,255,0.65)",
}, },
}, },
name: "单位:个", {
nameTextStyle: { name: "单位h",
color: "rgba(255,255,255,0.65)", type: "value",
axisLabel: {
color: "rgba(255,255,255,0.65)",
},
splitLine: {
lineStyle: {
color: "rgba(255,255,255,0.2)",
},
},
nameTextStyle: {
color: "rgba(255,255,255,0.65)",
},
}, },
}, ],
series: [ series: [
{ {
barWidth: 10, barWidth: 10,
name: "巡查里程", name: "巡查里程",
type: "bar", type: "bar",
data: [10, 25, 23, 58], data: y1Data,
}, },
{ {
barWidth: 10, barWidth: 10,
name: "巡查时长", name: "巡查时长",
type: "bar", type: "bar",
data: [10, 25, 23, 58], data: y2Data,
yAxisIndex: 1,
}, },
], ],
}); });

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-18 09:42:49 * @Date: 2024-10-18 09:42:49
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-11-14 15:48:21 * @LastEditTime: 2024-11-18 13:36:55
* @FilePath: \znxjxt-ui\src\views\big-screen\disease-components\today-inspection.vue * @FilePath: \znxjxt-ui\src\views\big-screen\disease-components\today-inspection.vue
* @Description: 总览大屏-今日巡查 * @Description: 总览大屏-今日巡查
--> -->
@ -10,10 +10,10 @@
<template> <template>
<div class="content"> <div class="content">
<div class="today-left"> <div class="today-left">
<span @click="showDialog('1')">{{ today }}</span> <span @click="showDialog('today')">{{ today }}</span>
</div> </div>
<div class="today-right"> <div class="today-right">
<div class="right-sum" @click="showDialog('2')"> <div class="right-sum" @click="showDialog('')">
<span>{{ all }}</span <span>{{ all }}</span
> >
</div> </div>
@ -38,13 +38,15 @@
<el-select <el-select
:popper-append-to-body="false" :popper-append-to-body="false"
v-model="roadSelect" v-model="roadSelect"
@change="changeRoad"
clearable
placeholder="请选择路段" placeholder="请选择路段"
> >
<el-option <el-option
v-for="item in roadList" v-for="item in roadList"
:key="item.value" :key="`${item.name}-${item.index}`"
:label="item.label" :label="item.name"
:value="item.value" :value="item.name"
/> />
</el-select> </el-select>
</div> </div>
@ -52,13 +54,15 @@
<el-select <el-select
:popper-append-to-body="false" :popper-append-to-body="false"
v-model="companySelect" v-model="companySelect"
clearable
@change="changeCompany"
placeholder="请选择分公司" placeholder="请选择分公司"
> >
<el-option <el-option
v-for="item in companyList" v-for="item in companyList"
:key="item.value" :key="`${item.name}-${item.index}`"
:label="item.label" :label="item.name"
:value="item.value" :value="item.name"
/> />
</el-select> </el-select>
</div> </div>
@ -85,20 +89,22 @@ export default {
all: "0", all: "0",
// //
scale: "0", scale: "0",
// /
clickTip: "",
// //
showDialogVisible: false, showDialogVisible: false,
// //
roadSelect: "", roadSelect: "",
// //
roadList: [], roadList: [],
//
leftChartList: [],
// //
leftChartData: [], leftChartData: [],
// //
companySelect: "", companySelect: "",
// //
companyList: [], companyList: [],
//
rightChartList: [],
// //
rightChartData: [], rightChartData: [],
}; };
@ -120,17 +126,56 @@ export default {
/* 点击打开弹窗 */ /* 点击打开弹窗 */
showDialog(item) { showDialog(item) {
this.clickTip = item; this.getChartData(item);
this.getChartData();
this.showDialogVisible = true; this.showDialogVisible = true;
}, },
/* 请求弹窗数据 */ /* 弹窗路段修改事件 */
getChartData() { changeRoad(value) {
roadTodayDetail().then(({ code, data }) => { this.leftChartData = this.leftChartList.filter((item) => {
if (value) {
return item.name === value;
}
return item;
});
this.$nextTick(() => {
this.drawLeftChart();
});
},
/* 弹窗公司修改事件 */
changeCompany(value) {
this.rightChartData = this.rightChartList.filter((item) => {
if (value) {
return item.name === value;
}
return item;
});
this.$nextTick(() => {
this.drawRightChart();
});
},
/* 请求病害弹窗数据 */
getChartData(item) {
roadTodayDetail({ type: item }).then(({ code, data }) => {
if (code === 200) { if (code === 200) {
this.leftChartList = data[0];
this.leftChartData = data[0]; this.leftChartData = data[0];
this.roadList = data[0].map((item, index) => {
return {
...item,
index: index,
};
});
this.rightChartList = data[1];
this.rightChartData = data[1]; this.rightChartData = data[1];
this.companyList = data[1].map((item, index) => {
return {
...item,
index: index,
};
});
this.$nextTick(() => { this.$nextTick(() => {
this.drawLeftChart(); this.drawLeftChart();
this.drawRightChart(); this.drawRightChart();
@ -295,6 +340,51 @@ export default {
data: y4Data, data: y4Data,
}, },
], ],
dataZoom: [
{
//
show: false,
//
type: "slider",
//
backgroundColor: "rgba(225,225,225,0.2)",
//
fillerColor: "#ccc",
//
borderColor: "rgba(225,225,225,0.2)",
// detail
showDetail: false,
//
startValue: 0,
//
endValue: 6,
// empty
//
filterMode: "empty",
//
width: "80%",
//
height: 5,
//
left: "center",
//
zoomLoxk: true,
//
handleSize: 10,
// dataZoom-slider
bottom: 0,
},
{
//
//
type: "inside",
//
zoomOnMouseWheel: false,
//
moveOnMouseMove: true,
moveOnMouseWheel: true,
},
],
}); });
window.addEventListener("resize", () => { window.addEventListener("resize", () => {
chart.resize(); chart.resize();
@ -443,6 +533,51 @@ export default {
data: y4Data, data: y4Data,
}, },
], ],
dataZoom: [
{
//
show: false,
//
type: "slider",
//
backgroundColor: "rgba(225,225,225,0.2)",
//
fillerColor: "#ccc",
//
borderColor: "rgba(225,225,225,0.2)",
// detail
showDetail: false,
//
startValue: 0,
//
endValue: 6,
// empty
//
filterMode: "empty",
//
width: "80%",
//
height: 5,
//
left: "center",
//
zoomLoxk: true,
//
handleSize: 10,
// dataZoom-slider
bottom: 0,
},
{
//
//
type: "inside",
//
zoomOnMouseWheel: false,
//
moveOnMouseMove: true,
moveOnMouseWheel: true,
},
],
}); });
window.addEventListener("resize", () => { window.addEventListener("resize", () => {
chart.resize(); chart.resize();
@ -452,7 +587,10 @@ export default {
/* 关闭 弹窗事件 */ /* 关闭 弹窗事件 */
screenCancel() { screenCancel() {
this.clickTip = ""; this.leftChartList = [];
this.leftChartData = [];
this.rightChartList = [];
this.rightChartData = [];
this.showDialogVisible = false; this.showDialogVisible = false;
}, },
}, },