Compare commits
No commits in common. "main" and "fix" have entirely different histories.
|
@ -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?
|
18
App.vue
|
@ -1,18 +0,0 @@
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
onLaunch: function() {
|
|
||||||
console.log('App Launch')
|
|
||||||
},
|
|
||||||
onShow: function() {
|
|
||||||
console.log('App Show')
|
|
||||||
},
|
|
||||||
onHide: function() {
|
|
||||||
console.log('App Hide')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
/*每个页面公共css */
|
|
||||||
@import "uview-ui/index.scss";
|
|
||||||
</style>
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
FROM nginx:1.17.9-alpine
|
||||||
|
|
||||||
|
LABEL maintainer="clibing <wmsjhappy@gmail.com>"
|
||||||
|
|
||||||
|
ARG TZ='Asia/Shanghai'
|
||||||
|
|
||||||
|
ENV TZ ${TZ}
|
||||||
|
|
||||||
|
RUN apk upgrade --update \
|
||||||
|
&& apk add bash \
|
||||||
|
&& ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \
|
||||||
|
&& echo ${TZ} > /etc/timezone \
|
||||||
|
&& rm -rf /usr/share/nginx/html /var/cache/apk/*
|
||||||
|
|
||||||
|
COPY nginx.vh.default.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
|
COPY dist /usr/share/nginx/html
|
||||||
|
|
||||||
|
RUN chown -R nginx /usr/share/nginx/html
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
|
STOPSIGNAL SIGTERM
|
||||||
|
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
|
|
@ -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/).
|
|
@ -0,0 +1,5 @@
|
||||||
|
module.exports = {
|
||||||
|
presets: [
|
||||||
|
'@vue/cli-plugin-babel/preset'
|
||||||
|
]
|
||||||
|
}
|
20
index.html
|
@ -1,20 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<script>
|
|
||||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
|
||||||
CSS.supports('top: constant(a)'))
|
|
||||||
document.write(
|
|
||||||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
|
||||||
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
|
||||||
</script>
|
|
||||||
<title></title>
|
|
||||||
<!--preload-links-->
|
|
||||||
<!--app-context-->
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="app"><!--app-html--></div>
|
|
||||||
<script type="module" src="/main.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es5",
|
||||||
|
"module": "esnext",
|
||||||
|
"baseUrl": "./",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"paths": {
|
||||||
|
"@/*": [
|
||||||
|
"src/*"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"lib": [
|
||||||
|
"esnext",
|
||||||
|
"dom",
|
||||||
|
"dom.iterable",
|
||||||
|
"scripthost"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
32
main.js
|
@ -1,32 +0,0 @@
|
||||||
import App from './App'
|
|
||||||
|
|
||||||
import uView from "uview-ui";
|
|
||||||
Vue.use(uView);
|
|
||||||
|
|
||||||
// #ifndef VUE3
|
|
||||||
import Vue from 'vue'
|
|
||||||
import './uni.promisify.adaptor'
|
|
||||||
Vue.config.productionTip = false
|
|
||||||
App.mpType = 'app'
|
|
||||||
const app = new Vue({
|
|
||||||
...App
|
|
||||||
})
|
|
||||||
app.$mount()
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// #ifdef VUE3
|
|
||||||
import { createSSRApp } from 'vue'
|
|
||||||
export function createApp() {
|
|
||||||
const app = createSSRApp(App)
|
|
||||||
return {
|
|
||||||
app
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
//接口 this.api
|
|
||||||
import api from '@/api/driverapi.js'
|
|
||||||
Vue.prototype.api = api;
|
|
||||||
//
|
|
||||||
import {myRequest} from "./api/nvuerequest"
|
|
||||||
Vue.prototype.$http=myRequest
|
|
|
@ -1,72 +0,0 @@
|
||||||
{
|
|
||||||
"name" : "greenhouse-wisdom-applet",
|
|
||||||
"appid" : "__UNI__1066059",
|
|
||||||
"description" : "",
|
|
||||||
"versionName" : "1.0.0",
|
|
||||||
"versionCode" : "100",
|
|
||||||
"transformPx" : false,
|
|
||||||
/* 5+App特有相关 */
|
|
||||||
"app-plus" : {
|
|
||||||
"usingComponents" : true,
|
|
||||||
"nvueStyleCompiler" : "uni-app",
|
|
||||||
"compilerVersion" : 3,
|
|
||||||
"splashscreen" : {
|
|
||||||
"alwaysShowBeforeRender" : true,
|
|
||||||
"waiting" : true,
|
|
||||||
"autoclose" : true,
|
|
||||||
"delay" : 0
|
|
||||||
},
|
|
||||||
/* 模块配置 */
|
|
||||||
"modules" : {},
|
|
||||||
/* 应用发布信息 */
|
|
||||||
"distribute" : {
|
|
||||||
/* android打包配置 */
|
|
||||||
"android" : {
|
|
||||||
"permissions" : [
|
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
|
||||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
|
||||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
/* ios打包配置 */
|
|
||||||
"ios" : {},
|
|
||||||
/* SDK配置 */
|
|
||||||
"sdkConfigs" : {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/* 快应用特有相关 */
|
|
||||||
"quickapp" : {},
|
|
||||||
/* 小程序特有相关 */
|
|
||||||
"mp-weixin" : {
|
|
||||||
"appid" : "wx05b45a2699f02a2b",
|
|
||||||
"setting" : {
|
|
||||||
"urlCheck" : false
|
|
||||||
},
|
|
||||||
"usingComponents" : true
|
|
||||||
},
|
|
||||||
"mp-alipay" : {
|
|
||||||
"usingComponents" : true
|
|
||||||
},
|
|
||||||
"mp-baidu" : {
|
|
||||||
"usingComponents" : true
|
|
||||||
},
|
|
||||||
"mp-toutiao" : {
|
|
||||||
"usingComponents" : true
|
|
||||||
},
|
|
||||||
"uniStatistics" : {
|
|
||||||
"enable" : false
|
|
||||||
},
|
|
||||||
"vueVersion" : "2"
|
|
||||||
}
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
#charset koi8-r;
|
||||||
|
#access_log /var/log/nginx/host.access.log main;
|
||||||
|
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html index.htm;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/index.html $uri/index.htm /index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
location = /50x.html {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -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"
|
||||||
|
]
|
||||||
|
}
|
After Width: | Height: | Size: 4.2 KiB |
|
@ -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>
|
|
@ -0,0 +1,128 @@
|
||||||
|
<template>
|
||||||
|
<div id="app">
|
||||||
|
<router-view />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted(){
|
||||||
|
let inputList = document.querySelectorAll('input');
|
||||||
|
for (let index = 0; index < inputList.length; index++) {
|
||||||
|
inputList[index].onfocus = this.selectValue();//input放入焦点,全选文本
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
//全选文本
|
||||||
|
selectValue(e) {
|
||||||
|
e.currentTarget.select();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<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>
|
|
@ -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);
|
||||||
|
},
|
||||||
|
};
|
|
@ -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>
|
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 134 B |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 616 KiB |
After Width: | Height: | Size: 1.4 MiB |
After Width: | Height: | Size: 9.4 KiB |
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 57 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.9 MiB |
After Width: | Height: | Size: 1002 B |
After Width: | Height: | Size: 661 B |
After Width: | Height: | Size: 793 B |
After Width: | Height: | Size: 621 B |
After Width: | Height: | Size: 752 B |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 739 B |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 1023 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 411 B |
After Width: | Height: | Size: 182 B |
After Width: | Height: | Size: 484 B |
After Width: | Height: | Size: 70 KiB |
After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 9.1 KiB |
After Width: | Height: | Size: 9.9 KiB |
After Width: | Height: | Size: 738 B |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 1.4 MiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 594 B |
After Width: | Height: | Size: 702 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 664 B |
After Width: | Height: | Size: 229 B |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 604 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 5.3 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 316 B |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 7.8 KiB |
After Width: | Height: | Size: 592 B |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 533 B |
|
@ -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();
|
||||||
|
});
|
||||||
|
}
|
|
@ -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,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|