Compare commits
5 Commits
f81ed63672
...
a338843889
Author | SHA1 | Date |
---|---|---|
|
a338843889 | |
|
873fad20eb | |
|
e4e10d63aa | |
|
8091b8da17 | |
|
169c182bf5 |
|
@ -36,7 +36,9 @@
|
||||||
"url": "https://gitee.com/y_project/MuYu-Cloud.git"
|
"url": "https://gitee.com/y_project/MuYu-Cloud.git"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@amap/amap-jsapi-loader": "^1.0.1",
|
||||||
"@riophae/vue-treeselect": "0.4.0",
|
"@riophae/vue-treeselect": "0.4.0",
|
||||||
|
"@types/echarts": "^4.9.22",
|
||||||
"axios": "0.24.0",
|
"axios": "0.24.0",
|
||||||
"clipboard": "2.0.8",
|
"clipboard": "2.0.8",
|
||||||
"core-js": "3.25.3",
|
"core-js": "3.25.3",
|
||||||
|
|
|
@ -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',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,77 @@
|
||||||
|
import request from "@/utils/request";
|
||||||
|
import fence from "@/views/system/fence/index.vue";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏列表
|
||||||
|
* @param data
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
export function fenceList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/corpor/fenceList',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增围栏
|
||||||
|
* @param data
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
export function fenceAdd(data) {
|
||||||
|
return request({
|
||||||
|
url: '/corpor/fenceAdd',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除围栏
|
||||||
|
* @param fenceId
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
export function fenceDelete(fenceId) {
|
||||||
|
return request({
|
||||||
|
url: '/corpor/fenceDelete/'+fenceId,
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改围栏
|
||||||
|
* @param data
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
export function fenceUpdate(data) {
|
||||||
|
return request({
|
||||||
|
url: '/corpor/fenceUpdate',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存围栏
|
||||||
|
*/
|
||||||
|
export function saveFence(data) {
|
||||||
|
return request({
|
||||||
|
url: '/corpor/saveFence',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标识列表
|
||||||
|
*/
|
||||||
|
export function identificationList() {
|
||||||
|
return request({
|
||||||
|
url: '/corpor/identificationList',
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
export function recordList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/corpor/recordList',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
12
src/main.js
12
src/main.js
|
@ -38,6 +38,9 @@ import VueMeta from 'vue-meta'
|
||||||
// 字典数据组件
|
// 字典数据组件
|
||||||
import DictData from '@/components/DictData'
|
import DictData from '@/components/DictData'
|
||||||
|
|
||||||
|
//高德地图
|
||||||
|
import AMapLoader from "@amap/amap-jsapi-loader";
|
||||||
|
|
||||||
// 全局方法挂载
|
// 全局方法挂载
|
||||||
Vue.prototype.getDicts = getDicts
|
Vue.prototype.getDicts = getDicts
|
||||||
Vue.prototype.getConfigKey = getConfigKey
|
Vue.prototype.getConfigKey = getConfigKey
|
||||||
|
@ -84,3 +87,12 @@ new Vue({
|
||||||
store,
|
store,
|
||||||
render: h => h(App)
|
render: h => h(App)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
AMapLoader.load({
|
||||||
|
'key': 'fcd296bbfa904e3bf49d7316882a11bf',
|
||||||
|
'version': '2.0', // 指定要加载的 JSAPI 的版本,缺少时默认为 1.4.15
|
||||||
|
'plugins': ['AMap.Scale','AMap.GeoJSON'] // 需要使用的的插件列表,如比例尺'AMap.Scale'等,更多插件请看官方文档
|
||||||
|
}).then((AMap) => {
|
||||||
|
Vue.use(AMap)
|
||||||
|
})
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {isRelogin} from '@/utils/request'
|
||||||
|
|
||||||
NProgress.configure({showSpinner: false})
|
NProgress.configure({showSpinner: false})
|
||||||
|
|
||||||
const whiteList = ['/login', '/register']
|
const whiteList = ['/login', '/register','/newPage']
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
NProgress.start()
|
NProgress.start()
|
||||||
|
|
|
@ -73,7 +73,7 @@ service.interceptors.request.use(config => {
|
||||||
|
|
||||||
// 响应拦截器
|
// 响应拦截器
|
||||||
service.interceptors.response.use(res => {
|
service.interceptors.response.use(res => {
|
||||||
debugger
|
// debugger
|
||||||
// 未设置状态码则默认成功状态
|
// 未设置状态码则默认成功状态
|
||||||
const code = res.data.code || 200;
|
const code = res.data.code || 200;
|
||||||
// 获取错误信息
|
// 获取错误信息
|
||||||
|
|
|
@ -0,0 +1,560 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<!-- {{ this.ident}}-->
|
||||||
|
|
||||||
|
|
||||||
|
<div v-if="showMapp">
|
||||||
|
<el-button @click="add()">新增</el-button>
|
||||||
|
|
||||||
|
|
||||||
|
<h1>查询</h1>
|
||||||
|
<el-form :inline="true" :model="car" class="demo-form-inline">
|
||||||
|
|
||||||
|
<el-form-item label="车辆VIN">
|
||||||
|
<el-input v-model="car.carNumber" placeholder="请输入车辆VIN"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="车辆类型">
|
||||||
|
<el-select v-model="car.carType" placeholder="请选择车辆类型">
|
||||||
|
<el-option label="中型轿车" value="中型轿车"></el-option>
|
||||||
|
<el-option label="跑车" value="跑车"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="电子围栏Id">
|
||||||
|
<el-input v-model="car.fenceId" placeholder="请输入电子围栏Id"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="车辆状态">
|
||||||
|
<el-select v-model="car.carState" placeholder="请选择车辆状态">
|
||||||
|
<el-option label="在线" value="1"></el-option>
|
||||||
|
<el-option label="离线" value="2"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="电机厂商">
|
||||||
|
<el-input v-model="car.carMachine" placeholder="请输入电机厂商"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="电池厂商">
|
||||||
|
<el-input v-model="car.carBattery" placeholder="请输入电池厂商"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="电机编号">
|
||||||
|
<el-input v-model="car.carMachineNumber" placeholder="请输入电机编号"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="电池编号">
|
||||||
|
<el-input v-model="car.carBatteryNumber" placeholder="请输入电池编号"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="onSubmit">查询</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
|
||||||
|
<h1>车辆列表</h1>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
:data="tableData"
|
||||||
|
style="width: 100%">
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="车辆Id"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.carId }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="车辆VIN"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.carNumber }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="车辆类型"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.carType }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="电子围栏Id"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.fenceName }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="车辆状态"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag type="warning" v-if="scope.row.carState==1">在线</el-tag>
|
||||||
|
<el-tag type="danger" v-if="scope.row.carState==2">离线</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="电机厂商"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.carMachine }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="电池厂商"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.carBattery }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="电机编号"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.carMachineNumber }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="电池编号"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.carBatteryNumber }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
@click="handleEdit1(scope.row)" v-if="scope.row.carState==2" disabled>实时轨迹
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
@click="handleEdit1(scope.row.carNumber)" v-if="scope.row.carState==1">实时轨迹
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
@click="handleEdit(scope.row)">编辑
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.carId)">删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<h1>分页</h1>
|
||||||
|
|
||||||
|
|
||||||
|
<el-pagination
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
:current-page="car.pageNum"
|
||||||
|
:page-sizes="[1, 2, 10, 15]"
|
||||||
|
:page-size="car.pageSize"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="total">
|
||||||
|
</el-pagination>
|
||||||
|
|
||||||
|
|
||||||
|
<!--新增车辆-->
|
||||||
|
|
||||||
|
<el-dialog :title="title" :visible.sync="dialogFormVisible">
|
||||||
|
<el-form :model="cars">
|
||||||
|
|
||||||
|
<el-form-item label="车辆VIN" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="cars.carNumber" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="车辆类型" :label-width="formLabelWidth">
|
||||||
|
<el-select v-model="cars.carType" placeholder="请选择车辆类型">
|
||||||
|
<el-option label="跑车" value="跑车"></el-option>
|
||||||
|
<el-option label="面包车" value="面包车"></el-option>
|
||||||
|
<el-option label="大汽车" value="大汽车"></el-option>
|
||||||
|
<el-option label="轿车" value="轿车"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="电子围栏Id" :label-width="formLabelWidth">
|
||||||
|
<el-select v-model="cars.fenceId" placeholder="请选择车辆电子围栏Id">
|
||||||
|
<el-option v-for="item in fence" :label="item.fenceName" :value="item.fenceId"
|
||||||
|
:key="item.fenceId"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="车辆状态" :label-width="formLabelWidth">
|
||||||
|
<el-select v-model="cars.carState" placeholder="请选择车辆状态">
|
||||||
|
<el-option label="在线" value="1"></el-option>
|
||||||
|
<el-option label="离线" value="2"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="电机厂商" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="cars.carMachine" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="电池厂商" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="cars.carBattery" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="电机编号" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="cars.carMachineNumber" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="电池编号" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="cars.carBatteryNumber" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="标识名称" :label-width="formLabelWidth">
|
||||||
|
<el-checkbox-group v-model="cars.identificationId">
|
||||||
|
<el-checkbox
|
||||||
|
v-for="item in ident"
|
||||||
|
:label="item.identificationId"
|
||||||
|
:key="item.identificationId"
|
||||||
|
>
|
||||||
|
{{ item.identificationLog }}
|
||||||
|
</el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
{{cars}}
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="qd()">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
<!--修改车辆-->
|
||||||
|
|
||||||
|
<el-dialog :title="title" :visible.sync="dialogFormVisible1">
|
||||||
|
<el-form :model="carss">
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="车辆Id" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="carss.carId" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="车辆VIN" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="carss.carNumber" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="车辆类型" :label-width="formLabelWidth">
|
||||||
|
<el-select v-model="carss.carType" placeholder="请选择车辆类型">
|
||||||
|
<el-option label="跑车" value="跑车"></el-option>
|
||||||
|
<el-option label="面包车" value="面包车"></el-option>
|
||||||
|
<el-option label="大汽车" value="大汽车"></el-option>
|
||||||
|
<el-option label="轿车" value="轿车"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="电子围栏Id" :label-width="formLabelWidth">
|
||||||
|
<el-select v-model="carss.fenceId" placeholder="请选择车辆电子围栏Id">
|
||||||
|
<el-option v-for="item in fence" :label="item.fenceName" :value="item.fenceId"
|
||||||
|
:key="item.fenceId"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="车辆状态" :label-width="formLabelWidth">
|
||||||
|
<el-select v-model="carss.carState" placeholder="请选择车辆状态">
|
||||||
|
<el-option label="在线" value="1"></el-option>
|
||||||
|
<el-option label="离线" value="2"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="电机厂商" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="carss.carMachine" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="电池厂商" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="carss.carBattery" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="电机编号" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="carss.carMachineNumber" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="电池编号" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="carss.carBatteryNumber" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="xg()">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="display: flex; justify-content: center;">
|
||||||
|
<div v-if="showMap" style="font-size: 20px;">
|
||||||
|
车辆轨迹:{{vin}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="mapContainer" v-if="showMap">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||||
|
//例如:import 《组件名称》 from '《组件路径》,
|
||||||
|
import {addCar, deleteCar, fenceList, ideList, listCar, updateCar} from "@/api/system/car";
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
|
components: {},
|
||||||
|
props: {},
|
||||||
|
data() {
|
||||||
|
//这里存放数据"
|
||||||
|
|
||||||
|
return {
|
||||||
|
tableData: [],
|
||||||
|
car: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 3,
|
||||||
|
|
||||||
|
},
|
||||||
|
total: 0,
|
||||||
|
fence: [],
|
||||||
|
fence1: {},
|
||||||
|
dialogFormVisible: false,
|
||||||
|
dialogFormVisible1: false,
|
||||||
|
formLabelWidth: "120px",
|
||||||
|
title: '',
|
||||||
|
|
||||||
|
cars: {
|
||||||
|
identificationId : [],
|
||||||
|
},
|
||||||
|
carss:{
|
||||||
|
},
|
||||||
|
//地图
|
||||||
|
showMap: false,
|
||||||
|
showMapp: true,
|
||||||
|
//高德地图
|
||||||
|
map: null,
|
||||||
|
key: 'bf67e6b110fda0875d19dcd528f2ee10',
|
||||||
|
searchInput: '',
|
||||||
|
//标识表
|
||||||
|
ident: [],
|
||||||
|
vin:'',
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//计算属性 类似于data概念",
|
||||||
|
computed: {},
|
||||||
|
//监控data中的数据变化",
|
||||||
|
watch: {},
|
||||||
|
//方法集合",
|
||||||
|
methods: {
|
||||||
|
list() {
|
||||||
|
listCar(this.car).then(
|
||||||
|
res => {
|
||||||
|
this.tableData = res.data.list;
|
||||||
|
this.total = res.data.total;
|
||||||
|
console.log(this.tableData);
|
||||||
|
console.log(res);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
onSubmit() {
|
||||||
|
this.list();
|
||||||
|
},
|
||||||
|
handleSizeChange(val) {
|
||||||
|
this.car.pageSize = val;
|
||||||
|
this.list();
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.car.pageNum = val;
|
||||||
|
this.list();
|
||||||
|
},
|
||||||
|
add() {
|
||||||
|
// this.cars={};
|
||||||
|
this.dialogFormVisible = true;
|
||||||
|
this.title = "新增车辆";
|
||||||
|
},
|
||||||
|
qd() {
|
||||||
|
addCar(this.cars).then(
|
||||||
|
res => {
|
||||||
|
this.$message.success(res.data)
|
||||||
|
this.list();
|
||||||
|
console.log(this.cars);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
this.dialogFormVisible = false;
|
||||||
|
this.cars={};
|
||||||
|
this.cars.identificationId=[];
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
list1() {
|
||||||
|
fenceList(this.fence1).then(
|
||||||
|
res => {
|
||||||
|
this.fence = res.data.list;
|
||||||
|
console.log(res);
|
||||||
|
console.log(this.fence)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
handleEdit(obj) {
|
||||||
|
this.dialogFormVisible1 = true;
|
||||||
|
this.title = "修改车辆";
|
||||||
|
this.carss = obj;
|
||||||
|
},
|
||||||
|
xg() {
|
||||||
|
updateCar(this.carss).then(
|
||||||
|
res => {
|
||||||
|
this.$message.success(res.data)
|
||||||
|
this.list();
|
||||||
|
console.log(this.carss);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
this.dialogFormVisible1 = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
handleDelete(carId) {
|
||||||
|
deleteCar(carId).then(
|
||||||
|
res => {
|
||||||
|
this.$message.success(res.data)
|
||||||
|
this.list()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
handleEdit1(aa) {
|
||||||
|
this.showMap = true;
|
||||||
|
this.showMapp = false;
|
||||||
|
this.initMap();
|
||||||
|
this.vin = aa;
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
//地图
|
||||||
|
initMap() {
|
||||||
|
const url = `https://webapi.amap.com/maps?v=1.4.15&key=${this.key}`;
|
||||||
|
const jsapi = document.createElement('script');
|
||||||
|
jsapi.charset = 'utf-8';
|
||||||
|
jsapi.src = url;
|
||||||
|
document.head.appendChild(jsapi);
|
||||||
|
|
||||||
|
jsapi.onload = () => {
|
||||||
|
this.map = new window.AMap.Map('mapContainer', {
|
||||||
|
zoom: 13,
|
||||||
|
center: [113.22, 22.93] // 深圳的经纬度
|
||||||
|
});
|
||||||
|
|
||||||
|
// 创建车辆图标
|
||||||
|
const carIcon = new AMap.Icon({
|
||||||
|
size: new AMap.Size(50, 25),
|
||||||
|
image: 'https://webapi.amap.com/images/car.png',
|
||||||
|
imageSize: new AMap.Size(50, 25)
|
||||||
|
});
|
||||||
|
|
||||||
|
// 创建车辆覆盖物
|
||||||
|
const carMarker = new AMap.Marker({
|
||||||
|
position: [113.22, 22.93],
|
||||||
|
icon: carIcon,
|
||||||
|
offset: new AMap.Pixel(-16, -16),
|
||||||
|
autoRotation: true
|
||||||
|
});
|
||||||
|
|
||||||
|
// 将车辆覆盖物添加到地图
|
||||||
|
this.map.add(carMarker);
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ideList1() {
|
||||||
|
ideList().then(
|
||||||
|
res => {
|
||||||
|
this.ident = res.data;
|
||||||
|
console.log(this.ident);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
|
created() {
|
||||||
|
|
||||||
|
this.list();
|
||||||
|
this.ideList1();
|
||||||
|
this.list1();
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||||
|
mounted() {
|
||||||
|
//初始化地图
|
||||||
|
this.initMap();
|
||||||
|
},
|
||||||
|
beforeCreate() {
|
||||||
|
}, //生命周期 - 创建之前",
|
||||||
|
beforeMount() {
|
||||||
|
}, //生命周期 - 挂载之前",
|
||||||
|
beforeUpdate() {
|
||||||
|
}, //生命周期 - 更新之前",
|
||||||
|
updated() {
|
||||||
|
}, //生命周期 - 更新之后",
|
||||||
|
beforeDestroy() {
|
||||||
|
}, //生命周期 - 销毁之前",
|
||||||
|
destroyed() {
|
||||||
|
}, //生命周期 - 销毁完成",
|
||||||
|
activated() {
|
||||||
|
} //如果页面有keep-alive缓存功能,这个函数会触发",
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
#mapContainer {
|
||||||
|
width: 25%;
|
||||||
|
height: 450px;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,518 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
|
||||||
|
<div v-if="showMapp">
|
||||||
|
<el-form :inline="true" :model="fence" class="demo-form-inline">
|
||||||
|
|
||||||
|
<el-form-item label="围栏名称">
|
||||||
|
<el-input v-model="fence.fenceName" placeholder="模糊查询围栏名称"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="围栏类型">
|
||||||
|
<el-select v-model="fence.fenceType" placeholder="请选择围栏类型">
|
||||||
|
<el-option label="驶出" value="1">驶出</el-option>
|
||||||
|
<el-option label="驶入" value="2">驶入</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="围栏状态">
|
||||||
|
<el-select v-model="fence.fenceState" placeholder="请选择围栏状态">
|
||||||
|
<el-option label="正常" value="1">正常</el-option>
|
||||||
|
<el-option label="停用" value="2">停用</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="onSubmit" icon="el-icon-search">搜索</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-button type="primary" plain icon="el-icon-plus" @click="fencadd">新增</el-button>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-table :data="tableData" style="width: 100%" ref="multipleTable" @selection-change="handleSelectionChange">
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
type="selection"
|
||||||
|
width="55">
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="围栏ID"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.fenceId }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="围栏名称"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.fenceName }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="围栏类型"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px" v-if="scope.row.fenceType==1">驶出</span>
|
||||||
|
<span style="margin-left: 10px" v-if="scope.row.fenceType==2">驶入</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="围栏状态"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px" v-if="scope.row.fenceState==1"><el-tag>正常</el-tag></span>
|
||||||
|
<span style="margin-left: 10px" v-if="scope.row.fenceState==2"><el-tag>停用</el-tag></span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="经纬度信息"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.fenceMessage }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link type="primary" icon="el-icon-map-location" @click="handleWdit(scope.row)">编辑围栏</el-link>
|
||||||
|
|
||||||
|
<el-link type="primary" icon="el-icon-edit" @click="handleEdit(scope.row)">编辑</el-link>
|
||||||
|
|
||||||
|
<el-link type="primary" icon="el-icon-delete" @click="handleDelete(scope.row.fenceId)">删除</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-pagination
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
:current-page="fence.pageNum"
|
||||||
|
:page-sizes="[1, 3, 5, 10]"
|
||||||
|
:page-size="fence.pageSize"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="total">
|
||||||
|
</el-pagination>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 围栏添加-->
|
||||||
|
<el-dialog :title="title" :visible.sync="dialogFormVisible">
|
||||||
|
|
||||||
|
<el-form :model="fencesw">
|
||||||
|
|
||||||
|
<el-form-item label="围栏名称" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="fencesw.fenceName" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="围栏类型" :label-width="formLabelWidth">
|
||||||
|
<el-select v-model="fencesw.fenceType" placeholder="请选择活动区域">
|
||||||
|
<el-option label="驶出" value="1">驶出</el-option>
|
||||||
|
<el-option label="驶入" value="2">驶入</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="围栏状态" :label-width="formLabelWidth">
|
||||||
|
<template>
|
||||||
|
<el-radio v-model="fencesw.fenceState" label="1">正常</el-radio>
|
||||||
|
<el-radio v-model="fencesw.fenceState" label="2">停用</el-radio>
|
||||||
|
</template>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="标识名称" :label-width="formLabelWidth">
|
||||||
|
<el-checkbox-group v-model="fencesw.identificationId">
|
||||||
|
<el-checkbox
|
||||||
|
v-for="item in ident"
|
||||||
|
:key="item.identificationId"
|
||||||
|
:label="item.identificationId"
|
||||||
|
:value="item.identificationId">
|
||||||
|
{{ item.identificationLog }}
|
||||||
|
</el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="addAll">新增</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 修改电子围栏-->
|
||||||
|
<el-dialog :title="title" :visible.sync="dialogFormVisible1">
|
||||||
|
|
||||||
|
<el-form :model="fences">
|
||||||
|
|
||||||
|
<el-form-item label="围栏ID" :label-width="formLabelWidth1">
|
||||||
|
<el-input v-model="fences.fenceId" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="围栏名称" :label-width="formLabelWidth1">
|
||||||
|
<el-input v-model="fences.fenceName" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="围栏类型" :label-width="formLabelWidth1">
|
||||||
|
<el-select v-model="fences.fenceType" placeholder="请选择活动区域">
|
||||||
|
<el-option label="驶出" value="1">驶出</el-option>
|
||||||
|
<el-option label="驶入" value="2">驶入</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="围栏状态">
|
||||||
|
<el-radio-group v-model="fences.fenceState" :label-width="formLabelWidth1">
|
||||||
|
<el-radio :label="1">正常</el-radio>
|
||||||
|
<el-radio :label="2">停用</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="updateAll">修 改</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<el-button @click="drawPolygon">绘制围栏</el-button>
|
||||||
|
<el-button @click="saveFenceData">保存围栏</el-button>
|
||||||
|
<el-button @click="cleanFence">清除围栏</el-button>
|
||||||
|
<div id="container" v-if="showMap">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import AMapLoader from '@amap/amap-jsapi-loader';
|
||||||
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||||
|
//例如:import 《组件名称》 from '《组件路径》,
|
||||||
|
import {fenceAdd, fenceDelete, fenceList, fenceUpdate, identificationList, saveFence} from "@/api/system/fence";
|
||||||
|
import mouseTool from "quill";
|
||||||
|
export default {
|
||||||
|
name: "map-view",
|
||||||
|
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||||
|
mounted() {
|
||||||
|
this.initAMap();
|
||||||
|
isMapPage:false
|
||||||
|
},
|
||||||
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
|
components: {},
|
||||||
|
props: {},
|
||||||
|
data() {
|
||||||
|
//这里存放数据"
|
||||||
|
|
||||||
|
return {
|
||||||
|
tableData:[],
|
||||||
|
fence:{
|
||||||
|
pageNum:1,
|
||||||
|
pageSize:3,
|
||||||
|
fenceName:'',
|
||||||
|
},
|
||||||
|
total:0,
|
||||||
|
dialogFormVisible:false,
|
||||||
|
formLabelWidth:'120px',
|
||||||
|
fencesw:{
|
||||||
|
fenceName:'',
|
||||||
|
fenceType:'',
|
||||||
|
fenceState:'',
|
||||||
|
identificationId:[]
|
||||||
|
},
|
||||||
|
fences:{
|
||||||
|
fenceId:'',
|
||||||
|
fenceName:'',
|
||||||
|
fenceType:'',
|
||||||
|
fenceState:'',
|
||||||
|
identificationId:[],
|
||||||
|
},
|
||||||
|
title:'',
|
||||||
|
dialogFormVisible1:false,
|
||||||
|
formLabelWidth1:'120px',
|
||||||
|
mouseTool:null,
|
||||||
|
map:null,
|
||||||
|
Amap:null,
|
||||||
|
|
||||||
|
//跳转地图页面
|
||||||
|
showMap:false,
|
||||||
|
showMapp:true,
|
||||||
|
|
||||||
|
|
||||||
|
//保存围栏
|
||||||
|
mapRequest:{
|
||||||
|
fenceId:0,
|
||||||
|
jwd: []
|
||||||
|
},
|
||||||
|
|
||||||
|
//标识表
|
||||||
|
ident:[],
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//计算属性 类似于data概念",
|
||||||
|
computed: {},
|
||||||
|
//监控data中的数据变化",
|
||||||
|
watch: {},
|
||||||
|
|
||||||
|
unmounted(){
|
||||||
|
this.map?.destroy()
|
||||||
|
},
|
||||||
|
//方法集合",
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
//围栏列表
|
||||||
|
list() {
|
||||||
|
fenceList(this.fence).then(
|
||||||
|
res => {
|
||||||
|
this.tableData = res.data.list
|
||||||
|
this.total = res.data.total
|
||||||
|
console.log(this.tableData);
|
||||||
|
console.log(res)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
|
||||||
|
// //复选框
|
||||||
|
handleSelectionChange(val) {
|
||||||
|
this.multipleSelection = val;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 搜索框
|
||||||
|
onSubmit() {
|
||||||
|
this.list()
|
||||||
|
},
|
||||||
|
|
||||||
|
//分页查询
|
||||||
|
handleSizeChange(val) {
|
||||||
|
this.fence.pageSize = val
|
||||||
|
this.list()
|
||||||
|
},
|
||||||
|
|
||||||
|
//分页查询
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.fence.pageNum = val
|
||||||
|
this.list()
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
//新增
|
||||||
|
fencadd() {
|
||||||
|
this.fences = {}
|
||||||
|
this.dialogFormVisible = true
|
||||||
|
this.title = '新增页面'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
addAll() {
|
||||||
|
fenceAdd(this.fencesw).then(
|
||||||
|
res => {
|
||||||
|
this.$message.success(res.msg)
|
||||||
|
this.list()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
this.dialogFormVisible = false
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
//删除电子围栏
|
||||||
|
handleDelete(fenceId){
|
||||||
|
fenceDelete(fenceId,'deleted').then(
|
||||||
|
res=>{
|
||||||
|
this.$message.success(res.msg)
|
||||||
|
this.list()
|
||||||
|
}
|
||||||
|
).catch(error=>{
|
||||||
|
console.error("逻辑删除失败",error);
|
||||||
|
this.$message.success("逻辑删除失败,请重试")
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//修改电子围栏
|
||||||
|
handleEdit(obj) {
|
||||||
|
this.dialogFormVisible1 = true
|
||||||
|
this.fences = obj
|
||||||
|
this.title = '修改电子围栏'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
updateAll() {
|
||||||
|
fenceUpdate(this.fences).then(
|
||||||
|
res => {
|
||||||
|
this.$message.success(res.msg)
|
||||||
|
this.list()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
this.dialogFormVisible1=false;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//编辑围栏
|
||||||
|
handleWdit(ojb) {
|
||||||
|
this.showMap=true
|
||||||
|
this.showMapp=false
|
||||||
|
this.mapRequest.fenceId=ojb.fenceId
|
||||||
|
this.initAMap();
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
//初始化地图
|
||||||
|
initAMap(){
|
||||||
|
|
||||||
|
|
||||||
|
AMapLoader.load({
|
||||||
|
|
||||||
|
key:"fcd296bbfa904e3bf49d7316882a11bf",
|
||||||
|
version:"2.0",
|
||||||
|
plugins:["AMap.Scale","AMap.MouseTool"],
|
||||||
|
})
|
||||||
|
.then((AMap)=>{
|
||||||
|
this._Amap=AMap;
|
||||||
|
this.map=new AMap.Map("container",{
|
||||||
|
//设置地图容器ID
|
||||||
|
viewMode:"3D",
|
||||||
|
zoom:11,
|
||||||
|
center: [116.397428, 39.90923],
|
||||||
|
});
|
||||||
|
this.mouseTool=new AMap.MouseTool(this.map);
|
||||||
|
this.mouseTool.on('draw', this.drawReady)
|
||||||
|
})
|
||||||
|
.catch((e)=>{
|
||||||
|
console.log(e);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
drawPolygon () {
|
||||||
|
this.mouseTool.polygon({
|
||||||
|
strokeColor: "#FF33FF",
|
||||||
|
strokeOpacity: 1,
|
||||||
|
strokeWeight: 6,
|
||||||
|
strokeOpacity: 0.2,
|
||||||
|
fillColor: '#1791fc',
|
||||||
|
fillOpacity: 0.4,
|
||||||
|
// 线样式还支持 'dashed'
|
||||||
|
strokeStyle: "solid",
|
||||||
|
// strokeStyle是dashed时有效
|
||||||
|
strokeDasharray: [30,10],
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 在 drawReady 方法中获取绘制的围栏的经纬度信息
|
||||||
|
drawReady(event){
|
||||||
|
console.log(event)
|
||||||
|
console.log(event.obj.getPath())
|
||||||
|
this.mapRequest.jwd=event.obj.getPath();
|
||||||
|
console.info('覆盖物对象绘制完成')
|
||||||
|
// 获取绘制的围栏经纬度信息
|
||||||
|
const path =event.obj.getPath()
|
||||||
|
// 将经纬度信息保存到 scope.row.fenceMessage 中
|
||||||
|
this.tableData.forEach(item=>{
|
||||||
|
if(item.fenceId === event.obj.fenceId){ // 假设 fenceId 是围栏的唯一标识符
|
||||||
|
item.fenceMessage = path.toString(); // 这里使用 toString() 方法将路径转换为字符串形式
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
//清除围栏
|
||||||
|
cleanFence(){
|
||||||
|
this.mouseTool.close(true)
|
||||||
|
},
|
||||||
|
|
||||||
|
//保存围栏
|
||||||
|
saveFenceData(){
|
||||||
|
console.log(this.mapRequest.jwd)
|
||||||
|
saveFence(this.mapRequest).then(response=>{
|
||||||
|
this.$modal.msgSuccess("保存成功")
|
||||||
|
})
|
||||||
|
this.showMap=false
|
||||||
|
this.showMapp=true
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
//标识列表
|
||||||
|
identificationList(){
|
||||||
|
identificationList().then(res=>{
|
||||||
|
this.ident=res
|
||||||
|
console.log(this.ident)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
|
created() {
|
||||||
|
this.list()
|
||||||
|
this.identificationList();
|
||||||
|
},
|
||||||
|
beforeCreate() {
|
||||||
|
}, //生命周期 - 创建之前",
|
||||||
|
beforeMount() {
|
||||||
|
}, //生命周期 - 挂载之前",
|
||||||
|
beforeUpdate() {
|
||||||
|
}, //生命周期 - 更新之前",
|
||||||
|
updated() {
|
||||||
|
}, //生命周期 - 更新之后",
|
||||||
|
beforeDestroy() {
|
||||||
|
}, //生命周期 - 销毁之前",
|
||||||
|
destroyed() {
|
||||||
|
}, //生命周期 - 销毁完成",
|
||||||
|
activated() {
|
||||||
|
} //如果页面有keep-alive缓存功能,这个函数会触发",
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.dashboard{
|
||||||
|
&-container{
|
||||||
|
margin: 30px;
|
||||||
|
}
|
||||||
|
&-text{
|
||||||
|
font-size:30px;
|
||||||
|
line-height:46px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#container{
|
||||||
|
|
||||||
|
padding:0px;
|
||||||
|
margin:0px;
|
||||||
|
width:100%;
|
||||||
|
height:800px;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -106,7 +106,8 @@
|
||||||
@selection-change="handleSelectionChange" @sort-change="handleSortChange">
|
@selection-change="handleSelectionChange" @sort-change="handleSortChange">
|
||||||
<el-table-column align="center" type="selection" width="55"/>
|
<el-table-column align="center" type="selection" width="55"/>
|
||||||
<el-table-column align="center" label="访问编号" prop="infoId"/>
|
<el-table-column align="center" label="访问编号" prop="infoId"/>
|
||||||
<el-table-column :show-overflow-tooltip="true" :sort-orders="['descending', 'ascending']" align="center" label="用户名称" prop="userName"
|
<el-table-column :show-overflow-tooltip="true" :sort-orders="['descending', 'ascending']" align="center"
|
||||||
|
label="用户名称" prop="userName"
|
||||||
sortable="custom"/>
|
sortable="custom"/>
|
||||||
<el-table-column :show-overflow-tooltip="true" align="center" label="地址" prop="ipaddr" width="130"/>
|
<el-table-column :show-overflow-tooltip="true" align="center" label="地址" prop="ipaddr" width="130"/>
|
||||||
<el-table-column align="center" label="登录状态" prop="status">
|
<el-table-column align="center" label="登录状态" prop="status">
|
||||||
|
|
|
@ -125,7 +125,8 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="请求方式" prop="requestMethod"/>
|
<el-table-column align="center" label="请求方式" prop="requestMethod"/>
|
||||||
<el-table-column :show-overflow-tooltip="true" :sort-orders="['descending', 'ascending']" align="center" label="操作人员" prop="operName"
|
<el-table-column :show-overflow-tooltip="true" :sort-orders="['descending', 'ascending']" align="center"
|
||||||
|
label="操作人员" prop="operName"
|
||||||
sortable="custom" width="110"/>
|
sortable="custom" width="110"/>
|
||||||
<el-table-column :show-overflow-tooltip="true" align="center" label="操作地址" prop="operIp" width="130"/>
|
<el-table-column :show-overflow-tooltip="true" align="center" label="操作地址" prop="operIp" width="130"/>
|
||||||
<el-table-column align="center" label="操作状态" prop="status">
|
<el-table-column align="center" label="操作状态" prop="status">
|
||||||
|
@ -133,13 +134,15 @@
|
||||||
<dict-tag :options="dict.type.sys_common_status" :value="scope.row.status"/>
|
<dict-tag :options="dict.type.sys_common_status" :value="scope.row.status"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :sort-orders="['descending', 'ascending']" align="center" label="操作日期" prop="operTime" sortable="custom"
|
<el-table-column :sort-orders="['descending', 'ascending']" align="center" label="操作日期" prop="operTime"
|
||||||
|
sortable="custom"
|
||||||
width="180">
|
width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.operTime) }}</span>
|
<span>{{ parseTime(scope.row.operTime) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :show-overflow-tooltip="true" :sort-orders="['descending', 'ascending']" align="center" label="消耗时间" prop="costTime"
|
<el-table-column :show-overflow-tooltip="true" :sort-orders="['descending', 'ascending']" align="center"
|
||||||
|
label="消耗时间" prop="costTime"
|
||||||
sortable="custom" width="110">
|
sortable="custom" width="110">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ scope.row.costTime }}毫秒</span>
|
<span>{{ scope.row.costTime }}毫秒</span>
|
||||||
|
|
|
@ -0,0 +1,222 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<h1>车辆记录管理</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 条件查询-->
|
||||||
|
<el-form :inline="true" :model="record" class="demo-form-inline">
|
||||||
|
|
||||||
|
<el-form-item label="VIN">
|
||||||
|
<el-input v-model="record.recordName" placeholder="审批人"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="开始时间">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="record.recordDateStart"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="选择日期时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="结束时间">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="record.recordDateEnd"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="选择日期时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="onSubmit" icon="el-icon-search">搜索</el-button>
|
||||||
|
<el-button @click="reset" icon="el-icon-refresh-left">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 记录车辆列表-->
|
||||||
|
<el-table :data="tableData" style="width: 100%">
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="车辆记录ID"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.recordId }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="VIN"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.recordName }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="开始时间"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.recordDateStart }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="结束时间"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.recordDateEnd }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link type="primary" icon="el-icon-map-location" @click="historicaltrack">历史轨迹</el-link>
|
||||||
|
<el-link type="primary" icon="el-icon-delete" @click="del">删除</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 分页查询-->
|
||||||
|
<el-pagination
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
:current-page="record.pageNum"
|
||||||
|
:page-sizes="[1, 3, 10, 20]"
|
||||||
|
:page-size="record.pageSize"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="total">
|
||||||
|
</el-pagination>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||||
|
//例如:import 《组件名称》 from '《组件路径》,
|
||||||
|
import axios from "axios";
|
||||||
|
import {recordList} from "@/api/system/record";
|
||||||
|
import {resetForm} from "@/utils/muyu";
|
||||||
|
export default {
|
||||||
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
|
components: {axios},
|
||||||
|
props: {},
|
||||||
|
data() {
|
||||||
|
//这里存放数据"
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
tableData:[],
|
||||||
|
record:{
|
||||||
|
recordName:'',
|
||||||
|
recordDateStart:'',
|
||||||
|
recordDateEnd:'',
|
||||||
|
pageNum:1,
|
||||||
|
pageSize:5
|
||||||
|
},
|
||||||
|
total:0,
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//计算属性 类似于data概念",
|
||||||
|
computed: {},
|
||||||
|
//监控data中的数据变化",
|
||||||
|
watch: {},
|
||||||
|
//方法集合",
|
||||||
|
methods: {
|
||||||
|
resetForm,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆记录列表
|
||||||
|
*/
|
||||||
|
list(){
|
||||||
|
recordList(this.record).then(
|
||||||
|
res=>{
|
||||||
|
this.tableData=res.data.list
|
||||||
|
this.total=res.data.total
|
||||||
|
console.log(this.tableData)
|
||||||
|
console.log(res)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 条件查询
|
||||||
|
*/
|
||||||
|
onSubmit(){
|
||||||
|
this.list()
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 条件重置
|
||||||
|
*/
|
||||||
|
reset(){
|
||||||
|
//重置表单
|
||||||
|
this.record.recordName=''
|
||||||
|
this.record.recordDateStart=''
|
||||||
|
this.record.recordDateEnd=''
|
||||||
|
this.list()
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*/
|
||||||
|
handleSizeChange(val){
|
||||||
|
this.record.pageSize=val
|
||||||
|
this.list()
|
||||||
|
},
|
||||||
|
handleCurrentChange(val){
|
||||||
|
this.record.pageNum=val
|
||||||
|
this.list()
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 历史轨迹
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
|
created() {
|
||||||
|
this.list()
|
||||||
|
},
|
||||||
|
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
beforeCreate() {
|
||||||
|
}, //生命周期 - 创建之前",
|
||||||
|
beforeMount() {
|
||||||
|
}, //生命周期 - 挂载之前",
|
||||||
|
beforeUpdate() {
|
||||||
|
}, //生命周期 - 更新之前",
|
||||||
|
updated() {
|
||||||
|
}, //生命周期 - 更新之后",
|
||||||
|
beforeDestroy() {
|
||||||
|
}, //生命周期 - 销毁之前",
|
||||||
|
destroyed() {
|
||||||
|
}, //生命周期 - 销毁完成",
|
||||||
|
activated() {
|
||||||
|
} //如果页面有keep-alive缓存功能,这个函数会触发",
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -17,7 +17,8 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<h4 class="form-header h4">角色信息</h4>
|
<h4 class="form-header h4">角色信息</h4>
|
||||||
<el-table ref="table" v-loading="loading" :data="roles.slice((pageNum-1)*pageSize,pageNum*pageSize)" :row-key="getRowKey"
|
<el-table ref="table" v-loading="loading" :data="roles.slice((pageNum-1)*pageSize,pageNum*pageSize)"
|
||||||
|
:row-key="getRowKey"
|
||||||
@row-click="clickRow" @selection-change="handleSelectionChange">
|
@row-click="clickRow" @selection-change="handleSelectionChange">
|
||||||
<el-table-column align="center" label="序号" type="index">
|
<el-table-column align="center" label="序号" type="index">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
|
@ -149,11 +149,14 @@
|
||||||
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column align="center" type="selection" width="50"/>
|
<el-table-column align="center" type="selection" width="50"/>
|
||||||
<el-table-column v-if="columns[0].visible" key="userId" align="center" label="用户编号" prop="userId"/>
|
<el-table-column v-if="columns[0].visible" key="userId" align="center" label="用户编号" prop="userId"/>
|
||||||
<el-table-column v-if="columns[1].visible" key="userName" :show-overflow-tooltip="true" align="center" label="用户名称"
|
<el-table-column v-if="columns[1].visible" key="userName" :show-overflow-tooltip="true" align="center"
|
||||||
|
label="用户名称"
|
||||||
prop="userName"/>
|
prop="userName"/>
|
||||||
<el-table-column v-if="columns[2].visible" key="nickName" :show-overflow-tooltip="true" align="center" label="用户昵称"
|
<el-table-column v-if="columns[2].visible" key="nickName" :show-overflow-tooltip="true" align="center"
|
||||||
|
label="用户昵称"
|
||||||
prop="nickName"/>
|
prop="nickName"/>
|
||||||
<el-table-column v-if="columns[3].visible" key="deptName" :show-overflow-tooltip="true" align="center" label="部门"
|
<el-table-column v-if="columns[3].visible" key="deptName" :show-overflow-tooltip="true" align="center"
|
||||||
|
label="部门"
|
||||||
prop="dept.deptName"/>
|
prop="dept.deptName"/>
|
||||||
<el-table-column v-if="columns[4].visible" key="phonenumber" align="center" label="手机号码"
|
<el-table-column v-if="columns[4].visible" key="phonenumber" align="center" label="手机号码"
|
||||||
prop="phonenumber" width="120"/>
|
prop="phonenumber" width="120"/>
|
||||||
|
|
Loading…
Reference in New Issue