pc端源码提交

pull/2/head
mzp 2023-09-28 17:50:50 +08:00
commit b8ab0b2645
115 changed files with 27550 additions and 0 deletions

23
.gitignore vendored 100644
View File

@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

19
README.md 100644
View File

@ -0,0 +1,19 @@
# ysws-vue
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

5
babel.config.js 100644
View File

@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

19
jsconfig.json 100644
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"baseUrl": "./",
"moduleResolution": "node",
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}
}

19204
package-lock.json generated 100644

File diff suppressed because it is too large Load Diff

38
package.json 100644
View File

@ -0,0 +1,38 @@
{
"name": "ysws-vue",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"axios": "^1.5.0",
"core-js": "^3.8.3",
"echarts": "^5.4.3",
"element-ui": "^2.15.14",
"flv.js": "^1.6.2",
"video.js": "^7.21.5",
"videojs-contrib-hls": "^5.15.0",
"videojs-contrib-hls.js": "^3.2.0",
"vue": "^2.7.14",
"vue-router": "^3.5.1",
"vue-seamless-scroll": "^1.1.23",
"vue-video-player": "^6.0.0",
"vuex": "^3.6.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-plugin-vuex": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"sass": "^1.32.7",
"sass-loader": "^12.0.0",
"vue-template-compiler": "^2.6.14"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}

BIN
public/favicon.ico 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

17
public/index.html 100644
View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

106
src/App.vue 100644
View File

@ -0,0 +1,106 @@
<template>
<div id="app">
<router-view />
</div>
</template>
<style lang="scss">
* {
padding: 0;
margin: 0;
outline: none;
font-size: 16px;
box-sizing: border-box;
font-family: Microsoft YaHei;
font-weight: 400;
color: #fff;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none !important;
margin: 0;
}
@font-face {
font-family: Oswald;
src: url(./assets/ttf/Oswald-Medium.ttf);
}
@font-face {
font-family: Alibaba PuHuiTi;
src: url(./assets/ttf/ALIBABA-PUHUITI-MEDIUM.OTF);
}
@font-face {
font-family: Alibaba PuHuiTiR;
src: url(./assets/ttf/ALIBABA-PUHUITI-REGULAR.OTF);
}
@font-face {
font-family: Alimama ShuHeiTiB;
src: url(./assets/ttf/Alimama_ShuHeiTi_Bold.ttf);
}
.main-title {
width: 100%;
height: 41px;
background: url(./assets/image/main-title.png) no-repeat center;
background-size: 100% 100%;
padding-left: 23px;
span {
line-height: 41px;
font-size: 20px;
font-family: Alibaba PuHuiTi;
font-weight: bold;
color: #DBE8FF;
background: linear-gradient(180deg, rgba(49, 190, 255, 1) 0%, rgba(20, 158, 255, 1) 0%, rgba(239, 252, 254, 1) 58.7646484375%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
.view-content {
width: 100%;
height: 327px;
border: 1px solid;
margin-top: 8px;
border-image: linear-gradient(180deg, rgba(142, 179, 221, 0.5) 0%, transparent 100%) 10 10;
background: linear-gradient(180deg, rgba(6, 72, 167, 0.5) 0%, rgba(6, 72, 167, 0) 100%);
}
.input-50 {
.input-title {
font-size: 16px;
font-family: Alibaba PuHuiTiR;
font-weight: 400;
color: #FFF9F9;
}
input,
.input {
width: 100%;
height: 50px;
background: url(./assets/image/left1-input.png) no-repeat center;
background-size: 100% 100%;
padding-left: 15px;
font-size: 20px;
font-family: Alibaba PuHuiTiR;
font-weight: 400;
color: #648cbb;
border: none;
line-height: 50px;
&.green{
color: #3CFDFF;
}
}
&.input-100 {
width: 100% !important;
}
}
</style>

115
src/api/index.js 100644
View File

@ -0,0 +1,115 @@
import axios from "axios";
// import qs from 'qs'
import router from '../router/index'
function sendGetRequest(url, data) {
return new Promise(function (resolve, reject) {
axios.get(url, {
headers: { //头部参数
// 'Content-Type': 'application/json; charset=utf-8',
// "Access-Control-Allow-Origin": "*",
// "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept",
'token': (localStorage.getItem('token') ? localStorage.getItem('token') : '')
},
params: data
})
.then(function (res) { //请求成功response接收返回参数
if(res.data.code==401){
localStorage.removeItem('token')
router.push({ name:'login' })
}
resolve(res);
})
.catch(function (err) { //请求失败error接收失败原因
reject(err);
})
});
}
function sendPostRequest(url, data) {
// 一个状态为resolve包裹的是数据
// 或者状态为reject (包裹的是错误信息)
// 的promise对象
return new Promise(function (resolve, reject) {
axios.post(url, data, {
headers: {
// 'Content-Type': 'application/json; charset=utf-8',
'token': (localStorage.getItem('token') ? localStorage.getItem('token') : '')
}
}).then(
(res) => {
if(res.data.code==401){
localStorage.removeItem('token')
router.push({ name:'login' })
}
resolve(res);
},
(err) => {
reject(err);
}
);
});
}
//总接口域名
axios.defaults.baseURL = "/api";
axios.defaults.timeout = 30000; // 设置全局默认请求超时时间为10秒
// 接口列表
export default {
//防止没有一个post/get会报错 写一个默认的
get(data) {
return sendGetRequest("", data);
},
post(data) {
return sendPostRequest("", data);
},
//接口开始()
//登录
login(data) {
return sendPostRequest("/user/login", data);
},
loginOut(data) {
return sendGetRequest("/user/logout", data);
},
//管理员根据设备id查询设备信息
getSeldevicebyid(data) {
return sendGetRequest("/admin/seldevicebyid", data);
},
//根据用户id查询对应的设备数据
getEqbyid(data) {
return sendGetRequest("/sel/eqbyid/"+data,'');
},
//测试施肥机读取设备状态信息 //读取数据 根据文档编号读取 所有数据展示都出自这个接口
postReg(data){
return sendPostRequest("/readFs/reg", data);
},
//测试施肥机读取设备状态信息 //读取数据 根据文档编号读取 所有数据展示都出自这个接口
postState(data){
return sendPostRequest("/readFs/state", data);
},
//测试施肥机写入数据信息 //修改数据 根据文档编号修改 所有数据修改都出自这个接口
postWriteFs(data){
return sendPostRequest("/writeFs", data);
},
getByid(data){
return sendGetRequest("/readFs/byid",data);
},
//获取实时数据
postRtdata(data){
return sendPostRequest("/getFs/rtdata?equipmentId="+data, '');
},
//获取实时数据
postFsdata(data){
return sendPostRequest("/chart/fsdata?equipmentId="+data, '');
},
//获取监控地址
getGethls(data){
return sendGetRequest("/camera/gethls",data);
},
};

45
src/api/test.html 100644
View File

@ -0,0 +1,45 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
</head>
<body>
<script>
// $.ajax({
// url: 'https://api.lihe-control.com/sel/eqbyid/1', // 请求地址
// type: 'get', // 请求方式
// data: '', //携带到后端的参数
// contentType: 'application/x-www-form-urlencoded', // 传参格式(默认为表单) json为application/json
// dataType: 'json', //期望后端返回的数据类型
// success: function (res) {
// console.log('res', res);
// }, // 成功的回调函数 res就是后端响应回来的数据
// error: function(err) {
// console.log('err', err);
// } // 失败的回调函数
// })
var xhr = new XMLHttpRequest(); // IE8/9需用window.XDomainRequest兼容
// 前端设置是否带cookie
xhr.withCredentials = true;
xhr.open('get', 'https://api.lihe-control.com/sel/eqbyid/1', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
xhr.setRequestHeader('token','eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI4NzRmMmRhNTI3NTU0MDAwYjYxODg0OWUzM2Y1ZGI1YyIsInN1YiI6IjEiLCJpc3MiOiJsaCIsImlhdCI6MTY5NTQzODA3NSwiZXhwIjoxNjk1NDc0MDc1fQ.GeGOTtdr6DAsXl-6bqXATenYrcWKc18hRgmiWFgP2QI')
xhr.setRequestHeader("Access-Control-Allow-Methods", "GET, PUT, OPTIONS, POST");
xhr.send();
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
console.log(xhr);
}
};
</script>
</body>
</html>

File diff suppressed because it is too large Load Diff

1
src/assets/css/main.min.css vendored 100644

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1002 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 793 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 739 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1023 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 664 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 B

View File

@ -0,0 +1,506 @@
import * as echarts from "echarts";
export function realTimeLine(id,data) {
var chartDom = document.getElementById(id);
var myChart = echarts.init(chartDom);
var Xdata=[]
var data1=[]//目标水肥PH
var data2=[]//目标水肥EC
var data3=[]//平均值水肥PH
var data4=[]//平均值水肥EC
var data5=[]//1#水肥PH
var data6=[]//2#水肥PH
var data7=[]//1#水肥EC
var data8=[]//2#水肥EC
var data9=[]//1#空气温度
data.forEach((el,index)=>{
Xdata.push(el.time)
data1.push(el.value['目标水肥PH'])
data2.push(el.value['目标水肥EC'])
data3.push(el.value['平均值水肥PH'])
data4.push(el.value['平均值水肥EC'])
data5.push(el.value['1#水肥PH'])
data6.push(el.value['2#水肥PH'])
data7.push(el.value['1#水肥EC'])
data8.push(el.value['2#水肥EC'])
data9.push(el.value['1#空气温度'])
})
console.log(data1,data2);
var list = [
{
name: '目标水肥PH',
data: data1,
type: "line",
symbol: "circle",
smooth: true,
symbolSize: 5,
showSymbol: false,
lineStyle: {
normal: {
width: 2,
},
},
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgba(0, 187, 136, 0.50)",
},
{
offset: 0.8,
color: "rgba(0, 187, 136, 0)",
},
],
false
),
},
},
itemStyle: {
normal: {
color: "rgba(0, 187, 136, 1)",
borderColor: "rgba(0, 187, 136, 1)",
borderWidth: 1,
},
},
},
{
name: '目标水肥EC',
data:data2,
type: "line",
symbol: "circle",
smooth: true,
symbolSize: 5,
showSymbol: false,
lineStyle: {
normal: {
width: 2,
},
},
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgba(252, 125, 106, 0.50)",
},
{
offset: 0.8,
color: "rgba(252, 125, 106, 0)",
},
],
false
),
},
},
itemStyle: {
normal: {
color: "rgba(252, 125, 106, 1)",
borderColor: "rgba(252, 125, 106, 1)",
borderWidth: 1,
},
},
},
{
name: '平均水肥PH',
data: data3,
type: "line",
symbol: "circle",
smooth: true,
symbolSize: 5,
showSymbol: false,
lineStyle: {
normal: {
width: 2,
},
},
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgba(252, 223, 39, 0.50)",
},
{
offset: 0.8,
color: "rgba(252, 223, 39, 0)",
},
],
false
),
},
},
itemStyle: {
normal: {
color: "rgba(252, 223, 39, 1)",
borderColor: "rgba(252, 223, 39, 1)",
borderWidth: 1,
},
},
},
{
name: '平均水肥EC',
data: data4,
type: "line",
symbol: "circle",
smooth: true,
symbolSize: 5,
showSymbol: false,
lineStyle: {
normal: {
width: 2,
},
},
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgba(68, 214, 232, 0.50)",
},
{
offset: 0.8,
color: "rgba(68, 214, 232, 0)",
},
],
false
),
},
},
itemStyle: {
normal: {
color: "rgba(68, 214, 232, 1)",
borderColor: "rgba(68, 214, 232, 1)",
borderWidth: 1,
},
},
},
{
name: '1#水肥PH',
data: data5,
type: "line",
symbol: "circle",
smooth: true,
symbolSize: 5,
showSymbol: false,
lineStyle: {
normal: {
width: 2,
},
},
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgba(69, 224, 155, 0.50)",
},
{
offset: 0.8,
color: "rgba(69, 224, 155, 0)",
},
],
false
),
},
},
itemStyle: {
normal: {
color: "rgba(69, 224, 155, 1)",
borderColor: "rgba(69, 224, 155, 1)",
borderWidth: 1,
},
},
},
{
name: '2#水肥PH',
data: data6,
type: "line",
symbol: "circle",
smooth: true,
symbolSize: 5,
showSymbol: false,
lineStyle: {
normal: {
width: 2,
},
},
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgba(82, 188, 255, 0.50)",
},
{
offset: 0.8,
color: "rgba(82, 188, 255, 0)",
},
],
false
),
},
},
itemStyle: {
normal: {
color: "rgba(82, 188, 255, 1)",
borderColor: "rgba(82, 188, 255, 1)",
borderWidth: 1,
},
},
},
{
name: '1#水肥EC',
data: data7,
type: "line",
symbol: "circle",
smooth: true,
symbolSize: 5,
showSymbol: false,
lineStyle: {
normal: {
width: 2,
},
},
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgba(214, 162, 255, 0.50)",
},
{
offset: 0.8,
color: "rgba(214, 162, 255, 0)",
},
],
false
),
},
},
itemStyle: {
normal: {
color: "rgba(214, 162, 255, 1)",
borderColor: "rgba(214, 162, 255, 1)",
borderWidth: 1,
},
},
},
{
name: '2#水肥EC',
data:data8,
type: "line",
symbol: "circle",
smooth: true,
symbolSize: 5,
showSymbol: false,
lineStyle: {
normal: {
width: 2,
},
},
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgba(255, 192, 111, 0.50)",
},
{
offset: 0.8,
color: "rgba(255, 192, 111, 0)",
},
],
false
),
},
},
itemStyle: {
normal: {
color: "rgba(255, 192, 111, 1)",
borderColor: "rgba(255, 192, 111, 1)",
borderWidth: 1,
},
},
},
{
name: '1#空气温度',
data: data9,
type: "line",
symbol: "circle",
smooth: true,
symbolSize: 5,
showSymbol: false,
lineStyle: {
normal: {
width: 2,
},
},
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgba(255, 156, 154, 0.50)",
},
{
offset: 0.8,
color: "rgba(255, 156, 154, 0)",
},
],
false
),
},
},
itemStyle: {
normal: {
color: "rgba(255, 156, 154, 1)",
borderColor: "rgba(255, 156, 154, 1)",
borderWidth: 1,
},
},
}]
var option = {
tooltip: {
trigger: "axis",
axisPointer: {
lineStyle: {
color: "#57617B",
},
},
},
legend: {
icon: "circle",
itemWidth: 10,
itemHeight: 10,
data: list,
right: "center",
textStyle: {
fontSize: 12,
color: "#fff",
},
},
dataZoom: [
{
show: true,
realtime: true,
start: 30,
end: 70,
xAxisIndex: [0, 1]
},
{
type: 'inside',
realtime: true,
start: 30,
end: 70,
xAxisIndex: [0, 1],
backgroundColor:'rgba(11, 28, 42, 0.4)',
fillerColor:'rgba(2, 148, 226, 1)',
textStyle:{
color:'#fff'
}
}
],
grid: {
left: "3%",
right: "4%",
bottom: "13%",
containLabel: true,
},
xAxis: [
{
type: "category",
boundaryGap: false,
axisTick: {
show: false,
},
axisLine: {
lineStyle: {
color: "#fff",
type: 'dashed'
},
},
data: Xdata,
},
],
yAxis: [
{
type: "value",
name: "",
axisTick: {
show: false,
},
axisLine: {
lineStyle: {
color: "#fff",
type: 'dashed'
},
},
axisLabel: {
margin: 10,
textStyle: {
fontSize: 14,
},
},
splitLine: {
lineStyle: {
color: "rgba(104, 168, 205, 1)",
type: 'dashed'
},
},
},
],
series: list,
};
option && myChart.setOption(option);
window.addEventListener("resize", function () {
myChart.resize();
});
}

View File

@ -0,0 +1,93 @@
function checkTime(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}
export function getnowtime() {
var nowdate = new Date();
var year = nowdate.getFullYear()
var month = nowdate.getMonth() + 1
var date = nowdate.getDate()
var day = nowdate.getDay()
var week = [
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六",
]
var h = nowdate.getHours()
var m = nowdate.getMinutes()
var s = nowdate.getSeconds()
var h = checkTime(h)
var m = checkTime(m)
var s = checkTime(s)
var month_=checkTime(month)
var date_=checkTime(date)
return {
day:date,
year:{year:year,month:month_,date:date_},
week: week[day],
time: h + ":" + m ,
timeS:s
}
}
export function getyesterday(time){
var nowtime=new Date(time).getTime() - 24 * 60 * 60 * 1000;
var nowdate = new Date(nowtime);
var year = nowdate.getFullYear()
var month = nowdate.getMonth() + 1
var date = nowdate.getDate()
var day = nowdate.getDay()
var week = [
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六",
]
var month_=checkTime(month)
var date_=checkTime(date)
return {
day:date,
year:{year:year,month:month_,date:date_},
week: week[day],
}
}
export function getdata(time) {
if (!time) {
return {
days:0,
hours:0,
minutes:0,
seconds:0,
};
}
var nowdate=new Date();
var lastdate = new Date(time);
var alltime=new Date(nowdate-lastdate)
var days =Math.floor(alltime/(1000*60*60*24))
var hours= checkTime(Math.floor((alltime%(1000*60*60*24))/(1000*60*60)))
var minutes=checkTime(Math.floor(((alltime%(1000*60*60*24))%(1000*60*60))/(1000*60)))
var seconds=checkTime(Math.floor((((alltime%(1000*60*60*24))%(1000*60*60))%(1000*60))/1000))
return {
days,
hours,
minutes,
seconds,
}
}

BIN
src/assets/logo.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,166 @@
<template>
<div class="set-params collapse scroll">
<div class="set-top">
<img src="../assets/image/set-icon.png" alt="">设定值参数
</div>
<div class="set-tips">
<div @click="toHome($store.state.equipmentIndex)">
{{ $store.state.equipmentList[$store.state.equipmentIndex - 1].deviceTypeName }}状态显示</div>
</div>
<el-collapse v-model="$store.state.activeNames">
<template v-for="item, index in routerList">
<el-collapse-item :name="index + 1" :key="index" v-if="!item.isRouter">
<template slot="title" class="collapse-title">
{{ item.name }}
</template>
<!-- :class="routerNow == item1.router ? 'active' : ''" -->
<ul class="table-ul">
<li @click="toRouter(item1)" class="table-li" v-for="item1, index1 in item.list" :key="index1">{{
item1.name }} <div class="status" :class="item1.status == 0 ? 'outline' : 'online'"
v-if="item1.status >= 0">{{ item1.status
== 0
? '离线' : '在线' }}</div>
</li>
</ul>
</el-collapse-item>
<div @click="toRouter(item)" class="no-list" v-else>{{ item.name }}</div>
</template>
</el-collapse>
</div>
</template>
<script>
export default {
data() {
return {
routerList: [
{ name: '施肥机配方设置', list: [] },
{
name: '灌溉组配置', list: [
{ name: '1#灌溉组配置', status: -1, router: 'irrigateSet', index: 1 },
{ name: '2#灌溉组配置', status: -1, router: 'irrigateSet', index: 2 },
{ name: '3#灌溉组配置', status: -1, router: 'irrigateSet', index: 3 },
{ name: '4#灌溉组配置', status: -1, router: 'irrigateSet', index: 4 },
{ name: '5#灌溉组配置', status: -1, router: 'irrigateSet', index: 5 },
{ name: '6#灌溉组配置', status: -1, router: 'irrigateSet', index: 6 },
{ name: '7#灌溉组配置', status: -1, router: 'irrigateSet', index: 7 },
{ name: '8#灌溉组配置', status: -1, router: 'irrigateSet', index: 8 },
{ name: '9#灌溉组配置', status: -1, router: 'irrigateSet', index: 9 },
{ name: '10#灌溉组配置', status: -1, router: 'irrigateSet', index: 10 },
{ name: '11#灌溉组配置', status: -1, router: 'irrigateSet', index: 11 },
{ name: '12#灌溉组配置', status: -1, router: 'irrigateSet', index: 12 },
{ name: '13#灌溉组配置', status: -1, router: 'irrigateSet', index: 13 },
{ name: '14#灌溉组配置', status: -1, router: 'irrigateSet', index: 14 },
{ name: '15#灌溉组配置', status: -1, router: 'irrigateSet', index: 15 },
{ name: '16#灌溉组配置', status: -1, router: 'irrigateSet', index: 16 }]
},
{ name: '厂家内部PID配置', list: [], router: 'PIDSet', isRouter: true, },
{ name: '系统参数配置', list: [], router: 'systemSet', isRouter: true, },
{ name: '传感器通道配置', list: [], router: 'sensorSet', isRouter: true, },
{ name: '数据上传', list: [], router: 'upload', isRouter: true, },],
routerNow: 'formula',
routerIndex: 1,
}
},
watch: {
"$route"(newName, oldName) {
this.gerRouter();
},
},
mounted() {
this.gerRouter();
this.dataInit()
},
methods: {
dataInit() {
var store = this.$store.state
store.nameList.forEach((el,index)=>{
if(index<8){
if(store.equipmentName['fertilization'+store.nameList[index]]){
console.log(store.equipmentName,2);
this.routerList[0].list.push({
name:store.equipmentName['fertilization'+store.nameList[index]],
status: -1,
index:index+1,
router: 'formula'
})
}
}
})
console.log(this.routerList[0],11);
},
//
toHome(index) {
this.$router.push({ path: `/status?eqbyIndex=` + index })
},
gerRouter() {
this.routerNow = this.$route.name;
this.routerIndex = this.$route.query.index ? this.$route.query.index : 1
},
toRouter(item) {
if (item.router) {
if (item.http) {
window.location.href = item.http;
} else if (item.router == 'irrigateSet' && this.$route.query.id != item.index) {
this.$router.push({ path: `/irrigateSet?id=${item.index}` })
} else if (item.router == 'formula' && this.$route.query.id != item.index) {
this.$router.push({ path: `/formula?id=${item.index}` })
} else if (item.router != this.routerNow && !item.http) {
this.$router.push({ name: item.router })
}
}
},
},
}
</script>
<style lang="scss" scoped>
.set-params {
width: 280px;
height: 100%;
background: rgba(0, 92, 178, 0.15);
border: 2px solid rgba(0, 186, 255, 0.20);
.set-top {
font-size: 20px;
font-family: Microsoft YaHei;
font-weight: bold;
color: #FFFFFF;
width: 100%;
padding-left: 20px;
display: flex;
align-items: center;
padding-top: 20px;
img {
width: 40px;
height: 40px;
margin-right: 10px;
}
}
.set-tips {
width: 100%;
border-bottom: 1px solid rgba(168, 182, 200, 0.2);
margin-top: 17px;
padding-bottom: 17px;
padding-left: 10px;
cursor: pointer;
>div {
width: 220px;
height: 40px;
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.3);
display: flex;
align-items: center;
padding-left: 10px;
}
}
}
</style>

23
src/main.js 100644
View File

@ -0,0 +1,23 @@
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
Vue.config.productionTip = false
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import axios from "axios";
Vue.prototype.$axios = axios;
import api from "./api/index.js";
Vue.prototype.api = api;
import './assets/css/main.scss'
Vue.use(ElementUI);
import 'video.js/dist/video-js.css'; // 引入video.js的样式
import 'video.js';
import 'videojs-contrib-hls'; // 引入支持HLS的插件
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')

Some files were not shown because too many files have changed in this diff Show More