Browse Source

Merge branch 'develop' of http://39.106.31.193:9211/mengff/jihe-hs into develop

wangqin
qingzhengli 11 months ago
parent
commit
e0c7cbc1e5
  1. 6
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Intermodulation/components/LineChartForTraffic/chart.js
  2. 13
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Intermodulation/components/LineChartForTraffic/index.vue
  3. 72
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Intermodulation/index.vue
  4. 54
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/addAndEditDialog/index.vue

6
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Intermodulation/components/LineChartForTraffic/chart.js

@ -13,7 +13,7 @@ export const lineChartOption = {
padding: [0, -15, 0, 0],
},
boundaryGap: false,
data: ["0", "2", "4", "6", "8", "10", "12", "14", "16", "18", "20", "22"],
data: [],
axisTick: {
show: false,
},
@ -27,9 +27,7 @@ export const lineChartOption = {
},
},
},
yAxis: {
max: 1,
name: "辆",
type: "value",
nameTextStyle: {
@ -85,7 +83,7 @@ export const lineChartOption = {
},
series: [
{
data: [0, 0.3, 0.6, 0.24, 0.15, 0.66, 0.9, 0, 0.36, 0.51, 0.72, 0.6, 0.3],
data: [],
type: "line",
showSymbol: false,
smooth: true,

13
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Intermodulation/components/LineChartForTraffic/index.vue

@ -8,8 +8,21 @@ import { lineChartOption } from "./chart"
export default {
name: 'LineChart',
props: {
xData: {
type: Array,
default: () => []
},
yData: {
type: Array,
default: () => []
}
},
mounted() {
const chartIns = echarts.init(this.$refs.LineChartRef);
console.log('lineChartOption', lineChartOption)
lineChartOption.xAxis.data = this.xData;
lineChartOption.series[0].data = this.yData;
chartIns.setOption(lineChartOption);
},
}

72
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Intermodulation/index.vue

@ -9,12 +9,10 @@
</ElTabPane>
<ElTabPane label="设备参数" name="second">
<div class="content-second" style="height: 185px">
<RadioGroup v-model="roadType" :options="roadTypeList" />
<span>当前车流量: 999</span>
<LineChartForTraffic
style="flex: 1"
v-if="activeName === 'second'"
/>
<RadioGroup v-model="roadType" :options="roadTypeList" @input="changeRadio" />
<span>当前车流量: {{ carNum }}</span>
<LineChartForTraffic style="flex: 1" v-if="isShowCar && activeName === 'second'" :xData="xData"
:yData="yData" />
</div>
</ElTabPane>
<ElTabPane label="在线率统计" name="third">
@ -45,6 +43,7 @@ import { dialogDelayVisible } from "./../mixin";
import request from "@/utils/request";
import { Message } from "element-ui";
import RadioGroup from "@screen/components/FormConfig/components/RadioGroup/index.vue";
import moment from 'moment/moment';
// 广
export default {
@ -74,10 +73,19 @@ export default {
brand: "XXX厂家",
deviceState: "0",
},
carNum: 0,
objectValue: {
'1': 0,
'3': 0
},
xData: [],
yData: [],
hzYData: [],
jnYData: [],
isShowCar: true,
roadTypeList: [
{ key: "1", label: "济南方向" },
{ key: "3", label: "菏泽方向" },
{ key: "1", label: "菏泽方向" },
{ key: "3", label: "济南方向" },
],
roadType: "1",
list: [
@ -138,7 +146,51 @@ export default {
const roadInfo = await getRoadInfoByStakeMark(this.dialogData.stakeMark);
if (roadInfo) this.data.roadName = roadInfo.roadName;
if (this.dialogData.iotDeviceId) {
this.getPropertiesHistory(this.dialogData.iotDeviceId);
}
},
methods: {
changeRadio(value) {
this.carNum = this.objectValue[value + ''];
this.isShowCar = false;
if (value == 3) {
this.yData = this.jnYData;
} else {
this.yData = this.hzYData;
}
console.log('xdata', this.xData);
console.log('ydata', this.hzYData);
console.log('rdata', this.jnYData);
setTimeout(() => {
this.isShowCar = true;
}, 1000)
},
getPropertiesHistory(deviceId) {
this.xData = [];
this.yData = [];
this.hzYData = [];
this.jnYData = [];
this.isShowCar = false;
request({
url: `/business/device/properties/history/day/${deviceId}/01`,
method: "get",
}).then((result) => {
if (result.code != 200) return Message.error(result?.msg);
this.objectValue = result.data[0];
this.carNum = result.data[0]['1'];
result.data.forEach(it => {
this.xData.push(moment(it.timestamp).format("HH:mm"));
this.hzYData.push(it['1']);
this.jnYData.push(it['3']);
this.yData = this.hzYData;
})
this.isShowCar = true;
});
}
}
};
</script>
@ -191,7 +243,7 @@ div.switcher {
align-items: center;
justify-content: end;
> div {
>div {
font-size: 16px;
padding: 6px 12px;
}

54
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/addAndEditDialog/index.vue

@ -32,7 +32,7 @@
<div class="second">
<el-row>
<el-col :span="2">
<div class="text">执行操作:</div>
<div class="text"><i style="color: red;">*</i>执行操作:</div>
</el-col>
<el-col :span="22">
<FormTable ref="secondFormTable" :tableData="secondFormData"></FormTable>
@ -42,7 +42,7 @@
<div class="third">
<el-row>
<el-col :span="2">
<div class="text">恢复操作:</div>
<div class="text"><i style="color: red;">*</i>恢复操作:</div>
</el-col>
<el-col :span="22">
<FormTable ref="thirdFormTable" :tableData="thirdFormData"></FormTable>
@ -312,22 +312,32 @@ export default {
// this.submitting = false;
let secondFormTable = this.$refs['secondFormTable'].tableData || [];
let thirdFormTable = this.$refs['thirdFormTable'].tableData || [];
console.log('12', thirdFormTable);
let flg = false;
for (let item of secondFormTable) {
if (this.areAllValuesEmpty(item)) { flg = true; break };
}
if (flg) return Message.warning('执行操作子项不能为空!');
for (let item of thirdFormTable) {
if (this.areAllValuesEmpty(item)) { flg = true; break };
}
if (flg) return Message.warning('恢复操作子项不能为空!');
console.log('12', secondFormTable);
console.log('34', thirdFormTable);
let dcArr = [];
let id = '';
if (this.dialogType == 2) id = this.planId;
secondFormTable.forEach(it => {
dcArr.push(this.formatData(it, 1, id));
})
thirdFormTable.forEach(it => {
dcArr.push(this.formatData(it, 2, id));
})
// console.log({
// ...this.formData,
// dcExecuteAction: dcArr
// let id = '';
// if (this.dialogType == 2) id = this.planId;
// secondFormTable.forEach(it => {
// dcArr.push(this.formatData(it, 1, id));
// })
// return;
// thirdFormTable.forEach(it => {
// dcArr.push(this.formatData(it, 2, id));
// })
console.log({
...this.formData,
dcExecuteAction: dcArr
})
return;
if (this.dialogType == 1) {//
request({
url: `/business/plans`,
@ -373,6 +383,18 @@ export default {
})
},
areAllValuesEmpty(obj) {
console.log('ass',obj)
return Object.keys(obj).every(function (key) {
const value = obj[key];
return (
value == null ||
value === '' ||
(Array.isArray(value) && value.length === 0) ||
(value instanceof Object && Object.keys(value).length === 0)
);
});
}
}
}

Loading…
Cancel
Save