dev_xd
姜玉琦 2025-04-05 16:48:56 +08:00
parent 0183f4e6fd
commit fbcc9d5b85
17 changed files with 775 additions and 15 deletions

View File

@ -0,0 +1,42 @@
import request from "@/utils/request";
// 查询配电箱点位列表
const findProAllConfigPoint = (proId) => {
return request({
url: `/manage/iotConfigPoint/findProAllConfigPoint/${proId}`,
method: "get",
});
};
// 查询配电箱点位详情
const findConfigPointInfo = (id) => {
return request({
url: `/manage/iotConfigPoint/${id}`,
method: "get",
});
};
// 查询配电箱数据统计
const findIotDatasMonitor = (proId,date) => {
return request({
url: `/manage/iotDatas/findIotDatasMonitor/${proId}?date=${date}`,
method: "get",
});
};
// 查询配电箱预警数据
const findIotWarnings = (proId) => {
return request({
url: `/manage/iotWarning/findIotWarnings/${proId}`,
method: "get",
});
};
export default {
findProAllConfigPoint,
findConfigPointInfo,
findIotDatasMonitor,
findIotWarnings
};

View File

@ -209,6 +209,9 @@ export default {
case 304:
this.$router.push("/towerCrane");
break;
case 306:
this.$router.push("/powerIot");
break;
case 4:
this.$router.push("/prjQuality");
break;

View File

@ -1,6 +1,6 @@
<template>
<div class="screen-one-1-3 screen-module">
<div class="module-title command" @click="doHeaderClick"><span>{{ label || '' }}</span></div>
<div class="module-title"><span>{{ label || '' }}</span></div>
<div class="module-ctx">
<slot></slot>
</div>
@ -15,11 +15,6 @@ export default {
type: String,
default:""
}
},
methods:{
doHeaderClick(){
this.$emit("headerClick");
}
}
};
</script>

View File

@ -1,5 +1,5 @@
<template>
<div class="screen-one-2-1 screen-module">
<div class="screen-one-2-1 screen-module">
<div class="module-title"><span>{{ label || '' }}</span></div>
<div class="module-ctx">
<slot></slot>

View File

@ -1,5 +1,5 @@
<template>
<div class="screen-one-2-2 screen-module">
<div class="screen-one-2-2 screen-module">
<div class="module-title"><span>{{ label || '' }}</span></div>
<div class="module-ctx">
<slot></slot>

View File

@ -1,5 +1,5 @@
<template>
<div class="screen-one-2-3 screen-module">
<div class="screen-one-2-3 screen-module">
<div class="module-title"><span>{{ label || '' }}</span></div>
<div class="module-ctx">
<slot></slot>

View File

@ -0,0 +1,169 @@
import Vue from 'vue'
Vue.component("trend-chart-line", {
template: `
<div :style="{'height': height+'px'}" ref="chart">
</div>
`,
props: {
data:{
type:Object
},
height:{
type:Number
},
},
data() {
return {
classData:[],
}
},
mounted(){
this.init()
},
methods: {
init(){
this.getChartData()
},
getChartData(){
//品类金额占比 饼图
var chChartPie = echarts.init(this.$refs.chart);
this.echartPie(chChartPie,this.data)
},
echartPie(chChart,data){
let newPromise = new Promise((resolve) => {
resolve()
})
//然后异步执行echarts的初始化函数
newPromise.then(() => {
var series = []
if(data && data.lineData){
for (let i = 0; i < data.lineData.length; i++) {
series.push({
name: data.legend[i],
type: "line",
smooth: true,
symbol: "circle",
symbolSize: 5,
showSymbol: false,
lineStyle: {
normal: {
width: 2,
},
},
itemStyle: {
normal: {
color: data.color[i],
borderWidth: 5,
},
},
data: data.lineData[i],
},)
}
}
var unit = ''
if(data.unit){
unit = '单位:'+data.unit
}
this.option = {
tooltip: {
trigger: "axis",
axisPointer: {
lineStyle: {
color: "#57617B",
},
},
},
legend: {
icon: "rect",
itemWidth: 14,
itemHeight: 10,
itemGap: 15,
data: data.legend,
top: -5,
textStyle: {
fontSize: 14,
color: "#c8dbfc",
},
},
grid: {
top:'15%',
left: "2%",
right: "3%",
bottom: "2%",
containLabel: true,
},
xAxis: {
boundaryGap: false,
type: "category",
data: data.date,
axisLine: {
//坐标轴轴线相关设置。数学上的x轴
show: true,
lineStyle: {
color: "#25597e",
type: "dashed",
},
},
axisTick: {
show: false
},
axisLabel: {
//坐标轴刻度标签的相关设置
textStyle: {
color: "#c5d9fc",
margin: 20,
fontSize:14
},
},
},
yAxis: {
name: unit,
type: "value",
axisLine: {
//坐标轴轴线相关设置。数学上的x轴
show: false,
lineStyle: {
color: "#c5d9fc",
type: "dashed",
},
},
axisTick: {
show: false
},
axisLabel: {
show: true,
//坐标轴刻度标签的相关设置
textStyle: {
color: "#c5d9fc",
margin: 20,
fontSize:14
},
},
splitLine: {
show: true,
lineStyle: {
color: "#25597e",
type: "dashed",
},
},
},
series: series
};
chChart.setOption(this.option);
window.onresize = chChart.resize;
})
},
},
watch:{
data: function (n,o) {
this.getChartData()
}
}
})

View File

@ -0,0 +1,173 @@
import Vue from 'vue'
Vue.component("trend-line-chart", {
template: `
<div :style="{'height': height+'px'}" ref="chart">
</div>
`,
props: {
chartdata:{
type:Object
},
height:{
type:Number
},
data:{
type:Array
},
fn:{
type:Function
}
},
data() {
return {
option:{}
}
},
mounted(){
this.init()
},
methods: {
init(){
this.getChartData()
},
getChartData(){
//品类金额占比 饼图
var myChart = echarts.init(this.$refs.chart);
this.echartPie(myChart,this.chartdata)
},
echartPie(myChart,data){
let newPromise = new Promise((resolve) => {
resolve()
})
//然后异步执行echarts的初始化函数
newPromise.then(() => {
var series =[]
if(data && data.data){
for (let i = 0; i < data.data.length; i++) {
series.push({
name:data.legend[i],
type: "line",
smooth: true,
symbol: "circle",
symbolSize: 5,
showSymbol: true,
lineStyle: {
normal: {
width: 2,
},
},
data: data.data[i],
})
}
}
var unit = ''
if(data.unit){
unit = '单位:'+data.unit
}
this.option = {
color : data.color,
dataZoom:[
{show:true,type:'slider'},
{type:'inside'}
],
tooltip: {
trigger: "axis",
axisPointer: {
lineStyle: {
color: "#57617B",
},
},
},
grid: {
top:'15%',
left: "1%",
right: "3%",
bottom: "1%",
containLabel: true,
},
xAxis: {
type: "category",
boundaryGap: false,
data: data.dataX,
axisLine: {
//坐标轴轴线相关设置。数学上的x轴
show: true,
lineStyle: {
color: "#25597e",
type: "dashed",
},
},
axisTick: {
show: false
},
axisLabel: {
//坐标轴刻度标签的相关设置
textStyle: {
color: "#c5d9fc",
margin: 20,
fontSize:16
},
},
},
yAxis: {
name:unit,
nameTextStyle: {
color: '#fff',
fontSize: 14,
},
type: "value",
axisLine: {
//坐标轴轴线相关设置。数学上的x轴
show: false,
lineStyle: {
color: "#c5d9fc",
type: "dashed",
},
},
axisTick: {
show: false
},
axisLabel: {
show: true,
//坐标轴刻度标签的相关设置
textStyle: {
color: "#c5d9fc",
margin: 20,
fontSize:16
},
},
splitLine: {
show: true,
lineStyle: {
color: "#25597e",
type: "dashed",
},
},
},
series: series
};
if(this.fn){
this.option=this.fn(this.option);
}
myChart.setOption(this.option,true);
window.onresize = myChart.resize;
})
},
},
watch:{
/*chartdata: {
deep:true,
handler: function (val, oldVal){
this.init()
}
},*/
data: function (val, oldVal){
this.init()
}
}
})

View File

@ -73,6 +73,15 @@ const routes = [
/* webpackChunkName: "safetyCheck" */ "../views/safety/towerCrane.vue"
),
},
{
path: "/powerIot",
name: "powerIot",
meta: { nav: 306 },
component: () =>
import(
/* webpackChunkName: "safetyCheck" */ "../views/safety/powerIot.vue"
),
},
{
path: "/photography",
name: "photography",

View File

@ -14,6 +14,8 @@ import moduleOne22 from "../components/module/module-one-2-2.vue";
import moduleOne23 from "../components/module/module-one-2-3.vue";
import moduleOne31 from "../components/module/module-one-3-1.vue";
import staffSurveyChart from "../components/staffSurveyChart.vue";
import trendChartLine from "../components/trend-chart-line";
import trendLineChart from "../components/trend-line-chart";
import peopleNumber from "@/components/people-number.vue";
import dictTag from "@/components/DictTag/index.vue";
import MyDialog from "@/components/MyDialog.vue";
@ -36,13 +38,13 @@ Vue.component("module-one-2-3", moduleOne23);
Vue.component("module-one-3-1", moduleOne31);
Vue.component("people-number", peopleNumber);
Vue.component("staff-survey-chart", staffSurveyChart);
Vue.component("trend-chart-line", trendChartLine);
Vue.component("trend-line-chart", trendLineChart);
Vue.component("my-chart", MyChart);
Vue.component("dict-tag", dictTag);
Vue.component("MyDialog", MyDialog);
Vue.component("project-overview-chart", projectOverviewChart);
Vue.prototype.$bus = new Vue();
//Vue.component("people-number",peopleNumber)
//Vue.component("project-overview-chart",projectOverviewChart)
Vue.prototype.$api = Api;
Vue.prototype.$bus = vue;
Vue.prototype.$apiPath = process.env.VUE_APP_BASE_API;

View File

@ -0,0 +1,298 @@
<template>
<div class="project-power-iot main-page">
<el-col :span="18">
<module-one-1-3 label="配电箱监测">
<el-row>
<el-col :span="5">
<div class="process-control-current-value-con">
<div class="current-value-img">
<img src="images/hj_wendu.png" />
</div>
<div class="process-control-current-value-data">
<div>A相温度</div>
<p v-cloak>{{ powerRun.t1 }} <span></span></p>
</div>
</div>
</el-col>
<el-col :span="5">
<div class="process-control-current-value-con">
<div class="current-value-img">
<img src="images/hj_wendu.png" />
</div>
<div class="process-control-current-value-data">
<div>B相温度</div>
<p v-cloak>{{ powerRun.t2 }} <span></span></p>
</div>
</div>
</el-col>
<el-col :span="5">
<div class="process-control-current-value-con">
<div class="current-value-img">
<img src="images/hj_wendu.png" />
</div>
<div class="process-control-current-value-data">
<div>C相温度</div>
<p v-cloak>{{ powerRun.t3 }} <span></span></p>
</div>
</div>
</el-col>
<el-col :span="5">
<div class="process-control-current-value-con">
<div class="current-value-img">
<img src="images/huanjingweidu.png" />
</div>
<div class="process-control-current-value-data">
<div>零线温度</div>
<p v-cloak>{{ powerRun.t4 }} <span></span></p>
</div>
</div>
</el-col>
<el-col :span="4">
<div class="process-control-current-value-con">
<div class="process-control-current-value-data">
<div>温度阈值</div>
<p class="red-data">70 <span></span></p>
</div>
</div>
</el-col>
<el-col :span="5">
<div class="process-control-current-value-con">
<div class="current-value-img">
<img src="images/hj_dianliu.png" />
</div>
<div class="process-control-current-value-data">
<div>A相电流</div>
<p v-cloak>{{ powerRun.c1 }} <span>A</span></p>
</div>
</div>
</el-col>
<el-col :span="5">
<div class="process-control-current-value-con">
<div class="current-value-img">
<img src="images/hj_dianliu.png" />
</div>
<div class="process-control-current-value-data">
<div>B相电流</div>
<p v-cloak>{{ powerRun.c2 }} <span>A</span></p>
</div>
</div>
</el-col>
<el-col :span="5">
<div class="process-control-current-value-con">
<div class="current-value-img">
<img src="images/hj_dianliu.png" />
</div>
<div class="process-control-current-value-data">
<div>C相电流</div>
<p v-cloak>{{ powerRun.c3 }} <span>A</span></p>
</div>
</div>
</el-col>
</el-row>
</module-one-1-3>
<module-one-1-3 label="温度监控">
<div class="sjk-chart-line-title quality-button">
<div :class="trendBtnNav == 7 ? 'active' : ''" @click="initTrendData(7)">
近7天
</div>
<div :class="trendBtnNav == 30 ? 'active' : ''" @click="initTrendData(30)">
近30天
</div>
</div>
<trend-chart-line :height="220" :data="trendData"></trend-chart-line>
</module-one-1-3>
<module-one-1-3 label="电流监控">
<div class="sjk-chart-line-title quality-button">
<div :class="tumidityBtnNav == 7 ? 'active' : ''" @click="initTumidityData(7)">
近7天
</div>
<div
:class="tumidityBtnNav == 30 ? 'active' : ''"
@click="initTumidityData(30)"
>
近30天
</div>
</div>
<trend-chart-line :height="220" :data="tumidityData"></trend-chart-line>
</module-one-1-3>
</el-col>
<el-col :span="6">
<div class="analyse-max">
<div class="analyse-map">
<div class="analyse-title analyse_title_blue">
<div class="analyse-text">当前设备</div>
<div class="analyse-equipment">配电箱监测</div>
</div>
<div class="hj-moment-max">
<table>
<tr>
<td>设备名称</td>
<td>
<div class="hj-moment-choice">
<div class="hj-moment-select">
</div>
<div class="hj-moment-state">
<div class="state-tag state-zx" v-if="powerRun.online=='0'">线</div>
<div class="state-tag state-lx" v-else>线</div>
</div>
</div>
</td>
</tr>
<tr>
<td>名称</td>
<td>
<div class="hj-moment-blue" v-cloak>
{{ powerRun.deviceId }}
</div>
</td>
</tr>
<tr>
<td>安装位置</td>
<td>办公区</td>
</tr>
<tr>
<td>设备状态</td>
<td>
<div class="hj-moment-green" v-if="powerRun.deviceStatus=='0'">线</div>
<div class="hj-moment-orange" v-if="powerRun.deviceStatus!='0'">线</div>
</td>
</tr>
<tr>
<td>设备编码</td>
<td v-cloak>{{ powerRun.deviceId }}</td>
</tr>
<tr>
<td>更新时间</td>
<td v-cloak>{{ powerRun.time }}</td>
</tr>
</table>
</div>
</div>
<div class="analyse-min">
<div class="analyse-title">
<div class="analyse-text">正在发生</div>
</div>
<div class="afoot-content">
<div
class="afoot-overflow process-afoot-overflow"
style="height: 530px"
id="afootOverflow"
@mouseout="listMinMouseout"
@mouseover="listMinMouseover"
>
<div v-if="warningDataList.length == 0" class="not-data"></div>
<div
v-if="warningDataList.length > 0"
:class="forIndex == i ? 'afoot-con-for active' : 'afoot-con-for '"
v-for="(item, i) in warningDataList"
>
<div class="afoot-machinery-nam" v-cloak>{{ item.type }}</div>
<div class="afoot-machinery-info">
<div class="afoot-machinery-img">
<img :src="item.images" v-if="item.images" />
</div>
<div class="afoot-machinery-data">
<div class="afoot-machinery-state" v-cloak>{{ item.content }}</div>
<div class="afoot-machinery-time" v-cloak>{{ item.time }}</div>
</div>
</div>
<div class="afoot-machinery-project">
异常传感器<span class="hj-moment-orange" v-cloak
>传感器-{{ item.deviceId }}</span
>
</div>
</div>
</div>
</div>
</div>
</div>
</el-col>
</div>
</template>
<script>
export default {
data() {
return {
powerRun: {},
powerRunList: [],
trendBtnNav: 7,
trendData: [],
tumidityBtnNav: 7,
tumidityData: [],
warningDataList: [],
forIndex: 0,
warningInterval: undefined,
};
},
mounted() {
this.$store.dispatch("ChangeNav", 306);
this.$bus.$on("projectChange", (prj) => {
this.selProject = prj;
this.init();
});
this.selProject = this.$store.getters.selProject;
this.init();
},
methods: {
init() {
if (!this.selProject) {
return;
}
this.$api.powerIot.findProAllConfigPoint(this.selProject.id).then((res) => {
if (res.data.length > 0) {
this.powerRun = res.data[0];
}
this.powerRunList = res.data;
});
this.initTrendData();
this.initTumidityData();
},
initTrendData(_date) {
if (_date) {
this.trendBtnNav = _data;
}
this.$api.powerIot
.findIotDatasMonitor(this.selProject.id, this.trendBtnNav)
.then((res) => {
if (res.data.length > 0) {
this.trendData = JSON.parse(
'{"lineData":[[6,7,6,6,6,7,7,6,7,9,9,9,9,10,10,9,10,9,8,9,10,11,10,10,8,7,7,7,7,7,6,7,6,6,6,5,5,6,9,10,10,10,11,11,12,12,13,11,9,8,8,7,6,5,5,5,5,5,5,5,5,6,9,12,11,11,12,12,13,13,13,13,11,9,7,6,5,5,4,3,3,2,2,1,1,4,7,7,8,8,9,10,11,13,12,11,11,9,9,9,8,7,6,6,6,6,5,4,4,6,8,10,12,12,13,14,14,15,15,15,12,11,9,8,8,7],[6,6,6,6,5,6,6,6,6,7,8,8,8,9,9,7,8,8,8,8,9,10,10,9,8,7,7,6,6,6,6,6,6,6,5,5,4,5,7,9,10,10,10,11,11,12,12,11,9,8,7,6,6,5,4,4,4,4,5,5,4,5,8,10,10,10,11,11,12,12,12,12,10,8,7,5,5,4,4,3,2,2,1,1,1,2,5,7,8,9,9,10,11,12,12,11,10,9,8,8,7,6,6,6,6,5,5,4,3,4,7,9,11,12,12,13,13,14,15,14,12,10,8,8,7,7],[5,6,5,5,5,6,6,6,7,8,9,9,9,9,9,9,10,9,8,8,9,11,10,10,8,7,7,6,6,6,6,6,6,6,5,5,4,6,8,11,11,11,11,11,12,12,13,12,9,9,7,7,6,5,4,4,5,4,5,5,4,5,8,11,10,11,11,11,12,13,13,12,11,9,7,5,5,4,4,3,2,2,1,1,1,4,6,8,8,9,9,10,11,12,12,11,10,8,8,8,7,6,6,5,5,5,4,4,3,5,7,9,11,12,12,13,14,14,15,15,12,10,8,8,7,7],[5,6,5,5,5,6,6,5,6,7,7,8,8,8,8,7,8,8,7,8,8,9,9,9,7,7,6,6,6,6,6,6,5,5,5,5,4,5,7,9,9,10,10,10,11,11,12,11,9,8,7,6,5,4,4,4,4,4,4,4,4,5,7,10,9,10,11,11,11,12,12,11,10,8,6,5,4,4,3,2,2,2,1,1,0,2,5,6,7,8,8,9,10,11,11,10,9,8,8,7,7,6,6,5,5,5,4,3,3,4,7,8,9,11,11,12,13,14,14,14,11,9,8,7,7,6],[70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70]],"color":["#008ffd","#f6d023","#5af9fd","#fc6902"],"legend":["A相温度","B相温度","C相温度","零线温度","温度阈值"],"unit":"℃","date":["2024-03-04 00:00","2024-03-04 01:00","2024-03-04 02:00","2024-03-04 03:00","2024-03-04 04:00","2024-03-04 05:00","2024-03-04 06:00","2024-03-04 07:00","2024-03-04 08:00","2024-03-04 09:00","2024-03-04 10:00","2024-03-04 11:00","2024-03-04 12:00","2024-03-04 13:00","2024-03-04 14:00","2024-03-05 10:00","2024-03-05 11:00","2024-03-05 12:00","2024-03-05 13:00","2024-03-05 14:00","2024-03-05 15:00","2024-03-05 16:00","2024-03-05 17:00","2024-03-05 18:00","2024-03-05 19:00","2024-03-05 20:00","2024-03-05 21:00","2024-03-05 22:00","2024-03-05 23:00","2024-03-06 00:00","2024-03-06 01:00","2024-03-06 02:00","2024-03-06 03:00","2024-03-06 04:00","2024-03-06 05:00","2024-03-06 06:00","2024-03-06 07:00","2024-03-06 08:00","2024-03-06 09:00","2024-03-06 10:00","2024-03-06 11:00","2024-03-06 12:00","2024-03-06 13:00","2024-03-06 14:00","2024-03-06 15:00","2024-03-06 16:00","2024-03-06 17:00","2024-03-06 18:00","2024-03-06 19:00","2024-03-06 20:00","2024-03-06 21:00","2024-03-06 22:00","2024-03-06 23:00","2024-03-07 00:00","2024-03-07 01:00","2024-03-07 02:00","2024-03-07 03:00","2024-03-07 04:00","2024-03-07 05:00","2024-03-07 06:00","2024-03-07 07:00","2024-03-07 08:00","2024-03-07 09:00","2024-03-07 10:00","2024-03-07 11:00","2024-03-07 12:00","2024-03-07 13:00","2024-03-07 14:00","2024-03-07 15:00","2024-03-07 16:00","2024-03-07 17:00","2024-03-07 18:00","2024-03-07 19:00","2024-03-07 20:00","2024-03-07 21:00","2024-03-07 22:00","2024-03-07 23:00","2024-03-08 00:00","2024-03-08 01:00","2024-03-08 02:00","2024-03-08 03:00","2024-03-08 04:00","2024-03-08 05:00","2024-03-08 06:00","2024-03-08 07:00","2024-03-08 08:00","2024-03-08 09:00","2024-03-08 10:00","2024-03-08 11:00","2024-03-08 12:00","2024-03-08 13:00","2024-03-08 14:00","2024-03-08 15:00","2024-03-08 16:00","2024-03-08 17:00","2024-03-08 18:00","2024-03-08 19:00","2024-03-08 20:00","2024-03-08 21:00","2024-03-08 22:00","2024-03-08 23:00","2024-03-09 00:00","2024-03-09 01:00","2024-03-09 02:00","2024-03-09 03:00","2024-03-09 04:00","2024-03-09 05:00","2024-03-09 06:00","2024-03-09 07:00","2024-03-09 08:00","2024-03-09 09:00","2024-03-09 10:00","2024-03-09 11:00","2024-03-09 12:00","2024-03-09 13:00","2024-03-09 14:00","2024-03-09 15:00","2024-03-09 16:00","2024-03-09 17:00","2024-03-09 18:00","2024-03-09 19:00","2024-03-09 20:00","2024-03-09 21:00","2024-03-09 22:00","2024-03-09 23:00","2024-03-10 00:00"]}'
);
}
});
},
initTumidityData(_date) {
if (_date) {
this.tumidityBtnNav = _data;
}
this.$api.powerIot
.findIotDatasMonitor(this.selProject.id, this.tumidityBtnNav)
.then((res) => {
if (res.data.length > 0) {
this.tumidityData = JSON.parse(
'{"lineData":[[16.6,11.6,11.7,11.7,17,16.3,16.8,16.1,18.4,57.3,34.1,16.1,24.9,17,11.6,29.3,31.9,44.2,9.6,34.6,30.2,42.4,19.3,11.9,4.2,4.7,3.4,12,2.1,2.1,2.1,2.1,7,2.2,2,2.1,2,30,27,39.4,30.2,16.2,9.5,6.3,11.6,7.4,13.5,4.2,4.5,13.5,9.3,12.1,2.9,7.6,2.9,2.9,2.8,2.8,2.8,2.9,2.8,11.2,18.3,20.5,11.3,17.8,10.6,10.5,11.2,11.9,16.8,8.7,8.7,18.6,10.5,4.5,8.5,7.3,2.3,7.4,7.2,6.7,7.3,7.3,2.3,25.4,31.7,23.4,21.7,18.4,8.8,7,17.8,11,5.8,4.8,4.6,5.1,8.7,20.5,7.1,25,2.4,2.2,6.6,2.3,2.3,7.1,2.3,19.8,19.2,21.1,13.6,23.6,13.9,4.9,7.3,7.2,6.6,7.4,9.6,9.2,2.8,2.3,2.3,2.3],[6.7,1.4,1.4,9.8,1.4,11.3,18.1,6.4,24.2,37.1,25.6,21.2,30,5.7,21.2,40.2,23.3,39.1,30.7,28.9,19.5,34.3,12.9,15.8,14.9,9.9,10.2,7,2.6,7.1,2.1,14.5,2.2,2.1,2.1,15.9,14.5,36.2,36,31.5,25.6,26.9,17.9,14.4,19.8,14.9,22.9,27.9,21.5,28.4,22,19.6,8.6,8.3,13.4,18.2,12.5,8.1,12,8.2,8.2,26.1,17.7,9.4,9,18.9,19,11.3,17.8,19,24.7,10.4,20.9,13.6,13.5,6.9,7,1.4,7.5,6.3,16.5,5.9,5.9,2,14.3,36.3,34.4,23.8,23.1,26,14.6,16.2,4.2,8.7,2.9,6.6,4.4,10.4,6.7,14.6,6.5,1.4,6.9,1.4,12.1,6.8,6.1,14.9,6.4,25.5,20,15.1,26.6,14.9,7.8,6.2,13.4,9.6,25.8,12.6,12.4,6.8,5.9,4.6,9.3,3.5],[11.2,4.8,15.9,4,14.1,4,15.9,1.9,10.8,22.3,12,13.4,25.8,15.3,16.6,16.1,8.9,17,7.3,10.5,9.9,15.6,20.7,18.5,2.9,7,2.9,1.8,11.4,1.3,11.5,1.2,11.5,1.3,1.2,11.6,11.2,21,21.2,17.3,9.4,19.6,5.4,17.3,10.2,9.6,7.4,6.6,4,2.5,4.4,4.5,9.7,10.1,11.1,1.5,11.1,1.5,1.4,1.5,9.1,11,18.5,6.1,24.5,4.1,2.3,9.7,14.4,6.7,17.1,14,3.4,2.6,10.9,1.2,10.8,1.3,6.3,1.3,6.1,1.3,7.8,8.5,7.9,21.1,13.1,19.9,14.4,24.3,4.2,17.9,16.8,6,18.6,6.4,12.3,14.5,15,4.4,14.4,12.9,1.7,15.7,4.3,4.4,4.4,4.4,15.2,9.2,6.6,6.5,18,7.8,8.6,3.4,10,9.1,21.9,6.6,4,5.5,1.5,4.2,4.1,5.7],[131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131]],"color":["#008ffd","#f4f660","#5af9fd","#FF0016"],"legend":["A相电流","B相电流","C相电流","电流阈值"],"unit":"A","date":["2024-03-04 00:00","2024-03-04 01:00","2024-03-04 02:00","2024-03-04 03:00","2024-03-04 04:00","2024-03-04 05:00","2024-03-04 06:00","2024-03-04 07:00","2024-03-04 08:00","2024-03-04 09:00","2024-03-04 10:00","2024-03-04 11:00","2024-03-04 12:00","2024-03-04 13:00","2024-03-04 14:00","2024-03-05 10:00","2024-03-05 11:00","2024-03-05 12:00","2024-03-05 13:00","2024-03-05 14:00","2024-03-05 15:00","2024-03-05 16:00","2024-03-05 17:00","2024-03-05 18:00","2024-03-05 19:00","2024-03-05 20:00","2024-03-05 21:00","2024-03-05 22:00","2024-03-05 23:00","2024-03-06 00:00","2024-03-06 01:00","2024-03-06 02:00","2024-03-06 03:00","2024-03-06 04:00","2024-03-06 05:00","2024-03-06 06:00","2024-03-06 07:00","2024-03-06 08:00","2024-03-06 09:00","2024-03-06 10:00","2024-03-06 11:00","2024-03-06 12:00","2024-03-06 13:00","2024-03-06 14:00","2024-03-06 15:00","2024-03-06 16:00","2024-03-06 17:00","2024-03-06 18:00","2024-03-06 19:00","2024-03-06 20:00","2024-03-06 21:00","2024-03-06 22:00","2024-03-06 23:00","2024-03-07 00:00","2024-03-07 01:00","2024-03-07 02:00","2024-03-07 03:00","2024-03-07 04:00","2024-03-07 05:00","2024-03-07 06:00","2024-03-07 07:00","2024-03-07 08:00","2024-03-07 09:00","2024-03-07 10:00","2024-03-07 11:00","2024-03-07 12:00","2024-03-07 13:00","2024-03-07 14:00","2024-03-07 15:00","2024-03-07 16:00","2024-03-07 17:00","2024-03-07 18:00","2024-03-07 19:00","2024-03-07 20:00","2024-03-07 21:00","2024-03-07 22:00","2024-03-07 23:00","2024-03-08 00:00","2024-03-08 01:00","2024-03-08 02:00","2024-03-08 03:00","2024-03-08 04:00","2024-03-08 05:00","2024-03-08 06:00","2024-03-08 07:00","2024-03-08 08:00","2024-03-08 09:00","2024-03-08 10:00","2024-03-08 11:00","2024-03-08 12:00","2024-03-08 13:00","2024-03-08 14:00","2024-03-08 15:00","2024-03-08 16:00","2024-03-08 17:00","2024-03-08 18:00","2024-03-08 19:00","2024-03-08 20:00","2024-03-08 21:00","2024-03-08 22:00","2024-03-08 23:00","2024-03-09 00:00","2024-03-09 01:00","2024-03-09 02:00","2024-03-09 03:00","2024-03-09 04:00","2024-03-09 05:00","2024-03-09 06:00","2024-03-09 07:00","2024-03-09 08:00","2024-03-09 09:00","2024-03-09 10:00","2024-03-09 11:00","2024-03-09 12:00","2024-03-09 13:00","2024-03-09 14:00","2024-03-09 15:00","2024-03-09 16:00","2024-03-09 17:00","2024-03-09 18:00","2024-03-09 19:00","2024-03-09 20:00","2024-03-09 21:00","2024-03-09 22:00","2024-03-09 23:00","2024-03-10 00:00"]}'
);
}
});
},
automaticRoll() {
var height = $(".afoot-con-for").innerHeight()
if (this.forIndex == this.warningDataList.length) {
this.forIndex = 0
} else {
this.forIndex = this.forIndex + 1
}
$("#afootOverflow").animate({ scrollTop: (height * this.forIndex) + 'px' })
},
listMinMouseover() {
clearInterval(this.warningInterval);
},
listMinMouseout() {
this.warningInterval = setInterval(this.automaticRoll, 5000);
},
},
};
</script>

View File

@ -1,5 +1,6 @@
package com.yanzhu.manage.controller.device;
import com.yanzhu.common.core.enums.IsDelEnums;
import com.yanzhu.common.core.utils.poi.ExcelUtil;
import com.yanzhu.common.core.web.controller.BaseController;
import com.yanzhu.common.core.web.domain.AjaxResult;
@ -95,4 +96,18 @@ public class DevIotConfigPointController extends BaseController
{
return toAjax(devIotConfigPointService.deleteDevIotConfigPointByIds(ids));
}
/**
*
*/
@GetMapping("/findProAllConfigPoint/{proId}")
public AjaxResult findProAllConfigPoint(@PathVariable("proId") Long proId)
{
DevIotConfigPoint configPointQuery = new DevIotConfigPoint();
configPointQuery.setProjectId(proId);
configPointQuery.setIsDel(IsDelEnums.NO.getCodeStr());
List<DevIotConfigPoint> list = devIotConfigPointService.selectDevIotConfigPointList(configPointQuery);
return success(list);
}
}

View File

@ -1,5 +1,6 @@
package com.yanzhu.manage.controller.device;
import com.yanzhu.common.core.enums.IsDelEnums;
import com.yanzhu.common.core.utils.poi.ExcelUtil;
import com.yanzhu.common.core.web.controller.BaseController;
import com.yanzhu.common.core.web.domain.AjaxResult;
@ -7,13 +8,17 @@ import com.yanzhu.common.core.web.page.TableDataInfo;
import com.yanzhu.common.log.annotation.Log;
import com.yanzhu.common.log.enums.BusinessType;
import com.yanzhu.common.security.annotation.RequiresPermissions;
import com.yanzhu.device.domain.DevIotConfigPoint;
import com.yanzhu.device.domain.DevIotDatas;
import com.yanzhu.manage.service.IDevIotDatasService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Controller
@ -95,4 +100,23 @@ public class DevIotDatasController extends BaseController
{
return toAjax(devIotDatasService.deleteDevIotDatasByIds(ids));
}
/**
*
*/
@GetMapping("/findIotDatasMonitor/{proId}")
public AjaxResult findProAllConfigPoint(@PathVariable("proId") Long proId, Integer date)
{
// 获取当前日期
LocalDate today = LocalDate.now();
// 获取最近${X}天的日期
LocalDate todayAgo = today.minusDays(date);
DevIotDatas datasQuery = new DevIotDatas();
datasQuery.setPointId(proId);
Map<String, Object> params = new HashMap<>();
params.put("beginCreateTime",today);
params.put("endCreateTime",todayAgo);
List<DevIotDatas> list = devIotDatasService.selectDevIotDatasList(datasQuery);
return success(list);
}
}

View File

@ -7,13 +7,17 @@ import com.yanzhu.common.core.web.page.TableDataInfo;
import com.yanzhu.common.log.annotation.Log;
import com.yanzhu.common.log.enums.BusinessType;
import com.yanzhu.common.security.annotation.RequiresPermissions;
import com.yanzhu.device.domain.DevIotDatas;
import com.yanzhu.device.domain.DevIotWarning;
import com.yanzhu.manage.service.IDevIotWarningService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Controller
@ -95,4 +99,17 @@ public class DevIotWarningController extends BaseController
{
return toAjax(devIotWarningService.deleteDevIotWarningByIds(ids));
}
/**
*
*/
@GetMapping("/findIotWarnings/{proId}")
public AjaxResult findIotWarnings(@PathVariable("proId") Long proId)
{
startPage(1,20);
DevIotWarning warningQuery = new DevIotWarning();
warningQuery.setPointId(proId);
List<DevIotWarning> list = devIotWarningService.selectDevIotWarningList(warningQuery);
return success(list);
}
}

View File

@ -45,8 +45,10 @@ public class DevIotConfigServiceImpl implements IDevIotConfigService
@Override
public List<DevIotConfig> selectDevIotConfigList(DevIotConfig devIotConfig)
{
devIotConfig.setActiveComId(SecurityUtils.getLoginUser().getSysUser().getActiveComId());
devIotConfig.setActiveProjectId(SecurityUtils.getLoginUser().getSysUser().getActiveProjectId());
if(devIotConfig.getProjectId()==null){
devIotConfig.setActiveComId(SecurityUtils.getLoginUser().getSysUser().getActiveComId());
devIotConfig.setActiveProjectId(SecurityUtils.getLoginUser().getSysUser().getActiveProjectId());
}
return devIotConfigMapper.selectDevIotConfigList(devIotConfig);
}

View File

@ -42,8 +42,10 @@ public class DevIotDatasServiceImpl implements IDevIotDatasService
@Override
public List<DevIotDatas> selectDevIotDatasList(DevIotDatas devIotDatas)
{
devIotDatas.setActiveComId(SecurityUtils.getLoginUser().getSysUser().getActiveComId());
devIotDatas.setActiveProjectId(SecurityUtils.getLoginUser().getSysUser().getActiveProjectId());
if(devIotDatas.getProjectId()==null){
devIotDatas.setActiveComId(SecurityUtils.getLoginUser().getSysUser().getActiveComId());
devIotDatas.setActiveProjectId(SecurityUtils.getLoginUser().getSysUser().getActiveProjectId());
}
return devIotDatasMapper.selectDevIotDatasList(devIotDatas);
}

View File

@ -1,13 +1,21 @@
package com.yanzhu.manage.service.impl;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.yanzhu.common.core.utils.DateUtils;
import com.yanzhu.common.core.web.domain.AjaxResult;
import com.yanzhu.common.security.utils.SecurityUtils;
import com.yanzhu.device.domain.DevIotDatas;
import com.yanzhu.device.domain.DevIotWarning;
import com.yanzhu.device.mapper.DevIotWarningMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yanzhu.manage.service.IDevIotWarningService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
/**
* Service
@ -95,4 +103,5 @@ public class DevIotWarningServiceImpl implements IDevIotWarningService
{
return devIotWarningMapper.deleteDevIotWarningById(id);
}
}