|
@@ -83,7 +83,7 @@
|
|
<el-dropdown-menu slot="dropdown">
|
|
<el-dropdown-menu slot="dropdown">
|
|
<el-dropdown-item command="settingOpen">设备设置</el-dropdown-item>
|
|
<el-dropdown-item command="settingOpen">设备设置</el-dropdown-item>
|
|
<el-dropdown-item command="healthInterval">健康阈值设置</el-dropdown-item>
|
|
<el-dropdown-item command="healthInterval">健康阈值设置</el-dropdown-item>
|
|
- <el-dropdown-item command="fence">电子围栏</el-dropdown-item>
|
|
|
|
|
|
+ <el-dropdown-item command="fenceOpen">电子围栏</el-dropdown-item>
|
|
<el-dropdown-item command="health">健康指标</el-dropdown-item>
|
|
<el-dropdown-item command="health">健康指标</el-dropdown-item>
|
|
<el-dropdown-item command="deviceLog">设备消息日志</el-dropdown-item>
|
|
<el-dropdown-item command="deviceLog">设备消息日志</el-dropdown-item>
|
|
<!-- <el-dropdown-item command="settingLog">设置日志</el-dropdown-item> -->
|
|
<!-- <el-dropdown-item command="settingLog">设置日志</el-dropdown-item> -->
|
|
@@ -558,38 +558,56 @@
|
|
<pagination v-show="logTotal > 0" :total="logTotal" :page.sync="logQuery.pageNum" :limit.sync="logQuery.pageSize"
|
|
<pagination v-show="logTotal > 0" :total="logTotal" :page.sync="logQuery.pageNum" :limit.sync="logQuery.pageSize"
|
|
@pagination="getDeviceLog" />
|
|
@pagination="getDeviceLog" />
|
|
</el-dialog>
|
|
</el-dialog>
|
|
- <el-dialog title="电子围栏" :visible.sync="fence" width="1200px" :before-close="beforeClose" destroy-on-close>
|
|
|
|
|
|
+ <el-dialog title="电子围栏" :visible.sync="fenceOpen" width="1200px" :before-close="beforeClose" destroy-on-close :close-on-click-modal="false">
|
|
<div id="map">
|
|
<div id="map">
|
|
<el-row class="map-tool">
|
|
<el-row class="map-tool">
|
|
- <el-select size="mini" v-model="fenceType">
|
|
|
|
- <el-option :label="1" :value="1">123</el-option>
|
|
|
|
|
|
+ <el-select size="mini" v-model="fenceName" @change="selectFence">
|
|
|
|
+ <el-option v-for="(item, index) in fenceList" :key="index" :label="item.fenceName"
|
|
|
|
+ :value="item.fenceName"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
- <el-button size="mini" type="primary" style="margin-left: 10px;">新增</el-button>
|
|
|
|
- <el-button size="mini" type="warning">修改</el-button>
|
|
|
|
|
|
+ <el-button size="mini" type="primary" style="margin-left: 10px;" @click="editAdd">新增</el-button>
|
|
|
|
+ <el-button size="mini" type="warning" @click="editUpdate">修改</el-button>
|
|
<el-button size="mini" type="danger">删除</el-button>
|
|
<el-button size="mini" type="danger">删除</el-button>
|
|
</el-row>
|
|
</el-row>
|
|
- <el-form class="update-tool" :model="fenceInfo" label-width="70px" size="mini">
|
|
|
|
|
|
+ <el-form class="update-tool" :model="fenceInfo" label-width="70px" size="mini" v-show="fenceEdit">
|
|
<el-form-item label="围栏名称">
|
|
<el-form-item label="围栏名称">
|
|
- <el-input size="mini"></el-input>
|
|
|
|
|
|
+ <el-input size="mini" v-model="fenceInfo.fenceName"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="开始时间">
|
|
<el-form-item label="开始时间">
|
|
- <el-input size="mini"></el-input>
|
|
|
|
|
|
+ <el-time-picker v-model="fenceInfo.start_time" value-format="HH:mm" placeholder="选择日期时间">
|
|
|
|
+ </el-time-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="结束时间">
|
|
<el-form-item label="结束时间">
|
|
- <el-input size="mini"></el-input>
|
|
|
|
|
|
+ <el-time-picker v-model="fenceInfo.end_time" :picker-options="{ minTime: fenceInfo.startTime }"
|
|
|
|
+ value-format="HH:mm" placeholder="选择日期时间">
|
|
|
|
+ </el-time-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="围栏类型">
|
|
<el-form-item label="围栏类型">
|
|
- <el-input size="mini"></el-input>
|
|
|
|
|
|
+ <el-select v-model="fenceInfo.type">
|
|
|
|
+ <el-option v-for="i in fenceType" :key="i.dictValue" :value="i.dictValue" :label="i.dictLabel"></el-option>
|
|
|
|
+ </el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="是否开启">
|
|
<el-form-item label="是否开启">
|
|
- <el-input size="mini"></el-input>
|
|
|
|
|
|
+ <el-select v-model="fenceInfo.state">
|
|
|
|
+ <el-option :value="1" label="是"></el-option>
|
|
|
|
+ <el-option :value="0" label="否"></el-option>
|
|
|
|
+ </el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
- <el-row class="edit">
|
|
|
|
- <el-button class="edit-btn" size="small" type="primary">圆形</el-button>
|
|
|
|
- <el-button class="edit-btn" size="small" type="primary">重新绘制</el-button>
|
|
|
|
- <el-button class="edit-btn" size="small" type="primary">取消绘制</el-button>
|
|
|
|
- <el-button class="edit-btn" size="small" type="primary">提交</el-button>
|
|
|
|
|
|
+ <el-row class="edit" v-show="fenceEdit">
|
|
|
|
+ <el-dropdown size="small" trigger="click" style="margin-right: 10px;" @command="switchFenceType">
|
|
|
|
+ <el-button type="primary" size="small">
|
|
|
|
+ {{ fenceBtn }}<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
|
+ <el-dropdown-item command="circle">圆形</el-dropdown-item>
|
|
|
|
+ <!-- <el-dropdown-item command="rect">矩形</el-dropdown-item> -->
|
|
|
|
+ <el-dropdown-item command="polygon">多边形</el-dropdown-item>
|
|
|
|
+ </el-dropdown-menu>
|
|
|
|
+ </el-dropdown>
|
|
|
|
+ <el-button class="edit-btn" size="small" type="primary" @click="switchFenceType('circle')">重新绘制</el-button>
|
|
|
|
+ <el-button class="edit-btn" size="small" type="primary" @click="editCancel">取消绘制</el-button>
|
|
|
|
+ <el-button class="edit-btn" size="small" type="primary" @click="subFence">提交</el-button>
|
|
</el-row>
|
|
</el-row>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -635,7 +653,8 @@ import {
|
|
getStepRate,
|
|
getStepRate,
|
|
getRollRate,
|
|
getRollRate,
|
|
getDeviceLog,
|
|
getDeviceLog,
|
|
- setDeviceInterval
|
|
|
|
|
|
+ setDeviceInterval,
|
|
|
|
+ addFence
|
|
}
|
|
}
|
|
from "@/api/system/device";
|
|
from "@/api/system/device";
|
|
import { listProfile, getProfile } from "@/api/system/profile";
|
|
import { listProfile, getProfile } from "@/api/system/profile";
|
|
@@ -748,9 +767,9 @@ export default {
|
|
health: false,
|
|
health: false,
|
|
tab: 0,
|
|
tab: 0,
|
|
map: null,
|
|
map: null,
|
|
- fence: false,
|
|
|
|
|
|
+ fenceOpen: false,
|
|
fenceInfo: {},
|
|
fenceInfo: {},
|
|
- fenceType: 0,
|
|
|
|
|
|
+ fenceName: null,
|
|
echartsQuery: {
|
|
echartsQuery: {
|
|
device_id_code: null,
|
|
device_id_code: null,
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
@@ -785,7 +804,16 @@ export default {
|
|
shouhuan_oxygen_min: null,
|
|
shouhuan_oxygen_min: null,
|
|
shouhuan_body_max: null,
|
|
shouhuan_body_max: null,
|
|
shouhuan_body_min: null
|
|
shouhuan_body_min: null
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ fenceEdit: false,
|
|
|
|
+ fenceType: [],
|
|
|
|
+ fenceBtn: '圆形',
|
|
|
|
+ fence: null,
|
|
|
|
+ fenceEditor: null,
|
|
|
|
+ fenceData: {},
|
|
|
|
+ fenceList: [],
|
|
|
|
+ fenceName: null,
|
|
|
|
+ add_flag: true
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -812,6 +840,9 @@ export default {
|
|
this.getDicts('sys_user_type').then(res => {
|
|
this.getDicts('sys_user_type').then(res => {
|
|
this.clientType = res.data
|
|
this.clientType = res.data
|
|
})
|
|
})
|
|
|
|
+ this.getDicts('sys_fence_type').then(res => {
|
|
|
|
+ this.fenceType = res.data
|
|
|
|
+ })
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
'form.grantType': {
|
|
'form.grantType': {
|
|
@@ -848,21 +879,23 @@ export default {
|
|
closeInterval() {
|
|
closeInterval() {
|
|
this.healthInterval = false
|
|
this.healthInterval = false
|
|
this.deviceInterval = {
|
|
this.deviceInterval = {
|
|
- shouhuan_heart_max: null,
|
|
|
|
- shouhuan_heart_min: null,
|
|
|
|
- shouhuan_blood_high_max: null,
|
|
|
|
- shouhuan_blood_high_min: null,
|
|
|
|
- shouhuan_blood_low_max: null,
|
|
|
|
- shouhuan_blood_low_min: null,
|
|
|
|
- shouhuan_oxygen_max: null,
|
|
|
|
- shouhuan_oxygen_min: null,
|
|
|
|
- shouhuan_body_max: null,
|
|
|
|
- shouhuan_body_min: null
|
|
|
|
- }
|
|
|
|
|
|
+ shouhuan_heart_max: null,
|
|
|
|
+ shouhuan_heart_min: null,
|
|
|
|
+ shouhuan_blood_high_max: null,
|
|
|
|
+ shouhuan_blood_high_min: null,
|
|
|
|
+ shouhuan_blood_low_max: null,
|
|
|
|
+ shouhuan_blood_low_min: null,
|
|
|
|
+ shouhuan_oxygen_max: null,
|
|
|
|
+ shouhuan_oxygen_min: null,
|
|
|
|
+ shouhuan_body_max: null,
|
|
|
|
+ shouhuan_body_min: null
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ selectSetting(e) {
|
|
|
|
+ this.settingPage = e
|
|
},
|
|
},
|
|
async setDeviceInfo() {
|
|
async setDeviceInfo() {
|
|
- let flag = 0
|
|
|
|
- if (Object.keys(this.sosForm).length) {
|
|
|
|
|
|
+ if (Object.keys(this.sosForm).length && this.settingPage == 'sos') {
|
|
let arr = []
|
|
let arr = []
|
|
arr.push(this.sosForm.tel1)
|
|
arr.push(this.sosForm.tel1)
|
|
arr.push(this.sosForm.tel2)
|
|
arr.push(this.sosForm.tel2)
|
|
@@ -873,25 +906,19 @@ export default {
|
|
obj.param = { tels: arr }
|
|
obj.param = { tels: arr }
|
|
await axios({
|
|
await axios({
|
|
method: 'POST',
|
|
method: 'POST',
|
|
- url: 'https://app.tjzhxx.cn:4200/index.php/api/shouhuan/createcommand',
|
|
|
|
|
|
+ url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
|
|
headers: {
|
|
headers: {
|
|
Authorization: getToken(),
|
|
Authorization: getToken(),
|
|
},
|
|
},
|
|
data: obj,
|
|
data: obj,
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.data && res.data.code == 200) {
|
|
if (res.data && res.data.code == 200) {
|
|
- if (flag == 2) {
|
|
|
|
- return
|
|
|
|
- } else {
|
|
|
|
- flag = 1
|
|
|
|
- }
|
|
|
|
|
|
+ this.$modal.msgSuccess('设置成功')
|
|
} else {
|
|
} else {
|
|
this.$modal.msgError('SOS设置失败')
|
|
this.$modal.msgError('SOS设置失败')
|
|
- flag = 2
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- }
|
|
|
|
- if (Object.keys(this.intervalForm).length) {
|
|
|
|
|
|
+ } else if (Object.keys(this.intervalForm).length && this.settingPage == 'sos') {
|
|
let obj = {}
|
|
let obj = {}
|
|
obj.facility_id = this.setUser.fid
|
|
obj.facility_id = this.setUser.fid
|
|
obj.device_id_code = this.setUser.deviceId
|
|
obj.device_id_code = this.setUser.deviceId
|
|
@@ -899,25 +926,19 @@ export default {
|
|
obj.param = this.intervalForm
|
|
obj.param = this.intervalForm
|
|
await axios({
|
|
await axios({
|
|
method: 'POST',
|
|
method: 'POST',
|
|
- url: 'https://app.tjzhxx.cn:4200/index.php/api/shouhuan/createcommand',
|
|
|
|
|
|
+ url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
|
|
headers: {
|
|
headers: {
|
|
Authorization: getToken(),
|
|
Authorization: getToken(),
|
|
},
|
|
},
|
|
data: obj,
|
|
data: obj,
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.data && res.data.code == 200) {
|
|
if (res.data && res.data.code == 200) {
|
|
- if (flag == 2) {
|
|
|
|
- return
|
|
|
|
- } else {
|
|
|
|
- flag = 1
|
|
|
|
- }
|
|
|
|
|
|
+ this.$modal.msgSuccess('设置成功')
|
|
} else {
|
|
} else {
|
|
this.$modal.msgError('测量间隔设置失败')
|
|
this.$modal.msgError('测量间隔设置失败')
|
|
- flag = 2
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- }
|
|
|
|
- if (Object.keys(this.pedoForm).length) {
|
|
|
|
|
|
+ } else if (Object.keys(this.pedoForm).length && this.settingPage == 'sos') {
|
|
let is_open = this.pedoForm.isopen ? 1 : 0
|
|
let is_open = this.pedoForm.isopen ? 1 : 0
|
|
let obj = {}
|
|
let obj = {}
|
|
obj.facility_id = this.setUser.fid
|
|
obj.facility_id = this.setUser.fid
|
|
@@ -926,25 +947,19 @@ export default {
|
|
obj.param = { is_open: is_open }
|
|
obj.param = { is_open: is_open }
|
|
await axios({
|
|
await axios({
|
|
method: 'POST',
|
|
method: 'POST',
|
|
- url: 'https://app.tjzhxx.cn:4200/index.php/api/shouhuan/createcommand',
|
|
|
|
|
|
+ url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
|
|
headers: {
|
|
headers: {
|
|
Authorization: getToken(),
|
|
Authorization: getToken(),
|
|
},
|
|
},
|
|
data: obj,
|
|
data: obj,
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.data && res.data.code == 200) {
|
|
if (res.data && res.data.code == 200) {
|
|
- if (flag == 2) {
|
|
|
|
- return
|
|
|
|
- } else {
|
|
|
|
- flag = 1
|
|
|
|
- }
|
|
|
|
|
|
+ this.$modal.msgSuccess('设置成功')
|
|
} else {
|
|
} else {
|
|
this.$modal.msgError('计步设置失败')
|
|
this.$modal.msgError('计步设置失败')
|
|
- flag = 2
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- }
|
|
|
|
- if (Object.keys(this.telForm).length) {
|
|
|
|
|
|
+ } else if (Object.keys(this.telForm).length && this.settingPage == 'sos') {
|
|
let arr = []
|
|
let arr = []
|
|
if (this.telForm.tel1 && this.telForm.name1) {
|
|
if (this.telForm.tel1 && this.telForm.name1) {
|
|
arr.push({ telno: this.telForm.tel1, name: this.telForm.name1 })
|
|
arr.push({ telno: this.telForm.tel1, name: this.telForm.name1 })
|
|
@@ -962,25 +977,19 @@ export default {
|
|
obj.param = arr
|
|
obj.param = arr
|
|
await axios({
|
|
await axios({
|
|
method: 'POST',
|
|
method: 'POST',
|
|
- url: 'https://app.tjzhxx.cn:4200/index.php/api/shouhuan/createcommand',
|
|
|
|
|
|
+ url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
|
|
headers: {
|
|
headers: {
|
|
Authorization: getToken(),
|
|
Authorization: getToken(),
|
|
},
|
|
},
|
|
data: obj,
|
|
data: obj,
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.data && res.data.code == 200) {
|
|
if (res.data && res.data.code == 200) {
|
|
- if (flag == 2) {
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
- flag = 1
|
|
|
|
- }
|
|
|
|
|
|
+ this.$modal.msgSuccess('设置成功')
|
|
} else {
|
|
} else {
|
|
this.$modal.msgError('通讯录设置失败')
|
|
this.$modal.msgError('通讯录设置失败')
|
|
- flag = 2
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- }
|
|
|
|
- if (Object.keys(this.onoffForm).length) {
|
|
|
|
|
|
+ } else if (Object.keys(this.onoffForm).length && this.settingPage == 'sos') {
|
|
this.onoffForm.is_open = this.onoffForm.is_open ? 1 : 0
|
|
this.onoffForm.is_open = this.onoffForm.is_open ? 1 : 0
|
|
let obj = {}
|
|
let obj = {}
|
|
obj.facility_id = this.setUser.fid
|
|
obj.facility_id = this.setUser.fid
|
|
@@ -989,25 +998,19 @@ export default {
|
|
obj.param = this.onoffForm
|
|
obj.param = this.onoffForm
|
|
await axios({
|
|
await axios({
|
|
method: 'POST',
|
|
method: 'POST',
|
|
- url: 'https://app.tjzhxx.cn:4200/index.php/api/shouhuan/createcommand',
|
|
|
|
|
|
+ url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
|
|
headers: {
|
|
headers: {
|
|
Authorization: getToken(),
|
|
Authorization: getToken(),
|
|
},
|
|
},
|
|
data: obj,
|
|
data: obj,
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.data && res.data.code == 200) {
|
|
if (res.data && res.data.code == 200) {
|
|
- if (flag == 2) {
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
- flag = 1
|
|
|
|
- }
|
|
|
|
|
|
+ this.$modal.msgSuccess('设置成功')
|
|
} else {
|
|
} else {
|
|
this.$modal.msgError('定时开关机设置失败')
|
|
this.$modal.msgError('定时开关机设置失败')
|
|
- flag = 2
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- }
|
|
|
|
- if (Object.keys(this.wearForm).length) {
|
|
|
|
|
|
+ } else if (Object.keys(this.wearForm).length && this.settingPage == 'sos') {
|
|
this.wearForm.is_open = this.wearForm.is_open ? 1 : 0
|
|
this.wearForm.is_open = this.wearForm.is_open ? 1 : 0
|
|
let obj = {}
|
|
let obj = {}
|
|
obj.facility_id = this.setUser.fid
|
|
obj.facility_id = this.setUser.fid
|
|
@@ -1016,25 +1019,19 @@ export default {
|
|
obj.param = this.wearForm
|
|
obj.param = this.wearForm
|
|
await axios({
|
|
await axios({
|
|
method: 'POST',
|
|
method: 'POST',
|
|
- url: 'https://app.tjzhxx.cn:4200/index.php/api/shouhuan/createcommand',
|
|
|
|
|
|
+ url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
|
|
headers: {
|
|
headers: {
|
|
Authorization: getToken(),
|
|
Authorization: getToken(),
|
|
},
|
|
},
|
|
data: obj,
|
|
data: obj,
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.data && res.data.code == 200) {
|
|
if (res.data && res.data.code == 200) {
|
|
- if (flag == 2) {
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
- flag = 1
|
|
|
|
- }
|
|
|
|
|
|
+ this.$modal.msgSuccess('设置成功')
|
|
} else {
|
|
} else {
|
|
this.$modal.msgError('定时开关机设置失败')
|
|
this.$modal.msgError('定时开关机设置失败')
|
|
- flag = 2
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- }
|
|
|
|
- if (this.clockList.length) {
|
|
|
|
|
|
+ } else if (this.clockList.length && this.settingPage == 'sos') {
|
|
this.clockList.map(item => {
|
|
this.clockList.map(item => {
|
|
if (item.weeks.length) {
|
|
if (item.weeks.length) {
|
|
item.type = 3
|
|
item.type = 3
|
|
@@ -1049,25 +1046,19 @@ export default {
|
|
obj.param = this.clockList
|
|
obj.param = this.clockList
|
|
await axios({
|
|
await axios({
|
|
method: 'POST',
|
|
method: 'POST',
|
|
- url: 'https://app.tjzhxx.cn:4200/index.php/api/shouhuan/createcommand',
|
|
|
|
|
|
+ url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
|
|
headers: {
|
|
headers: {
|
|
Authorization: getToken(),
|
|
Authorization: getToken(),
|
|
},
|
|
},
|
|
data: obj,
|
|
data: obj,
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.data && res.data.code == 200) {
|
|
if (res.data && res.data.code == 200) {
|
|
- if (flag == 2) {
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
- flag = 1
|
|
|
|
- }
|
|
|
|
|
|
+ this.$modal.msgSuccess('设置成功')
|
|
} else {
|
|
} else {
|
|
this.$modal.msgError('闹钟设置失败')
|
|
this.$modal.msgError('闹钟设置失败')
|
|
- flag = 2
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- }
|
|
|
|
- if (Object.keys(this.fallForm).length) {
|
|
|
|
|
|
+ } else if (Object.keys(this.fallForm).length && this.settingPage == 'sos') {
|
|
this.fallForm.is_open = this.onoffForm.is_open ? 1 : 0
|
|
this.fallForm.is_open = this.onoffForm.is_open ? 1 : 0
|
|
let obj = {}
|
|
let obj = {}
|
|
obj.facility_id = this.setUser.fid
|
|
obj.facility_id = this.setUser.fid
|
|
@@ -1076,28 +1067,19 @@ export default {
|
|
obj.param = this.fallForm
|
|
obj.param = this.fallForm
|
|
await axios({
|
|
await axios({
|
|
method: 'POST',
|
|
method: 'POST',
|
|
- url: 'https://app.tjzhxx.cn:4200/index.php/api/shouhuan/createcommand',
|
|
|
|
|
|
+ url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
|
|
headers: {
|
|
headers: {
|
|
Authorization: getToken(),
|
|
Authorization: getToken(),
|
|
},
|
|
},
|
|
data: obj,
|
|
data: obj,
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.data && res.data.code == 200) {
|
|
if (res.data && res.data.code == 200) {
|
|
- if (flag == 2) {
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
- flag = 1
|
|
|
|
- }
|
|
|
|
|
|
+ this.$modal.msgSuccess('设置成功')
|
|
} else {
|
|
} else {
|
|
this.$modal.msgError('跌倒提醒设置失败')
|
|
this.$modal.msgError('跌倒提醒设置失败')
|
|
- flag = 2
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- if (flag == 1) {
|
|
|
|
- this.$modal.msgSuccess('设置成功')
|
|
|
|
- this.settingOpen = false
|
|
|
|
- }
|
|
|
|
},
|
|
},
|
|
resetDeviceInfo() {
|
|
resetDeviceInfo() {
|
|
this.sosForm = {}
|
|
this.sosForm = {}
|
|
@@ -1369,23 +1351,216 @@ export default {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ subFence() {
|
|
|
|
+ this.fenceEditor.close()
|
|
|
|
+ if (this.add_flag) {
|
|
|
|
+ this.fenceInfo.deviceid = this.setUser.deviceId
|
|
|
|
+ console.log(this.fenceInfo);
|
|
|
|
+ // addFence(this.fenceInfo).then(res => {
|
|
|
|
+
|
|
|
|
+ // })
|
|
|
|
+ this.fenceList.push(this.fenceInfo)
|
|
|
|
+ } else {
|
|
|
|
+ this.fenceList.map(item => {
|
|
|
|
+ if (item.fenceName == this.fenceInfo.fenceName) {
|
|
|
|
+ item = this.fenceInfo
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ this.fenceEdit = false
|
|
|
|
+ },
|
|
|
|
+ switchFenceType(e) {
|
|
|
|
+ if (e == 'circle') {
|
|
|
|
+ if (this.fence) {
|
|
|
|
+ this.fenceEditor.close()
|
|
|
|
+ this.map.remove(this.fence)
|
|
|
|
+ }
|
|
|
|
+ this.fenceBtn = '圆形'
|
|
|
|
+ this.fenceInfo.geofence_type = 0
|
|
|
|
+ let radius = 500
|
|
|
|
+ let lnglat = this.map.getCenter()
|
|
|
|
+ this.fence = new AMap.Circle({
|
|
|
|
+ center: lnglat,
|
|
|
|
+ radius: radius, //半径
|
|
|
|
+ borderWeight: 3,
|
|
|
|
+ fillOpacity: 0.4,
|
|
|
|
+ strokeStyle: 'dashed',
|
|
|
|
+ strokeDasharray: [10, 10],
|
|
|
|
+ // 线样式还支持 'dashed'
|
|
|
|
+ fillColor: '#1791fc',
|
|
|
|
+ zIndex: 50,
|
|
|
|
+ })
|
|
|
|
+ this.map.add(this.fence);
|
|
|
|
+ // 缩放地图到合适的视野级别
|
|
|
|
+ // this.map.setFitView([this.circle])
|
|
|
|
+ this.fenceEditor = new AMap.CircleEditor(this.map, this.fence)
|
|
|
|
+ this.fenceEditor.open()
|
|
|
|
+ this.fenceEditor.on('end', (e) => {
|
|
|
|
+ this.fenceInfo.radius = radius
|
|
|
|
+ this.fenceInfo.lnglat = lnglat
|
|
|
|
+ })
|
|
|
|
+ this.fenceEditor.on('adjust', (e) => {
|
|
|
|
+ radius = e.radius
|
|
|
|
+ })
|
|
|
|
+ this.fenceEditor.on('move', (e) => {
|
|
|
|
+ lnglat = e.lnglat
|
|
|
|
+ })
|
|
|
|
+ } else if (e == 'rect') {
|
|
|
|
+ if (this.fence) {
|
|
|
|
+ this.fenceEditor.close()
|
|
|
|
+ this.map.remove(this.fence)
|
|
|
|
+ }
|
|
|
|
+ this.fenceBtn = '矩形'
|
|
|
|
+ let center = this.map.getCenter()
|
|
|
|
+ var southWest = new AMap.LngLat(center.lng + 0.01, center.lat + 0.005)
|
|
|
|
+ var northEast = new AMap.LngLat(center.lng - 0.01, center.lat - 0.005)
|
|
|
|
+
|
|
|
|
+ var bounds = new AMap.Bounds(southWest, northEast)
|
|
|
|
+
|
|
|
|
+ this.fence = new AMap.Rectangle({
|
|
|
|
+ bounds: bounds,
|
|
|
|
+ fillColor: 'blue',
|
|
|
|
+ fillOpacity: 0.5,
|
|
|
|
+ cursor: 'pointer',
|
|
|
|
+ zIndex: 50,
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ this.map.add(this.fence);
|
|
|
|
+ // 缩放地图到合适的视野级别
|
|
|
|
+
|
|
|
|
+ this.fenceEditor = new AMap.RectangleEditor(this.map, this.fence)
|
|
|
|
+ this.fenceEditor.open()
|
|
|
|
+ } else if (e == 'polygon') {
|
|
|
|
+ if (this.fence) {
|
|
|
|
+ this.fenceEditor.close()
|
|
|
|
+ this.map.remove(this.fence)
|
|
|
|
+ }
|
|
|
|
+ this.fenceBtn = '多边形'
|
|
|
|
+ let center = this.map.getCenter()
|
|
|
|
+ let path = [
|
|
|
|
+ [center.lng - 0.01, center.lat + 0.005],
|
|
|
|
+ [center.lng + 0.01, center.lat + 0.005],
|
|
|
|
+ [center.lng + 0.01, center.lat - 0.005],
|
|
|
|
+ [center.lng - 0.01, center.lat - 0.005]
|
|
|
|
+ ]
|
|
|
|
+ this.fence = new AMap.Polygon({
|
|
|
|
+ path: path,
|
|
|
|
+ strokeColor: "#FF33FF",
|
|
|
|
+ strokeWeight: 6,
|
|
|
|
+ strokeOpacity: 0.2,
|
|
|
|
+ fillOpacity: 0.4,
|
|
|
|
+ fillColor: '#1791fc',
|
|
|
|
+ zIndex: 50,
|
|
|
|
+ bubble: true,
|
|
|
|
+ draggable: true,
|
|
|
|
+ })
|
|
|
|
+ this.map.add(this.fence);
|
|
|
|
+ this.fenceEditor = new AMap.PolygonEditor(this.map, this.fence);
|
|
|
|
+ this.fenceEditor.open();
|
|
|
|
+ this.fenceEditor.on('end', (e) => {
|
|
|
|
+ this.fenceInfo.path = e.target._opts.path
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ editAdd() {
|
|
|
|
+ this.fenceEdit = true
|
|
|
|
+ this.add_flag = true
|
|
|
|
+ if (this.fence == null) {
|
|
|
|
+ this.switchFenceType('circle')
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ editCancel() {
|
|
|
|
+ this.fenceEdit = false
|
|
|
|
+ this.map.remove(this.fence)
|
|
|
|
+ this.fence = null
|
|
|
|
+ this.fenceEditor = null
|
|
|
|
+ },
|
|
|
|
+ editUpdate() {
|
|
|
|
+ this.add_flag = false
|
|
|
|
+ this.fenceEdit = true
|
|
|
|
+ if (this.fence) {
|
|
|
|
+ if (this.fence._opts.radius) {
|
|
|
|
+ this.fenceEditor = new AMap.CircleEditor(this.map, this.fence)
|
|
|
|
+ let radius = this.fenceInfo.radius
|
|
|
|
+ let lnglat = this.fenceInfo.lnglat
|
|
|
|
+ this.fenceEditor.open()
|
|
|
|
+ this.fenceEditor.on('end', (e) => {
|
|
|
|
+ this.fenceInfo.radius = radius
|
|
|
|
+ this.fenceInfo.lnglat = lnglat
|
|
|
|
+ })
|
|
|
|
+ this.fenceEditor.on('adjust', (e) => {
|
|
|
|
+ radius = e.radius
|
|
|
|
+ })
|
|
|
|
+ this.fenceEditor.on('move', (e) => {
|
|
|
|
+ lnglat = e.lnglat
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ selectFence(e) {
|
|
|
|
+ this.fenceList.map(item => {
|
|
|
|
+ if (item.fenceName == e) {
|
|
|
|
+ if (this.fence) {
|
|
|
|
+ this.map.remove(this.fence)
|
|
|
|
+ }
|
|
|
|
+ if (item.type == 'circle') {
|
|
|
|
+ this.fence = new AMap.Circle({
|
|
|
|
+ center: item.lnglat,
|
|
|
|
+ radius: item.radius, //半径
|
|
|
|
+ borderWeight: 3,
|
|
|
|
+ fillOpacity: 0.4,
|
|
|
|
+ strokeStyle: 'dashed',
|
|
|
|
+ strokeDasharray: [10, 10],
|
|
|
|
+ // 线样式还支持 'dashed'
|
|
|
|
+ fillColor: '#1791fc',
|
|
|
|
+ zIndex: 50,
|
|
|
|
+ })
|
|
|
|
+ this.map.add(this.fence);
|
|
|
|
+ this.map.setCenter(item.lnglat)
|
|
|
|
+ this.map.setFitView([this.fence])
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
createMap() {
|
|
createMap() {
|
|
window._AMapSecurityConfig = {
|
|
window._AMapSecurityConfig = {
|
|
- securityJsCode: '6aaa52f268bd774edcc494a7055cf167'
|
|
|
|
|
|
+ securityJsCode: 'e91e92cbd76e89c48f3ff1d6180f288c'
|
|
}
|
|
}
|
|
AMapLoader.load({
|
|
AMapLoader.load({
|
|
- key: '533a73da5000e2db8d89b8fda02f33bf',
|
|
|
|
|
|
+ key: 'c968deab485d6e688e7c68689722ffb4',
|
|
version: '2.0'
|
|
version: '2.0'
|
|
}).then(AMap => {
|
|
}).then(AMap => {
|
|
this.map = new AMap.Map('map', {
|
|
this.map = new AMap.Map('map', {
|
|
- zoom: 13
|
|
|
|
- })
|
|
|
|
- this.map.plugin(['AMap.ToolBar', 'AMap.Scale'], () => {
|
|
|
|
- this.map.addControl(new AMap.ToolBar({
|
|
|
|
- position: 'RT'
|
|
|
|
- }))
|
|
|
|
- this.map.addControl(new AMap.Scale())
|
|
|
|
|
|
+ zoom: 15
|
|
})
|
|
})
|
|
|
|
+ this.map.plugin([
|
|
|
|
+ 'AMap.ToolBar',
|
|
|
|
+ 'AMap.Scale',
|
|
|
|
+ 'AMap.Geolocation',
|
|
|
|
+ 'AMap.CircleEditor',
|
|
|
|
+ 'AMap.RectangleEditor',
|
|
|
|
+ 'AMap.PolygonEditor'], () => {
|
|
|
|
+ this.map.addControl(new AMap.ToolBar({
|
|
|
|
+ position: 'RT'
|
|
|
|
+ }))
|
|
|
|
+ this.map.addControl(new AMap.Scale())
|
|
|
|
+ var geolocation = new AMap.Geolocation({
|
|
|
|
+ enableHighAccuracy: true, // 是否使用高精度定位,默认:true
|
|
|
|
+ timeout: 10000, // 设置定位超时时间,默认:无穷大
|
|
|
|
+ offset: [10, 20], // 定位按钮的停靠位置的偏移量
|
|
|
|
+ zoomToAccuracy: true, // 定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
|
|
|
|
+ position: 'RB' // 定位按钮的排放位置, RB表示右下
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ geolocation.getCurrentPosition((status, result) => {
|
|
|
|
+ if (status == 'complete') {
|
|
|
|
+ this.$modal.msgSuccess('定位成功')
|
|
|
|
+ this.map.setCenter([result.position.lng, result.position.lat])
|
|
|
|
+ } else {
|
|
|
|
+ this.$modal.msgError('获取定位失败')
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ })
|
|
})
|
|
})
|
|
},
|
|
},
|
|
getUserList() {
|
|
getUserList() {
|
|
@@ -1469,9 +1644,6 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- selectSetting(e) {
|
|
|
|
- this.settingPage = e
|
|
|
|
- },
|
|
|
|
openSetting(e, row) {
|
|
openSetting(e, row) {
|
|
this.echartsQuery.device_id_code = row.deviceId
|
|
this.echartsQuery.device_id_code = row.deviceId
|
|
this[e] = true
|
|
this[e] = true
|
|
@@ -1479,8 +1651,9 @@ export default {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
this.setEcharts(0)
|
|
this.setEcharts(0)
|
|
}, 100);
|
|
}, 100);
|
|
- } else if (e == 'fence') {
|
|
|
|
|
|
+ } else if (e == 'fenceOpen') {
|
|
this.createMap()
|
|
this.createMap()
|
|
|
|
+ this.setUser = row
|
|
} else if (e == 'deviceLog') {
|
|
} else if (e == 'deviceLog') {
|
|
this.getDeviceLog()
|
|
this.getDeviceLog()
|
|
} else if (e == 'settingOpen') {
|
|
} else if (e == 'settingOpen') {
|