新增添加电子围栏
parent
65419e532d
commit
7e6fe5583e
|
@ -1,9 +1,24 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询参数列表
|
||||
// 查询围栏标签列表
|
||||
export function list() {
|
||||
return request({
|
||||
url: '/fence/fenceTag/list',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 查询所属围栏列表
|
||||
export function selectIdFenceList(fenceTagId) {
|
||||
return request({
|
||||
url: '/fence/fenceTag/selectIdFence/' + fenceTagId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
//添加电子围栏数据
|
||||
export function insertFenceObject(form) {
|
||||
return request({
|
||||
url: '/fence/fence/insert',
|
||||
method: 'post',
|
||||
data: form,
|
||||
})
|
||||
}
|
||||
|
|
|
@ -6,46 +6,122 @@
|
|||
|
||||
<el-table-column label="围栏标签主键id" width="180">
|
||||
<template slot-scope="scope">
|
||||
<i class="el-icon-time"></i>
|
||||
<span style="margin-left: 10px">{{ scope.row.fenceTagId }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="围栏标签名称" width="180">
|
||||
<template slot-scope="scope">
|
||||
<i class="el-icon-time"></i>
|
||||
<span style="margin-left: 10px">{{ scope.row.fenceTagName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="创建人" width="180">
|
||||
<template slot-scope="scope">
|
||||
<i class="el-icon-time"></i>
|
||||
<span style="margin-left: 10px">{{ scope.row.createdBy }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="创建时间" width="180">
|
||||
<template slot-scope="scope">
|
||||
<i class="el-icon-time"></i>
|
||||
<span style="margin-left: 10px">{{ scope.row.createdTime}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="更新人" width="180">
|
||||
<template slot-scope="scope">
|
||||
<i class="el-icon-time"></i>
|
||||
<span style="margin-left: 10px">{{scope.row.updatedBy}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="更新时间" width="180">
|
||||
<template slot-scope="scope">
|
||||
<i class="el-icon-time"></i>
|
||||
<span style="margin-left: 10px">{{scope.row.updatedTime}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="420">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" @click="selectIdFence(scope.row)">查看围栏所属</el-button>
|
||||
|
||||
<!-- 查看这个标签下所属的围栏-->
|
||||
<el-dialog title="电子围栏" :visible.sync="dialogTableVisible" style="text-align: center">
|
||||
<el-table :data="gridData" style="width: 1000px">
|
||||
<el-table-column label="围栏主键id" width="110">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ scope.row.fenceId }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="围栏名称" width="110">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ scope.row.fenceName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="围栏数据" width="210">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ scope.row.fenceData }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="围栏状态" width="180">
|
||||
<template slot-scope="scope">
|
||||
<i v-if="scope.row.status==1">
|
||||
已开启
|
||||
</i>
|
||||
<i v-if="scope.row.status==0">
|
||||
未开启
|
||||
</i>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="告警类型" width="180">
|
||||
<template slot-scope="scope">
|
||||
<i v-if="scope.row.alarmType==1">
|
||||
驶出警告
|
||||
</i>
|
||||
<i v-if="scope.row.alarmType==0">
|
||||
驶入警告
|
||||
</i>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="110">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="">绘制围栏</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
<!-- <el-input v-model="form.fenceData" autocomplete="off"></el-input>-->
|
||||
|
||||
<el-button type="primary" @click="openInsert(scope.row)">添加所属围栏</el-button>
|
||||
<!-- 添加这个标签下所属的围栏-->
|
||||
<el-dialog title="添加围栏" :visible.sync="dialogFormVisible">
|
||||
<el-form :model="form">
|
||||
<el-form-item label="围栏名称" :label-width="formLabelWidth">
|
||||
<el-input v-model="form.fenceName" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="围栏状态" :label-width="formLabelWidth">
|
||||
<el-select v-model="form.status" placeholder="请选择围栏状态">
|
||||
<el-option label="未开启" value="0"></el-option>
|
||||
<el-option label="已开启" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="报警类型" :label-width="formLabelWidth">
|
||||
<el-select v-model="form.alarmType" placeholder="请选择报警类型">
|
||||
<el-option label="驶入警告" value="0"></el-option>
|
||||
<el-option label="驶出警告" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="insertFence">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
|
@ -54,7 +130,7 @@
|
|||
<script>
|
||||
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||
//例如:import 《组件名称》 from '《组件路径》,
|
||||
import { list } from "@/api/system/fence";
|
||||
import { list,selectIdFenceList,insertFenceObject } from "@/api/system/fence";
|
||||
|
||||
export default {
|
||||
//import引入的组件需要注入到对象中才能使用"
|
||||
|
@ -64,6 +140,9 @@ export default {
|
|||
//这里存放数据"
|
||||
|
||||
return {
|
||||
gridData: [],
|
||||
dialogTableVisible: false,
|
||||
dialogFormVisible: false,
|
||||
form:{
|
||||
fenceName: null,
|
||||
fenceData: null,
|
||||
|
@ -72,6 +151,7 @@ export default {
|
|||
fenceTagId: null,
|
||||
},
|
||||
tableData:[],
|
||||
formLabelWidth: '320px',
|
||||
};
|
||||
},
|
||||
//计算属性 类似于data概念",
|
||||
|
@ -80,16 +160,34 @@ export default {
|
|||
watch: {},
|
||||
//方法集合",
|
||||
methods: {
|
||||
FenceList() {
|
||||
FenceTagList() {
|
||||
list().then(res => {
|
||||
console.log(res.data)
|
||||
this.tableData=res.data
|
||||
})
|
||||
},
|
||||
selectIdFence(val) {
|
||||
this.dialogTableVisible = true
|
||||
selectIdFenceList(val.fenceTagId).then(res=>{
|
||||
this.gridData=res.data
|
||||
})
|
||||
},
|
||||
openInsert(val) {
|
||||
this.dialogFormVisible=true
|
||||
this.form.fenceTagId=val.fenceTagId
|
||||
console.log(this.form)
|
||||
},
|
||||
insertFence() {
|
||||
this.dialogFormVisible = false
|
||||
console.log(this.form)
|
||||
insertFenceObject(this.form).then(res=>{
|
||||
alert(res.msg);
|
||||
})
|
||||
},
|
||||
},
|
||||
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||
created() {
|
||||
this.FenceList();
|
||||
this.FenceTagList();
|
||||
},
|
||||
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||
mounted() {
|
||||
|
@ -111,5 +209,8 @@ export default {
|
|||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
#container {
|
||||
width: 100%;
|
||||
height: 850px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -31,7 +31,7 @@ import AMapLoader from '@amap/amap-jsapi-loader';
|
|||
methods: {
|
||||
initAMap() {
|
||||
AMapLoader.load({
|
||||
key: "0b5f26b194361cbc9571101bc2856962", // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
key: "164dc573bc4daf5bf1f1ebcebdae0717", // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
version: "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
||||
plugins: ['AMap.MouseTool'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue