diff --git a/package.json b/package.json index e2217b6..f24ad11 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "url": "https://gitee.com/y_project/MuYu-Cloud.git" }, "dependencies": { + "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "0.4.0", "axios": "0.24.0", "clipboard": "2.0.8", diff --git a/src/api/system/car.js b/src/api/system/car.js new file mode 100644 index 0000000..e70df99 --- /dev/null +++ b/src/api/system/car.js @@ -0,0 +1,52 @@ +import request from '@/utils/request' + +// 查询部门列表 +export function listCar(data) { + return request({ + url: '/corpor/carList', + method: 'post', + data: data + }) +} + +export function addCar(data) { + return request({ + url: '/corpor/addCar', + method: 'post', + data: data + }) +} + +export function updateCar(data) { + return request({ + url: '/corpor/updateCar', + method: 'post', + data: data + }) +} + + +export function fenceList(data) { + return request({ + url: '/corpor/fenceList', + method: 'post', + data: data + }) +} + + +export function deleteCar(carId) { + return request({ + url: '/corpor/deleteCar/' + carId, + method: 'post', + }) +} + +export function ideList() { + return request({ + url: '/corpor/ideList', + method: 'get', + }) +} + + diff --git a/src/main.js b/src/main.js index 546f125..a2bb892 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,9 @@ import VueMeta from 'vue-meta' // 字典数据组件 import DictData from '@/components/DictData' +//高德地图 +import AMapLoader from "@amap/amap-jsapi-loader"; + // 全局方法挂载 Vue.prototype.getDicts = getDicts Vue.prototype.getConfigKey = getConfigKey @@ -84,3 +87,11 @@ new Vue({ store, render: h => h(App) }) + +AMapLoader.load({ + 'key':'bf67e6b110fda0875d19dcd528f2ee10', + 'version': '2.0',// + 'plugins':['AMap.Scale','AMap.GeoJSON'], +}).then((AMap)=>{ + Vue.use(AMap) +}) diff --git a/src/permission.js b/src/permission.js index 6034239..06a09f1 100644 --- a/src/permission.js +++ b/src/permission.js @@ -8,7 +8,7 @@ import {isRelogin} from '@/utils/request' NProgress.configure({showSpinner: false}) -const whiteList = ['/login', '/register'] +const whiteList = ['/login', '/register','/newPage'] router.beforeEach((to, from, next) => { NProgress.start() diff --git a/src/router/index.js b/src/router/index.js index 2afac71..94a8711 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -3,6 +3,9 @@ import Router from 'vue-router' /* Layout */ import Layout from '@/layout' + + + Vue.use(Router) /** @@ -27,6 +30,9 @@ Vue.use(Router) } */ + + + // 公共路由 export const constantRoutes = [ { @@ -73,6 +79,34 @@ export const constantRoutes = [ } ] }, + // { + // path: '/car', + // component: Layout, + // redirect: 'index', + // children: [ + // { + // path: 'index', + // component: () => import('@/views/system/car/index'), + // name: 'Index', + // meta: {title: '车辆管理', icon: 'dashboard', affix: true} + // } + // ] + // }, + + // { + // path: '/car', + // component: Layout, + // redirect: 'index', + // children: [ + // { + // path: 'map', + // component: () => import('@/views/system/car/map'), + // name: 'Index', + // meta: {title: '地图页面!', icon: 'dashboard', affix: true} + // } + // ] + // }, + { path: '/user', component: Layout, @@ -163,6 +197,9 @@ export const dynamicRoutes = [ } ] + + + // 防止连续点击多次路由报错 let routerPush = Router.prototype.push; let routerReplace = Router.prototype.replace; @@ -175,8 +212,12 @@ Router.prototype.replace = function push(location) { return routerReplace.call(this, location).catch(err => err) } + + + export default new Router({ mode: 'history', // 去掉url中的# scrollBehavior: () => ({y: 0}), - routes: constantRoutes + routes: constantRoutes, + }) diff --git a/src/utils/request.js b/src/utils/request.js index 47d1bcb..5345f75 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -73,7 +73,7 @@ service.interceptors.request.use(config => { // 响应拦截器 service.interceptors.response.use(res => { - debugger + // debugger // 未设置状态码则默认成功状态 const code = res.data.code || 200; // 获取错误信息 diff --git a/src/views/system/car/index.vue b/src/views/system/car/index.vue new file mode 100644 index 0000000..0438e89 --- /dev/null +++ b/src/views/system/car/index.vue @@ -0,0 +1,560 @@ + + + + diff --git a/src/views/system/logininfor/index.vue b/src/views/system/logininfor/index.vue index a9aaa39..b2e4eb9 100644 --- a/src/views/system/logininfor/index.vue +++ b/src/views/system/logininfor/index.vue @@ -106,7 +106,8 @@ @selection-change="handleSelectionChange" @sort-change="handleSortChange"> - diff --git a/src/views/system/operlog/index.vue b/src/views/system/operlog/index.vue index d109a26..f63dca0 100644 --- a/src/views/system/operlog/index.vue +++ b/src/views/system/operlog/index.vue @@ -125,7 +125,8 @@ - @@ -133,13 +134,15 @@ - -