init
18
src/assets/css/iconfont.styl
Normal file
@@ -0,0 +1,18 @@
|
||||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 1255596 */
|
||||
src: url('iconfont/iconfont.woff2?t=1620977303191') format('woff2'),
|
||||
url('iconfont/iconfont.woff?t=1620977303191') format('woff'),
|
||||
url('iconfont/iconfont.ttf?t=1620977303191') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-guanbi:before {
|
||||
content: "\e60f";
|
||||
}
|
||||
37
src/assets/css/iconfont/iconfont.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"id": "1255596",
|
||||
"name": "nl-hht-hl",
|
||||
"font_family": "iconfont",
|
||||
"css_prefix_text": "icon-",
|
||||
"description": "",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "2229060",
|
||||
"name": "无信号",
|
||||
"font_class": "no-signal",
|
||||
"unicode": "e76b",
|
||||
"unicode_decimal": 59243
|
||||
},
|
||||
{
|
||||
"icon_id": "400034",
|
||||
"name": "下拉",
|
||||
"font_class": "htmal5icon03",
|
||||
"unicode": "e626",
|
||||
"unicode_decimal": 58918
|
||||
},
|
||||
{
|
||||
"icon_id": "731140",
|
||||
"name": "选择",
|
||||
"font_class": "guanbi1",
|
||||
"unicode": "e608",
|
||||
"unicode_decimal": 58888
|
||||
},
|
||||
{
|
||||
"icon_id": "4736203",
|
||||
"name": "关闭",
|
||||
"font_class": "guanbi",
|
||||
"unicode": "e60f",
|
||||
"unicode_decimal": 58895
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
src/assets/css/iconfont/iconfont.ttf
Normal file
BIN
src/assets/css/iconfont/iconfont.woff
Normal file
BIN
src/assets/css/iconfont/iconfont.woff2
Normal file
5
src/assets/css/layout.styl
Normal file
@@ -0,0 +1,5 @@
|
||||
@import 'iconfont.styl'
|
||||
.bg
|
||||
width 100%
|
||||
height 100%
|
||||
overflow hidden
|
||||
40
src/assets/css/mixin.styl
Normal file
@@ -0,0 +1,40 @@
|
||||
$red = #ed4754
|
||||
$green = #67c23a
|
||||
$yellow = #f2d648
|
||||
$orange = #f17d3a
|
||||
$blue = #6798ef
|
||||
$gray = #c9c9c9
|
||||
$fc1 = #323232
|
||||
|
||||
|
||||
//宽高
|
||||
_wh(w, h)
|
||||
width: w
|
||||
height: h
|
||||
|
||||
//字体大小、行高、颜色
|
||||
_font(size,height,color=$fc1,weight=normal,align=left)
|
||||
font-size: size
|
||||
line-height: height
|
||||
color: color
|
||||
font-weight: weight
|
||||
text-align: align
|
||||
|
||||
//flex 布局和 子元素 对其方式
|
||||
_fj(x=space-between,y=center)
|
||||
display: flex
|
||||
justify-content: x
|
||||
align-items: y
|
||||
|
||||
// 背景图片地址和大小
|
||||
_bis(url,w,h=auto,x=center,y=center)
|
||||
background-position: x y
|
||||
background-size: w h
|
||||
background-image: url(url)
|
||||
background-repeat: no-repeat
|
||||
|
||||
// 定位上下居中
|
||||
_ct()
|
||||
position: absolute
|
||||
top: 50%
|
||||
transform: translateY(-50%)
|
||||
130
src/assets/css/reset.css
Normal file
@@ -0,0 +1,130 @@
|
||||
html, body, div, span, applet, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||
a, abbr, acronym, address, big, cite, code,
|
||||
del, dfn, em, img, ins, kbd, q, s, samp,
|
||||
small, strike, strong, sub, sup, tt, var,
|
||||
b, u, i, center,
|
||||
dl, dt, dd, ol, ul, li,
|
||||
fieldset, form, label, legend,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td,
|
||||
article, aside, canvas, details, embed,
|
||||
figure, figcaption, footer, header,
|
||||
menu, nav, output, ruby, section, summary,
|
||||
time, mark, audio, video, input {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
font-size: 0.16rem;
|
||||
line-height: inherit;
|
||||
color: #ffffff;
|
||||
font-weight: normal;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/* HTML5 display-role reset for older browsers */
|
||||
article, aside, details, figcaption, figure,
|
||||
footer, header, menu, nav, section {
|
||||
display: block;
|
||||
}
|
||||
|
||||
body {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
blockquote, q {
|
||||
quotes: none;
|
||||
}
|
||||
|
||||
blockquote:before, blockquote:after,
|
||||
q:before, q:after {
|
||||
content: none;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
/* custom */
|
||||
a,a:link,a:visited,a:active {
|
||||
color: #7e8c8d;
|
||||
text-decoration: none;
|
||||
-webkit-backface-visibility: hidden;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track-piece {
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
-webkit-border-radius: 6px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:vertical {
|
||||
height: 5px;
|
||||
background-color: rgba(125, 125, 125, 0.7);
|
||||
-webkit-border-radius: 6px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:horizontal {
|
||||
width: 5px;
|
||||
background-color: rgba(125, 125, 125, 0.7);
|
||||
-webkit-border-radius: 6px;
|
||||
}
|
||||
|
||||
html, body {
|
||||
/* width: 1920px;
|
||||
height: 1080px; */
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-width: 1440px;
|
||||
min-height: 784px;
|
||||
}
|
||||
|
||||
body {
|
||||
-webkit-text-size-adjust: none;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
background: #05032a center center / 100% 100% url(../../assets/images/bg.png) no-repeat;
|
||||
}
|
||||
|
||||
div, p {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.clearfix {
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.clearfix:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.ellipsis {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.fl {
|
||||
float: left !important;
|
||||
}
|
||||
|
||||
.fr {
|
||||
float: right !important;
|
||||
}
|
||||
|
||||
.fontselect {
|
||||
-moz-user-select:none;/*火狐*/
|
||||
-webkit-user-select:none;/*webkit浏览器*/
|
||||
-ms-user-select:none;/*IE10*/
|
||||
-khtml-user-select:none;/*早期浏览器*/
|
||||
user-select:none;
|
||||
}
|
||||
BIN
src/assets/images/bg.png
Normal file
|
After Width: | Height: | Size: 7.9 MiB |
BIN
src/assets/images/bg1.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
src/assets/images/bg2.png
Normal file
|
After Width: | Height: | Size: 599 KiB |
BIN
src/assets/images/bg3.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
src/assets/images/bg4.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
BIN
src/assets/images/header.png
Normal file
|
After Width: | Height: | Size: 459 KiB |
BIN
src/assets/images/mon_04.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
src/assets/images/tip.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
14
src/assets/js/filter.js
Normal file
@@ -0,0 +1,14 @@
|
||||
// import store from '../vuex/store'
|
||||
|
||||
const filter = {
|
||||
numeric (value) {
|
||||
if (value === '') return ''
|
||||
return Number(value).toFixed(3)
|
||||
},
|
||||
numFixed (value, bit) {
|
||||
if (value === '') return ''
|
||||
return Number(value).toFixed(bit)
|
||||
}
|
||||
}
|
||||
|
||||
export default filter
|
||||
10
src/assets/js/getData1.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import {post} from '@js/http.js'
|
||||
|
||||
/** 1.1小屏-上 */
|
||||
export const queryInfo5 = (did) => post('api/screen/pdm/queryInfo5', {
|
||||
device_id: did
|
||||
})
|
||||
/** 1.1小屏-下 */
|
||||
export const queryInfo6 = (did) => post('api/screen/pdm/queryInfo6', {
|
||||
device_id: did
|
||||
})
|
||||
24
src/assets/js/getData2.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import {post, post1} from '@js/http.js'
|
||||
|
||||
/** 1.1配粉设备下拉框 */
|
||||
export const queryDevice = (url) => post1(url + '/api/screen/pdm/queryDevice', {})
|
||||
|
||||
/** 1.2大屏左一 */
|
||||
export const queryInfo1 = (id) => post('api/screen/pdm/queryInfo1', {
|
||||
device_id: id
|
||||
})
|
||||
|
||||
/** 1.3大屏左二 */
|
||||
export const queryInfo2 = (id) => post('api/screen/pdm/queryInfo2', {
|
||||
device_id: id
|
||||
})
|
||||
|
||||
/** 1.4大屏右一 */
|
||||
export const queryInfo3 = (id) => post('api/screen/pdm/queryInfo3', {
|
||||
device_id: id
|
||||
})
|
||||
|
||||
/** 1.5大屏右二 */
|
||||
export const queryInfo4 = (id) => post('api/screen/pdm/queryInfo4', {
|
||||
device_id: id
|
||||
})
|
||||
78
src/assets/js/http.js
Normal file
@@ -0,0 +1,78 @@
|
||||
import axios from 'axios'
|
||||
import { Dialog, toast } from './mUtils.js'
|
||||
import store from '../../vuex/store'
|
||||
import router from '@/router'
|
||||
|
||||
axios.defaults.timeout = 50000
|
||||
axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8'
|
||||
|
||||
axios.interceptors.request.use(
|
||||
config => {
|
||||
if (config.method === 'post') {
|
||||
if (!config.data.flag) {
|
||||
config.data = config.data
|
||||
} else {
|
||||
config.data = config.data.formData
|
||||
}
|
||||
}
|
||||
return config
|
||||
},
|
||||
error => {
|
||||
Dialog('错误的传参')
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
axios.interceptors.response.use(
|
||||
response => {
|
||||
if (response.status === 200) {
|
||||
return Promise.resolve(response)
|
||||
} else {
|
||||
return Promise.reject(response)
|
||||
}
|
||||
},
|
||||
error => {
|
||||
if (error && error.response) {
|
||||
switch (error.response.status) {
|
||||
case 401:
|
||||
toast(error.response.data.message)
|
||||
store.dispatch('setSignOut')
|
||||
router.push('/login')
|
||||
break
|
||||
}
|
||||
return Promise.reject(error.response.data)
|
||||
} else {
|
||||
return Promise.reject(error)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
export const post = (sevmethod, params) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios.post(`${store.getters.baseUrl}/` + sevmethod, params)
|
||||
.then(response => {
|
||||
resolve(response.data)
|
||||
}, error => {
|
||||
Dialog(error.message)
|
||||
reject(error.message)
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export const post1 = (sevmethod, params) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios.post(sevmethod, params)
|
||||
.then(response => {
|
||||
resolve(response.data)
|
||||
}, error => {
|
||||
Dialog(error.message)
|
||||
reject(error.message)
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
134
src/assets/js/mUtils.js
Normal file
@@ -0,0 +1,134 @@
|
||||
import store from '../../vuex/store'
|
||||
|
||||
/**
|
||||
* 弹出框
|
||||
*/
|
||||
export const Dialog = (str) => {
|
||||
store.dispatch('showAlert', true)
|
||||
store.dispatch('alertMsg', str)
|
||||
setTimeout(() => {
|
||||
store.dispatch('showAlert', false)
|
||||
}, 30000)
|
||||
}
|
||||
|
||||
/**
|
||||
* 提示框
|
||||
*/
|
||||
export const toast = (str) => {
|
||||
store.dispatch('showToast', true)
|
||||
store.dispatch('toastMsg', str)
|
||||
setTimeout(() => {
|
||||
store.dispatch('showToast', false)
|
||||
}, 3000)
|
||||
}
|
||||
|
||||
/**
|
||||
* 存储localStorage
|
||||
*/
|
||||
export const setStore = (name, content) => {
|
||||
if (!name) return
|
||||
if (typeof content !== 'string') {
|
||||
content = JSON.stringify(content)
|
||||
}
|
||||
window.localStorage.setItem(name, content)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取localStorage
|
||||
*/
|
||||
export const getStore = name => {
|
||||
if (!name) return
|
||||
return window.localStorage.getItem(name)
|
||||
}
|
||||
|
||||
/**
|
||||
* 小数加法
|
||||
*/
|
||||
export const accAdd = (arg1, arg2) => {
|
||||
var r1, r2, m, c
|
||||
try {
|
||||
r1 = arg1.toString().split('.')[1].length
|
||||
} catch (e) {
|
||||
r1 = 0
|
||||
}
|
||||
try {
|
||||
r2 = arg2.toString().split('.')[1].length
|
||||
} catch (e) {
|
||||
r2 = 0
|
||||
}
|
||||
c = Math.abs(r1 - r2)
|
||||
m = Math.pow(10, Math.max(r1, r2))
|
||||
if (c > 0) {
|
||||
var cm = Math.pow(10, c)
|
||||
if (r1 > r2) {
|
||||
arg1 = Number(arg1.toString().replace('.', ''))
|
||||
arg2 = Number(arg2.toString().replace('.', '')) * cm
|
||||
} else {
|
||||
arg1 = Number(arg1.toString().replace('.', '')) * cm
|
||||
arg2 = Number(arg2.toString().replace('.', ''))
|
||||
}
|
||||
} else {
|
||||
arg1 = Number(arg1.toString().replace('.', ''))
|
||||
arg2 = Number(arg2.toString().replace('.', ''))
|
||||
}
|
||||
return (arg1 + arg2) / m
|
||||
}
|
||||
|
||||
/**
|
||||
* 小数减法
|
||||
*/
|
||||
export const accSubtract = (arg1, arg2) => {
|
||||
var r1, r2, m, c
|
||||
try {
|
||||
r1 = arg1.toString().split('.')[1].length
|
||||
} catch (e) {
|
||||
r1 = 0
|
||||
}
|
||||
try {
|
||||
r2 = arg2.toString().split('.')[1].length
|
||||
} catch (e) {
|
||||
r2 = 0
|
||||
}
|
||||
c = Math.abs(r1 - r2)
|
||||
m = Math.pow(10, Math.max(r1, r2))
|
||||
if (c > 0) {
|
||||
var cm = Math.pow(10, c)
|
||||
if (r1 > r2) {
|
||||
arg1 = Number(arg1.toString().replace('.', ''))
|
||||
arg2 = Number(arg2.toString().replace('.', '')) * cm
|
||||
} else {
|
||||
arg1 = Number(arg1.toString().replace('.', '')) * cm
|
||||
arg2 = Number(arg2.toString().replace('.', ''))
|
||||
}
|
||||
} else {
|
||||
arg1 = Number(arg1.toString().replace('.', ''))
|
||||
arg2 = Number(arg2.toString().replace('.', ''))
|
||||
}
|
||||
return (arg1 - arg2) / m
|
||||
}
|
||||
|
||||
/**
|
||||
* 小数乘法
|
||||
*/
|
||||
export const accMul = (arg1, arg2) => {
|
||||
var m = 0
|
||||
var s1 = arg1.toString()
|
||||
var s2 = arg2.toString()
|
||||
try { m += s1.split('.')[1].length } catch (e) {}
|
||||
try { m += s2.split('.')[1].length } catch (e) {}
|
||||
return Number(s1.replace('.', '')) * Number(s2.replace('.', '')) / Math.pow(10, m)
|
||||
}
|
||||
|
||||
/**
|
||||
* 求数组最大值
|
||||
*/
|
||||
export const maxArr = (arr) => {
|
||||
let max = Number(arr[0])
|
||||
let len = arr.length
|
||||
for (let i = 1; i < len; i++) {
|
||||
if (Number(arr[i]) > max) {
|
||||
max = Number(arr[i])
|
||||
}
|
||||
}
|
||||
return max
|
||||
}
|
||||
12
src/assets/js/rem.js
Normal file
@@ -0,0 +1,12 @@
|
||||
(function (doc, win) {
|
||||
var docEl = doc.documentElement
|
||||
var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'
|
||||
var recalc = function () {
|
||||
var clientWidth = docEl.clientWidth
|
||||
if (!clientWidth) return
|
||||
docEl.style.fontSize = 100 * (clientWidth / 1920) + 'px'
|
||||
document.body.style.display = 'block'
|
||||
}
|
||||
if (!doc.addEventListener) return win.addEventListener(resizeEvt, recalc, false)
|
||||
doc.addEventListener('DOMContentLoaded', recalc, false)
|
||||
})(document, window)
|
||||
72
src/assets/js/utils.js
Normal file
@@ -0,0 +1,72 @@
|
||||
const utils = {
|
||||
getUserIP: function () {
|
||||
var MyPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection
|
||||
var pc = new MyPeerConnection({
|
||||
iceServers: []
|
||||
})
|
||||
var noop = function () {}
|
||||
var localIPs = {}
|
||||
var newObj = {}
|
||||
var ipRegex = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/g
|
||||
function iterateIP (ip) {
|
||||
if (!localIPs[ip]) localStorage.setItem('localip', ip)
|
||||
localIPs[ip] = true
|
||||
newObj['ip'] = ip
|
||||
}
|
||||
pc.createDataChannel('')
|
||||
pc.createOffer().then(function (sdp) {
|
||||
sdp.sdp.split('\n').forEach(function (line) {
|
||||
if (line.indexOf('candidate') < 0) return
|
||||
line.match(ipRegex).forEach(iterateIP)
|
||||
})
|
||||
pc.setLocalDescription(sdp, noop, noop)
|
||||
}).catch(function (reason) {
|
||||
// An error occurred, so handle the failure to connect
|
||||
})
|
||||
pc.onicecandidate = function (ice) {
|
||||
if (!ice || !ice.candidate || !ice.candidate.candidate || !ice.candidate.candidate.match(ipRegex)) return
|
||||
ice.candidate.candidate.match(ipRegex).forEach(iterateIP)
|
||||
}
|
||||
return newObj
|
||||
},
|
||||
// 小数加法
|
||||
accAdd (arg1, arg2) {
|
||||
var r1, r2, m, c
|
||||
try {
|
||||
r1 = arg1.toString().split('.')[1].length
|
||||
} catch (e) {
|
||||
r1 = 0
|
||||
}
|
||||
try {
|
||||
r2 = arg2.toString().split('.')[1].length
|
||||
} catch (e) {
|
||||
r2 = 0
|
||||
}
|
||||
c = Math.abs(r1 - r2)
|
||||
m = Math.pow(10, Math.max(r1, r2))
|
||||
if (c > 0) {
|
||||
var cm = Math.pow(10, c)
|
||||
if (r1 > r2) {
|
||||
arg1 = Number(arg1.toString().replace('.', ''))
|
||||
arg2 = Number(arg2.toString().replace('.', '')) * cm
|
||||
} else {
|
||||
arg1 = Number(arg1.toString().replace('.', '')) * cm
|
||||
arg2 = Number(arg2.toString().replace('.', ''))
|
||||
}
|
||||
} else {
|
||||
arg1 = Number(arg1.toString().replace('.', ''))
|
||||
arg2 = Number(arg2.toString().replace('.', ''))
|
||||
}
|
||||
return (arg1 + arg2) / m
|
||||
},
|
||||
// 乘法
|
||||
accMul (arg1, arg2) {
|
||||
var m = 0
|
||||
var s1 = arg1.toString()
|
||||
var s2 = arg2.toString()
|
||||
try { m += s1.split('.')[1].length } catch (e) {}
|
||||
try { m += s2.split('.')[1].length } catch (e) {}
|
||||
return Number(s1.replace('.', '')) * Number(s2.replace('.', '')) / Math.pow(10, m)
|
||||
}
|
||||
}
|
||||
export default utils
|
||||