diff --git a/README.md b/README.md index a93bd30..ae90135 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,19 @@ -# 智能闸井监测管理系统前端 +# 管网运行监测系统 -> 智能闸井监测管理系统WEB前端,系统管理模块基于基础权限管理的基础框架 ,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 +> 管网运行监测系统WEB前端,系统管理模块基于基础权限管理的基础框架,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 -本项目源于vue-element-admin,一个极简的 vue admin 管理后台V4.4.0版本。 +本项目源于vue-element-admin。 -[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) ## 安装前提 1. 安装nodejs -去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包 +去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包, 建议版本不要超过14 安装完成之后,在cmd中检查Node.js版本,输出版本号则表示安装成功 @@ -56,11 +54,11 @@ ## 浏览器支持情况 -主流浏览器和IE 10+. +主流浏览器和IE 11. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| --------- | --------- | --------- | --------- | -| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions +| IE | Edge | Firefox |Chrome | Safari | +|--------------| --------- | --------- | --------- |------| +| IE11(部分特性不支持) | 90+ | 80+ | 90+ |14+| ## License diff --git a/README.md b/README.md index a93bd30..ae90135 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,19 @@ -# 智能闸井监测管理系统前端 +# 管网运行监测系统 -> 智能闸井监测管理系统WEB前端,系统管理模块基于基础权限管理的基础框架 ,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 +> 管网运行监测系统WEB前端,系统管理模块基于基础权限管理的基础框架,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 -本项目源于vue-element-admin,一个极简的 vue admin 管理后台V4.4.0版本。 +本项目源于vue-element-admin。 -[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) ## 安装前提 1. 安装nodejs -去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包 +去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包, 建议版本不要超过14 安装完成之后,在cmd中检查Node.js版本,输出版本号则表示安装成功 @@ -56,11 +54,11 @@ ## 浏览器支持情况 -主流浏览器和IE 10+. +主流浏览器和IE 11. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| --------- | --------- | --------- | --------- | -| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions +| IE | Edge | Firefox |Chrome | Safari | +|--------------| --------- | --------- | --------- |------| +| IE11(部分特性不支持) | 90+ | 80+ | 90+ |14+| ## License diff --git a/public/config/project.config.json b/public/config/project.config.json index f986319..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -4,6 +4,9 @@ "theme":"blue", "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", + "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", + "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", + "mapType": "gaode", "singleSys": true, "refreshType":"websocket", "showPointType":"massMarkers", diff --git a/README.md b/README.md index a93bd30..ae90135 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,19 @@ -# 智能闸井监测管理系统前端 +# 管网运行监测系统 -> 智能闸井监测管理系统WEB前端,系统管理模块基于基础权限管理的基础框架 ,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 +> 管网运行监测系统WEB前端,系统管理模块基于基础权限管理的基础框架,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 -本项目源于vue-element-admin,一个极简的 vue admin 管理后台V4.4.0版本。 +本项目源于vue-element-admin。 -[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) ## 安装前提 1. 安装nodejs -去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包 +去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包, 建议版本不要超过14 安装完成之后,在cmd中检查Node.js版本,输出版本号则表示安装成功 @@ -56,11 +54,11 @@ ## 浏览器支持情况 -主流浏览器和IE 10+. +主流浏览器和IE 11. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| --------- | --------- | --------- | --------- | -| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions +| IE | Edge | Firefox |Chrome | Safari | +|--------------| --------- | --------- | --------- |------| +| IE11(部分特性不支持) | 90+ | 80+ | 90+ |14+| ## License diff --git a/public/config/project.config.json b/public/config/project.config.json index f986319..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -4,6 +4,9 @@ "theme":"blue", "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", + "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", + "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", + "mapType": "gaode", "singleSys": true, "refreshType":"websocket", "showPointType":"massMarkers", diff --git a/src/api/base/tenant.js b/src/api/base/tenant.js deleted file mode 100644 index 9ad9f31..0000000 --- a/src/api/base/tenant.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 租户/项目列表 - */ -import request from '@/utils/request' - -// 项目列表查询 -export function getTenantList(params) { - return request({ - url: 'tenant/list', - method: 'get', - params - }) -} diff --git a/README.md b/README.md index a93bd30..ae90135 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,19 @@ -# 智能闸井监测管理系统前端 +# 管网运行监测系统 -> 智能闸井监测管理系统WEB前端,系统管理模块基于基础权限管理的基础框架 ,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 +> 管网运行监测系统WEB前端,系统管理模块基于基础权限管理的基础框架,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 -本项目源于vue-element-admin,一个极简的 vue admin 管理后台V4.4.0版本。 +本项目源于vue-element-admin。 -[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) ## 安装前提 1. 安装nodejs -去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包 +去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包, 建议版本不要超过14 安装完成之后,在cmd中检查Node.js版本,输出版本号则表示安装成功 @@ -56,11 +54,11 @@ ## 浏览器支持情况 -主流浏览器和IE 10+. +主流浏览器和IE 11. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| --------- | --------- | --------- | --------- | -| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions +| IE | Edge | Firefox |Chrome | Safari | +|--------------| --------- | --------- | --------- |------| +| IE11(部分特性不支持) | 90+ | 80+ | 90+ |14+| ## License diff --git a/public/config/project.config.json b/public/config/project.config.json index f986319..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -4,6 +4,9 @@ "theme":"blue", "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", + "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", + "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", + "mapType": "gaode", "singleSys": true, "refreshType":"websocket", "showPointType":"massMarkers", diff --git a/src/api/base/tenant.js b/src/api/base/tenant.js deleted file mode 100644 index 9ad9f31..0000000 --- a/src/api/base/tenant.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 租户/项目列表 - */ -import request from '@/utils/request' - -// 项目列表查询 -export function getTenantList(params) { - return request({ - url: 'tenant/list', - method: 'get', - params - }) -} diff --git a/src/api/data/dataStatics.js b/src/api/data/dataStatics.js index b9ccd3d..e79dea3 100644 --- a/src/api/data/dataStatics.js +++ b/src/api/data/dataStatics.js @@ -49,7 +49,7 @@ // 离线设备数量 export function deviceStaticsByOnline(params) { return request({ - url: 'statics/deviceCountByOnlineStatus', + url: 'statics/deviceStaticsByStatus', method: 'get', params }) diff --git a/README.md b/README.md index a93bd30..ae90135 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,19 @@ -# 智能闸井监测管理系统前端 +# 管网运行监测系统 -> 智能闸井监测管理系统WEB前端,系统管理模块基于基础权限管理的基础框架 ,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 +> 管网运行监测系统WEB前端,系统管理模块基于基础权限管理的基础框架,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 -本项目源于vue-element-admin,一个极简的 vue admin 管理后台V4.4.0版本。 +本项目源于vue-element-admin。 -[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) ## 安装前提 1. 安装nodejs -去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包 +去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包, 建议版本不要超过14 安装完成之后,在cmd中检查Node.js版本,输出版本号则表示安装成功 @@ -56,11 +54,11 @@ ## 浏览器支持情况 -主流浏览器和IE 10+. +主流浏览器和IE 11. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| --------- | --------- | --------- | --------- | -| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions +| IE | Edge | Firefox |Chrome | Safari | +|--------------| --------- | --------- | --------- |------| +| IE11(部分特性不支持) | 90+ | 80+ | 90+ |14+| ## License diff --git a/public/config/project.config.json b/public/config/project.config.json index f986319..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -4,6 +4,9 @@ "theme":"blue", "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", + "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", + "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", + "mapType": "gaode", "singleSys": true, "refreshType":"websocket", "showPointType":"massMarkers", diff --git a/src/api/base/tenant.js b/src/api/base/tenant.js deleted file mode 100644 index 9ad9f31..0000000 --- a/src/api/base/tenant.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 租户/项目列表 - */ -import request from '@/utils/request' - -// 项目列表查询 -export function getTenantList(params) { - return request({ - url: 'tenant/list', - method: 'get', - params - }) -} diff --git a/src/api/data/dataStatics.js b/src/api/data/dataStatics.js index b9ccd3d..e79dea3 100644 --- a/src/api/data/dataStatics.js +++ b/src/api/data/dataStatics.js @@ -49,7 +49,7 @@ // 离线设备数量 export function deviceStaticsByOnline(params) { return request({ - url: 'statics/deviceCountByOnlineStatus', + url: 'statics/deviceStaticsByStatus', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 7274ede..bee92d0 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -4,7 +4,7 @@ import request from '@/utils/request' import qs from 'qs' -// 设备类别 +// 设备类别, 不分页全部 export function getDevice(params) { return request({ url: 'device/type', diff --git a/README.md b/README.md index a93bd30..ae90135 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,19 @@ -# 智能闸井监测管理系统前端 +# 管网运行监测系统 -> 智能闸井监测管理系统WEB前端,系统管理模块基于基础权限管理的基础框架 ,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 +> 管网运行监测系统WEB前端,系统管理模块基于基础权限管理的基础框架,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 -本项目源于vue-element-admin,一个极简的 vue admin 管理后台V4.4.0版本。 +本项目源于vue-element-admin。 -[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) ## 安装前提 1. 安装nodejs -去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包 +去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包, 建议版本不要超过14 安装完成之后,在cmd中检查Node.js版本,输出版本号则表示安装成功 @@ -56,11 +54,11 @@ ## 浏览器支持情况 -主流浏览器和IE 10+. +主流浏览器和IE 11. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| --------- | --------- | --------- | --------- | -| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions +| IE | Edge | Firefox |Chrome | Safari | +|--------------| --------- | --------- | --------- |------| +| IE11(部分特性不支持) | 90+ | 80+ | 90+ |14+| ## License diff --git a/public/config/project.config.json b/public/config/project.config.json index f986319..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -4,6 +4,9 @@ "theme":"blue", "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", + "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", + "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", + "mapType": "gaode", "singleSys": true, "refreshType":"websocket", "showPointType":"massMarkers", diff --git a/src/api/base/tenant.js b/src/api/base/tenant.js deleted file mode 100644 index 9ad9f31..0000000 --- a/src/api/base/tenant.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 租户/项目列表 - */ -import request from '@/utils/request' - -// 项目列表查询 -export function getTenantList(params) { - return request({ - url: 'tenant/list', - method: 'get', - params - }) -} diff --git a/src/api/data/dataStatics.js b/src/api/data/dataStatics.js index b9ccd3d..e79dea3 100644 --- a/src/api/data/dataStatics.js +++ b/src/api/data/dataStatics.js @@ -49,7 +49,7 @@ // 离线设备数量 export function deviceStaticsByOnline(params) { return request({ - url: 'statics/deviceCountByOnlineStatus', + url: 'statics/deviceStaticsByStatus', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 7274ede..bee92d0 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -4,7 +4,7 @@ import request from '@/utils/request' import qs from 'qs' -// 设备类别 +// 设备类别, 不分页全部 export function getDevice(params) { return request({ url: 'device/type', diff --git a/src/api/system/dict.js b/src/api/system/dict.js index 689b6b1..c2e7978 100644 --- a/src/api/system/dict.js +++ b/src/api/system/dict.js @@ -10,7 +10,14 @@ params }) } - +// 报警类型 +export function alarmType(params) { + return request({ + url: '/sys/dict/code/alarmType', + method: 'get', + params + }) +} // 添加字典 export function addDict(data) { return request({ diff --git a/README.md b/README.md index a93bd30..ae90135 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,19 @@ -# 智能闸井监测管理系统前端 +# 管网运行监测系统 -> 智能闸井监测管理系统WEB前端,系统管理模块基于基础权限管理的基础框架 ,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 +> 管网运行监测系统WEB前端,系统管理模块基于基础权限管理的基础框架,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 -本项目源于vue-element-admin,一个极简的 vue admin 管理后台V4.4.0版本。 +本项目源于vue-element-admin。 -[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) ## 安装前提 1. 安装nodejs -去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包 +去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包, 建议版本不要超过14 安装完成之后,在cmd中检查Node.js版本,输出版本号则表示安装成功 @@ -56,11 +54,11 @@ ## 浏览器支持情况 -主流浏览器和IE 10+. +主流浏览器和IE 11. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| --------- | --------- | --------- | --------- | -| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions +| IE | Edge | Firefox |Chrome | Safari | +|--------------| --------- | --------- | --------- |------| +| IE11(部分特性不支持) | 90+ | 80+ | 90+ |14+| ## License diff --git a/public/config/project.config.json b/public/config/project.config.json index f986319..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -4,6 +4,9 @@ "theme":"blue", "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", + "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", + "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", + "mapType": "gaode", "singleSys": true, "refreshType":"websocket", "showPointType":"massMarkers", diff --git a/src/api/base/tenant.js b/src/api/base/tenant.js deleted file mode 100644 index 9ad9f31..0000000 --- a/src/api/base/tenant.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 租户/项目列表 - */ -import request from '@/utils/request' - -// 项目列表查询 -export function getTenantList(params) { - return request({ - url: 'tenant/list', - method: 'get', - params - }) -} diff --git a/src/api/data/dataStatics.js b/src/api/data/dataStatics.js index b9ccd3d..e79dea3 100644 --- a/src/api/data/dataStatics.js +++ b/src/api/data/dataStatics.js @@ -49,7 +49,7 @@ // 离线设备数量 export function deviceStaticsByOnline(params) { return request({ - url: 'statics/deviceCountByOnlineStatus', + url: 'statics/deviceStaticsByStatus', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 7274ede..bee92d0 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -4,7 +4,7 @@ import request from '@/utils/request' import qs from 'qs' -// 设备类别 +// 设备类别, 不分页全部 export function getDevice(params) { return request({ url: 'device/type', diff --git a/src/api/system/dict.js b/src/api/system/dict.js index 689b6b1..c2e7978 100644 --- a/src/api/system/dict.js +++ b/src/api/system/dict.js @@ -10,7 +10,14 @@ params }) } - +// 报警类型 +export function alarmType(params) { + return request({ + url: '/sys/dict/code/alarmType', + method: 'get', + params + }) +} // 添加字典 export function addDict(data) { return request({ diff --git a/src/api/system/tenant.js b/src/api/system/tenant.js index 4bf3350..863476c 100644 --- a/src/api/system/tenant.js +++ b/src/api/system/tenant.js @@ -1,28 +1,11 @@ /* - * 项目管理配置接口 + * 项目管理接口 */ import request from '@/utils/request' import qs from 'qs' -// 设备类别 -export function getDevice(params) { - return request({ - url: 'device/type', - method: 'get', - params - }) -} -// 项目管理绑定组织 -export function deptTenantSys(params) { - return request({ - url: 'bus/tenant/relateTenant', - method: 'post', - params - }) -} - // 项目管理查询 -export function tenantSysList(params) { +export function getTenantList(params) { return request({ url: 'bus/tenant/list', method: 'get', @@ -31,21 +14,31 @@ } // 添加项目管理 -export function addTenantSys(params) { +export function addTenant(data) { return request({ url: 'sys/tenant/add', method: 'post', - params + data }) } // 修改项目管理 -export function updateTenantSys(params) { +export function updateTenant(data) { return request({ url: 'sys/tenant/update', method: 'post', - params + data }) } + +// 修改项目管理 +export function relatedDept(data) { + return request({ + url: 'bus/tenant/relateTenant', + method: 'post', + data + }) +} + // 删除项目管理 export function delTenantSys(ids) { return request({ diff --git a/README.md b/README.md index a93bd30..ae90135 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,19 @@ -# 智能闸井监测管理系统前端 +# 管网运行监测系统 -> 智能闸井监测管理系统WEB前端,系统管理模块基于基础权限管理的基础框架 ,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 +> 管网运行监测系统WEB前端,系统管理模块基于基础权限管理的基础框架,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 -本项目源于vue-element-admin,一个极简的 vue admin 管理后台V4.4.0版本。 +本项目源于vue-element-admin。 -[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) ## 安装前提 1. 安装nodejs -去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包 +去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包, 建议版本不要超过14 安装完成之后,在cmd中检查Node.js版本,输出版本号则表示安装成功 @@ -56,11 +54,11 @@ ## 浏览器支持情况 -主流浏览器和IE 10+. +主流浏览器和IE 11. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| --------- | --------- | --------- | --------- | -| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions +| IE | Edge | Firefox |Chrome | Safari | +|--------------| --------- | --------- | --------- |------| +| IE11(部分特性不支持) | 90+ | 80+ | 90+ |14+| ## License diff --git a/public/config/project.config.json b/public/config/project.config.json index f986319..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -4,6 +4,9 @@ "theme":"blue", "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", + "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", + "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", + "mapType": "gaode", "singleSys": true, "refreshType":"websocket", "showPointType":"massMarkers", diff --git a/src/api/base/tenant.js b/src/api/base/tenant.js deleted file mode 100644 index 9ad9f31..0000000 --- a/src/api/base/tenant.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 租户/项目列表 - */ -import request from '@/utils/request' - -// 项目列表查询 -export function getTenantList(params) { - return request({ - url: 'tenant/list', - method: 'get', - params - }) -} diff --git a/src/api/data/dataStatics.js b/src/api/data/dataStatics.js index b9ccd3d..e79dea3 100644 --- a/src/api/data/dataStatics.js +++ b/src/api/data/dataStatics.js @@ -49,7 +49,7 @@ // 离线设备数量 export function deviceStaticsByOnline(params) { return request({ - url: 'statics/deviceCountByOnlineStatus', + url: 'statics/deviceStaticsByStatus', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 7274ede..bee92d0 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -4,7 +4,7 @@ import request from '@/utils/request' import qs from 'qs' -// 设备类别 +// 设备类别, 不分页全部 export function getDevice(params) { return request({ url: 'device/type', diff --git a/src/api/system/dict.js b/src/api/system/dict.js index 689b6b1..c2e7978 100644 --- a/src/api/system/dict.js +++ b/src/api/system/dict.js @@ -10,7 +10,14 @@ params }) } - +// 报警类型 +export function alarmType(params) { + return request({ + url: '/sys/dict/code/alarmType', + method: 'get', + params + }) +} // 添加字典 export function addDict(data) { return request({ diff --git a/src/api/system/tenant.js b/src/api/system/tenant.js index 4bf3350..863476c 100644 --- a/src/api/system/tenant.js +++ b/src/api/system/tenant.js @@ -1,28 +1,11 @@ /* - * 项目管理配置接口 + * 项目管理接口 */ import request from '@/utils/request' import qs from 'qs' -// 设备类别 -export function getDevice(params) { - return request({ - url: 'device/type', - method: 'get', - params - }) -} -// 项目管理绑定组织 -export function deptTenantSys(params) { - return request({ - url: 'bus/tenant/relateTenant', - method: 'post', - params - }) -} - // 项目管理查询 -export function tenantSysList(params) { +export function getTenantList(params) { return request({ url: 'bus/tenant/list', method: 'get', @@ -31,21 +14,31 @@ } // 添加项目管理 -export function addTenantSys(params) { +export function addTenant(data) { return request({ url: 'sys/tenant/add', method: 'post', - params + data }) } // 修改项目管理 -export function updateTenantSys(params) { +export function updateTenant(data) { return request({ url: 'sys/tenant/update', method: 'post', - params + data }) } + +// 修改项目管理 +export function relatedDept(data) { + return request({ + url: 'bus/tenant/relateTenant', + method: 'post', + data + }) +} + // 删除项目管理 export function delTenantSys(ids) { return request({ diff --git a/src/api/systemConfig/alarmContent.js b/src/api/systemConfig/alarmContent.js index bdefe72..486c3ce 100644 --- a/src/api/systemConfig/alarmContent.js +++ b/src/api/systemConfig/alarmContent.js @@ -22,31 +22,25 @@ } // 添加告警内容 -export function addAlarmContent(params) { +export function addAlarmContent(data) { return request({ - url: 'device/simManage/add', + url: 'alarmContent/add', method: 'post', - params + data }) } // 修改告警内容 export function updateAlarmContent(params) { return request({ - url: 'device/simManage/update', + url: 'alarmContent/update', method: 'post', params }) } // 删除告警内容 -export function delAlarmContent(ids) { +export function delAlarmContent(id) { return request({ - url: 'device/simManage/delete', - method: 'post', - params: { - ids: ids - }, - paramsSerializer: params => { - return qs.stringify(params, { indices: false }) - } + url: 'alarmContent/delete/' + id, + method: 'post' }) } diff --git a/README.md b/README.md index a93bd30..ae90135 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,19 @@ -# 智能闸井监测管理系统前端 +# 管网运行监测系统 -> 智能闸井监测管理系统WEB前端,系统管理模块基于基础权限管理的基础框架 ,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 +> 管网运行监测系统WEB前端,系统管理模块基于基础权限管理的基础框架,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 -本项目源于vue-element-admin,一个极简的 vue admin 管理后台V4.4.0版本。 +本项目源于vue-element-admin。 -[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) ## 安装前提 1. 安装nodejs -去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包 +去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包, 建议版本不要超过14 安装完成之后,在cmd中检查Node.js版本,输出版本号则表示安装成功 @@ -56,11 +54,11 @@ ## 浏览器支持情况 -主流浏览器和IE 10+. +主流浏览器和IE 11. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| --------- | --------- | --------- | --------- | -| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions +| IE | Edge | Firefox |Chrome | Safari | +|--------------| --------- | --------- | --------- |------| +| IE11(部分特性不支持) | 90+ | 80+ | 90+ |14+| ## License diff --git a/public/config/project.config.json b/public/config/project.config.json index f986319..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -4,6 +4,9 @@ "theme":"blue", "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", + "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", + "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", + "mapType": "gaode", "singleSys": true, "refreshType":"websocket", "showPointType":"massMarkers", diff --git a/src/api/base/tenant.js b/src/api/base/tenant.js deleted file mode 100644 index 9ad9f31..0000000 --- a/src/api/base/tenant.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 租户/项目列表 - */ -import request from '@/utils/request' - -// 项目列表查询 -export function getTenantList(params) { - return request({ - url: 'tenant/list', - method: 'get', - params - }) -} diff --git a/src/api/data/dataStatics.js b/src/api/data/dataStatics.js index b9ccd3d..e79dea3 100644 --- a/src/api/data/dataStatics.js +++ b/src/api/data/dataStatics.js @@ -49,7 +49,7 @@ // 离线设备数量 export function deviceStaticsByOnline(params) { return request({ - url: 'statics/deviceCountByOnlineStatus', + url: 'statics/deviceStaticsByStatus', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 7274ede..bee92d0 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -4,7 +4,7 @@ import request from '@/utils/request' import qs from 'qs' -// 设备类别 +// 设备类别, 不分页全部 export function getDevice(params) { return request({ url: 'device/type', diff --git a/src/api/system/dict.js b/src/api/system/dict.js index 689b6b1..c2e7978 100644 --- a/src/api/system/dict.js +++ b/src/api/system/dict.js @@ -10,7 +10,14 @@ params }) } - +// 报警类型 +export function alarmType(params) { + return request({ + url: '/sys/dict/code/alarmType', + method: 'get', + params + }) +} // 添加字典 export function addDict(data) { return request({ diff --git a/src/api/system/tenant.js b/src/api/system/tenant.js index 4bf3350..863476c 100644 --- a/src/api/system/tenant.js +++ b/src/api/system/tenant.js @@ -1,28 +1,11 @@ /* - * 项目管理配置接口 + * 项目管理接口 */ import request from '@/utils/request' import qs from 'qs' -// 设备类别 -export function getDevice(params) { - return request({ - url: 'device/type', - method: 'get', - params - }) -} -// 项目管理绑定组织 -export function deptTenantSys(params) { - return request({ - url: 'bus/tenant/relateTenant', - method: 'post', - params - }) -} - // 项目管理查询 -export function tenantSysList(params) { +export function getTenantList(params) { return request({ url: 'bus/tenant/list', method: 'get', @@ -31,21 +14,31 @@ } // 添加项目管理 -export function addTenantSys(params) { +export function addTenant(data) { return request({ url: 'sys/tenant/add', method: 'post', - params + data }) } // 修改项目管理 -export function updateTenantSys(params) { +export function updateTenant(data) { return request({ url: 'sys/tenant/update', method: 'post', - params + data }) } + +// 修改项目管理 +export function relatedDept(data) { + return request({ + url: 'bus/tenant/relateTenant', + method: 'post', + data + }) +} + // 删除项目管理 export function delTenantSys(ids) { return request({ diff --git a/src/api/systemConfig/alarmContent.js b/src/api/systemConfig/alarmContent.js index bdefe72..486c3ce 100644 --- a/src/api/systemConfig/alarmContent.js +++ b/src/api/systemConfig/alarmContent.js @@ -22,31 +22,25 @@ } // 添加告警内容 -export function addAlarmContent(params) { +export function addAlarmContent(data) { return request({ - url: 'device/simManage/add', + url: 'alarmContent/add', method: 'post', - params + data }) } // 修改告警内容 export function updateAlarmContent(params) { return request({ - url: 'device/simManage/update', + url: 'alarmContent/update', method: 'post', params }) } // 删除告警内容 -export function delAlarmContent(ids) { +export function delAlarmContent(id) { return request({ - url: 'device/simManage/delete', - method: 'post', - params: { - ids: ids - }, - paramsSerializer: params => { - return qs.stringify(params, { indices: false }) - } + url: 'alarmContent/delete/' + id, + method: 'post' }) } diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..5b5057e 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -75,9 +75,11 @@ methods: { initMap() { const { vid, zoom, zooms, center, viewMode, mapStyle } = this - // 安全码 - window._AMapSecurityConfig = { - securityJsCode: this.$store.getters.amapSecurityCode + if (!window._AMapSecurityConfig) { + // 安全码 + window._AMapSecurityConfig = { + securityJsCode: this.$store.getters.amapSecurityCode + } } AMapLoader.load({ key: this.$store.getters.amapKey, // 秘钥,从store中取 @@ -91,7 +93,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +112,7 @@ component.$emit('ready', this.map) }) }).catch(e => { - this.$message.error('地图加载失败') + this.$message.error('地图加载失败:'+e) }) }, changeBaseLayer() { diff --git a/README.md b/README.md index a93bd30..ae90135 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,19 @@ -# 智能闸井监测管理系统前端 +# 管网运行监测系统 -> 智能闸井监测管理系统WEB前端,系统管理模块基于基础权限管理的基础框架 ,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 +> 管网运行监测系统WEB前端,系统管理模块基于基础权限管理的基础框架,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 -本项目源于vue-element-admin,一个极简的 vue admin 管理后台V4.4.0版本。 +本项目源于vue-element-admin。 -[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) ## 安装前提 1. 安装nodejs -去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包 +去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包, 建议版本不要超过14 安装完成之后,在cmd中检查Node.js版本,输出版本号则表示安装成功 @@ -56,11 +54,11 @@ ## 浏览器支持情况 -主流浏览器和IE 10+. +主流浏览器和IE 11. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| --------- | --------- | --------- | --------- | -| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions +| IE | Edge | Firefox |Chrome | Safari | +|--------------| --------- | --------- | --------- |------| +| IE11(部分特性不支持) | 90+ | 80+ | 90+ |14+| ## License diff --git a/public/config/project.config.json b/public/config/project.config.json index f986319..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -4,6 +4,9 @@ "theme":"blue", "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", + "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", + "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", + "mapType": "gaode", "singleSys": true, "refreshType":"websocket", "showPointType":"massMarkers", diff --git a/src/api/base/tenant.js b/src/api/base/tenant.js deleted file mode 100644 index 9ad9f31..0000000 --- a/src/api/base/tenant.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 租户/项目列表 - */ -import request from '@/utils/request' - -// 项目列表查询 -export function getTenantList(params) { - return request({ - url: 'tenant/list', - method: 'get', - params - }) -} diff --git a/src/api/data/dataStatics.js b/src/api/data/dataStatics.js index b9ccd3d..e79dea3 100644 --- a/src/api/data/dataStatics.js +++ b/src/api/data/dataStatics.js @@ -49,7 +49,7 @@ // 离线设备数量 export function deviceStaticsByOnline(params) { return request({ - url: 'statics/deviceCountByOnlineStatus', + url: 'statics/deviceStaticsByStatus', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 7274ede..bee92d0 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -4,7 +4,7 @@ import request from '@/utils/request' import qs from 'qs' -// 设备类别 +// 设备类别, 不分页全部 export function getDevice(params) { return request({ url: 'device/type', diff --git a/src/api/system/dict.js b/src/api/system/dict.js index 689b6b1..c2e7978 100644 --- a/src/api/system/dict.js +++ b/src/api/system/dict.js @@ -10,7 +10,14 @@ params }) } - +// 报警类型 +export function alarmType(params) { + return request({ + url: '/sys/dict/code/alarmType', + method: 'get', + params + }) +} // 添加字典 export function addDict(data) { return request({ diff --git a/src/api/system/tenant.js b/src/api/system/tenant.js index 4bf3350..863476c 100644 --- a/src/api/system/tenant.js +++ b/src/api/system/tenant.js @@ -1,28 +1,11 @@ /* - * 项目管理配置接口 + * 项目管理接口 */ import request from '@/utils/request' import qs from 'qs' -// 设备类别 -export function getDevice(params) { - return request({ - url: 'device/type', - method: 'get', - params - }) -} -// 项目管理绑定组织 -export function deptTenantSys(params) { - return request({ - url: 'bus/tenant/relateTenant', - method: 'post', - params - }) -} - // 项目管理查询 -export function tenantSysList(params) { +export function getTenantList(params) { return request({ url: 'bus/tenant/list', method: 'get', @@ -31,21 +14,31 @@ } // 添加项目管理 -export function addTenantSys(params) { +export function addTenant(data) { return request({ url: 'sys/tenant/add', method: 'post', - params + data }) } // 修改项目管理 -export function updateTenantSys(params) { +export function updateTenant(data) { return request({ url: 'sys/tenant/update', method: 'post', - params + data }) } + +// 修改项目管理 +export function relatedDept(data) { + return request({ + url: 'bus/tenant/relateTenant', + method: 'post', + data + }) +} + // 删除项目管理 export function delTenantSys(ids) { return request({ diff --git a/src/api/systemConfig/alarmContent.js b/src/api/systemConfig/alarmContent.js index bdefe72..486c3ce 100644 --- a/src/api/systemConfig/alarmContent.js +++ b/src/api/systemConfig/alarmContent.js @@ -22,31 +22,25 @@ } // 添加告警内容 -export function addAlarmContent(params) { +export function addAlarmContent(data) { return request({ - url: 'device/simManage/add', + url: 'alarmContent/add', method: 'post', - params + data }) } // 修改告警内容 export function updateAlarmContent(params) { return request({ - url: 'device/simManage/update', + url: 'alarmContent/update', method: 'post', params }) } // 删除告警内容 -export function delAlarmContent(ids) { +export function delAlarmContent(id) { return request({ - url: 'device/simManage/delete', - method: 'post', - params: { - ids: ids - }, - paramsSerializer: params => { - return qs.stringify(params, { indices: false }) - } + url: 'alarmContent/delete/' + id, + method: 'post' }) } diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..5b5057e 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -75,9 +75,11 @@ methods: { initMap() { const { vid, zoom, zooms, center, viewMode, mapStyle } = this - // 安全码 - window._AMapSecurityConfig = { - securityJsCode: this.$store.getters.amapSecurityCode + if (!window._AMapSecurityConfig) { + // 安全码 + window._AMapSecurityConfig = { + securityJsCode: this.$store.getters.amapSecurityCode + } } AMapLoader.load({ key: this.$store.getters.amapKey, // 秘钥,从store中取 @@ -91,7 +93,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +112,7 @@ component.$emit('ready', this.map) }) }).catch(e => { - this.$message.error('地图加载失败') + this.$message.error('地图加载失败:'+e) }) }, changeBaseLayer() { diff --git a/src/components/Amap/utils/convert-helper.js b/src/components/Amap/utils/convert-helper.js index 39ae214..6799041 100644 --- a/src/components/Amap/utils/convert-helper.js +++ b/src/components/Amap/utils/convert-helper.js @@ -1,3 +1,6 @@ +import store from '@/store' +import AMapLoader from '@amap/amap-jsapi-loader' + export function toPixel(arr) { return new window.AMap.Pixel(arr[0], arr[1]) } @@ -22,6 +25,72 @@ } /** + * 逆地址解析 + * @param coordinate 坐标数组[lng,lat] + * @returns {*[]} + */ +export function reverseLnglat(coordinate) { + let lnglat = [] + if (coordinate instanceof Array) { // 如果是Array[lng,lat] + lnglat = coordinate + } else if (coordinate instanceof String) { // 如果是字符串(lng,lat) + lnglat = coordinate.split(',') + } else if (coordinate instanceof Object) { + lnglat = [coordinate.lng, coordinate.lat] + } + return new Promise((resolve, reject) => { + if (lnglat.length === 2) { + AMapLoader.load({ + key: store.getters.amapKey // 秘钥 + }).then((AMap) => { + AMap.plugin('AMap.Geocoder', function() { + var geocoder = new AMap.Geocoder({ city: '' }) + geocoder.getAddress(lnglat, function(status, result) { + if (status === 'complete' && result.info === 'OK') { + resolve(result.regeocode) + // result为对应的地理位置详细信息 + } else { + reject('no address') + } + }) + }) + }).catch(error => { + reject(error) + }) + } else { + reject('no address') + } + }) +} + +/** + * 坐标系转换 + * @param coordinate 坐标数组[lng,lat] + */ +export function convertLnglat(coordinate) { + // 安全码 + window._AMapSecurityConfig = { + securityJsCode: store.getters.amapSecurityCode + } + return new Promise((resolve, reject) => { + AMapLoader.load({ + key: store.getters.amapKey // 秘钥 + }).then((AMap) => { + debugger + AMap.convertFrom(coordinate, 'gps', (status, result) => { + if (result.info === 'ok') { + const lnglats = result.locations[0] + resolve([lnglats.lng, lnglats.lat]) + // Array. + } else { + reject('convert error:' + result.info) + } + }) + }) + }) +} + +/** * @param arrs 二重数组 southWest, northEast */ export function toBounds(arrs) { diff --git a/README.md b/README.md index a93bd30..ae90135 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,19 @@ -# 智能闸井监测管理系统前端 +# 管网运行监测系统 -> 智能闸井监测管理系统WEB前端,系统管理模块基于基础权限管理的基础框架 ,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 +> 管网运行监测系统WEB前端,系统管理模块基于基础权限管理的基础框架,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 -本项目源于vue-element-admin,一个极简的 vue admin 管理后台V4.4.0版本。 +本项目源于vue-element-admin。 -[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) ## 安装前提 1. 安装nodejs -去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包 +去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包, 建议版本不要超过14 安装完成之后,在cmd中检查Node.js版本,输出版本号则表示安装成功 @@ -56,11 +54,11 @@ ## 浏览器支持情况 -主流浏览器和IE 10+. +主流浏览器和IE 11. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| --------- | --------- | --------- | --------- | -| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions +| IE | Edge | Firefox |Chrome | Safari | +|--------------| --------- | --------- | --------- |------| +| IE11(部分特性不支持) | 90+ | 80+ | 90+ |14+| ## License diff --git a/public/config/project.config.json b/public/config/project.config.json index f986319..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -4,6 +4,9 @@ "theme":"blue", "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", + "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", + "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", + "mapType": "gaode", "singleSys": true, "refreshType":"websocket", "showPointType":"massMarkers", diff --git a/src/api/base/tenant.js b/src/api/base/tenant.js deleted file mode 100644 index 9ad9f31..0000000 --- a/src/api/base/tenant.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 租户/项目列表 - */ -import request from '@/utils/request' - -// 项目列表查询 -export function getTenantList(params) { - return request({ - url: 'tenant/list', - method: 'get', - params - }) -} diff --git a/src/api/data/dataStatics.js b/src/api/data/dataStatics.js index b9ccd3d..e79dea3 100644 --- a/src/api/data/dataStatics.js +++ b/src/api/data/dataStatics.js @@ -49,7 +49,7 @@ // 离线设备数量 export function deviceStaticsByOnline(params) { return request({ - url: 'statics/deviceCountByOnlineStatus', + url: 'statics/deviceStaticsByStatus', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 7274ede..bee92d0 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -4,7 +4,7 @@ import request from '@/utils/request' import qs from 'qs' -// 设备类别 +// 设备类别, 不分页全部 export function getDevice(params) { return request({ url: 'device/type', diff --git a/src/api/system/dict.js b/src/api/system/dict.js index 689b6b1..c2e7978 100644 --- a/src/api/system/dict.js +++ b/src/api/system/dict.js @@ -10,7 +10,14 @@ params }) } - +// 报警类型 +export function alarmType(params) { + return request({ + url: '/sys/dict/code/alarmType', + method: 'get', + params + }) +} // 添加字典 export function addDict(data) { return request({ diff --git a/src/api/system/tenant.js b/src/api/system/tenant.js index 4bf3350..863476c 100644 --- a/src/api/system/tenant.js +++ b/src/api/system/tenant.js @@ -1,28 +1,11 @@ /* - * 项目管理配置接口 + * 项目管理接口 */ import request from '@/utils/request' import qs from 'qs' -// 设备类别 -export function getDevice(params) { - return request({ - url: 'device/type', - method: 'get', - params - }) -} -// 项目管理绑定组织 -export function deptTenantSys(params) { - return request({ - url: 'bus/tenant/relateTenant', - method: 'post', - params - }) -} - // 项目管理查询 -export function tenantSysList(params) { +export function getTenantList(params) { return request({ url: 'bus/tenant/list', method: 'get', @@ -31,21 +14,31 @@ } // 添加项目管理 -export function addTenantSys(params) { +export function addTenant(data) { return request({ url: 'sys/tenant/add', method: 'post', - params + data }) } // 修改项目管理 -export function updateTenantSys(params) { +export function updateTenant(data) { return request({ url: 'sys/tenant/update', method: 'post', - params + data }) } + +// 修改项目管理 +export function relatedDept(data) { + return request({ + url: 'bus/tenant/relateTenant', + method: 'post', + data + }) +} + // 删除项目管理 export function delTenantSys(ids) { return request({ diff --git a/src/api/systemConfig/alarmContent.js b/src/api/systemConfig/alarmContent.js index bdefe72..486c3ce 100644 --- a/src/api/systemConfig/alarmContent.js +++ b/src/api/systemConfig/alarmContent.js @@ -22,31 +22,25 @@ } // 添加告警内容 -export function addAlarmContent(params) { +export function addAlarmContent(data) { return request({ - url: 'device/simManage/add', + url: 'alarmContent/add', method: 'post', - params + data }) } // 修改告警内容 export function updateAlarmContent(params) { return request({ - url: 'device/simManage/update', + url: 'alarmContent/update', method: 'post', params }) } // 删除告警内容 -export function delAlarmContent(ids) { +export function delAlarmContent(id) { return request({ - url: 'device/simManage/delete', - method: 'post', - params: { - ids: ids - }, - paramsSerializer: params => { - return qs.stringify(params, { indices: false }) - } + url: 'alarmContent/delete/' + id, + method: 'post' }) } diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..5b5057e 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -75,9 +75,11 @@ methods: { initMap() { const { vid, zoom, zooms, center, viewMode, mapStyle } = this - // 安全码 - window._AMapSecurityConfig = { - securityJsCode: this.$store.getters.amapSecurityCode + if (!window._AMapSecurityConfig) { + // 安全码 + window._AMapSecurityConfig = { + securityJsCode: this.$store.getters.amapSecurityCode + } } AMapLoader.load({ key: this.$store.getters.amapKey, // 秘钥,从store中取 @@ -91,7 +93,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +112,7 @@ component.$emit('ready', this.map) }) }).catch(e => { - this.$message.error('地图加载失败') + this.$message.error('地图加载失败:'+e) }) }, changeBaseLayer() { diff --git a/src/components/Amap/utils/convert-helper.js b/src/components/Amap/utils/convert-helper.js index 39ae214..6799041 100644 --- a/src/components/Amap/utils/convert-helper.js +++ b/src/components/Amap/utils/convert-helper.js @@ -1,3 +1,6 @@ +import store from '@/store' +import AMapLoader from '@amap/amap-jsapi-loader' + export function toPixel(arr) { return new window.AMap.Pixel(arr[0], arr[1]) } @@ -22,6 +25,72 @@ } /** + * 逆地址解析 + * @param coordinate 坐标数组[lng,lat] + * @returns {*[]} + */ +export function reverseLnglat(coordinate) { + let lnglat = [] + if (coordinate instanceof Array) { // 如果是Array[lng,lat] + lnglat = coordinate + } else if (coordinate instanceof String) { // 如果是字符串(lng,lat) + lnglat = coordinate.split(',') + } else if (coordinate instanceof Object) { + lnglat = [coordinate.lng, coordinate.lat] + } + return new Promise((resolve, reject) => { + if (lnglat.length === 2) { + AMapLoader.load({ + key: store.getters.amapKey // 秘钥 + }).then((AMap) => { + AMap.plugin('AMap.Geocoder', function() { + var geocoder = new AMap.Geocoder({ city: '' }) + geocoder.getAddress(lnglat, function(status, result) { + if (status === 'complete' && result.info === 'OK') { + resolve(result.regeocode) + // result为对应的地理位置详细信息 + } else { + reject('no address') + } + }) + }) + }).catch(error => { + reject(error) + }) + } else { + reject('no address') + } + }) +} + +/** + * 坐标系转换 + * @param coordinate 坐标数组[lng,lat] + */ +export function convertLnglat(coordinate) { + // 安全码 + window._AMapSecurityConfig = { + securityJsCode: store.getters.amapSecurityCode + } + return new Promise((resolve, reject) => { + AMapLoader.load({ + key: store.getters.amapKey // 秘钥 + }).then((AMap) => { + debugger + AMap.convertFrom(coordinate, 'gps', (status, result) => { + if (result.info === 'ok') { + const lnglats = result.locations[0] + resolve([lnglats.lng, lnglats.lat]) + // Array. + } else { + reject('convert error:' + result.info) + } + }) + }) + }) +} + +/** * @param arrs 二重数组 southWest, northEast */ export function toBounds(arrs) { diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 842f145..7f8def7 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -157,10 +157,10 @@ return [] } }, // 列 - // pagination: { - // type: Boolean, - // default: true - // }, // 是否分页 + pagination: { + type: Boolean, + default: true + }, // 是否分页 options: { type: Object, default: function() { @@ -195,8 +195,8 @@ columnsFiltered: [], // 过滤后的列情况 columnsChecked: [], // 显示列选择情况 visible: false, // 弹窗显示情况 - animateClass: '', // 按钮动画效果 - pagination: false // 是否显示分页 + animateClass: '' // 按钮动画效果 + // pagination: false // 是否显示分页 } }, watch: { @@ -213,11 +213,11 @@ methods: { // 初始化显示列状态 initColumnsState(paginationStatus) { - if (paginationStatus === true || paginationStatus === undefined) { - this.pagination = true - } else { - this.pagination = false - } + // if (paginationStatus === true || paginationStatus === undefined) { + // this.pagination = true + // } else { + // this.pagination = false + // } this.columnsChecked = [] for (const column of this.columns) { if (column.show === false) { diff --git a/README.md b/README.md index a93bd30..ae90135 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,19 @@ -# 智能闸井监测管理系统前端 +# 管网运行监测系统 -> 智能闸井监测管理系统WEB前端,系统管理模块基于基础权限管理的基础框架 ,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 +> 管网运行监测系统WEB前端,系统管理模块基于基础权限管理的基础框架,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 -本项目源于vue-element-admin,一个极简的 vue admin 管理后台V4.4.0版本。 +本项目源于vue-element-admin。 -[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) ## 安装前提 1. 安装nodejs -去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包 +去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包, 建议版本不要超过14 安装完成之后,在cmd中检查Node.js版本,输出版本号则表示安装成功 @@ -56,11 +54,11 @@ ## 浏览器支持情况 -主流浏览器和IE 10+. +主流浏览器和IE 11. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| --------- | --------- | --------- | --------- | -| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions +| IE | Edge | Firefox |Chrome | Safari | +|--------------| --------- | --------- | --------- |------| +| IE11(部分特性不支持) | 90+ | 80+ | 90+ |14+| ## License diff --git a/public/config/project.config.json b/public/config/project.config.json index f986319..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -4,6 +4,9 @@ "theme":"blue", "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", + "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", + "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", + "mapType": "gaode", "singleSys": true, "refreshType":"websocket", "showPointType":"massMarkers", diff --git a/src/api/base/tenant.js b/src/api/base/tenant.js deleted file mode 100644 index 9ad9f31..0000000 --- a/src/api/base/tenant.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 租户/项目列表 - */ -import request from '@/utils/request' - -// 项目列表查询 -export function getTenantList(params) { - return request({ - url: 'tenant/list', - method: 'get', - params - }) -} diff --git a/src/api/data/dataStatics.js b/src/api/data/dataStatics.js index b9ccd3d..e79dea3 100644 --- a/src/api/data/dataStatics.js +++ b/src/api/data/dataStatics.js @@ -49,7 +49,7 @@ // 离线设备数量 export function deviceStaticsByOnline(params) { return request({ - url: 'statics/deviceCountByOnlineStatus', + url: 'statics/deviceStaticsByStatus', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 7274ede..bee92d0 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -4,7 +4,7 @@ import request from '@/utils/request' import qs from 'qs' -// 设备类别 +// 设备类别, 不分页全部 export function getDevice(params) { return request({ url: 'device/type', diff --git a/src/api/system/dict.js b/src/api/system/dict.js index 689b6b1..c2e7978 100644 --- a/src/api/system/dict.js +++ b/src/api/system/dict.js @@ -10,7 +10,14 @@ params }) } - +// 报警类型 +export function alarmType(params) { + return request({ + url: '/sys/dict/code/alarmType', + method: 'get', + params + }) +} // 添加字典 export function addDict(data) { return request({ diff --git a/src/api/system/tenant.js b/src/api/system/tenant.js index 4bf3350..863476c 100644 --- a/src/api/system/tenant.js +++ b/src/api/system/tenant.js @@ -1,28 +1,11 @@ /* - * 项目管理配置接口 + * 项目管理接口 */ import request from '@/utils/request' import qs from 'qs' -// 设备类别 -export function getDevice(params) { - return request({ - url: 'device/type', - method: 'get', - params - }) -} -// 项目管理绑定组织 -export function deptTenantSys(params) { - return request({ - url: 'bus/tenant/relateTenant', - method: 'post', - params - }) -} - // 项目管理查询 -export function tenantSysList(params) { +export function getTenantList(params) { return request({ url: 'bus/tenant/list', method: 'get', @@ -31,21 +14,31 @@ } // 添加项目管理 -export function addTenantSys(params) { +export function addTenant(data) { return request({ url: 'sys/tenant/add', method: 'post', - params + data }) } // 修改项目管理 -export function updateTenantSys(params) { +export function updateTenant(data) { return request({ url: 'sys/tenant/update', method: 'post', - params + data }) } + +// 修改项目管理 +export function relatedDept(data) { + return request({ + url: 'bus/tenant/relateTenant', + method: 'post', + data + }) +} + // 删除项目管理 export function delTenantSys(ids) { return request({ diff --git a/src/api/systemConfig/alarmContent.js b/src/api/systemConfig/alarmContent.js index bdefe72..486c3ce 100644 --- a/src/api/systemConfig/alarmContent.js +++ b/src/api/systemConfig/alarmContent.js @@ -22,31 +22,25 @@ } // 添加告警内容 -export function addAlarmContent(params) { +export function addAlarmContent(data) { return request({ - url: 'device/simManage/add', + url: 'alarmContent/add', method: 'post', - params + data }) } // 修改告警内容 export function updateAlarmContent(params) { return request({ - url: 'device/simManage/update', + url: 'alarmContent/update', method: 'post', params }) } // 删除告警内容 -export function delAlarmContent(ids) { +export function delAlarmContent(id) { return request({ - url: 'device/simManage/delete', - method: 'post', - params: { - ids: ids - }, - paramsSerializer: params => { - return qs.stringify(params, { indices: false }) - } + url: 'alarmContent/delete/' + id, + method: 'post' }) } diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..5b5057e 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -75,9 +75,11 @@ methods: { initMap() { const { vid, zoom, zooms, center, viewMode, mapStyle } = this - // 安全码 - window._AMapSecurityConfig = { - securityJsCode: this.$store.getters.amapSecurityCode + if (!window._AMapSecurityConfig) { + // 安全码 + window._AMapSecurityConfig = { + securityJsCode: this.$store.getters.amapSecurityCode + } } AMapLoader.load({ key: this.$store.getters.amapKey, // 秘钥,从store中取 @@ -91,7 +93,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +112,7 @@ component.$emit('ready', this.map) }) }).catch(e => { - this.$message.error('地图加载失败') + this.$message.error('地图加载失败:'+e) }) }, changeBaseLayer() { diff --git a/src/components/Amap/utils/convert-helper.js b/src/components/Amap/utils/convert-helper.js index 39ae214..6799041 100644 --- a/src/components/Amap/utils/convert-helper.js +++ b/src/components/Amap/utils/convert-helper.js @@ -1,3 +1,6 @@ +import store from '@/store' +import AMapLoader from '@amap/amap-jsapi-loader' + export function toPixel(arr) { return new window.AMap.Pixel(arr[0], arr[1]) } @@ -22,6 +25,72 @@ } /** + * 逆地址解析 + * @param coordinate 坐标数组[lng,lat] + * @returns {*[]} + */ +export function reverseLnglat(coordinate) { + let lnglat = [] + if (coordinate instanceof Array) { // 如果是Array[lng,lat] + lnglat = coordinate + } else if (coordinate instanceof String) { // 如果是字符串(lng,lat) + lnglat = coordinate.split(',') + } else if (coordinate instanceof Object) { + lnglat = [coordinate.lng, coordinate.lat] + } + return new Promise((resolve, reject) => { + if (lnglat.length === 2) { + AMapLoader.load({ + key: store.getters.amapKey // 秘钥 + }).then((AMap) => { + AMap.plugin('AMap.Geocoder', function() { + var geocoder = new AMap.Geocoder({ city: '' }) + geocoder.getAddress(lnglat, function(status, result) { + if (status === 'complete' && result.info === 'OK') { + resolve(result.regeocode) + // result为对应的地理位置详细信息 + } else { + reject('no address') + } + }) + }) + }).catch(error => { + reject(error) + }) + } else { + reject('no address') + } + }) +} + +/** + * 坐标系转换 + * @param coordinate 坐标数组[lng,lat] + */ +export function convertLnglat(coordinate) { + // 安全码 + window._AMapSecurityConfig = { + securityJsCode: store.getters.amapSecurityCode + } + return new Promise((resolve, reject) => { + AMapLoader.load({ + key: store.getters.amapKey // 秘钥 + }).then((AMap) => { + debugger + AMap.convertFrom(coordinate, 'gps', (status, result) => { + if (result.info === 'ok') { + const lnglats = result.locations[0] + resolve([lnglats.lng, lnglats.lat]) + // Array. + } else { + reject('convert error:' + result.info) + } + }) + }) + }) +} + +/** * @param arrs 二重数组 southWest, northEast */ export function toBounds(arrs) { diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 842f145..7f8def7 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -157,10 +157,10 @@ return [] } }, // 列 - // pagination: { - // type: Boolean, - // default: true - // }, // 是否分页 + pagination: { + type: Boolean, + default: true + }, // 是否分页 options: { type: Object, default: function() { @@ -195,8 +195,8 @@ columnsFiltered: [], // 过滤后的列情况 columnsChecked: [], // 显示列选择情况 visible: false, // 弹窗显示情况 - animateClass: '', // 按钮动画效果 - pagination: false // 是否显示分页 + animateClass: '' // 按钮动画效果 + // pagination: false // 是否显示分页 } }, watch: { @@ -213,11 +213,11 @@ methods: { // 初始化显示列状态 initColumnsState(paginationStatus) { - if (paginationStatus === true || paginationStatus === undefined) { - this.pagination = true - } else { - this.pagination = false - } + // if (paginationStatus === true || paginationStatus === undefined) { + // this.pagination = true + // } else { + // this.pagination = false + // } this.columnsChecked = [] for (const column of this.columns) { if (column.show === false) { diff --git a/src/main.js b/src/main.js index 5131944..cb309a1 100644 --- a/src/main.js +++ b/src/main.js @@ -97,6 +97,13 @@ Vue.prototype.baseConfig = result.data document.title = result.data.title // 首先设置网页的title service.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 + // 地图类型是高德的话,设置windowSecurity + // if (result.mapType === 'gaode') { + // window._AMapSecurityConfig = { + // securityJsCode: this.baseConfig.amapSecurityCode, + // key: this.baseConfig.amapKey + // } + // } setWsUrl(result.data.wsUrl) new Vue({ router, diff --git a/README.md b/README.md index a93bd30..ae90135 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,19 @@ -# 智能闸井监测管理系统前端 +# 管网运行监测系统 -> 智能闸井监测管理系统WEB前端,系统管理模块基于基础权限管理的基础框架 ,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 +> 管网运行监测系统WEB前端,系统管理模块基于基础权限管理的基础框架,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 -本项目源于vue-element-admin,一个极简的 vue admin 管理后台V4.4.0版本。 +本项目源于vue-element-admin。 -[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) ## 安装前提 1. 安装nodejs -去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包 +去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包, 建议版本不要超过14 安装完成之后,在cmd中检查Node.js版本,输出版本号则表示安装成功 @@ -56,11 +54,11 @@ ## 浏览器支持情况 -主流浏览器和IE 10+. +主流浏览器和IE 11. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| --------- | --------- | --------- | --------- | -| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions +| IE | Edge | Firefox |Chrome | Safari | +|--------------| --------- | --------- | --------- |------| +| IE11(部分特性不支持) | 90+ | 80+ | 90+ |14+| ## License diff --git a/public/config/project.config.json b/public/config/project.config.json index f986319..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -4,6 +4,9 @@ "theme":"blue", "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", + "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", + "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", + "mapType": "gaode", "singleSys": true, "refreshType":"websocket", "showPointType":"massMarkers", diff --git a/src/api/base/tenant.js b/src/api/base/tenant.js deleted file mode 100644 index 9ad9f31..0000000 --- a/src/api/base/tenant.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 租户/项目列表 - */ -import request from '@/utils/request' - -// 项目列表查询 -export function getTenantList(params) { - return request({ - url: 'tenant/list', - method: 'get', - params - }) -} diff --git a/src/api/data/dataStatics.js b/src/api/data/dataStatics.js index b9ccd3d..e79dea3 100644 --- a/src/api/data/dataStatics.js +++ b/src/api/data/dataStatics.js @@ -49,7 +49,7 @@ // 离线设备数量 export function deviceStaticsByOnline(params) { return request({ - url: 'statics/deviceCountByOnlineStatus', + url: 'statics/deviceStaticsByStatus', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 7274ede..bee92d0 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -4,7 +4,7 @@ import request from '@/utils/request' import qs from 'qs' -// 设备类别 +// 设备类别, 不分页全部 export function getDevice(params) { return request({ url: 'device/type', diff --git a/src/api/system/dict.js b/src/api/system/dict.js index 689b6b1..c2e7978 100644 --- a/src/api/system/dict.js +++ b/src/api/system/dict.js @@ -10,7 +10,14 @@ params }) } - +// 报警类型 +export function alarmType(params) { + return request({ + url: '/sys/dict/code/alarmType', + method: 'get', + params + }) +} // 添加字典 export function addDict(data) { return request({ diff --git a/src/api/system/tenant.js b/src/api/system/tenant.js index 4bf3350..863476c 100644 --- a/src/api/system/tenant.js +++ b/src/api/system/tenant.js @@ -1,28 +1,11 @@ /* - * 项目管理配置接口 + * 项目管理接口 */ import request from '@/utils/request' import qs from 'qs' -// 设备类别 -export function getDevice(params) { - return request({ - url: 'device/type', - method: 'get', - params - }) -} -// 项目管理绑定组织 -export function deptTenantSys(params) { - return request({ - url: 'bus/tenant/relateTenant', - method: 'post', - params - }) -} - // 项目管理查询 -export function tenantSysList(params) { +export function getTenantList(params) { return request({ url: 'bus/tenant/list', method: 'get', @@ -31,21 +14,31 @@ } // 添加项目管理 -export function addTenantSys(params) { +export function addTenant(data) { return request({ url: 'sys/tenant/add', method: 'post', - params + data }) } // 修改项目管理 -export function updateTenantSys(params) { +export function updateTenant(data) { return request({ url: 'sys/tenant/update', method: 'post', - params + data }) } + +// 修改项目管理 +export function relatedDept(data) { + return request({ + url: 'bus/tenant/relateTenant', + method: 'post', + data + }) +} + // 删除项目管理 export function delTenantSys(ids) { return request({ diff --git a/src/api/systemConfig/alarmContent.js b/src/api/systemConfig/alarmContent.js index bdefe72..486c3ce 100644 --- a/src/api/systemConfig/alarmContent.js +++ b/src/api/systemConfig/alarmContent.js @@ -22,31 +22,25 @@ } // 添加告警内容 -export function addAlarmContent(params) { +export function addAlarmContent(data) { return request({ - url: 'device/simManage/add', + url: 'alarmContent/add', method: 'post', - params + data }) } // 修改告警内容 export function updateAlarmContent(params) { return request({ - url: 'device/simManage/update', + url: 'alarmContent/update', method: 'post', params }) } // 删除告警内容 -export function delAlarmContent(ids) { +export function delAlarmContent(id) { return request({ - url: 'device/simManage/delete', - method: 'post', - params: { - ids: ids - }, - paramsSerializer: params => { - return qs.stringify(params, { indices: false }) - } + url: 'alarmContent/delete/' + id, + method: 'post' }) } diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..5b5057e 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -75,9 +75,11 @@ methods: { initMap() { const { vid, zoom, zooms, center, viewMode, mapStyle } = this - // 安全码 - window._AMapSecurityConfig = { - securityJsCode: this.$store.getters.amapSecurityCode + if (!window._AMapSecurityConfig) { + // 安全码 + window._AMapSecurityConfig = { + securityJsCode: this.$store.getters.amapSecurityCode + } } AMapLoader.load({ key: this.$store.getters.amapKey, // 秘钥,从store中取 @@ -91,7 +93,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +112,7 @@ component.$emit('ready', this.map) }) }).catch(e => { - this.$message.error('地图加载失败') + this.$message.error('地图加载失败:'+e) }) }, changeBaseLayer() { diff --git a/src/components/Amap/utils/convert-helper.js b/src/components/Amap/utils/convert-helper.js index 39ae214..6799041 100644 --- a/src/components/Amap/utils/convert-helper.js +++ b/src/components/Amap/utils/convert-helper.js @@ -1,3 +1,6 @@ +import store from '@/store' +import AMapLoader from '@amap/amap-jsapi-loader' + export function toPixel(arr) { return new window.AMap.Pixel(arr[0], arr[1]) } @@ -22,6 +25,72 @@ } /** + * 逆地址解析 + * @param coordinate 坐标数组[lng,lat] + * @returns {*[]} + */ +export function reverseLnglat(coordinate) { + let lnglat = [] + if (coordinate instanceof Array) { // 如果是Array[lng,lat] + lnglat = coordinate + } else if (coordinate instanceof String) { // 如果是字符串(lng,lat) + lnglat = coordinate.split(',') + } else if (coordinate instanceof Object) { + lnglat = [coordinate.lng, coordinate.lat] + } + return new Promise((resolve, reject) => { + if (lnglat.length === 2) { + AMapLoader.load({ + key: store.getters.amapKey // 秘钥 + }).then((AMap) => { + AMap.plugin('AMap.Geocoder', function() { + var geocoder = new AMap.Geocoder({ city: '' }) + geocoder.getAddress(lnglat, function(status, result) { + if (status === 'complete' && result.info === 'OK') { + resolve(result.regeocode) + // result为对应的地理位置详细信息 + } else { + reject('no address') + } + }) + }) + }).catch(error => { + reject(error) + }) + } else { + reject('no address') + } + }) +} + +/** + * 坐标系转换 + * @param coordinate 坐标数组[lng,lat] + */ +export function convertLnglat(coordinate) { + // 安全码 + window._AMapSecurityConfig = { + securityJsCode: store.getters.amapSecurityCode + } + return new Promise((resolve, reject) => { + AMapLoader.load({ + key: store.getters.amapKey // 秘钥 + }).then((AMap) => { + debugger + AMap.convertFrom(coordinate, 'gps', (status, result) => { + if (result.info === 'ok') { + const lnglats = result.locations[0] + resolve([lnglats.lng, lnglats.lat]) + // Array. + } else { + reject('convert error:' + result.info) + } + }) + }) + }) +} + +/** * @param arrs 二重数组 southWest, northEast */ export function toBounds(arrs) { diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 842f145..7f8def7 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -157,10 +157,10 @@ return [] } }, // 列 - // pagination: { - // type: Boolean, - // default: true - // }, // 是否分页 + pagination: { + type: Boolean, + default: true + }, // 是否分页 options: { type: Object, default: function() { @@ -195,8 +195,8 @@ columnsFiltered: [], // 过滤后的列情况 columnsChecked: [], // 显示列选择情况 visible: false, // 弹窗显示情况 - animateClass: '', // 按钮动画效果 - pagination: false // 是否显示分页 + animateClass: '' // 按钮动画效果 + // pagination: false // 是否显示分页 } }, watch: { @@ -213,11 +213,11 @@ methods: { // 初始化显示列状态 initColumnsState(paginationStatus) { - if (paginationStatus === true || paginationStatus === undefined) { - this.pagination = true - } else { - this.pagination = false - } + // if (paginationStatus === true || paginationStatus === undefined) { + // this.pagination = true + // } else { + // this.pagination = false + // } this.columnsChecked = [] for (const column of this.columns) { if (column.show === false) { diff --git a/src/main.js b/src/main.js index 5131944..cb309a1 100644 --- a/src/main.js +++ b/src/main.js @@ -97,6 +97,13 @@ Vue.prototype.baseConfig = result.data document.title = result.data.title // 首先设置网页的title service.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 + // 地图类型是高德的话,设置windowSecurity + // if (result.mapType === 'gaode') { + // window._AMapSecurityConfig = { + // securityJsCode: this.baseConfig.amapSecurityCode, + // key: this.baseConfig.amapKey + // } + // } setWsUrl(result.data.wsUrl) new Vue({ router, diff --git a/src/router/modules/config.js b/src/router/modules/config.js index 0ca7f44..c33329b 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -52,7 +52,7 @@ path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), - meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission'] } + meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } } ] }] diff --git a/README.md b/README.md index a93bd30..ae90135 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,19 @@ -# 智能闸井监测管理系统前端 +# 管网运行监测系统 -> 智能闸井监测管理系统WEB前端,系统管理模块基于基础权限管理的基础框架 ,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 +> 管网运行监测系统WEB前端,系统管理模块基于基础权限管理的基础框架,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 -本项目源于vue-element-admin,一个极简的 vue admin 管理后台V4.4.0版本。 +本项目源于vue-element-admin。 -[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) ## 安装前提 1. 安装nodejs -去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包 +去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包, 建议版本不要超过14 安装完成之后,在cmd中检查Node.js版本,输出版本号则表示安装成功 @@ -56,11 +54,11 @@ ## 浏览器支持情况 -主流浏览器和IE 10+. +主流浏览器和IE 11. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| --------- | --------- | --------- | --------- | -| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions +| IE | Edge | Firefox |Chrome | Safari | +|--------------| --------- | --------- | --------- |------| +| IE11(部分特性不支持) | 90+ | 80+ | 90+ |14+| ## License diff --git a/public/config/project.config.json b/public/config/project.config.json index f986319..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -4,6 +4,9 @@ "theme":"blue", "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", + "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", + "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", + "mapType": "gaode", "singleSys": true, "refreshType":"websocket", "showPointType":"massMarkers", diff --git a/src/api/base/tenant.js b/src/api/base/tenant.js deleted file mode 100644 index 9ad9f31..0000000 --- a/src/api/base/tenant.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 租户/项目列表 - */ -import request from '@/utils/request' - -// 项目列表查询 -export function getTenantList(params) { - return request({ - url: 'tenant/list', - method: 'get', - params - }) -} diff --git a/src/api/data/dataStatics.js b/src/api/data/dataStatics.js index b9ccd3d..e79dea3 100644 --- a/src/api/data/dataStatics.js +++ b/src/api/data/dataStatics.js @@ -49,7 +49,7 @@ // 离线设备数量 export function deviceStaticsByOnline(params) { return request({ - url: 'statics/deviceCountByOnlineStatus', + url: 'statics/deviceStaticsByStatus', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 7274ede..bee92d0 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -4,7 +4,7 @@ import request from '@/utils/request' import qs from 'qs' -// 设备类别 +// 设备类别, 不分页全部 export function getDevice(params) { return request({ url: 'device/type', diff --git a/src/api/system/dict.js b/src/api/system/dict.js index 689b6b1..c2e7978 100644 --- a/src/api/system/dict.js +++ b/src/api/system/dict.js @@ -10,7 +10,14 @@ params }) } - +// 报警类型 +export function alarmType(params) { + return request({ + url: '/sys/dict/code/alarmType', + method: 'get', + params + }) +} // 添加字典 export function addDict(data) { return request({ diff --git a/src/api/system/tenant.js b/src/api/system/tenant.js index 4bf3350..863476c 100644 --- a/src/api/system/tenant.js +++ b/src/api/system/tenant.js @@ -1,28 +1,11 @@ /* - * 项目管理配置接口 + * 项目管理接口 */ import request from '@/utils/request' import qs from 'qs' -// 设备类别 -export function getDevice(params) { - return request({ - url: 'device/type', - method: 'get', - params - }) -} -// 项目管理绑定组织 -export function deptTenantSys(params) { - return request({ - url: 'bus/tenant/relateTenant', - method: 'post', - params - }) -} - // 项目管理查询 -export function tenantSysList(params) { +export function getTenantList(params) { return request({ url: 'bus/tenant/list', method: 'get', @@ -31,21 +14,31 @@ } // 添加项目管理 -export function addTenantSys(params) { +export function addTenant(data) { return request({ url: 'sys/tenant/add', method: 'post', - params + data }) } // 修改项目管理 -export function updateTenantSys(params) { +export function updateTenant(data) { return request({ url: 'sys/tenant/update', method: 'post', - params + data }) } + +// 修改项目管理 +export function relatedDept(data) { + return request({ + url: 'bus/tenant/relateTenant', + method: 'post', + data + }) +} + // 删除项目管理 export function delTenantSys(ids) { return request({ diff --git a/src/api/systemConfig/alarmContent.js b/src/api/systemConfig/alarmContent.js index bdefe72..486c3ce 100644 --- a/src/api/systemConfig/alarmContent.js +++ b/src/api/systemConfig/alarmContent.js @@ -22,31 +22,25 @@ } // 添加告警内容 -export function addAlarmContent(params) { +export function addAlarmContent(data) { return request({ - url: 'device/simManage/add', + url: 'alarmContent/add', method: 'post', - params + data }) } // 修改告警内容 export function updateAlarmContent(params) { return request({ - url: 'device/simManage/update', + url: 'alarmContent/update', method: 'post', params }) } // 删除告警内容 -export function delAlarmContent(ids) { +export function delAlarmContent(id) { return request({ - url: 'device/simManage/delete', - method: 'post', - params: { - ids: ids - }, - paramsSerializer: params => { - return qs.stringify(params, { indices: false }) - } + url: 'alarmContent/delete/' + id, + method: 'post' }) } diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..5b5057e 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -75,9 +75,11 @@ methods: { initMap() { const { vid, zoom, zooms, center, viewMode, mapStyle } = this - // 安全码 - window._AMapSecurityConfig = { - securityJsCode: this.$store.getters.amapSecurityCode + if (!window._AMapSecurityConfig) { + // 安全码 + window._AMapSecurityConfig = { + securityJsCode: this.$store.getters.amapSecurityCode + } } AMapLoader.load({ key: this.$store.getters.amapKey, // 秘钥,从store中取 @@ -91,7 +93,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +112,7 @@ component.$emit('ready', this.map) }) }).catch(e => { - this.$message.error('地图加载失败') + this.$message.error('地图加载失败:'+e) }) }, changeBaseLayer() { diff --git a/src/components/Amap/utils/convert-helper.js b/src/components/Amap/utils/convert-helper.js index 39ae214..6799041 100644 --- a/src/components/Amap/utils/convert-helper.js +++ b/src/components/Amap/utils/convert-helper.js @@ -1,3 +1,6 @@ +import store from '@/store' +import AMapLoader from '@amap/amap-jsapi-loader' + export function toPixel(arr) { return new window.AMap.Pixel(arr[0], arr[1]) } @@ -22,6 +25,72 @@ } /** + * 逆地址解析 + * @param coordinate 坐标数组[lng,lat] + * @returns {*[]} + */ +export function reverseLnglat(coordinate) { + let lnglat = [] + if (coordinate instanceof Array) { // 如果是Array[lng,lat] + lnglat = coordinate + } else if (coordinate instanceof String) { // 如果是字符串(lng,lat) + lnglat = coordinate.split(',') + } else if (coordinate instanceof Object) { + lnglat = [coordinate.lng, coordinate.lat] + } + return new Promise((resolve, reject) => { + if (lnglat.length === 2) { + AMapLoader.load({ + key: store.getters.amapKey // 秘钥 + }).then((AMap) => { + AMap.plugin('AMap.Geocoder', function() { + var geocoder = new AMap.Geocoder({ city: '' }) + geocoder.getAddress(lnglat, function(status, result) { + if (status === 'complete' && result.info === 'OK') { + resolve(result.regeocode) + // result为对应的地理位置详细信息 + } else { + reject('no address') + } + }) + }) + }).catch(error => { + reject(error) + }) + } else { + reject('no address') + } + }) +} + +/** + * 坐标系转换 + * @param coordinate 坐标数组[lng,lat] + */ +export function convertLnglat(coordinate) { + // 安全码 + window._AMapSecurityConfig = { + securityJsCode: store.getters.amapSecurityCode + } + return new Promise((resolve, reject) => { + AMapLoader.load({ + key: store.getters.amapKey // 秘钥 + }).then((AMap) => { + debugger + AMap.convertFrom(coordinate, 'gps', (status, result) => { + if (result.info === 'ok') { + const lnglats = result.locations[0] + resolve([lnglats.lng, lnglats.lat]) + // Array. + } else { + reject('convert error:' + result.info) + } + }) + }) + }) +} + +/** * @param arrs 二重数组 southWest, northEast */ export function toBounds(arrs) { diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 842f145..7f8def7 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -157,10 +157,10 @@ return [] } }, // 列 - // pagination: { - // type: Boolean, - // default: true - // }, // 是否分页 + pagination: { + type: Boolean, + default: true + }, // 是否分页 options: { type: Object, default: function() { @@ -195,8 +195,8 @@ columnsFiltered: [], // 过滤后的列情况 columnsChecked: [], // 显示列选择情况 visible: false, // 弹窗显示情况 - animateClass: '', // 按钮动画效果 - pagination: false // 是否显示分页 + animateClass: '' // 按钮动画效果 + // pagination: false // 是否显示分页 } }, watch: { @@ -213,11 +213,11 @@ methods: { // 初始化显示列状态 initColumnsState(paginationStatus) { - if (paginationStatus === true || paginationStatus === undefined) { - this.pagination = true - } else { - this.pagination = false - } + // if (paginationStatus === true || paginationStatus === undefined) { + // this.pagination = true + // } else { + // this.pagination = false + // } this.columnsChecked = [] for (const column of this.columns) { if (column.show === false) { diff --git a/src/main.js b/src/main.js index 5131944..cb309a1 100644 --- a/src/main.js +++ b/src/main.js @@ -97,6 +97,13 @@ Vue.prototype.baseConfig = result.data document.title = result.data.title // 首先设置网页的title service.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 + // 地图类型是高德的话,设置windowSecurity + // if (result.mapType === 'gaode') { + // window._AMapSecurityConfig = { + // securityJsCode: this.baseConfig.amapSecurityCode, + // key: this.baseConfig.amapKey + // } + // } setWsUrl(result.data.wsUrl) new Vue({ router, diff --git a/src/router/modules/config.js b/src/router/modules/config.js index 0ca7f44..c33329b 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -52,7 +52,7 @@ path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), - meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission'] } + meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } } ] }] diff --git a/src/router/modules/well.js b/src/router/modules/well.js index ef12852..17ed4e1 100644 --- a/src/router/modules/well.js +++ b/src/router/modules/well.js @@ -168,7 +168,7 @@ path: '/deviceType', name: 'DeviceType', component: () => import('@/views/deviceManage/deviceType/deviceType'), - meta: { title: '设备类型管理', icon: 'icon-config', permission: ['/deviceType/mange'] } + meta: { title: '设备类型管理', icon: 'icon-config', permission: ['/deviceType/listPage'] } }, { path: '/deviceModel', @@ -180,7 +180,7 @@ path: '/deviceImei', name: 'DeviceImei', component: () => import('@/views/deviceManage/deviceImei/deviceImei'), - meta: { title: '设备SIM卡号管理', icon: 'icon-config', permission: ['/device/imei'] } + meta: { title: '设备SIM卡号管理', icon: 'icon-config', permission: ['/device/simManage/listpage'] } } ] }, diff --git a/README.md b/README.md index a93bd30..ae90135 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,19 @@ -# 智能闸井监测管理系统前端 +# 管网运行监测系统 -> 智能闸井监测管理系统WEB前端,系统管理模块基于基础权限管理的基础框架 ,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 +> 管网运行监测系统WEB前端,系统管理模块基于基础权限管理的基础框架,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 -本项目源于vue-element-admin,一个极简的 vue admin 管理后台V4.4.0版本。 +本项目源于vue-element-admin。 -[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) ## 安装前提 1. 安装nodejs -去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包 +去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包, 建议版本不要超过14 安装完成之后,在cmd中检查Node.js版本,输出版本号则表示安装成功 @@ -56,11 +54,11 @@ ## 浏览器支持情况 -主流浏览器和IE 10+. +主流浏览器和IE 11. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| --------- | --------- | --------- | --------- | -| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions +| IE | Edge | Firefox |Chrome | Safari | +|--------------| --------- | --------- | --------- |------| +| IE11(部分特性不支持) | 90+ | 80+ | 90+ |14+| ## License diff --git a/public/config/project.config.json b/public/config/project.config.json index f986319..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -4,6 +4,9 @@ "theme":"blue", "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", + "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", + "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", + "mapType": "gaode", "singleSys": true, "refreshType":"websocket", "showPointType":"massMarkers", diff --git a/src/api/base/tenant.js b/src/api/base/tenant.js deleted file mode 100644 index 9ad9f31..0000000 --- a/src/api/base/tenant.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 租户/项目列表 - */ -import request from '@/utils/request' - -// 项目列表查询 -export function getTenantList(params) { - return request({ - url: 'tenant/list', - method: 'get', - params - }) -} diff --git a/src/api/data/dataStatics.js b/src/api/data/dataStatics.js index b9ccd3d..e79dea3 100644 --- a/src/api/data/dataStatics.js +++ b/src/api/data/dataStatics.js @@ -49,7 +49,7 @@ // 离线设备数量 export function deviceStaticsByOnline(params) { return request({ - url: 'statics/deviceCountByOnlineStatus', + url: 'statics/deviceStaticsByStatus', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 7274ede..bee92d0 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -4,7 +4,7 @@ import request from '@/utils/request' import qs from 'qs' -// 设备类别 +// 设备类别, 不分页全部 export function getDevice(params) { return request({ url: 'device/type', diff --git a/src/api/system/dict.js b/src/api/system/dict.js index 689b6b1..c2e7978 100644 --- a/src/api/system/dict.js +++ b/src/api/system/dict.js @@ -10,7 +10,14 @@ params }) } - +// 报警类型 +export function alarmType(params) { + return request({ + url: '/sys/dict/code/alarmType', + method: 'get', + params + }) +} // 添加字典 export function addDict(data) { return request({ diff --git a/src/api/system/tenant.js b/src/api/system/tenant.js index 4bf3350..863476c 100644 --- a/src/api/system/tenant.js +++ b/src/api/system/tenant.js @@ -1,28 +1,11 @@ /* - * 项目管理配置接口 + * 项目管理接口 */ import request from '@/utils/request' import qs from 'qs' -// 设备类别 -export function getDevice(params) { - return request({ - url: 'device/type', - method: 'get', - params - }) -} -// 项目管理绑定组织 -export function deptTenantSys(params) { - return request({ - url: 'bus/tenant/relateTenant', - method: 'post', - params - }) -} - // 项目管理查询 -export function tenantSysList(params) { +export function getTenantList(params) { return request({ url: 'bus/tenant/list', method: 'get', @@ -31,21 +14,31 @@ } // 添加项目管理 -export function addTenantSys(params) { +export function addTenant(data) { return request({ url: 'sys/tenant/add', method: 'post', - params + data }) } // 修改项目管理 -export function updateTenantSys(params) { +export function updateTenant(data) { return request({ url: 'sys/tenant/update', method: 'post', - params + data }) } + +// 修改项目管理 +export function relatedDept(data) { + return request({ + url: 'bus/tenant/relateTenant', + method: 'post', + data + }) +} + // 删除项目管理 export function delTenantSys(ids) { return request({ diff --git a/src/api/systemConfig/alarmContent.js b/src/api/systemConfig/alarmContent.js index bdefe72..486c3ce 100644 --- a/src/api/systemConfig/alarmContent.js +++ b/src/api/systemConfig/alarmContent.js @@ -22,31 +22,25 @@ } // 添加告警内容 -export function addAlarmContent(params) { +export function addAlarmContent(data) { return request({ - url: 'device/simManage/add', + url: 'alarmContent/add', method: 'post', - params + data }) } // 修改告警内容 export function updateAlarmContent(params) { return request({ - url: 'device/simManage/update', + url: 'alarmContent/update', method: 'post', params }) } // 删除告警内容 -export function delAlarmContent(ids) { +export function delAlarmContent(id) { return request({ - url: 'device/simManage/delete', - method: 'post', - params: { - ids: ids - }, - paramsSerializer: params => { - return qs.stringify(params, { indices: false }) - } + url: 'alarmContent/delete/' + id, + method: 'post' }) } diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..5b5057e 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -75,9 +75,11 @@ methods: { initMap() { const { vid, zoom, zooms, center, viewMode, mapStyle } = this - // 安全码 - window._AMapSecurityConfig = { - securityJsCode: this.$store.getters.amapSecurityCode + if (!window._AMapSecurityConfig) { + // 安全码 + window._AMapSecurityConfig = { + securityJsCode: this.$store.getters.amapSecurityCode + } } AMapLoader.load({ key: this.$store.getters.amapKey, // 秘钥,从store中取 @@ -91,7 +93,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +112,7 @@ component.$emit('ready', this.map) }) }).catch(e => { - this.$message.error('地图加载失败') + this.$message.error('地图加载失败:'+e) }) }, changeBaseLayer() { diff --git a/src/components/Amap/utils/convert-helper.js b/src/components/Amap/utils/convert-helper.js index 39ae214..6799041 100644 --- a/src/components/Amap/utils/convert-helper.js +++ b/src/components/Amap/utils/convert-helper.js @@ -1,3 +1,6 @@ +import store from '@/store' +import AMapLoader from '@amap/amap-jsapi-loader' + export function toPixel(arr) { return new window.AMap.Pixel(arr[0], arr[1]) } @@ -22,6 +25,72 @@ } /** + * 逆地址解析 + * @param coordinate 坐标数组[lng,lat] + * @returns {*[]} + */ +export function reverseLnglat(coordinate) { + let lnglat = [] + if (coordinate instanceof Array) { // 如果是Array[lng,lat] + lnglat = coordinate + } else if (coordinate instanceof String) { // 如果是字符串(lng,lat) + lnglat = coordinate.split(',') + } else if (coordinate instanceof Object) { + lnglat = [coordinate.lng, coordinate.lat] + } + return new Promise((resolve, reject) => { + if (lnglat.length === 2) { + AMapLoader.load({ + key: store.getters.amapKey // 秘钥 + }).then((AMap) => { + AMap.plugin('AMap.Geocoder', function() { + var geocoder = new AMap.Geocoder({ city: '' }) + geocoder.getAddress(lnglat, function(status, result) { + if (status === 'complete' && result.info === 'OK') { + resolve(result.regeocode) + // result为对应的地理位置详细信息 + } else { + reject('no address') + } + }) + }) + }).catch(error => { + reject(error) + }) + } else { + reject('no address') + } + }) +} + +/** + * 坐标系转换 + * @param coordinate 坐标数组[lng,lat] + */ +export function convertLnglat(coordinate) { + // 安全码 + window._AMapSecurityConfig = { + securityJsCode: store.getters.amapSecurityCode + } + return new Promise((resolve, reject) => { + AMapLoader.load({ + key: store.getters.amapKey // 秘钥 + }).then((AMap) => { + debugger + AMap.convertFrom(coordinate, 'gps', (status, result) => { + if (result.info === 'ok') { + const lnglats = result.locations[0] + resolve([lnglats.lng, lnglats.lat]) + // Array. + } else { + reject('convert error:' + result.info) + } + }) + }) + }) +} + +/** * @param arrs 二重数组 southWest, northEast */ export function toBounds(arrs) { diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 842f145..7f8def7 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -157,10 +157,10 @@ return [] } }, // 列 - // pagination: { - // type: Boolean, - // default: true - // }, // 是否分页 + pagination: { + type: Boolean, + default: true + }, // 是否分页 options: { type: Object, default: function() { @@ -195,8 +195,8 @@ columnsFiltered: [], // 过滤后的列情况 columnsChecked: [], // 显示列选择情况 visible: false, // 弹窗显示情况 - animateClass: '', // 按钮动画效果 - pagination: false // 是否显示分页 + animateClass: '' // 按钮动画效果 + // pagination: false // 是否显示分页 } }, watch: { @@ -213,11 +213,11 @@ methods: { // 初始化显示列状态 initColumnsState(paginationStatus) { - if (paginationStatus === true || paginationStatus === undefined) { - this.pagination = true - } else { - this.pagination = false - } + // if (paginationStatus === true || paginationStatus === undefined) { + // this.pagination = true + // } else { + // this.pagination = false + // } this.columnsChecked = [] for (const column of this.columns) { if (column.show === false) { diff --git a/src/main.js b/src/main.js index 5131944..cb309a1 100644 --- a/src/main.js +++ b/src/main.js @@ -97,6 +97,13 @@ Vue.prototype.baseConfig = result.data document.title = result.data.title // 首先设置网页的title service.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 + // 地图类型是高德的话,设置windowSecurity + // if (result.mapType === 'gaode') { + // window._AMapSecurityConfig = { + // securityJsCode: this.baseConfig.amapSecurityCode, + // key: this.baseConfig.amapKey + // } + // } setWsUrl(result.data.wsUrl) new Vue({ router, diff --git a/src/router/modules/config.js b/src/router/modules/config.js index 0ca7f44..c33329b 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -52,7 +52,7 @@ path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), - meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission'] } + meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } } ] }] diff --git a/src/router/modules/well.js b/src/router/modules/well.js index ef12852..17ed4e1 100644 --- a/src/router/modules/well.js +++ b/src/router/modules/well.js @@ -168,7 +168,7 @@ path: '/deviceType', name: 'DeviceType', component: () => import('@/views/deviceManage/deviceType/deviceType'), - meta: { title: '设备类型管理', icon: 'icon-config', permission: ['/deviceType/mange'] } + meta: { title: '设备类型管理', icon: 'icon-config', permission: ['/deviceType/listPage'] } }, { path: '/deviceModel', @@ -180,7 +180,7 @@ path: '/deviceImei', name: 'DeviceImei', component: () => import('@/views/deviceManage/deviceImei/deviceImei'), - meta: { title: '设备SIM卡号管理', icon: 'icon-config', permission: ['/device/imei'] } + meta: { title: '设备SIM卡号管理', icon: 'icon-config', permission: ['/device/simManage/listpage'] } } ] }, diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index 421e31b..318c03c 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -24,7 +24,6 @@ }, SET_BODY_HEIGHT: (state, height) => { state.bodyHeight = height - console.log('bodyHeight', height) } } diff --git a/README.md b/README.md index a93bd30..ae90135 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,19 @@ -# 智能闸井监测管理系统前端 +# 管网运行监测系统 -> 智能闸井监测管理系统WEB前端,系统管理模块基于基础权限管理的基础框架 ,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 +> 管网运行监测系统WEB前端,系统管理模块基于基础权限管理的基础框架,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 -本项目源于vue-element-admin,一个极简的 vue admin 管理后台V4.4.0版本。 +本项目源于vue-element-admin。 -[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) ## 安装前提 1. 安装nodejs -去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包 +去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包, 建议版本不要超过14 安装完成之后,在cmd中检查Node.js版本,输出版本号则表示安装成功 @@ -56,11 +54,11 @@ ## 浏览器支持情况 -主流浏览器和IE 10+. +主流浏览器和IE 11. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| --------- | --------- | --------- | --------- | -| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions +| IE | Edge | Firefox |Chrome | Safari | +|--------------| --------- | --------- | --------- |------| +| IE11(部分特性不支持) | 90+ | 80+ | 90+ |14+| ## License diff --git a/public/config/project.config.json b/public/config/project.config.json index f986319..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -4,6 +4,9 @@ "theme":"blue", "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", + "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", + "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", + "mapType": "gaode", "singleSys": true, "refreshType":"websocket", "showPointType":"massMarkers", diff --git a/src/api/base/tenant.js b/src/api/base/tenant.js deleted file mode 100644 index 9ad9f31..0000000 --- a/src/api/base/tenant.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 租户/项目列表 - */ -import request from '@/utils/request' - -// 项目列表查询 -export function getTenantList(params) { - return request({ - url: 'tenant/list', - method: 'get', - params - }) -} diff --git a/src/api/data/dataStatics.js b/src/api/data/dataStatics.js index b9ccd3d..e79dea3 100644 --- a/src/api/data/dataStatics.js +++ b/src/api/data/dataStatics.js @@ -49,7 +49,7 @@ // 离线设备数量 export function deviceStaticsByOnline(params) { return request({ - url: 'statics/deviceCountByOnlineStatus', + url: 'statics/deviceStaticsByStatus', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 7274ede..bee92d0 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -4,7 +4,7 @@ import request from '@/utils/request' import qs from 'qs' -// 设备类别 +// 设备类别, 不分页全部 export function getDevice(params) { return request({ url: 'device/type', diff --git a/src/api/system/dict.js b/src/api/system/dict.js index 689b6b1..c2e7978 100644 --- a/src/api/system/dict.js +++ b/src/api/system/dict.js @@ -10,7 +10,14 @@ params }) } - +// 报警类型 +export function alarmType(params) { + return request({ + url: '/sys/dict/code/alarmType', + method: 'get', + params + }) +} // 添加字典 export function addDict(data) { return request({ diff --git a/src/api/system/tenant.js b/src/api/system/tenant.js index 4bf3350..863476c 100644 --- a/src/api/system/tenant.js +++ b/src/api/system/tenant.js @@ -1,28 +1,11 @@ /* - * 项目管理配置接口 + * 项目管理接口 */ import request from '@/utils/request' import qs from 'qs' -// 设备类别 -export function getDevice(params) { - return request({ - url: 'device/type', - method: 'get', - params - }) -} -// 项目管理绑定组织 -export function deptTenantSys(params) { - return request({ - url: 'bus/tenant/relateTenant', - method: 'post', - params - }) -} - // 项目管理查询 -export function tenantSysList(params) { +export function getTenantList(params) { return request({ url: 'bus/tenant/list', method: 'get', @@ -31,21 +14,31 @@ } // 添加项目管理 -export function addTenantSys(params) { +export function addTenant(data) { return request({ url: 'sys/tenant/add', method: 'post', - params + data }) } // 修改项目管理 -export function updateTenantSys(params) { +export function updateTenant(data) { return request({ url: 'sys/tenant/update', method: 'post', - params + data }) } + +// 修改项目管理 +export function relatedDept(data) { + return request({ + url: 'bus/tenant/relateTenant', + method: 'post', + data + }) +} + // 删除项目管理 export function delTenantSys(ids) { return request({ diff --git a/src/api/systemConfig/alarmContent.js b/src/api/systemConfig/alarmContent.js index bdefe72..486c3ce 100644 --- a/src/api/systemConfig/alarmContent.js +++ b/src/api/systemConfig/alarmContent.js @@ -22,31 +22,25 @@ } // 添加告警内容 -export function addAlarmContent(params) { +export function addAlarmContent(data) { return request({ - url: 'device/simManage/add', + url: 'alarmContent/add', method: 'post', - params + data }) } // 修改告警内容 export function updateAlarmContent(params) { return request({ - url: 'device/simManage/update', + url: 'alarmContent/update', method: 'post', params }) } // 删除告警内容 -export function delAlarmContent(ids) { +export function delAlarmContent(id) { return request({ - url: 'device/simManage/delete', - method: 'post', - params: { - ids: ids - }, - paramsSerializer: params => { - return qs.stringify(params, { indices: false }) - } + url: 'alarmContent/delete/' + id, + method: 'post' }) } diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..5b5057e 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -75,9 +75,11 @@ methods: { initMap() { const { vid, zoom, zooms, center, viewMode, mapStyle } = this - // 安全码 - window._AMapSecurityConfig = { - securityJsCode: this.$store.getters.amapSecurityCode + if (!window._AMapSecurityConfig) { + // 安全码 + window._AMapSecurityConfig = { + securityJsCode: this.$store.getters.amapSecurityCode + } } AMapLoader.load({ key: this.$store.getters.amapKey, // 秘钥,从store中取 @@ -91,7 +93,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +112,7 @@ component.$emit('ready', this.map) }) }).catch(e => { - this.$message.error('地图加载失败') + this.$message.error('地图加载失败:'+e) }) }, changeBaseLayer() { diff --git a/src/components/Amap/utils/convert-helper.js b/src/components/Amap/utils/convert-helper.js index 39ae214..6799041 100644 --- a/src/components/Amap/utils/convert-helper.js +++ b/src/components/Amap/utils/convert-helper.js @@ -1,3 +1,6 @@ +import store from '@/store' +import AMapLoader from '@amap/amap-jsapi-loader' + export function toPixel(arr) { return new window.AMap.Pixel(arr[0], arr[1]) } @@ -22,6 +25,72 @@ } /** + * 逆地址解析 + * @param coordinate 坐标数组[lng,lat] + * @returns {*[]} + */ +export function reverseLnglat(coordinate) { + let lnglat = [] + if (coordinate instanceof Array) { // 如果是Array[lng,lat] + lnglat = coordinate + } else if (coordinate instanceof String) { // 如果是字符串(lng,lat) + lnglat = coordinate.split(',') + } else if (coordinate instanceof Object) { + lnglat = [coordinate.lng, coordinate.lat] + } + return new Promise((resolve, reject) => { + if (lnglat.length === 2) { + AMapLoader.load({ + key: store.getters.amapKey // 秘钥 + }).then((AMap) => { + AMap.plugin('AMap.Geocoder', function() { + var geocoder = new AMap.Geocoder({ city: '' }) + geocoder.getAddress(lnglat, function(status, result) { + if (status === 'complete' && result.info === 'OK') { + resolve(result.regeocode) + // result为对应的地理位置详细信息 + } else { + reject('no address') + } + }) + }) + }).catch(error => { + reject(error) + }) + } else { + reject('no address') + } + }) +} + +/** + * 坐标系转换 + * @param coordinate 坐标数组[lng,lat] + */ +export function convertLnglat(coordinate) { + // 安全码 + window._AMapSecurityConfig = { + securityJsCode: store.getters.amapSecurityCode + } + return new Promise((resolve, reject) => { + AMapLoader.load({ + key: store.getters.amapKey // 秘钥 + }).then((AMap) => { + debugger + AMap.convertFrom(coordinate, 'gps', (status, result) => { + if (result.info === 'ok') { + const lnglats = result.locations[0] + resolve([lnglats.lng, lnglats.lat]) + // Array. + } else { + reject('convert error:' + result.info) + } + }) + }) + }) +} + +/** * @param arrs 二重数组 southWest, northEast */ export function toBounds(arrs) { diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 842f145..7f8def7 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -157,10 +157,10 @@ return [] } }, // 列 - // pagination: { - // type: Boolean, - // default: true - // }, // 是否分页 + pagination: { + type: Boolean, + default: true + }, // 是否分页 options: { type: Object, default: function() { @@ -195,8 +195,8 @@ columnsFiltered: [], // 过滤后的列情况 columnsChecked: [], // 显示列选择情况 visible: false, // 弹窗显示情况 - animateClass: '', // 按钮动画效果 - pagination: false // 是否显示分页 + animateClass: '' // 按钮动画效果 + // pagination: false // 是否显示分页 } }, watch: { @@ -213,11 +213,11 @@ methods: { // 初始化显示列状态 initColumnsState(paginationStatus) { - if (paginationStatus === true || paginationStatus === undefined) { - this.pagination = true - } else { - this.pagination = false - } + // if (paginationStatus === true || paginationStatus === undefined) { + // this.pagination = true + // } else { + // this.pagination = false + // } this.columnsChecked = [] for (const column of this.columns) { if (column.show === false) { diff --git a/src/main.js b/src/main.js index 5131944..cb309a1 100644 --- a/src/main.js +++ b/src/main.js @@ -97,6 +97,13 @@ Vue.prototype.baseConfig = result.data document.title = result.data.title // 首先设置网页的title service.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 + // 地图类型是高德的话,设置windowSecurity + // if (result.mapType === 'gaode') { + // window._AMapSecurityConfig = { + // securityJsCode: this.baseConfig.amapSecurityCode, + // key: this.baseConfig.amapKey + // } + // } setWsUrl(result.data.wsUrl) new Vue({ router, diff --git a/src/router/modules/config.js b/src/router/modules/config.js index 0ca7f44..c33329b 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -52,7 +52,7 @@ path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), - meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission'] } + meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } } ] }] diff --git a/src/router/modules/well.js b/src/router/modules/well.js index ef12852..17ed4e1 100644 --- a/src/router/modules/well.js +++ b/src/router/modules/well.js @@ -168,7 +168,7 @@ path: '/deviceType', name: 'DeviceType', component: () => import('@/views/deviceManage/deviceType/deviceType'), - meta: { title: '设备类型管理', icon: 'icon-config', permission: ['/deviceType/mange'] } + meta: { title: '设备类型管理', icon: 'icon-config', permission: ['/deviceType/listPage'] } }, { path: '/deviceModel', @@ -180,7 +180,7 @@ path: '/deviceImei', name: 'DeviceImei', component: () => import('@/views/deviceManage/deviceImei/deviceImei'), - meta: { title: '设备SIM卡号管理', icon: 'icon-config', permission: ['/device/imei'] } + meta: { title: '设备SIM卡号管理', icon: 'icon-config', permission: ['/device/simManage/listpage'] } } ] }, diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index 421e31b..318c03c 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -24,7 +24,6 @@ }, SET_BODY_HEIGHT: (state, height) => { state.bodyHeight = height - console.log('bodyHeight', height) } } diff --git a/src/utils/dateutils.js b/src/utils/dateutils.js index 1abdc08..17cfdb9 100644 --- a/src/utils/dateutils.js +++ b/src/utils/dateutils.js @@ -33,7 +33,7 @@ export function getSearchLastWeekTime() { // 默认7天内 const startTime = getLastWeek().Format('yyyy-MM-dd hh:mm:ss') const endTime = getToday().Format('yyyy-MM-dd hh:mm:ss') - return { startTime, endTime } + return [startTime, endTime] } // 对Date的扩展,将 Date 转化为指定格式的String diff --git a/README.md b/README.md index a93bd30..ae90135 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,19 @@ -# 智能闸井监测管理系统前端 +# 管网运行监测系统 -> 智能闸井监测管理系统WEB前端,系统管理模块基于基础权限管理的基础框架 ,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 +> 管网运行监测系统WEB前端,系统管理模块基于基础权限管理的基础框架,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 -本项目源于vue-element-admin,一个极简的 vue admin 管理后台V4.4.0版本。 +本项目源于vue-element-admin。 -[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) ## 安装前提 1. 安装nodejs -去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包 +去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包, 建议版本不要超过14 安装完成之后,在cmd中检查Node.js版本,输出版本号则表示安装成功 @@ -56,11 +54,11 @@ ## 浏览器支持情况 -主流浏览器和IE 10+. +主流浏览器和IE 11. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| --------- | --------- | --------- | --------- | -| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions +| IE | Edge | Firefox |Chrome | Safari | +|--------------| --------- | --------- | --------- |------| +| IE11(部分特性不支持) | 90+ | 80+ | 90+ |14+| ## License diff --git a/public/config/project.config.json b/public/config/project.config.json index f986319..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -4,6 +4,9 @@ "theme":"blue", "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", + "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", + "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", + "mapType": "gaode", "singleSys": true, "refreshType":"websocket", "showPointType":"massMarkers", diff --git a/src/api/base/tenant.js b/src/api/base/tenant.js deleted file mode 100644 index 9ad9f31..0000000 --- a/src/api/base/tenant.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 租户/项目列表 - */ -import request from '@/utils/request' - -// 项目列表查询 -export function getTenantList(params) { - return request({ - url: 'tenant/list', - method: 'get', - params - }) -} diff --git a/src/api/data/dataStatics.js b/src/api/data/dataStatics.js index b9ccd3d..e79dea3 100644 --- a/src/api/data/dataStatics.js +++ b/src/api/data/dataStatics.js @@ -49,7 +49,7 @@ // 离线设备数量 export function deviceStaticsByOnline(params) { return request({ - url: 'statics/deviceCountByOnlineStatus', + url: 'statics/deviceStaticsByStatus', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 7274ede..bee92d0 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -4,7 +4,7 @@ import request from '@/utils/request' import qs from 'qs' -// 设备类别 +// 设备类别, 不分页全部 export function getDevice(params) { return request({ url: 'device/type', diff --git a/src/api/system/dict.js b/src/api/system/dict.js index 689b6b1..c2e7978 100644 --- a/src/api/system/dict.js +++ b/src/api/system/dict.js @@ -10,7 +10,14 @@ params }) } - +// 报警类型 +export function alarmType(params) { + return request({ + url: '/sys/dict/code/alarmType', + method: 'get', + params + }) +} // 添加字典 export function addDict(data) { return request({ diff --git a/src/api/system/tenant.js b/src/api/system/tenant.js index 4bf3350..863476c 100644 --- a/src/api/system/tenant.js +++ b/src/api/system/tenant.js @@ -1,28 +1,11 @@ /* - * 项目管理配置接口 + * 项目管理接口 */ import request from '@/utils/request' import qs from 'qs' -// 设备类别 -export function getDevice(params) { - return request({ - url: 'device/type', - method: 'get', - params - }) -} -// 项目管理绑定组织 -export function deptTenantSys(params) { - return request({ - url: 'bus/tenant/relateTenant', - method: 'post', - params - }) -} - // 项目管理查询 -export function tenantSysList(params) { +export function getTenantList(params) { return request({ url: 'bus/tenant/list', method: 'get', @@ -31,21 +14,31 @@ } // 添加项目管理 -export function addTenantSys(params) { +export function addTenant(data) { return request({ url: 'sys/tenant/add', method: 'post', - params + data }) } // 修改项目管理 -export function updateTenantSys(params) { +export function updateTenant(data) { return request({ url: 'sys/tenant/update', method: 'post', - params + data }) } + +// 修改项目管理 +export function relatedDept(data) { + return request({ + url: 'bus/tenant/relateTenant', + method: 'post', + data + }) +} + // 删除项目管理 export function delTenantSys(ids) { return request({ diff --git a/src/api/systemConfig/alarmContent.js b/src/api/systemConfig/alarmContent.js index bdefe72..486c3ce 100644 --- a/src/api/systemConfig/alarmContent.js +++ b/src/api/systemConfig/alarmContent.js @@ -22,31 +22,25 @@ } // 添加告警内容 -export function addAlarmContent(params) { +export function addAlarmContent(data) { return request({ - url: 'device/simManage/add', + url: 'alarmContent/add', method: 'post', - params + data }) } // 修改告警内容 export function updateAlarmContent(params) { return request({ - url: 'device/simManage/update', + url: 'alarmContent/update', method: 'post', params }) } // 删除告警内容 -export function delAlarmContent(ids) { +export function delAlarmContent(id) { return request({ - url: 'device/simManage/delete', - method: 'post', - params: { - ids: ids - }, - paramsSerializer: params => { - return qs.stringify(params, { indices: false }) - } + url: 'alarmContent/delete/' + id, + method: 'post' }) } diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..5b5057e 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -75,9 +75,11 @@ methods: { initMap() { const { vid, zoom, zooms, center, viewMode, mapStyle } = this - // 安全码 - window._AMapSecurityConfig = { - securityJsCode: this.$store.getters.amapSecurityCode + if (!window._AMapSecurityConfig) { + // 安全码 + window._AMapSecurityConfig = { + securityJsCode: this.$store.getters.amapSecurityCode + } } AMapLoader.load({ key: this.$store.getters.amapKey, // 秘钥,从store中取 @@ -91,7 +93,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +112,7 @@ component.$emit('ready', this.map) }) }).catch(e => { - this.$message.error('地图加载失败') + this.$message.error('地图加载失败:'+e) }) }, changeBaseLayer() { diff --git a/src/components/Amap/utils/convert-helper.js b/src/components/Amap/utils/convert-helper.js index 39ae214..6799041 100644 --- a/src/components/Amap/utils/convert-helper.js +++ b/src/components/Amap/utils/convert-helper.js @@ -1,3 +1,6 @@ +import store from '@/store' +import AMapLoader from '@amap/amap-jsapi-loader' + export function toPixel(arr) { return new window.AMap.Pixel(arr[0], arr[1]) } @@ -22,6 +25,72 @@ } /** + * 逆地址解析 + * @param coordinate 坐标数组[lng,lat] + * @returns {*[]} + */ +export function reverseLnglat(coordinate) { + let lnglat = [] + if (coordinate instanceof Array) { // 如果是Array[lng,lat] + lnglat = coordinate + } else if (coordinate instanceof String) { // 如果是字符串(lng,lat) + lnglat = coordinate.split(',') + } else if (coordinate instanceof Object) { + lnglat = [coordinate.lng, coordinate.lat] + } + return new Promise((resolve, reject) => { + if (lnglat.length === 2) { + AMapLoader.load({ + key: store.getters.amapKey // 秘钥 + }).then((AMap) => { + AMap.plugin('AMap.Geocoder', function() { + var geocoder = new AMap.Geocoder({ city: '' }) + geocoder.getAddress(lnglat, function(status, result) { + if (status === 'complete' && result.info === 'OK') { + resolve(result.regeocode) + // result为对应的地理位置详细信息 + } else { + reject('no address') + } + }) + }) + }).catch(error => { + reject(error) + }) + } else { + reject('no address') + } + }) +} + +/** + * 坐标系转换 + * @param coordinate 坐标数组[lng,lat] + */ +export function convertLnglat(coordinate) { + // 安全码 + window._AMapSecurityConfig = { + securityJsCode: store.getters.amapSecurityCode + } + return new Promise((resolve, reject) => { + AMapLoader.load({ + key: store.getters.amapKey // 秘钥 + }).then((AMap) => { + debugger + AMap.convertFrom(coordinate, 'gps', (status, result) => { + if (result.info === 'ok') { + const lnglats = result.locations[0] + resolve([lnglats.lng, lnglats.lat]) + // Array. + } else { + reject('convert error:' + result.info) + } + }) + }) + }) +} + +/** * @param arrs 二重数组 southWest, northEast */ export function toBounds(arrs) { diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 842f145..7f8def7 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -157,10 +157,10 @@ return [] } }, // 列 - // pagination: { - // type: Boolean, - // default: true - // }, // 是否分页 + pagination: { + type: Boolean, + default: true + }, // 是否分页 options: { type: Object, default: function() { @@ -195,8 +195,8 @@ columnsFiltered: [], // 过滤后的列情况 columnsChecked: [], // 显示列选择情况 visible: false, // 弹窗显示情况 - animateClass: '', // 按钮动画效果 - pagination: false // 是否显示分页 + animateClass: '' // 按钮动画效果 + // pagination: false // 是否显示分页 } }, watch: { @@ -213,11 +213,11 @@ methods: { // 初始化显示列状态 initColumnsState(paginationStatus) { - if (paginationStatus === true || paginationStatus === undefined) { - this.pagination = true - } else { - this.pagination = false - } + // if (paginationStatus === true || paginationStatus === undefined) { + // this.pagination = true + // } else { + // this.pagination = false + // } this.columnsChecked = [] for (const column of this.columns) { if (column.show === false) { diff --git a/src/main.js b/src/main.js index 5131944..cb309a1 100644 --- a/src/main.js +++ b/src/main.js @@ -97,6 +97,13 @@ Vue.prototype.baseConfig = result.data document.title = result.data.title // 首先设置网页的title service.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 + // 地图类型是高德的话,设置windowSecurity + // if (result.mapType === 'gaode') { + // window._AMapSecurityConfig = { + // securityJsCode: this.baseConfig.amapSecurityCode, + // key: this.baseConfig.amapKey + // } + // } setWsUrl(result.data.wsUrl) new Vue({ router, diff --git a/src/router/modules/config.js b/src/router/modules/config.js index 0ca7f44..c33329b 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -52,7 +52,7 @@ path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), - meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission'] } + meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } } ] }] diff --git a/src/router/modules/well.js b/src/router/modules/well.js index ef12852..17ed4e1 100644 --- a/src/router/modules/well.js +++ b/src/router/modules/well.js @@ -168,7 +168,7 @@ path: '/deviceType', name: 'DeviceType', component: () => import('@/views/deviceManage/deviceType/deviceType'), - meta: { title: '设备类型管理', icon: 'icon-config', permission: ['/deviceType/mange'] } + meta: { title: '设备类型管理', icon: 'icon-config', permission: ['/deviceType/listPage'] } }, { path: '/deviceModel', @@ -180,7 +180,7 @@ path: '/deviceImei', name: 'DeviceImei', component: () => import('@/views/deviceManage/deviceImei/deviceImei'), - meta: { title: '设备SIM卡号管理', icon: 'icon-config', permission: ['/device/imei'] } + meta: { title: '设备SIM卡号管理', icon: 'icon-config', permission: ['/device/simManage/listpage'] } } ] }, diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index 421e31b..318c03c 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -24,7 +24,6 @@ }, SET_BODY_HEIGHT: (state, height) => { state.bodyHeight = height - console.log('bodyHeight', height) } } diff --git a/src/utils/dateutils.js b/src/utils/dateutils.js index 1abdc08..17cfdb9 100644 --- a/src/utils/dateutils.js +++ b/src/utils/dateutils.js @@ -33,7 +33,7 @@ export function getSearchLastWeekTime() { // 默认7天内 const startTime = getLastWeek().Format('yyyy-MM-dd hh:mm:ss') const endTime = getToday().Format('yyyy-MM-dd hh:mm:ss') - return { startTime, endTime } + return [startTime, endTime] } // 对Date的扩展,将 Date 转化为指定格式的String diff --git a/src/views/alarmManage/components/HandlePrompt.vue b/src/views/alarmManage/components/HandlePrompt.vue index 9eb9a36..c2b0b01 100644 --- a/src/views/alarmManage/components/HandlePrompt.vue +++ b/src/views/alarmManage/components/HandlePrompt.vue @@ -68,8 +68,7 @@ }, methods: { // 初始化对话框 - initDialog: function(dialogFormVisible, jobId, isBatch, params) { - // debugger + initDialog: function(dialogFormVisible, id, isBatch, params) { this.dialogVisible = dialogFormVisible this.isBatch = isBatch if (isBatch) { @@ -79,7 +78,7 @@ this.formData.beginTime = params.beginTime this.formData.endTime = params.endTime } else { - this.formData.id = jobId + this.formData.id = id } }, handleClose(done) { diff --git a/README.md b/README.md index a93bd30..ae90135 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,19 @@ -# 智能闸井监测管理系统前端 +# 管网运行监测系统 -> 智能闸井监测管理系统WEB前端,系统管理模块基于基础权限管理的基础框架 ,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 +> 管网运行监测系统WEB前端,系统管理模块基于基础权限管理的基础框架,整个系统模块包括闸井状态总览、闸井管理、告警管理、工单管理、设备配置。 -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 -本项目源于vue-element-admin,一个极简的 vue admin 管理后台V4.4.0版本。 +本项目源于vue-element-admin。 -[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) ## 安装前提 1. 安装nodejs -去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包 +去[nodejs官网](https://nodejs.org/zh-cn/)下载安装包, 建议版本不要超过14 安装完成之后,在cmd中检查Node.js版本,输出版本号则表示安装成功 @@ -56,11 +54,11 @@ ## 浏览器支持情况 -主流浏览器和IE 10+. +主流浏览器和IE 11. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| --------- | --------- | --------- | --------- | -| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions +| IE | Edge | Firefox |Chrome | Safari | +|--------------| --------- | --------- | --------- |------| +| IE11(部分特性不支持) | 90+ | 80+ | 90+ |14+| ## License diff --git a/public/config/project.config.json b/public/config/project.config.json index f986319..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -4,6 +4,9 @@ "theme":"blue", "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", + "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", + "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", + "mapType": "gaode", "singleSys": true, "refreshType":"websocket", "showPointType":"massMarkers", diff --git a/src/api/base/tenant.js b/src/api/base/tenant.js deleted file mode 100644 index 9ad9f31..0000000 --- a/src/api/base/tenant.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 租户/项目列表 - */ -import request from '@/utils/request' - -// 项目列表查询 -export function getTenantList(params) { - return request({ - url: 'tenant/list', - method: 'get', - params - }) -} diff --git a/src/api/data/dataStatics.js b/src/api/data/dataStatics.js index b9ccd3d..e79dea3 100644 --- a/src/api/data/dataStatics.js +++ b/src/api/data/dataStatics.js @@ -49,7 +49,7 @@ // 离线设备数量 export function deviceStaticsByOnline(params) { return request({ - url: 'statics/deviceCountByOnlineStatus', + url: 'statics/deviceStaticsByStatus', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 7274ede..bee92d0 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -4,7 +4,7 @@ import request from '@/utils/request' import qs from 'qs' -// 设备类别 +// 设备类别, 不分页全部 export function getDevice(params) { return request({ url: 'device/type', diff --git a/src/api/system/dict.js b/src/api/system/dict.js index 689b6b1..c2e7978 100644 --- a/src/api/system/dict.js +++ b/src/api/system/dict.js @@ -10,7 +10,14 @@ params }) } - +// 报警类型 +export function alarmType(params) { + return request({ + url: '/sys/dict/code/alarmType', + method: 'get', + params + }) +} // 添加字典 export function addDict(data) { return request({ diff --git a/src/api/system/tenant.js b/src/api/system/tenant.js index 4bf3350..863476c 100644 --- a/src/api/system/tenant.js +++ b/src/api/system/tenant.js @@ -1,28 +1,11 @@ /* - * 项目管理配置接口 + * 项目管理接口 */ import request from '@/utils/request' import qs from 'qs' -// 设备类别 -export function getDevice(params) { - return request({ - url: 'device/type', - method: 'get', - params - }) -} -// 项目管理绑定组织 -export function deptTenantSys(params) { - return request({ - url: 'bus/tenant/relateTenant', - method: 'post', - params - }) -} - // 项目管理查询 -export function tenantSysList(params) { +export function getTenantList(params) { return request({ url: 'bus/tenant/list', method: 'get', @@ -31,21 +14,31 @@ } // 添加项目管理 -export function addTenantSys(params) { +export function addTenant(data) { return request({ url: 'sys/tenant/add', method: 'post', - params + data }) } // 修改项目管理 -export function updateTenantSys(params) { +export function updateTenant(data) { return request({ url: 'sys/tenant/update', method: 'post', - params + data }) } + +// 修改项目管理 +export function relatedDept(data) { + return request({ + url: 'bus/tenant/relateTenant', + method: 'post', + data + }) +} + // 删除项目管理 export function delTenantSys(ids) { return request({ diff --git a/src/api/systemConfig/alarmContent.js b/src/api/systemConfig/alarmContent.js index bdefe72..486c3ce 100644 --- a/src/api/systemConfig/alarmContent.js +++ b/src/api/systemConfig/alarmContent.js @@ -22,31 +22,25 @@ } // 添加告警内容 -export function addAlarmContent(params) { +export function addAlarmContent(data) { return request({ - url: 'device/simManage/add', + url: 'alarmContent/add', method: 'post', - params + data }) } // 修改告警内容 export function updateAlarmContent(params) { return request({ - url: 'device/simManage/update', + url: 'alarmContent/update', method: 'post', params }) } // 删除告警内容 -export function delAlarmContent(ids) { +export function delAlarmContent(id) { return request({ - url: 'device/simManage/delete', - method: 'post', - params: { - ids: ids - }, - paramsSerializer: params => { - return qs.stringify(params, { indices: false }) - } + url: 'alarmContent/delete/' + id, + method: 'post' }) } diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..5b5057e 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -75,9 +75,11 @@ methods: { initMap() { const { vid, zoom, zooms, center, viewMode, mapStyle } = this - // 安全码 - window._AMapSecurityConfig = { - securityJsCode: this.$store.getters.amapSecurityCode + if (!window._AMapSecurityConfig) { + // 安全码 + window._AMapSecurityConfig = { + securityJsCode: this.$store.getters.amapSecurityCode + } } AMapLoader.load({ key: this.$store.getters.amapKey, // 秘钥,从store中取 @@ -91,7 +93,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +112,7 @@ component.$emit('ready', this.map) }) }).catch(e => { - this.$message.error('地图加载失败') + this.$message.error('地图加载失败:'+e) }) }, changeBaseLayer() { diff --git a/src/components/Amap/utils/convert-helper.js b/src/components/Amap/utils/convert-helper.js index 39ae214..6799041 100644 --- a/src/components/Amap/utils/convert-helper.js +++ b/src/components/Amap/utils/convert-helper.js @@ -1,3 +1,6 @@ +import store from '@/store' +import AMapLoader from '@amap/amap-jsapi-loader' + export function toPixel(arr) { return new window.AMap.Pixel(arr[0], arr[1]) } @@ -22,6 +25,72 @@ } /** + * 逆地址解析 + * @param coordinate 坐标数组[lng,lat] + * @returns {*[]} + */ +export function reverseLnglat(coordinate) { + let lnglat = [] + if (coordinate instanceof Array) { // 如果是Array[lng,lat] + lnglat = coordinate + } else if (coordinate instanceof String) { // 如果是字符串(lng,lat) + lnglat = coordinate.split(',') + } else if (coordinate instanceof Object) { + lnglat = [coordinate.lng, coordinate.lat] + } + return new Promise((resolve, reject) => { + if (lnglat.length === 2) { + AMapLoader.load({ + key: store.getters.amapKey // 秘钥 + }).then((AMap) => { + AMap.plugin('AMap.Geocoder', function() { + var geocoder = new AMap.Geocoder({ city: '' }) + geocoder.getAddress(lnglat, function(status, result) { + if (status === 'complete' && result.info === 'OK') { + resolve(result.regeocode) + // result为对应的地理位置详细信息 + } else { + reject('no address') + } + }) + }) + }).catch(error => { + reject(error) + }) + } else { + reject('no address') + } + }) +} + +/** + * 坐标系转换 + * @param coordinate 坐标数组[lng,lat] + */ +export function convertLnglat(coordinate) { + // 安全码 + window._AMapSecurityConfig = { + securityJsCode: store.getters.amapSecurityCode + } + return new Promise((resolve, reject) => { + AMapLoader.load({ + key: store.getters.amapKey // 秘钥 + }).then((AMap) => { + debugger + AMap.convertFrom(coordinate, 'gps', (status, result) => { + if (result.info === 'ok') { + const lnglats = result.locations[0] + resolve([lnglats.lng, lnglats.lat]) + // Array. + } else { + reject('convert error:' + result.info) + } + }) + }) + }) +} + +/** * @param arrs 二重数组 southWest, northEast */ export function toBounds(arrs) { diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 842f145..7f8def7 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -157,10 +157,10 @@ return [] } }, // 列 - // pagination: { - // type: Boolean, - // default: true - // }, // 是否分页 + pagination: { + type: Boolean, + default: true + }, // 是否分页 options: { type: Object, default: function() { @@ -195,8 +195,8 @@ columnsFiltered: [], // 过滤后的列情况 columnsChecked: [], // 显示列选择情况 visible: false, // 弹窗显示情况 - animateClass: '', // 按钮动画效果 - pagination: false // 是否显示分页 + animateClass: '' // 按钮动画效果 + // pagination: false // 是否显示分页 } }, watch: { @@ -213,11 +213,11 @@ methods: { // 初始化显示列状态 initColumnsState(paginationStatus) { - if (paginationStatus === true || paginationStatus === undefined) { - this.pagination = true - } else { - this.pagination = false - } + // if (paginationStatus === true || paginationStatus === undefined) { + // this.pagination = true + // } else { + // this.pagination = false + // } this.columnsChecked = [] for (const column of this.columns) { if (column.show === false) { diff --git a/src/main.js b/src/main.js index 5131944..cb309a1 100644 --- a/src/main.js +++ b/src/main.js @@ -97,6 +97,13 @@ Vue.prototype.baseConfig = result.data document.title = result.data.title // 首先设置网页的title service.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 + // 地图类型是高德的话,设置windowSecurity + // if (result.mapType === 'gaode') { + // window._AMapSecurityConfig = { + // securityJsCode: this.baseConfig.amapSecurityCode, + // key: this.baseConfig.amapKey + // } + // } setWsUrl(result.data.wsUrl) new Vue({ router, diff --git a/src/router/modules/config.js b/src/router/modules/config.js index 0ca7f44..c33329b 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -52,7 +52,7 @@ path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), - meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission'] } + meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } } ] }] diff --git a/src/router/modules/well.js b/src/router/modules/well.js index ef12852..17ed4e1 100644 --- a/src/router/modules/well.js +++ b/src/router/modules/well.js @@ -168,7 +168,7 @@ path: '/deviceType', name: 'DeviceType', component: () => import('@/views/deviceManage/deviceType/deviceType'), - meta: { title: '设备类型管理', icon: 'icon-config', permission: ['/deviceType/mange'] } + meta: { title: '设备类型管理', icon: 'icon-config', permission: ['/deviceType/listPage'] } }, { path: '/deviceModel', @@ -180,7 +180,7 @@ path: '/deviceImei', name: 'DeviceImei', component: () => import('@/views/deviceManage/deviceImei/deviceImei'), - meta: { title: '设备SIM卡号管理', icon: 'icon-config', permission: ['/device/imei'] } + meta: { title: '设备SIM卡号管理', icon: 'icon-config', permission: ['/device/simManage/listpage'] } } ] }, diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index 421e31b..318c03c 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -24,7 +24,6 @@ }, SET_BODY_HEIGHT: (state, height) => { state.bodyHeight = height - console.log('bodyHeight', height) } } diff --git a/src/utils/dateutils.js b/src/utils/dateutils.js index 1abdc08..17cfdb9 100644 --- a/src/utils/dateutils.js +++ b/src/utils/dateutils.js @@ -33,7 +33,7 @@ export function getSearchLastWeekTime() { // 默认7天内 const startTime = getLastWeek().Format('yyyy-MM-dd hh:mm:ss') const endTime = getToday().Format('yyyy-MM-dd hh:mm:ss') - return { startTime, endTime } + return [startTime, endTime] } // 对Date的扩展,将 Date 转化为指定格式的String diff --git a/src/views/alarmManage/components/HandlePrompt.vue b/src/views/alarmManage/components/HandlePrompt.vue index 9eb9a36..c2b0b01 100644 --- a/src/views/alarmManage/components/HandlePrompt.vue +++ b/src/views/alarmManage/components/HandlePrompt.vue @@ -68,8 +68,7 @@ }, methods: { // 初始化对话框 - initDialog: function(dialogFormVisible, jobId, isBatch, params) { - // debugger + initDialog: function(dialogFormVisible, id, isBatch, params) { this.dialogVisible = dialogFormVisible this.isBatch = isBatch if (isBatch) { @@ -79,7 +78,7 @@ this.formData.beginTime = params.beginTime this.formData.endTime = params.endTime } else { - this.formData.id = jobId + this.formData.id = id } }, handleClose(done) { diff --git a/src/views/alarmManage/listAlarmNow.vue b/src/views/alarmManage/listAlarmNow.vue index 39b3ff4..f50de80 100644 --- a/src/views/alarmManage/listAlarmNow.vue +++ b/src/views/alarmManage/listAlarmNow.vue @@ -59,16 +59,25 @@ - - + + + - +