parent
4620093e14
commit
f33cfd80df
@ -0,0 +1,3 @@
|
||||
> 1%
|
||||
last 2 versions
|
||||
not dead
|
@ -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?
|
@ -0,0 +1,24 @@
|
||||
# sheyang-minedata
|
||||
|
||||
## Project setup
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
npm run serve
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Lints and fixes files
|
||||
```
|
||||
npm run lint
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
presets: ["@vue/cli-plugin-babel/preset"],
|
||||
};
|
@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "esnext",
|
||||
"baseUrl": "./",
|
||||
"moduleResolution": "node",
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"src/*"
|
||||
]
|
||||
},
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"scripthost"
|
||||
]
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "sheyang-minedata",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@liveqing/liveplayer": "^2.6.9",
|
||||
"axios": "^1.6.0",
|
||||
"copy-webpack-plugin": "^4.6.0",
|
||||
"core-js": "^3.8.3",
|
||||
"echarts": "^5.4.3",
|
||||
"element-ui": "^2.15.14",
|
||||
"vue": "^2.6.14",
|
||||
"vue-router": "^3.5.1",
|
||||
"vuex": "^3.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.12.16",
|
||||
"@babel/eslint-parser": "^7.12.16",
|
||||
"@vue/cli-plugin-babel": "~5.0.0",
|
||||
"@vue/cli-plugin-eslint": "~5.0.0",
|
||||
"@vue/cli-plugin-router": "~5.0.0",
|
||||
"@vue/cli-plugin-vuex": "~5.0.0",
|
||||
"@vue/cli-service": "~5.0.0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint-plugin-vue": "^8.0.3",
|
||||
"prettier": "^2.4.1",
|
||||
"sass": "^1.32.7",
|
||||
"sass-loader": "^12.0.0",
|
||||
"vue-template-compiler": "^2.6.14"
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
<!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>
|
||||
<script type="text/javascript" src="<%= BASE_URL %>js/liveplayer-lib.min.js"></script>
|
||||
</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>
|
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.4 KiB |
@ -0,0 +1,58 @@
|
||||
.box {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 5px;
|
||||
width: 220px;
|
||||
height: 100px;
|
||||
background-color: #fff;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.button_plus,
|
||||
.state {
|
||||
margin-top: 5px;
|
||||
margin-left: 5px;
|
||||
width: 60px;
|
||||
height: 30px;
|
||||
background-color: #2e92f7;
|
||||
border-radius: 5px;
|
||||
border: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
font-size: 0.5rem;
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.button_plus:active {
|
||||
transform: translateY(2px);
|
||||
}
|
||||
|
||||
.state {
|
||||
width: 60px;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
color: #fff;
|
||||
font-size: 0.1rem;
|
||||
}
|
||||
|
||||
.state_a {
|
||||
background-color: #ff6600;
|
||||
}
|
||||
|
||||
.state_b {
|
||||
background-color: #188801;
|
||||
}
|
||||
|
||||
.state_c {
|
||||
background-color: #2278f8;
|
||||
}
|
||||
|
||||
.state_d {
|
||||
background-color: #f74242;
|
||||
}
|
||||
|
||||
.plus {
|
||||
font-size: 2rem;
|
||||
color: #fff;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<router-view></router-view>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
After Width: | Height: | Size: 6.7 KiB |
@ -0,0 +1,5 @@
|
||||
html,body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
import '../src/assets/main.scss'
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
new Vue({
|
||||
router,
|
||||
store,
|
||||
render: (h) => h(App)
|
||||
}).$mount('#app')
|
@ -0,0 +1,18 @@
|
||||
import Vue from 'vue'
|
||||
import VueRouter from 'vue-router'
|
||||
|
||||
Vue.use(VueRouter)
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'map',
|
||||
component: () => import('@/views/MinedataMap.vue')
|
||||
}
|
||||
]
|
||||
|
||||
const router = new VueRouter({
|
||||
routes
|
||||
})
|
||||
|
||||
export default router
|
@ -0,0 +1,12 @@
|
||||
import Vue from "vue";
|
||||
import Vuex from "vuex";
|
||||
|
||||
Vue.use(Vuex);
|
||||
|
||||
export default new Vuex.Store({
|
||||
state: {},
|
||||
getters: {},
|
||||
mutations: {},
|
||||
actions: {},
|
||||
modules: {},
|
||||
});
|
@ -0,0 +1,47 @@
|
||||
import request from './request'
|
||||
import { getToken } from '@/utils/token'
|
||||
|
||||
const token = getToken()
|
||||
|
||||
// * 登录接口获取 token
|
||||
export const login = () => {
|
||||
return request.get('/api/v1/login', {
|
||||
params: {
|
||||
username: 'admin',
|
||||
password: 'AF7548EEDFF8e737C0E4B2A669497290',
|
||||
url_token_only: true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// * 获取设备信息列表
|
||||
export const getDeviceListAPI = (params) => {
|
||||
return request.get(
|
||||
`/api/v1/device/channellist?start=${params.start}&limit=${params.limit}&online=${params.online}&token=${token}`
|
||||
)
|
||||
}
|
||||
|
||||
// * 获取视频列表
|
||||
export const getVideoListAPI = (channel) => {
|
||||
return request.get(
|
||||
`/api/v1/stream/start?serial=${'32092400002005063063'}&channel=${channel}&timeout=${500}&token=${token}`
|
||||
)
|
||||
}
|
||||
|
||||
// * 退出登录
|
||||
export const logoutAPI = () => {
|
||||
return request.get('/api/v1/logout')
|
||||
}
|
||||
// // * 获取视频列表
|
||||
// export const getVideoChannelAPI = () => {
|
||||
// return request.get(
|
||||
// `/api/v1/stream/start?serial=${'32092400002005063063'}&code=${'32092400001310088291'}&token=${getToken()}`
|
||||
// )
|
||||
// }
|
||||
|
||||
// * 关闭视频流
|
||||
export const getCloseVideoAPI = (channel) => {
|
||||
return request.get(
|
||||
`/api/v1/stream/stop?serial=${'32092400002005063063'}&channel=${channel}&token=${token}`
|
||||
)
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
import axios from 'axios'
|
||||
// import { getToken } from '@/utils/token'
|
||||
|
||||
const baseURL = 'http://50.146.63.43:20000/'
|
||||
// const baseURL = ''
|
||||
// axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
|
||||
const request = axios.create({
|
||||
baseURL,
|
||||
timeout: 1000
|
||||
})
|
||||
// todo 封装基本拦截
|
||||
// * 请求拦截器
|
||||
request.interceptors.request.use(
|
||||
(config) => {
|
||||
if (config) {
|
||||
// config.headers['Authorization'] = 'Bearer ' + getToken()
|
||||
return config
|
||||
}
|
||||
},
|
||||
(error) => {
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
// * 响应拦截器
|
||||
request.interceptors.response.use(
|
||||
(response) => {
|
||||
if (response.status !== 200) {
|
||||
return Promise.reject(response.message)
|
||||
}
|
||||
return response.data
|
||||
},
|
||||
(error) => {
|
||||
if (axios.isCancel(error)) {
|
||||
console.log(error)
|
||||
}
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
export default request
|
@ -0,0 +1,17 @@
|
||||
const URL_TOKEN = 'url_token'
|
||||
|
||||
// * 存储 token
|
||||
export const setToken = (token) => {
|
||||
localStorage.setItem(URL_TOKEN, JSON.stringify(token))
|
||||
}
|
||||
|
||||
// * 获取 token
|
||||
export const getToken = () => {
|
||||
const res = localStorage.getItem(URL_TOKEN)
|
||||
return res ? JSON.parse(res) : ''
|
||||
}
|
||||
|
||||
// * 移除token
|
||||
export const removeToken = () => {
|
||||
localStorage.removeItem(URL_TOKEN)
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
|
||||
module.exports = {
|
||||
configureWebpack: {
|
||||
plugins: [
|
||||
// eslint-disable-next-line no-undef
|
||||
new CopyWebpackPlugin([
|
||||
// patterns:[
|
||||
{
|
||||
from: 'node_modules/@liveqing/liveplayer/dist/component/crossdomain.xml'
|
||||
},
|
||||
{
|
||||
from: 'node_modules/@liveqing/liveplayer/dist/component/liveplayer.swf'
|
||||
},
|
||||
{
|
||||
from: 'node_modules/@liveqing/liveplayer/dist/component/liveplayer-lib.min.js',
|
||||
to: 'js/'
|
||||
}
|
||||
// ]
|
||||
])
|
||||
]
|
||||
}
|
||||
}
|
Loading…
Reference in new issue