feat():优化业务功能 10.1

dav.saas
zhang chengzhi 2024-10-01 22:21:55 +08:00
parent 6790c484f9
commit 95e6bc22e7
4 changed files with 119 additions and 16 deletions

View File

@ -63,7 +63,6 @@ export function selectAllGroup() {
return request({
url: '/enterprise/group/selectAllGroup',
method: 'post',
data
})
}
@ -76,6 +75,17 @@ export function findFenceAndWayById(id) {
})
}
//车辆绑定围栏组
export function boundGroupAndCar(data) {
return request({
url: '/enterprise/group/boundGroupAndCar',
method: 'post',
data
})
}
//围栏组绑定车辆
export function selectCarAdd(data) {
@ -85,3 +95,4 @@ export function selectCarAdd(data) {
data
})
}

View File

@ -3,14 +3,14 @@ import request from '@/utils/request'
// 查询预警规则列表
export function listRule(query) {
return request({
url: '/warning/rule/list',
url: '/enterprise/rule/list',
method: 'get',
params: query
})
}
export function findStrategyRuleList(query) {
return request({
url: '/warning/rule/findStrategyRuleList',
url: '/enterprise/rule/findStrategyRuleList',
method: 'get',
params: query
})
@ -19,7 +19,7 @@ export function findStrategyRuleList(query) {
// 查询预警规则详细
export function getRule(id) {
return request({
url: '/warning/rule/' + id,
url: '/enterprise/rule/' + id,
method: 'get'
})
}
@ -27,7 +27,7 @@ export function getRule(id) {
// 新增预警规则
export function addRule(data) {
return request({
url: '/warning/rule',
url: '/enterprise/rule',
method: 'post',
data: data
})
@ -36,7 +36,7 @@ export function addRule(data) {
// 修改预警规则
export function updateRule(data) {
return request({
url: '/warning/rule',
url: '/enterprise/rule',
method: 'put',
data: data
})
@ -45,14 +45,14 @@ export function updateRule(data) {
// 删除预警规则
export function delRule(id) {
return request({
url: '/warning/rule/' + id,
url: '/enterprise/rule/' + id,
method: 'delete'
})
}
export function findCarTypeMsg(carTypeId) {
return request({
url: '/warning/carTypeMsg/findCarTypeMsg',
url: '/enterprise/carTypeMsg/findCarTypeMsg',
method: 'post',
params: {carTypeId:carTypeId}
})

View File

@ -3,14 +3,14 @@ import request from '@/utils/request'
// 查询预警策略列表
export function listStrategy(query) {
return request({
url: '/warning/strategy/list',
url: '/enterprise/strategy/list',
method: 'get',
params: query
})
}
export function selectStrategyList(query) {
return request({
url: '/warning/strategy/selectStrategyList',
url: '/enterprise/strategy/selectStrategyList',
method: 'get',
params: query
})
@ -19,7 +19,7 @@ export function selectStrategyList(query) {
// 查询预警策略详细
export function getStrategy(id) {
return request({
url: '/warning/strategy/' + id,
url: '/enterprise/strategy/' + id,
method: 'get'
})
}
@ -27,7 +27,7 @@ export function getStrategy(id) {
// 新增预警策略
export function addStrategy(data) {
return request({
url: '/warning/strategy',
url: '/enterprise/strategy',
method: 'post',
data: data
})
@ -36,7 +36,7 @@ export function addStrategy(data) {
// 修改预警策略
export function updateStrategy(data) {
return request({
url: '/warning/strategy',
url: '/enterprise/strategy',
method: 'put',
data: data
})
@ -45,19 +45,19 @@ export function updateStrategy(data) {
// 删除预警策略
export function delStrategy(id) {
return request({
url: '/warning/strategy/' + id,
url: '/enterprise/strategy/' + id,
method: 'delete'
})
}
export function findCarTypeName() {
return request({
url: '/warning/carType/findCarTypeName',
url: '/enterprise/carType/findCarTypeName',
method: 'post',
})
}
export function findStrategyListByCarTypeId(carTypeId) {
return request({
url: '/warning/strategy/findStrategyListByCarTypeId',
url: '/enterprise/strategy/findStrategyListByCarTypeId',
method: 'post',
params: {carTypeId:carTypeId}
})

View File

@ -94,6 +94,7 @@
<el-button type="text" @click="handleEdit(scope.row)"></el-button>
<el-button type="text" @click="handleDelete(scope.row)"></el-button>
<el-button type="text" @click="configurationStrategy(scope.row)"></el-button>
<el-button type="text" class="el-icon-connection" @click="boundFenceGroup(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
@ -119,6 +120,47 @@
</span>
</el-dialog>
<el-drawer
title="绑定围栏组"
:visible.sync="drawer"
:direction="direction"
:before-close="handleClose">
<el-table
ref="multipleTable"
:data="groupList"
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
label="id"
prop="id"
width="120">
</el-table-column>
<el-table-column
prop="groupName"
label="围栏组名称"
width="120">
</el-table-column>
<el-table-column
prop="priority"
label="优先级"
show-overflow-tooltip>
</el-table-column>
</el-table>
<el-button @click="drawer = false"> </el-button>
<el-button type="primary" @click="dobound()"> </el-button>
</el-drawer>
</div>
@ -135,6 +177,7 @@ import {
updCarStrategyId
} from '@/api/system/manage/carInformation'
import { findStrategyListByCarTypeId, updateStrategy } from '@/api/warning/strategy'
import { boundGroupAndCar, selectAllGroup } from '@/api/fence/group'
export default {
//import使"
@ -143,10 +186,24 @@ export default {
data() {
//"
return {
GroupAndCarBound:{
vin:null,
//
groupListResp: [],
},
//
groupList:[],
//
drawer:false,
//
direction:'rtl',
strategyId:null,
carId:null,
dialogVisible: false,
tableData: [],
//
selectInformation: {
pageNum: 1,
@ -171,6 +228,41 @@ export default {
watch: {},
//",
methods: {
dobound(){
boundGroupAndCar(this.GroupAndCarBound).then(res=>{
this.$modal.msgSuccess("绑定成功");
this.drawer=false;
})
},
handleSelectionChange(val) {
this.GroupAndCarBound.groupListResp = val;
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
},
boundFenceGroup(row){
this.GroupAndCarBound.vin=row.carVin;
selectAllGroup().then(res=>{
this.groupList = res.data;
console.log(this.groupList);
this.drawer =true;
})
},
updCarStrategyId(){
updCarStrategyId(this.carId,this.strategyId).then((res)=>{
this.$modal.msgSuccess("修改成功");