增加删除车辆接口
parent
1f3eb43eb8
commit
9bfcfb4d9d
|
@ -14,3 +14,10 @@ export function gen(number) {
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function remove(vin) {
|
||||||
|
return request({
|
||||||
|
url: `/vehicle/${vin}`,
|
||||||
|
method: 'DELETE'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ service.interceptors.response.use(
|
||||||
error => {
|
error => {
|
||||||
console.log('err' + error) // for debug
|
console.log('err' + error) // for debug
|
||||||
Message({
|
Message({
|
||||||
message: error.msg,
|
message: error.message,
|
||||||
type: 'error',
|
type: 'error',
|
||||||
duration: 5 * 1000
|
duration: 5 * 1000
|
||||||
})
|
})
|
||||||
|
|
|
@ -60,6 +60,9 @@
|
||||||
<el-tag :type="!vehicle.online ? 'info' : 'success'" style="padding-left: 0; padding-right: 0">
|
<el-tag :type="!vehicle.online ? 'info' : 'success'" style="padding-left: 0; padding-right: 0">
|
||||||
{{ vehicle.vin }}
|
{{ vehicle.vin }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
|
<el-button style="float: right;" type="danger"
|
||||||
|
@click="vehicleRemove(vehicle.vin)" size="mini">删除</el-button>
|
||||||
|
<span style="float: right; color: rgba(255,255,255,0)">|</span>
|
||||||
<el-button style="float: right;" :type="checkVin === vehicle.vin ? 'success' : ''"
|
<el-button style="float: right;" :type="checkVin === vehicle.vin ? 'success' : ''"
|
||||||
@click="checkVin = vehicle.vin" size="mini" :disabled="!vehicle.online">{{checkVin === vehicle.vin ? "已选择" : "选择"}}</el-button>
|
@click="checkVin = vehicle.vin" size="mini" :disabled="!vehicle.online">{{checkVin === vehicle.vin ? "已选择" : "选择"}}</el-button>
|
||||||
<span style="float: right; color: rgba(255,255,255,0)">|</span>
|
<span style="float: right; color: rgba(255,255,255,0)">|</span>
|
||||||
|
@ -257,7 +260,7 @@ import {
|
||||||
instanceMsg, unifiedOffline, unifiedOnline, unifiedPosition, unifiedSend, unifiedStatus, unifiedStop
|
instanceMsg, unifiedOffline, unifiedOnline, unifiedPosition, unifiedSend, unifiedStatus, unifiedStop
|
||||||
} from '@/api/vehicle/instance'
|
} from '@/api/vehicle/instance'
|
||||||
import {positionList} from "@/api/vehicle/position";
|
import {positionList} from "@/api/vehicle/position";
|
||||||
import { create, gen } from '@/api/vehicle/vehicle'
|
import { create, gen, remove } from '@/api/vehicle/vehicle'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
|
@ -440,6 +443,19 @@ export default {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* 车辆删除
|
||||||
|
*/
|
||||||
|
vehicleRemove(vin){
|
||||||
|
remove(vin).then(response => {
|
||||||
|
this.getInstanceList()
|
||||||
|
this.$notify({
|
||||||
|
title: '操作提示',
|
||||||
|
message: response.msg,
|
||||||
|
type: response.code === 200 ? 'success' : 'error'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取车辆数据
|
* 获取车辆数据
|
||||||
|
|
Loading…
Reference in New Issue