ds1.0
fanluyan 2 years ago
parent ca099093ee
commit 30d8498fcb

@ -120,8 +120,6 @@
<script> <script>
import { import {
getTermStatistics, getTermStatistics,
getWeekAlarmStatistics,
getTodayAlarmStatistics,
getOnlineTerminalList, getOnlineTerminalList,
getOnlineTerminalListExcel, getOnlineTerminalListExcel,
} from "@/utils/api/index"; } from "@/utils/api/index";
@ -159,8 +157,6 @@ export default {
mounted() { mounted() {
this.getDateTime(); // this.getDateTime(); //
this.getTermData(); this.getTermData();
this.getWeekAlarmStatistics();
this.getTodayAlarmStatistics();
}, },
watch: { watch: {
"$store.state.collapse"(val) { "$store.state.collapse"(val) {
@ -169,8 +165,6 @@ export default {
//echarts //echarts
this.myChart1.resize(); this.myChart1.resize();
this.myChart2.resize(); this.myChart2.resize();
this.myChart3.resize();
this.myChart4.resize();
}, 300); }, 300);
}, },
}, },
@ -197,18 +191,7 @@ export default {
console.log(val); console.log(val);
window.location.href = "/api/api/getOnlineTerminalListExcel?type=" + val; window.location.href = "/api/api/getOnlineTerminalListExcel?type=" + val;
}, },
//
changedate() {
console.log(this.dateValue.getTime());
this.dateValue = this.dateValue.getTime();
this.getWeekAlarmStatistics();
},
//
changedate2() {
console.log(this.dateValue2.getTime());
this.dateValue2 = this.dateValue2.getTime();
this.getTodayAlarmStatistics();
},
// //
getDateTime() { getDateTime() {
console.log(new Date()); console.log(new Date());
@ -231,30 +214,7 @@ export default {
}) })
.catch((err) => {}); .catch((err) => {});
}, },
//7
getWeekAlarmStatistics() {
this.barloading = true;
getWeekAlarmStatistics({ starttime: this.dateValue })
.then((res) => {
console.log(res);
this.weekData = res.data.list;
this.barloading = false;
this.getEchart3();
})
.catch((err) => {});
},
//
getTodayAlarmStatistics() {
this.pie2loading = true;
getTodayAlarmStatistics({ starttime: this.dateValue2 })
.then((res) => {
console.log(res);
this.todayAlarm = res.data.list;
this.pie2loading = false;
this.getEchart4();
})
.catch((err) => {});
},
// //
getEchart2() { getEchart2() {
this.$nextTick(() => { this.$nextTick(() => {
@ -326,152 +286,6 @@ export default {
}); });
}); });
}, },
//7
getEchart3() {
this.$nextTick(() => {
this.$echarts.init(document.getElementById("echart3")).dispose();
this.myChart3 = this.$echarts.init(document.getElementById("echart3"));
let option = {
// title: {
// text: "",
// },
color: ["#169e8c"],
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
},
grid: {
//topleftrightbottom
top: "10%",
left: "10%",
right: "10%",
bottom: "10%",
},
xAxis: {
type: "category",
data: this.weekData.map((x) => {
return this.$moment(x.date).format("MM-DD");
}),
axisTick: {
alignWithLabel: true,
},
},
yAxis: { type: "value" },
series: [
{
name: "告警数量",
data: this.weekData.map((x) => {
return x.num;
}),
type: "bar",
showBackground: true,
backgroundStyle: { color: "rgba(180, 180, 180, 0.2)" },
},
],
};
this.myChart3.setOption(option);
window.addEventListener("resize", () => {
this.myChart3.resize();
});
});
},
//
getEchart4() {
this.$nextTick(() => {
this.$echarts.init(document.getElementById("echart4")).dispose();
this.myChart4 = this.$echarts.init(document.getElementById("echart4"));
let arr = [];
this.todayAlarm.forEach((element) => {
arr.push({
value: element.num, //numvalue
name: element.enname, //namename
});
});
let option = {
// title: {
// text: "",
// },
// tooltip: {
// trigger: "axis",
// axisPointer: {
// type: "shadow",
// },
// },
// xAxis: {
// type: "category",
// data: this.todayAlarm.map((item) => {
// return item.enname;
// }),
// axisTick: {
// alignWithLabel: true,
// },
// },
// yAxis: { type: "value" },
// series: [
// {
// name: "",
// data: this.todayAlarm.map((item) => {
// return item.num;
// }),
// type: "bar",
// showBackground: true,
// backgroundStyle: { color: "rgba(180, 180, 180, 0.2)" },
// },
// ],
// title: {
// text: "线",
// },
tooltip: {
trigger: "item",
},
legend: {
type: "scroll",
orient: "vertical",
right: 10,
top: 20,
bottom: 20,
},
series: [
{
type: "pie",
radius: ["40%", "70%"],
avoidLabelOverlap: false,
itemStyle: {
borderRadius: 10,
borderColor: "#fff",
borderWidth: 2,
},
label: {
show: true,
fontSize: 16,
fontWeight: "bold",
formatter: "{b}\n{d}%",
},
emphasis: {
label: {
show: true,
fontSize: 26,
fontWeight: "bold",
formatter: "{b}\n{d}%",
},
},
labelLine: {
show: true,
},
data: arr,
},
],
};
this.myChart4.setOption(option);
window.addEventListener("resize", () => {
this.myChart4.resize();
});
});
},
}, },
}; };
</script> </script>

@ -129,7 +129,7 @@ export default {
this.channelId = obj.id; this.channelId = obj.id;
this.photoId = obj.photoId; this.photoId = obj.photoId;
this.restCanvas(); this.restCanvas();
this.getcanvansPic(this.pictureData, this.channelId); //this.getcanvansPic(this.pictureData, this.channelId);
// console.log(this.picsrc); // console.log(this.picsrc);
}, },
//线 //线
@ -150,7 +150,7 @@ export default {
this.channelId = val.list[0].id; this.channelId = val.list[0].id;
this.picvalue = val.list[0].name; // this.picvalue = val.list[0].name; //
this.termId = val.id; //id this.termId = val.id; //id
this.getcanvansPic(val, this.channelId); //this.getcanvansPic(val, this.channelId);
}, },
hide() { hide() {
this.isShow = false; this.isShow = false;

@ -16,7 +16,7 @@
v-loading="picLoading" v-loading="picLoading"
> >
<el-image <el-image
:src="currentPicPath + '!1366x768'" :src="currentPicPath + ''"
:preview-src-list="srcList" :preview-src-list="srcList"
@load="loadImage" @load="loadImage"
@error="setDefaultImage" @error="setDefaultImage"
@ -80,7 +80,7 @@
" "
> >
<!-- <el-image v-lazy="item.path + '!260x160'"></el-image> --> <!-- <el-image v-lazy="item.path + '!260x160'"></el-image> -->
<img v-lazy="item.path + '!260x160'" /> <img v-lazy="item.path + ''" />
<p class="timeInfo"> <p class="timeInfo">
<el-tooltip <el-tooltip
@ -113,7 +113,7 @@
</div> </div>
<div class="picBox" v-else-if="item.mediaType == 1"> <div class="picBox" v-else-if="item.mediaType == 1">
<!-- <el-image :src="item.thumb + '!260x160'"></el-image> --> <!-- <el-image :src="item.thumb + '!260x160'"></el-image> -->
<img v-lazy="item.thumb + '!260x160'" /> <img v-lazy="item.thumb + ''" />
<p class="timeInfo"> <p class="timeInfo">
<i class="el-icon-video-camera"></i> <i class="el-icon-video-camera"></i>
<el-tooltip <el-tooltip
@ -359,7 +359,7 @@ export default {
} else { } else {
this.radioPx = ""; this.radioPx = "";
} }
this.getPointList(data); //this.getPointList(data);
}, },
loadImage() { loadImage() {
console.log("loading"); console.log("loading");

@ -14,7 +14,7 @@
v-loading="picLoading" v-loading="picLoading"
> >
<el-image <el-image
:src="currentPicPath + '!1366x768'" :src="currentPicPath + ''"
:preview-src-list="srcList" :preview-src-list="srcList"
@load="loadImage" @load="loadImage"
ref="picJpg" ref="picJpg"
@ -368,7 +368,7 @@ export default {
} else { } else {
this.radioPx = ""; this.radioPx = "";
} }
this.getPointList(data); // this.getPointList(data);
}, },
loadImage() { loadImage() {
this.picLoading = false; this.picLoading = false;

@ -15,14 +15,14 @@
<div class="imgcloum" @click="handleTowerPic(item)"> <div class="imgcloum" @click="handleTowerPic(item)">
<!-- 首先判断是否是图片mediatype=0,并且path不为空 展示图片 --> <!-- 首先判断是否是图片mediatype=0,并且path不为空 展示图片 -->
<img <img
:src="item.path + '!1366x768'" :src="item.path + ''"
v-if="item.mediatype == 0 && item.path !== null" v-if="item.mediatype == 0 && item.path !== null"
@error="setDefaultImage" @error="setDefaultImage"
/> />
<!-- 判断是否是视频mediatype=1,并且path不为空 展示图片 --> <!-- 判断是否是视频mediatype=1,并且path不为空 展示图片 -->
<img <img
v-else-if="item.mediatype == 1 && item.thumb !== null" v-else-if="item.mediatype == 1 && item.thumb !== null"
:src="item.thumb + '!1366x768'" :src="item.thumb + ''"
/> />
<!-- 判断是否是视频mediatype=bull,并且path为空 展示暂无图片 --> <!-- 判断是否是视频mediatype=bull,并且path为空 展示暂无图片 -->
<img <img

@ -121,7 +121,7 @@
<div class="bigpic" v-if="item.path.indexOf('videos') == -1"> <div class="bigpic" v-if="item.path.indexOf('videos') == -1">
<el-image <el-image
lazy lazy
:src="item.path + '!1366x768'" :src="item.path + ''"
:preview-src-list="[item.path]" :preview-src-list="[item.path]"
> >
<template slot="error"> <template slot="error">

@ -21,11 +21,12 @@ module.exports = defineConfig({
proxy: { proxy: {
"/api": { "/api": {
//表示拦截以/api开头的请求路径 //表示拦截以/api开头的请求路径
target: "http://47.96.238.157:8093", //阿里云服务器环境 //target: "http://47.96.238.157:8093", //阿里云服务器环境
//target: "http://180.166.218.222:40080", //dell //target: "http://180.166.218.222:40080", //dell
target: "http://192.168.50.42:81", //dell
changOrigin: true, //是否开启跨域 changOrigin: true, //是否开启跨域
pathRewrite: { pathRewrite: {
"^/api": "", //重写api把api变成空字符因为我们真正请求的路径是没有api的 "^/api": "/api", //重写api把api变成空字符因为我们真正请求的路径是没有api的
}, },
}, },
}, },

Loading…
Cancel
Save