|
@@ -731,13 +731,13 @@ export default {
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
factory: [
|
|
|
- {required: true, message: '请选择厂商', trigger: 'change'}
|
|
|
+ { required: true, message: '请选择厂商', trigger: 'change' }
|
|
|
],
|
|
|
deviceModel: [
|
|
|
- {required: true, message: '请选择设备型号', trigger: 'change'}
|
|
|
+ { required: true, message: '请选择设备型号', trigger: 'change' }
|
|
|
],
|
|
|
grantType: [
|
|
|
- {required: true, message: '请选择发放方式', trigger: 'change'}
|
|
|
+ { required: true, message: '请选择发放方式', trigger: 'change' }
|
|
|
]
|
|
|
},
|
|
|
menuInfo: [],
|
|
@@ -891,19 +891,19 @@ export default {
|
|
|
obj.command = 'keybrd'
|
|
|
obj.param = { is_open: 0 }
|
|
|
await axios({
|
|
|
- method: 'POST',
|
|
|
- url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
|
|
|
- headers: {
|
|
|
- Authorization: getToken(),
|
|
|
- },
|
|
|
- data: obj,
|
|
|
- }).then(res => {
|
|
|
- if (res.data && res.data.code == 200) {
|
|
|
- success += 1
|
|
|
- } else {
|
|
|
- this.$modal.msgError(`${item.name}设置失败`)
|
|
|
- }
|
|
|
- })
|
|
|
+ method: 'POST',
|
|
|
+ url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
|
|
|
+ headers: {
|
|
|
+ Authorization: getToken(),
|
|
|
+ },
|
|
|
+ data: obj,
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data && res.data.code == 200) {
|
|
|
+ success += 1
|
|
|
+ } else {
|
|
|
+ this.$modal.msgError(`${item.name}设置失败`)
|
|
|
+ }
|
|
|
+ })
|
|
|
}))
|
|
|
if (success == this.items.length) {
|
|
|
this.$modal.msgSuccess('关闭成功')
|
|
@@ -920,22 +920,22 @@ export default {
|
|
|
obj.command = 'keybrd'
|
|
|
obj.param = { is_open: 1 }
|
|
|
await axios({
|
|
|
- method: 'POST',
|
|
|
- url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
|
|
|
- headers: {
|
|
|
- Authorization: getToken(),
|
|
|
- },
|
|
|
- data: obj,
|
|
|
- }).then(res => {
|
|
|
- if (res.data && res.data.code == 200) {
|
|
|
- success += 1
|
|
|
- } else {
|
|
|
- this.$modal.msgError(`${item.name}设置失败`)
|
|
|
- }
|
|
|
- })
|
|
|
+ method: 'POST',
|
|
|
+ url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
|
|
|
+ headers: {
|
|
|
+ Authorization: getToken(),
|
|
|
+ },
|
|
|
+ data: obj,
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data && res.data.code == 200) {
|
|
|
+ success += 1
|
|
|
+ } else {
|
|
|
+ this.$modal.msgError(`${item.name}设置失败`)
|
|
|
+ }
|
|
|
+ })
|
|
|
}))
|
|
|
if (success == this.items.length) {
|
|
|
- this.$modal.msgSuccess('关闭成功')
|
|
|
+ this.$modal.msgSuccess('打开成功')
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -1181,7 +1181,8 @@ export default {
|
|
|
this.$modal.closeLoading()
|
|
|
this.$refs.fileUpload.handleRemove(file);
|
|
|
} else {
|
|
|
- this.modal.msgSuccess("导入成功");
|
|
|
+ this.$modal.msgSuccess("导入成功");
|
|
|
+ this.$modal.closeLoading()
|
|
|
this.openToUpload = false
|
|
|
this.resetQuery()
|
|
|
}
|
|
@@ -1478,8 +1479,8 @@ export default {
|
|
|
// 切换围栏按钮
|
|
|
switchFenceType(e) {
|
|
|
if (this.fence) {
|
|
|
- this.map.remove(this.fence)
|
|
|
- this.fence = null
|
|
|
+ this.map.remove(this.fence)
|
|
|
+ this.fence = null
|
|
|
}
|
|
|
if (this.fenceEditor) {
|
|
|
this.fenceEditor.close()
|
|
@@ -1759,28 +1760,37 @@ export default {
|
|
|
'AMap.Geolocation',
|
|
|
'AMap.CircleEditor',
|
|
|
'AMap.RectangleEditor',
|
|
|
- 'AMap.PolygonEditor'], () => {
|
|
|
+ 'AMap.PolygonEditor',
|
|
|
+ 'AMap.CitySearch'], () => {
|
|
|
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表示右下
|
|
|
- })
|
|
|
+ // 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('获取定位失败')
|
|
|
+ // geolocation.getCurrentPosition((status, result) => {
|
|
|
+ // if (status == 'complete') {
|
|
|
+ // this.$modal.msgSuccess('定位成功')
|
|
|
+ // this.map.setCenter([result.position.lng, result.position.lat])
|
|
|
+ // } else {
|
|
|
+ // this.$modal.msgError('获取定位失败')
|
|
|
+ // }
|
|
|
+ // this.getFence()
|
|
|
+ // });
|
|
|
+ let citySearch = new AMap.CitySearch()
|
|
|
+ citySearch.getLocalCity((status, result) => {
|
|
|
+ if (status === 'complete' && result.info === 'OK') {
|
|
|
+ console.log(result);
|
|
|
+ let bounds = result.bounds;
|
|
|
+ this.map.setBounds(bounds);
|
|
|
}
|
|
|
- this.getFence()
|
|
|
- });
|
|
|
+ })
|
|
|
})
|
|
|
})
|
|
|
},
|
|
@@ -1800,7 +1810,7 @@ export default {
|
|
|
this.loading = true;
|
|
|
listProfile(this.userForm).then(response => {
|
|
|
response.rows.map(item => {
|
|
|
- item.sex = item.gender == 0 ? '男':item.gender == 1?'女': ''
|
|
|
+ item.sex = item.gender == 0 ? '男' : item.gender == 1 ? '女' : ''
|
|
|
})
|
|
|
this.userList = response.rows;
|
|
|
this.userTotal = response.total;
|
|
@@ -1945,6 +1955,7 @@ export default {
|
|
|
this.deviceList = response.rows;
|
|
|
this.deviceList.map(item => {
|
|
|
if (item.deviceModel || item.deviceModel == 0) {
|
|
|
+ console.log(item.deviceModel);
|
|
|
item.deviceType = this.deviceModel[item.deviceModel].dictLabel
|
|
|
}
|
|
|
if (item.grantType || item.grantType == 0) {
|