Commit 0eb52769 authored by zhanglw's avatar zhanglw

代码迁移备份

parent 8c7e75cb
Pipeline #333 failed with stages
.DS_Store
node_modules/
dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
**/*.log
tests/**/coverage/
tests/e2e/reports
selenium-debug.log
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.local
package-lock.json
yarn.lock
vv
\ No newline at end of file
# donkey-mou
## 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/).
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
{
"name": "donkey-mou",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"@riophae/vue-treeselect": "^0.4.0",
"axios": "^0.21.1",
"core-js": "^3.12.0",
"echarts": "^5.1.2",
"element-ui": "^2.9.2",
"ezuikit-js": "0.0.7",
"hls.js": "^1.0.12",
"jquery": "^3.6.0",
"js-cookie": "3.0.0",
"jsencrypt": "^3.0.0-rc.1",
"json-server": "^0.16.3",
"maptalks": "^1.0.0-rc.17",
"mars3d": "^3.1.3",
"moment": "^2.29.1",
"qs": "^6.10.1",
"recorder-core": "*",
"simple-keyboard": "^3.4.100",
"underscore": "^1.13.1",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"node-sass": "^4.12.0",
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
"vue-template-compiler": "^2.6.11"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
This diff is collapsed.
{
"map3d": {
"scene": {
"center": {"lat":37.4890,"lng":122.04700,"alt":1000,"heading":360,"pitch":-90},
"scene3DOnly": false,
"shadows": false,
"removeDblClick": true,
"sceneMode": 2,
"showSun": false,
"showMoon": false,
"showSkyBox": false,
"showSkyAtmosphere": false,
"fog": false,
"fxaa": false,
"globe": {
"depthTestAgainstTerrain": false,
"baseColor": "#546a53",
"showGroundAtmosphere": true,
"enableLighting": false
},
"cameraController": {
"zoomFactor": 3.0,
"minimumZoomDistance": 5,
"maximumZoomDistance": 50000000,
"enableRotate": true,
"enableTranslate": true,
"enableTilt": true,
"enableZoom": true,
"enableCollisionDetection": true,
"minimumCollisionTerrainHeight": 15000
}
},
"control": {
"homeButton": true,
"baseLayerPicker": true,
"sceneModePicker": false,
"vrButton": false,
"fullscreenButton": true,
"navigationHelpButton": true,
"animation": false,
"timeline": false,
"infoBox": false,
"geocoder": false,
"geocoderConfig": {
"key": [
"ae29a37307840c7ae4a785ac905927e0"
]
},
"selectionIndicator": false,
"defaultContextMenu": true,
"mouseDownView": true,
"compass": {
"bottom": "240px",
"right": "2px"
},
"distanceLegend": {
"left": "100px",
"bottom": "0px"
},
"locationBar": {
"fps": true,
"template": "<div>经度:{lng}</div> <div>纬度:{lat}</div><div>海拔:{alt}米</div> <div>层级:{level}</div><div>方向:{heading}度</div> <div>俯仰角:{pitch}度</div><div>视高:{cameraHeight}米</div>"
}
},
"terrain": {
"url": "//data.mars3d.cn/terrain",
"show": false
},
"basemaps": [
{
"id": 10,
"name": "地图底图",
"type": "group"
},
{
"id": 2021,
"pid": 10,
"name": "天地图影像",
"icon": "http://mars3d.cn/example/img/basemaps/tdt_img.png",
"type": "tdt",
"layer": "img_d",
"key": [
"9ae78c51a0a28f06444d541148496e36"
]
},
{
"pid": 10,
"name": "天地图电子",
"icon": "http://mars3d.cn/example/img/basemaps/tdt_vec.png",
"type": "group",
"layers": [
{
"name": "底图",
"type": "tdt",
"layer": "vec_d",
"key": [
"9ae78c51a0a28f06444d541148496e36"
]
},
{
"name": "注记",
"type": "tdt",
"layer": "vec_z",
"key": [
"9ae78c51a0a28f06444d541148496e36"
]
}
]
},
{
"pid": 10,
"name": "高德影像",
"type": "group",
"icon": "http://mars3d.cn/example/img/basemaps/gaode_img.png",
"layers": [
{
"name": "底图",
"type": "gaode",
"layer": "img_d"
},
{
"name": "注记",
"type": "gaode",
"layer": "img_z"
}
],
"show": true
},
{
"pid": 10,
"name": "高德电子",
"type": "gaode",
"icon": "http://mars3d.cn/example/img/basemaps/gaode_vec.png",
"layer": "vec"
},
{
"pid": 10,
"name": "百度影像",
"type": "group",
"icon": "http://mars3d.cn/example/img/basemaps/bd-img.png",
"layers": [
{
"name": "底图",
"type": "baidu",
"layer": "img_d"
},
{
"name": "注记",
"type": "baidu",
"layer": "img_z"
}
]
},
{
"pid": 10,
"name": "百度电子",
"icon": "http://mars3d.cn/example/img/basemaps/bd-vec.png",
"type": "baidu",
"layer": "vec"
},
{
"pid": 10,
"name": "腾讯影像",
"icon": "http://mars3d.cn/example/img/basemaps/gaode_img.png",
"type": "group",
"layers": [
{
"name": "底图",
"type": "tencent",
"layer": "img_d"
},
{
"name": "注记",
"type": "tencent",
"layer": "img_z"
}
],
"show": false
},
{
"pid": 10,
"name": "腾讯电子",
"icon": "http://mars3d.cn/example/img/basemaps/gaode_vec.png",
"type": "tencent",
"layer": "vec"
},
{
"pid": 10,
"name": "ArcGIS影像",
"icon": "http://mars3d.cn/example/img/basemaps/esriWorldImagery.png",
"type": "xyz",
"url": "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",
"enablePickFeatures": false
},
{
"pid": 10,
"name": "微软影像",
"icon": "http://mars3d.cn/example/img/basemaps/bingAerial.png",
"type": "bing",
"key": "AuKhM0WRkjhX8E4y1OM0TukYycaw_4Vh3eSfXONDf7OARls-WEB3K_Rfx89bWxof",
"layer": "Aerial"
},
{
"pid": 10,
"name": "OSM地图",
"type": "xyz",
"icon": "http://mars3d.cn/example/img/basemaps/osm.png",
"url": "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
"subdomains": "abc"
},
{
"id": 2017,
"pid": 10,
"name": "蓝色底图",
"icon": "http://mars3d.cn/example/img/basemaps/bd-c-midnight.png",
"type": "xyz",
"url": "http://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}",
"chinaCRS": "GCJ02",
"enablePickFeatures": false
},
{
"pid": 10,
"name": "黑色底图",
"icon": "http://mars3d.cn/example/img/basemaps/bd-c-dark.png",
"type": "tencent",
"layer": "custom",
"style": "4"
},
{
"pid": 10,
"name": "灰色底图",
"icon": "http://mars3d.cn/example/img/basemaps/bd-c-grayscale.png",
"type": "mapbox",
"username": "marsgis",
"styleId": "cki0a92b123qo1aluk0e5v7sb",
"scaleFactor": true
},
{
"pid": 10,
"name": "离线地图 (供参考)",
"type": "xyz",
"icon": "http://mars3d.cn/example/img/basemaps/mapboxSatellite.png",
"url": "//data.mars3d.cn/tile/googleImg/{z}/{x}/{y}.jpg",
"minimumLevel": 1,
"maximumLevel": 18,
"minimumTerrainLevel": 1,
"maximumTerrainLevel": 18,
"rectangle": {
"xmin": -180,
"xmax": 180,
"ymin": -85,
"ymax": 85
}
},
{
"pid": 10,
"name": "单张图片 (本地离线)",
"icon": "http://mars3d.cn/example/img/basemaps/offline.png",
"type": "image",
"url": "//data.mars3d.cn/file/img/world/world.jpg"
}
],
"layers": [
{
"id": 20,
"name": "辅助图层",
"type": "group"
},
{
"pid": 20,
"name": "行政区划界线",
"type": "xyz",
"url": "https://t{s}.tianditu.gov.cn/DataServer?T=ibo_w&x={x}&y={y}&l={z}&tk=9ae78c51a0a28f06444d541148496e36",
"subdomains": "01234567",
"maximumLevel": 10,
"show": false
},
{
"pid": 20,
"name": "天地图注记",
"type": "tdt",
"layer": "img_z",
"key": [
"9ae78c51a0a28f06444d541148496e36"
],
"show": false
},
{
"id": 30,
"name": "实时路况",
"type": "group"
},
{
"pid": 30,
"name": "高德实时路况",
"type": "gaode",
"layer": "time",
"minimumTerrainLevel": 4,
"minimumLevel": 4,
"proxy": "//server.mars3d.cn/proxy/"
},
{
"pid": 30,
"name": "百度实时路况",
"type": "baidu",
"layer": "time"
},
{
"pid": 10,
"name": "天地图电子",
"icon": "http://mars3d.cn/example/img/basemaps/tdt_vec.png",
"type": "group",
"layers": [
{
"name": "底图",
"type": "tdt",
"layer": "vec_d",
"key": [
"9ae78c51a0a28f06444d541148496e36"
]
},
{
"name": "注记",
"type": "tdt",
"layer": "vec_z",
"key": [
"9ae78c51a0a28f06444d541148496e36"
]
}
],
"show": false
},
{
"pid": 40,
"name": "单张图片 (本地离线)",
"icon": "http://mars3d.cn/example/img/basemaps/offline.png",
"type": "image",
"url": "/dianziweilan/dianziweilan.jpg",
"rectangle": {
"xmin": 115.34449339,
"xmax": 115.383424,
"ymin": 39.269255,
"ymax": 39.2829251
}
}
]
}
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="author" content="火星科技 http://mars3d.cn ">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" >
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<script src="https://cdn.bootcss.com/eruda/1.5.8/eruda.min.js"></script>
<script>
//eruda.init();
</script>
<!-- <title><%= htmlWebpackPlugin.options.title %></title> -->
<title>卡车调度系统终端平台</title>
<script>
window.basePathUrl = '<%= BASE_URL %>' //标识config、widgets所在的目录
window.onload = function() {
document.addEventListener('touchstart', function(event) {
if (event.touches.length > 1) {
event.preventDefault()
}
})
document.addEventListener('gesturestart', function(event) {
event.preventDefault()
})
}
</script>
<!-- 方式2:使用直接引入的Cesium ,需要拷贝对应目录到public下 -->
<!-- <script type="text/javascript" >
window.CESIUM_BASE_URL ="<%= BASE_URL %>lib/Cesium/"
</script>
<link rel="stylesheet" href="<%= BASE_URL %>lib/Cesium/Widgets/widgets.css">
<script type="text/javascript" src="<%= BASE_URL %>lib/Cesium/Cesium.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>
<template>
<div id="app">
<router-view/>
</div>
</template>
<script>
export default {
mounted(){
var height= document.documentElement.clientHeight; //获取当前可视区域的高度存到hrt变量
window.onload = function(){ //在页面整体加载完毕时
document.getElementById('app').style.height= height + 'px'//把获取到的高度赋值给根div
}
}
}
</script>
<style lang="scss">
html,
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
#app {
font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
width: 100%;
height: 100%;
}
</style>
@font-face {
font-family: "iconfont"; /* Project id 2782333 */
src: url('iconfont.woff2?t=1630478178623') format('woff2'),
url('iconfont.woff?t=1630478178623') format('woff'),
url('iconfont.ttf?t=1630478178623') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-ren-jianshao:before {
content: "\e705";
}
.icon-xiajiantou:before {
content: "\e60a";
}
.icon-dian:before {
content: "\e601";
}
.icon-bianpo:before {
content: "\e794";
}
.icon-leaf:before {
content: "\e642";
}
.icon-suoxiao:before {
content: "\e616";
}
.icon-70BasicIcons-all-48:before {
content: "\e64a";
}
.icon-dingwei:before {
content: "\e600";
}
.icon-wenjianjia:before {
content: "\e66f";
}
.icon-zhuye:before {
content: "\e61d";
}
.icon-diannao:before {
content: "\e649";
}
.icon-che:before {
content: "\e609";
}
.icon-kuaizhuanggengduo:before {
content: "\e66c";
}
.icon-shezhi:before {
content: "\e696";
}
.icon-a-ziyuan50:before {
content: "\e6f2";
}
.el-table th.el-table__cell{
overflow: hidden;
user-select: none;
background-color: #ecf5ff;
}
This diff is collapsed.
{
"id": "2782333",
"name": "鑫海2",
"font_family": "iconfont",
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "9974423",
"name": "人-减少",
"font_class": "ren-jianshao",
"unicode": "e705",
"unicode_decimal": 59141
},
{
"icon_id": "13474459",
"name": "下箭头",
"font_class": "xiajiantou",
"unicode": "e60a",
"unicode_decimal": 58890
},
{
"icon_id": "14918649",
"name": "dian",
"font_class": "dian",
"unicode": "e601",
"unicode_decimal": 58881
},
{
"icon_id": "15196692",
"name": "边坡",
"font_class": "bianpo",
"unicode": "e794",
"unicode_decimal": 59284
},
{
"icon_id": "18012926",
"name": "叶子",
"font_class": "leaf",
"unicode": "e642",
"unicode_decimal": 58946
},
{
"icon_id": "579386",
"name": "缩小",
"font_class": "suoxiao",
"unicode": "e616",
"unicode_decimal": 58902
},
{
"icon_id": "18924792",
"name": "放大",
"font_class": "70BasicIcons-all-48",
"unicode": "e64a",
"unicode_decimal": 58954
},
{
"icon_id": "1901667",
"name": "定位",
"font_class": "dingwei",
"unicode": "e600",
"unicode_decimal": 58880
},
{
"icon_id": "5729042",
"name": "文件夹",
"font_class": "wenjianjia",
"unicode": "e66f",
"unicode_decimal": 58991
},
{
"icon_id": "6429564",
"name": "主页",
"font_class": "zhuye",
"unicode": "e61d",
"unicode_decimal": 58909
},
{
"icon_id": "9748109",
"name": "电脑",
"font_class": "diannao",
"unicode": "e649",
"unicode_decimal": 58953
},
{
"icon_id": "13581222",
"name": "车",
"font_class": "che",
"unicode": "e609",
"unicode_decimal": 58889
},
{
"icon_id": "16384707",
"name": "块状更多",
"font_class": "kuaizhuanggengduo",
"unicode": "e66c",
"unicode_decimal": 58988
},
{
"icon_id": "18379488",
"name": "设 置",
"font_class": "shezhi",
"unicode": "e696",
"unicode_decimal": 59030
},
{
"icon_id": "22861713",
"name": "门",
"font_class": "a-ziyuan50",
"unicode": "e6f2",
"unicode_decimal": 59122
}
]
}
This image diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
export const login = '/auth/login'; //登录
export const code = '/auth/code';
export const menus = '/api/menus';
export const getMenusTree = '/api/menus/lazy';
export const users = '/api/users';
export const addUser = '/api/User/addUser';
export const updateUser = '/api/User/updateUser';
export const delUser = '/api/User/delUser';
export const editMenu = '/api/roles/menu';
export const childMenu = '/api/menus/child';
export const creatOrder = '/api/Order/changeOdoStatusByCarNumber'; //点击智能派单生成Order表
export const screenMapSetUpQuery = '/Weilan/list'; //获取区域围栏范围信息
export const manualSchedulingQuery = '/api/Manmade'; //获取人工调度信息
export const vehicleInformationQuery = '/api/CarPeop'; //获取车辆信息
export const safetySubmitCheck = '/api/newChange/isSubmitAnjian'; //安全报告提交检查
export const vehicleInformationUpdate = '/api/CarPeop'; //修改车辆信息
export const apiCarClassQuery = '/api/CarClass'; //获取车辆类型
export const vehicleRealTimeQuery = '/api/CarReal'; //获取车辆信息实时数据(不用)
export const vehicleRealTimeQuery2 = '/api/CarPeop/realtime'; //获取车辆信息实时数据(不用)
export const apiManmadesRealQuery = '/api/Manmades/Real'; //获取车辆信息实时数据(使用)
export const personalCenterInforQuery = '/api/Drivers'; //获取个人信息
export const failureDeclarationAdd = '/api/Hitch'; //故障申报提交
export const achievementStatisticsQuery = '/api/DispatchReal'; //获取绩效统计——司机考核(不用)
export const apiManmadesJXQuery = '/api/Manmades/JX'; //获取绩效统计——司机考核(使用)
export const intelligentDispatchQuery = '/api/Manmades'; //获取绩效统计——智能派单
export const chanRealQuery = '/api/Manmades/ChanReal'; //获取绩效统计——智能派单
export const updatePass = '/api/users/updatePass'; //修改个人信息密码
export const carFleetQuery = '/api/CarRoad'; //获取语音申请车队
export const carsInforQuery = '/api/CarBreak'; //获取语音申请车辆
export const faultInforQuery = '/api/BreakClass'; //获取车辆故障类型
export const carRealTimeLocationQuery1 = '/gps/all'; //获取车辆实时位置
export const carRealTimeLocationQuery2 = '/gps'; //获取一个车辆位置
export const gpsPhoneGpsQuery = '/gps/phoneGps'; //获取一个车辆位置
export const faultDayAdd = '/api/Fault'; //添加故障日报
export const faultMonthAdd = '/api/FaultMonth'; //添加故障月报
export const faultYearAdd = '/api/FaultYear'; //添加故障年报
export const waitingtrucksQuery = '/api/Dispatch/waitingtrucks'; //获取待装车卡车列表
export const manmadeStatusQuery = '/api/Manmade/status'; //获取调度车辆次数为一天或者长期的数据
export const dingDanBiaoCaoZuo = '/api/Order'; //订单表操作
export const getZhuangCheDingDanQuery = '/api/Order/ZC'; //获取装车订单
export const getXieCheDingDanQuery = '/api/Order/XC'; //获取卸车订单
export const getalarmRealQuery = '/api/alarm/real'; //获取车辆设备实时报警
export const dispatchFinishQuery = '/api/Dispatch/finish'; //获取智能调度是否完成
export const apiCpointQuery = '/api/Cpoint'; //获取关键控制点坐标
export const apiPathmapNavigationQuery = '/api/Pathmap/navigation'; //获取关键控制点坐标
export const apiManmadesRealCarQuery = '/api/Manmades/RealCar'; //点击车辆小弹框
export const apiManmadesChanJxQuery = '/api/Manmades/ChanJx'; //铲车绩效上面
export const apiManmadesChanCheRealQuery = '/api/Manmades/ChanCheReal'; //铲车车辆信息实时数据
export const apiEquipmentQuery = '/api/Equipment'; //获取设备表
export const ajReportModel = '/api/anjian/getAnjianByFormId'; //获取安检项目模板
export const ajReportSubmit = '/api/anjian'; //提交安检报告
export const posGetAllOnlineCarPosition = '/api/carPosition/getAllOnlineCarPosition'; //获取车辆列表和坐标
export const posAreaInformation = '/api/areaInformation'; //获取装卸区信息
export const posAreaInformationPoint = '/api/areaInformation/point'; //获取装卸点信息
export const changeJinJiReadStatus = '/api/Notice/changeJinJiReadStatus'; //终端确认紧急通知
export const crossingFence = '/api/crossingFence'; //终端围栏出入消息回传
export const tRealTimeOrder = '/api/tRealTimeOrder'; //获取当前车辆的订单
export const arriveCaiDian = '/api/tRealTimeOrder/arriveCaiDian'; //判断车辆到达采点后,提供订单id,使进入待装车状态
export const getAllLoadableKC = '/api/tRealTimeOrder/getAllLoadableKC'; //铲车查询附近五十米内是否有状态为2(到达采点,等待装车)的卡车
export const chooseKCZC = '/api/tRealTimeOrder/chooseKCZC'; //铲车给指定卡车进行装车
import axios from 'axios'
import { config as appConfig } from '../config.js'
import { Message } from 'element-ui'
import bus from "@/axios/bus.js";
// axios 配置
axios.defaults.baseURL = appConfig.BASE_URL;
axios.defaults.timeout = 500000;
axios.defaults.headers = {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
}
// http request 请求拦截器,有token值则配置上token值
axios.interceptors.request.use(
config => {
var token = localStorage.getItem(appConfig.TOKEN_KEY);
if (localStorage.getItem(appConfig.USER_KEY)) {
let ticket = JSON.parse(localStorage.getItem(appConfig.USER_KEY)).ticket;
config.headers.ticket = ticket == null ? '' : ticket;
}
config.headers.Authorization = token == null ? '' : token;
return config;
},
err => {
return Promise.reject(err);
}
);
// http response 服务器响应拦截器,这里拦截401错误,并重新跳入登页重新获取token
axios.interceptors.response.use(
response => {
return response;
},
error => {
if (error.response) {
console.log(error.response.status)
switch (error.response.status) {
case 403:
Message({
message: "登录凭证失效,请重新登录",
type: 'warning'
});
window.location.href = '#/login';
error.message = "登录凭证失效,请重新登录";
bus.$emit("todoDetailWebsocket");
break
case 401:
Message({
//message: '未授权,请重新登录',
message: '网络异常,请重新登录',
type: 'warning'
});
//error.message = '未授权,请重新登录';
error.message = '网络异常,请重新登录';
break
// localStorage.removeItem(appConfig.TOKEN_KEY)
// localStorage.removeItem(appConfig.USER_KEY)
// router.replace({
// path: '/login',
// // query: {redirect: router.currentRoute.fullPath}//登录成功后跳入浏览的当前页面
// })
case 400:
error.message = '网络异常'
case 404:
error.message = '网络异常'
break
case 405:
error.message = '网络异常'
break
case 408:
error.message = '网络异常'
break
case 500:
Message({
message: '内部服务器错误,请联系管理员',
type: 'warning'
});
break
case 501:
error.message = '网络未实现'
break
case 502:
error.message = '网络错误'
break
case 503:
error.message = '服务不可用'
break
case 504:
error.message = '网络超时'
break
case 505:
error.message = 'http版本不支持该请求'
break
default:
error.message = `连接错误${error.response.status}`
// router.replace({
// path: '/',
// query: {redirect: router.currentRoute.fullPath}//登录成功后跳入浏览的当前页面
// })
}
// console.log(error.response);
} else {
Message({
message: "网络异常",
type: 'warning'
});
}
return Promise.reject(error)
}
);
export default axios;
import Vue from 'vue';
// 使用 Event Bus
const bus = new Vue();
export default bus;
\ No newline at end of file
//不在此定义的url,isMock默认为true
export default [
{
key: 'login',
isMock: false
}
];
'use strict'
import { app, protocol, BrowserWindow } from 'electron'
import { createProtocol } from 'vue-cli-plugin-electron-builder/lib'
import installExtension, { VUEJS_DEVTOOLS } from 'electron-devtools-installer'
const isDevelopment = process.env.NODE_ENV !== 'production'
// Scheme must be registered before the app is ready
protocol.registerSchemesAsPrivileged([
{ scheme: 'app', privileges: { secure: true, standard: true } }
])
async function createWindow() {
// Create the browser window.
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
// Required for Spectron testing
enableRemoteModule: !!process.env.IS_TEST,
// Use pluginOptions.nodeIntegration, leave this alone
// See nklayman.github.io/vue-cli-plugin-electron-builder/guide/security.html#node-integration for more info
nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION,
contextIsolation: !process.env.ELECTRON_NODE_INTEGRATION
}
})
if (process.env.WEBPACK_DEV_SERVER_URL) {
// Load the url of the dev server if in development mode
await win.loadURL(process.env.WEBPACK_DEV_SERVER_URL)
if (!process.env.IS_TEST) win.webContents.openDevTools()
} else {
createProtocol('app')
// Load the index.html when not in development
win.loadURL('app://./index.html')
}
}
// Quit when all windows are closed.
app.on('window-all-closed', () => {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', async () => {
if (isDevelopment && !process.env.IS_TEST) {
// Install Vue Devtools
try {
await installExtension(VUEJS_DEVTOOLS)
} catch (e) {
console.error('Vue Devtools failed to install:', e.toString())
}
}
createWindow()
})
// Exit cleanly on request from parent process in development mode.
if (isDevelopment) {
if (process.platform === 'win32') {
process.on('message', (data) => {
if (data === 'graceful-exit') {
app.quit()
}
})
} else {
process.on('SIGTERM', () => {
app.quit()
})
}
}
This diff is collapsed.
<template>
<div>
<canvas ref="mycanvas" :width="cWidth" :height="cHeight"></canvas>
</div>
</template>
<script>
export default {
name: 'ElectricQuantity',
mycanvas: null,
ctx: null,
myInterval: null,
props: {
proQuantity: {
type: Number,
default: 50
},
proIsCharge: {
type: Boolean,
default: false
}
},
data () {
return {
cWidth: 66,
cHeight: 28,
jd: 0
}
},
created () {
},
watch: {
// 监听是否变化电量 ,如果是 做一个充电动画
proIsCharge (newVal, oldVal) {
console.log('======proIsCharge============', newVal)
let _this = this
clearInterval(_this.myInterval)
this.jd = 0
if (_this.proIsCharge) {
_this.myInterval = setInterval(function () {
_this.drawCharge()
}, 300)
}
},
proQuantity (newVal, oldVal) {
this.drawPath(this.proQuantity)
}
},
mounted () {
this.mycanvas = this.$refs.mycanvas
this.ctx = this.mycanvas.getContext('2d')
this.drawBg()
this.drawPath(this.proQuantity)
},
methods: {
// 画一个背景
drawBg () {
this.ctx.strokeStyle = 'rgba(255,255,255,1)'
this.ctx.lineWidth = 2
this.ctx.strokeRect(0, 0, 60, 28)
this.ctx.fillStyle = 'rgba(0,0,0,0.2)'
this.ctx.fillRect(0, 0, 60, 28)
this.ctx.fillStyle = 'rgba(255,255,255,1)'
this.ctx.fillRect(61, 7, 6, 14)
},
// 根据电量画出一个块
drawPath (quantity) {
if (this.proIsCharge) {
this.ctx.fillStyle = 'rgba(0,255,0,1)'
} else if (quantity < 20) {
this.ctx.fillStyle = 'red'
} else {
this.ctx.fillStyle = 'rgba(0,255,0,1)'
}
this.ctx.fillRect(1, 1, (60 - 2) * quantity / 100, 26)
},
drawCharge () {
this.ctx.clearRect(0, 0, this.cWidth, this.cHeight)
this.drawBg()
this.jd = this.jd + 10
if (this.jd > 100) {
this.jd = 0
}
this.drawPath(this.jd)
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment