+
+
+
+
+
+
+

+
+
+
+
+
+

+
{{ item.greenhouseName }}
+
+

+
+
+
+
+
+
+

+
+
![]()
+
+
{{ item.greenhouseName }}
+
+
+
+

+
品种:{{ item.greenhouseVariety }}
+
+
+

+
数量:{{ item.greenhouseNums }}株
+
+
+
+

+
生长阶段:
+
{{ item.growthStageName }}
+
+
+
+
+
+
+
+
+
+
+
@@ -811,382 +877,35 @@ export default {
popContentList: [],
popContentCurrent: 1,
- popContentCurrent1: 1,
// 自动跳转和手动跳转切换
autoPlay: false, //false 手动切换 true 自动切换
time: "", //当前时间
- typeList: [
- {
- label: "无意义的传感器",
- value: 0,
- countType: 0,
- },
- {
- label: "空气温度",
- value: 1,
- countType: 3,
- unit: "℃",
- },
- {
- label: "空气湿度",
- value: 2,
- countType: 2,
- unit: "%",
- },
- {
- label: "光亮度",
- value: 3,
- countType: 2,
- unit: "Klux",
- },
- {
- label: "二氧化碳",
- value: 4,
- countType: 0,
- unit: "ppm",
- },
- {
- label: "土壤温度",
- value: 5,
- countType: 3,
- unit: "℃",
- },
- {
- label: "土壤湿度",
- value: 6,
- countType: 2,
- unit: "%",
- },
- {
- label: "水温",
- value: 7,
- countType: 3,
- unit: "℃",
- },
- {
- label: "水肥PH",
- value: 8,
- countType: 2,
- unit: "",
- },
- {
- label: "水肥EC",
- value: 9,
- countType: 2,
- unit: "mS/cm",
- },
- {
- label: "压差",
- value: 10,
- countType: 0,
- unit: "Pa",
- },
- {
- label: "风速",
- value: 11,
- countType: 2,
- unit: "m/s",
- },
- {
- label: "风向",
- value: 12,
- countType: 0,
- unit: "°",
- },
- {
- label: "雨雪信号",
- value: 13,
- countType: 0,
- unit: "",
- },
- {
- label: "降雨量",
- value: 14,
- countType: 2,
- unit: "mm",
- },
- {
- label: "光合有效辐射",
- value: 15,
- countType: 2,
- unit: "umol/m2.s",
- },
- {
- label: "太阳总辐射",
- value: 16,
- countType: 0,
- unit: "W/m2",
- },
- {
- label: "流量",
- value: 17,
- countType: 0,
- unit: "L/H",
- },
- {
- label: "大气压强",
- value: 18,
- countType: 2,
- unit: "KPa",
- },
- {
- label: "土壤PH",
- value: 19,
- countType: 2,
- unit: "",
- },
- {
- label: "土壤EC",
- value: 20,
- countType: 0,
- unit: "uS/cm",
- },
- {
- label: "叶面温度",
- value: 21,
- countType: 3,
- unit: "℃",
- },
- {
- label: "叶面湿度",
- value: 22,
- countType: 2,
- unit: "%",
- },
- {
- label: "果实直径",
- value: 23,
- countType: 0,
- unit: "mm",
- },
- {
- label: "茎秆直径",
- value: 24,
- countType: 0,
- unit: "mm",
- },
- {
- label: "流速",
- value: 25,
- countType: 2,
- unit: "m/s",
- },
- {
- label: "瞬时流量",
- value: 26,
- countType: 2,
- unit: "m3",
- },
- {
- label: "当日流量",
- value: 27,
- countType: 2,
- unit: "T",
- },
- {
- label: "累计流量",
- value: 28,
- countType: 0,
- unit: "T",
- },
- {
- label: "无线气象站电池电压",
- value: 29,
- countType: 2,
- unit: "V",
- },
- {
- label: "无线气象站无线信号强度",
- value: 30,
- countType: 1,
- unit: "dBm",
- },
- {
- label: "无线气象站信噪比(SNR)",
- value: 31,
- countType: 1,
- unit: "dB",
- },
- {
- label: "PM1.0",
- value: 32,
- countType: 0,
- unit: "μg/m2",
- },
- {
- label: "PM2.5",
- value: 33,
- countType: 0,
- unit: "μg/m2",
- },
- {
- label: "PM10",
- value: 34,
- countType: 0,
- unit: "μg/m2",
- },
- {
- label: "紫外辐射",
- value: 35,
- countType: 0,
- unit: "W/m2",
- },
- {
- label: "蒸发量",
- value: 36,
- countType: 2,
- unit: "mm",
- },
- {
- label: "负氧离子",
- value: 37,
- countType: 0,
- unit: "个/cm3",
- },
- {
- label: "露点温度",
- value: 38,
- countType: 3,
- unit: "℃",
- },
- {
- label: "设备电压",
- value: 39,
- countType: 2,
- unit: "V",
- },
- {
- label: "设备电流",
- value: 40,
- countType: 2,
- unit: "A",
- },
- {
- label: "土壤氮含量",
- value: 41,
- countType: 0,
- unit: "mg/kg",
- },
- {
- label: "土壤磷含量",
- value: 42,
- countType: 0,
- unit: "mg/kg",
- },
- {
- label: "土壤钾含量",
- value: 43,
- countType: 0,
- unit: "mg/kg",
- },
- {
- label: "管道压力",
- value: 44,
- countType: 0,
- unit: "Kpa",
- },
- {
- label: "一氧化碳",
- value: 45,
- countType: 0,
- unit: "ppm",
- },
- {
- label: "氨气",
- value: 46,
- countType: 0,
- unit: "ppm",
- },
- {
- label: "硫化氢",
- value: 47,
- countType: 0,
- unit: "ppm",
- },
- {
- label: "氧气",
- value: 48,
- countType: 2,
- unit: "%vol",
- },
- {
- label: "甲烷",
- value: 49,
- countType: 2,
- unit: "%vol",
- },
- {
- label: "铜(CU)",
- value: 50,
- countType: 0,
- unit: "mg/kg",
- },
- {
- label: "镉(CD)",
- value: 51,
- countType: 2,
- unit: "mg/kg",
- },
- {
- label: "铅(PB)",
- value: 52,
- countType: 0,
- unit: "mg/kg",
- },
- {
- label: "噪声",
- value: 53,
- countType: 0,
- unit: "dB",
- },
- {
- label: "叶面面积",
- value: 54,
- countType: 0,
- unit: "mm",
- },
- {
- label: "虫数量",
- value: 55,
- countType: 0,
- unit: "个",
- },
- {
- label: "无线传感器电池电压",
- value: 56,
- countType: 2,
- unit: "V",
- },
- {
- label: "无线传感器无线信号强度",
- value: 57,
- countType: 1,
- unit: "dBm",
- },
- {
- label: "无线传感器信噪比(SNR)",
- value: 58,
- countType: 1,
- unit: "dB",
- },
- ],
+ typeList: this.$store.state.typeList,
limitUserId: "",
popContentList1: [],
popContentList2: [],
+ listNumber:[{id:1,num:6},
+ {id:2,num:35},
+ {id:5,num:5},
+ {id:7,num:7},
+ {id:8,num:6},
+ {id:9,num:9},
+ {id:10,num:6},
+ {id:11,num:1},
+ {id:12,num:2},
+ {id:13,num:12}],
};
},
mounted() {
this.login();
this.getTime();
+ this.typeList=this.$store.state.typeList
- setInterval(() => {
- this.getNowTime();
- }, 1000);
},
beforeDestroy() {
clearInterval(this.timer2) && this.timer2;
@@ -1221,7 +940,6 @@ export default {
-(this.popContentList.length - 24)
);
}
- // console.log(this.popContentList1);
}
});
},
@@ -1256,7 +974,7 @@ export default {
}
},
- getTopOrLeft11(id) {
+ getTopOrLeft2(id) {
for (let i = 0; i < 10; i++) {
if (id == i + 25)
return `top:65%;left:${71 - i * 4}%;transform: translate(-50%,-50%);`;
@@ -1403,20 +1121,7 @@ export default {
return 'top:16.5%;left:75.5%;transform: translate(54%,0);'
}
},
- getTopOrLeft12(id) {
- if (id == 1) {
- return 'top:37.5%;left:29.5%;z-index:10;'
- } else if (id == 2) {
- return 'top:37.5%;left:70%;z-index:9;'
- }
- },
- getTopOrLeft12_12(id) {
- if (id == 1) {
- return 'top:37.5%;left:26.5%;transform: translate(54%,0);'
- } else if (id == 2) {
- return 'top:37.5%;left:67%;transform: translate(54%,0);'
- }
- },
+
getTopOrLeft10(id) {
if (id == 1) {
return 'top:12.5%;left:43%;z-index:10;'
@@ -1456,6 +1161,74 @@ export default {
if (id == 1) {
return 'top:14.5%;left:41%;transform: translate(54%,0);'
}
+ },
+ getTopOrLeft12(id) {
+ if (id == 1) {
+ return 'top:37.5%;left:29.5%;z-index:10;'
+ } else if (id == 2) {
+ return 'top:37.5%;left:70%;z-index:9;'
+ }
+ },
+ getTopOrLeft12_12(id) {
+ if (id == 1) {
+ return 'top:37.5%;left:26.5%;transform: translate(54%,0);'
+ } else if (id == 2) {
+ return 'top:37.5%;left:67%;transform: translate(54%,0);'
+ }
+ },
+ getTopOrLeft13(id) {
+ if (id == 1) {
+ return 'top:50%;left:57%;z-index:5;'
+ }else if (id == 2) {
+ return 'top:43%;left:58%;z-index:4;'
+ }else if (id == 3) {
+ return 'top:36%;left:59%;z-index:3;'
+ }else if (id == 4) {
+ return 'top:29%;left:60%;z-index:2;'
+ }else if (id == 5) {
+ return 'top:21%;left:61%;z-index:1;'
+ } else if (id == 6) {
+ return 'top:10%;left:43.5%;z-index:12;'
+ } else if (id == 7) {
+ return 'top:11%;left:34.5%;z-index:11;'
+ } else if (id == 8) {
+ return 'top:12%;left:26%;z-index:10;'
+ } else if (id == 9) {
+ return 'top:24%;left:35%;z-index:9;'
+ } else if (id == 10) {
+ return 'top:25%;left:27%;z-index:8;'
+ } else if (id == 11) {
+ return 'top:39%;left:38.5%;z-index:7;'
+ } else if (id == 12) {
+ return 'top:40%;left:30.5%;z-index:6;'
+ }
+ },
+ getTopOrLeft13_13(id) {
+ if (id == 1) {
+ return 'top:50%;left:54%;transform: translate(54%,0);'
+ } else if (id == 2) {
+ return 'top:43%;left:55%;transform: translate(54%,0);'
+ } else if (id == 3) {
+ return 'top:36%;left:56%;transform: translate(54%,0);'
+ } else if (id == 4) {
+ return 'top:29%;left:57%;transform: translate(54%,0);'
+ } else if (id == 5) {
+ return 'top:21%;left:58%;transform: translate(54%,0);'
+ }else if (id == 6) {
+ return 'top:10%;left:40.5%;transform: translate(54%,0);'
+ } else if (id == 7) {
+ return 'top:11%;left:31.5%;transform: translate(54%,0);'
+ } else if (id == 8) {
+ return 'top:12%;left:23%;transform: translate(54%,0);'
+ } else if (id == 9) {
+ return 'top:24%;left:32%;transform: translate(54%,0);'
+ } else if (id == 10) {
+ return 'top:25%;left:24%;transform: translate(54%,0);'
+ } else if (id == 11) {
+ return 'top:39%;left:35.5%;transform: translate(54%,0);'
+ } else if (id == 12) {
+ return 'top:40%;left:27.5%;transform: translate(54%,0);'
+ }
},
getNamePosition(id) {
if (id == 1) {
@@ -1483,28 +1256,13 @@ export default {
let that = this;
this.autoPlay = true;
localStorage.setItem("autoPlay", JSON.stringify(this.autoPlay));
+ var num=this.listNumber.find(item => item.id == that.limitUserId)
+ var maxNum=num?num:0
this.timer2 = setInterval(() => {
- if (that.limitUserId == 1) {
that.popContentCurrent++;
- if (that.popContentCurrent > 6) {
+ if (that.popContentCurrent >= maxNum) {
that.popContentCurrent = 1;
}
- } else if (that.limitUserId == 2) {
- that.popContentCurrent1++;
- if (that.popContentCurrent1 > 34) {
- that.popContentCurrent1 = 1;
- }
- } else if (that.limitUserId == 5) {
- that.popContentCurrent++;
- if (that.popContentCurrent > 4) {
- that.popContentCurrent = 1;
- }
- } else if (that.limitUserId == 7) {
- that.popContentCurrent++;
- if (that.popContentCurrent > 6) {
- that.popContentCurrent = 1;
- }
- }
}, 3000);
},
@@ -1546,29 +1304,15 @@ export default {
if (this.autoPlay == false) {
clearInterval(that.timer2) && this.timer2;
} else {
- this.timer2 = setInterval(() => {
- if (that.limitUserId == 1) {
- that.popContentCurrent++;
- if (that.popContentCurrent > 6) {
- that.popContentCurrent = 1;
- }
- } else if (that.limitUserId == 2) {
- that.popContentCurrent1++;
- if (that.popContentCurrent1 > 35) {
- that.popContentCurrent1 = 1;
- }
- } else if (that.limitUserId == 5) {
- that.popContentCurrent++;
- if (that.popContentCurrent > 4) {
- that.popContentCurrent = 1;
- }
- } else if (that.limitUserId == 7) {
- that.popContentCurrent++;
- if (that.popContentCurrent > 6) {
- that.popContentCurrent = 1;
- }
+ var num=this.listNumber.find(item => item.id == that.limitUserId)
+ var maxNum=num?num:0
+ this.timer2 = setInterval(() => {
+ that.popContentCurrent++;
+ if (that.popContentCurrent >= maxNum) {
+ that.popContentCurrent = 1;
}
- }, 3000);
+ }, 3000);
+
}
},
@@ -1576,26 +1320,31 @@ export default {
get_user_getjurisdiction(userId) {
this.api.user_getjurisdiction(userId).then((res) => {
if (res.data.code == 200) {
- this.limitUserId = (res.data.data.filter(el => el.id == 1 || el.id == 2 || el.id == 5 || el.id == 7 || el.id == 8 || el.id == 9 || el.id == 10 || el.id == 11 || el.id == 12))[0].id;
- if (this.limitUserId == 1) {
- this.drag_boxHandler();
- } else if (this.limitUserId == 2) {
- this.drag_boxHandler1();
- } else if (this.limitUserId == 5) {
- this.drag_boxHandler5();
- } else if (this.limitUserId == 7) {
- this.drag_boxHandler7();
- } else if (this.limitUserId == 8) {
- this.drag_boxHandler8();
- } else if (this.limitUserId == 9) {
- this.drag_boxHandler9();
- } else if (this.limitUserId == 10) {
- this.drag_boxHandler10();
- } else if (this.limitUserId == 11) {
- this.drag_boxHandler11();
- } else if (this.limitUserId == 12) {
- this.drag_boxHandler12();
- }
+ this.limitUserId = (res.data.data.filter(el => el.id == 1 || el.id == 2 || el.id == 5 || el.id == 7 || el.id == 8 || el.id == 9 || el.id == 10 || el.id == 11 || el.id == 12|| el.id == 13))[0].id;
+ setTimeout(() => {
+ this.drag_boxHandler(this.limitUserId);
+ }, 0);
+ // if (this.limitUserId == 1) {
+ // this.drag_boxHandler();
+ // } else if (this.limitUserId == 2) {
+ // this.drag_boxHandler1();
+ // } else if (this.limitUserId == 5) {
+ // this.drag_boxHandler5();
+ // } else if (this.limitUserId == 7) {
+ // this.drag_boxHandler7();
+ // } else if (this.limitUserId == 8) {
+ // this.drag_boxHandler8();
+ // } else if (this.limitUserId == 9) {
+ // this.drag_boxHandler9();
+ // } else if (this.limitUserId == 10) {
+ // this.drag_boxHandler10();
+ // } else if (this.limitUserId == 11) {
+ // this.drag_boxHandler11();
+ // } else if (this.limitUserId == 12) {
+ // this.drag_boxHandler12();
+ // }else if (this.limitUserId == 13) {
+ // this.drag_boxHandler13();
+ // }
}
});
},
@@ -1626,26 +1375,21 @@ export default {
clearInterval(that.timer2) && this.timer2;
},
- cancelHandler1() {
- this.popContentCurrent1 = -1;
- },
handlerPop(id) {
- // console.log(id);
this.popContentCurrent = id;
},
- handlerPop1(id) {
- this.popContentCurrent1 = id;
- },
+
toBack() {
this.$router.push({ path: "/largeScreen" });
},
- drag_boxHandler() {
- let demo = this.$refs.drag_box;
- demo = document.querySelector(".drag_box"); //待拖拽元素
+ drag_boxHandler(id) {
+ console.log(id,111);
+ let demo = this.$refs[`drag_box${id}`];
+ demo = document.querySelector(`.drag_box${id}`); //待拖拽元素
let canMove = false; //拖拽状态
let x = 0,
y = 0; //鼠标位置
@@ -1712,8 +1456,75 @@ export default {
},
drag_boxHandler1() {
- let demo = this.$refs.drag_box1;
- demo = document.querySelector(".drag_box1"); //待拖拽元素
+ let demo = this.$refs.drag_box2;
+ demo = document.querySelector(".drag_box2"); //待拖拽元素
+ let canMove = false; //拖拽状态
+ let x = 0,
+ y = 0; //鼠标位置
+ //监听按下鼠标事件
+ demo.onmousedown = function (e) {
+ x = e.pageX - demo.offsetLeft;
+ y = e.pageY - demo.offsetTop;
+ canMove = true; //激活拖拽状态
+ };
+ //监听右击鼠标事件
+ demo.oncontextmenu = function (e) {
+ e.preventDefault(); //阻止默认行为
+ };
+ //监听鼠标抬起事件
+ window.onmouseup = function () {
+ canMove = false; //关闭拖拽状态
+ };
+
+ window.onblur = function () {
+ //窗口失去焦点事件
+ canMove = false; //关闭拖拽状态
+ };
+
+ //监听鼠标移动事件
+ window.onmousemove = function (e) {
+ e.preventDefault(); //阻止默认行为(字不能拖走)
+ if (canMove) {
+ //对范围判断
+ let left = e.pageX - x;
+ let top = e.pageY - y;
+
+ //if (left > 0) left = 0 //当距离左边小于0时 让它为0
+ //if (top > 0) top = 0 //当距离上边小于0时 让它为0
+ // //右边距离为 标签距离左边最大距离(页面宽度减去div宽度得到)
+ // let maxLeft = window.innerWidth - demo.offsetWidth
+ // //下边距离为 标签距离上边最大距离(页面高度减去div高度度得到)
+ // let maxTop = window.innerHeight - demo.offsetHeight
+
+ // if (left > maxLeft) left = maxLeft
+ // if (top > maxTop) top = maxTop
+
+ demo.style.left = left + "px";
+ demo.style.top = top + "px";
+ }
+ };
+ let scale = 1;
+ demo.onwheel = function (e) {
+ if (e.wheelDelta > 0) {
+ scale += 0.05;
+ if (scale > 4) {
+ scale = 4;
+ }
+ demo.style.transform = `scale(${scale})`;
+ // console.log(scale);
+ } else {
+ scale -= 0.05;
+ if (scale < 1) {
+ scale = 1;
+ }
+ demo.style.transform = `scale(${scale})`;
+ // console.log(scale);
+ }
+ };
+ },
+ drag_boxHandler13() {
+ let demo = this.$refs.drag_box13;
+ demo = document.querySelector(".drag_box13"); //待拖拽元素
let canMove = false; //拖拽状态
let x = 0,
y = 0; //鼠标位置
@@ -2417,7 +2228,7 @@ export default {
overflow: hidden;
position: absolute;
- .drag_box1 {
+ .drag_box2 {
width: 100%;
height: 100%;
position: absolute;
@@ -2640,7 +2451,7 @@ export default {
}
}
- .drag_box {
+ .drag_box1 {
width: 100%;
height: 100%;
position: absolute;
@@ -2905,7 +2716,8 @@ export default {
.drag_box9,
.drag_box10,
.drag_box11,
- .drag_box12 {
+ .drag_box12,
+ .drag_box13 {
width: 100%;
height: auto;
position: absolute;
diff --git a/vue.config.js b/vue.config.js
index ada31900..5dde2e7d 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -41,9 +41,9 @@ module.exports = {
// https:true,
proxy: {
"/api": {
- // target: 'https://api.lihe-control.com', //地址
+ target: 'https://api.lihe-control.com', //地址
// target: 'http://jiaxingtest.a1.luyouxia.net:21114', //地址
- target: 'http://jiaxingtest.a1.luyouxia.net:25762', //地址
+ // target: 'http://jiaxingtest.a1.luyouxia.net:25762', //地址
changeOrigin: true,
pathRewrite: {