feat(): 前台整合saas
parent
5747259c30
commit
9dbf32203d
|
@ -1,34 +0,0 @@
|
||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
//查询
|
|
||||||
export function listLog(data){
|
|
||||||
return request({
|
|
||||||
url:'/breakdown/log/list',
|
|
||||||
method:'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function listStatusIgnore(data){
|
|
||||||
return request({
|
|
||||||
url:'/breakdown/log/listStatusIgnore',
|
|
||||||
method:'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function listStatusSolve(data){
|
|
||||||
return request({
|
|
||||||
url:'/breakdown/log/listStatusSolve',
|
|
||||||
method:'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function listStatusProcess(data){
|
|
||||||
return request({
|
|
||||||
url:'/breakdown/log/listStatusProcess',
|
|
||||||
method:'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
|
@ -1,58 +0,0 @@
|
||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 查询车辆故障管理列表
|
|
||||||
export function listBreakdown(query) {
|
|
||||||
return request({
|
|
||||||
url: '/breakdown/breakdown/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询车辆故障管理详细
|
|
||||||
export function getBreakdown(id) {
|
|
||||||
return request({
|
|
||||||
url: '/breakdown/breakdown/' + id,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增车辆故障管理
|
|
||||||
export function addBreakdown(data) {
|
|
||||||
return request({
|
|
||||||
url: '/breakdown/breakdown',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改车辆故障管理
|
|
||||||
export function updateBreakdown(data) {
|
|
||||||
return request({
|
|
||||||
url: '/breakdown/breakdown',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除车辆故障管理
|
|
||||||
export function delBreakdown(id) {
|
|
||||||
return request({
|
|
||||||
url: '/breakdown/breakdown/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//启用警告
|
|
||||||
export function enableWarningsById(id) {
|
|
||||||
return request({
|
|
||||||
url: '/breakdown/breakdown/enableWarningsById/' + id,
|
|
||||||
method: 'put'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//禁用警告
|
|
||||||
export function disableWarningsById(id) {
|
|
||||||
return request({
|
|
||||||
url: '/breakdown/breakdown/disableWarningsById/' + id,
|
|
||||||
method: 'put'
|
|
||||||
})
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
//查询
|
|
||||||
export function listMessage(){
|
|
||||||
return request({
|
|
||||||
url:'/breakdown/message/list',
|
|
||||||
method:'get',
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function listStatusOne(){
|
|
||||||
return request({
|
|
||||||
url:'/breakdown/message/listStatusOne',
|
|
||||||
method:'get',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function listStatusTwo(){
|
|
||||||
return request({
|
|
||||||
url:'/breakdown/message/listStatusTwo',
|
|
||||||
method:'get',
|
|
||||||
})
|
|
||||||
}
|
|
|
@ -1,80 +0,0 @@
|
||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 查询车辆基础信息列表
|
|
||||||
export function listCar(query) {
|
|
||||||
return request({
|
|
||||||
url: '/car/sysCar/selectSysCarVoList',
|
|
||||||
method: 'post',
|
|
||||||
data: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询车辆基础信息详细
|
|
||||||
export function getCar(id) {
|
|
||||||
return request({
|
|
||||||
url: '/car/sysCar/selectSysCarVoById/' + id,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增车辆基础信息
|
|
||||||
export function addCar(data) {
|
|
||||||
return request({
|
|
||||||
url: '/car/addSysCar',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改车辆基础信息
|
|
||||||
export function updateCar(data) {
|
|
||||||
return request({
|
|
||||||
url: '/car/sysCar',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除车辆基础信息
|
|
||||||
export function delCar(id) {
|
|
||||||
return request({
|
|
||||||
url: '/car/sysCar/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 查询车辆类型列表
|
|
||||||
export function selectCarTypeList() {
|
|
||||||
return request({
|
|
||||||
url: '/car/carType/selectCarTypeList',
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// // 查询电子围栏列表
|
|
||||||
// export function selectFenceList() {
|
|
||||||
// return request({
|
|
||||||
// url: '/car/fence/list',
|
|
||||||
// method: 'post'
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export function getLogCar() {
|
|
||||||
return request({
|
|
||||||
url: '/car/sysCarLog/selectList',
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//对应车辆VIN码查询对应故障 预警 电子围栏
|
|
||||||
export function findFaultData(carVin) {
|
|
||||||
return request({
|
|
||||||
url: '/car/sysCar/findFenceByCarVin/'+carVin,
|
|
||||||
method: 'post'
|
|
||||||
})
|
|
||||||
}
|
|
|
@ -1,83 +0,0 @@
|
||||||
import request from '@/utils/request'
|
|
||||||
// 查询电子围栏列表
|
|
||||||
export function listFence(data) {
|
|
||||||
return request({
|
|
||||||
url: '/fence/fence/fenceselectList',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询电子围栏选择列表
|
|
||||||
export function fenceArray(data) {
|
|
||||||
return request({
|
|
||||||
url: '/fence/fence/fenceArray',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//添加
|
|
||||||
export function addfence(data) {
|
|
||||||
return request({
|
|
||||||
url: '/fence/fence/add',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//修改
|
|
||||||
export function updfence(data) {
|
|
||||||
return request({
|
|
||||||
url: `/fence/fence/upd/${data.id}`,
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//删除
|
|
||||||
export function delElectronById(id) {
|
|
||||||
// return request({
|
|
||||||
// url: '/fence/fence/delElectronById/'+id,
|
|
||||||
// method: 'post',
|
|
||||||
// data
|
|
||||||
// })
|
|
||||||
return request({
|
|
||||||
url: '/fence/fence/' + id,
|
|
||||||
method: 'DELETE'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//根据id设置围栏
|
|
||||||
export function setFenceWay(data) {
|
|
||||||
return request({
|
|
||||||
url: '/fence/fence/setFenceWay',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//开启围栏
|
|
||||||
export function openFence(id) {
|
|
||||||
return request({
|
|
||||||
url: '/fence/fence/open/'+id,
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//回显
|
|
||||||
export function findElectronicByid(id) {
|
|
||||||
return request({
|
|
||||||
url: '/fence/fence/findElectronicByid/'+id,
|
|
||||||
method: 'post',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//关闭围栏
|
|
||||||
export function closeFence(id) {
|
|
||||||
return request({
|
|
||||||
url: '/fence/fence/close/'+id,
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 查询围栏组列表
|
|
||||||
export function selectGroupList(data) {
|
|
||||||
return request({
|
|
||||||
url: '/fence/group/selectGroupList',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//添加
|
|
||||||
export function addGroup(data) {
|
|
||||||
return request({
|
|
||||||
url: '/fence/group/addGroup',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//修改
|
|
||||||
export function updGroup(data) {
|
|
||||||
return request({
|
|
||||||
url: `/fence/group/updGroup/${data.id}`,
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//添加
|
|
||||||
export function findGroupByid(id) {
|
|
||||||
return request({
|
|
||||||
url: '/fence/group/findGroupByid/'+id,
|
|
||||||
method: 'post',
|
|
||||||
})
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
export class geofenceList {
|
|
||||||
}
|
|
|
@ -1,61 +0,0 @@
|
||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 查询报文模版列表
|
|
||||||
export function messageTemplateTypeList() {
|
|
||||||
return request({
|
|
||||||
url: '/template/messageTemplateType/messageTemplateTypeList',
|
|
||||||
method: 'post'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 添加报文
|
|
||||||
export function addMessageTemplate(data) {
|
|
||||||
return request({
|
|
||||||
url: '/template/messageTemplateType/addMessageType',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 数据类型列表
|
|
||||||
export function findDataTypeList() {
|
|
||||||
return request({
|
|
||||||
url: '/template/dataType/dataTypeList',
|
|
||||||
method: 'post'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 报文模版
|
|
||||||
export function templateList() {
|
|
||||||
return request({
|
|
||||||
url: '/template/template/templateList',
|
|
||||||
method: 'post'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//基础类型
|
|
||||||
export function findvehicleFoundationData(templatedId,code) {
|
|
||||||
return request({
|
|
||||||
url: '/template/messageTemplateType/findvehicleFoundationData?templatedId='+templatedId+"&code="+code,
|
|
||||||
method: 'post'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//数据类型
|
|
||||||
export function findvehicleData(templatedId,code) {
|
|
||||||
return request({
|
|
||||||
url: '/template/messageTemplateType/findvehicleData?templatedId='+templatedId+"&code="+code,
|
|
||||||
method: 'post'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//设备状态
|
|
||||||
export function finddeviceStatusData(templatedId,code) {
|
|
||||||
return request({
|
|
||||||
url: '/car/sysCar/findFenceByCarVin?templatedId='+templatedId+"&code="+code,
|
|
||||||
method: 'post'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//设备状态
|
|
||||||
export function findVehicleFaultData(param) {
|
|
||||||
return request({
|
|
||||||
url: '/template/messageTemplateType/finddeviceStatusData?carVin='+param,
|
|
||||||
method: 'post'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,577 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
//电子围栏
|
||||||
|
|
||||||
|
|
||||||
|
// 查询电子围栏列表
|
||||||
|
export function listFence(data) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/fence/fenceselectList',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询电子围栏选择列表
|
||||||
|
export function fenceArray(data) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/fence/fenceArray',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//添加
|
||||||
|
export function addfence(data) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/fence/add',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//修改
|
||||||
|
export function updfence(data) {
|
||||||
|
return request({
|
||||||
|
url: `/saas/fence/upd/${data.id}`,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//删除
|
||||||
|
export function delElectronById(id) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/fence/' + id,
|
||||||
|
method: 'DELETE'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据id设置围栏
|
||||||
|
export function setFenceWay(data) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/fence/setFenceWay',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//开启围栏
|
||||||
|
export function openFence(id) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/fence/open/'+id,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//回显
|
||||||
|
export function findElectronicByid(id) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/fence/findElectronicByid/'+id,
|
||||||
|
method: 'post',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//关闭围栏
|
||||||
|
export function closeFence(id) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/fence/close/'+id,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//围栏组
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 查询围栏组列表
|
||||||
|
export function selectGroupList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/group/selectGroupList',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//添加
|
||||||
|
export function addGroup(data) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/group/addGroup',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//修改
|
||||||
|
export function updGroup(data) {
|
||||||
|
return request({
|
||||||
|
url: `/saas/group/updGroup/${data.id}`,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//添加
|
||||||
|
export function findGroupByid(id) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/group/findGroupByid/'+id,
|
||||||
|
method: 'post',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//企业信息
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//分页查询企业信息
|
||||||
|
export function enterpriseList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/selectEnterprise',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//新增企业信息
|
||||||
|
export function insert(data) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/insert',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//根据编号查询企业信息
|
||||||
|
export function searchById(enterpriseId) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/searchById',
|
||||||
|
method: 'get',
|
||||||
|
params: {enterpriseId}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//修改企业信息
|
||||||
|
export function updateEnterEnterprise(data) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/updateEnterEnterprise',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//删除企业信息
|
||||||
|
export function deleteByIds(data) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/deleteByIds',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//车辆管理
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 查询车辆基础信息列表
|
||||||
|
export function listCar(query) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/sysCar/selectSysCarVoList',
|
||||||
|
method: 'post',
|
||||||
|
data: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询车辆基础信息详细
|
||||||
|
export function getCar(id) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/sysCar/selectSysCarVoById/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增车辆基础信息
|
||||||
|
export function addCar(data) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/addSysCar',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改车辆基础信息
|
||||||
|
export function updateCar(data) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/sysCar',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除车辆基础信息
|
||||||
|
export function delCar(id) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/sysCar/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 查询车辆类型列表
|
||||||
|
export function selectCarTypeList() {
|
||||||
|
return request({
|
||||||
|
url: '/saas/carType/selectCarTypeList',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getLogCar() {
|
||||||
|
return request({
|
||||||
|
url: '/saas/sysCarLog/selectList',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//对应车辆VIN码查询对应故障 预警 电子围栏
|
||||||
|
export function findFaultData(carVin) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/sysCar/findFenceByCarVin/'+carVin,
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//报文
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 查询报文模版列表
|
||||||
|
export function messageTemplateTypeList() {
|
||||||
|
return request({
|
||||||
|
url: '/saas/messageTemplateType/messageTemplateTypeList',
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 添加报文
|
||||||
|
export function addMessageTemplate(data) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/messageTemplateType/addMessageType',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 数据类型列表
|
||||||
|
export function findDataTypeList() {
|
||||||
|
return request({
|
||||||
|
url: '/saas/dataType/dataTypeList',
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 报文模版
|
||||||
|
export function templateList() {
|
||||||
|
return request({
|
||||||
|
url: '/saas/template/templateList',
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//基础类型
|
||||||
|
export function findvehicleFoundationData(templatedId,code) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/messageTemplateType/findvehicleFoundationData?templatedId='+templatedId+"&code="+code,
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//数据类型
|
||||||
|
export function findvehicleData(templatedId,code) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/messageTemplateType/findvehicleData?templatedId='+templatedId+"&code="+code,
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//设备状态
|
||||||
|
export function finddeviceStatusData(templatedId,code) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/sysCar/findFenceByCarVin?templatedId='+templatedId+"&code="+code,
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//设备状态
|
||||||
|
export function findVehicleFaultData(param) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/messageTemplateType/finddeviceStatusData?carVin='+param,
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//警告策略
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export function selectWarnStrategyList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/strategy/selectWarnStrategyList',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//报文模板列表
|
||||||
|
// export function templateList(data) {
|
||||||
|
// return request({
|
||||||
|
// url: '/saas/template/templateList',
|
||||||
|
// method: 'post',
|
||||||
|
// data
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
//根据报文ID查报文字段
|
||||||
|
export function selectByTemplateId(templateId) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/templateNeed/selectByTemplateId/'+templateId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//策略新增
|
||||||
|
export function addWarnStrategy(data) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/strategy/addWarnStrategy',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//策略修改
|
||||||
|
export function updWarnStrategy(data) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/strategy/updWarnStrategy',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//策略回显
|
||||||
|
export function selectListByCarType(carTypeId) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/strategy/selectListByCarType/'+carTypeId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//根据车辆类型查策略
|
||||||
|
export function selectById(id) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/strategy/selectById/'+id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//查询所有规则
|
||||||
|
|
||||||
|
export function selectWarnRuleRespList() {
|
||||||
|
return request({
|
||||||
|
url: '/saas/rule/selectWarnRuleRespList',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据策略ID查规则
|
||||||
|
export function selectListByStrategyId(strategyId) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/rule/selectListByStrategyId/'+strategyId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//规则新增
|
||||||
|
export function addWarnRule(data) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/rule/addWarnRule',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//规则删除
|
||||||
|
export function updWarnRule(data) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/rule/updWarnRule',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//规则回显
|
||||||
|
export function selectRuleById(id) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/rule/selectById/'+id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//故障
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 查询车辆故障管理列表
|
||||||
|
export function listBreakdown(query) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/breakdown/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询车辆故障管理详细
|
||||||
|
export function getBreakdown(id) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/breakdown/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增车辆故障管理
|
||||||
|
export function addBreakdown(data) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/breakdown',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改车辆故障管理
|
||||||
|
export function updateBreakdown(data) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/breakdown',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除车辆故障管理
|
||||||
|
export function delBreakdown(id) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/breakdown/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//启用警告
|
||||||
|
export function enableWarningsById(id) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/breakdown/enableWarningsById/' + id,
|
||||||
|
method: 'put'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//禁用警告
|
||||||
|
export function disableWarningsById(id) {
|
||||||
|
return request({
|
||||||
|
url: '/saas/breakdown/disableWarningsById/' + id,
|
||||||
|
method: 'put'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//查询
|
||||||
|
export function listMessage(){
|
||||||
|
return request({
|
||||||
|
url:'/saas/message/list',
|
||||||
|
method:'get',
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function listStatusOne(){
|
||||||
|
return request({
|
||||||
|
url:'/saas/message/listStatusOne',
|
||||||
|
method:'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function listStatusTwo(){
|
||||||
|
return request({
|
||||||
|
url:'/saas/message/listStatusTwo',
|
||||||
|
method:'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//状态修改
|
||||||
|
export function updateStatusById(id){
|
||||||
|
return request({
|
||||||
|
url:'/saas/message/updateStatusById/'+id,
|
||||||
|
method:'put',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//查询
|
||||||
|
export function listLog(data){
|
||||||
|
return request({
|
||||||
|
url:'/saas/log/list',
|
||||||
|
method:'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function listStatusIgnore(data){
|
||||||
|
return request({
|
||||||
|
url:'/saas/log/listStatusIgnore',
|
||||||
|
method:'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function listStatusSolve(data){
|
||||||
|
return request({
|
||||||
|
url:'/saas/log/listStatusSolve',
|
||||||
|
method:'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function listStatusProcess(data){
|
||||||
|
return request({
|
||||||
|
url:'/saas/log/listStatusProcess',
|
||||||
|
method:'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将状态改为忽略
|
||||||
|
// export function updateStatusById(id){
|
||||||
|
// return request({
|
||||||
|
// url:'/breakdown/log/updateStatusById/'+id,
|
||||||
|
// method:'put'
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
|
@ -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', '/enterprise']
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
NProgress.start()
|
NProgress.start()
|
||||||
|
|
|
@ -50,6 +50,11 @@ export const constantRoutes = [
|
||||||
component: () => import('@/views/register'),
|
component: () => import('@/views/register'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/enterprise',
|
||||||
|
component: () => import('@/views/enterprise'),
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/404',
|
path: '/404',
|
||||||
component: () => import('@/views/error/404'),
|
component: () => import('@/views/error/404'),
|
||||||
|
|
|
@ -0,0 +1,221 @@
|
||||||
|
<template>
|
||||||
|
<div class="register">
|
||||||
|
<el-form ref="enterpriseForm" :model="enterpriseForm" :rules="enterpriseRules" class="register-form">
|
||||||
|
<h3 class="title">若依后台管理系统</h3>
|
||||||
|
<el-form-item prop="firmName">
|
||||||
|
<el-input v-model="enterpriseForm.firmName" auto-complete="off" placeholder="企业名称" type="text">
|
||||||
|
<svg-icon slot="prefix" class="el-input__icon input-icon" icon-class="user"/>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="databaseName">
|
||||||
|
<el-input
|
||||||
|
v-model="enterpriseForm.databaseName"
|
||||||
|
auto-complete="off"
|
||||||
|
placeholder="自定义数据库"
|
||||||
|
type="databaseName"
|
||||||
|
@keyup.enter.native="handleRegister"
|
||||||
|
>
|
||||||
|
<svg-icon slot="prefix" class="el-input__icon input-icon" icon-class="databaseName"/>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="confirmDatabaseName">
|
||||||
|
<el-input
|
||||||
|
v-model="enterpriseForm.confirmDatabaseName"
|
||||||
|
auto-complete="off"
|
||||||
|
placeholder="确认自定义数据库"
|
||||||
|
type="databaseName"
|
||||||
|
@keyup.enter.native="handleRegister"
|
||||||
|
>
|
||||||
|
<svg-icon slot="prefix" class="el-input__icon input-icon" icon-class="databaseName"/>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="captchaEnabled" prop="code">
|
||||||
|
<el-input
|
||||||
|
v-model="enterpriseForm.code"
|
||||||
|
auto-complete="off"
|
||||||
|
placeholder="验证码"
|
||||||
|
style="width: 63%"
|
||||||
|
@keyup.enter.native="handleRegister"
|
||||||
|
>
|
||||||
|
<svg-icon slot="prefix" class="el-input__icon input-icon" icon-class="validCode"/>
|
||||||
|
</el-input>
|
||||||
|
<div class="register-code">
|
||||||
|
<img :src="codeUrl" class="register-code-img" @click="getCode"/>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item style="width:100%;">
|
||||||
|
<el-button
|
||||||
|
:loading="loading"
|
||||||
|
size="medium"
|
||||||
|
style="width:100%;"
|
||||||
|
type="primary"
|
||||||
|
@click.native.prevent="handleRegister"
|
||||||
|
>
|
||||||
|
<span v-if="!loading">企业入驻</span>
|
||||||
|
<span v-else>入 驻 中...</span>
|
||||||
|
</el-button>
|
||||||
|
<div style="float: right;">
|
||||||
|
<router-link :to="'/login'" class="link-type">使用已有账户登录</router-link>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<!-- 底部 -->
|
||||||
|
<div class="el-register-footer">
|
||||||
|
<span>Copyright © 2018-2023 muyu.vip All Rights Reserved.</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {getCodeImg, enterprise} from "@/api/login";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
|
||||||
|
name:"Enterprise",
|
||||||
|
data() {
|
||||||
|
const equalToPassword = (rule, value, callback) => {
|
||||||
|
if (this.enterpriseForm.databaseName !== value) {
|
||||||
|
callback(new Error("两次输入的自定义数据库不一致"));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
codeUrl: "",
|
||||||
|
enterpriseForm: {
|
||||||
|
firmName: "",
|
||||||
|
databaseName: "",
|
||||||
|
confirmDatabaseName: "",
|
||||||
|
code: "",
|
||||||
|
uuid: ""
|
||||||
|
},
|
||||||
|
enterpriseRules: {
|
||||||
|
firmName: [
|
||||||
|
{required: true, trigger: "blur", message: "请输入您的企业名称"},
|
||||||
|
{min:2,max: 20,message: '企业名称长度必须介于2-20之间',trigger: 'blur'}
|
||||||
|
|
||||||
|
],
|
||||||
|
databaseName: [
|
||||||
|
{required: true, trigger: "blur", message: "请输入您的自定义数据库"},
|
||||||
|
{min: 2, max: 10, message: '用户自定义数据库长度必须介于 2 和 10 之间', trigger: 'blur'}
|
||||||
|
],
|
||||||
|
confirmDatabaseName: [
|
||||||
|
{required: true, trigger: "blur", message: "请再次输入您的自定义数据库"},
|
||||||
|
{required: true, validator: equalToPassword, trigger: "blur"}
|
||||||
|
],
|
||||||
|
code: [{required: true, trigger: "change", message: "请输入验证码"}]
|
||||||
|
},
|
||||||
|
loading: false,
|
||||||
|
captchaEnabled: true
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getCode();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getCode() {
|
||||||
|
getCodeImg().then(res => {
|
||||||
|
this.captchaEnabled = res.data.captchaEnabled === undefined ? true : res.data.captchaEnabled;
|
||||||
|
if (this.captchaEnabled) {
|
||||||
|
this.codeUrl = "data:image/gif;base64," + res.data.img;
|
||||||
|
this.enterpriseForm.uuid = res.data.uuid;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleRegister() {
|
||||||
|
this.$refs.enterpriseForm.validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
this.loading = true;
|
||||||
|
enterprise(this.enterpriseForm).then(res => {
|
||||||
|
const firmName = this.enterpriseForm.firmName;
|
||||||
|
this.$alert("<font color='red'>恭喜你,您的企业 " + firmName + " 入驻成功!</font>", '系统提示', {
|
||||||
|
dangerouslyUseHTMLString: true,
|
||||||
|
type: 'success'
|
||||||
|
}).then(() => {
|
||||||
|
this.$router.push("/login");
|
||||||
|
}).catch(() => {
|
||||||
|
});
|
||||||
|
}).catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
if (this.captchaEnabled) {
|
||||||
|
this.getCode();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" rel="stylesheet/scss">
|
||||||
|
.register {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 100%;
|
||||||
|
background-image: url("../assets/images/login-background.jpg");
|
||||||
|
background-size: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
margin: 0px auto 30px auto;
|
||||||
|
text-align: center;
|
||||||
|
color: #707070;
|
||||||
|
}
|
||||||
|
|
||||||
|
.register-form {
|
||||||
|
border-radius: 6px;
|
||||||
|
background: #ffffff;
|
||||||
|
width: 400px;
|
||||||
|
padding: 25px 25px 5px 25px;
|
||||||
|
|
||||||
|
.el-input {
|
||||||
|
height: 38px;
|
||||||
|
|
||||||
|
input {
|
||||||
|
height: 38px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-icon {
|
||||||
|
height: 39px;
|
||||||
|
width: 14px;
|
||||||
|
margin-left: 2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.register-tip {
|
||||||
|
font-size: 13px;
|
||||||
|
text-align: center;
|
||||||
|
color: #bfbfbf;
|
||||||
|
}
|
||||||
|
|
||||||
|
.register-code {
|
||||||
|
width: 33%;
|
||||||
|
height: 38px;
|
||||||
|
float: right;
|
||||||
|
|
||||||
|
img {
|
||||||
|
cursor: pointer;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-register-footer {
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
color: #fff;
|
||||||
|
font-family: Arial;
|
||||||
|
font-size: 12px;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.register-code-img {
|
||||||
|
height: 38px;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -1,407 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
||||||
<el-form-item label="围栏名称" prop="fenceName">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.fenceName"
|
|
||||||
placeholder="请输入围栏名称"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="围栏状态" prop="fenceFlag">
|
|
||||||
<el-select v-model="queryParams.fenceFlag" placeholder="请选择围栏状态" clearable>
|
|
||||||
<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" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['fence:fence:add']"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
plain
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
v-hasPermi="['fence:fence:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['fence:fence:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['fence:fence:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="fenceList" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="围栏名称" align="center" prop="fenceName" />
|
|
||||||
<el-table-column label="围栏类型" align="center" prop="fenceType" :formatter="fenceTypeFormatter" />
|
|
||||||
<el-table-column label="围栏状态" align="center" prop="fenceFlag" :formatter="fenceFlagFormatter" />
|
|
||||||
<el-table-column label="经纬度信息" align="center" prop="longitudeAndLatitudeInformation" />
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['fence:fence:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['fence:fence:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改电子围栏对话框 -->
|
|
||||||
<el-dialog :title="title" :visible.sync="open" width="750px" append-to-body>
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
||||||
<el-form-item label="围栏名称" prop="fenceName">
|
|
||||||
<el-input v-model="form.fenceName" placeholder="请输入围栏名称" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="围栏类型" prop="fenceType">
|
|
||||||
<el-radio-group v-model="form.fenceType">
|
|
||||||
<el-radio :label="1">驶入</el-radio>
|
|
||||||
<el-radio :label="2">驶出</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="围栏状态" prop="fenceFlag">
|
|
||||||
<el-select v-model="form.fenceFlag" placeholder="请选择围栏状态" clearable>
|
|
||||||
<el-option label="正常" :value="1"></el-option>
|
|
||||||
<el-option label="停用" :value="2"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item v-if="form.fencePriority != null" label="优先级回显" prop="fencePriority">
|
|
||||||
<el-input v-model="form.fencePriority" placeholder="请输入围栏优先级" />
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="优先级" prop="fencePriority">
|
|
||||||
<el-transfer
|
|
||||||
v-model="selectedGroups"
|
|
||||||
:data="transferData"
|
|
||||||
:titles="['围栏组', '优先级']"
|
|
||||||
style="margin-top: 15px;"
|
|
||||||
></el-transfer>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<el-form-item label="经纬度信息" prop="longitudeAndLatitudeInformation">
|
|
||||||
<el-input v-model="form.longitudeAndLatitudeInformation" placeholder="请输入经纬度信息" />
|
|
||||||
<el-button type="primary" @click="openDialog">选择经纬度</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
<el-dialog :title="'选择经纬度信息'" :visible.sync="showLocationDialog" width="600px">
|
|
||||||
<select-location @locationSelected="handleLocationSelected"></select-location>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { listFence, getFence, delFence, addFence, updateFence } from "/src/api/fence/fence";
|
|
||||||
import SelectLocation from '@/components/SelectLocation.vue'
|
|
||||||
import { selectGroupList } from '@/api/fence/group'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "Fence",
|
|
||||||
components:{
|
|
||||||
SelectLocation
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
//定义围栏组集合
|
|
||||||
group:[],
|
|
||||||
// el-transfer 的数据源
|
|
||||||
transferData: [],
|
|
||||||
// el-transfer 的当前选择值,用于存储选中的围栏组编号
|
|
||||||
selectedGroups: [],
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
showLocationDialog:false,
|
|
||||||
selectedLocation:null,
|
|
||||||
|
|
||||||
// openLocationDialogVisible:false,// 用于控制选择经纬度对话框的显示
|
|
||||||
// 遮罩层
|
|
||||||
loading: true,
|
|
||||||
// 选中数组
|
|
||||||
ids: [],
|
|
||||||
// 非单个禁用
|
|
||||||
single: true,
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 显示搜索条件
|
|
||||||
showSearch: true,
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
// 电子围栏表格数据
|
|
||||||
fenceList: [],
|
|
||||||
// 弹出层标题
|
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
fenceName: null,
|
|
||||||
fenceType: null,
|
|
||||||
fenceFlag: null,
|
|
||||||
longitudeAndLatitudeInformation: null,
|
|
||||||
fencePriority: null,
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {
|
|
||||||
fenceId:null,
|
|
||||||
fenceName:'',
|
|
||||||
fenceType:null,// 确保类型正确,字符串或数字,取决于您实际的数据类型
|
|
||||||
fenceFlag:null,
|
|
||||||
fencePriority: null, // 初始化为 null
|
|
||||||
longitudeAndLatitudeInformation:[]
|
|
||||||
},
|
|
||||||
// 表单校验
|
|
||||||
rules: {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
// 对话框页面的组件
|
|
||||||
computed: {
|
|
||||||
selectedLongitudeAndLatitude() {
|
|
||||||
return this.$store.state.selectedLongitudeAndLatitude;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
selectedLongitudeAndLatitude(newValue) {
|
|
||||||
if (newValue) {
|
|
||||||
this.form.longitudeAndLatitudeInformation = newValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
this.getGroupList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
//查询围栏组集合
|
|
||||||
getGroupList() {
|
|
||||||
selectGroupList().then(response => {
|
|
||||||
this.group = response.data;
|
|
||||||
// 格式化数据
|
|
||||||
if (Array.isArray(response.data)) {
|
|
||||||
this.transferData = response.data.map((item, index) => ({
|
|
||||||
key: item.groupId ? item.groupId.toString() : `defaultKey${index}`, // 使用默认键值
|
|
||||||
label: item.groupName || `Group ${index}`
|
|
||||||
}));
|
|
||||||
} else {
|
|
||||||
console.error('Response data is not an array:', response.data);
|
|
||||||
this.transferData = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
// 确保 selectedGroups 包含正确的数据
|
|
||||||
if (this.form.fencePriority) {
|
|
||||||
try {
|
|
||||||
const parsedPriority = JSON.parse(this.form.fencePriority);
|
|
||||||
this.selectedGroups = parsedPriority.map(Number);
|
|
||||||
} catch (error) {
|
|
||||||
console.error('解析 fencePriority 错误:', error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).catch(error => {
|
|
||||||
console.error('Error fetching group list:', error);
|
|
||||||
this.transferData = [];
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 查询电子围栏列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
listFence(this.queryParams).then(response => {
|
|
||||||
this.fenceList = response.data.rows;
|
|
||||||
this.total = response.data.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
fenceId: null,
|
|
||||||
fenceName: null,
|
|
||||||
fenceType: null,
|
|
||||||
fenceFlag: null,
|
|
||||||
longitudeAndLatitudeInformation: null,
|
|
||||||
fencePriority: null,
|
|
||||||
createBy: null,
|
|
||||||
createTime: null,
|
|
||||||
updateBy: null,
|
|
||||||
updateTime: null,
|
|
||||||
remark: null
|
|
||||||
};
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
this.ids = selection.map(item => item.fenceId)
|
|
||||||
this.single = selection.length!==1
|
|
||||||
this.multiple = !selection.length
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
|
||||||
this.open = true;
|
|
||||||
this.title = "添加电子围栏";
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset();
|
|
||||||
const fenceId = row.fenceId || this.ids
|
|
||||||
getFence(fenceId).then(response => {
|
|
||||||
console.log(response.data);// 打印数据确认内容
|
|
||||||
this.form = response.data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = "修改电子围栏";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
submitForm() {
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
// 将 selectedGroups 转换为 JSON 格式并赋值给 form.fencePriority
|
|
||||||
this.form.fencePriority = JSON.stringify(this.selectedGroups);
|
|
||||||
|
|
||||||
if (this.form.fenceId != null) {
|
|
||||||
updateFence(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addFence(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const fenceIds = row.fenceId || this.ids;
|
|
||||||
this.$modal.confirm('是否确认删除电子围栏编号为"' + fenceIds + '"的数据项?').then(function() {
|
|
||||||
return delFence(fenceIds);
|
|
||||||
}).then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.$modal.msgSuccess("删除成功");
|
|
||||||
}).catch(() => {});
|
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
this.download('fence/fence/export', {
|
|
||||||
...this.queryParams
|
|
||||||
}, `fence_${new Date().getTime()}.xlsx`)
|
|
||||||
},
|
|
||||||
|
|
||||||
fenceTypeFormatter(row,column,value) {
|
|
||||||
return value == '1' ?'驶入' :'驶出';
|
|
||||||
},
|
|
||||||
fenceFlagFormatter(row,column,value) {
|
|
||||||
return value == '1' ?'正常' :'停用';
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
openDialog() {
|
|
||||||
this.showLocationDialog = true;
|
|
||||||
// 设置过几秒后关闭弹框
|
|
||||||
setTimeout(() => {
|
|
||||||
this.showLocationDialog = false; // 关闭弹框
|
|
||||||
}, 10000); // 这里的 3000 毫秒等于 3 秒
|
|
||||||
},
|
|
||||||
handleLocationSelected(location) {
|
|
||||||
this.showLocationDialog = false;
|
|
||||||
if (location) {
|
|
||||||
this.form.longitudeAndLatitudeInformation = `${location.lng},${location.lat}`;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
|
@ -1,89 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<el-table
|
|
||||||
ref="multipleTable"
|
|
||||||
:data="tableData"
|
|
||||||
tooltip-effect="dark"
|
|
||||||
style="width: 100%"
|
|
||||||
@selection-change="handleSelectionChange">
|
|
||||||
<el-table-column
|
|
||||||
type="selection"
|
|
||||||
width="55">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="日期"
|
|
||||||
width="120">
|
|
||||||
<template slot-scope="scope">{{ scope.row.date }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
prop="name"
|
|
||||||
label="姓名"
|
|
||||||
width="120">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
prop="address"
|
|
||||||
label="地址"
|
|
||||||
show-overflow-tooltip>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<div style="margin-top: 20px">
|
|
||||||
<el-button @click="toggleSelection([tableData[1], tableData[2]])">切换第二、第三行的选中状态</el-button>
|
|
||||||
<el-button @click="toggleSelection()">取消选择</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
tableData: [{
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1518 弄'
|
|
||||||
}, {
|
|
||||||
date: '2016-05-02',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1518 弄'
|
|
||||||
}, {
|
|
||||||
date: '2016-05-04',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1518 弄'
|
|
||||||
}, {
|
|
||||||
date: '2016-05-01',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1518 弄'
|
|
||||||
}, {
|
|
||||||
date: '2016-05-08',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1518 弄'
|
|
||||||
}, {
|
|
||||||
date: '2016-05-06',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1518 弄'
|
|
||||||
}, {
|
|
||||||
date: '2016-05-07',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1518 弄'
|
|
||||||
}],
|
|
||||||
multipleSelection: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
toggleSelection(rows) {
|
|
||||||
if (rows) {
|
|
||||||
rows.forEach(row => {
|
|
||||||
console.log(row)
|
|
||||||
this.$refs.multipleTable.toggleRowSelection(row);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.$refs.multipleTable.clearSelection();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleSelectionChange(val) {
|
|
||||||
this.multipleSelection = val;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
|
@ -52,6 +52,9 @@
|
||||||
<div v-if="register" style="float: right;">
|
<div v-if="register" style="float: right;">
|
||||||
<router-link :to="'/register'" class="link-type">立即注册</router-link>
|
<router-link :to="'/register'" class="link-type">立即注册</router-link>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="enterprise" style="float: right;">
|
||||||
|
<router-link :to="'/enterprise'" class="link-type">企业入驻</router-link>
|
||||||
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<!-- 底部 -->
|
<!-- 底部 -->
|
||||||
|
@ -92,6 +95,8 @@ export default {
|
||||||
captchaEnabled: false,
|
captchaEnabled: false,
|
||||||
// 注册开关
|
// 注册开关
|
||||||
register: false,
|
register: false,
|
||||||
|
// 入驻开关
|
||||||
|
enterprise:false,
|
||||||
redirect: undefined
|
redirect: undefined
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
|
@ -34,12 +34,14 @@
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
<el-button @click="drawer = true" type="primary" icon="el-icon-setting" style="margin-left: 16px;" />
|
<el-button @click="drawer = true" type="primary" icon="el-icon-setting" style="margin-left: 16px;" />
|
||||||
|
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-radio-group v-model="direction">
|
<!-- 抽屉 --->
|
||||||
|
<el-radio-group v-model="direction" />
|
||||||
|
|
||||||
|
|
||||||
</el-radio-group>
|
|
||||||
|
|
||||||
|
|
||||||
<el-drawer title="通知" :visible.sync="drawer" :direction="direction" :before-close="handleClose">
|
<el-drawer title="通知" :visible.sync="drawer" :direction="direction" :before-close="handleClose">
|
||||||
|
@ -72,6 +74,17 @@
|
||||||
<el-table-column label="故障编号" align="center" prop="id" />
|
<el-table-column label="故障编号" align="center" prop="id" />
|
||||||
<el-table-column label="内容" align="center" prop="content" />
|
<el-table-column label="内容" align="center" prop="content" />
|
||||||
<el-table-column label="开始时间" align="center" prop="createTime"/>
|
<el-table-column label="开始时间" align="center" prop="createTime"/>
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdateStatusById(scope.row.id)">
|
||||||
|
已读
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
@ -126,6 +139,11 @@
|
||||||
<el-table v-loading="loading" :data="breakdownList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="breakdownList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="故障码编码" align="center" prop="faultCode" />
|
<el-table-column label="故障码编码" align="center" prop="faultCode" />
|
||||||
|
<el-table-column align="center" label="车辆类型" prop="carTypeId">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.car_type_id" :value="scope.row.carTypeId"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column align="center" label="故障类型" prop="typeId">
|
<el-table-column align="center" label="故障类型" prop="typeId">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.sys_fault_type" :value="scope.row.typeId"/>
|
<dict-tag :options="dict.type.sys_fault_type" :value="scope.row.typeId"/>
|
||||||
|
@ -147,6 +165,7 @@
|
||||||
<dict-tag :options="dict.type.sys_warn_status" :value="scope.row.warnStatus"/>
|
<dict-tag :options="dict.type.sys_warn_status" :value="scope.row.warnStatus"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -199,15 +218,25 @@
|
||||||
<el-form-item label="故障名" prop="faultName">
|
<el-form-item label="故障名" prop="faultName">
|
||||||
<el-input v-model="form.faultName" placeholder="请输入故障名" />
|
<el-input v-model="form.faultName" placeholder="请输入故障名" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="车辆类型" prop="carTypeId">
|
||||||
|
<el-select v-model="form.carTypeId" placeholder="请选择车辆类型">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.car_type_id"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="Number(dict.value)"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="故障类型" prop="typeId">
|
<el-form-item label="故障类型" prop="typeId">
|
||||||
<el-radio-group v-model="form.typeId">
|
<el-select v-model="form.typeId" placeholder="请选择故障类型">
|
||||||
<el-radio
|
<el-option
|
||||||
v-for="dict in dict.type.sys_fault_type"
|
v-for="dict in dict.type.sys_fault_type"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.value"
|
:label="dict.label"
|
||||||
>{{ dict.label }}
|
:value="Number(dict.value)"
|
||||||
</el-radio>
|
/>
|
||||||
</el-radio-group>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="故障标签" prop="faultLabel">
|
<el-form-item label="故障标签" prop="faultLabel">
|
||||||
<el-input v-model="form.faultLabel" placeholder="请输入故障标签" />
|
<el-input v-model="form.faultLabel" placeholder="请输入故障标签" />
|
||||||
|
@ -219,14 +248,14 @@
|
||||||
<el-input v-model="form.faultValue" placeholder="请输入故障值" />
|
<el-input v-model="form.faultValue" placeholder="请输入故障值" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="故障级别" prop="faultRank">
|
<el-form-item label="故障级别" prop="faultRank">
|
||||||
<el-radio-group v-model="form.faultRank">
|
<el-select v-model="form.faultRank" placeholder="请选择故障级别">
|
||||||
<el-radio
|
<el-option
|
||||||
v-for="dict in dict.type.sys_fault_rank"
|
v-for="dict in dict.type.sys_fault_rank"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.value"
|
:label="dict.label"
|
||||||
>{{ dict.label }}
|
:value="Number(dict.value)"
|
||||||
</el-radio>
|
/>
|
||||||
</el-radio-group>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="故障描述信息" prop="faultDesc">
|
<el-form-item label="故障描述信息" prop="faultDesc">
|
||||||
<el-input v-model="form.faultDesc" placeholder="请输入故障描述信息" />
|
<el-input v-model="form.faultDesc" placeholder="请输入故障描述信息" />
|
||||||
|
@ -250,17 +279,24 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listBreakdown, getBreakdown, delBreakdown, addBreakdown, updateBreakdown,enableWarningsById,disableWarningsById } from "/src/api/breakdown/breakdown";
|
|
||||||
import { listMessage,listStatusOne,listStatusTwo } from '/src/api/breakdown/message'
|
|
||||||
|
|
||||||
|
import {
|
||||||
|
addBreakdown,
|
||||||
|
delBreakdown, disableWarningsById,
|
||||||
|
enableWarningsById,
|
||||||
|
getBreakdown,
|
||||||
|
listBreakdown, listMessage, listStatusOne, listStatusTwo,
|
||||||
|
updateBreakdown, updateStatusById
|
||||||
|
} from '@/api/saas/saas'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Breakdown",
|
name: "Breakdown",
|
||||||
dicts: ['sys_fault_rank', 'sys_fault_status','sys_warn_status','sys_fault_type','sys_car_fault_message_status'],
|
dicts: ['sys_fault_rank', 'sys_fault_status','sys_warn_status','sys_fault_type','sys_car_fault_message_status','car_type_id'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeName: 'first',
|
activeName: 'first',
|
||||||
drawer: false,
|
drawer: false,
|
||||||
|
//向右打开
|
||||||
direction: 'rtl',
|
direction: 'rtl',
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
|
@ -386,6 +422,7 @@ export default {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateBreakdown(this.form).then(response => {
|
updateBreakdown(this.form).then(response => {
|
||||||
|
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
@ -434,6 +471,15 @@ export default {
|
||||||
this.$modal.msgSuccess("禁用成功");
|
this.$modal.msgSuccess("禁用成功");
|
||||||
}).catch(()=>{});
|
}).catch(()=>{});
|
||||||
},
|
},
|
||||||
|
//修改站内信信息的状态
|
||||||
|
handleUpdateStatusById(id){
|
||||||
|
this.$modal.confirm('是否确认读取编号为"'+id+'"的数据项?').then(function(){
|
||||||
|
return updateStatusById(id);
|
||||||
|
}).then(()=>{
|
||||||
|
this.getMessageList();
|
||||||
|
this.$modal.msgSuccess("读取成功");
|
||||||
|
}).catch(()=>{});
|
||||||
|
},
|
||||||
handleClose(done) {
|
handleClose(done) {
|
||||||
this.$confirm('确认关闭?')
|
this.$confirm('确认关闭?')
|
||||||
.then(_ => {
|
.then(_ => {
|
||||||
|
@ -442,6 +488,7 @@ export default {
|
||||||
.catch(_ => {});
|
.catch(_ => {});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
// 显示站内信
|
// 显示站内信
|
||||||
getMessageList() {
|
getMessageList() {
|
||||||
listMessage().then(response => {
|
listMessage().then(response => {
|
||||||
|
@ -460,10 +507,10 @@ export default {
|
||||||
},
|
},
|
||||||
handleClick(tab, event) {
|
handleClick(tab, event) {
|
||||||
console.log(tab, event);
|
console.log(tab, event);
|
||||||
}
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.card-container{
|
.card-container{
|
|
@ -12,6 +12,14 @@
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="故障码" prop="faultCode">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.faultCode"
|
||||||
|
placeholder="请输入故障码"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="status">
|
<el-form-item label="状态" prop="status">
|
||||||
<el-select v-model="queryParams.status" clearable placeholder="状态">
|
<el-select v-model="queryParams.status" clearable placeholder="状态">
|
||||||
<el-option
|
<el-option
|
||||||
|
@ -28,12 +36,21 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<rl-row>
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
@click="handelExport">导出</el-button>
|
||||||
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</rl-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="messageList" stripe>
|
<el-table v-loading="loading" :data="messageList" stripe @selection-chang="handleSelectionChange">
|
||||||
<el-table-column label="故障编号" align="center" prop="sysCarFaultId" />
|
<el-table-column type="selection" width="55" align="center"/>
|
||||||
|
<el-table-column label="故障码" align="center" prop="faultCode" />
|
||||||
<el-table-column label="VIN码" align="center" prop="vin" />
|
<el-table-column label="VIN码" align="center" prop="vin" />
|
||||||
<el-table-column label="开始时间" align="center" prop="createTime" />
|
<el-table-column label="开始时间" align="center" prop="createTime" />
|
||||||
<el-table-column label="结束时间" align="center" prop="updateTime" />
|
<el-table-column label="结束时间" align="center" prop="updateTime" />
|
||||||
|
@ -53,6 +70,7 @@
|
||||||
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="解决" name="resolve">
|
<el-tab-pane label="解决" name="resolve">
|
||||||
|
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="VIN码" prop="vin">
|
<el-form-item label="VIN码" prop="vin">
|
||||||
<el-input
|
<el-input
|
||||||
|
@ -62,6 +80,14 @@
|
||||||
@ceyup.enter.native="handleQuery"
|
@ceyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="故障码" prop="faultCode">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.faultCode"
|
||||||
|
placeholder="请输入故障码"
|
||||||
|
clearable
|
||||||
|
@ceyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
@ -71,10 +97,11 @@
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getListSolve"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getListSolve"></right-toolbar>
|
||||||
</rl-row>
|
</rl-row>
|
||||||
<el-table v-loading="loading" :data="StatusSolveList" stripe>
|
<el-table v-loading="loading" :data="StatusSolveList" stripe>
|
||||||
<el-table-column label="故障编号" align="center" prop="sysCarFaultId" />
|
<el-table-column label="故障码" align="center" prop="faultCode" />
|
||||||
<el-table-column label="VIN码" align="center" prop="vin" />
|
<el-table-column label="VIN码" align="center" prop="vin" />
|
||||||
<el-table-column label="开始时间" align="center" prop="createTime" />
|
<el-table-column label="开始时间" align="center" prop="createTime" />
|
||||||
<el-table-column label="结束时间" align="center" prop="updateTime" />
|
<el-table-column label="结束时间" align="center" prop="updateTime" />
|
||||||
|
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination
|
<pagination
|
||||||
v-show="totalSolve > 0"
|
v-show="totalSolve > 0"
|
||||||
|
@ -94,20 +121,47 @@
|
||||||
@ceyup.enter.native="handleQuery"
|
@ceyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="故障码" prop="faultCode">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.faultCode"
|
||||||
|
placeholder="请输入故障码"
|
||||||
|
clearable
|
||||||
|
@ceyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<rl-row>
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
@click="handleUpdateStatusIgnore">忽略</el-button>
|
||||||
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</rl-row>
|
</el-row>
|
||||||
<el-table v-loading="loading" :data="StatusProcessList" stripe>
|
<el-table v-loading="loading" :data="StatusProcessList" stripe @selection-chang="handleSelectionChange">
|
||||||
<el-table-column label="故障编号" align="center" prop="sysCarFaultId" />
|
<el-table-column type="selection" width="55" align="center"/>
|
||||||
|
<el-table-column label="故障码" align="center" prop="faultCode" />
|
||||||
<el-table-column label="VIN码" align="center" prop="vin" />
|
<el-table-column label="VIN码" align="center" prop="vin" />
|
||||||
<el-table-column label="开始时间" align="center" prop="createTime" />
|
<el-table-column label="开始时间" align="center" prop="createTime" />
|
||||||
<el-table-column label="结束时间" align="center" prop="updateTime" />
|
<el-table-column label="结束时间" align="center" prop="updateTime" />
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdateStatusIgnore(scope.row)">
|
||||||
|
忽略
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination
|
<pagination
|
||||||
|
@ -128,6 +182,14 @@
|
||||||
@ceyup.enter.native="handleQuery"
|
@ceyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="故障码" prop="faultCode">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.faultCode"
|
||||||
|
placeholder="请输入故障码"
|
||||||
|
clearable
|
||||||
|
@ceyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
@ -137,7 +199,7 @@
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</rl-row>
|
</rl-row>
|
||||||
<el-table v-loading="loading" :data="StatusIgnoreList" stripe>
|
<el-table v-loading="loading" :data="StatusIgnoreList" stripe>
|
||||||
<el-table-column label="故障编号" align="center" prop="sysCarFaultId" />
|
<el-table-column label="故障码" align="center" prop="faultCode" />
|
||||||
<el-table-column label="VIN码" align="center" prop="vin" />
|
<el-table-column label="VIN码" align="center" prop="vin" />
|
||||||
<el-table-column label="开始时间" align="center" prop="createTime" />
|
<el-table-column label="开始时间" align="center" prop="createTime" />
|
||||||
<el-table-column label="结束时间" align="center" prop="updateTime" />
|
<el-table-column label="结束时间" align="center" prop="updateTime" />
|
||||||
|
@ -158,7 +220,13 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listLog ,listStatusIgnore,listStatusProcess,listStatusSolve} from '/src/api/breakdown/Log';
|
import {
|
||||||
|
listLog,
|
||||||
|
listStatusIgnore,
|
||||||
|
listStatusProcess,
|
||||||
|
listStatusSolve,
|
||||||
|
updateStatusById
|
||||||
|
} from '@/api/saas/saas'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
dicts:['sys_car_fault_log_status'],
|
dicts:['sys_car_fault_log_status'],
|
||||||
|
@ -167,6 +235,12 @@ export default {
|
||||||
props:{},
|
props:{},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
//选中数组
|
||||||
|
ids:[],
|
||||||
|
//非单个禁用
|
||||||
|
single:true,
|
||||||
|
//非多个禁用
|
||||||
|
multiple:true,
|
||||||
activeName:'all',
|
activeName:'all',
|
||||||
loading:true,
|
loading:true,
|
||||||
messageList:[],
|
messageList:[],
|
||||||
|
@ -184,7 +258,8 @@ export default {
|
||||||
pageNum:1,
|
pageNum:1,
|
||||||
pageSize:10,
|
pageSize:10,
|
||||||
vin:null,
|
vin:null,
|
||||||
status:null
|
status:null,
|
||||||
|
faultCode:null
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -243,6 +318,27 @@ export default {
|
||||||
this.resetForm("queryForm");
|
this.resetForm("queryForm");
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handelExport(){
|
||||||
|
this.download('breakdown/log/export',{
|
||||||
|
...this.queryParams
|
||||||
|
},`log_${new Date().getTime()}.xlsx`)
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
handleUpdateStatusIgnore(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('是否确认忽略编号为"' + ids + '"的数据项?').then(function() {
|
||||||
|
return updateStatusById(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getListIgnore();
|
||||||
|
this.$modal.msgSuccess("忽略成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
@ -250,14 +346,7 @@ export default {
|
||||||
this.getListProcess()
|
this.getListProcess()
|
||||||
this.getListSolve()
|
this.getListSolve()
|
||||||
},
|
},
|
||||||
mounted() {},
|
|
||||||
beforeCreate() {},
|
|
||||||
beforeMount() {},
|
|
||||||
beforeUpdate() {},
|
|
||||||
updated() {},
|
|
||||||
beforeDestroy() {},
|
|
||||||
destroyed() {},
|
|
||||||
activated() {}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
<script>
|
<script>
|
||||||
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||||
//例如:import 《组件名称》 from '《组件路径》,
|
//例如:import 《组件名称》 from '《组件路径》,
|
||||||
import { getLogCar } from '@/api/car/vehicle_manage'
|
import { getLogCar } from '@/api/saas/saas'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
//import引入的组件需要注入到对象中才能使用"
|
//import引入的组件需要注入到对象中才能使用"
|
|
@ -217,16 +217,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
|
||||||
listCar,
|
import { addCar, delCar, findFaultData, getCar, listCar, selectCarTypeList, updateCar } from '@/api/saas/saas'
|
||||||
getCar,
|
|
||||||
delCar,
|
|
||||||
addCar,
|
|
||||||
updateCar,
|
|
||||||
selectCarTypeList,
|
|
||||||
selectFenceList, findFaultData
|
|
||||||
} from '/src/api/car/vehicle_manage'
|
|
||||||
import { findVehicleFaultData } from '../../../api/message/message'
|
|
||||||
export default {
|
export default {
|
||||||
name: "Car",
|
name: "Car",
|
||||||
data() {
|
data() {
|
|
@ -0,0 +1,227 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-form :inline="true" :model="requestParam" :rules="dataRule" ref="form">
|
||||||
|
<el-form-item prop="enterpriseName">
|
||||||
|
<el-input v-model="requestParam.enterpriseName" placeholder="请输入企业名称" maxlength="10" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="searchHandle()">查询</el-button>
|
||||||
|
<el-button type="primary" @click="dialogFormVisible = true">新增</el-button>
|
||||||
|
<el-button type="danger" @click="batchDeleteHandle()">批量删除</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-table :data="enterprise" :header-cell-style="{ background: '#f5f7fa' }" border v-loading="loading" @selection-change="selectionChangeHandle">
|
||||||
|
<el-table-column type="selection" header-align="center" align="center" width="50" />
|
||||||
|
<el-table-column type="index" header-align="center" align="center" width="100" label="企业编号">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="enterprise_name" header-align="center" align="center" label="企业名称" min-width="180" />
|
||||||
|
<el-table-column prop="enterprise_car_count" header-align="center" align="center" label="企业车辆数量" min-width="180" />
|
||||||
|
<el-table-column prop="enterprise_fence_count" header-align="center" align="center" label="企业电子围栏数量" min-width="180" />
|
||||||
|
<el-table-column header-align="center" align="center" width="150" label="操作">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="text" @click="handleEdit(scope.row.enterprise_id)">修改</el-button>
|
||||||
|
<el-button type="text" @click="deleteHandle(scope.row.enterprise_id)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex" :page-sizes="[10, 20, 50]" :page-size="pageSize" :total="totalCount" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||||
|
|
||||||
|
<!-- 新增/修改弹窗 -->
|
||||||
|
<el-dialog title="收货地址" :visible.sync="dialogFormVisible" ref="dialog">
|
||||||
|
<el-form :model="operations" ref="formRef" :rules="dialogDataRule" label-width="130px">
|
||||||
|
|
||||||
|
<el-form-item label="企业名称" prop="enterpriseName">
|
||||||
|
<el-input v-model="operations.enterpriseName" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="企业车辆数量" prop="enterpriseCarCount">
|
||||||
|
<el-input-number v-model="operations.enterpriseCarCount" @change="handleChange" :max="52"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="企业电子围栏数量" prop="enterpriseFenceCount">
|
||||||
|
<el-input-number v-model="operations.enterpriseFenceCount" @change="handleChange" :max="99"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submitDialog">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { enterpriseList, insert, updateEnterEnterprise, deleteByIds, searchById } from '@/api/saas/saas';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading:false,
|
||||||
|
requestParam: {
|
||||||
|
enterpriseName: '',
|
||||||
|
page: 1,
|
||||||
|
length: 10
|
||||||
|
},
|
||||||
|
enterprise: [],
|
||||||
|
selections: [],
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
totalCount: 0,
|
||||||
|
dataRule: {
|
||||||
|
enterpriseName: [
|
||||||
|
{ required: true, message: '请输入企业名称', trigger: 'blur' },
|
||||||
|
{ pattern: /^[0-9a-zA-Z\u4e00-\u9fa5]{1,10}$/, message: '企业名称格式不正确' }
|
||||||
|
],
|
||||||
|
},
|
||||||
|
dialogFormVisible: false,
|
||||||
|
formLabelWidth: '130px',
|
||||||
|
operations: {
|
||||||
|
enterpriseId: '',
|
||||||
|
enterpriseName: '',
|
||||||
|
enterpriseCarCount: '',
|
||||||
|
enterpriseFenceCount: ''
|
||||||
|
},
|
||||||
|
dialogDataRule: {
|
||||||
|
enterpriseName: [
|
||||||
|
{ required: true, message: '请输入企业名称', trigger: 'blur' },
|
||||||
|
{ pattern: /^[0-9a-zA-Z\u4e00-\u9fa5]{1,10}$/, message: '企业名称格式不正确' }
|
||||||
|
],
|
||||||
|
enterpriseCarCount: [
|
||||||
|
{ required: true, message: '请输入企业车辆数量', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
enterpriseFenceCount: [
|
||||||
|
{ required: true, message: '请输入企业电子围栏数量', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
enterpriseList() {
|
||||||
|
enterpriseList({ ...this.requestParam, page: this.pageIndex, length: this.pageSize }).then(res => {
|
||||||
|
this.enterprise = res.data.list;
|
||||||
|
this.totalCount = res.data.totalCount;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
searchHandle() {
|
||||||
|
this.pageIndex = 1;
|
||||||
|
this.enterpriseList();
|
||||||
|
},
|
||||||
|
|
||||||
|
deleteHandle(enterprise_id) {
|
||||||
|
this.$confirm('确认删除该企业吗?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
deleteByIds({ ids: [enterprise_id] }).then(() => {
|
||||||
|
console.log('删除成功');
|
||||||
|
this.$message.success('删除成功');
|
||||||
|
this.enterpriseList();
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('删除失败:', error);
|
||||||
|
this.$message.error('删除失败,请重试');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
batchDeleteHandle() {
|
||||||
|
const selectedIds = this.selections.map(item => item.enterprise_id); // 确保这里使用的是正确的属性名,如 enterprise_id
|
||||||
|
if (selectedIds.length === 0) {
|
||||||
|
this.$message.warning('请选择要删除的企业');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$confirm('确认批量删除这些企业吗?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
deleteByIds({ ids: selectedIds }).then(() => { // 直接传递 selectedIds 数组
|
||||||
|
console.log('删除成功');
|
||||||
|
this.$message.success('删除成功');
|
||||||
|
this.enterpriseList();
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('删除失败:', error);
|
||||||
|
this.$message.error('删除失败,请重试');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
selectionChangeHandle(val) {
|
||||||
|
this.selections = val;
|
||||||
|
},
|
||||||
|
sizeChangeHandle(val) {
|
||||||
|
this.pageSize = val;
|
||||||
|
this.pageIndex = 1;
|
||||||
|
this.enterpriseList();
|
||||||
|
},
|
||||||
|
currentChangeHandle(val) {
|
||||||
|
this.pageIndex = val;
|
||||||
|
this.enterpriseList();
|
||||||
|
},
|
||||||
|
handleEdit(enterprise_id) {
|
||||||
|
searchById(enterprise_id).then(res => {
|
||||||
|
if (res.code === 200) { // 假设成功状态码为200
|
||||||
|
this.operations.enterpriseId = res.data.enterprise_id;
|
||||||
|
this.operations.enterpriseName = res.data.enterprise_name;
|
||||||
|
this.operations.enterpriseCarCount = res.data.enterprise_car_count;
|
||||||
|
this.operations.enterpriseFenceCount = res.data.enterprise_fence_count;
|
||||||
|
// this.operations = res.data; // 这里假设res.data直接就是企业信息对象
|
||||||
|
console.log('res.data:', res.data);
|
||||||
|
this.dialogFormVisible = true;
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.message); // 显示错误信息
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('调用searchById失败:', error);
|
||||||
|
this.$message.error('服务器错误,请稍后再试');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
submitDialog() {
|
||||||
|
this.$refs.formRef.validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.operations.enterpriseId) {
|
||||||
|
// 修改企业信息
|
||||||
|
updateEnterEnterprise(this.operations).then(() => {
|
||||||
|
this.$message.success('修改成功');
|
||||||
|
this.dialogFormVisible = false;
|
||||||
|
this.enterpriseList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 新增企业信息
|
||||||
|
insert(this.operations).then(() => {
|
||||||
|
this.$message.success('新增成功');
|
||||||
|
this.dialogFormVisible = false;
|
||||||
|
this.enterpriseList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleChange(value) {
|
||||||
|
console.log(value);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.enterpriseList();
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
beforeCreate() {},
|
||||||
|
beforeMount() {},
|
||||||
|
beforeUpdate() {},
|
||||||
|
updated() {},
|
||||||
|
beforeDestroy() {},
|
||||||
|
destroyed() {},
|
||||||
|
activated() {}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
/* 可以在这里添加样式 */
|
||||||
|
</style>
|
|
@ -82,13 +82,6 @@
|
||||||
<span style="margin-left: 10px">{{ scope.row.groupName}}</span>
|
<span style="margin-left: 10px">{{ scope.row.groupName}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
|
||||||
label="围栏类型"
|
|
||||||
width="180">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<dict-tag :options="dict.type.sys_fence_type" :value="scope.row.groupType"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="围栏状态"
|
label="围栏状态"
|
||||||
width="180">
|
width="180">
|
||||||
|
@ -157,20 +150,6 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<!-- <el-row>-->
|
|
||||||
<!-- <el-col :span="20">-->
|
|
||||||
<!-- <el-form-item label="围栏类型" prop="noticeType">-->
|
|
||||||
<!-- <el-select v-model="form.groupType" placeholder="请选择围栏类型">-->
|
|
||||||
<!-- <el-option-->
|
|
||||||
<!-- v-for="dict in dict.type.sys_fence_type"-->
|
|
||||||
<!-- :key="dict.value"-->
|
|
||||||
<!-- :label="dict.label"-->
|
|
||||||
<!-- :value="dict.value"-->
|
|
||||||
<!-- ></el-option>-->
|
|
||||||
<!-- </el-select>-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<!-- </el-col>-->
|
|
||||||
<!-- </el-row>-->
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="20">
|
<el-col :span="20">
|
||||||
<el-form-item label="围栏组状态">
|
<el-form-item label="围栏组状态">
|
||||||
|
@ -297,9 +276,8 @@
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
import {addGroup, findGroupByid, selectGroupList, updGroup} from "@/api/fence/group";
|
|
||||||
import {fenceArray, findElectronicByid, listFence} from "@/api/fence/fence";
|
|
||||||
import { delDept } from '@/api/system/dept'
|
import { delDept } from '@/api/system/dept'
|
||||||
|
import { addGroup, fenceArray, findGroupByid, selectGroupList, updGroup } from '@/api/saas/saas'
|
||||||
export default {
|
export default {
|
||||||
name: "group",
|
name: "group",
|
||||||
dicts: ['sys_normal_disable','sys_fence_type','sys_notice_status'],
|
dicts: ['sys_normal_disable','sys_fence_type','sys_notice_status'],
|
||||||
|
@ -357,7 +335,7 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path:'map',
|
path:'fenceMap',
|
||||||
query:{id:row.id,longitudeLatitude:row.longitudeLatitude,open:0}
|
query:{id:row.id,longitudeLatitude:row.longitudeLatitude,open:0}
|
||||||
})
|
})
|
||||||
},
|
},
|
|
@ -3,7 +3,7 @@
|
||||||
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" size="small">
|
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" size="small">
|
||||||
<el-form-item label="围栏名称" prop="fenceName">
|
<el-form-item label="围栏名称" prop="fenceName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.fenceName"
|
v-model="queryParams.name"
|
||||||
clearable
|
clearable
|
||||||
placeholder="请输入围栏名称"
|
placeholder="请输入围栏名称"
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
|
@ -122,13 +122,6 @@
|
||||||
<dict-tag :options="dict.type.sys_notice_status" :value="scope.row.status"/>
|
<dict-tag :options="dict.type.sys_notice_status" :value="scope.row.status"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column-->
|
|
||||||
<!-- label="围栏位置"-->
|
|
||||||
<!-- width="180">-->
|
|
||||||
<!-- <template slot-scope="scope">-->
|
|
||||||
<!-- <span style="margin-left: 10px">{{ scope.row.longitudeLatitude}}</span>-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- </el-table-column>-->
|
|
||||||
|
|
||||||
<el-table-column label="操作">
|
<el-table-column label="操作">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
@ -205,8 +198,7 @@
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
import { addfence, delElectronById, findElectronicByid, listFence, updfence } from '@/api/fence/fence'
|
import { addfence, delElectronById, findElectronicByid, listFence, updfence } from '@/api/saas/saas'
|
||||||
import {addDept, delDept, getDept, listDept, listDeptExcludeChild, updateDept} from "@/api/system/dept";
|
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -250,7 +242,7 @@ export default {
|
||||||
//绘制电子围栏
|
//绘制电子围栏
|
||||||
handleFence(row){
|
handleFence(row){
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path:'map',
|
path:'fenceMap',
|
||||||
query:{id:row.id,longitudeLatitude:row.longitudeLatitude,open:1}
|
query:{id:row.id,longitudeLatitude:row.longitudeLatitude,open:1}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -261,20 +253,13 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path:'map',
|
path:'fenceMap',
|
||||||
query:{id:row.id,longitudeLatitude:row.longitudeLatitude,open:0}
|
query:{id:row.id,longitudeLatitude:row.longitudeLatitude,open:0}
|
||||||
})
|
})
|
||||||
alert("位置:"+row.longitudeLatitude)
|
alert("位置:"+row.longitudeLatitude)
|
||||||
},
|
},
|
||||||
//删除电子围栏
|
//删除电子围栏
|
||||||
handleDelete(row){
|
handleDelete(row){
|
||||||
// this.$modal.confirm('是否确认删除名称为"' + row.deptName + '"的数据项?').then(function () {
|
|
||||||
// return delDept(row.deptId);
|
|
||||||
// }).then(() => {
|
|
||||||
// this.getList();
|
|
||||||
// this.$modal.msgSuccess("删除成功");
|
|
||||||
// }).catch(() => {
|
|
||||||
// });
|
|
||||||
const ids = row.id || this.ids;
|
const ids = row.id || this.ids;
|
||||||
this.$confirm('是否确认删除电子围栏编号为"' + ids + '"的数据项?', "警告", {
|
this.$confirm('是否确认删除电子围栏编号为"' + ids + '"的数据项?', "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
|
@ -14,7 +14,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {setFenceWay} from "@/api/fence/fence";
|
import { setFenceWay } from '@/api/saas/saas'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AmapPolygonEditor',
|
name: 'AmapPolygonEditor',
|
||||||
|
@ -25,34 +25,34 @@ export default {
|
||||||
open: 0,
|
open: 0,
|
||||||
fenceWay: {
|
fenceWay: {
|
||||||
id: null,
|
id: null,
|
||||||
longitudeLatitude: '',
|
longitudeLatitude: ''
|
||||||
},
|
},
|
||||||
polygonEcho: null,
|
polygonEcho: null,
|
||||||
polygon1: null,
|
polygon1: null,
|
||||||
polygon2: null,
|
polygon2: null,
|
||||||
//回显围栏位置
|
//回显围栏位置
|
||||||
pathEcho: null,
|
pathEcho: null,
|
||||||
polyEditor: null,
|
polyEditor: null
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.initMap();
|
this.initMap()
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.fenceWay.id = this.$route.query.id;
|
this.fenceWay.id = this.$route.query.id
|
||||||
this.open = this.$route.query.open;
|
this.open = this.$route.query.open
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
//初始化地图
|
//初始化地图
|
||||||
initMap() {
|
initMap() {
|
||||||
this.pathEcho = this.$route.query.longitudeLatitude;
|
this.pathEcho = this.$route.query.longitudeLatitude
|
||||||
console.log(this.pathEcho);
|
console.log(this.pathEcho)
|
||||||
// 初始化地图
|
// 初始化地图
|
||||||
this.map = new AMap.Map('container', {
|
this.map = new AMap.Map('container', {
|
||||||
center: [116.471354, 39.994257],
|
center: [116.471354, 39.994257],
|
||||||
zoom: 16.8,
|
zoom: 16.8
|
||||||
});
|
})
|
||||||
|
|
||||||
// 创建多边形
|
// 创建多边形
|
||||||
// const path1 = [[116.475334, 39.997534], [116.476627, 39.998315], [116.478603, 39.99879], [116.478529, 40.000296], [116.475082, 40.000151], [116.473421, 39.998717]];
|
// const path1 = [[116.475334, 39.997534], [116.476627, 39.998315], [116.478603, 39.99879], [116.478529, 40.000296], [116.475082, 40.000151], [116.473421, 39.998717]];
|
||||||
|
@ -67,61 +67,61 @@ export default {
|
||||||
|
|
||||||
if (this.pathEcho != null && this.pathEcho != undefined) {
|
if (this.pathEcho != null && this.pathEcho != undefined) {
|
||||||
// 将字符串按分号分割
|
// 将字符串按分号分割
|
||||||
const pointPairs = this.pathEcho.split(';');
|
const pointPairs = this.pathEcho.split(';')
|
||||||
const points = [];
|
const points = []
|
||||||
|
|
||||||
for (const pair of pointPairs) {
|
for (const pair of pointPairs) {
|
||||||
// 去除空格
|
// 去除空格
|
||||||
const trimmedPair = pair.trim();
|
const trimmedPair = pair.trim()
|
||||||
if (trimmedPair) {
|
if (trimmedPair) {
|
||||||
// 将每一对经纬度按逗号分割
|
// 将每一对经纬度按逗号分割
|
||||||
const [lng, lat] = trimmedPair.split(',').map(Number);
|
const [lng, lat] = trimmedPair.split(',').map(Number)
|
||||||
points.push([lng, lat]);
|
points.push([lng, lat])
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.polygon1 = new AMap.Polygon({
|
this.polygon1 = new AMap.Polygon({
|
||||||
//points 是经纬度数组
|
//points 是经纬度数组
|
||||||
path: points
|
path: points
|
||||||
});
|
})
|
||||||
|
|
||||||
this.map.add([this.polygon1]);
|
this.map.add([this.polygon1])
|
||||||
|
|
||||||
this.polygon1.on('dblclick', () => {
|
this.polygon1.on('dblclick', () => {
|
||||||
this.polyEditor.setTarget(this.polygon1);
|
this.polyEditor.setTarget(this.polygon1)
|
||||||
this.polyEditor.open();
|
this.polyEditor.open()
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
this.map.setFitView();
|
this.map.setFitView()
|
||||||
|
|
||||||
// 初始化多边形编辑器
|
// 初始化多边形编辑器
|
||||||
this.polyEditor = new AMap.PolygonEditor(this.map);
|
this.polyEditor = new AMap.PolygonEditor(this.map)
|
||||||
// this.polyEditor.addAdsorbPolygons([this.polygon1, this.polygon2]);
|
// this.polyEditor.addAdsorbPolygons([this.polygon1, this.polygon2]);
|
||||||
|
|
||||||
// 监听添加事件
|
// 监听添加事件
|
||||||
this.polyEditor.on('add', (data) => {
|
this.polyEditor.on('add', (data) => {
|
||||||
// event.obj 为绘制出来的覆盖物对象
|
// event.obj 为绘制出来的覆盖物对象
|
||||||
let path = data.obj.getPath(); // 获取多边形的路径
|
let path = data.obj.getPath() // 获取多边形的路径
|
||||||
let str = "";
|
let str = ''
|
||||||
let pathArr = [];
|
let pathArr = []
|
||||||
for (let i = 0; i < path.length; i++) {
|
for (let i = 0; i < path.length; i++) {
|
||||||
pathArr.push([path[i].getLng(), path[i].getLat()]);
|
pathArr.push([path[i].getLng(), path[i].getLat()])
|
||||||
this.fenceWay.longitudeLatitude += path[i].getLng() + "," + path[i].getLat() + ";";
|
this.fenceWay.longitudeLatitude += path[i].getLng() + ',' + path[i].getLat() + ';'
|
||||||
}
|
}
|
||||||
// 这个就是绘制的点的坐标数组
|
// 这个就是绘制的点的坐标数组
|
||||||
// this.addForm.latlng = str; // 转换为字符串
|
// this.addForm.latlng = str; // 转换为字符串
|
||||||
console.log(this.fenceWay.longitudeLatitude)
|
console.log(this.fenceWay.longitudeLatitude)
|
||||||
console.log(data);
|
console.log(data)
|
||||||
const polygon = data.target;
|
const polygon = data.target
|
||||||
|
|
||||||
this.polyEditor.addAdsorbPolygons(polygon);
|
this.polyEditor.addAdsorbPolygons(polygon)
|
||||||
|
|
||||||
polygon.on('dblclick', () => {
|
polygon.on('dblclick', () => {
|
||||||
this.polyEditor.setTarget(polygon);
|
this.polyEditor.setTarget(polygon)
|
||||||
this.polyEditor.open();
|
this.polyEditor.open()
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
|
||||||
// 双击多边形开始编辑
|
// 双击多边形开始编辑
|
||||||
// this.polygon1.on('dblclick', () => {
|
// this.polygon1.on('dblclick', () => {
|
||||||
|
@ -137,27 +137,27 @@ export default {
|
||||||
//返回围栏列表
|
//返回围栏列表
|
||||||
returnlist() {
|
returnlist() {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: 'list'
|
path: 'fenceList'
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
createPolygon() {
|
createPolygon() {
|
||||||
this.polyEditor.close();
|
this.polyEditor.close()
|
||||||
this.polyEditor.setTarget();
|
this.polyEditor.setTarget()
|
||||||
this.polyEditor.open();
|
this.polyEditor.open()
|
||||||
},
|
},
|
||||||
|
|
||||||
//开始编辑
|
//开始编辑
|
||||||
startEditing() {
|
startEditing() {
|
||||||
this.polyEditor.open();
|
this.polyEditor.open()
|
||||||
},
|
},
|
||||||
//结束编辑
|
//结束编辑
|
||||||
endEditing() {
|
endEditing() {
|
||||||
this.polyEditor.close();
|
this.polyEditor.close()
|
||||||
console.log(this.longitudeLatitude)
|
console.log(this.longitudeLatitude)
|
||||||
setFenceWay(this.fenceWay).then(res => {
|
setFenceWay(this.fenceWay).then(res => {
|
||||||
if (200 == res.code) {
|
if (200 == res.code) {
|
||||||
this.$modal.msgSuccess("设置位置成功");
|
this.$modal.msgSuccess('设置位置成功')
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: 'list'
|
path: 'list'
|
||||||
})
|
})
|
||||||
|
@ -165,7 +165,7 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
|
@ -242,7 +242,7 @@ import {
|
||||||
findvehicleFoundationData,
|
findvehicleFoundationData,
|
||||||
messageTemplateTypeList,
|
messageTemplateTypeList,
|
||||||
templateList
|
templateList
|
||||||
} from '../../api/message/message'
|
} from '@/api/saas/saas'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
//import引入的组件需要注入到对象中才能使用"
|
//import引入的组件需要注入到对象中才能使用"
|
|
@ -0,0 +1,352 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<el-form :model="warnStrategyReq" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item label="车辆类型" prop="carTypeId">
|
||||||
|
<el-select v-model="warnStrategyReq.carTypeId" placeholder="请选择车辆类型">
|
||||||
|
<el-option
|
||||||
|
v-for="item in carTypeList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.typeName"
|
||||||
|
:value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="报文模版" prop="templateId">
|
||||||
|
<el-select v-model="warnStrategyReq.templateId" placeholder="请选择报文模版">
|
||||||
|
<el-option
|
||||||
|
v-for="item in templateList"
|
||||||
|
:key="item.templateId"
|
||||||
|
:label="item.templateName"
|
||||||
|
:value="item.templateId">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="策略名称" prop="strategyName">
|
||||||
|
<el-input
|
||||||
|
v-model="warnStrategyReq.strategyName"
|
||||||
|
placeholder="请输入策略名称"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="getList">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['platform:strategy:add']"
|
||||||
|
>新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="templateList">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="策略Id" align="center" prop="id" />
|
||||||
|
<el-table-column label="车辆类型" align="center" prop="typeName" />
|
||||||
|
<el-table-column label="策略名称" align="center" prop="strategyName" />
|
||||||
|
<el-table-column label="报文模版" align="center" prop="templateName" />
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="showRule(scope.row.id)"
|
||||||
|
v-hasPermi="['platform:strategy:remove']"
|
||||||
|
>查看规则</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="addRule(scope.row)"
|
||||||
|
v-hasPermi="['platform:strategy:remove']"
|
||||||
|
>配置规则</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['platform:strategy:edit']"
|
||||||
|
>修改策略</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['platform:strategy:remove']"
|
||||||
|
>删除策略</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 查看规则抽屉 -->
|
||||||
|
<el-drawer
|
||||||
|
title="具体规则"
|
||||||
|
:visible.sync="dialogTableVisible"
|
||||||
|
direction="rtl"
|
||||||
|
size="50%">
|
||||||
|
<el-table :data="ruleList">
|
||||||
|
<el-table-column property="ruleName" label="规则名称" width="150"></el-table-column>
|
||||||
|
<el-table-column property="strategyName" label="策略名称" width="150"></el-table-column>
|
||||||
|
<el-table-column property="messageField" label="报文数值" width="150"></el-table-column>
|
||||||
|
<el-table-column property="slideTime" label="滑窗时间" width="150"></el-table-column>
|
||||||
|
<el-table-column label="滑窗频率" align="center" prop="slideFrequency">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.slideFrequency===1">1分之1</span>
|
||||||
|
<span v-if="scope.row.slideFrequency===2">2分之1</span>
|
||||||
|
<span v-if="scope.row.slideFrequency===3">3分之1</span>
|
||||||
|
<span v-if="scope.row.slideFrequency===4">4分之1</span>
|
||||||
|
<span v-if="scope.row.slideFrequency===5">5分之1</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column property="growthRate" label="增长率" width="150"></el-table-column>
|
||||||
|
<el-table-column property="volatilityRate" label="波动率" width="150"></el-table-column>
|
||||||
|
<el-table-column property="decreaseRate" label="下降率" width="150"></el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-drawer>
|
||||||
|
|
||||||
|
<!-- 添加或修改预警策略对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="策略名称" prop="strategyName">
|
||||||
|
<el-input v-model="form.strategyName" placeholder="请输入策略名称" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="车辆类型" prop="carTypeId">
|
||||||
|
<el-select v-model="form.carTypeId" placeholder="请选择车辆类型" @change="changeCarType(form.carTypeId)">
|
||||||
|
<el-option
|
||||||
|
v-for="item in carTypeList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.typeName"
|
||||||
|
:value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="报文模版" prop="templateId">
|
||||||
|
<el-input v-model="form.templateId" :disabled="disabled"/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="报文模版名称" prop="templateId" v-show="inShow">
|
||||||
|
<el-input v-model="templateName" :disabled="disabled"/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||||
|
//例如:import 《组件名称》 from '《组件路径》,
|
||||||
|
import {
|
||||||
|
addWarnStrategy, selectById,
|
||||||
|
selectListByStrategyId,
|
||||||
|
selectWarnStrategyList,
|
||||||
|
updWarnStrategy
|
||||||
|
} from '@/api/saas/saas'
|
||||||
|
import { selectCarTypeList, selectCarTypeResp } from '@/api/saas/saas'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
|
components: {},
|
||||||
|
props: {},
|
||||||
|
data() {
|
||||||
|
//这里存放数据"
|
||||||
|
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
|
||||||
|
//策略查询条件对象
|
||||||
|
warnStrategyReq:{},
|
||||||
|
carTypeList:[],
|
||||||
|
templateList:[],
|
||||||
|
form:{},
|
||||||
|
dialogTableVisible:false,
|
||||||
|
ruleList:[],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 表单参数
|
||||||
|
warnStrategy: {},
|
||||||
|
isDisabled:false,
|
||||||
|
templateTypeList:[],
|
||||||
|
labelPosition: 'right',
|
||||||
|
rule:{},
|
||||||
|
templateName:'',
|
||||||
|
disabled:false,
|
||||||
|
rules:{},
|
||||||
|
inShow:true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//计算属性 类似于data概念",
|
||||||
|
computed: {},
|
||||||
|
//监控data中的数据变化",
|
||||||
|
watch: {},
|
||||||
|
//方法集合",
|
||||||
|
methods: {
|
||||||
|
/** 查询预警策略列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
selectWarnStrategyList(this.warnStrategyReq).then(response => {
|
||||||
|
this.templateList = response.data;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.warnStrategyReq = {
|
||||||
|
id: null,
|
||||||
|
carTypeId: null,
|
||||||
|
strategyName: null,
|
||||||
|
templateId: null
|
||||||
|
};
|
||||||
|
this.resetForm("warnStrategyReq");
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("warnStrategyReq");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**查询车辆类型列表*/
|
||||||
|
selCarType(){
|
||||||
|
selectCarTypeList().then(
|
||||||
|
res=>{
|
||||||
|
this.carTypeList=res.data
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
/**查询策略下具体规则*/
|
||||||
|
showRule(id){
|
||||||
|
selectListByStrategyId(id).then(
|
||||||
|
res=>{
|
||||||
|
this.dialogTableVisible=true
|
||||||
|
this.ruleList=res.data
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加预警策略";
|
||||||
|
},
|
||||||
|
/**根据车辆类型改变,报文模板改变*/
|
||||||
|
changeCarType(carTypeId){
|
||||||
|
selectCarTypeResp(carTypeId).then(
|
||||||
|
res=>{
|
||||||
|
this.form.templateId=res.data.templateId
|
||||||
|
this.templateName=res.data.templateName
|
||||||
|
this.disabled=true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
selectById(row.id).then(response => {
|
||||||
|
this.open = true;
|
||||||
|
this.form = response.data;
|
||||||
|
this.templateName=response.data.templateName
|
||||||
|
this.title = "修改预警策略";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updWarnStrategy(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addWarnStrategy(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**跳转规则页面 */
|
||||||
|
addRule(row){
|
||||||
|
const id = row.id
|
||||||
|
const templateId = row.templateId
|
||||||
|
this.$router.push({
|
||||||
|
path: 'rule',
|
||||||
|
query: {id:id,templateId:templateId}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
this.selCarType()
|
||||||
|
// this.selTemplate()
|
||||||
|
},
|
||||||
|
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
beforeCreate() {
|
||||||
|
}, //生命周期 - 创建之前",
|
||||||
|
beforeMount() {
|
||||||
|
}, //生命周期 - 挂载之前",
|
||||||
|
beforeUpdate() {
|
||||||
|
}, //生命周期 - 更新之前",
|
||||||
|
updated() {
|
||||||
|
}, //生命周期 - 更新之后",
|
||||||
|
beforeDestroy() {
|
||||||
|
}, //生命周期 - 销毁之前",
|
||||||
|
destroyed() {
|
||||||
|
}, //生命周期 - 销毁完成",
|
||||||
|
activated() {
|
||||||
|
} //如果页面有keep-alive缓存功能,这个函数会触发",
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -0,0 +1,260 @@
|
||||||
|
<template>
|
||||||
|
|
||||||
|
<div class="app-container">
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-righ"
|
||||||
|
size="mini"
|
||||||
|
@click="goWarn"
|
||||||
|
v-hasPermi="['warning:rule:add']"
|
||||||
|
>返回配置页面</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['warning:rule:add']"
|
||||||
|
>新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table :data="ruleList">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="规则名称" align="center" prop="ruleName" />
|
||||||
|
<el-table-column label="策略名称" align="center" prop="strategyName" />
|
||||||
|
<el-table-column label="报文数据类型" align="center" prop="messageField" />
|
||||||
|
<el-table-column label="滑窗时间" align="center" prop="slideTime" />
|
||||||
|
<el-table-column label="滑窗频率" align="center" prop="slideFrequency">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.slideFrequency===1">1分之1</span>
|
||||||
|
<span v-if="scope.row.slideFrequency===2">2分之1</span>
|
||||||
|
<span v-if="scope.row.slideFrequency===3">3分之1</span>
|
||||||
|
<span v-if="scope.row.slideFrequency===4">4分之1</span>
|
||||||
|
<span v-if="scope.row.slideFrequency===5">5分之1</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="增长率" align="center" prop="growthRate" />
|
||||||
|
<el-table-column label="波动率" align="center" prop="volatilityRate" />
|
||||||
|
<el-table-column label="下降率" align="center" prop="decreaseRate" />
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['warning:rule:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['warning:rule:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 添加或修改预警规则对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="规则名称" prop="ruleName">
|
||||||
|
<el-input v-model="form.ruleName" placeholder="请输入规则名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="报文数值">
|
||||||
|
<el-select v-model="form.msgTypeId" placeholder="请选择报文数值">
|
||||||
|
<el-option
|
||||||
|
v-for="item in templateTypeList"
|
||||||
|
:key="item.messageTemplateTypeId"
|
||||||
|
:label="item.messageField"
|
||||||
|
:value="item.messageTemplateTypeId">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="滑窗时间" prop="slideTime">
|
||||||
|
<el-input v-model="form.slideTime" placeholder="请输入滑窗时间" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="滑窗频率" prop="slideFrequency">
|
||||||
|
<el-select v-model="form.slideFrequency" placeholder="请选择滑窗频率">
|
||||||
|
<el-option label="1分之1" value="1"></el-option>
|
||||||
|
<el-option label="2分之1" value="2"></el-option>
|
||||||
|
<el-option label="3分之1" value="3"></el-option>
|
||||||
|
<el-option label="4分之1" value="4"></el-option>
|
||||||
|
<el-option label="5分之1" value="5"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="增长率" prop="growthRate">
|
||||||
|
<el-input v-model="form.growthRate" placeholder="请输入增长率" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="波动率" prop="volatilityRate">
|
||||||
|
<el-input v-model="form.volatilityRate" placeholder="请输入波动率" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="下降率" prop="decreaseRate">
|
||||||
|
<el-input v-model="form.decreaseRate" placeholder="请输入下降率" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
import {
|
||||||
|
addWarnRule,
|
||||||
|
selectByTemplateId,
|
||||||
|
selectListByStrategyId, selectRuleById, selectWarnRuleRespList,
|
||||||
|
updWarnRule
|
||||||
|
} from '@/api/saas/saas'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Rule",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
strategyName:null,
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 预警规则表格数据
|
||||||
|
ruleList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
},
|
||||||
|
strategyId:null,
|
||||||
|
templateTypeList:[]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.receiveStrategyId()
|
||||||
|
this.selectTemplateByStrategyId()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
/**返回配置*/
|
||||||
|
goWarn(){
|
||||||
|
this.$router.push({
|
||||||
|
path: 'warn'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**根据报文ID查报文字段*/
|
||||||
|
selectTemplateByStrategyId(){
|
||||||
|
this.templateId = this.$route.query.templateId
|
||||||
|
selectByTemplateId(this.templateId).then(
|
||||||
|
res=>{
|
||||||
|
this.templateTypeList=res.data
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** 接收预警id */
|
||||||
|
receiveStrategyId(){
|
||||||
|
this.strategyId = this.$route.query.id
|
||||||
|
selectListByStrategyId(this.strategyId).then((res)=>{
|
||||||
|
this.ruleList=res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
ruleName: null,
|
||||||
|
strategyId: null,
|
||||||
|
msgTypeId: null,
|
||||||
|
slideTime: null,
|
||||||
|
slideFrequency: null,
|
||||||
|
growthRate: null,
|
||||||
|
volatilityRate: null,
|
||||||
|
decreaseRate:null
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加预警规则";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids
|
||||||
|
selectRuleById(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改预警规则";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
this.form.strategyId=this.strategyId
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updWarnRule(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addWarnRule(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
location.reload()
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除预警规则编号为"' + ids + '"的数据项?').then(function() {
|
||||||
|
return delRule(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in New Issue