Merge remote-tracking branch 'origin/master'
commit
1f2f00774c
|
@ -10,6 +10,9 @@ cd cloud-ui
|
|||
# 安装依赖
|
||||
npm install
|
||||
|
||||
#高德题图第三方依赖
|
||||
npm install @amap/amap-jsapi-loader
|
||||
|
||||
# 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题
|
||||
npm install --registry=https://registry.npmmirror.com
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
"screenfull": "5.0.2",
|
||||
"sortablejs": "1.10.2",
|
||||
"vue": "2.6.12",
|
||||
"vue-amap": "^0.5.10",
|
||||
"vue-count-to": "1.0.13",
|
||||
"vue-cropper": "0.5.5",
|
||||
"vue-meta": "2.4.0",
|
||||
|
|
|
@ -9,4 +9,62 @@ export function carList(data) {
|
|||
data
|
||||
})
|
||||
}
|
||||
//车辆信息列表
|
||||
export function carHuiList(carVinId) {
|
||||
return request({
|
||||
url: 'carBase/car//list/' + carVinId,
|
||||
method: 'get',
|
||||
carVinId
|
||||
})
|
||||
}
|
||||
|
||||
//添加车辆信息管理
|
||||
export function carAdd(data) {
|
||||
return request({
|
||||
url: 'carBase/car/addCar',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
//修改车辆信息管理
|
||||
export function carUpd(data) {
|
||||
return request({
|
||||
url: 'carBase/car/updCar',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
//删除车辆信息管理
|
||||
export function carDel(vinId){
|
||||
return request({
|
||||
url:'carBase/car/delCar' + vinId,
|
||||
method:'get',
|
||||
vinId
|
||||
})
|
||||
}
|
||||
//导出车辆信息管理
|
||||
export function carExport(data){
|
||||
return request({
|
||||
url:'carBase/car/export',
|
||||
method:'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
//获取电子围栏的下拉框
|
||||
export function getFenceList(data){
|
||||
return request({
|
||||
url:'carBase/car/fenceId',
|
||||
method:'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
//获取车辆类型的下拉框
|
||||
export function getCarType(data){
|
||||
return request({
|
||||
url:'carBase/car/carType',
|
||||
method:'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
12
src/main.js
12
src/main.js
|
@ -76,7 +76,19 @@ DictData.install()
|
|||
Vue.use(Element, {
|
||||
size: Cookies.get('size') || 'medium' // set element-ui default size
|
||||
})
|
||||
//高德地图相关配置
|
||||
import AMapLoader from '@amap/amap-jsapi-loader'
|
||||
|
||||
Vue.prototype.$AMap = null
|
||||
AMapLoader.load({
|
||||
key: '9a267a434f26f5dd5a87fb89d128f745',
|
||||
version: '2.0',
|
||||
//'AMap.Autocomplete', 'AMap.MoveAnimation','AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor'
|
||||
plugins: [],
|
||||
|
||||
}).then((AMap) => {
|
||||
Vue.prototype.$AMap = AMap
|
||||
})
|
||||
Vue.config.productionTip = false
|
||||
|
||||
new Vue({
|
||||
|
|
|
@ -73,7 +73,6 @@ service.interceptors.request.use(config => {
|
|||
|
||||
// 响应拦截器
|
||||
service.interceptors.response.use(res => {
|
||||
debugger
|
||||
// 未设置状态码则默认成功状态
|
||||
const code = res.data.code || 200;
|
||||
// 获取错误信息
|
||||
|
|
|
@ -0,0 +1,432 @@
|
|||
html {
|
||||
font-size: 12px;
|
||||
}
|
||||
.amap-copyright{
|
||||
box-sizing: content-box
|
||||
}
|
||||
* {
|
||||
box-sizing: border-box
|
||||
}
|
||||
.input-textarea{
|
||||
color:grey;
|
||||
height:8em;
|
||||
overflow:auto;
|
||||
border-radius:0.4rem;
|
||||
border:1px solid #ced4da;
|
||||
margin-bottom:1rem;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
line-height: 1.5;
|
||||
font-weight: 300;
|
||||
color: #111213;
|
||||
}
|
||||
|
||||
hr {
|
||||
margin: 0.5rem 0;
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
overflow: visible;
|
||||
border: 0;
|
||||
border-top: 1px solid rgba(0, 0, 0, .1)
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
label {
|
||||
display: inline-block;
|
||||
margin-bottom: 0.4rem;
|
||||
}
|
||||
|
||||
label, .btn {
|
||||
margin-left: 0;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
button, input, select {
|
||||
margin: 0;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
overflow: visible;
|
||||
text-transform: none
|
||||
}
|
||||
|
||||
[type=button]::-moz-focus-inner, [type=reset]::-moz-focus-inner, [type=submit]::-moz-focus-inner, button::-moz-focus-inner {
|
||||
padding: 0;
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
input[type=checkbox], input[type=radio] {
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
margin: 0 0.5rem 0 0;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-family: inherit;
|
||||
line-height: 1.8;
|
||||
font-weight: 300;
|
||||
color: inherit;
|
||||
font-size: 1.1rem;
|
||||
margin-top: 0;
|
||||
margin-bottom: .5rem
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: inline-block;
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
border: 1px solid transparent;
|
||||
transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
||||
background-color: transparent;
|
||||
background-image: none;
|
||||
color: #25A5F7;
|
||||
border-color: #25A5F7;
|
||||
padding: .25rem .5rem;
|
||||
line-height: 1.5;
|
||||
border-radius: 1rem;
|
||||
-webkit-appearance: button;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
color: #fff;
|
||||
background-color: #25A5F7;
|
||||
border-color: #25A5F7
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
.input-item {
|
||||
position: relative;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-ms-flex-wrap: wrap;
|
||||
flex-wrap: wrap;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 3rem;
|
||||
}
|
||||
|
||||
.input-item:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.input-item>select, .input-item>input[type=text], .input-item>input[type=date] {
|
||||
position: relative;
|
||||
-ms-flex: 1 1 auto;
|
||||
flex: 1 1 auto;
|
||||
width: 1%;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.input-item>select:not(:last-child), .input-item>input[type=text]:not(:last-child), .input-item>input[type=date]:not(:last-child) {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0
|
||||
}
|
||||
|
||||
.input-item>select:not(:first-child), .input-item>input[type=text]:not(:first-child), .input-item>input[type=date]:not(:first-child) {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0
|
||||
}
|
||||
|
||||
.input-item-prepend {
|
||||
margin-right: -1px;
|
||||
}
|
||||
|
||||
.input-item-text, input[type=text],input[type=date], select {
|
||||
height: calc(2.2rem + 2px);
|
||||
}
|
||||
|
||||
.input-item-text {
|
||||
width: 6rem;
|
||||
text-align: justify;
|
||||
padding: 0.4rem 0.7rem;
|
||||
display: inline-block;
|
||||
text-justify: distribute-all-lines;
|
||||
/*ie6-8*/
|
||||
text-align-last: justify;
|
||||
/* ie9*/
|
||||
-moz-text-align-last: justify;
|
||||
/*ff*/
|
||||
-webkit-text-align-last: justify;
|
||||
/*chrome 20+*/
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
margin-bottom: 0;
|
||||
font-size: 1rem;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
color: #495057;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
background-color: #e9ecef;
|
||||
border: 1px solid #ced4da;
|
||||
border-radius: .25rem;
|
||||
border-bottom-right-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
|
||||
.input-item-text input[type=checkbox], .input-item-text input[type=radio] {
|
||||
margin-top: 0
|
||||
}
|
||||
|
||||
.input-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
word-wrap: break-word;
|
||||
background-color: #fff;
|
||||
background-clip: border-box;
|
||||
border-radius: .25rem;
|
||||
width: 22rem;
|
||||
border-width: 0;
|
||||
border-radius: 0.4rem;
|
||||
box-shadow: 0 2px 6px 0 rgba(114, 124, 245, .5);
|
||||
position: fixed;
|
||||
bottom: 1rem;
|
||||
right: 1rem;
|
||||
-ms-flex: 1 1 auto;
|
||||
flex: 1 1 auto;
|
||||
padding: 0.75rem 1.25rem;
|
||||
}
|
||||
|
||||
.input-text {
|
||||
line-height: 2rem;
|
||||
margin-right: 2rem;
|
||||
}
|
||||
|
||||
.info hr {
|
||||
margin-right: 0;
|
||||
margin-left: 0;
|
||||
border-top-color: grey;
|
||||
}
|
||||
|
||||
.info {
|
||||
padding: .75rem 1.25rem;
|
||||
margin-bottom: 1rem;
|
||||
border-radius: .25rem;
|
||||
position: fixed;
|
||||
top: 1rem;
|
||||
background-color: white;
|
||||
width: auto;
|
||||
min-width: 22rem;
|
||||
border-width: 0;
|
||||
right: 1rem;
|
||||
box-shadow: 0 2px 6px 0 rgba(114, 124, 245, .5);
|
||||
}
|
||||
|
||||
.code {
|
||||
left: 1.5rem;
|
||||
right: 1.5rem;
|
||||
top: 1.5rem;
|
||||
bottom: 1.5rem;
|
||||
overflow: auto;
|
||||
margin-bottom: 0rem;
|
||||
}
|
||||
|
||||
.code .btn {
|
||||
top: 1rem;
|
||||
position: absolute;
|
||||
right: 1rem;
|
||||
}
|
||||
|
||||
.code .result {
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
border-radius: 0.5rem;
|
||||
padding: 1rem;
|
||||
bottom: 1rem;
|
||||
position: absolute;
|
||||
top: 5.5rem;
|
||||
right: 1rem;
|
||||
left: 1rem;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.code .status {
|
||||
color: #80adff;
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.code h4 {
|
||||
display: inline-block;
|
||||
max-width: 20rem;
|
||||
margin-right: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
select, input[type=text], input[type=date] {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
padding: .375rem 1.75rem .375rem .75rem;
|
||||
line-height: 1.5;
|
||||
color: #495057;
|
||||
vertical-align: middle;
|
||||
background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right .75rem center;
|
||||
background-size: 8px 10px;
|
||||
border: 1px solid #ced4da;
|
||||
border-radius: .25rem;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none
|
||||
}
|
||||
|
||||
input[type=text],input[type=date] {
|
||||
background: #fff;
|
||||
padding: .375rem .75rem;
|
||||
}
|
||||
|
||||
select:focus, input[type=text]:focus, input[type=date]:focus {
|
||||
border-color: #80bdff;
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 .1rem rgba(128, 189, 255, .1)
|
||||
}
|
||||
|
||||
.btn:focus {
|
||||
outline: 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
select:focus::-ms-value, input[type=text]:focus::-ms-value,input[type=date]:focus::-ms-value {
|
||||
color: #495057;
|
||||
background-color: #fff
|
||||
}
|
||||
|
||||
|
||||
/* native toastr */
|
||||
.native-toast {
|
||||
position: fixed;
|
||||
background-color: rgba(50, 50, 50, .8);
|
||||
border-radius: 33px;
|
||||
color: white;
|
||||
left: 50%;
|
||||
text-align: center;
|
||||
padding: 6px 12px;
|
||||
opacity: 0;
|
||||
z-index: 99999;
|
||||
transition: transform .25s, opacity .25s, top .25s;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.native-toast-bottom {
|
||||
bottom: 50px;
|
||||
-ms-transform: translateX(-50%) translateY(50px);
|
||||
transform: translateX(-50%) translateY(50px)
|
||||
}
|
||||
|
||||
.native-toast-bottom.native-toast-shown {
|
||||
opacity: 1;
|
||||
-ms-transform: translateX(-50%) translateY(0);
|
||||
transform: translateX(-50%) translateY(0);
|
||||
}
|
||||
|
||||
.native-toast-bottom.native-toast-edge {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.native-toast-top {
|
||||
top: 50px;
|
||||
-ms-transform: translateX(-50%) translateY(-50px);
|
||||
transform: translateX(-50%) translateY(-50px)
|
||||
}
|
||||
|
||||
.native-toast-top.native-toast-shown {
|
||||
opacity: 1;
|
||||
-ms-transform: translateX(-50%) translateY(0);
|
||||
transform: translateX(-50%) translateY(0);
|
||||
}
|
||||
|
||||
.native-toast-top.native-toast-edge {
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.native-toast-center {
|
||||
top: 0;
|
||||
-ms-transform: translateX(-50%) translateY(-50px);
|
||||
transform: translateX(-50%) translateY(-50px)
|
||||
}
|
||||
|
||||
.native-toast-center.native-toast-shown {
|
||||
opacity: 1;
|
||||
top: 50%;
|
||||
-ms-transform: translateX(-50%) translateY(-50%);
|
||||
transform: translateX(-50%) translateY(-50%);
|
||||
}
|
||||
|
||||
.native-toast-edge {
|
||||
border-radius: 0;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 40rem) {
|
||||
.native-toast:not(.native-toast-edge) {
|
||||
max-width: 18rem;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
max-width does not seem to work in small screen?
|
||||
*/
|
||||
|
||||
/*@media screen and (max-width: 768px) {
|
||||
.native-toast:not(.native-toast-edge) {
|
||||
max-width: 400px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 468px) {
|
||||
.native-toast:not(.native-toast-edge) {
|
||||
max-width: 300px;
|
||||
}
|
||||
}*/
|
||||
|
||||
/* types */
|
||||
|
||||
.native-toast-error {
|
||||
background-color: #d92727;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.native-toast-success {
|
||||
background-color: #62a465;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.native-toast-warning {
|
||||
background-color: #fdaf17;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.native-toast-info {
|
||||
background-color: #5060ba;
|
||||
color: white;
|
||||
}
|
||||
|
||||
[class^="native-toast-icon-"] {
|
||||
vertical-align: middle;
|
||||
margin-right: 8px
|
||||
}
|
||||
|
||||
[class^="native-toast-icon-"] svg {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
|
@ -1,85 +1,196 @@
|
|||
<template>
|
||||
<el-table :data="tableData" style="width: 100%">
|
||||
<div>
|
||||
<el-form ref="from" :model="from" status-icon class="demo-ruleForm">
|
||||
车辆VIN: <el-input v-model="from.carVinId" placeholder="车辆VIN" />
|
||||
车辆类型: <el-input v-model="from.carTypeId" placeholder="车辆类型" />
|
||||
电子围栏: <el-input v-model="from.fenceId" placeholder="电子围栏" />
|
||||
车辆状态: <el-input v-model="from.status" placeholder="车辆状态" />
|
||||
<br><br>
|
||||
电机厂商: <el-input v-model="from.batteryManufacturer" placeholder="电机厂商" />
|
||||
电池厂商: <el-input v-model="from.motorManufacturer" placeholder="电池厂商" />
|
||||
电机编号: <el-input v-model="from.motorNumber" placeholder="电机编号" />
|
||||
电池编号: <el-input v-model="from.batteryNumber" placeholder="电池编号" />
|
||||
<br><br>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
<el-button @click="resetForm">重置</el-button>
|
||||
</el-form-item>
|
||||
|
||||
<el-table-column label="车辆VIN" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-popover trigger="hover" placement="top">
|
||||
<el-button type="primary" @click="addCar">添加</el-button>
|
||||
<el-button type="danger" round @click="delListCar">批量删除</el-button>
|
||||
<el-button type="info" round @click="exportCar">导出信息</el-button>
|
||||
<!--1111111111111111111111111111111111添加弹窗1111111111111111111111111111-->
|
||||
<el-dialog title="添加车辆信息管理" :visible.sync="dialogFormVisible">
|
||||
<el-form :model="form">
|
||||
<el-form-item label="车辆VIN">
|
||||
<el-input v-model="form.carVinId" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车辆类型">
|
||||
<el-select v-model="form.carTypeId" clearable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in carTypeList"
|
||||
:key="item.id"
|
||||
:label="item.carTypeName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="电子围栏">
|
||||
<el-select v-model="form.fenceId" clearable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in fenceList"
|
||||
:key="item.id"
|
||||
:label="item.fenceName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="电机厂商" >
|
||||
<el-input v-model="form.motorManufacturer" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="电池厂商" >
|
||||
<el-input v-model="form.batteryManufacturer" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="电机编号" >
|
||||
<el-input v-model="form.motorNumber" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="电池编号" >
|
||||
<el-input v-model="form.batteryNumber" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="addCarDialogFormVisible">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!--1111111111111111111111111111111111修改回显弹窗1111111111111111111111111111-->
|
||||
<el-dialog title="修改车辆信息管理" :visible.sync="dialogFormVisible1">
|
||||
<el-form :model="formHui">
|
||||
<el-form-item label="车辆VIN" >
|
||||
<el-input v-model="formHui.carVinId" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车辆类型">
|
||||
<el-select v-model="form.carTypeId" clearable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in carTypeList"
|
||||
:key="item.id"
|
||||
:label="item.carTypeName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="电子围栏">
|
||||
<el-select v-model="form.fenceId" clearable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in fenceList"
|
||||
:key="item.id"
|
||||
:label="item.fenceName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="电机厂商" >
|
||||
<el-input v-model="formHui.motorManufacturer" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="电池厂商" >
|
||||
<el-input v-model="formHui.batteryManufacturer" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="电机编号" >
|
||||
<el-input v-model="formHui.motorNumber" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="电池编号" >
|
||||
<el-input v-model="formHui.batteryNumber" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="addCarDialogFormVisible1">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</el-form>
|
||||
<!--1111111111111111111111111111111111 列表展示 1111111111111111111111111111-->
|
||||
<el-table :data="tableData" style="width: 100%">
|
||||
|
||||
<el-table-column label="车辆VIN" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="medium">{{ scope.row.carVinId }}</el-tag>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="车辆VIN" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-popover trigger="hover" placement="top">
|
||||
<el-table-column label="车辆类型" width="180" prop="carTypeId">
|
||||
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="medium">{{ scope.row.carTypeId }}</el-tag>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="车辆类型" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-popover trigger="hover" placement="top">
|
||||
<el-table-column label="电子围栏ID" width="180" prop="fenceId">
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="medium">{{ scope.row.fenceId }}</el-tag>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="车辆状态" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-popover trigger="hover" placement="top">
|
||||
<el-tag size="medium">{{ scope.row.carStatus }}</el-tag>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="车辆状态" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="medium">{{ scope.row.status }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="电子围栏" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-popover trigger="hover" placement="top">
|
||||
<el-table-column label="电池厂商" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="medium">{{ scope.row.batteryManufacturer }}</el-tag>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="电池厂商" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-popover trigger="hover" placement="top">
|
||||
<el-table-column label="电机厂商" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="medium">{{ scope.row.motorManufacturer }}</el-tag>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="电机厂商" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-popover trigger="hover" placement="top">
|
||||
<el-table-column label="电机编号" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="medium">{{ scope.row.motorNumber }}</el-tag>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="电机编号" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-popover trigger="hover" placement="top">
|
||||
<el-table-column label="电池编号" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="medium">{{ scope.row.batteryNumber }}</el-tag>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" @click="handleShi(scope.$index , scope.row)">实时轨迹</el-button>
|
||||
<!-- 修改车辆信息-->
|
||||
<el-button size="mini" @click="handleEdit(scope.$index, scope.row)">修改</el-button>
|
||||
<!-- 删除车辆信息-->
|
||||
<el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<!-- 实时轨迹-->
|
||||
<el-button size="mini" @click="handleShi(scope.$index , scope.row.carVinId)">实时轨迹</el-button>
|
||||
<!-- 111111-->
|
||||
<el-button size="mini" @click="handleShiGui(scope.$index , scope.row.carVinId)">1111</el-button>
|
||||
<!-- 修改车辆信息-->
|
||||
<el-button size="mini" @click="handleEdit(scope.$index, scope.row.carVinId)">修改</el-button>
|
||||
<!-- 删除车辆信息-->
|
||||
<el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row.carVinId)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { carList } from '../../api/carList/list'
|
||||
import {
|
||||
carAdd,
|
||||
carDel,
|
||||
carExport,
|
||||
carHuiList,
|
||||
carList,
|
||||
carUpd,
|
||||
getCarType,
|
||||
getFenceList
|
||||
} from '../../api/carList/list'
|
||||
|
||||
export default {
|
||||
name: 'CarList',
|
||||
|
@ -97,8 +208,39 @@ export default {
|
|||
return {
|
||||
list: null,
|
||||
listLoading: true,
|
||||
from: {},
|
||||
tableData: []
|
||||
from: {
|
||||
carVinId: null,
|
||||
carTypeId: null
|
||||
},
|
||||
// 添加表单数据
|
||||
form: {
|
||||
carVinId: '',
|
||||
carTypeId: '',
|
||||
fenceId: '',
|
||||
status: '',
|
||||
motorManufacturer: '',
|
||||
batteryManufacturer: '',
|
||||
motorNumber: '',
|
||||
batteryNumber: '',
|
||||
fenceName: '',
|
||||
carTypeName: ''
|
||||
},
|
||||
// 修改表单数据
|
||||
formHui: {
|
||||
carVinId: '',
|
||||
carTypeId: '',
|
||||
fenceId: '',
|
||||
status: '',
|
||||
motorManufacturer: '',
|
||||
batteryManufacturer: '',
|
||||
motorNumber: '',
|
||||
batteryNumber: ''
|
||||
},
|
||||
tableData: [],
|
||||
fenceList: [],
|
||||
carTypeList: [],
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible1: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -109,15 +251,149 @@ export default {
|
|||
this.listLoading = true
|
||||
carList().then(response => {
|
||||
this.tableData = response.data.data
|
||||
console.log(2222222222222222)
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
// 实时轨迹
|
||||
handleShi() {},
|
||||
// 修改
|
||||
handleEdit() {},
|
||||
// 删除
|
||||
handleDelete() {}
|
||||
handleShiGui() {
|
||||
this.$router.push('/allCar/history')
|
||||
},
|
||||
// 模糊查询提交 更新列表
|
||||
submitForm() {
|
||||
this.fetchData()
|
||||
},
|
||||
// 重置
|
||||
resetForm() {
|
||||
this.fetchData()
|
||||
},
|
||||
// 新增车辆管理信息数据
|
||||
addCar() {
|
||||
this.getFenceList1()
|
||||
this.getCarType1()
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
// 添加车辆确认
|
||||
addCarDialogFormVisible() {
|
||||
carAdd().then(res => {
|
||||
debugger
|
||||
if (res.data.code === 200) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '添加成功'
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
this.fetchData()
|
||||
} else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '添加失败'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 批量删除
|
||||
delListCar() {},
|
||||
// 实时轨迹 跳转这个表 carVinId
|
||||
handleShi() {
|
||||
this.$router.push('/allCar/operation')
|
||||
},
|
||||
// 回显 修改
|
||||
handleEdit(carVinId) {
|
||||
this.dialogFormVisible1 = true
|
||||
carHuiList(carVinId).then(res => {
|
||||
if (res.data.code === 200) {
|
||||
this.formHui = res.data.data
|
||||
} else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '回显失败失败'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 修改确认键
|
||||
addCarDialogFormVisible1() {
|
||||
carUpd().then(res => {
|
||||
if (res.data.code === 200) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '修改成功'
|
||||
})
|
||||
} else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '修改失败'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 单删除
|
||||
handleDelete(carVinId) {
|
||||
carDel(carVinId).then(res => {
|
||||
if (res.data.code === 200) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功'
|
||||
})
|
||||
} else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '删除失败'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 导出信息
|
||||
exportCar() {
|
||||
carExport().then(res => {
|
||||
if (res.data.code === 200) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '导出成功'
|
||||
})
|
||||
} else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '导出失败'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 电子围栏列表
|
||||
getFenceList1() {
|
||||
getFenceList().then(res => {
|
||||
console.log(res)
|
||||
if (res.code === 200) {
|
||||
this.fenceList = res.data
|
||||
console.log(this.fenceList + '2222222')
|
||||
} else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '获取电子围栏列表失败'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取车辆类型列表
|
||||
getCarType1() {
|
||||
getCarType().then(res => {
|
||||
console.log(res)
|
||||
if (res.code === 200) {
|
||||
this.carTypeList = res.data
|
||||
console.log(this.carTypeList + '1111111111111111111')
|
||||
} else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '获取车辆类型列表失败'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.el-input{
|
||||
width: 200px;
|
||||
}
|
||||
</style>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,2 +1,158 @@
|
|||
<!--运行轨迹-->
|
||||
<template>
|
||||
<div>
|
||||
<div id="container" />
|
||||
<div class="input-card">
|
||||
<h4>轨迹回放控制</h4>
|
||||
<div class="input-item">
|
||||
<input id="start" type="button" class="btn" value="开始动画" @click="startAnimation()">
|
||||
<input id="pause" type="button" class="btn" value="暂停动画" @click="pauseAnimation()">
|
||||
</div>
|
||||
<div class="input-item">
|
||||
<input id="resume" type="button" class="btn" value="继续动画" @click="resumeAnimation()">
|
||||
<input id="stop" type="button" class="btn" value="停止动画" @click="stopAnimation()">
|
||||
</div>
|
||||
<!-- <div class="input-item">-->
|
||||
<!-- <el-button type="primary" round plain id="start" @click="startAnimation">开始动画</el-button>-->
|
||||
<!-- <el-button type="primary" round plain id="pause" @click="pauseAnimation">暂停动画</el-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="input-item">-->
|
||||
<!-- <el-button type="primary" round plain id="resume" @click="resumeAnimation">继续动画</el-button>-->
|
||||
<!-- <el-button type="primary" round plain id="stop" @click="send">实时轨迹</el-button>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
map: null,
|
||||
marker: null,
|
||||
passedPolyline: null,
|
||||
lineArr: [],
|
||||
arr: []
|
||||
|
||||
// lineArr: [
|
||||
// [116.478935,39.997761],[116.478939,39.997825],[116.478912,39.998549],
|
||||
// [116.478912,39.998549],[116.478998,39.998555],[116.478998,39.998555],
|
||||
// [116.479282,39.99856],[116.479658,39.998528],[116.480151,39.998453],
|
||||
// [116.480784,39.998302],[116.480784,39.998302],[116.481149,39.998184],
|
||||
// [116.481573,39.997997],[116.481863,39.997846],[116.482072,39.997718],
|
||||
// [116.482362,39.997718],[116.483633,39.998935],[116.48367,39.998968],
|
||||
// [116.484648,39.999861]
|
||||
// ],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.socket = new WebSocket('ws://10.100.1.8:9802/websocket/12345')
|
||||
},
|
||||
mounted() {
|
||||
this.socket.onopen = this.handleOpen
|
||||
this.socket.onmessage = this.handleMessage
|
||||
this.socket.onerror = this.handleError
|
||||
setTimeout(() => {
|
||||
this.send()
|
||||
this.initAMap()
|
||||
}, 500)
|
||||
},
|
||||
methods: {
|
||||
send() {
|
||||
// 发送消息
|
||||
this.socket.send('nihao')
|
||||
},
|
||||
handleOpen() {
|
||||
console.log('WebSocket is open!')
|
||||
},
|
||||
// 前端接收数据
|
||||
handleMessage(event) {
|
||||
let lastArr = []
|
||||
this.arr = JSON.parse(event.data)
|
||||
const len = this.lineArr.length
|
||||
if (len !== 0) {
|
||||
lastArr = this.lineArr[len - 1]
|
||||
this.lineArr.length = 0
|
||||
this.lineArr.push(lastArr)
|
||||
}
|
||||
console.log(this.lineArr.toString())
|
||||
this.lineArr.push(this.arr) // 添加新的点数据
|
||||
console.log(this.lineArr.toString())
|
||||
this.startAnimation()
|
||||
},
|
||||
|
||||
handleError(error) {
|
||||
console.log('异常')
|
||||
// console.error(`Error occurred: ${error}`);
|
||||
},
|
||||
initAMap() {
|
||||
// JSAPI2.0 使用覆盖物动画必须先加载动画插件
|
||||
this.$AMap.plugin('AMap.MoveAnimation', () => {
|
||||
this.map = new this.$AMap.Map('container', {
|
||||
resizeEnable: true,
|
||||
center: [116.478935, 39.997761],
|
||||
zoom: 17
|
||||
})
|
||||
})
|
||||
|
||||
this.marker = new this.$AMap.Marker({
|
||||
map: this.map,
|
||||
position: [116.478935, 39.997761],
|
||||
icon: 'https://a.amap.com/jsapi_demos/static/demo-center-v2/car.png',
|
||||
offset: new this.$AMap.Pixel(-13, -26),
|
||||
autoRotation: true
|
||||
})
|
||||
|
||||
this.marker.on('moving', (e) => {
|
||||
this.passedPolyline.setPath(e.passedPath)
|
||||
this.map.setCenter(e.target.getPosition(), true)
|
||||
})
|
||||
this.map.setFitView()
|
||||
},
|
||||
|
||||
// 开始动画
|
||||
startAnimation() {
|
||||
this.marker.setPosition(this.arr)
|
||||
this.marker.on('moving', (e) => {
|
||||
this.passedPolyline.setPath(e.passedPath)
|
||||
this.map.setCenter(e.target.getPosition(), true)
|
||||
})
|
||||
|
||||
this.marker.moveAlong(this.lineArr,
|
||||
{
|
||||
duration: 2000
|
||||
})
|
||||
},
|
||||
|
||||
// 暂停
|
||||
pauseAnimation() {
|
||||
this.marker.pauseMove()
|
||||
},
|
||||
|
||||
// 继续
|
||||
resumeAnimation() {
|
||||
this.marker.resumeMove()
|
||||
},
|
||||
|
||||
// 停止
|
||||
stopAnimation() {
|
||||
this.marker.stopMove()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
@import "../MapStyle.css";
|
||||
.input-card .btn{
|
||||
margin-right: 1.2rem;
|
||||
width: 9rem;
|
||||
}
|
||||
#container {
|
||||
width: 100%;
|
||||
height: 800px;
|
||||
}
|
||||
.input-card .btn:last-child{
|
||||
margin-right: 0;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="login">
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
||||
<h3 class="title">若依后台管理系统</h3>
|
||||
<h3 class="title">智能车联管理系统</h3>
|
||||
<el-form-item prop="username">
|
||||
<el-input
|
||||
v-model="loginForm.username"
|
||||
|
|
Loading…
Reference in New Issue