肖凡4.3提交

yinyuyang^2
肖凡 2024-04-03 11:46:12 +08:00
parent 320bcb9539
commit 16b0c1b2a6
3 changed files with 16 additions and 15 deletions

View File

@ -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",

View File

@ -50,15 +50,15 @@ export function del(carIds) {
});
}
export function updateStateClose(carId) {
export function close(carVin) {
return request({
url: '/system/car/updateStateClose/'+carId,
url: '/system/car/close/'+carVin,
method: 'post'
});
}
export function updateStateOpen(carId) {
export function open(carVin) {
return request({
url: '/system/car/updateStateOpen/'+carId,
url: '/system/car/open/'+carVin,
method: 'post'
});
}

View File

@ -135,17 +135,17 @@
type="text"
icon="el-icon-success"
v-if="scope.row.state === 1"
@click="handleUpdateOpen(scope.row.carId)"
@click="handleUpdateOpen(scope.row.carVin)"
v-hasPermi="['system:car:edit']"
>启用</el-button>
>上线</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-error"
v-if="scope.row.state === 0"
@click="handleUpdateClose(scope.row.carId)"
@click="handleUpdateClose(scope.row.carVin)"
v-hasPermi="['system:car:edit']"
>禁用</el-button>
>下线</el-button>
<el-button
size="mini"
type="text"
@ -217,7 +217,7 @@
</template>
<script>
import {list, add, update, findById, del, exportA, selectFence,updateStateClose,updateStateOpen} from "@/api/system/car";
import {list, add, update, findById, del, exportA, selectFence,open,close} from "@/api/system/car";
export default {
name: "Car",
@ -350,16 +350,16 @@ export default {
});
},
/** 启用车辆 **/
handleUpdateOpen(carId){
updateStateOpen(carId).then(res=>{
this.$message.success('启用成功')
handleUpdateOpen(carVin){
open(carVin).then(res=>{
this.$message.success('上线成功')
this.getList();
})
},
/** 禁用车辆 **/
handleUpdateClose(carId){
updateStateClose(carId).then(res=>{
this.$message.success('禁用成功')
handleUpdateClose(carVin){
close(carVin).then(res=>{
this.$message.success('下线成功')
this.getList();
})
},