Compare commits

...

2 Commits

Author SHA1 Message Date
yanchouchou 8e1f9fb11e fix():添加车辆类型下拉框 2024-10-08 14:17:40 +08:00
yanchouchou e950b3aab9 feat():初始化 2024-10-07 10:29:44 +08:00
17 changed files with 2244 additions and 41 deletions

View File

@ -36,6 +36,7 @@
"url": "https://gitee.com/y_project/MuYu-Cloud.git"
},
"dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1",
"@riophae/vue-treeselect": "0.4.0",
"axios": "0.24.0",
"clipboard": "2.0.8",

55
src/api/car/car.js 100644
View File

@ -0,0 +1,55 @@
import request from '@/utils/request'
// 查询车辆基础信息列表
export function listCar(query) {
return request({
url: '/saas/car/list',
method: 'get',
params: query
})
}
// 查询车辆基础信息详细
export function getCar(id) {
return request({
url: '/saas/car/' + id,
method: 'get'
})
}
// 新增车辆基础信息
export function addCar(data) {
return request({
url: '/saas/car',
method: 'post',
data: data
})
}
// 修改车辆基础信息
export function updateCar(data) {
return request({
url: '/saas/car',
method: 'put',
data: data
})
}
// 删除车辆基础信息
export function delCar(id) {
return request({
url: '/saas/car/' + id,
method: 'delete'
})
}
//查询所有的车辆类型
export function listType() {
return request({
url: '/car/sysType/list',
method: 'get'
})
}

View File

@ -0,0 +1,36 @@
import request from '@/utils/request'
// 报文模版列表
export function templateList() {
return request({
url: 'saas/messageTemplate/list',
method: 'POST',
})
}
//添加报文模版
export function addTemplate(data) {
return request({
url: 'saas/messageTemplate/',
method: 'POST',
data: data
})
}
// 报文数据列表
export function valueList(data) {
return request({
url: 'saas/messageValue/list',
method: 'POST',
data: data
})
}
// 添加报文数据
export function addValue(data) {
return request({
url: 'saas/messageValue/',
method: 'POST',
data: data
})
}

View File

@ -0,0 +1,128 @@
import request from '@/utils/request'
// liebiao
export function selectCarFenceList(data) {
return request({
url: '/saas/carFence/selectConnect',
method: 'post',
data:data
})
}
//添加围栏
export function addCarFence(data) {
return request({
url: '/saas/carFence/addCarFence',
method: 'post',
data
})
}
// 添加多对多
export function addFenceGroupMidddle(fenceGroupId,carFence) {
return request({
url: '/saas/middle/addCarFence',
method: 'post',
params:{fenceGroupId},
data:carFence,
})
}
// 添加中间
export function addMiddle(data) {
return request({
url: '/saas/middle/addMiddle',
method: 'post',
data:data
})
}
// 刷新方法
export function clazzList() {
return request({
url: '/saas/carFenceClazz/selectClazz',
method: 'post',
})
}
// 刷新方法
export function typeList(data) {
return request({
url: '/saas/carFenceType/selectType',
method: 'post',
})
}
// 刷新方法
export function carAddList(data) {
return request({
url: '/saas/carFence/carAddList',
method: 'post',
})
}
// 查询所有车名称
export function selectCarInformationIdAndLicensePlate() {
return request({
url: '/saas/carFence/selectCarInformationIdAndLicensePlate',
method: 'get',
})
}
// 围栏组列表
export function group(data) {
return request({
url: '/saas/fenceGroup/fenceGroupList',
method: 'post',
data
})
}
// 围栏组添加
export function addFenceGroup(data) {
return request({
url: '/saas/fenceGroup/addFenceGroup',
method: 'POST',
data
})
}
//修改围栏组状态
export function updateFenceGroupById(groupId){
return request({
url:'/saas/middle/updateFenceGroupById?groupId='+groupId,
method:'get',
data:groupId
})
}
//启动修改围栏状态
export function activate(groupId){
return request({
url:'/saas/middle/activate?groupId='+groupId,
method:'get',
data:groupId
})
}
//根据围栏组的id查询绑定的围栏的中间表
export function BoundFenceGroup(groupId){
return request({
url:'/saas/middle/BoundFenceGroup',
method:'get',
params:{groupId}
})
}
//根据围栏组的id 添加车辆的中间表
export function AddFenceGroupAddCar(carId,fenceGroup){
return request({
url:'/saas/middle/addFenceGroupAddCarMiddle',
method:'post',
params:{carId},
data:fenceGroup
})
}
/* 查询绑定的围栏组 */
export function selectBoundGFenceGroup(carId){
return request({
url:'/saas/middle/selectBoundGFenceGroup',
method:'get',
params:{carId},
})
}

View File

@ -0,0 +1,5 @@
import request from '@/utils/request'
export function geofenceList(){
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询预警日志列表
export function listLogs(query) {
return request({
url: '/warn/logs/list',
method: 'get',
params: query
})
}
// 查询预警日志详细
export function getLogs(id) {
return request({
url: '/warn/logs/' + id,
method: 'get'
})
}
// 新增预警日志
export function addLogs(data) {
return request({
url: '/warn/logs',
method: 'post',
data: data
})
}
// 修改预警日志
export function updateLogs(data) {
return request({
url: '/warn/logs',
method: 'put',
data: data
})
}
// 删除预警日志
export function delLogs(id) {
return request({
url: '/warn/logs/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询预警规则列表
export function listRule(query) {
return request({
url: '/warn/rule/list',
method: 'get',
params: query
})
}
// 查询预警规则详细
export function getRule(id) {
return request({
url: '/warn/rule/' + id,
method: 'get'
})
}
// 新增预警规则
export function addRule(data) {
return request({
url: '/warn/rule',
method: 'post',
data: data
})
}
// 修改预警规则
export function updateRule(data) {
return request({
url: '/warn/rule',
method: 'put',
data: data
})
}
// 删除预警规则
export function delRule(id) {
return request({
url: '/warn/rule/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,60 @@
import request from '@/utils/request'
// //根据车辆类型
// export function findBySysTypeId(id) {
// return request({
// url: 'car/sysType/findBySysTypeId/' + id,
// method: "POST"
// })
// }
// 查询预警策略列表
export function listStrategy(query) {
return request({
url: '/warn/strategy/list',
method: 'get',
params: query
})
}
// 查询预警策略详细
export function getStrategy(id) {
return request({
url: '/warn/strategy/' + id,
method: 'get'
})
}
// 新增预警策略
export function addStrategy(data) {
return request({
url: '/warn/strategy',
method: 'post',
data: data
})
}
// 修改预警策略
export function updateStrategy(data) {
return request({
url: '/warn/strategy',
method: 'put',
data: data
})
}
// 删除预警策略
export function delStrategy(id) {
return request({
url: '/warn/strategy/' + id,
method: 'delete'
})
}

View File

@ -119,6 +119,21 @@ export const dynamicRoutes = [
}
]
},
{
path: '/carFence',
component: Layout,
hidden: true,
permissions: ['carFence:fence:index'],
children: [
{
path: 'fence-MapContainer/:Id(\\d+)',
// path: 'fence-MapContainer',
component: () => import('@/views/carFence/fence/MapContainer'),
name: 'MapContainer',
meta: {title: '地图', activeMenu: '/carFence/fence'}
}
]
},
{
path: '/system/dict-data',
component: Layout,

View File

@ -0,0 +1,560 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="82px">
<el-form-item label="车辆VIN码" prop="carVin">
<el-input
v-model="queryParams.carVin"
placeholder="请输入车辆VIN码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="车辆车牌号" prop="carPlate">
<el-input
v-model="queryParams.carPlate"
placeholder="请输入车辆车牌号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="启用状态" prop="state">
<el-input
v-model="queryParams.state"
placeholder="请输入启用状态"
clearable
@keyup.enter.native="handleQuery"
/>
</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="['car:car: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="['car:car: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="['car:car: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="['car:car:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="carList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="自增主键" align="center" prop="id" />
<el-table-column label="车辆VIN码" align="center" prop="carVin" />
<el-table-column label="车辆车牌号" align="center" prop="carPlate" />
<el-table-column label="车辆品牌" align="center" prop="carBrand" />
<el-table-column label="车辆型号" align="center" prop="carModel" />
<el-table-column label="车辆车型" align="center" prop="carType" />
<el-table-column label="围栏组编码" align="center" prop="groupCode" >
</el-table-column>
<el-table-column label="启用状态" align="center" prop="state" />
<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="['car:car:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['car:car:remove']"
>删除</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-s-order"
@click="handleAddStrategy(scope.row)"
>详细信息</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="addFenceGroupAddCarMiddle(scope.row.id)"
>添加围栏组</el-button>
<el-button size="mini" type="text" icon="el-icon-plus" @click="selectBoundGFenceGroup(scope.row.id)">
查询绑定的围栏组
</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="650px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="82px">
<el-form-item label="车辆VIN码" prop="carVin">
<el-input v-model="form.carVin" placeholder="请输入车辆VIN码" />
</el-form-item>
<el-form-item label="车辆车牌号" prop="carPlate">
<el-input v-model="form.carPlate" placeholder="请输入车辆车牌号" />
</el-form-item>
<el-form-item label="车辆品牌" prop="carBrand">
<el-input v-model="form.carBrand" placeholder="请输入车辆品牌" />
</el-form-item>
<el-form-item label="车辆型号" prop="carModel">
<el-input v-model="form.carModel" placeholder="请输入车辆型号" />
</el-form-item>
<el-form-item label="车辆车型" prop="carType">
<el-input v-model="form.carType" placeholder="请输入车辆车型" />
</el-form-item>
<el-form-item label="车辆车型" prop="carType">
<el-select v-model="form.carType" placeholder="请选择报文模版id" :change="getCarTypeList">
<el-option
v-for="item in sysCarType"
:key="item.id"
:label="item.sysTypeName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="围栏组编码" prop="groupCode">
<el-input v-model="form.groupCode" placeholder="请输入围栏组编码" />
</el-form-item>
<el-form-item label="启用状态" prop="state">
<el-input v-model="form.state" placeholder="请输入启用状态" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" 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>
<!-- 添加预警策略对话框 -->
<el-dialog :title="title" :visible.sync="beginOpen" width="500px" append-to-body>
<el-form ref="formList" :model="formList" :rules="rules" label-width="80px">
<el-form-item label="车辆类型id" prop="carTypeId">
<el-input v-model="formList.carTypeId" placeholder="请输入车辆类型id" />
</el-form-item>
<el-form-item label="策略名称" prop="strategyName">
<el-input v-model="formList.strategyName" placeholder="请输入策略名称" />
</el-form-item>
<el-form-item label="报文模版id" prop="msgId">
<!-- <el-input v-model="formList.msgId" placeholder="请输入报文模版id" />-->
<el-select v-model="formList.msgId" placeholder="请选择报文模版id">
<el-option
v-for="item in templateList"
:key="item.messageTemplateId"
:label="item.messageTemplateName"
:value="item.messageTemplateId">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitAddForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 围栏组的添加 -->
<el-dialog
title="提示"
:visible.sync="dialogVisible"
width="50%"
:before-close="handleClose">
<template>
<el-table ref="multipleTable"
:data="fenceGroup"
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChanges">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column label="id" width="180">
<template slot-scope="scope" >
<span style="margin-left: 10px">{{ scope.row.groupId }}</span>
</template>
</el-table-column>
<el-table-column label="名称" width="180">
<template slot-scope="scope" >
<span style="margin-left: 10px">{{ scope.row.groupName }}</span>
</template>
</el-table-column>
<el-table-column label="状态" width="180">
<template slot-scope="scope">
<el-switch
v-if="scope.row.groupStates ==0"
v-model="groupStates"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
<el-switch
v-if="scope.row.groupStates ==1"
v-model="groupStatestwo"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</template>
</el-table-column>
</el-table>
</template>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="AddFenceGroupAddCar"> </el-button>
</span>
</el-dialog>
<!-- 查询绑定的围栏组 -->
<el-dialog
title="提示"
:visible.sync="dialogVisibleBound"
width="30%"
:before-close="handleClose">
<el-table :data="boundGFenceGroup" style="width: 100%">
<el-table-column label="id" width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.groupId }}</span>
</template>
</el-table-column>
<el-table-column label="名称" width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.groupName }}</span>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisibleBound = false"> </el-button>
<el-button type="primary" @click="dialogVisibleBound = false"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {listCar, getCar, delCar, addCar, updateCar} from "/src/api/car/car";
import {templateList} from "@/api/car/message/template";
import {addStrategy} from "@/api/platform/strategy";
import {
addFenceGroup,
AddFenceGroupAddCar,
addFenceGroupAddCarMiddle,
group,
selectBoundGFenceGroup
} from '@/api/electronic'
import { listType } from '@/api/system/dict/type'
export default {
name: "Car",
data() {
return {
//
loading: true,
//
ids: [],
//
sysCarType: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
carList: [],
templateList:[],
//
title: "",
//
open: false,
beginOpen:false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
carVin: null,
carPlate: null,
carBrand: null,
carModel: null,
carType: null,
state: null,
},
//
form: {},
formList:{},
//
rules: {
},
/* 多选围栏组 */
multipleSelections: [],
//
fenceGroup:[],
//
groupStatestwo:false,
groupStates:true,
//
dialogVisible:false,
//id
carid:'',
//
boundGFenceGroup:[],
//
dialogVisibleBound:false,
};
},
created() {
this.getList();
this.group()
this.getListType()
},
methods: {
/* 车辆类型表 */
getListType() {
listType().then(res => {
this.sysCarType = res.data.rows;
})
},
/** 查询车辆基础信息列表 */
getList() {
this.loading = true;
listCar(this.queryParams).then(response => {
console.log(response)
this.carList = response.data.rows
this.total = response.data.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
carVin: null,
carPlate: null,
carBrand: null,
carModel: null,
carType: null,
groupCode: null,
state: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
this.resetForm("form");
},
//
init() {
this.formList= {
carTypeId: null,
strategyName: null,
msgId: null
};
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加车辆基础信息";
},
/** 添加策略信息按钮 **/
handleAddStrategy(row) {
this.init();
const id = row.id || this.ids
getCar(id).then(response => {
this.formList.carTypeId = response.data.id;
this.beginOpen = true;
this.title ="添加策略信息";
});
templateList().then(response => {
this.templateList = response.data;
console.log(this.templateList);
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getCar(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改车辆基础信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateCar(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addCar(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 添加策略信息**/
submitAddForm(){
addStrategy(this.formList).then(response => {
this.$modal.msgSuccess("添加策略信息成功");
this.beginOpen = false;
this.getList();
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除车辆基础信息编号为"' + ids + '"的数据项?').then(function() {
return delCar(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('car/car/export', {
...this.queryParams
}, `car_${new Date().getTime()}.xlsx`)
},
/* 多选框 选择围栏组数据 */
handleSelectionChanges(val) {
this.multipleSelections = val;
},
//
group(){
group().then(res=>{
console.log(res)
this.fenceGroup = res.data
})
},
/* 打开围栏组和车辆中间表对话框 */
addFenceGroupAddCarMiddle(id){
this.dialogVisible = true
this.carid = id
},
/* 添加围栏组和车辆中间表 */
AddFenceGroupAddCar(){
AddFenceGroupAddCar(this.carid,this.multipleSelections).then(res=>{
if (200 == res.code){
this.$message.success("成功")
this.dialogVisible = false
}
})
},
/* 查询绑定的围栏组 */
selectBoundGFenceGroup(ids){
this.dialogVisibleBound = true
selectBoundGFenceGroup(ids).then(res=>{
console.log(res)
this.boundGFenceGroup = res.data
})
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
},
}
};
</script>

View File

@ -0,0 +1,313 @@
<template>
<div class="app-container">
<el-container>
<el-aside width="400px">
<el-button @click="handleAddTemplate"></el-button>
<el-empty description="暂无报文模版" v-if="templateList.length == 0"></el-empty>
<el-col :span="24" v-for="template in templateList" v-if="templateList.length != 0">
<el-card class="box-card" style="margin-top: 20px">
<div slot="header" class="text">
<span>{{ template.messageTemplateName }}</span>
<el-button style="float: right" type="text" @click="handleArrange(template.messageTemplateId)">
</el-button>
</div>
<div class="text">
<span>{{ template.messageTemplateDescribe }}</span>
</div>
</el-card>
</el-col>
</el-aside>
<el-container v-if="this.queryParam.messageTemplateId != 0">
<el-header>
<el-form :inline="true" ref="queryParams" :model="addParams" class="demo-form-inline">
<el-form-item label="报文类别" size="mini">
<el-select
v-model="addParams.messageType"
clearable
placeholder="报文类别"
>
<el-option
v-for="dict in dict.type.car_message_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="编码" size="mini">
<el-input v-model="addParams.messageCode" placeholder="编码"></el-input>
</el-form-item>
<el-form-item label="标签" size="mini">
<el-input v-model="addParams.messageLabel" placeholder="标签"></el-input>
</el-form-item>
<el-form-item label="起始位" size="mini">
<el-input v-model="addParams.messageStartIndex" placeholder="起始位"></el-input>
</el-form-item>
<el-form-item label="终止位" size="mini">
<el-input v-model="addParams.messageEndIndex" placeholder="终止位"></el-input>
</el-form-item>
<el-form-item label="数据类型" size="mini">
<el-select
v-model="addParams.messageDataType"
clearable
placeholder="数据类型"
>
<el-option
v-for="dict in dict.type.car_message_data_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="固定值" size="mini" v-if="this.addParams.messageDataType == 'fixed'">
<el-input v-model="addParams.fixedValue" placeholder="固定值"></el-input>
</el-form-item>
<el-form-item label="最小值" size="mini" v-if="this.addParams.messageDataType == 'range'">
<el-input v-model="addParams.minimumValue" placeholder="最小值"></el-input>
</el-form-item>
<el-form-item label="最大值" size="mini" v-if="this.addParams.messageDataType == 'range'">
<el-input v-model="addParams.maximumValue" placeholder="最大值"></el-input>
</el-form-item>
<el-form-item size="mini">
<el-button type="primary" @click="handleAddValue"></el-button>
<el-button icon="el-icon-refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
</el-header>
<el-main style="margin-top: 35px">
<el-tabs v-model="queryParam.messageType" @tab-click="handleClick">
<el-tab-pane label="基础" name="basics">
<el-table :data="valueList">
<el-table-column label="编码" prop="messageCode" align="center"/>
<el-table-column label="标签" prop="messageLabel" align="center"/>
<el-table-column label="起始位" prop="messageStartIndex" align="center"/>
<el-table-column label="终止位" prop="messageEndIndex" align="center"/>
<el-table-column align="center" label="数据类型" prop="messageDataType">
<template slot-scope="scope">
<dict-tag :options="dict.type.car_message_data_type" :value="scope.row.messageDataType"/>
</template>
</el-table-column>
<el-table-column label="固定值" prop="fixedValue" align="center">
<template slot-scope="scope">
{{scope.row.fixedValue?scope.row.fixedValue:'-'}}
</template>
</el-table-column>
<el-table-column label="最小值" align="center">
<template slot-scope="scope">
{{scope.row.minimumValue?scope.row.minimumValue:'-'}}
</template>
</el-table-column>
<el-table-column label="最大值" align="center">
<template slot-scope="scope">
{{scope.row.maximumValue?scope.row.maximumValue:'-'}}
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="数据" name="info">
<el-table :data="valueList">
<el-table-column label="编码" prop="messageCode" align="center"/>
<el-table-column label="标签" prop="messageLabel" align="center"/>
<el-table-column label="起始位" prop="messageStartIndex" align="center"/>
<el-table-column label="终止位" prop="messageEndIndex" align="center"/>
<el-table-column align="center" label="数据类型" prop="messageDataType">
<template slot-scope="scope">
<dict-tag :options="dict.type.car_message_data_type" :value="scope.row.messageDataType"/>
</template>
</el-table-column>
<el-table-column label="固定值" prop="fixedValue" align="center">
<template slot-scope="scope">
{{scope.row.fixedValue?scope.row.fixedValue:'-'}}
</template>
</el-table-column>
<el-table-column label="最小值" align="center">
<template slot-scope="scope">
{{scope.row.minimumValue?scope.row.minimumValue:'-'}}
</template>
</el-table-column>
<el-table-column label="最大值" align="center">
<template slot-scope="scope">
{{scope.row.maximumValue?scope.row.maximumValue:'-'}}
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="状态" name="status">
<el-table :data="valueList">
<el-table-column label="编码" prop="messageCode" align="center"/>
<el-table-column label="标签" prop="messageLabel" align="center"/>
<el-table-column label="起始位" prop="messageStartIndex" align="center"/>
<el-table-column label="终止位" prop="messageEndIndex" align="center"/>
<el-table-column label="数据类型" prop="messageDataType" align="center"/>
<el-table-column label="固定值" prop="fixedValue" align="center">
<template slot-scope="scope">
{{scope.row.fixedValue?scope.row.fixedValue:'-'}}
</template>
</el-table-column>
<el-table-column label="最小值" align="center">
<template slot-scope="scope">
{{scope.row.minimumValue?scope.row.minimumValue:'-'}}
</template>
</el-table-column>
<el-table-column label="最大值" align="center">
<template slot-scope="scope">
{{scope.row.maximumValue?scope.row.maximumValue:'-'}}
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</el-main>
</el-container>
</el-container>
<el-dialog title="添加报文模版" :visible.sync="open" append-to-body>
<el-form :model="form">
<el-form-item label="模版名称">
<el-input v-model="form.messageTemplateName" placeholder="模版名称"></el-input>
</el-form-item>
<el-form-item label="模版描述">
<el-input v-model="form.messageTemplateDescribe" placeholder="模版描述"></el-input>
</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 {
templateList,
addTemplate,
valueList,
addValue
} from "/src/api/car/message/template";
export default {
name: "MessageTemplateValue",
dicts: ['car_message_type', 'car_message_data_type'],
data() {
return {
//
templateList: [],
//
open: false,
//
form: {},
//
queryParam: {
//
messageTemplateId: 0,
//
messageType: '',
},
//
valueList: [],
//
addParams: {
templateId: 0,
},
};
},
created() {
//
this.getTemplateList();
},
methods: {
/** 获取报文模版列表 */
getTemplateList() {
templateList().then(response => {
this.templateList = response.data;
})
},
/** 添加报文模版 */
handleAddTemplate() {
this.open = true
},
/** 提交按钮 */
submitForm() {
addTemplate(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getTemplateList();
})
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 模版配置 */
handleArrange(messageTemplateId) {
this.queryParam.messageTemplateId = messageTemplateId;
this.addParams.templateId = messageTemplateId;
},
/** 切换选项卡 */
handleClick() {
valueList(this.queryParam).then(response => {
this.valueList = response.data
})
},
/** 添加报文数据 */
handleAddValue(){
if (this.addParams.messageType == null){
this.$modal.msgError("请选择报文类别");
}else {
addValue(this.addParams).then(response => {
this.$modal.msgSuccess("添加成功");
valueList(this.queryParam).then(response => {
this.valueList = response.data
})
})
}
},
/** 重置按钮操作 */
resetQuery() {
this.addParams = {
messageType: '',
messageCode: '',
messageLabel: '',
messageStartIndex: '',
messageEndIndex: '',
messageDataType: '',
fixedValue: '',
minimumValue: '',
maximumValue: ''
}
},
}
};
</script>
<style>
.el-header {
//background-color: #B3C0D1;
//color: #333;
text-align: center;
}
.el-aside {
//background-color: #D3DCE6;
//color: #333;
}
.el-main {
//background-color: #E9EEF3;
//color: #333;
text-align: center;
}
.text {
line-height: 30px;
}
.box-card {
width: 350px;
margin-top: 15px;
}
</style>

View File

@ -0,0 +1,397 @@
<template>
<!-- 控制按钮组 -->
<div class="main">
<section class="section">
{{this.paths}}
<!-- 地图 -->
<div id="map_container" style="width: 100%; height: 100vh;"></div>
<!-- 控制按钮组 -->
<div class="ebox">
<el-button-group>
<el-button v-if="this.testId==0" type="info" icon="el-icon-circle-plus-outline" @click="drawRectangle"></el-button>
<el-button v-if="this.testId!=0" type="primary" icon="el-icon-edit" @click="editRectangle"></el-button>
<el-button type="warning" icon="el-icon-delete" @click="cancelRectangle"></el-button>
<el-button type="success" icon="el-icon-success" @click="saveRectangle"></el-button>
<el-button type="danger" icon="el-icon-delete" @click="deleRectangle"></el-button>
</el-button-group>
</div>
</section>
<!-- Form -->
<el-dialog title="新增围栏" :visible.sync="dialogFormVisible">
<el-form :model="carFence">
<el-form-item label="围栏名称" :label-width="formLabelWidth">
<el-input v-model="carFence.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="围栏类型" :label-width="formLabelWidth">
<el-select v-model="carFence.clazzId" placeholder="请选择">
<el-option
v-for="item in type"
:key="item.clazzId"
:label="item.clazzName"
:value="item.clazzId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="围栏类型" :label-width="formLabelWidth">
<el-select v-model="carFence.typeId" placeholder="请选择">
<el-option
v-for="item in clazz"
:key="item.typeId"
:label="item.typeName"
:value="item.typeId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="围栏经纬度" :label-width="formLabelWidth">
<el-input v-model="carFence.fenceText" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="围栏开始时间" :label-width="formLabelWidth">
<div class="block">
<el-date-picker
v-model="carFence.fenceStart"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间">
</el-date-picker>
</div>
</el-form-item>
<el-form-item label="围栏结束时间" :label-width="formLabelWidth">
<div class="block">
<el-date-picker
v-model="carFence.fenceEnd"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间">
</el-date-picker>
</div>
</el-form-item>
<el-form-item label="创建时间" :label-width="formLabelWidth">
<div class="block">
<el-date-picker
v-model="carFence.fenceCreate"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间">
</el-date-picker>
</div>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="addCarFence"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import AMapLoader from '@amap/amap-jsapi-loader'
import { geofenceList } from '@/api/manage/fenceAPI.js'
import { addCarFence, clazzList, typeList, group, addMiddle } from '@/api/electronic' //
window._AMapSecurityConfig = {
securityJsCode: "4f3846d5cf6d8f35fbddff03827111c5",
};
export default {
name: "MapContainer",
data() {
return {
multipleSelection: [],
form:{},
fenceGroup:[],
type:[],
clazz:[],
carFence:{
fenceText:'',
},
carFences:[],
formData: {
testId:0,
carId: '',
pageNum: 1,//
pageSize: 10,//
pageTotal: 0,//
},
map: null,
centerArr: [113.760234, 23.048884],//
path: [],//
paths: [], //
test: [], //
polygonItem: [], //
polyEditors: [],// =>
polyEditorsBefore: [],// =>
dialogFormVisible: false,
formLabelWidth:'120px',
};
},
mounted() {
this.initAMap();
this.init();
},
created(){
this.testId = this.$route.params.Id;
this.clazzList()
this.typeList()
this.group();
// console.log(this.testId)
},
methods: {
//
forbidden(){
},
//
group(){
group().then(res=>{
// console.log(res)
this.fenceGroup = res.data
})
},
clazzList(){
clazzList().then(res=>{
this.type = res.data
})
},
typeList(){
typeList().then(res=>{
this.clazz = res.data
})
},
initAMap() {
AMapLoader.load({
key: "d617205580ad1f43884deefb6ea53eb2",
version: "2.0",
plugins: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar',
'AMap.MapType', 'AMap.MouseTool', 'AMap.Polygon', 'AMap.PolyEditor', 'AMap.CircleEditor'],
}).then((AMap) => {
this.map = new AMap.Map("map_container", {
resizeEnable: true,
viewMode: '3D', //
zoom: 17,
// pitch
// pitch: 55,
showBuildingBlock: true, //
});
//
this.map.plugin(['AMap.ToolBar', 'AMap.Scale'], () => {
const toolbar = new AMap.ToolBar()//
const scale = new AMap.Scale()//
this.map.addControl(toolbar)
this.map.addControl(scale)
})
}).catch((e) => {
console.error('地图加载失败:', e);
});
},
//
drawRectangle() {
const This = this;
let mouseTool = new AMap.MouseTool(this.map);
const polygon = mouseTool.polygon({
//polygon线polyline;rectangle;circle
strokeColor: 'red',
strokeOpacity: 0.4,
strokeWeight: 6,
fillColor: '#1791fc',
fillOpacity: 0.2,
// strokeStyle solid
strokeStyle: 'solid',
// strokeDasharray: [30,10],
});
mouseTool.on('draw', function (event) {
// event.obj
let polygonItem = event.obj;
let paths = polygonItem.getPath();//
// console.log('', paths, event);
let path = []; //
paths.forEach(v => {
path.push([v.lng, v.lat])
});
This.paths = path
// this.paths = path.toString() //paths
// This.editRectangle();//,
This.polygonItem.push(event.obj);
// console.log(9999,this.paths)
// sessionStorage.setItem("paths","")
// sessionStorage.setItem("paths",path.toString());
// This.map.remove(event.obj); //
// console.log(polygon, '------polygon-----');
console.log(paths);//
});
},
//
editRectangle() {
console.log(2,this.paths)
const path = this.paths;
//
let polygon = new AMap.Polygon({
path: path,
strokeColor: "#FF33FF",
strokeWeight: 6,
strokeOpacity: 0.2,
fillOpacity: 0.2,
fillColor: '#1791fc',
zIndex: 50,
});
this.map.add(polygon);
this.polygonItem.push(polygon);
//
this.map.setFitView([polygon]);
this.polyEditor = new AMap.PolyEditor(this.map, polygon);
this.polyEditor.open();
this.polyEditors.push(this.polyEditor);
//
let polygonBefore = new AMap.Polygon({
path: this.path,
strokeColor: "#FF33FF",
strokeWeight: 6,
strokeOpacity: 0.2,
fillOpacity: 0.2,
fillColor: '#1791fc',
zIndex: 50,
});
this.map.add(polygonBefore);
this.polygonItem.push(polygonBefore);
//
this.map.setFitView([polygonBefore]);
this.polyEditorBefore = new AMap.PolyEditor(this.map, polygonBefore);
this.polyEditorBefore.open();
this.polyEditorsBefore.push(this.polyEditorBefore);
console.log(this.polyEditorBefore)
// this.polyEditor.on('addnode', function (event) {
// console.info('addnode', event)
// console.info('', polygon.getPath())
// });
// this.polyEditor.on('adjust', function (event) {
// console.info('adjust', event)
// console.info('', polygon.getPath())
// });
// this.polyEditor.on('removenode', function (event) {
// console.info('removenode', event)
// console.info('', polygon.getPath())
// });
// this.polyEditor.on('end', function (event) {
// console.info(' end', event)
// console.info('end', polygon.getPath())
// // event.target
// });
},
//
cancelRectangle() {
this.polyEditors.forEach(item => { item.close(); });//
this.polyEditorsBefore.forEach(item => { item.close(); });//
},
//
addCarFence(){
addCarFence(this.carFence).then(res=>{
// console.log(this.carFence)
this.$modal.msgSuccess("成功");
this.dialogFormVisible = false
})
},
//
saveRectangle() {
// let item1 = sessionStorage.getItem("paths")
// console.log(9,paths)
this.carFence.fenceCreate = new Date().toLocaleString()
var s = JSON.stringify(this.paths)
this.carFence.fenceText=s
console.log(this.carFence.fenceText)
//
this.polyEditors.forEach(item => { item.close(); });
this.polyEditorsBefore.forEach(item => { item.close(); });
this.dialogFormVisible = true
// console.log(this.paths,this.path)=>
// ...
},
//
deleRectangle() {
this.polyEditors.forEach(item => { item.close(); });//
this.polyEditorsBefore.forEach(item => { item.close(); });//
this.map.clearMap(); //
//=>
// ...
},
//
init() {
const that = this
let param = {
carId: this.formData.carId,//string true carID
pageNum: this.formData.pageNum,//string false
pageSize: this.formData.pageSize,//string false
}
geofenceList({ param }).then(res => {
if (res.data.code == 0) {
if (res.data.data.list.length==0) {
this.$message.error('没有围栏数据')
return
}
that.path=[]
that.map.clearMap(); //
res.data.data.list.forEach((item, index) => { //
that.path.push(item.points)//
// this.centerArr = that.path[0]
// this.initMap()
that.map.add(new AMap.Polygon({
path: item.points,
strokeColor: "#FF33FF",
strokeWeight: 6,
strokeOpacity: 0.2,
fillOpacity: 0.4,
fillColor: "#1791fc",
zIndex: 50,
}));
that.map.setFitView();
})
} else {
this.$message.error(res.data.msg)
}
})
},
}
};
</script>
<style scoped>
#map_container {
width: 100%;
height: 100vh;
}
.ebox {
position: absolute;
top: 10px;
right: 10px;
z-index: 1000; /* 确保按钮在地图之上 */
}
</style>

View File

@ -0,0 +1,366 @@
<template>
<div>
<template>
<el-form ref="form" :model="form" label-width="80px">
<!-- <el-form-item label="活动名称">-->
<!-- <el-input v-model="form.name"></el-input>-->
<!-- </el-form-item>-->
</el-form>
<el-button type="primary" @click="toAddFenceGroup"></el-button>
<!--围栏组列表-->
<el-table :data="fenceGroup" tooltip-effect="dark" style="width: 100%">
<el-table-column label="id" width="180" >
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.groupId }}</span>
</template>
</el-table-column>
<el-table-column label="名称" width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.groupName }}</span>
</template>
</el-table-column>
<el-table-column label="状态" width="180">
<template slot-scope="scope">
<el-switch
v-if="scope.row.groupStates ==0"
v-model="groupStates"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
<el-switch
v-if="scope.row.groupStates ==1"
v-model="groupStatestwo"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button size="mini" @click="updateFenceGroupById(scope.row.groupId)" v-if="scope.row.groupStates ==0"></el-button>
<el-button size="mini" @click="activate(scope.row.groupId)" v-if="scope.row.groupStates ==1"></el-button>
<el-button size="mini" @click="addGroup(scope.row.groupId)" v-if="scope.row.groupStates ==0"></el-button>
<el-button size="mini" @click="BoundFence(scope.row.groupId)" v-if="scope.row.groupStates ==0"></el-button>
</template>
</el-table-column>
</el-table>
</template>
<!--多对多的添加-->
<el-dialog
title="提示"
:visible.sync="dialogVisible"
width="85%"
:before-close="handleClose">
<template>
<el-table
ref="multipleTable"
:data="carFence"
tooltip-effect="dark"
:style="{width: tableWidth}" @selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
label="围栏主键">
<template slot-scope="scope">{{ scope.row.id }}</template>
</el-table-column>
<el-table-column
label="围栏名称">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column
label="业务类型">
<template slot-scope="scope">{{ scope.row.clazzName }}</template>
</el-table-column>
<el-table-column
label="围栏类型">
<template slot-scope="scope">{{ scope.row.typeName }}</template>
</el-table-column>
<el-table-column
label="围栏开始时间">
<template slot-scope="scope">{{ scope.row.fenceCreate }}</template>
</el-table-column>
<el-table-column
label="围栏结束时间">
<template slot-scope="scope">{{ scope.row.fenceEnd }}</template>
</el-table-column>
<el-table-column
label="创建时间">
<template slot-scope="scope">{{ scope.row.fenceStart }}</template>
</el-table-column>
</el-table>
</template>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="addMiddls"> </el-button>
</span>
</el-dialog>
<!--//-->
<el-dialog
title="提示"
:visible.sync="dialogVisibles"
width="85%"
:before-close="handleClose">
<el-form ref="form" :model="fenceGroupAdd" label-width="100px">
<el-form-item label="围栏组名称">
<el-input v-model="fenceGroupAdd.groupName"></el-input>
</el-form-item>
<el-form-item label="围栏组状态">
<el-switch
v-model="fenceGroupAdd.groupStates"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisibles = false"> </el-button>
<el-button type="primary" @click="doAddFenceGroup"> </el-button>
</span>
</el-dialog>
<!--已经绑定的围栏-->
<el-dialog
title="提示"
:visible.sync="dialogVisibless"
width="85%"
:before-close="handleClose">
<template>
<el-table
ref="multipleTable"
:data="carFences"
tooltip-effect="dark"
:style="{width: tableWidth}">
<el-table-column
label="围栏主键">
<template slot-scope="scope">{{ scope.row.id }}</template>
</el-table-column>
<el-table-column
label="围栏名称">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column
label="业务类型">
<template slot-scope="scope">{{ scope.row.clazzName }}</template>
</el-table-column>
<el-table-column
label="围栏类型">
<template slot-scope="scope">{{ scope.row.typeName }}</template>
</el-table-column>
<el-table-column
label="围栏开始时间">
<template slot-scope="scope">{{ scope.row.fenceCreate }}</template>
</el-table-column>
<el-table-column
label="围栏结束时间">
<template slot-scope="scope">{{ scope.row.fenceEnd }}</template>
</el-table-column>
<el-table-column
label="创建时间">
<template slot-scope="scope">{{ scope.row.fenceStart }}</template>
</el-table-column>
</el-table>
</template>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisibless = false"> </el-button>
<el-button type="primary" @click="dialogVisibless = false"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
//jsjsjson,
//import from ',
import {
activate,
addFenceGroup,
addFenceGroupMidddle, BoundFenceGroup,
group,
selectCarFenceList,
updateFenceGroupById
} from '@/api/electronic'
import log from '@/views/monitor/job/log.vue'
export default {
//import使"
components: {},
props: {},
data() {
//"
return {
//
carFences:[],
groupStates:true,
groupStatestwo:false,
fenceGroupAdd:{
groupStates:true
},
fenceGroup:[],
dialogVisible: false,
dialogVisibles: false,
dialogVisibless: false,
carFence:[],
form:{},
multipleSelection: [],
fenceGroupId:'',
};
},
// data",
computed: {},
//data",
watch: {},
//",
methods: {
//id
BoundFence(groupId){
this.dialogVisibless = true
BoundFenceGroup(groupId).then(res=>{
this.carFences=res.data
})
},
//
activate(groupId){
activate(groupId).then(res=>{
if (200 == res.code){
this.$message.success("成功")
this.group()
}
})
},
//
updateFenceGroupById(groupId){
updateFenceGroupById(groupId).then(res=>{
if (200 == res.code){
this.$message.success("成功")
this.group()
}
})
},
//
addMiddls(){
addFenceGroupMidddle(this.fenceGroupId,this.multipleSelection).then(res=>{
this.$modal.msgSuccess("成功");
this.dialogVisible = false
this.selectCarFenceList();
})
},
//
doAddFenceGroup(){
if (this.fenceGroupAdd.groupStates = true){
this.fenceGroupAdd.groupStates = 0
}else {
this.fenceGroupAdd.groupStates = 1
}
// console.log(this.fenceGroupAdd.groupStates)
addFenceGroup(this.fenceGroupAdd).then(res=>{
if (200 == res.code ){
this.$message.success("成功");
this.dialogVisibles=false
this.group()
}
})
},
//
toAddFenceGroup(){
this.dialogVisibles=true
},
//id
addGroup(id){
this.multipleSelection = []
this.fenceGroupId = id
this.dialogVisible = true
},
//Id
handleSelectionChange(val) {
this.multipleSelection = val;
},
//
group(){
group().then(res=>{
// console.log(res)
this.fenceGroup = res.data
})
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
},
//
selectCarFenceList(){
selectCarFenceList(this.form).then(res=>{
this.carFence=res.data.records
})
},
},
// - 访this",
created() {
this.group()
this.selectCarFenceList();
},
// - 访DOM",
mounted() {
},
beforeCreate() {
}, // - ",
beforeMount() {
}, // - ",
beforeUpdate() {
}, // - ",
updated() {
}, // - ",
beforeDestroy() {
}, // - ",
destroyed() {
}, // - ",
activated() {
} //keep-alive",
};
</script>
<style scoped>
</style>

View File

@ -0,0 +1,202 @@
<template>
<div>
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="活动名称">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-form>
<router-link :to="'/carFence/fence-MapContainer/'+0" class="link-type">
<span>添加围栏</span>
</router-link>
<template>
<el-table
ref="multipleTable"
:data="carFence"
tooltip-effect="dark"
:style="{width: tableWidth}">
<el-table-column>
<!-- <el-button @click="show = !show">Click Me</el-button>-->
<!-- <div style="display: flex; margin-top: 20px; height: 100px;">-->
<!-- <transition name="el-fade-in-linear">-->
<!-- <div v-show="show" class="transition-box">.el-fade-in-linear</div>-->
<!-- </transition>-->
<!-- </div>-->
</el-table-column>
<el-table-column
label="围栏主键">
<template slot-scope="scope">{{ scope.row.id }}</template>
</el-table-column>
<el-table-column
label="围栏名称">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column
label="业务类型">
<template slot-scope="scope">{{ scope.row.clazzName }}</template>
</el-table-column>
<el-table-column
label="围栏类型">
<template slot-scope="scope">{{ scope.row.typeName }}</template>
</el-table-column>
<el-table-column
label="围栏开始时间">
<template slot-scope="scope">{{ scope.row.fenceCreate }}</template>
</el-table-column>
<el-table-column
label="围栏结束时间">
<template slot-scope="scope">{{ scope.row.fenceEnd }}</template>
</el-table-column>
<el-table-column
label="创建时间">
<template slot-scope="scope">{{ scope.row.fenceStart }}</template>
</el-table-column>
<!-- <el-table-column-->
<!-- label="中间ID"-->
<!-- width="120">-->
<!-- <template slot-scope="scope">{{ scope.row.date }}</template>-->
<!-- </el-table-column>-->
<el-table-column
label="操作">
<template slot-scope="scope">
<!-- <el-button v-hasPermi="['carFence:fence-MapContainer:MapContainer']"-->
<!-- icon="el-icon-s-platform"-->
<!-- size="mini"-->
<!-- type="text">-->
<router-link :to="'/carFence/fence-MapContainer/'+scope.row.id" class="link-type">
<span>查看地图</span>
</router-link>
<el-button type="text" @click="addCarList(scope.row)"></el-button>
<!-- </el-button>-->
</template>
</el-table-column>
</el-table>
</template>
<!-- Form -->
<el-dialog title="收货地址" :visible.sync="dialogFormVisible">
<el-form :model="carMiddle">
<el-form-item label="车辆名称" :label-width="formLabelWidth">
<!-- <el-input v-model="form.name" autocomplete="off"></el-input>-->
<div v-for="car in carInformationIdAndLicensePlate" :key="car.id">
<input
type="checkbox"
:id="`checkbox-${car.id}`"
:value="car.id"
v-model="selectedCarIds"
@change="handleSelectionChange"
>
<label :for="`checkbox-${car.id}`">{{ car.name }}</label>
</div>
<!-- 显示选中的用户 -->
<div>{{ selectedCarIds }}</div>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="carAddList"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
//jsjsjson,
//import from ',
import { carAddList, selectCarFenceList, selectCarInformationIdAndLicensePlate } from '@/api/electronic'
export default {
//import使"
components: {},
props: {},
data() {
//"
return {
carMiddle:{},
carInformationIdAndLicensePlate:[],
// ID
selectedCarIds: [],
dialogFormVisible: false,
formLabelWidth: '120px',
show: true,
form:{},
carFence:[],
tableWidth: '100%',
}
},
// data",
computed: {},
//data",
watch: {},
//",
methods: {
carAddList,
handleSelectionChange(val) {
this.selectedCarIds = val;
},
selectCarFenceList(){
selectCarFenceList(this.form).then(res=>{
this.carFence=res.data.records
})
},
addCarList(row){
this.carMiddle.carFenceId = row.id
this.dialogFormVisible=true
},
carList(){
carAddList(this.carMiddle).then(res=>{
this.$modal.msgSuccess(res.msg);
this.dialogFormVisible=false
})
},
/* 调用车辆信息 */
selectCarInformationIdAndLicensePlate(){
selectCarInformationIdAndLicensePlate().then(res=>{
this.carInformationIdAndLicensePlate=res.data
})
}
},
// - 访this",
created() {
this.selectCarFenceList();
// this.selectCarInformationIdAndLicensePlate();
},
// - 访DOM",
mounted() {
},
beforeCreate() {
}, // - ",
beforeMount() {
}, // - ",
beforeUpdate() {
}, // - ",
updated() {
}, // - ",
beforeDestroy() {
}, // - ",
destroyed() {
}, // - ",
activated() {
} //keep-alive",
}
</script>
<style>
.transition-box {
margin-bottom: 10px;
width: 200px;
height: 100px;
border-radius: 4px;
background-color: #409EFF;
text-align: center;
color: #fff;
padding: 40px 20px;
box-sizing: border-box;
margin-right: 20px;
}
</style>

View File

@ -50,7 +50,7 @@
<span v-else> ...</span>
</el-button>
<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>
</el-form-item>
</el-form>
@ -91,7 +91,7 @@ export default {
//
captchaEnabled: false,
//
register: false,
register: true,
redirect: undefined
};
},

View File

@ -1,47 +1,24 @@
<template>
<div class="register">
<el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form">
<h3 class="title">若依后台管理系统</h3>
<el-form-item prop="username">
<el-input v-model="registerForm.username" auto-complete="off" placeholder="账号" type="text">
<svg-icon slot="prefix" class="el-input__icon input-icon" icon-class="user"/>
</el-input>
<h3 class="title">企业注册页面</h3>
<el-form-item prop="pass">
<el-input type="text" v-model="registerForm.firmName" autocomplete="off" placeholder="企业名称"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
v-model="registerForm.password"
auto-complete="off"
placeholder="密码"
type="password"
@keyup.enter.native="handleRegister"
>
<svg-icon slot="prefix" class="el-input__icon input-icon" icon-class="password"/>
</el-input>
<el-form-item prop="pass">
<el-input type="text" v-model="registerForm.username" autocomplete="off" placeholder="企业登录账号"></el-input>
</el-form-item>
<el-form-item prop="confirmPassword">
<el-input
v-model="registerForm.confirmPassword"
auto-complete="off"
placeholder="确认密码"
type="password"
@keyup.enter.native="handleRegister"
>
<svg-icon slot="prefix" class="el-input__icon input-icon" icon-class="password"/>
</el-input>
<el-form-item prop="pass">
<el-input type="text" v-model="registerForm.password" autocomplete="off" placeholder="企业登录密码"></el-input>
</el-form-item>
<el-form-item v-if="captchaEnabled" prop="code">
<el-input
v-model="registerForm.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 prop="pass">
<el-input type="text" v-model="registerForm.nickName" autocomplete="off" placeholder="公司注册人"></el-input>
</el-form-item>
<el-form-item prop="pass">
<el-input type="text" v-model="registerForm.email" autocomplete="off" placeholder="企业邮箱"></el-input>
</el-form-item>
<el-form-item prop="pass">
<el-input type="text" v-model="registerForm.phonenumber" autocomplete="off" placeholder="企业电话"></el-input>
</el-form-item>
<el-form-item style="width:100%;">
<el-button

View File

@ -35,7 +35,7 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8080`,
target: `http://127.0.0.1:8080`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''