电子区域和电子围栏、坐标转换联调完成,编辑提示name重复,区域无法删除已反馈电信

main
xuechunyuan 3 years ago
parent dbb6c528f8
commit d28cafe3df
  1. BIN
      public/data/map/0002/default/240d819c33e0eeb4.pbf
  2. BIN
      public/data/map/0002/default/2ae162441b3580a3.pbf
  3. BIN
      public/data/map/0002/default/2f1d22c0aef2794a.pbf
  4. BIN
      public/data/map/0002/default/30100af91e6d7bed.pbf
  5. 0
      public/data/map/0002/default/39bda6ab4517425f.pbf
  6. BIN
      public/data/map/0002/default/39c92a55a7517b50.pbf
  7. BIN
      public/data/map/0002/default/3c8cf78d7cbd706b.1.png
  8. BIN
      public/data/map/0002/default/3c8cf78d7cbd706b.2.png
  9. BIN
      public/data/map/0002/default/3c8cf78d7cbd706b.4.png
  10. BIN
      public/data/map/0002/default/3c8cf78d7cbd706b.8.png
  11. BIN
      public/data/map/0002/default/44041634df400a13.pbf
  12. BIN
      public/data/map/0002/default/49c044a9b2dbe7f8.1.png
  13. BIN
      public/data/map/0002/default/49c044a9b2dbe7f8.2.png
  14. BIN
      public/data/map/0002/default/49c044a9b2dbe7f8.4.png
  15. BIN
      public/data/map/0002/default/49c044a9b2dbe7f8.8.png
  16. BIN
      public/data/map/0002/default/49c2e198940f07d4.1.png
  17. BIN
      public/data/map/0002/default/49c2e198940f07d4.2.png
  18. BIN
      public/data/map/0002/default/49c2e198940f07d4.4.png
  19. BIN
      public/data/map/0002/default/49c2e198940f07d4.8.png
  20. BIN
      public/data/map/0002/default/599b1121df707cf4.1.png
  21. BIN
      public/data/map/0002/default/599b1121df707cf4.2.png
  22. BIN
      public/data/map/0002/default/599b1121df707cf4.4.png
  23. BIN
      public/data/map/0002/default/599b1121df707cf4.8.png
  24. BIN
      public/data/map/0002/default/5de0fec8a1ad102c.pbf
  25. BIN
      public/data/map/0002/default/62455571f028a1a0.pbf
  26. BIN
      public/data/map/0002/default/746c074f830c3668.pbf
  27. BIN
      public/data/map/0002/default/7c2600f0edf530a5.pbf
  28. BIN
      public/data/map/0002/default/8493a04d4effeb04.pbf
  29. BIN
      public/data/map/0002/default/90a0faf2b7d99535.pbf
  30. BIN
      public/data/map/0002/default/9acdf5926ce8e3de.pbf
  31. BIN
      public/data/map/0002/default/bundle.pbf
  32. BIN
      public/data/map/0002/default/c60300572454b750.pbf
  33. BIN
      public/data/map/0002/default/c8cf3f56c4e242b1.1.png
  34. BIN
      public/data/map/0002/default/c8cf3f56c4e242b1.2.png
  35. BIN
      public/data/map/0002/default/c8cf3f56c4e242b1.4.png
  36. BIN
      public/data/map/0002/default/c8cf3f56c4e242b1.8.png
  37. BIN
      public/data/map/0002/default/ce7e2f079340da06.1.png
  38. BIN
      public/data/map/0002/default/ce7e2f079340da06.2.png
  39. BIN
      public/data/map/0002/default/ce7e2f079340da06.4.png
  40. BIN
      public/data/map/0002/default/ce7e2f079340da06.8.png
  41. BIN
      public/data/map/0002/default/f89d1d7113a0748f.1.png
  42. BIN
      public/data/map/0002/default/f89d1d7113a0748f.2.png
  43. BIN
      public/data/map/0002/default/f89d1d7113a0748f.4.png
  44. BIN
      public/data/map/0002/default/f89d1d7113a0748f.8.png
  45. 14
      src/api/rails/rails.js
  46. 8
      src/api/wirelessintrusion/wirelessintrusion.js
  47. 4
      src/router/axios.js
  48. 1
      src/views/alarmcenter/peopleposition/list.vue
  49. 54
      src/views/map/index.vue
  50. 108
      src/views/rails/arealist.vue
  51. 154
      src/views/rails/list.vue

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -52,7 +52,19 @@ export const railsAdd = (token, data) => {
//围栏编辑
export const railsUpdate = (token, data) => {
return request({
url: baseUrl + '/api/electronicFencePlatform/editRail',
url: baseUrl + '/api/electronicFencePlatform/editRail/' + data.id,
method: 'put',
headers: {
Authorization: token
},
data: data,
authorization: false
})
}
//围栏使用
export const useRail = (token, data) => {
return request({
url: baseUrl + '/api/electronicFencePlatform/useRail',
method: 'put',
headers: {
Authorization: token

@ -158,4 +158,12 @@ export const terminalList = (token, params) => {
params: params,
authorization: false
})
}
//定位设备列表
export const coordinateToWGS84 = (params) => {
return request({
url: '/api/appData/coordinateToWGS84',
method: 'get',
params: params
})
}

@ -93,8 +93,8 @@ const whiteList = [
'/system/dict/data/type/device_status',
'/api/bizDevice/list',
'/api/deviceTerminal/device/terminal',
'/api/electronicFencePlatform',
'/api/electronicFencePlatform'
'/api/electronicFencePlatform/rail/page',
'/api/electronicFencePlatform/region/page'
];//物联网平台白名单接口
function checkWhiteList(message) {
let ret = true;

@ -37,6 +37,7 @@ export default {
total: 0
},
option: {
height: 'auto',
calcHeight: 30,
tip: false,
searchShow: true,

@ -6,6 +6,7 @@
<script>
import Img from "@/assets/image/position_icon.png";
import { coordinateToWGS84 } from "@/api/wirelessintrusion/wirelessintrusion";
export default {
name: "map",
props: {
@ -35,12 +36,11 @@ export default {
window.map = null;
},
mounted() {
console.log('点位标注', this.sn);
window.map = new jsmapbase.JSMap({
container: 'mapContainer',
mapServerURL: 'data/map'
});
window.map.openMapById('0001');
window.map.openMapById('0002');
window.map.on("loadComplete", e => {
var floorControl = new jsmapbase.JSFloorControl({
position: jsmapbase.JSControlPosition.LEFT_TOP,//
@ -55,30 +55,36 @@ export default {
window.map.addControl(floorControl);
if(this.sn && this.floorNo && this.x && this.y) {
window.map._map.focusFloorId = this.floorNo;
let tool = new jsmapbase.JSMapCoordTool(window.map);
let pixel = tool.screenToMapCoordinate({x: this.x, y: this.y});
console.log(this.x);
//
var imagerMarker = new jsmapbase.JSImageMarker({
id: 'iamgeMareker1',//id
image: Img,//
position: new jsmapbase.JSPoint(pixel, 0),//
width: 55,//-
height: 55,//-
floorId: this.floorNo,//id
offset: jsmapbase.JSControlPosition.RIGHT_BOTTOM,//
depthTest: false,//
show: true, //
properties: {
name: 'test'
},//
callback: (node) => {
console.log(node);
}//
});
window.map.addMarker(imagerMarker);
coordinateToWGS84({ x:this.x, y:this.y, minX: 13439311, maxY:3667244.25 }).then(res => {
//
if(res.data.code == 200) {
var imagerMarker = new jsmapbase.JSImageMarker({
id: 'iamgeMareker1',//id
image: Img,//
position: new jsmapbase.JSPoint(res.data.data.lng, res.data.data.lat, 0),//
width: 55,//-
height: 55,//-
floorId: this.floorNo,//id
offset: jsmapbase.JSControlPosition.RIGHT_BOTTOM,//
depthTest: false,//
show: true, //
properties: {
name: 'test'
},//
callback: (node) => {
console.log(node);
}//
});
window.map.addMarker(imagerMarker);
}
})
}
});
//
window.map.on('mapClickNode', event => {
console.log(map._map.focusFloorId, map._map.allLayers);
console.log('===========', event);
});
},
methods: {

@ -18,17 +18,17 @@
</avue-crud>
<!-- 新增 编辑 详情 -->
<el-dialog :title="title" :visible.sync="dialogVisible" :append-to-body="true" :close-on-click-modal="false"
:close-on-press-escape="false" width="800px">
:close-on-press-escape="false" custom-class="dia_box" width="950px">
<el-form ref="addForm" :model="addForm" :rules="rules" label-width="80px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="建筑ID" prop="buildingId">
<el-input v-model="addForm.buildingId" placeholder="请输入建筑ID" disabled maxlength="10" />
<el-input v-model="addForm.buildingId" placeholder="请输入建筑ID" maxlength="10" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="区域名称" prop="name">
<el-input v-model="addForm.name" placeholder="请输入围栏名称" :disabled="type == 'view'" maxlength="30" />
<el-input v-model="addForm.name" placeholder="请输入围栏名称" :disabled="type == 'view'" maxlength="30" clearable />
</el-form-item>
</el-col>
</el-row><el-form-item label="">
@ -55,7 +55,7 @@
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="addForm.remark" placeholder="请输入备注" :disabled="type == 'view'" maxlength="200"
<el-input v-model="addForm.remark" placeholder="请输入备注" :disabled="type == 'view'" maxlength="200" :autosize="{ minRows: 2, maxRows: 4}" clearable
show-word-limit />
</el-form-item>
</el-col>
@ -73,7 +73,6 @@
import { bizLogin } from "@/api/wirelessintrusion/wirelessintrusion";
import { getRegionRailsList, regionDelete, regionAdd, regionUpdate, getRailsList } from "@/api/rails/rails";
import { mapGetters } from "vuex";
import { dateFormat } from "../../util/date"
export default {
data() {
@ -133,7 +132,7 @@ export default {
{
label: "备注",
prop: "remark",
overHide: true
overHidden: true
},
]
},
@ -169,18 +168,19 @@ export default {
},
//
rowView(row) {
this.addForm = row;
this.addForm = JSON.parse(JSON.stringify(row));
this.addForm.railIds = row.rails;
this.title = '围栏详情';
this.type = 'view';
this.dialogVisible = true;
// this.$refs.addForm.resetFields();
this.diaPage.currentPage = 1;
this.$nextTick(() => {
this.$refs.addForm.clearValidate();
this.queryRailsList(this.diaPage);
})
},
//
rowAdd(row) {
rowAdd() {
this.addForm = {
buildingId: this.buildingId,
railIds: [],
@ -191,19 +191,23 @@ export default {
this.multipleSelection = [];
this.diaPage.currentPage = 1;
this.dialogVisible = true;
// this.$refs.addForm.resetFields();
this.$nextTick(() => {
this.queryRailsList(this.diaPage);
this.$refs.addForm.clearValidate();
})
},
//
rowEdit(row) {
this.addForm = row;
this.addForm = JSON.parse(JSON.stringify(row));
this.addForm.railIds = row.rails;
this.title = '围栏编辑';
this.type = 'edit';
this.diaPage.currentPage = 1;
this.dialogVisible = true;
// this.$refs.addForm.resetFields();
this.$nextTick(() => {
this.queryRailsList(this.diaPage);
this.$refs.addForm.clearValidate();
})
},
//
submitForm() {
@ -221,11 +225,9 @@ export default {
return;
}
this.submitLoading = true;
console.log(this.addForm.id)
this.addForm.railIds = this.multipleSelection.map(item => {return item._id});
console.log(this.addForm);
if (this.addForm.id != undefined) {
regionUpdate(token, this.addForm).then(res => {
if (this.addForm._id != undefined) {
regionUpdate(token, { ...this.addForm, id: this.addForm._id}).then(res => {
this.submitLoading = false;
if (res.data.code == 401) {
window.sessionStorage.removeItem('bizToken');
@ -241,8 +243,13 @@ export default {
type: "success",
message: "操作成功!"
});
}else {
this.$message({
type: "error",
message: res.data.msg
});
}
}, err => {
}, () => {
this.submitLoading = false;
})
} else {
@ -262,8 +269,13 @@ export default {
type: "success",
message: "操作成功!"
});
}else {
this.$message({
type: "error",
message: res.data.msg
});
}
}, err => {
}, () => {
this.submitLoading = false;
})
}
@ -289,7 +301,7 @@ export default {
if (token == 'undefined' || !token) {
return;
}
regionDelete(token, { "buildingId": row.buildingId, "ids": [row.id] }).then(res => {
regionDelete(token, { "buildingId": row.buildingId, "ids": [row._id] }).then(res => {
if (res.data.code == 401) {
window.sessionStorage.removeItem('bizToken');
bizLogin({ appKey: 'Arf7bd4f26', appSecret: 'kb207044c8' }).then(res2 => {
@ -300,7 +312,9 @@ export default {
});
})
.then(() => {
this.onLoad(this.page);
setTimeout(() => {
this.onLoad(this.page);
}, 300)
this.$message({
type: "success",
message: "操作成功!"
@ -366,6 +380,10 @@ export default {
});
}
},
//
selectable() {
return this.type == 'view' ? false : true;
},
//
queryRailsList(page, params = {}) {
let values = {
@ -380,12 +398,11 @@ export default {
this.diaPage.total = data.totalElements;
this.tableData = data.content;
this.$refs.multipleTable.clearSelection();
let multipleSelection = this.addForm.railIds ? this.addForm.railIds.split(",") : [];
if (multipleSelection.length > 0) { //
if (this.addForm.railIds.length > 0) { //
this.$nextTick(() => {
this.tableData.forEach(row => { //
multipleSelection.forEach(item => { //
if (row._id === parseInt(item)) {
this.addForm.railIds.forEach(item => { //
if (row._id === item) {
this.$refs.multipleTable.toggleRowSelection(row, true); //
}
});
@ -406,12 +423,11 @@ export default {
this.diaPage.total = data.totalElements;
this.tableData = data.content;
this.$refs.multipleTable.clearSelection();
let multipleSelection = this.addForm.railIds ? this.addForm.railIds.split(",") : [];
if (multipleSelection.length > 0) { //
if (this.addForm.railIds.length > 0) { //
this.$nextTick(() => {
this.tableData.forEach(row => { //
multipleSelection.forEach(item => { //
if (row._id === parseInt(item)) {
this.addForm.railIds.forEach(item => { //
if (row._id === item) {
this.$refs.multipleTable.toggleRowSelection(row, true); //
}
});
@ -441,4 +457,40 @@ export default {
.el-table th.el-table__cell {
background: #F7F8FA;
}
.table_box {
th.el-table__cell {
background: #F7F8FA;
}
}
.dia_box {
height: 700px;
overflow: auto;
.el-table {
width: 100% !important;
border: 1px solid #D6D8DF;
}
.el-table th.el-table__cell {
background: #F7F8FA;
}
.dialog-footer {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.page_box {
width: 90%;
margin-left: 9%;
display: flex;
align-items: center;
justify-content: center;
margin-top: 15px;
}
}
</style>

@ -2,10 +2,12 @@
<basic-container>
<avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" :page.sync="page"
:permission="permissionList" @search-change="searchChange" @search-reset="searchReset"
@current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
@current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" @selection-change="selectionChange">
<template slot="menuLeft">
<el-button type="primary" size="small" icon="el-icon-plus" plain @click="rowAdd">新增
</el-button>
<!-- <el-button type="primary" size="small" icon="el-icon-connection" plain @click="rowUse">使用围栏
</el-button> -->
</template>
<template #menu="{ row, index }">
<el-button type="text" icon="el-icon-view" size="small" @click="rowView(row)">详情
@ -23,17 +25,19 @@
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="建筑ID" prop="buildingId">
<el-input v-model="addForm.buildingId" placeholder="请输入建筑ID" disabled maxlength="10" />
<el-input v-model="addForm.buildingId" placeholder="请输入建筑ID" maxlength="10" />
</el-form-item>
<el-form-item label="围栏名称" prop="name">
<el-input v-model="addForm.name" placeholder="请输入围栏名称" :disabled="type == 'view'" maxlength="30" />
<el-input v-model="addForm.name" placeholder="请输入围栏名称" :disabled="type == 'view'" maxlength="30"
clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="围栏类型" prop="type">
<el-select v-model="addForm.type" placeholder="请选择" :disabled="type == 'view'">
<el-option value="0" label="跨楼层"></el-option>
<el-option value="1" label="当前楼层"></el-option>
<el-select v-model="addForm.type" placeholder="请选择" :disabled="type == 'view'" style="width:100%;"
clearable>
<el-option v-for="item in railsType" :key="'railsType' + item.value" :value="item.value"
:label="item.label"></el-option>
</el-select>
</el-form-item>
<el-form-item label="楼层" prop="floorNo" :rules="addForm.type == 1 ? rules.floorNo : [{ required: false }]">
@ -50,14 +54,14 @@
<el-table-column label="坐标x">
<template slot-scope="{row,$index}">
<el-form-item :prop="`coordinates.${$index}.x`" label-width="0" :rules="rules.x">
<el-input v-model="row.x" placeholder="请输入坐标x" :disabled="type == 'view'" maxlength="10" />
<el-input v-model="row.x" placeholder="请输入坐标x" :disabled="type == 'view'" maxlength="10" clearable />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="坐标y">
<template slot-scope="{row,$index}">
<el-form-item :prop="`coordinates.${$index}.y`" label-width="0" :rules="rules.x">
<el-input v-model="row.y" placeholder="请输入坐标y" :disabled="type == 'view'" maxlength="10" />
<el-input v-model="row.y" placeholder="请输入坐标y" :disabled="type == 'view'" maxlength="10" clearable />
</el-form-item>
</template>
</el-table-column>
@ -71,8 +75,8 @@
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="addForm.remark" placeholder="请输入备注" :disabled="type == 'view'" maxlength="200"
show-word-limit />
<el-input v-model="addForm.remark" placeholder="请输入备注" :disabled="type == 'view'" maxlength="200" clearable
:autosize="{ minRows: 2, maxRows: 4 }" show-word-limit />
</el-form-item>
</el-col>
</el-row>
@ -82,14 +86,26 @@
<el-button v-if="type != 'view'" type="primary" @click="submitForm" :loading="submitLoading">确认</el-button>
</div>
</el-dialog>
<!-- 使用围栏 -->
<el-dialog title="使用围栏" :visible.sync="dialogVisible2" :append-to-body="true" :close-on-click-modal="false"
:close-on-press-escape="false" width="800px">
<el-form ref="addForm2" :model="addForm2" :rules="rules2" label-width="80px">
<el-form-item label="建筑ID" prop="buildingId">
<el-input v-model="addForm2.buildingId" placeholder="请输入建筑ID" maxlength="10" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible2 = false"> </el-button>
<el-button type="primary" @click="doRailsUse" :loading="submitLoading">确认</el-button>
</div>
</el-dialog>
</basic-container>
</template>
<script>
import { bizLogin } from "@/api/wirelessintrusion/wirelessintrusion";
import { getRailsList, railsDelete, railsAdd, railsUpdate } from "@/api/rails/rails";
import { getRailsList, railsDelete, railsAdd, railsUpdate, useRail } from "@/api/rails/rails";
import { mapGetters } from "vuex";
import { dateFormat } from "../../util/date"
export default {
data() {
@ -121,6 +137,10 @@ export default {
current: 1,
total: 0
},
//
railsType: [
{ value: 0, label: '跨楼层' }, { value: 1, label: '当前楼层' }
],
option: {
height: 'auto',
calcHeight: 30,
@ -146,6 +166,15 @@ export default {
],
prop: "type",
},
{
label: "是否使用",
type: 'switch',
prop: "own",
slot: true,
dicData: [
{ value: 'true', label: '是' }, { value: 'false', label: '否' }
]
},
{
label: "建筑 id",
prop: "buildingId",
@ -157,13 +186,26 @@ export default {
{
label: "备注",
prop: "remark",
overHide: true
overHidden: true
},
]
},
data: [],
submitLoading: false,
buildingId: 202861,//id
//使
selectionList: [],
ids: [],
addForm2: {
buildingId: '',
id: ''
},
dialogVisible2: false,
rules2: {
buildingId: [
{ required: true, message: "请输入建筑id", trigger: "blur" }
]
}
};
},
computed: {
@ -176,34 +218,86 @@ export default {
editBtn: false
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
//
selectionChange(list) {
this.selectionList = list;
},
//使
rowUse() {
},
doRailsUse() {
console.log(val, row);
if(val) {
return
}
let token = window.sessionStorage.getItem('bizToken');
if (token == 'undefined' || !token) {
return;
}
useRail(token, { "buildingId": row.buildingId, "id": [row._id] }).then(res => {
if (res.data.code == 401) {
window.sessionStorage.removeItem('bizToken');
bizLogin({ appKey: 'Arf7bd4f26', appSecret: 'kb207044c8' }).then(res2 => {
window.sessionStorage.setItem('bizToken', res2.data.data.token);
this.changeOwn(val, row);
})
} else if(res.data.code == 0) {
setTimeout(() => {
this.onLoad(this.page);
}, 300);
this.$message({
type: "success",
message: "操作成功!"
});
}
});
},
//
rowView(row) {
this.addForm = row;
this.title = '围栏详情';
this.type = 'view';
this.dialogVisible = true;
this.$refs.addForm.resetFields();
this.$nextTick(() => {
this.$refs.addForm.clearValidate();
})
},
//
rowAdd(row) {
rowAdd() {
this.addForm = {
type: "",
name: "",
coordinates: [{ "x": 0, "y": 0 }],
buildingId: this.buildingId
buildingId: this.buildingId,
floorNo: "",
remark: ""
};
this.title = '围栏新增';
this.type = 'add';
this.dialogVisible = true;
this.$refs.addForm.resetFields();
this.$nextTick(() => {
this.$refs.addForm.clearValidate();
})
},
//
rowEdit(row) {
this.addForm = row;
this.addForm = JSON.parse(JSON.stringify(row));
this.title = '围栏编辑';
this.type = 'edit';
this.dialogVisible = true;
this.$refs.addForm.resetFields();
this.$nextTick(() => {
this.$refs.addForm.clearValidate();
})
},
//
submitForm() {
@ -223,7 +317,7 @@ export default {
this.submitLoading = true;
console.log(this.addForm._id)
if (this.addForm._id != undefined) {
railsUpdate(token, { ...this.addForm, id: this.addForm._id}).then(res => {
railsUpdate(token, { ...this.addForm, id: this.addForm._id, type: this.addForm.type ? Number(this.addForm.type) : '', floorNo: this.addForm.floorNo ? Number(this.addForm.floorNo) : '' }).then(res => {
this.submitLoading = false;
if (res.data.code == 401) {
window.sessionStorage.removeItem('bizToken');
@ -239,12 +333,17 @@ export default {
type: "success",
message: "操作成功!"
});
} else {
this.$message({
type: "error",
message: res.data.msg
});
}
}, err => {
}, () => {
this.submitLoading = false;
})
} else {
railsAdd(token, this.addForm).then(res => {
railsAdd(token, { ...this.addForm, type: this.addForm.type ? Number(this.addForm.type) : '', floorNo: this.addForm.floorNo ? Number(this.addForm.floorNo) : '' }).then(res => {
this.submitLoading = false;
if (res.data.code == 401) {
window.sessionStorage.removeItem('bizToken');
@ -260,8 +359,13 @@ export default {
type: "success",
message: "操作成功!"
});
} else {
this.$message({
type: "error",
message: res.data.msg
});
}
}, err => {
}, () => {
this.submitLoading = false;
})
}
@ -298,7 +402,9 @@ export default {
});
})
.then(() => {
this.onLoad(this.page);
setTimeout(() => {
this.onLoad(this.page);
}, 300);
this.$message({
type: "success",
message: "操作成功!"

Loading…
Cancel
Save