@ -0,0 +1,11 @@
|
|||||||
|
# 页面标题
|
||||||
|
VUE_APP_TITLE = 停车场查询
|
||||||
|
# 开发环境配置
|
||||||
|
ENV = 'development'
|
||||||
|
|
||||||
|
# 若依管理系统/开发环境
|
||||||
|
# /dev-api
|
||||||
|
# VUE_APP_BASE_API = 'http://39.101.188.84:9037'
|
||||||
|
VUE_APP_BASE_API = 'http://192.168.0.130:9004/api'
|
||||||
|
# VUE_APP_BASE_API = 'http://192.168.0.106:9037'
|
||||||
|
|
@ -0,0 +1,6 @@
|
|||||||
|
# 页面标题
|
||||||
|
VUE_APP_TITLE = 停车场查询
|
||||||
|
|
||||||
|
# 生产环境配置
|
||||||
|
ENV = 'production'
|
||||||
|
VUE_APP_BASE_API = 'https://bjh.jndz.cn/bjh-admin-server'
|
@ -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,19 @@
|
|||||||
|
# jiangning-leflat
|
||||||
|
|
||||||
|
## 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'
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es5",
|
||||||
|
"module": "esnext",
|
||||||
|
"baseUrl": "./",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"paths": {
|
||||||
|
"@/*": [
|
||||||
|
"src/*"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"lib": [
|
||||||
|
"esnext",
|
||||||
|
"dom",
|
||||||
|
"dom.iterable",
|
||||||
|
"scripthost"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"name": "eventMap",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vue-cli-service serve",
|
||||||
|
"build": "vue-cli-service build"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"core-js": "^3.8.3",
|
||||||
|
"vue": "^2.6.14"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@vue/cli-plugin-babel": "~5.0.0",
|
||||||
|
"@vue/cli-service": "~5.0.0",
|
||||||
|
"sass": "^1.32.7",
|
||||||
|
"compression-webpack-plugin": "5.0.2",
|
||||||
|
"script-ext-html-webpack-plugin": "2.1.5",
|
||||||
|
"js-cookie": "3.0.1",
|
||||||
|
"file-saver": "2.0.5",
|
||||||
|
"sass-loader": "^12.0.0",
|
||||||
|
"element-ui": "2.15.13",
|
||||||
|
"axios": "0.24.0",
|
||||||
|
"vue-router": "3.4.9",
|
||||||
|
"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="" style="font-size: 37.5px;">
|
||||||
|
<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 style="font-size: 24px;">
|
||||||
|
<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,2 @@
|
|||||||
|
User-agent: *
|
||||||
|
Disallow: /
|
@ -0,0 +1,23 @@
|
|||||||
|
<template>
|
||||||
|
<div id="app">
|
||||||
|
<!-- <HelloWorld/> -->
|
||||||
|
<router-view />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'App',
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
#app {
|
||||||
|
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,43 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询重点区域列表
|
||||||
|
export function listZdqy(query) {
|
||||||
|
return request({
|
||||||
|
url: '/jn/regionalsettings/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 查询区域网格列表
|
||||||
|
export function listQywg(query) {
|
||||||
|
return request({
|
||||||
|
url: '/jn/bgridsetting/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//根据等级查询所有区域网格
|
||||||
|
export function levelQywg(query) {
|
||||||
|
return request({
|
||||||
|
url: '/jn/bgridsetting/getListBylevel',
|
||||||
|
method: 'get',
|
||||||
|
params:query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 查询重点路段列表
|
||||||
|
export function listZdld(query) {
|
||||||
|
return request({
|
||||||
|
url: '/jn/roadsetting/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取围栏管理列表
|
||||||
|
export function getFenceList(params) {
|
||||||
|
return request({
|
||||||
|
url: "/jn/fence/list",
|
||||||
|
method:'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function GetAreaFreeSpaceNum() {
|
||||||
|
return request({
|
||||||
|
url:"/remoteCall/GetAreaFreeSpaceNum",
|
||||||
|
method:'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function GetCarInfoByPlateNo(params) {
|
||||||
|
return request({
|
||||||
|
url:"/remoteCall/GetCarInfoByPlateNo",
|
||||||
|
method:'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
After Width: | Height: | Size: 161 KiB |
After Width: | Height: | Size: 183 KiB |
After Width: | Height: | Size: 9.4 KiB |
After Width: | Height: | Size: 9.4 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 6.7 KiB |
@ -0,0 +1,4 @@
|
|||||||
|
@font-face {
|
||||||
|
font-family: "PingFangSC-Regular";
|
||||||
|
src: url("./fonts/PingFang Regular.ttf");
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
// @import "./font.css";
|
||||||
|
body {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
font-variant: tabular-nums;
|
||||||
|
line-height: 1.5;
|
||||||
|
background-color: #fff;
|
||||||
|
font-feature-settings: "tnum";
|
||||||
|
touch-action: manipulation;
|
||||||
|
}
|
||||||
|
html {
|
||||||
|
touch-action: manipulation;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
*, :after, :before {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
button, select {
|
||||||
|
text-transform: none;
|
||||||
|
}
|
||||||
|
button, input {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
button, input, optgroup, select, textarea {
|
||||||
|
margin: 0;
|
||||||
|
color: inherit;
|
||||||
|
font-size: inherit;
|
||||||
|
font-family: inherit;
|
||||||
|
line-height: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
[type=reset], [type=submit], button, html [type=button] {
|
||||||
|
-webkit-appearance: button;
|
||||||
|
}
|
@ -0,0 +1,267 @@
|
|||||||
|
<template>
|
||||||
|
<div class="content" v-title data-title="首页" v-if="carInfo.freeSpaceNum">
|
||||||
|
<div class="car-number">
|
||||||
|
<div class="total-number">
|
||||||
|
<div class="text">当前总空余车位数</div>
|
||||||
|
<div class="number">{{ carInfo.freeSpaceNum }}</div>
|
||||||
|
</div>
|
||||||
|
<ul class="content-box">
|
||||||
|
<li class="content-box-li" v-for="(item,index) in carInfo.areaInfo" :key="index">
|
||||||
|
<div>
|
||||||
|
<div class="name-box">
|
||||||
|
<img src="@/assets/images/icon_p.svg" alt="" />
|
||||||
|
{{ item.areaName }}
|
||||||
|
</div>
|
||||||
|
<p class="text-box">
|
||||||
|
<span class="text-box-span">{{ item.freeSpaceNum }}</span>
|
||||||
|
<span class="text-box-xie">/</span>
|
||||||
|
{{ item.placeCount }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line2"></div>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="footer-box">
|
||||||
|
<button class="bot-bg" @click="goQuery">查询车场</button>
|
||||||
|
<button class="bot-bg2" @click="InquiryPayment">查询缴费</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { GetAreaFreeSpaceNum } from "@/api/index"
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
liItems:[
|
||||||
|
{
|
||||||
|
name:"镇东停车场",
|
||||||
|
number:288,
|
||||||
|
total: 347
|
||||||
|
},{
|
||||||
|
name:"镇北停车场",
|
||||||
|
number:146,
|
||||||
|
total: 361
|
||||||
|
},{
|
||||||
|
name:"镇南停车场",
|
||||||
|
number:95,
|
||||||
|
total: 98
|
||||||
|
},{
|
||||||
|
name:"地下停车场",
|
||||||
|
number:0,
|
||||||
|
total: 72
|
||||||
|
},
|
||||||
|
],
|
||||||
|
carInfo:{
|
||||||
|
freeSpaceNum:null,
|
||||||
|
areaInfo:[]
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted(){
|
||||||
|
GetAreaFreeSpaceNum().then(res=>{
|
||||||
|
// let data = res.data ? JSON.parse(res.data) : '';
|
||||||
|
this.carInfo = res.data;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
InquiryPayment(){
|
||||||
|
window.open("https://cloud.keytop.cn/stcfront/Payment/GroupQuery?groupId=671540406378439398")
|
||||||
|
},
|
||||||
|
goQuery(){
|
||||||
|
this.$router.push('/parkinglot')
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.content {
|
||||||
|
padding: .53125rem .375rem;
|
||||||
|
}
|
||||||
|
.car-number {
|
||||||
|
padding: .5625rem .3125rem .25rem;
|
||||||
|
background-color: #fff;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
box-shadow: 0 .0625rem .25rem 0 rgba(38, 80, 0, .06);
|
||||||
|
border-radius: .3125rem;
|
||||||
|
margin-bottom: 1.25rem;
|
||||||
|
.total-number {
|
||||||
|
font-family: PingFangSC-Regular;
|
||||||
|
font-size: .46875rem;
|
||||||
|
color: rgba(0, 0, 0, .85);
|
||||||
|
text-align: center;
|
||||||
|
font-weight: 400;
|
||||||
|
|
||||||
|
.number {
|
||||||
|
margin-top: .1875rem;
|
||||||
|
font-size: 1.125rem;
|
||||||
|
color: #59a812;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: .46875rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.content-box {
|
||||||
|
list-style-type: none;
|
||||||
|
background: #f8faf8;
|
||||||
|
border-radius: .25rem;
|
||||||
|
width: 100%;
|
||||||
|
padding: .375rem;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
li {
|
||||||
|
margin: 0 .15625rem;
|
||||||
|
}
|
||||||
|
.content-box-li {
|
||||||
|
width: 48%;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
&:nth-child(1) {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:nth-child(2) {
|
||||||
|
width: 49%;
|
||||||
|
padding-left: .375rem;
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
&:nth-child(3) {
|
||||||
|
margin: 0;
|
||||||
|
margin-top: .625rem;
|
||||||
|
}
|
||||||
|
&:nth-child(4) {
|
||||||
|
width: 49%;
|
||||||
|
padding-left: .375rem;
|
||||||
|
margin-right: 0;
|
||||||
|
margin-top: .625rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.name-box {
|
||||||
|
font-family: PingFangSC-Regular;
|
||||||
|
font-size: .40625rem;
|
||||||
|
color: rgba(0, 0, 0, .85);
|
||||||
|
line-height: .5625rem;
|
||||||
|
font-weight: 400;
|
||||||
|
margin-bottom: .25rem;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
img {
|
||||||
|
width: .390625rem;
|
||||||
|
height: .390625rem;
|
||||||
|
margin-right: .1875rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-box {
|
||||||
|
font-family: PingFangSC-Regular;
|
||||||
|
font-size: .5rem;
|
||||||
|
color: rgba(0, 0, 0, .85);
|
||||||
|
font-weight: 400;
|
||||||
|
|
||||||
|
.text-box-span {
|
||||||
|
font-size: .5625rem;
|
||||||
|
color: #6fba2c;
|
||||||
|
margin-left: .5625rem;
|
||||||
|
}
|
||||||
|
.text-box-xie {
|
||||||
|
font-size: .4375rem;
|
||||||
|
color: rgba(0, 0, 0, .65);
|
||||||
|
font-weight: 400;
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: .0625rem;
|
||||||
|
margin-left: .125rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.line {
|
||||||
|
width: calc(100% - .75rem);
|
||||||
|
border-bottom: .03125rem dashed #d4d9d4;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: .375rem;
|
||||||
|
}
|
||||||
|
.line2 {
|
||||||
|
height: calc(100% - .75rem);
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: .375rem;
|
||||||
|
border-right: .03125rem dashed #d4d9d4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.footer-box {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
button {
|
||||||
|
// width: 200px;
|
||||||
|
// height: 90px;
|
||||||
|
// font-size: 18px;
|
||||||
|
// color: rgba(0, 0, 0, .85);
|
||||||
|
// text-align: left;
|
||||||
|
// padding-left: 20px;
|
||||||
|
// display: flex;
|
||||||
|
// align-items: center;
|
||||||
|
// border: none;
|
||||||
|
// border-radius: 10px;
|
||||||
|
// overflow: hidden;
|
||||||
|
// cursor: pointer;
|
||||||
|
width: 5.15625rem;
|
||||||
|
height: 2.5rem;
|
||||||
|
border: none;
|
||||||
|
font-size: .5rem;
|
||||||
|
color: rgba(0, 0, 0, .85);
|
||||||
|
text-align: left;
|
||||||
|
padding-left: .375rem;
|
||||||
|
}
|
||||||
|
.bot-bg {
|
||||||
|
background: url("@/assets/images/btnbg-1.png") no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
margin-right: .5rem;
|
||||||
|
|
||||||
|
}
|
||||||
|
.bot-bg2 {
|
||||||
|
background: url("@/assets/images/btnbg-2.png") no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
// width: 5.15625rem;
|
||||||
|
// height: 2.5rem;
|
||||||
|
// border: none;
|
||||||
|
// font-size: .5rem;
|
||||||
|
// color: rgba(0, 0, 0, .85);
|
||||||
|
// text-align: left;
|
||||||
|
// padding-left: .375rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// .code-number {
|
||||||
|
// width: 100%;
|
||||||
|
// height: 200px;
|
||||||
|
// display: flex;
|
||||||
|
// justify-content: center;
|
||||||
|
|
||||||
|
// /deep/ .message-input {
|
||||||
|
// width: 100%;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// /deep/ .u-box[data-v-0e1e7f9a] {
|
||||||
|
// border: none;
|
||||||
|
// background-color: #F7F8FA;
|
||||||
|
// }
|
||||||
|
// /deep/.u-placeholder-line {
|
||||||
|
// background-color: #00B578;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// /deep/.u-box.data-v-0e1e7f9a {
|
||||||
|
// border: none;
|
||||||
|
// background-color: #f7f8fa;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// /deep/ .u-box-active.data-v-0e1e7f9a {
|
||||||
|
// border: none;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
</style>
|
@ -0,0 +1,24 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import App from './App.vue'
|
||||||
|
import router from './router'
|
||||||
|
import Element from 'element-ui'
|
||||||
|
import "@/assets/style/index.scss"
|
||||||
|
import 'element-ui/lib/theme-chalk/index.css';
|
||||||
|
import './permission'
|
||||||
|
Vue.config.productionTip = false
|
||||||
|
|
||||||
|
Vue.directive('title', {
|
||||||
|
inserted: function (el, binding) {
|
||||||
|
document.title = el.dataset.title
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// router.beforeEach((to, from, next) => {
|
||||||
|
// window.document.title = to.meta.title == undefined ? '默认标题' : to.meta.title
|
||||||
|
// next();
|
||||||
|
// })
|
||||||
|
Vue.use(Element)
|
||||||
|
new Vue({
|
||||||
|
router,
|
||||||
|
render: h => h(App),
|
||||||
|
}).$mount('#app')
|
@ -0,0 +1,26 @@
|
|||||||
|
import router from './router'
|
||||||
|
import { getRobot, setRobot } from '@/utils/auth'
|
||||||
|
router.beforeEach((to, from, next) => {
|
||||||
|
var tokenReg = new RegExp(/[?&]token=([^&#]+)/)
|
||||||
|
var t = window.location.href.match(tokenReg);
|
||||||
|
// console.log(t,"t");
|
||||||
|
if (window.location.href.includes("token=")) {
|
||||||
|
var tokenReg = new RegExp(/[?&]token=([^&#]+)/)
|
||||||
|
var t = window.location.href.match(tokenReg);
|
||||||
|
const token = t && t[1];
|
||||||
|
// localStorage.setItem('robotToken',token);
|
||||||
|
// robotLogin({username:"superAdmin",password:"sa@123456"}).then(res=>{
|
||||||
|
// setRobot(res.result.token)
|
||||||
|
// })
|
||||||
|
next();
|
||||||
|
} else {
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
// else {
|
||||||
|
// if (localStorage.getItem('robotToken')) {
|
||||||
|
// next()
|
||||||
|
// } else {
|
||||||
|
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
})
|
@ -0,0 +1,60 @@
|
|||||||
|
import store from '@/store'
|
||||||
|
|
||||||
|
function authPermission(permission) {
|
||||||
|
const all_permission = "*:*:*";
|
||||||
|
const permissions = store.getters && store.getters.permissions
|
||||||
|
if (permission && permission.length > 0) {
|
||||||
|
return permissions.some(v => {
|
||||||
|
return all_permission === v || v === permission
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function authRole(role) {
|
||||||
|
const super_admin = "admin";
|
||||||
|
const roles = store.getters && store.getters.roles
|
||||||
|
if (role && role.length > 0) {
|
||||||
|
return roles.some(v => {
|
||||||
|
return super_admin === v || v === role
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
// 验证用户是否具备某权限
|
||||||
|
hasPermi(permission) {
|
||||||
|
return authPermission(permission);
|
||||||
|
},
|
||||||
|
// 验证用户是否含有指定权限,只需包含其中一个
|
||||||
|
hasPermiOr(permissions) {
|
||||||
|
return permissions.some(item => {
|
||||||
|
return authPermission(item)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 验证用户是否含有指定权限,必须全部拥有
|
||||||
|
hasPermiAnd(permissions) {
|
||||||
|
return permissions.every(item => {
|
||||||
|
return authPermission(item)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 验证用户是否具备某角色
|
||||||
|
hasRole(role) {
|
||||||
|
return authRole(role);
|
||||||
|
},
|
||||||
|
// 验证用户是否含有指定角色,只需包含其中一个
|
||||||
|
hasRoleOr(roles) {
|
||||||
|
return roles.some(item => {
|
||||||
|
return authRole(item)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 验证用户是否含有指定角色,必须全部拥有
|
||||||
|
hasRoleAnd(roles) {
|
||||||
|
return roles.every(item => {
|
||||||
|
return authRole(item)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,77 @@
|
|||||||
|
const sessionCache = {
|
||||||
|
set (key, value) {
|
||||||
|
if (!sessionStorage) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (key != null && value != null) {
|
||||||
|
sessionStorage.setItem(key, value)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
get (key) {
|
||||||
|
if (!sessionStorage) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
if (key == null) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
return sessionStorage.getItem(key)
|
||||||
|
},
|
||||||
|
setJSON (key, jsonValue) {
|
||||||
|
if (jsonValue != null) {
|
||||||
|
this.set(key, JSON.stringify(jsonValue))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getJSON (key) {
|
||||||
|
const value = this.get(key)
|
||||||
|
if (value != null) {
|
||||||
|
return JSON.parse(value)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
remove (key) {
|
||||||
|
sessionStorage.removeItem(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const localCache = {
|
||||||
|
set (key, value) {
|
||||||
|
if (!localStorage) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (key != null && value != null) {
|
||||||
|
localStorage.setItem(key, value)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
get (key) {
|
||||||
|
if (!localStorage) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
if (key == null) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
return localStorage.getItem(key)
|
||||||
|
},
|
||||||
|
setJSON (key, jsonValue) {
|
||||||
|
if (jsonValue != null) {
|
||||||
|
this.set(key, JSON.stringify(jsonValue))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getJSON (key) {
|
||||||
|
const value = this.get(key)
|
||||||
|
if (value != null) {
|
||||||
|
return JSON.parse(value)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
remove (key) {
|
||||||
|
localStorage.removeItem(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
/**
|
||||||
|
* 会话级缓存
|
||||||
|
*/
|
||||||
|
session: sessionCache,
|
||||||
|
/**
|
||||||
|
* 本地缓存
|
||||||
|
*/
|
||||||
|
local: localCache
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
import axios from 'axios'
|
||||||
|
import { Message } from 'element-ui'
|
||||||
|
import { saveAs } from 'file-saver'
|
||||||
|
import { getToken } from '@/utils/auth'
|
||||||
|
import errorCode from '@/utils/errorCode'
|
||||||
|
import { blobValidate } from "@/utils/ruoyi";
|
||||||
|
|
||||||
|
const baseURL = process.env.VUE_APP_BASE_API
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name(name, isDelete = true) {
|
||||||
|
var url = baseURL + "/common/download?fileName=" + encodeURIComponent(name) + "&delete=" + isDelete
|
||||||
|
axios({
|
||||||
|
method: 'get',
|
||||||
|
url: url,
|
||||||
|
responseType: 'blob',
|
||||||
|
headers: { 'Authorization': 'Bearer ' + getToken() }
|
||||||
|
}).then((res) => {
|
||||||
|
const isBlob = blobValidate(res.data);
|
||||||
|
if (isBlob) {
|
||||||
|
const blob = new Blob([res.data])
|
||||||
|
this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
|
||||||
|
} else {
|
||||||
|
this.printErrMsg(res.data);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
resource(resource) {
|
||||||
|
var url = baseURL + "/common/download/resource?resource=" + encodeURIComponent(resource);
|
||||||
|
axios({
|
||||||
|
method: 'get',
|
||||||
|
url: url,
|
||||||
|
responseType: 'blob',
|
||||||
|
headers: { 'Authorization': 'Bearer ' + getToken() }
|
||||||
|
}).then((res) => {
|
||||||
|
const isBlob = blobValidate(res.data);
|
||||||
|
if (isBlob) {
|
||||||
|
const blob = new Blob([res.data])
|
||||||
|
this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
|
||||||
|
} else {
|
||||||
|
this.printErrMsg(res.data);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
zip(url, name) {
|
||||||
|
var url = baseURL + url
|
||||||
|
axios({
|
||||||
|
method: 'get',
|
||||||
|
url: url,
|
||||||
|
responseType: 'blob',
|
||||||
|
headers: { 'Authorization': 'Bearer ' + getToken() }
|
||||||
|
}).then((res) => {
|
||||||
|
const isBlob = blobValidate(res.data);
|
||||||
|
if (isBlob) {
|
||||||
|
const blob = new Blob([res.data], { type: 'application/zip' })
|
||||||
|
this.saveAs(blob, name)
|
||||||
|
} else {
|
||||||
|
this.printErrMsg(res.data);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
saveAs(text, name, opts) {
|
||||||
|
saveAs(text, name, opts);
|
||||||
|
},
|
||||||
|
async printErrMsg(data) {
|
||||||
|
const resText = await data.text();
|
||||||
|
const rspObj = JSON.parse(resText);
|
||||||
|
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
|
||||||
|
Message.error(errMsg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
|||||||
|
import tab from './tab'
|
||||||
|
import auth from './auth'
|
||||||
|
import cache from './cache'
|
||||||
|
import modal from './modal'
|
||||||
|
import download from './download'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
install(Vue) {
|
||||||
|
// 页签操作
|
||||||
|
Vue.prototype.$tab = tab
|
||||||
|
// 认证对象
|
||||||
|
Vue.prototype.$auth = auth
|
||||||
|
// 缓存对象
|
||||||
|
Vue.prototype.$cache = cache
|
||||||
|
// 模态框对象
|
||||||
|
Vue.prototype.$modal = modal
|
||||||
|
// 下载文件
|
||||||
|
Vue.prototype.$download = download
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,83 @@
|
|||||||
|
import { Message, MessageBox, Notification, Loading } from 'element-ui'
|
||||||
|
|
||||||
|
let loadingInstance;
|
||||||
|
|
||||||
|
export default {
|
||||||
|
// 消息提示
|
||||||
|
msg(content) {
|
||||||
|
Message.info(content)
|
||||||
|
},
|
||||||
|
// 错误消息
|
||||||
|
msgError(content) {
|
||||||
|
Message.error(content)
|
||||||
|
},
|
||||||
|
// 成功消息
|
||||||
|
msgSuccess(content) {
|
||||||
|
Message.success(content)
|
||||||
|
},
|
||||||
|
// 警告消息
|
||||||
|
msgWarning(content) {
|
||||||
|
Message.warning(content)
|
||||||
|
},
|
||||||
|
// 弹出提示
|
||||||
|
alert(content) {
|
||||||
|
MessageBox.alert(content, "系统提示")
|
||||||
|
},
|
||||||
|
// 错误提示
|
||||||
|
alertError(content) {
|
||||||
|
MessageBox.alert(content, "系统提示", { type: 'error' })
|
||||||
|
},
|
||||||
|
// 成功提示
|
||||||
|
alertSuccess(content) {
|
||||||
|
MessageBox.alert(content, "系统提示", { type: 'success' })
|
||||||
|
},
|
||||||
|
// 警告提示
|
||||||
|
alertWarning(content) {
|
||||||
|
MessageBox.alert(content, "系统提示", { type: 'warning' })
|
||||||
|
},
|
||||||
|
// 通知提示
|
||||||
|
notify(content) {
|
||||||
|
Notification.info(content)
|
||||||
|
},
|
||||||
|
// 错误通知
|
||||||
|
notifyError(content) {
|
||||||
|
Notification.error(content);
|
||||||
|
},
|
||||||
|
// 成功通知
|
||||||
|
notifySuccess(content) {
|
||||||
|
Notification.success(content)
|
||||||
|
},
|
||||||
|
// 警告通知
|
||||||
|
notifyWarning(content) {
|
||||||
|
Notification.warning(content)
|
||||||
|
},
|
||||||
|
// 确认窗体
|
||||||
|
confirm(content) {
|
||||||
|
return MessageBox.confirm(content, "系统提示", {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 提交内容
|
||||||
|
prompt(content) {
|
||||||
|
return MessageBox.prompt(content, "系统提示", {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 打开遮罩层
|
||||||
|
loading(content) {
|
||||||
|
loadingInstance = Loading.service({
|
||||||
|
lock: true,
|
||||||
|
text: content,
|
||||||
|
spinner: "el-icon-loading",
|
||||||
|
background: "rgba(0, 0, 0, 0.7)",
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 关闭遮罩层
|
||||||
|
closeLoading() {
|
||||||
|
loadingInstance.close();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import Router from 'vue-router'
|
||||||
|
|
||||||
|
Vue.use(Router)
|
||||||
|
|
||||||
|
const constantRoutes = [
|
||||||
|
{
|
||||||
|
path: '/',
|
||||||
|
redirect: "home",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/home',
|
||||||
|
meta: {
|
||||||
|
title:'首页'
|
||||||
|
},
|
||||||
|
component: () => import("@/components/map.vue"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/parkinglot',
|
||||||
|
meta: {
|
||||||
|
title:'停车查询'
|
||||||
|
},
|
||||||
|
component: () => import("@/components/queryCar.vue"),
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
export default new Router({
|
||||||
|
// mode: 'history', // 去掉url中的#
|
||||||
|
scrollBehavior: () => ({ y: 0 }),
|
||||||
|
routes: constantRoutes
|
||||||
|
})
|
@ -0,0 +1,42 @@
|
|||||||
|
import Cookies from 'js-cookie'
|
||||||
|
|
||||||
|
const TokenKey = 'Admin-Token' // 自己的token
|
||||||
|
const Access = 'X-Access-Token' // test环境的token
|
||||||
|
const RobotToken = 'X-Access-token' // 测试环境的token
|
||||||
|
|
||||||
|
export function getToken() {
|
||||||
|
return Cookies.get(TokenKey)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function setToken(token) {
|
||||||
|
return Cookies.set(TokenKey, token, { expires: 7 })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function removeToken() {
|
||||||
|
return Cookies.remove(TokenKey)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getAccess() {
|
||||||
|
return Cookies.get(Access)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function setAccess(token) {
|
||||||
|
return Cookies.set(Access, token)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function removeAccess() {
|
||||||
|
return Cookies.remove(Access)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getRobot() {
|
||||||
|
return Cookies.get(RobotToken)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function setRobot(token) {
|
||||||
|
return Cookies.set(RobotToken, token)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function removeRobot() {
|
||||||
|
return Cookies.remove(RobotToken)
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
|||||||
|
export default {
|
||||||
|
'401': '认证失败,无法访问系统资源',
|
||||||
|
'403': '当前操作没有权限',
|
||||||
|
'404': '访问资源不存在',
|
||||||
|
'default': '系统未知错误,请反馈给管理员'
|
||||||
|
}
|