From 3ac4f2c9343626e4755cdfdcb8cfd8a25a554408 Mon Sep 17 00:00:00 2001
From: fanluyan <754122931@qq.com>
Date: Thu, 27 Jul 2023 14:28:47 +0800
Subject: [PATCH 01/15] =?UTF-8?q?=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/adddeviceDialog.vue | 8 +-
.../components/setdevicebak.vue | 386 ------------------
src/views/devicePhotoSchedule/index copy.vue | 280 +++++++++++++
vue.config.js | 6 +-
4 files changed, 288 insertions(+), 392 deletions(-)
delete mode 100644 src/views/devicePhotoSchedule/components/setdevicebak.vue
create mode 100644 src/views/devicePhotoSchedule/index copy.vue
diff --git a/src/views/devicePhotoSchedule/components/adddeviceDialog.vue b/src/views/devicePhotoSchedule/components/adddeviceDialog.vue
index 717a4e4..e9fc558 100644
--- a/src/views/devicePhotoSchedule/components/adddeviceDialog.vue
+++ b/src/views/devicePhotoSchedule/components/adddeviceDialog.vue
@@ -35,7 +35,7 @@
start-placeholder="开始时间"
end-placeholder="结束时间"
format="HH:mm"
- value-format="HH:mm:ss"
+ value-format="HH:mm"
>
@@ -93,8 +93,9 @@ export default {
name: "",
list: [
{
- time: "",
- span: "",
+ hour: "",
+ minute: "",
+ preset: "",
},
],
remark: "",
@@ -136,6 +137,7 @@ export default {
if (valid) {
// delete this.ruleForm.time;
this.ruleForm.list.forEach((val) => {
+ console.log(val);
this.$set(val, "startTime", val.time[0]);
this.$set(val, "endTime", val.time[1]);
});
diff --git a/src/views/devicePhotoSchedule/components/setdevicebak.vue b/src/views/devicePhotoSchedule/components/setdevicebak.vue
deleted file mode 100644
index d3255b3..0000000
--- a/src/views/devicePhotoSchedule/components/setdevicebak.vue
+++ /dev/null
@@ -1,386 +0,0 @@
-
-
-
-
时间表规则
-
-
-
- {{
- val.startTime.substring(0, val.startTime.lastIndexOf(":"))
- }}
- ~
- {{
- val.endTime.substring(0, val.endTime.lastIndexOf(":"))
- }}
- 间隔:{{ val.span }}分钟
-
-
-
设置通道
-
-
-
-
- {{ val.name }}
-
-
-
-
-
-
- {{ data.name }}
-
-
-
- {{ data.name }}
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/devicePhotoSchedule/index copy.vue b/src/views/devicePhotoSchedule/index copy.vue
new file mode 100644
index 0000000..40c3a2c
--- /dev/null
+++ b/src/views/devicePhotoSchedule/index copy.vue
@@ -0,0 +1,280 @@
+
+
+
+
+
diff --git a/vue.config.js b/vue.config.js
index 2d81f4c..040028d 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -29,11 +29,11 @@ module.exports = defineConfig({
proxy: {
"/api": {
//表示拦截以/api开头的请求路径
- //target: "http://47.96.238.157:8093", //阿里云服务器环境
- target: "http://180.166.218.222:40080", //dell
+ target: "http://47.96.238.157:8093", //阿里云服务器环境
+ //target: "http://180.166.218.222:40080", //dell
changOrigin: true, //是否开启跨域
pathRewrite: {
- "^/api": "/api", //重写api,把api变成空字符,因为我们真正请求的路径是没有api的
+ "^/api": "", //重写api,把api变成空字符,因为我们真正请求的路径是没有api的
},
},
},
From 50f3822bc7cb1d4cae480854639a1d638a90292d Mon Sep 17 00:00:00 2001
From: fanluyan <754122931@qq.com>
Date: Fri, 28 Jul 2023 17:31:34 +0800
Subject: [PATCH 02/15] =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/adddeviceDialog copy.vue | 260 ++++++++++++++++++
.../components/adddeviceDialog.vue | 56 +++-
src/views/devicePhotoSchedule/index.vue | 78 ++++--
3 files changed, 356 insertions(+), 38 deletions(-)
create mode 100644 src/views/devicePhotoSchedule/components/adddeviceDialog copy.vue
diff --git a/src/views/devicePhotoSchedule/components/adddeviceDialog copy.vue b/src/views/devicePhotoSchedule/components/adddeviceDialog copy.vue
new file mode 100644
index 0000000..d559381
--- /dev/null
+++ b/src/views/devicePhotoSchedule/components/adddeviceDialog copy.vue
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/devicePhotoSchedule/components/adddeviceDialog.vue b/src/views/devicePhotoSchedule/components/adddeviceDialog.vue
index e9fc558..7ace0c5 100644
--- a/src/views/devicePhotoSchedule/components/adddeviceDialog.vue
+++ b/src/views/devicePhotoSchedule/components/adddeviceDialog.vue
@@ -20,12 +20,12 @@
-
+
@@ -54,7 +56,7 @@
icon="el-icon-plus"
type="primary"
@click="addModule()"
- v-if="index + 1 == ruleForm.list.length"
+ v-if="index + 1 == ruleForm.listTime.length"
>
@@ -91,25 +93,25 @@ export default {
if (val == null) {
return (this.ruleForm = {
name: "",
- list: [
+ listTime: [
{
- hour: "",
- minute: "",
- preset: "",
+ time: "",
+ span: "",
},
],
+ list: [],
remark: "",
});
}
//this.ruleForm = val;
this.ruleForm = JSON.parse(JSON.stringify(val));
- this.ruleForm.list.forEach((val) => {
+ this.ruleForm.listTime.forEach((val) => {
this.$set(val, "time", [val.startTime, val.endTime]);
});
},
addModule() {
//新增一行
- this.ruleForm.list.push({
+ this.ruleForm.listTime.push({
time: "",
span: "",
});
@@ -136,11 +138,39 @@ export default {
this.$refs.formInfo.validate((valid) => {
if (valid) {
// delete this.ruleForm.time;
- this.ruleForm.list.forEach((val) => {
- console.log(val);
+ this.ruleForm.listTime.forEach((val) => {
this.$set(val, "startTime", val.time[0]);
this.$set(val, "endTime", val.time[1]);
+ // console.log(val.time[0]);
+ // console.log(typeof val.time[0]);
+ // console.log(new Date(val.time[0]));
+ // console.log(new Date(val.time[1]));
+ // console.log(new Date(val.time[0]).getHours());
+ // console.log(new Date(val.time[0]).getMinutes());
});
+ let arr = [];
+ for (var i = 0; i < this.ruleForm.listTime.length; i++) {
+ console.log(this.ruleForm.listTime);
+ arr.push(
+ {
+ hour: Math.floor(this.ruleForm.listTime[i].span / 60),
+ minute: this.ruleForm.listTime[i].span % 60,
+ preset: 255,
+ },
+ {
+ hour: this.ruleForm.listTime[i].startTime.getHours(),
+ minute: this.ruleForm.listTime[i].startTime.getMinutes(),
+ preset: 255,
+ },
+ {
+ hour: this.ruleForm.listTime[i].endTime.getHours(),
+ minute: this.ruleForm.listTime[i].endTime.getMinutes(),
+ preset: 255,
+ }
+ );
+ }
+ console.log(arr);
+ this.ruleForm.list = arr;
if (this.title == "新增") {
addScheduleRulel(this.ruleForm)
.then((res) => {
diff --git a/src/views/devicePhotoSchedule/index.vue b/src/views/devicePhotoSchedule/index.vue
index 40c3a2c..331330e 100644
--- a/src/views/devicePhotoSchedule/index.vue
+++ b/src/views/devicePhotoSchedule/index.vue
@@ -13,7 +13,7 @@
{{ scope.row.name }}
-
-
- {{
- val.startTime.substring(0, val.startTime.lastIndexOf(":"))
- }}
+ {{ val.startTime }}
~
- {{
- val.endTime.substring(0, val.endTime.lastIndexOf(":"))
- }}
+ {{ val.endTime }}
间隔:{{ val.span }}分钟
-
@@ -127,6 +106,8 @@ export default {
return {
title: "", //弹窗标题
deviceTableData: [],
+ newList: [],
+ listTime: [],
//multipleSelection: [], //获取当前选中
page: 1, // 当前页数
pageSize: 20, // 每页数量
@@ -146,9 +127,56 @@ export default {
pagesize: this.pageSize,
})
.then((res) => {
+ this.newList = [];
this.deviceTableData = res.data.list;
this.total = res.data.total;
this.loading = false;
+ // for (var i = 0; i < this.deviceTableData.list.length; i++) {
+ // console.log(this.deviceTableData.list[i]);
+ // }
+ // console.log(this.deviceTableData);
+
+ for (var i = 0; i < this.deviceTableData.length; i++) {
+ var arr = [];
+ console.log(this.deviceTableData[i]);
+ for (var k = 0; k < this.deviceTableData[i].list.length; k++) {
+ if (k % 3 == 0) {
+ var obj = {};
+ obj.span =
+ this.deviceTableData[i].list[k].hour * 60 +
+ this.deviceTableData[i].list[k].minute;
+ console.log("时间间隔");
+ } else if (k % 3 == 1) {
+ console.log("开始时间");
+ console.log("a");
+ // obj.startTime =
+ // this.deviceTableData[i].list[k].hour +
+ // ":" +
+ // this.deviceTableData[i].list[k].minute;
+ obj.startTime = new Date().toISOString();
+ } else if (k % 3 == 2) {
+ console.log("结束时间");
+ obj.endTime =
+ this.deviceTableData[i].list[k].hour +
+ ":" +
+ this.deviceTableData[i].list[k].minute;
+ arr.push(obj);
+ console.log("2222222222222222222222222222");
+ console.log(arr);
+ console.log("2222222222222222222222222222");
+ }
+ console.log(this.deviceTableData[i].list[k]);
+ }
+ this.newList.push({
+ id: this.deviceTableData[i].id,
+ list: this.deviceTableData[i].list,
+ name: this.deviceTableData[i].name,
+ remark: this.deviceTableData[i].remark,
+ listTime: arr,
+ });
+ }
+ console.log("this.newList");
+ console.log(this.newList);
})
.catch((err) => {});
},
From 548ecb0bfcee0610988821bba8d0de2a49123736 Mon Sep 17 00:00:00 2001
From: fanluyan <754122931@qq.com>
Date: Mon, 31 Jul 2023 15:57:40 +0800
Subject: [PATCH 03/15] =?UTF-8?q?=E6=8B=8D=E7=85=A7=E8=A3=85=E7=BD=AE?=
=?UTF-8?q?=E7=AE=A1=E7=90=86=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/adddeviceDialog.vue | 7 +-
.../components/setdevice.vue | 41 ++++--
src/views/devicePhotoSchedule/index.vue | 75 ++++++++++-
.../components/setschedule.vue | 123 ++++++++++++++++--
4 files changed, 220 insertions(+), 26 deletions(-)
diff --git a/src/views/devicePhotoSchedule/components/adddeviceDialog.vue b/src/views/devicePhotoSchedule/components/adddeviceDialog.vue
index 7ace0c5..fb39916 100644
--- a/src/views/devicePhotoSchedule/components/adddeviceDialog.vue
+++ b/src/views/devicePhotoSchedule/components/adddeviceDialog.vue
@@ -138,9 +138,10 @@ export default {
this.$refs.formInfo.validate((valid) => {
if (valid) {
// delete this.ruleForm.time;
+
this.ruleForm.listTime.forEach((val) => {
- this.$set(val, "startTime", val.time[0]);
- this.$set(val, "endTime", val.time[1]);
+ this.$set(val, "startTime", new Date(val.time[0]));
+ this.$set(val, "endTime", new Date(val.time[1]));
// console.log(val.time[0]);
// console.log(typeof val.time[0]);
// console.log(new Date(val.time[0]));
@@ -148,9 +149,11 @@ export default {
// console.log(new Date(val.time[0]).getHours());
// console.log(new Date(val.time[0]).getMinutes());
});
+
let arr = [];
for (var i = 0; i < this.ruleForm.listTime.length; i++) {
console.log(this.ruleForm.listTime);
+
arr.push(
{
hour: Math.floor(this.ruleForm.listTime[i].span / 60),
diff --git a/src/views/devicePhotoSchedule/components/setdevice.vue b/src/views/devicePhotoSchedule/components/setdevice.vue
index 3e6a8b4..395b457 100644
--- a/src/views/devicePhotoSchedule/components/setdevice.vue
+++ b/src/views/devicePhotoSchedule/components/setdevice.vue
@@ -14,13 +14,29 @@
{{
- val.startTime.substring(0, val.startTime.lastIndexOf(":"))
+ new Date(val.startTime).getHours() < 10
+ ? "0" + new Date(val.startTime).getHours()
+ : new Date(val.startTime).getHours()
+ }}:
+ {{
+ new Date(val.startTime).getMinutes() < 10
+ ? "0" + new Date(val.startTime).getMinutes()
+ : new Date(val.startTime).getMinutes()
}}
~
- {{
- val.endTime.substring(0, val.endTime.lastIndexOf(":"))
- }}
+ {{
+ new Date(val.endTime).getHours() < 10
+ ? "0" + new Date(val.endTime).getHours()
+ : new Date(val.endTime).getHours()
+ }}:
+ {{
+ new Date(val.endTime).getMinutes() < 10
+ ? "0" + new Date(val.endTime).getMinutes()
+ : new Date(val.endTime).getMinutes()
+ }}
间隔:{{ val.span }}分钟
@@ -65,6 +81,10 @@
:max="9"
>
+
+ 规约:
+ {{ data.protocol }}
+
{});
},
- //// 给数组里的每一个对象都添加一个isEdit属性
+ // 给数组里的每一个对象都添加一个isEdit属性
getChildren(data) {
console.log(data);
return data.map((item) => {
@@ -224,14 +245,16 @@ export default {
},
//时间表
sureSum() {
- //console.log(this.termidArr);
+ console.log(this.ruleSchedule);
+
console.log(this.checkedAisle);
var ruleBox = [];
for (var i = 0; i < this.allCheckNode.length; i++) {
var parmsobj = {
termid: this.allCheckNode[i].id,
- channelidlist: [this.checkedAisle],
+ channelidlist: this.checkedAisle,
offset: this.allCheckNode[i].offsetNum,
+ list: [],
};
console.log(parmsobj);
ruleBox.push(parmsobj);
diff --git a/src/views/devicePhotoSchedule/index.vue b/src/views/devicePhotoSchedule/index.vue
index 331330e..a4c6dea 100644
--- a/src/views/devicePhotoSchedule/index.vue
+++ b/src/views/devicePhotoSchedule/index.vue
@@ -37,9 +37,32 @@
v-for="(val, index) in scope.row.listTime"
:key="index"
>
-
{{ val.startTime }}
+
+ {{
+ new Date(val.startTime).getHours() < 10
+ ? "0" + new Date(val.startTime).getHours()
+ : new Date(val.startTime).getHours()
+ }}:
+ {{
+ new Date(val.startTime).getMinutes() < 10
+ ? "0" + new Date(val.startTime).getMinutes()
+ : new Date(val.startTime).getMinutes()
+ }}
+
~
-
{{ val.endTime }}
+
{{
+ new Date(val.endTime).getHours() < 10
+ ? "0" + new Date(val.endTime).getHours()
+ : new Date(val.endTime).getHours()
+ }}:
+ {{
+ new Date(val.endTime).getMinutes() < 10
+ ? "0" + new Date(val.endTime).getMinutes()
+ : new Date(val.endTime).getMinutes()
+ }}
间隔:
{{ val.span }}分钟
@@ -134,7 +157,7 @@ export default {
// for (var i = 0; i < this.deviceTableData.list.length; i++) {
// console.log(this.deviceTableData.list[i]);
// }
- // console.log(this.deviceTableData);
+ console.log(this.deviceTableData);
for (var i = 0; i < this.deviceTableData.length; i++) {
var arr = [];
@@ -153,17 +176,55 @@ export default {
// this.deviceTableData[i].list[k].hour +
// ":" +
// this.deviceTableData[i].list[k].minute;
- obj.startTime = new Date().toISOString();
+ // console.log(new Date());
+ let timeDate = new Date();
+ timeDate.setHours(this.deviceTableData[i].list[k].hour);
+ timeDate.setMinutes(this.deviceTableData[i].list[k].minute);
+ console.log(timeDate);
+ // console.log(new Date().getHours());
+ // console.log(
+ // new Date().setHours(this.deviceTableData[i].list[k].hour)
+ // );
+ // console.log(d.getHours() + ":" + d.getMinutes());
+ // if (timeDate.getHours() < 10) {
+ // console.log(timeDate.getHours());
+ // obj.startTime =
+ // "0" + timeDate.getHours() + ":" + timeDate.getMinutes();
+ // } else {
+
+ // }
+
+ // let timeHour =
+ // timeDate.getHours() < 10
+ // ? "0" + timeDate.getHours()
+ // : timeDate.getHours();
+ // let timeMinute =
+ // timeDate.getMinutes() < 10
+ // ? "0" + timeDate.getMinutes()
+ // : timeDate.getMinutes();
+ obj.startTime = timeDate.toUTCString();
} else if (k % 3 == 2) {
console.log("结束时间");
obj.endTime =
this.deviceTableData[i].list[k].hour +
":" +
this.deviceTableData[i].list[k].minute;
+ let timeDate = new Date();
+ timeDate.setHours(this.deviceTableData[i].list[k].hour);
+ timeDate.setMinutes(this.deviceTableData[i].list[k].minute);
+ // obj.endTime = c.toJSON();
+ let timeHour =
+ timeDate.getHours() < 10
+ ? "0" + timeDate.getHours()
+ : timeDate.getHours();
+ let timeMinute =
+ timeDate.getMinutes() < 10
+ ? "0" + timeDate.getMinutes()
+ : timeDate.getMinutes();
+ //obj.startTime = timeHour + ":" + timeMinute;
+ // obj.endTime = timeHour + ":" + timeMinute;
+ obj.endTime = timeDate.toUTCString();
arr.push(obj);
- console.log("2222222222222222222222222222");
- console.log(arr);
- console.log("2222222222222222222222222222");
}
console.log(this.deviceTableData[i].list[k]);
}
diff --git a/src/views/realTimeMonitor/components/setschedule.vue b/src/views/realTimeMonitor/components/setschedule.vue
index 9bc62d9..309dd5a 100644
--- a/src/views/realTimeMonitor/components/setschedule.vue
+++ b/src/views/realTimeMonitor/components/setschedule.vue
@@ -92,7 +92,7 @@
按时间段
-
+
{{
- val.startTime.substring(0, val.startTime.lastIndexOf(":"))
+ new Date(val.startTime).getHours() < 10
+ ? "0" + new Date(val.startTime).getHours()
+ : new Date(val.startTime).getHours()
+ }}:
+ {{
+ new Date(val.startTime).getMinutes() < 10
+ ? "0" + new Date(val.startTime).getMinutes()
+ : new Date(val.startTime).getMinutes()
}}
+
~
- {{
- val.endTime.substring(0, val.endTime.lastIndexOf(":"))
- }}
+ {{
+ new Date(val.endTime).getHours() < 10
+ ? "0" + new Date(val.endTime).getHours()
+ : new Date(val.endTime).getHours()
+ }}:
+ {{
+ new Date(val.endTime).getMinutes() < 10
+ ? "0" + new Date(val.endTime).getMinutes()
+ : new Date(val.endTime).getMinutes()
+ }}
间隔:{{ val.span }}分钟
@@ -259,6 +276,8 @@ export default {
selaccess: "", //选中的通道
shedulenr: [], //查询的时间表
deviceTableData: [], //时间表-表格
+ newList: [],
+ listTime: [],
page: 1, // 当前页数
pageSize: 10, // 每页数量
total: 0, //总条数
@@ -416,10 +435,98 @@ export default {
pagesize: this.pageSize,
})
.then((res) => {
+ // this.deviceTableData = res.data.list;
+ // this.total = res.data.total;
+ // console.log(this.deviceTableData);
+ // this.loading = false;
+ this.newList = [];
this.deviceTableData = res.data.list;
this.total = res.data.total;
- console.log(this.deviceTableData);
this.loading = false;
+ // for (var i = 0; i < this.deviceTableData.list.length; i++) {
+ // console.log(this.deviceTableData.list[i]);
+ // }
+ // console.log(this.deviceTableData);
+
+ for (var i = 0; i < this.deviceTableData.length; i++) {
+ var arr = [];
+ console.log(this.deviceTableData[i]);
+ for (var k = 0; k < this.deviceTableData[i].list.length; k++) {
+ if (k % 3 == 0) {
+ var obj = {};
+ obj.span =
+ this.deviceTableData[i].list[k].hour * 60 +
+ this.deviceTableData[i].list[k].minute;
+ console.log("时间间隔");
+ } else if (k % 3 == 1) {
+ console.log("开始时间");
+ console.log("a");
+ // obj.startTime =
+ // this.deviceTableData[i].list[k].hour +
+ // ":" +
+ // this.deviceTableData[i].list[k].minute;
+ // console.log(new Date());
+ let timeDate = new Date();
+ timeDate.setHours(this.deviceTableData[i].list[k].hour);
+ timeDate.setMinutes(this.deviceTableData[i].list[k].minute);
+ console.log(timeDate);
+ // console.log(new Date().getHours());
+ // console.log(
+ // new Date().setHours(this.deviceTableData[i].list[k].hour)
+ // );
+ // console.log(d.getHours() + ":" + d.getMinutes());
+ // if (timeDate.getHours() < 10) {
+ // console.log(timeDate.getHours());
+ // obj.startTime =
+ // "0" + timeDate.getHours() + ":" + timeDate.getMinutes();
+ // } else {
+
+ // }
+
+ // let timeHour =
+ // timeDate.getHours() < 10
+ // ? "0" + timeDate.getHours()
+ // : timeDate.getHours();
+ // let timeMinute =
+ // timeDate.getMinutes() < 10
+ // ? "0" + timeDate.getMinutes()
+ // : timeDate.getMinutes();
+ obj.startTime = timeDate.toUTCString();
+ } else if (k % 3 == 2) {
+ console.log("结束时间");
+ obj.endTime =
+ this.deviceTableData[i].list[k].hour +
+ ":" +
+ this.deviceTableData[i].list[k].minute;
+ let timeDate = new Date();
+ timeDate.setHours(this.deviceTableData[i].list[k].hour);
+ timeDate.setMinutes(this.deviceTableData[i].list[k].minute);
+ // obj.endTime = c.toJSON();
+ let timeHour =
+ timeDate.getHours() < 10
+ ? "0" + timeDate.getHours()
+ : timeDate.getHours();
+ let timeMinute =
+ timeDate.getMinutes() < 10
+ ? "0" + timeDate.getMinutes()
+ : timeDate.getMinutes();
+ //obj.startTime = timeHour + ":" + timeMinute;
+ // obj.endTime = timeHour + ":" + timeMinute;
+ obj.endTime = timeDate.toUTCString();
+ arr.push(obj);
+ }
+ console.log(this.deviceTableData[i].list[k]);
+ }
+ this.newList.push({
+ id: this.deviceTableData[i].id,
+ list: this.deviceTableData[i].list,
+ name: this.deviceTableData[i].name,
+ remark: this.deviceTableData[i].remark,
+ listTime: arr,
+ });
+ }
+ console.log("this.newList");
+ console.log(this.newList);
})
.catch((err) => {});
},
From 8d55d7b02306eff99eb7e60714a1ea0f4c7e7567 Mon Sep 17 00:00:00 2001
From: fanluyan <754122931@qq.com>
Date: Mon, 31 Jul 2023 17:21:01 +0800
Subject: [PATCH 04/15] =?UTF-8?q?=E6=8B=8D=E7=85=A7=E8=A3=85=E7=BD=AE?=
=?UTF-8?q?=E7=AE=A1=E7=90=86=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/setdevice.vue | 78 +++++++++++++++++--
1 file changed, 73 insertions(+), 5 deletions(-)
diff --git a/src/views/devicePhotoSchedule/components/setdevice.vue b/src/views/devicePhotoSchedule/components/setdevice.vue
index 395b457..53614db 100644
--- a/src/views/devicePhotoSchedule/components/setdevice.vue
+++ b/src/views/devicePhotoSchedule/components/setdevice.vue
@@ -232,6 +232,7 @@ export default {
this.allCheckNode = this.$refs.tree.getCheckedNodes();
// console.log(this.allCheckNode);
console.log(nodeObj);
+
this.isactive = nodeObj.id;
this.isCheck = this.$refs.tree.getCheckedNodes().indexOf(nodeObj) > -1;
console.log(this.isCheck);
@@ -245,16 +246,23 @@ export default {
},
//时间表
sureSum() {
- console.log(this.ruleSchedule);
-
console.log(this.checkedAisle);
+
var ruleBox = [];
for (var i = 0; i < this.allCheckNode.length; i++) {
+ console.log(this.allCheckNode[i].protocol);
+
+ if (this.allCheckNode[i].protocol == "65283") {
+ //湖南规约
+ this.getHnTime(this.allCheckNode[i]);
+ } else if (this.allCheckNode[i].protocol == "65286") {
+ //郑州规约
+ this.getZzTime(this.allCheckNode[i]);
+ }
var parmsobj = {
termid: this.allCheckNode[i].id,
- channelidlist: this.checkedAisle,
+ channelid: this.checkedAisle,
offset: this.allCheckNode[i].offsetNum,
- list: [],
};
console.log(parmsobj);
ruleBox.push(parmsobj);
@@ -283,6 +291,67 @@ export default {
});
});
},
+ //获取到时间规则,把时间规则转化为对应的规约格式
+ //湖南规约
+ getHnTime(val) {
+ console.log("湖南");
+ console.log(val);
+
+ var numberoff = val.offsetNum;
+ console.log(numberoff);
+ console.log(this.ruleSchedule);
+ let arr = [];
+ for (var i = 0; i < this.ruleSchedule.length; i++) {
+ console.log(this.ruleSchedule[i].startTime);
+ console.log(this.ruleSchedule[i].endTime);
+ let sTime = new Date(this.ruleSchedule[i].startTime);
+ let eTime = new Date(this.ruleSchedule[i].endTime);
+ console.log(sTime, eTime);
+ arr.push(
+ {
+ hour: Math.floor(this.ruleSchedule[i].span / 60),
+ minute: this.ruleSchedule[i].span % 60,
+ preset: 255,
+ },
+ {
+ hour: new Date(this.ruleSchedule[i].startTime).getHours(),
+ minute:
+ new Date(this.ruleSchedule[i].startTime).getMinutes() + numberoff,
+ preset: 255,
+ },
+ {
+ hour: new Date(this.ruleSchedule[i].endTime).getHours(),
+ minute:
+ new Date(this.ruleSchedule[i].endTime).getMinutes() + numberoff,
+
+ preset: 255,
+ }
+ );
+ console.log(arr);
+ // arr.push(
+ // {
+ // hour: Math.floor(this.ruleForm.listTime[i].span / 60),
+ // minute: this.ruleForm.listTime[i].span % 60,
+ // preset: 255,
+ // },
+ // {
+ // hour: this.ruleForm.listTime[i].startTime.getHours(),
+ // minute: this.ruleForm.listTime[i].startTime.getMinutes(),
+ // preset: 255,
+ // },
+ // {
+ // hour: this.ruleForm.listTime[i].endTime.getHours(),
+ // minute: this.ruleForm.listTime[i].endTime.getMinutes(),
+ // preset: 255,
+ // }
+ // );
+ }
+ },
+ //河南规约
+ getZzTime() {
+ console.log("河南");
+ console.log(this.ruleSchedule);
+ },
//根据requestid查询时间表下发状态
requestTime() {
this.sureloading = true;
@@ -297,7 +366,6 @@ export default {
arr
) {
console.log(value, index, arr);
-
return value.status !== 1;
});
if (this.requestList.length == 0) {
From 9df6f03ee6abb6f7f580a974f8eea2d29cc44524 Mon Sep 17 00:00:00 2001
From: fanluyan <754122931@qq.com>
Date: Mon, 31 Jul 2023 17:57:16 +0800
Subject: [PATCH 05/15] =?UTF-8?q?=E6=8B=8D=E7=85=A7=E8=A3=85=E7=BD=AE?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A7=84=E7=BA=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/assets/css/element.less | 3 +++
.../monitoringEquipment/photographicDevice/index.vue | 7 +++++++
2 files changed, 10 insertions(+)
diff --git a/src/assets/css/element.less b/src/assets/css/element.less
index 2af53cf..c2dbdc4 100644
--- a/src/assets/css/element.less
+++ b/src/assets/css/element.less
@@ -72,3 +72,6 @@
.el-select-dropdown {
margin-top: 4px !important;
}
+.el-link {
+ font-size: 12px;
+}
diff --git a/src/views/management/monitoringEquipment/photographicDevice/index.vue b/src/views/management/monitoringEquipment/photographicDevice/index.vue
index 2d3def3..8a306bc 100644
--- a/src/views/management/monitoringEquipment/photographicDevice/index.vue
+++ b/src/views/management/monitoringEquipment/photographicDevice/index.vue
@@ -177,6 +177,13 @@
:formatter="dateFormat"
>
-->
+
Date: Tue, 1 Aug 2023 14:56:20 +0800
Subject: [PATCH 06/15] =?UTF-8?q?=E6=8B=8D=E7=85=A7=E8=A3=85=E7=BD=AE?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A7=84=E7=BA=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/setdevice.vue | 260 ++++++++++++------
src/views/realTimeMonitor/index.vue | 4 +-
2 files changed, 182 insertions(+), 82 deletions(-)
diff --git a/src/views/devicePhotoSchedule/components/setdevice.vue b/src/views/devicePhotoSchedule/components/setdevice.vue
index 53614db..3c4e9d0 100644
--- a/src/views/devicePhotoSchedule/components/setdevice.vue
+++ b/src/views/devicePhotoSchedule/components/setdevice.vue
@@ -119,6 +119,7 @@ import {
getTermListByChannelJoggle,
getCmaSchelduleUpload,
} from "@/utils/api/index";
+import moment from "moment";
export default {
props: {
title: String,
@@ -168,6 +169,7 @@ export default {
flag: false,
sureloading: false,
showtag: false,
+ checkOffset: "",
};
},
mounted() {},
@@ -177,6 +179,7 @@ export default {
console.log(val);
this.selid = val.id;
this.ruleSchedule = val.listTime;
+ console.log(this.ruleSchedule);
// console.log(this.ruleSchedule, "时间规则");
this.getlistnr();
},
@@ -232,11 +235,34 @@ export default {
this.allCheckNode = this.$refs.tree.getCheckedNodes();
// console.log(this.allCheckNode);
console.log(nodeObj);
-
+ console.log(this.allCheckNode);
this.isactive = nodeObj.id;
this.isCheck = this.$refs.tree.getCheckedNodes().indexOf(nodeObj) > -1;
console.log(this.isCheck);
},
+ // //获取开始时间和结束时间的偏移量
+ // getruleSchedule() {
+ // for (var j = 0; j < this.allCheckNode.length; j++) {
+ // console.log(this.allCheckNode[j].offsetNum);
+ // for (var i = 0; i < this.ruleSchedule.length; i++) {
+ // console.log(typeof this.ruleSchedule[i].startTime);
+ // console.log(this.ruleSchedule[i].startTime);
+ // var Stime = moment(this.ruleSchedule[i].startTime).format("HH:mm");
+ // var Etime = moment(this.ruleSchedule[i].endTime).format("HH:mm");
+ // console.log(Stime, Etime);
+
+ // // this.ruleSchedule[i].startTime = new Date(
+ // // this.ruleSchedule[i].startTime
+ // // );
+ // // this.ruleSchedule[i].endTime = new Date(this.ruleSchedule[i].endTime);
+ // // console.log(this.ruleSchedule[i].startTime);
+ // // console.log(this.ruleSchedule[i].endTime);
+ // // moment().add(offsetSeconds, "seconds").toObject();
+
+ // // console.log(time);
+ // }
+ // }
+ // },
// 保存确定操作
submitForm() {
@@ -249,25 +275,155 @@ export default {
console.log(this.checkedAisle);
var ruleBox = [];
+ //循环装置
for (var i = 0; i < this.allCheckNode.length; i++) {
- console.log(this.allCheckNode[i].protocol);
+ console.log(this.allCheckNode[i].bsManufacturer);
+ if (
+ this.allCheckNode[i].bsManufacturer == null ||
+ this.allCheckNode[i].bsManufacturer == undefined
+ ) {
+ console.log(this.allCheckNode[i].offsetNum);
+ //循环时间规则
+ let timearr = [];
+ let dayArr = [];
+ for (var j = 0; j < this.ruleSchedule.length; j++) {
+ console.log(this.ruleSchedule);
+ console.log(this.ruleSchedule[j].startTime);
+ // var Stime = moment(this.ruleSchedule[j].startTime).format("HH:mm");
+ // var Etime = moment(this.ruleSchedule[j].endTime).format("HH:mm");
+
+ var Stime = moment(this.ruleSchedule[j].startTime)
+ .add(this.allCheckNode[i].offsetNum, "minute")
+ .format();
+ var Etime = moment(this.ruleSchedule[j].endTime)
+ .add(this.allCheckNode[i].offsetNum, "minute")
+ .format();
+ var spanTime = this.ruleSchedule[j].span;
+ console.log(spanTime);
+ console.log(moment(this.ruleSchedule[j].endTime).hour());
+ //判断湖南规约
+ if (this.allCheckNode[i].protocol == "65283") {
+ console.log("湖南规约");
+ console.log(Stime, Etime);
+ console.log(typeof Stime);
+ console.log(
+ moment(this.ruleSchedule[j].endTime)
+ .add(this.allCheckNode[i].offsetNum, "minute")
+ .hour()
+ );
+ console.log(
+ moment(this.ruleSchedule[j].endTime)
+ .add(this.allCheckNode[i].offsetNum, "minute")
+ .minute()
+ );
+
+ //如果偏移之后的时间是第二天,那么不做偏移
+ console.log(moment().isSame(moment(Etime), "day"));
+ //判断是不是同一天
+ if (moment().isSame(moment(Etime), "day")) {
+ //如果是同一天
+ timearr.push(
+ {
+ hour: Math.floor(this.ruleSchedule[j].span / 60),
+ minute: this.ruleSchedule[j].span % 60,
+ preset: 255,
+ },
+ {
+ hour: moment(this.ruleSchedule[j].startTime)
+ .add(this.allCheckNode[i].offsetNum, "minute")
+ .hour(),
+ minute: moment(this.ruleSchedule[j].startTime)
+ .add(this.allCheckNode[i].offsetNum, "minute")
+ .minute(),
+ preset: 255,
+ },
+ {
+ hour: moment(this.ruleSchedule[j].endTime)
+ .add(this.allCheckNode[i].offsetNum, "minute")
+ .hour(),
+ minute: moment(this.ruleSchedule[j].endTime)
+ .add(this.allCheckNode[i].offsetNum, "minute")
+ .minute(),
+ preset: 255,
+ }
+ );
+ } else {
+ timearr.push(
+ {
+ hour: Math.floor(this.ruleSchedule[j].span / 60),
+ minute: this.ruleSchedule[j].span % 60,
+ preset: 255,
+ },
+ {
+ hour: moment(this.ruleSchedule[j].startTime)
+ .add(this.allCheckNode[i].offsetNum, "minute")
+ .hour(),
+ minute: moment(this.ruleSchedule[j].startTime)
+ .add(this.allCheckNode[i].offsetNum, "minute")
+ .minute(),
+ preset: 255,
+ },
+ {
+ hour: moment(this.ruleSchedule[j].endTime).hour(),
+ minute: moment(this.ruleSchedule[j].endTime).minute(),
+ preset: 255,
+ }
+ );
+ }
+
+ console.log(timearr);
+ }
+ ////判断河南规约
+ if (this.allCheckNode[i].protocol == "65286") {
+ console.log("河南规约");
+ //偏移时间
+ //this.getDayArr(startDay, endDay);
+ let startDay = Stime;
+ let endDay = Etime;
+ console.log(startDay, endDay);
+ let startVal = this.$moment(new Date(startDay)).format(
+ "YYYY-MM-DD HH:mm"
+ );
+ console.log(startVal);
+
+ while (this.$moment(startVal).isBefore(endDay)) {
+ dayArr.push(startVal);
+ // 自增
+ startVal = this.$moment(new Date(startVal))
+ .add(spanTime, "minute")
+ .format("YYYY-MM-DD HH:mm");
+ console.log(startVal);
+ }
+
+ // // 将结束日期的天放进数组
+ dayArr.push(
+ this.$moment(new Date(endDay)).format("YYYY-MM-DD HH:mm")
+ );
+ console.log(dayArr);
+ for (var k = 0; k < dayArr.length; k++) {
+ //console.log(moment(dayArr[k]).hour());
+ timearr.push({
+ hour: moment(dayArr[k]).hour(),
+ minute: moment(dayArr[k]).minute(),
+ preset: 255,
+ });
+ }
- if (this.allCheckNode[i].protocol == "65283") {
- //湖南规约
- this.getHnTime(this.allCheckNode[i]);
- } else if (this.allCheckNode[i].protocol == "65286") {
- //郑州规约
- this.getZzTime(this.allCheckNode[i]);
+ // return dayArr;
+ }
+ }
+
+ var parmsobj = {
+ termid: this.allCheckNode[i].id,
+ channelid: this.checkedAisle,
+ offset: this.allCheckNode[i].offsetNum,
+ list: timearr,
+ };
+ console.log(parmsobj);
+ ruleBox.push(parmsobj);
}
- var parmsobj = {
- termid: this.allCheckNode[i].id,
- channelid: this.checkedAisle,
- offset: this.allCheckNode[i].offsetNum,
- };
- console.log(parmsobj);
- ruleBox.push(parmsobj);
+ console.log(ruleBox);
}
- console.log(ruleBox);
setScheduleRulel({
list: ruleBox,
scheduleid: this.selid,
@@ -283,75 +439,19 @@ export default {
}, 3000);
})
.catch((err) => {
- this.$message({
- duration: 1500,
- showClose: true,
- message: "添加失败",
- type: "error",
- });
+ // this.$message({
+ // duration: 1500,
+ // showClose: true,
+ // message: "添加失败",
+ // type: "error",
+ // });
});
},
//获取到时间规则,把时间规则转化为对应的规约格式
//湖南规约
- getHnTime(val) {
- console.log("湖南");
- console.log(val);
-
- var numberoff = val.offsetNum;
- console.log(numberoff);
- console.log(this.ruleSchedule);
- let arr = [];
- for (var i = 0; i < this.ruleSchedule.length; i++) {
- console.log(this.ruleSchedule[i].startTime);
- console.log(this.ruleSchedule[i].endTime);
- let sTime = new Date(this.ruleSchedule[i].startTime);
- let eTime = new Date(this.ruleSchedule[i].endTime);
- console.log(sTime, eTime);
- arr.push(
- {
- hour: Math.floor(this.ruleSchedule[i].span / 60),
- minute: this.ruleSchedule[i].span % 60,
- preset: 255,
- },
- {
- hour: new Date(this.ruleSchedule[i].startTime).getHours(),
- minute:
- new Date(this.ruleSchedule[i].startTime).getMinutes() + numberoff,
- preset: 255,
- },
- {
- hour: new Date(this.ruleSchedule[i].endTime).getHours(),
- minute:
- new Date(this.ruleSchedule[i].endTime).getMinutes() + numberoff,
-
- preset: 255,
- }
- );
- console.log(arr);
- // arr.push(
- // {
- // hour: Math.floor(this.ruleForm.listTime[i].span / 60),
- // minute: this.ruleForm.listTime[i].span % 60,
- // preset: 255,
- // },
- // {
- // hour: this.ruleForm.listTime[i].startTime.getHours(),
- // minute: this.ruleForm.listTime[i].startTime.getMinutes(),
- // preset: 255,
- // },
- // {
- // hour: this.ruleForm.listTime[i].endTime.getHours(),
- // minute: this.ruleForm.listTime[i].endTime.getMinutes(),
- // preset: 255,
- // }
- // );
- }
- },
+ getHnTime() {},
//河南规约
- getZzTime() {
- console.log("河南");
- console.log(this.ruleSchedule);
- },
+ getZzTime() {},
//根据requestid查询时间表下发状态
requestTime() {
this.sureloading = true;
diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue
index f0e212d..ba73e97 100644
--- a/src/views/realTimeMonitor/index.vue
+++ b/src/views/realTimeMonitor/index.vue
@@ -687,9 +687,9 @@ export default {
this.picTime = res.data.taketime; //获取时间 判断获取最新视频
console.log(this.requestId);
this.btnvideoloading = true;
- this.getTakePicStatus(this.requestId);
+ this.getTakePicStatus(res.data);
this.statusTimer = window.setInterval(() => {
- this.getTakePicStatus(this.requestId);
+ this.getTakePicStatus(res.data);
this.statusNum++;
}, 2000);
})
From 78bfd4ead90ef1cc99d8c6a19d549f76ce74e6da Mon Sep 17 00:00:00 2001
From: fanluyan <754122931@qq.com>
Date: Tue, 1 Aug 2023 18:24:44 +0800
Subject: [PATCH 07/15] =?UTF-8?q?=E6=8B=8D=E7=85=A7=E8=A3=85=E7=BD=AE?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A7=84=E7=BA=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/utils/api/index.js | 10 ++
.../components/setdevice.vue | 1 -
src/views/realTimeMonitor/index.vue | 128 +++++++++++++++++-
3 files changed, 137 insertions(+), 2 deletions(-)
diff --git a/src/utils/api/index.js b/src/utils/api/index.js
index 6880bc0..021044a 100644
--- a/src/utils/api/index.js
+++ b/src/utils/api/index.js
@@ -803,3 +803,13 @@ export function getOnlineTerminalListExcel() {
responseType: "blob",
});
}
+
+//调节焦距
+
+export function updateTermCamera(data) {
+ return request({
+ url: "/api/updateTermCamera",
+ method: "get",
+ params: data,
+ });
+}
diff --git a/src/views/devicePhotoSchedule/components/setdevice.vue b/src/views/devicePhotoSchedule/components/setdevice.vue
index 3c4e9d0..cd4150b 100644
--- a/src/views/devicePhotoSchedule/components/setdevice.vue
+++ b/src/views/devicePhotoSchedule/components/setdevice.vue
@@ -408,7 +408,6 @@ export default {
preset: 255,
});
}
-
// return dayArr;
}
}
diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue
index ba73e97..2858cc0 100644
--- a/src/views/realTimeMonitor/index.vue
+++ b/src/views/realTimeMonitor/index.vue
@@ -235,6 +235,49 @@
>
+
+
焦距调节
+
+ 选择通道
+
+
+ {{
+ item.alias !== null && item.alias !== ""
+ ? item.alias
+ : item.label
+ }}
+
+
+
+
+ 放大
+ 缩小
+
+
@@ -255,6 +298,7 @@ import {
getTakePicPhotoStatusJoggle,
getTakePicStatusJoggle,
setTermGPSJoggle,
+ updateTermCamera,
} from "@/utils/api/index";
import previewContain from "./previewContain.vue";
import carouselChart from "../components/carouselChart.vue";
@@ -307,6 +351,8 @@ export default {
},
channelListOption: [], //通道内容
channelOption: [], //主动拍照通道
+ channelarr: [],
+ channelarrValue: null,
selectChannelValue: null, //选中的通道
channelId: "", //选中的通道id
btnpicloading: false, //主动拍照按钮loading
@@ -466,12 +512,14 @@ export default {
.then((res) => {
console.log(res);
this.channelList = res.data.list;
+ this.channelarr = res.data.list;
if (this.channelList.length == 0) {
console.log("没有通道");
this.getTerminalPhotoList(-1, this.dateValue, this.zztermId); //获取图片列表是传当前设备的 id 和termid
} else {
console.log(this.channelList);
this.channelOption = [];
+
this.channelList.forEach((item) => {
this.channelOption.push({
label: item.channelname,
@@ -497,6 +545,7 @@ export default {
});
});
this.selectChannelValue = this.channelListOption[0].value; //默认选中所有通道
+ this.channelarrValue = this.channelOption[0].value;
this.getTerminalPhotoList(
this.selectChannelValue,
this.dateValue,
@@ -516,6 +565,10 @@ export default {
console.log(val);
this.getTerminalPhotoList(val, this.dateValue, this.zztermId);
},
+ //焦距切换通道
+ changeChannelarrValue(val) {
+ console.log(val);
+ },
//选择时间
changedate() {
console.log(this.dateValue.getTime());
@@ -1034,6 +1087,53 @@ export default {
this.timer = null;
} //利用vue的生命周期函数
},
+ //焦距放大缩小
+ amplify() {
+ getTermStatus({ termId: this.zztermId }).then((res) => {
+ console.log(res);
+ if (res.data.isonline) {
+ updateTermCamera({
+ termId: this.zztermId,
+ channelId: this.channelarrValue,
+ type: 6,
+ })
+ .then((res) => {})
+ .catch();
+ //this.$refs.infodialog_ref.getListData(this.channelId, this.cmdid);
+ } else {
+ this.$message({
+ duration: 1500,
+ showClose: true,
+ message: "装置下线,发送指令失败",
+ type: "error",
+ });
+ }
+ });
+ console.log(this.channelarrValue, this.zztermId);
+ },
+ //焦距缩小
+ reduce() {
+ getTermStatus({ termId: this.zztermId }).then((res) => {
+ console.log(res);
+ if (res.data.isonline) {
+ updateTermCamera({
+ termId: this.zztermId,
+ channelId: this.channelarrValue,
+ type: 7,
+ })
+ .then((res) => {})
+ .catch();
+ //this.$refs.infodialog_ref.getListData(this.channelId, this.cmdid);
+ } else {
+ this.$message({
+ duration: 1500,
+ showClose: true,
+ message: "装置下线,发送指令失败",
+ type: "error",
+ });
+ }
+ });
+ },
},
destroyed() {
@@ -1202,7 +1302,8 @@ export default {
}
.paramsDate,
.monitorItemBox,
- .setTimebtn {
+ .setTimebtn,
+ .setfocalLength {
margin-bottom: 16px;
position: relative;
h3 {
@@ -1226,6 +1327,31 @@ export default {
}
}
}
+ .setfocalLength {
+ .selectChannel {
+ display: flex;
+ align-items: center;
+ margin-bottom: 12px;
+ .labelname {
+ font-size: 14px;
+ margin-right: 4px;
+ width: 80px;
+ color: #666;
+ }
+ }
+ .buttonGroup {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-between;
+ .el-button {
+ margin-bottom: 8px;
+ width: 104px;
+ }
+ .el-button + .el-button {
+ margin-left: 0px;
+ }
+ }
+ }
}
}
}
From 9ee2b57776b9751652a0e16cb297c674506f38de Mon Sep 17 00:00:00 2001
From: fanluyan <754122931@qq.com>
Date: Wed, 2 Aug 2023 14:40:15 +0800
Subject: [PATCH 08/15] =?UTF-8?q?=E6=8B=8D=E7=85=A7=E8=A3=85=E7=BD=AE?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A7=84=E7=BA=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/setdevice.vue | 16 +-
.../components/setschedule.vue | 493 +++++++++++++++++-
src/views/realTimeMonitor/index.vue | 8 +-
3 files changed, 491 insertions(+), 26 deletions(-)
diff --git a/src/views/devicePhotoSchedule/components/setdevice.vue b/src/views/devicePhotoSchedule/components/setdevice.vue
index cd4150b..5bc8730 100644
--- a/src/views/devicePhotoSchedule/components/setdevice.vue
+++ b/src/views/devicePhotoSchedule/components/setdevice.vue
@@ -298,6 +298,8 @@ export default {
var Etime = moment(this.ruleSchedule[j].endTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.format();
+ var lastETime = moment(this.ruleSchedule[j].endTime).format();
+
var spanTime = this.ruleSchedule[j].span;
console.log(spanTime);
console.log(moment(this.ruleSchedule[j].endTime).hour());
@@ -378,14 +380,17 @@ export default {
console.log("河南规约");
//偏移时间
//this.getDayArr(startDay, endDay);
+
let startDay = Stime;
let endDay = Etime;
+ var lastendDay = lastETime;
+ console.log(lastETime);
console.log(startDay, endDay);
let startVal = this.$moment(new Date(startDay)).format(
"YYYY-MM-DD HH:mm"
);
console.log(startVal);
-
+ console.log(moment().isSame(moment(endDay), "day"));
while (this.$moment(startVal).isBefore(endDay)) {
dayArr.push(startVal);
// 自增
@@ -396,9 +401,12 @@ export default {
}
// // 将结束日期的天放进数组
- dayArr.push(
- this.$moment(new Date(endDay)).format("YYYY-MM-DD HH:mm")
- );
+ if (!moment().isSame(moment(endDay), "day")) {
+ dayArr.push(
+ this.$moment(new Date(lastETime)).format("YYYY-MM-DD HH:mm")
+ );
+ }
+
console.log(dayArr);
for (var k = 0; k < dayArr.length; k++) {
//console.log(moment(dayArr[k]).hour());
diff --git a/src/views/realTimeMonitor/components/setschedule.vue b/src/views/realTimeMonitor/components/setschedule.vue
index 309dd5a..ebcecc3 100644
--- a/src/views/realTimeMonitor/components/setschedule.vue
+++ b/src/views/realTimeMonitor/components/setschedule.vue
@@ -50,12 +50,22 @@
时间表:
{{ val.substring(0, val.lastIndexOf(":")) }}{{ val.substring(val.length - 5) }}
+ {{ $moment(val).format("HH:mm") }}
+
@@ -65,11 +75,20 @@
>
{{ val.substring(val.length - 5) }}
+ {{ val.substring(0, val.lastIndexOf(":")) }}{{ $moment(val).format("HH:mm") }}
@@ -101,10 +120,10 @@
{{ scope.row.name }}
-
+
+
- {{ val.startTime }} ~
- {{ val.endTime }}
+ {{
+ new Date(val.startTime).getHours() < 10
+ ? "0" + new Date(val.startTime).getHours()
+ : new Date(val.startTime).getHours()
+ }}:
+ {{
+ new Date(val.startTime).getMinutes() < 10
+ ? "0" + new Date(val.startTime).getMinutes()
+ : new Date(val.startTime).getMinutes()
+ }}
+ ~
+ {{
+ new Date(val.endTime).getHours() < 10
+ ? "0" + new Date(val.endTime).getHours()
+ : new Date(val.endTime).getHours()
+ }}:
+ {{
+ new Date(val.endTime).getMinutes() < 10
+ ? "0" + new Date(val.endTime).getMinutes()
+ : new Date(val.endTime).getMinutes()
+ }}
间隔:{{ val.span }}分钟
@@ -262,6 +304,7 @@ import {
getCmaSchelduleUpload,
getTermStatus,
} from "@/utils/api/index";
+import moment from "moment";
export default {
props: {
title: String,
@@ -314,6 +357,7 @@ export default {
offsetnum: "",
setNum: Math.floor(Math.random() * 10),
compareloading: false,
+ timeProtocol: "",
};
},
mounted() {
@@ -324,9 +368,11 @@ export default {
console.log(tab, event);
},
//获取单个设备通道
- getSingleAccess(id, zzid) {
+ getSingleAccess(id, zzid, protocol) {
this.newcmdzzid = zzid;
this.selfacilityId = id;
+ this.timeProtocol = protocol;
+ console.log(this.timeProtocol);
getChannelListJoggle({ termid: id })
.then((res) => {
this.accesslist = res.data.list;
@@ -340,10 +386,97 @@ export default {
terminalid: this.selfacilityId,
})
.then((res) => {
- // this.$message.success("查询成功");
- // this.shedulenr = res.data.list.join("; ")
this.shedulenr = res.data.list;
+ console.log(this.shedulenr);
+ //湖南规约
+ if (this.timeProtocol == "65283") {
+ console.log("1111111111111111111111111111111111111");
+ var hnarr = [];
+ for (var i = 0; i < this.shedulenr.length; i++) {
+ if (i % 3 == 0) {
+ var hnobj = {};
+ hnobj.span =
+ this.shedulenr[i].hour * 60 + this.shedulenr[i].minute;
+ console.log("时间间隔");
+ } else if (i % 3 == 1) {
+ console.log("开始时间");
+ console.log("a");
+ let timeDate = new Date();
+ timeDate.setHours(this.shedulenr[i].hour);
+ timeDate.setMinutes(this.shedulenr[i].minute);
+ console.log(timeDate);
+ hnobj.startTime = timeDate;
+ } else if (i % 3 == 2) {
+ console.log("结束时间");
+ hnobj.endTime =
+ this.shedulenr[i].hour + ":" + this.shedulenr[i].minute;
+ let timeDate = new Date();
+ timeDate.setHours(this.shedulenr[i].hour);
+ timeDate.setMinutes(this.shedulenr[i].minute);
+ // hnobj.endTime = c.toJSON();
+ let timeHour =
+ timeDate.getHours() < 10
+ ? "0" + timeDate.getHours()
+ : timeDate.getHours();
+ let timeMinute =
+ timeDate.getMinutes() < 10
+ ? "0" + timeDate.getMinutes()
+ : timeDate.getMinutes();
+ hnobj.endTime = timeDate;
+ hnarr.push(hnobj);
+ }
+ }
+ console.log("222222222222222222");
+ console.log(hnarr);
+ console.log("22222222222222222222222");
+ let dayArr = [];
+ //根据开始时间结束时间生产数组
+ for (let k = 0; k < hnarr.length; k++) {
+ console.log(hnarr[k].startTime);
+ console.log(hnarr[k].endTime);
+ console.log(hnarr[k].span);
+ let startDay = hnarr[k].startTime;
+ let endDay = hnarr[k].endTime;
+ console.log(startDay, endDay);
+ let startVal = this.$moment(new Date(startDay)).format(
+ "YYYY-MM-DD HH:mm"
+ );
+ console.log(startVal);
+ while (this.$moment(startVal).isBefore(endDay)) {
+ dayArr.push(startVal);
+ // 自增
+ startVal = this.$moment(new Date(startVal))
+ .add(hnarr[k].span, "minute")
+ .format("YYYY-MM-DD HH:mm");
+ console.log(startVal);
+ }
+
+ // // 将结束日期的天放进数组
+ dayArr.push(
+ this.$moment(new Date(endDay)).format("YYYY-MM-DD HH:mm")
+ );
+ console.log(dayArr);
+ this.shedulenr = dayArr;
+ }
+ }
+ //河南规约
+ if (this.timeProtocol == "65286") {
+ console.log("河南规约");
+ var hnarr = [];
+ for (var i = 0; i < this.shedulenr.length; i++) {
+ console.log(this.shedulenr[i].hour);
+ let timeDate = new Date();
+ timeDate.setHours(this.shedulenr[i].hour);
+ timeDate.setMinutes(this.shedulenr[i].minute);
+
+ console.log(timeDate);
+ hnarr.push(timeDate);
+ }
+ console.log(hnarr);
+ this.shedulenr = hnarr;
+ }
this.offsetnum = res.data.offset;
+
this.loading = false;
})
.catch((err) => {
@@ -362,9 +495,95 @@ export default {
terminalid: this.selfacilityId,
})
.then((res) => {
- // this.$message.success("查询成功");
- // this.shedulenr = res.data.list.join("; ")
this.shedulenr = res.data.list;
+ console.log(this.shedulenr);
+ //湖南规约
+ if (this.timeProtocol == "65283") {
+ console.log("1111111111111111111111111111111111111");
+ var hnarr = [];
+ for (var i = 0; i < this.shedulenr.length; i++) {
+ if (i % 3 == 0) {
+ var hnobj = {};
+ hnobj.span =
+ this.shedulenr[i].hour * 60 + this.shedulenr[i].minute;
+ console.log("时间间隔");
+ } else if (i % 3 == 1) {
+ console.log("开始时间");
+ console.log("a");
+ let timeDate = new Date();
+ timeDate.setHours(this.shedulenr[i].hour);
+ timeDate.setMinutes(this.shedulenr[i].minute);
+ console.log(timeDate);
+ hnobj.startTime = timeDate;
+ } else if (i % 3 == 2) {
+ console.log("结束时间");
+ hnobj.endTime =
+ this.shedulenr[i].hour + ":" + this.shedulenr[i].minute;
+ let timeDate = new Date();
+ timeDate.setHours(this.shedulenr[i].hour);
+ timeDate.setMinutes(this.shedulenr[i].minute);
+ // hnobj.endTime = c.toJSON();
+ let timeHour =
+ timeDate.getHours() < 10
+ ? "0" + timeDate.getHours()
+ : timeDate.getHours();
+ let timeMinute =
+ timeDate.getMinutes() < 10
+ ? "0" + timeDate.getMinutes()
+ : timeDate.getMinutes();
+ hnobj.endTime = timeDate;
+ hnarr.push(hnobj);
+ }
+ }
+ console.log("222222222222222222");
+ console.log(hnarr);
+ console.log("22222222222222222222222");
+ let dayArr = [];
+ //根据开始时间结束时间生产数组
+ for (let k = 0; k < hnarr.length; k++) {
+ console.log(hnarr[k].startTime);
+ console.log(hnarr[k].endTime);
+ console.log(hnarr[k].span);
+ let startDay = hnarr[k].startTime;
+ let endDay = hnarr[k].endTime;
+ console.log(startDay, endDay);
+ let startVal = this.$moment(new Date(startDay)).format(
+ "YYYY-MM-DD HH:mm"
+ );
+ console.log(startVal);
+ while (this.$moment(startVal).isBefore(endDay)) {
+ dayArr.push(startVal);
+ // 自增
+ startVal = this.$moment(new Date(startVal))
+ .add(hnarr[k].span, "minute")
+ .format("YYYY-MM-DD HH:mm");
+ console.log(startVal);
+ }
+
+ // // 将结束日期的天放进数组
+ dayArr.push(
+ this.$moment(new Date(endDay)).format("YYYY-MM-DD HH:mm")
+ );
+ console.log(dayArr);
+ this.shedulenr = dayArr;
+ }
+ }
+ //河南规约
+ if (this.timeProtocol == "65286") {
+ console.log("河南规约");
+ var hnarr = [];
+ for (var i = 0; i < this.shedulenr.length; i++) {
+ console.log(this.shedulenr[i].hour);
+ let timeDate = new Date();
+ timeDate.setHours(this.shedulenr[i].hour);
+ timeDate.setMinutes(this.shedulenr[i].minute);
+
+ console.log(timeDate);
+ hnarr.push(timeDate);
+ }
+ console.log(hnarr);
+ this.shedulenr = hnarr;
+ }
this.offsetnum = res.data.offset;
this.loading = false;
})
@@ -405,6 +624,99 @@ export default {
// this.shedulenr = res.data.list.join("; ")
this.compareloading = false;
this.newshedulenr = res.data.list;
+ //湖南规约
+ if (this.timeProtocol == "65283") {
+ console.log("湖南规约");
+ console.log("1111111111111111111111111111111111111");
+ var hnarr = [];
+ for (var i = 0; i < this.newshedulenr.length; i++) {
+ if (i % 3 == 0) {
+ var hnobj = {};
+ hnobj.span =
+ this.newshedulenr[i].hour * 60 +
+ this.newshedulenr[i].minute;
+ console.log("时间间隔");
+ } else if (i % 3 == 1) {
+ console.log("开始时间");
+ console.log("a");
+ let timeDate = new Date();
+ timeDate.setHours(this.newshedulenr[i].hour);
+ timeDate.setMinutes(this.newshedulenr[i].minute);
+ console.log(timeDate);
+ hnobj.startTime = timeDate;
+ } else if (i % 3 == 2) {
+ console.log("结束时间");
+ hnobj.endTime =
+ this.newshedulenr[i].hour +
+ ":" +
+ this.newshedulenr[i].minute;
+ let timeDate = new Date();
+ timeDate.setHours(this.newshedulenr[i].hour);
+ timeDate.setMinutes(this.newshedulenr[i].minute);
+ // hnobj.endTime = c.toJSON();
+ let timeHour =
+ timeDate.getHours() < 10
+ ? "0" + timeDate.getHours()
+ : timeDate.getHours();
+ let timeMinute =
+ timeDate.getMinutes() < 10
+ ? "0" + timeDate.getMinutes()
+ : timeDate.getMinutes();
+ hnobj.endTime = timeDate;
+ hnarr.push(hnobj);
+ }
+ }
+ console.log("222222222222222222");
+ console.log(hnarr);
+ console.log("22222222222222222222222");
+ let dayArr = [];
+ //根据开始时间结束时间生产数组
+ for (let k = 0; k < hnarr.length; k++) {
+ console.log(hnarr[k].startTime);
+ console.log(hnarr[k].endTime);
+ console.log(hnarr[k].span);
+ let startDay = hnarr[k].startTime;
+ let endDay = hnarr[k].endTime;
+ console.log(startDay, endDay);
+ let startVal = this.$moment(new Date(startDay)).format(
+ "YYYY-MM-DD HH:mm"
+ );
+ console.log(startVal);
+ while (this.$moment(startVal).isBefore(endDay)) {
+ dayArr.push(startVal);
+ // 自增
+ startVal = this.$moment(new Date(startVal))
+ .add(hnarr[k].span, "minute")
+ .format("YYYY-MM-DD HH:mm");
+ console.log(startVal);
+ }
+
+ // // 将结束日期的天放进数组
+
+ dayArr.push(
+ this.$moment(new Date(endDay)).format("YYYY-MM-DD HH:mm")
+ );
+
+ console.log(dayArr);
+ this.newshedulenr = dayArr;
+ }
+ }
+ //河南规约
+ if (this.timeProtocol == "65286") {
+ console.log("河南规约");
+ var hnarr = [];
+ for (var i = 0; i < this.newshedulenr.length; i++) {
+ console.log(this.newshedulenr[i].hour);
+ let timeDate = new Date();
+ timeDate.setHours(this.newshedulenr[i].hour);
+ timeDate.setMinutes(this.newshedulenr[i].minute);
+
+ console.log(timeDate);
+ hnarr.push(timeDate);
+ }
+ console.log(hnarr);
+ this.newshedulenr = hnarr;
+ }
this.timernum = 0;
// this.$message.success("查询成功");
clearInterval(this.timer);
@@ -537,11 +849,14 @@ export default {
},
//设置-获取所有通道
handleSet(val) {
+ console.log(this.setNum);
+ var deviceOffsetnum = this.setNum;
this.loading = true;
this.scheduleid = val.id;
this.isShowset = true;
console.log(val);
- this.scheduleInfo = val.list;
+ this.scheduleInfo = val.listTime;
+ console.log("1111111", deviceOffsetnum);
this.timeName = val.name;
getScheduleRulelAccessList({ termid: this.selfacilityId })
.then((res) => {
@@ -556,6 +871,8 @@ export default {
zzname: this.listnr[0].list[0].list[0].name,
zzcmid: this.listnr[0].list[0].list[0].cmdid,
zzid: this.listnr[0].list[0].list[0].id,
+ zzprotocol: this.timeProtocol,
+ offsetNum: deviceOffsetnum,
};
this.zzchannel = this.listnr[0].list[0].list[0].list;
console.log(this.deviceListData);
@@ -625,15 +942,149 @@ export default {
getTermStatus({ termId: this.deviceListData.zzid }).then((res) => {
console.log(res);
if (res.data.isonline) {
+ var ruleBox = [];
+ //循环装置
+
+ //循环时间规则
+ let timearr = [];
+ let dayArr = [];
+ console.log(this.scheduleInfo);
+ for (var j = 0; j < this.scheduleInfo.length; j++) {
+ var Stime = moment(this.scheduleInfo[j].startTime)
+ .add(this.deviceListData.offsetNum, "minute")
+ .format();
+ var Etime = moment(this.scheduleInfo[j].endTime)
+ .add(this.deviceListData.offsetNum, "minute")
+ .format();
+ var lastETime = moment(this.scheduleInfo[j].endTime).format();
+ var spanTime = this.scheduleInfo[j].span;
+ console.log(Stime, Etime, spanTime);
+ console.log(moment(this.scheduleInfo[j].endTime).hour());
+ //判断湖南规约
+ if (this.deviceListData.zzprotocol == "65283") {
+ console.log("湖南规约");
+ console.log(Stime, Etime);
+ console.log(typeof Stime);
+ console.log(
+ moment(this.scheduleInfo[j].endTime)
+ .add(this.deviceListData.offsetNum, "minute")
+ .hour()
+ );
+ console.log(
+ moment(this.scheduleInfo[j].endTime)
+ .add(this.deviceListData.offsetNum, "minute")
+ .minute()
+ );
+ if (moment().isSame(moment(Etime), "day")) {
+ //如果是同一天
+ timearr.push(
+ {
+ hour: Math.floor(this.scheduleInfo[j].span / 60),
+ minute: this.scheduleInfo[j].span % 60,
+ preset: 255,
+ },
+ {
+ hour: moment(this.scheduleInfo[j].startTime)
+ .add(this.deviceListData.offsetNum, "minute")
+ .hour(),
+ minute: moment(this.scheduleInfo[j].startTime)
+ .add(this.deviceListData.offsetNum, "minute")
+ .minute(),
+ preset: 255,
+ },
+ {
+ hour: moment(this.scheduleInfo[j].endTime)
+ .add(this.deviceListData.offsetNum, "minute")
+ .hour(),
+ minute: moment(this.scheduleInfo[j].endTime)
+ .add(this.deviceListData.offsetNum, "minute")
+ .minute(),
+ preset: 255,
+ }
+ );
+ } else {
+ timearr.push(
+ {
+ hour: Math.floor(this.scheduleInfo[j].span / 60),
+ minute: this.scheduleInfo[j].span % 60,
+ preset: 255,
+ },
+ {
+ hour: moment(this.scheduleInfo[j].startTime)
+ .add(this.deviceListData.offsetNum, "minute")
+ .hour(),
+ minute: moment(this.scheduleInfo[j].startTime)
+ .add(this.deviceListData.offsetNum, "minute")
+ .minute(),
+ preset: 255,
+ },
+ {
+ hour: moment(this.scheduleInfo[j].endTime).hour(),
+ minute: moment(this.scheduleInfo[j].endTime).minute(),
+ preset: 255,
+ }
+ );
+ }
+
+ console.log(timearr);
+ }
+ }
+
+ ////判断河南规约
+ if (this.deviceListData.zzprotocol == "65286") {
+ console.log("河南规约");
+ //偏移时间
+ //this.getDayArr(startDay, endDay);
+ let startDay = Stime;
+ let endDay = Etime;
+ var lastendDay = lastETime;
+ console.log(startDay, endDay);
+ let startVal = this.$moment(new Date(startDay)).format(
+ "YYYY-MM-DD HH:mm"
+ );
+ console.log(startVal);
+
+ while (this.$moment(startVal).isBefore(endDay)) {
+ dayArr.push(startVal);
+ // 自增
+ startVal = this.$moment(new Date(startVal))
+ .add(spanTime, "minute")
+ .format("YYYY-MM-DD HH:mm");
+ console.log(startVal);
+ }
+
+ // // 将结束日期的天放进数组
+ if (!moment().isSame(moment(endDay), "day")) {
+ dayArr.push(
+ this.$moment(new Date(lastETime)).format("YYYY-MM-DD HH:mm")
+ );
+ }
+ console.log(dayArr);
+ for (var k = 0; k < dayArr.length; k++) {
+ //console.log(moment(dayArr[k]).hour());
+ timearr.push({
+ hour: moment(dayArr[k]).hour(),
+ minute: moment(dayArr[k]).minute(),
+ preset: 255,
+ });
+ }
+ // return dayArr;
+ }
+
+ var parmsobj = {
+ termid: this.deviceListData.zzid,
+ channelid: this.checkList,
+ offset: this.deviceListData.offsetNum,
+ list: timearr,
+ };
+ console.log(parmsobj);
+ ruleBox.push(parmsobj);
+
+ console.log(ruleBox);
+
setScheduleRulel({
scheduleid: this.scheduleid,
- list: [
- {
- termid: this.deviceListData.zzid,
- channelidlist: [this.checkList],
- offset: this.setNum,
- },
- ],
+ list: ruleBox,
})
.then((res) => {
console.log(res);
@@ -703,7 +1154,7 @@ export default {
closebtn() {
this.isShowset = false;
this.checkList = "";
- this.setNum = Math.floor(Math.random() * 10);
+ // this.setNum = this.offsetnum;
this.deviceList();
clearInterval(this.timers);
diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue
index 2858cc0..9b178f7 100644
--- a/src/views/realTimeMonitor/index.vue
+++ b/src/views/realTimeMonitor/index.vue
@@ -343,6 +343,7 @@ export default {
swiperLoading: false,
zzCmdid: "",
zztermId: "",
+ zzprotocol: "", //装置规约
dateValue: "", //选择日期
pickerOptions: {
disabledDate(date) {
@@ -406,6 +407,7 @@ export default {
console.log(data);
this.selectData = data;
this.zztermId = data.id;
+ this.zzprotocol = data.protocol;
this.CurrentData = data;
//this.previewData = data;
if (data.dyValue) {
@@ -922,7 +924,11 @@ export default {
handleSetSchedule() {
this.clearfun();
this.$refs.setschedule_ref.display();
- this.$refs.setschedule_ref.getSingleAccess(this.zztermId, this.zzCmdid);
+ this.$refs.setschedule_ref.getSingleAccess(
+ this.zztermId,
+ this.zzCmdid,
+ this.zzprotocol
+ );
this.$refs.setschedule_ref.deviceList();
},
//线缆显示
From 3ec4f5d03ece856e5111e18d593d9ccdbd8d5522 Mon Sep 17 00:00:00 2001
From: fanluyan <754122931@qq.com>
Date: Wed, 2 Aug 2023 14:45:48 +0800
Subject: [PATCH 09/15] =?UTF-8?q?=E7=84=A6=E8=B7=9D=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/realTimeMonitor/index.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue
index 9b178f7..c5ae8fd 100644
--- a/src/views/realTimeMonitor/index.vue
+++ b/src/views/realTimeMonitor/index.vue
@@ -235,7 +235,7 @@
>
-
+
焦距调节
选择通道
From 45b85b47004c6e513f620a10356c3479756bca5c Mon Sep 17 00:00:00 2001
From: fanluyan <754122931@qq.com>
Date: Wed, 2 Aug 2023 14:49:57 +0800
Subject: [PATCH 10/15] =?UTF-8?q?=E7=84=A6=E8=B7=9D=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/devicePhotoSchedule/components/setdevice.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/views/devicePhotoSchedule/components/setdevice.vue b/src/views/devicePhotoSchedule/components/setdevice.vue
index 5bc8730..495aaf2 100644
--- a/src/views/devicePhotoSchedule/components/setdevice.vue
+++ b/src/views/devicePhotoSchedule/components/setdevice.vue
@@ -81,10 +81,10 @@
:max="9"
>
-
+
Date: Thu, 3 Aug 2023 09:25:56 +0800
Subject: [PATCH 11/15] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=A6=BB=E7=BA=BF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/setschedule.vue | 4 +-
src/views/realTimeMonitor/index.vue | 59 +++++++++++++++----
2 files changed, 49 insertions(+), 14 deletions(-)
diff --git a/src/views/realTimeMonitor/components/setschedule.vue b/src/views/realTimeMonitor/components/setschedule.vue
index ebcecc3..2c00f6d 100644
--- a/src/views/realTimeMonitor/components/setschedule.vue
+++ b/src/views/realTimeMonitor/components/setschedule.vue
@@ -70,7 +70,9 @@
装置时间表:
-
(偏移时间{{ offsetnum }}分钟)
diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue
index c5ae8fd..4362a13 100644
--- a/src/views/realTimeMonitor/index.vue
+++ b/src/views/realTimeMonitor/index.vue
@@ -20,6 +20,13 @@
+
+
+ 全部
+ 在线
+ 离线
+
+
{
- console.log(res);
- this.lineTreeData = res.data.list;
- this.$nextTick(() => {
- this.$refs.tree.setCurrentKey(this.selectData.id); //一定要加这个选中了否则样式没有出来
+ console.log("11111111");
+ console.log(this.filterText);
+ if (this.filterText !== "") {
+ this.$refs.tree.filter(this.filterText);
+ } else {
+ getdyTreeListJoggle()
+ .then((res) => {
+ console.log(res);
+ this.lineTreeData = res.data.list;
+ this.$nextTick(() => {
+ this.$refs.tree.setCurrentKey(this.selectData.id); //一定要加这个选中了否则样式没有出来
+ });
+ })
+ .catch((err) => {
+ console.log(err); //代码错误、请求失败捕获
});
- })
- .catch((err) => {
- console.log(err); //代码错误、请求失败捕获
- });
+ }
},
//树状图搜索
filterNode(value, data, node) {
- console.log(value, data, node);
-
+ //console.log(value, data, node);
+ this.filterText = value;
+ console.log(this.filterText);
// 如果什么都没填全部匹配全部返回
if (!value) return true;
this.searchName = data.name + data.cmdid;
- console.log(this.searchName);
+ //console.log(this.searchName);
// 如果传入的value和data中的label相同,匹配成功
if (this.searchName.indexOf(value) !== -1) {
return true;
@@ -1200,6 +1219,20 @@ export default {
}
}
}
+ .radioFilter {
+ width: 94%;
+ margin: 0 auto;
+ margin-bottom: 8px;
+ font-size: 12px;
+ .el-radio-group {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ .el-radio {
+ margin-right: 16px;
+ }
+ }
+ }
.el-tree {
overflow-y: auto;
overflow-x: hidden;
From de7af2db3d238b0d02c9835593ad0eb19f6a938b Mon Sep 17 00:00:00 2001
From: fanluyan <754122931@qq.com>
Date: Thu, 3 Aug 2023 17:50:56 +0800
Subject: [PATCH 12/15] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=A6=BB=E7=BA=BF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/utils/api/index.js | 7 ++-
src/views/components/carouselChart.vue | 49 ++++++++++++++++++
src/views/realTimeMonitor/index.vue | 71 +++++++++++++++++++++++---
vue.config.js | 2 +-
4 files changed, 119 insertions(+), 10 deletions(-)
diff --git a/src/utils/api/index.js b/src/utils/api/index.js
index 021044a..21dc317 100644
--- a/src/utils/api/index.js
+++ b/src/utils/api/index.js
@@ -54,8 +54,11 @@ export function alarmMarkJoggle(data) {
export function getdyTreeListJoggle(data) {
return request({
url: "/api/getdyTreeList",
- method: "post",
- data,
+ method: "get",
+ params: data,
+ headers: {
+ "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
+ },
});
}
//获取图片接口
diff --git a/src/views/components/carouselChart.vue b/src/views/components/carouselChart.vue
index 803411e..aeb294c 100644
--- a/src/views/components/carouselChart.vue
+++ b/src/views/components/carouselChart.vue
@@ -2,6 +2,7 @@
+
+
下载图片
{
+ const canvas = document.createElement("canvas");
+ canvas.width = image.width;
+ canvas.height = image.height;
+ const ctx = canvas.getContext("2d");
+ ctx.drawImage(image, 0, 0, image.width, image.height);
+ canvas.toBlob((blob) => {
+ const url = URL.createObjectURL(blob);
+ this.download(url, name);
+ // 用完释放URL对象
+ URL.revokeObjectURL(url);
+ });
+ };
+ },
+ download(href, name) {
+ const eleLink = document.createElement("a");
+ eleLink.download = name;
+ eleLink.href = href;
+ eleLink.click();
+ eleLink.remove();
+ },
// showbigpicPath(data) {
// console.log(data);
// if (data.includes("!")) {
@@ -582,6 +618,19 @@ export default {
overflow: hidden;
margin-bottom: 4px;
position: relative;
+ .downBtn {
+ position: absolute;
+ background: rgba(0, 0, 0, 0.5);
+ border: none;
+ right: 8px;
+ bottom: 16px;
+ color: #fff;
+ z-index: 5;
+ &:hover {
+ background: rgba(0, 0, 0, 0.9);
+ color: #169e8c;
+ }
+ }
&:hover {
.arrow {
opacity: 1;
diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue
index 4362a13..2491621 100644
--- a/src/views/realTimeMonitor/index.vue
+++ b/src/views/realTimeMonitor/index.vue
@@ -22,10 +22,17 @@
- 全部
- 在线
- 离线
+ 全部
+ 在线
+ 离线
+ 刷新
{
setTimeout(this.getLineTreeStatus(), 0);
@@ -401,7 +410,9 @@ export default {
methods: {
//获取当前选中的radio
getRadio() {
- console.log();
+ console.log(this.zzradio);
+ localStorage.setItem("radio", JSON.stringify(this.zzradio));
+ this.getLineTreeStatus();
},
//获取当前时间
getDateTime() {
@@ -455,10 +466,11 @@ export default {
if (this.filterText !== "") {
this.$refs.tree.filter(this.filterText);
} else {
- getdyTreeListJoggle()
+ getdyTreeListJoggle({ type: this.zzradio })
.then((res) => {
console.log(res);
this.lineTreeData = res.data.list;
+
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.selectData.id); //一定要加这个选中了否则样式没有出来
});
@@ -484,11 +496,13 @@ export default {
},
//获取左侧树结构
getLineTreeList() {
- getdyTreeListJoggle()
+ console.log(this.zzradio);
+ getdyTreeListJoggle({ type: this.zzradio })
.then((res) => {
console.log(res);
this.lineTreeData = res.data.list;
console.log(this.lineTreeData);
+
this.onlineNum = res.data.onlineNum;
this.totalNum = res.data.totalNum;
this.currentData = JSON.parse(localStorage.getItem("currentData"));
@@ -521,6 +535,45 @@ export default {
this.$refs.tree.setCurrentKey(this.currentNodekey); //一定要加这个选中了否则样式没有出来
});
}
+ // if (this.zzradio == -1) {
+ // this.lineTreeData = this.lineTreeData;
+ // } else if (this.zzradio == 1) {
+ // //在线
+ // var data = JSON.parse(JSON.stringify(this.lineTreeData));
+ // console.log(data);
+ // const filterId = (data, id) => {
+ // if (!Array.isArray(data)) {
+ // return data;
+ // }
+ // return data.filter((item) => {
+ // if ("list" in item) {
+ // item.list = filterId(item.list, id);
+ // }
+ // return item.onlinestatus !== 0;
+ // });
+ // };
+ // const filtredData = filterId(data);
+ // console.log(filtredData);
+ // this.lineTreeData = filtredData;
+ // } else if (this.zzradio == 0) {
+ // //离线
+ // var data = JSON.parse(JSON.stringify(this.lineTreeData));
+ // console.log(data);
+ // const filterId = (data, id) => {
+ // if (!Array.isArray(data)) {
+ // return data;
+ // }
+ // return data.filter((item) => {
+ // if ("list" in item) {
+ // item.list = filterId(item.list, id);
+ // }
+ // return item.onlinestatus !== 1;
+ // });
+ // };
+ // const filtredData = filterId(data);
+ // console.log(filtredData);
+ // this.lineTreeData = filtredData;
+ // }
})
.catch((err) => {
console.log(err); //代码错误、请求失败捕获
@@ -1224,6 +1277,10 @@ export default {
margin: 0 auto;
margin-bottom: 8px;
font-size: 12px;
+ display: flex;
+ justify-content: space-around;
+ .refresh {
+ }
.el-radio-group {
display: flex;
align-items: center;
diff --git a/vue.config.js b/vue.config.js
index 040028d..31ee2c5 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -30,7 +30,7 @@ module.exports = defineConfig({
"/api": {
//表示拦截以/api开头的请求路径
target: "http://47.96.238.157:8093", //阿里云服务器环境
- //target: "http://180.166.218.222:40080", //dell
+ // target: "http://180.166.218.222:40080", //dell
changOrigin: true, //是否开启跨域
pathRewrite: {
"^/api": "", //重写api,把api变成空字符,因为我们真正请求的路径是没有api的
From 948adb6ee03a150e68e659d70aed5fdb590aeccb Mon Sep 17 00:00:00 2001
From: fanluyan <754122931@qq.com>
Date: Fri, 4 Aug 2023 10:57:40 +0800
Subject: [PATCH 13/15] =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/realTimeMonitor/components/setschedule.vue | 6 +++++-
src/views/realTimeMonitor/index.vue | 5 ++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/views/realTimeMonitor/components/setschedule.vue b/src/views/realTimeMonitor/components/setschedule.vue
index 2c00f6d..6e5432f 100644
--- a/src/views/realTimeMonitor/components/setschedule.vue
+++ b/src/views/realTimeMonitor/components/setschedule.vue
@@ -870,7 +870,10 @@ export default {
dyid: this.listnr[0].id,
xlname: this.listnr[0].list[0].name,
xlid: this.listnr[0].list[0].id,
- zzname: this.listnr[0].list[0].list[0].name,
+ zzname:
+ this.listnr[0].list[0].list[0].name == null
+ ? this.listnr[0].list[0].list[0].cmdid
+ : this.listnr[0].list[0].list[0].name,
zzcmid: this.listnr[0].list[0].list[0].cmdid,
zzid: this.listnr[0].list[0].list[0].id,
zzprotocol: this.timeProtocol,
@@ -1155,6 +1158,7 @@ export default {
},
closebtn() {
this.isShowset = false;
+ this.deviceListData = [];
this.checkList = "";
// this.setNum = this.offsetnum;
this.deviceList();
diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue
index 2491621..46b17be 100644
--- a/src/views/realTimeMonitor/index.vue
+++ b/src/views/realTimeMonitor/index.vue
@@ -400,7 +400,10 @@ export default {
},
created() {
//获取日期
- this.zzradio = JSON.parse(localStorage.getItem("radio"));
+ this.zzradio =
+ JSON.parse(localStorage.getItem("radio")) !== null
+ ? JSON.parse(localStorage.getItem("radio"))
+ : -1;
this.getRadio();
this.getLineTreeList();
this.treetimer = window.setInterval(() => {
From f6c1f5becb9e2a36a64d93684fe29f9557fa9dfa Mon Sep 17 00:00:00 2001
From: fanluyan <754122931@qq.com>
Date: Mon, 7 Aug 2023 09:26:30 +0800
Subject: [PATCH 14/15] =?UTF-8?q?=E6=8B=8D=E7=85=A7=E6=97=B6=E9=97=B4?=
=?UTF-8?q?=E8=A1=A8=E8=AE=BE=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/setdevice.vue | 5 ++-
.../components/setschedule.vue | 33 ++++++++++++++-----
2 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/src/views/devicePhotoSchedule/components/setdevice.vue b/src/views/devicePhotoSchedule/components/setdevice.vue
index 495aaf2..cb1fc90 100644
--- a/src/views/devicePhotoSchedule/components/setdevice.vue
+++ b/src/views/devicePhotoSchedule/components/setdevice.vue
@@ -376,7 +376,10 @@ export default {
console.log(timearr);
}
////判断河南规约
- if (this.allCheckNode[i].protocol == "65286") {
+ if (
+ this.allCheckNode[i].protocol == "65286" ||
+ this.allCheckNode[i].protocol == "65282"
+ ) {
console.log("河南规约");
//偏移时间
//this.getDayArr(startDay, endDay);
diff --git a/src/views/realTimeMonitor/components/setschedule.vue b/src/views/realTimeMonitor/components/setschedule.vue
index 6e5432f..869712e 100644
--- a/src/views/realTimeMonitor/components/setschedule.vue
+++ b/src/views/realTimeMonitor/components/setschedule.vue
@@ -58,7 +58,7 @@
>{{ val.substring(val.length - 5) }}
{{ val.substring(val.length - 5) }}
{
this.shedulenr = res.data.list;
+ console.log(res.data.offset);
+ this.offsetnum = res.data.offset;
+ console.log(this.offsetnum);
+ console.log("aaaaa");
console.log(this.shedulenr);
//湖南规约
if (this.timeProtocol == "65283") {
@@ -462,7 +466,10 @@ export default {
}
}
//河南规约
- if (this.timeProtocol == "65286") {
+ if (
+ this.timeProtocol == "65286" ||
+ this.timeProtocol == "65282"
+ ) {
console.log("河南规约");
var hnarr = [];
for (var i = 0; i < this.shedulenr.length; i++) {
@@ -477,7 +484,6 @@ export default {
console.log(hnarr);
this.shedulenr = hnarr;
}
- this.offsetnum = res.data.offset;
this.loading = false;
})
@@ -571,7 +577,7 @@ export default {
}
}
//河南规约
- if (this.timeProtocol == "65286") {
+ if (this.timeProtocol == "65286" || this.timeProtocol == "65282") {
console.log("河南规约");
var hnarr = [];
for (var i = 0; i < this.shedulenr.length; i++) {
@@ -626,6 +632,9 @@ export default {
// this.shedulenr = res.data.list.join("; ")
this.compareloading = false;
this.newshedulenr = res.data.list;
+ this.offsetnum = res.data.offset;
+ console.log("qqqqqqqqqqqqqqqqqqqqqq");
+ console.log(this.offsetnum);
//湖南规约
if (this.timeProtocol == "65283") {
console.log("湖南规约");
@@ -704,7 +713,10 @@ export default {
}
}
//河南规约
- if (this.timeProtocol == "65286") {
+ if (
+ this.timeProtocol == "65286" ||
+ this.timeProtocol == "65282"
+ ) {
console.log("河南规约");
var hnarr = [];
for (var i = 0; i < this.newshedulenr.length; i++) {
@@ -1036,7 +1048,10 @@ export default {
}
////判断河南规约
- if (this.deviceListData.zzprotocol == "65286") {
+ if (
+ this.deviceListData.zzprotocol == "65286" ||
+ this.timeProtocol == "65282"
+ ) {
console.log("河南规约");
//偏移时间
//this.getDayArr(startDay, endDay);
@@ -1218,12 +1233,14 @@ export default {
}
}
.timeShow {
- display: flex;
+ //display: flex;
.leftTime {
width: 50%;
+ float: left;
}
.rightTime {
width: 50%;
+ float: right;
position: relative;
.offtime {
position: absolute;
From b4007ca85aa50167cef2478e9377b95e9ad43056 Mon Sep 17 00:00:00 2001
From: fanluyan <754122931@qq.com>
Date: Mon, 7 Aug 2023 09:56:07 +0800
Subject: [PATCH 15/15] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/realTimeMonitor/components/setschedule.vue | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/views/realTimeMonitor/components/setschedule.vue b/src/views/realTimeMonitor/components/setschedule.vue
index 869712e..104f602 100644
--- a/src/views/realTimeMonitor/components/setschedule.vue
+++ b/src/views/realTimeMonitor/components/setschedule.vue
@@ -70,9 +70,7 @@
装置时间表:
-
(偏移时间{{ offsetnum }}分钟)