diff --git a/public/config/project.config.json b/public/config/project.config.json index 2e9b76b..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,8 +2,11 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "http://192.168.83.40:11309", + "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/public/config/project.config.json b/public/config/project.config.json index 2e9b76b..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,8 +2,11 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "http://192.168.83.40:11309", + "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/public/config/project.config.json b/public/config/project.config.json index 2e9b76b..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,8 +2,11 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "http://192.168.83.40:11309", + "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/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/public/config/project.config.json b/public/config/project.config.json index 2e9b76b..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,8 +2,11 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "http://192.168.83.40:11309", + "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/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/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..7348e02 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -91,7 +91,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +110,7 @@ component.$emit('ready', this.map) }) }).catch(e => { - this.$message.error('地图加载失败') + this.$message.error('地图加载失败:'+e) }) }, changeBaseLayer() { diff --git a/public/config/project.config.json b/public/config/project.config.json index 2e9b76b..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,8 +2,11 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "http://192.168.83.40:11309", + "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/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/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..7348e02 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -91,7 +91,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +110,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/public/config/project.config.json b/public/config/project.config.json index 2e9b76b..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,8 +2,11 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "http://192.168.83.40:11309", + "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/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/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..7348e02 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -91,7 +91,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +110,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/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/public/config/project.config.json b/public/config/project.config.json index 2e9b76b..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,8 +2,11 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "http://192.168.83.40:11309", + "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/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/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..7348e02 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -91,7 +91,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +110,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/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/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/public/config/project.config.json b/public/config/project.config.json index 2e9b76b..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,8 +2,11 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "http://192.168.83.40:11309", + "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/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/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..7348e02 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -91,7 +91,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +110,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/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/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/public/config/project.config.json b/public/config/project.config.json index 2e9b76b..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,8 +2,11 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "http://192.168.83.40:11309", + "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/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/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..7348e02 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -91,7 +91,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +110,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/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/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/dataManage/deviceData/listDigData.vue b/src/views/dataManage/deviceData/listDigData.vue index c3acf3e..815c715 100644 --- a/src/views/dataManage/deviceData/listDigData.vue +++ b/src/views/dataManage/deviceData/listDigData.vue @@ -3,7 +3,7 @@ - + { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +110,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/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/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/dataManage/deviceData/listDigData.vue b/src/views/dataManage/deviceData/listDigData.vue index c3acf3e..815c715 100644 --- a/src/views/dataManage/deviceData/listDigData.vue +++ b/src/views/dataManage/deviceData/listDigData.vue @@ -3,7 +3,7 @@ - + - + { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +110,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/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/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/dataManage/deviceData/listDigData.vue b/src/views/dataManage/deviceData/listDigData.vue index c3acf3e..815c715 100644 --- a/src/views/dataManage/deviceData/listDigData.vue +++ b/src/views/dataManage/deviceData/listDigData.vue @@ -3,7 +3,7 @@ - + - + { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +110,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/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/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/dataManage/deviceData/listDigData.vue b/src/views/dataManage/deviceData/listDigData.vue index c3acf3e..815c715 100644 --- a/src/views/dataManage/deviceData/listDigData.vue +++ b/src/views/dataManage/deviceData/listDigData.vue @@ -3,7 +3,7 @@ - + - + { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +110,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/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/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/dataManage/deviceData/listDigData.vue b/src/views/dataManage/deviceData/listDigData.vue index c3acf3e..815c715 100644 --- a/src/views/dataManage/deviceData/listDigData.vue +++ b/src/views/dataManage/deviceData/listDigData.vue @@ -3,7 +3,7 @@ - + - + { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +110,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/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/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/dataManage/deviceData/listDigData.vue b/src/views/dataManage/deviceData/listDigData.vue index c3acf3e..815c715 100644 --- a/src/views/dataManage/deviceData/listDigData.vue +++ b/src/views/dataManage/deviceData/listDigData.vue @@ -3,7 +3,7 @@ - + - + { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +110,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/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/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/dataManage/deviceData/listDigData.vue b/src/views/dataManage/deviceData/listDigData.vue index c3acf3e..815c715 100644 --- a/src/views/dataManage/deviceData/listDigData.vue +++ b/src/views/dataManage/deviceData/listDigData.vue @@ -3,7 +3,7 @@ - + - + { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +110,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/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/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/dataManage/deviceData/listDigData.vue b/src/views/dataManage/deviceData/listDigData.vue index c3acf3e..815c715 100644 --- a/src/views/dataManage/deviceData/listDigData.vue +++ b/src/views/dataManage/deviceData/listDigData.vue @@ -3,7 +3,7 @@ - + - + - - + + - - + + - - - + - - - + + + + + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + - + @@ -92,6 +103,7 @@ return { dialogFormVisible: false, // 对话框是否显示 dialogStatus: '', // 对话框类型:create,update,detail + showData: false, // 是否显示近期数据 cmpName: '', // 组件名称 deviceForm: { id: '', @@ -109,6 +121,20 @@ create: '新增', detail: '详情' }, // 表头显示标题 + compDict: { + '1': 'list-wellcover-data', + '2': 'list-liquid-data', + '3': 'list-harmful-data', + '4': 'list-gas-data', + '5': 'list-temp-hum-data', + '6': 'list-dig-data', + '7': 'list-well-loca-data', + '8': 'list-noise-data', + '9': 'list-temp-press-data', + '10': 'list-liquid-gas-data', + '11': 'list-hydrant-data', + '12': 'list-tube-data' + }, // 组件对照表 deviceTypeList: null, // 设备类型列表 deviceModelList: null // 设备型号列表 } @@ -123,40 +149,22 @@ id: row.id, deviceName: row.deviceName, devcode: row.devcode, - deviceType: row.deviceType, - modelId: row.modelId, + deviceTypeName: row.deviceTypeName, wellCode: row.wellCode, - concenCode: row.concenCode, + modelName: row.modelName, installDate: row.installDate, - installHeight: row.installHeight + concenCode: row.concenCode, + onlineStateName: row.onlineStateName, + deptName: row.deptName, + bfztName: row.bfztName, + position: row.position } // 展示相对应的设备列表组件 - if (row.deviceTypeName === '开挖监测仪') { - this.cmpName = 'list-dig-data' - } else if (row.deviceTypeName === '井盖状态监测仪') { - this.cmpName = 'list-well-data' - } else if (row.deviceTypeName === '液位监测仪') { - this.cmpName = 'list-liquid-data' - } else if (row.deviceTypeName === '燃气智能监测终端') { - this.cmpName = 'list-gas-data' - } else if (row.deviceTypeName === '噪声记录仪') { - this.cmpName = 'list-noise-data' - } else if (row.deviceTypeName === '有害气体监测仪') { - this.cmpName = 'list-harmful-data' - } else if (row.deviceTypeName === '温湿度监测仪') { - this.cmpName = 'list-temp-data' - } else if (row.deviceTypeName === '井盖定位监测仪') { - this.cmpName = 'list-well-loca-data' - } else if (row.deviceTypeName === '燃气智能终端(一体化)') { - this.cmpName = 'list-liquid-gas-data' - } else if (row.deviceTypeName === '管盯') { - this.cmpName = 'list-tube-data' - } + this.cmpName = this.compDict[row.deviceType] setTimeout(() => { this.$refs.deviceTypeDialog.initData(row) }, 100) }, - fetchDeviceList() {}, // 重置表单 resetForm() { this.deviceForm = { diff --git a/public/config/project.config.json b/public/config/project.config.json index 2e9b76b..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,8 +2,11 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "http://192.168.83.40:11309", + "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/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/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..7348e02 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -91,7 +91,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +110,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/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/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/dataManage/deviceData/listDigData.vue b/src/views/dataManage/deviceData/listDigData.vue index c3acf3e..815c715 100644 --- a/src/views/dataManage/deviceData/listDigData.vue +++ b/src/views/dataManage/deviceData/listDigData.vue @@ -3,7 +3,7 @@ - + - + - - + + - - + + - - - + - - - + + + + + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + - + @@ -92,6 +103,7 @@ return { dialogFormVisible: false, // 对话框是否显示 dialogStatus: '', // 对话框类型:create,update,detail + showData: false, // 是否显示近期数据 cmpName: '', // 组件名称 deviceForm: { id: '', @@ -109,6 +121,20 @@ create: '新增', detail: '详情' }, // 表头显示标题 + compDict: { + '1': 'list-wellcover-data', + '2': 'list-liquid-data', + '3': 'list-harmful-data', + '4': 'list-gas-data', + '5': 'list-temp-hum-data', + '6': 'list-dig-data', + '7': 'list-well-loca-data', + '8': 'list-noise-data', + '9': 'list-temp-press-data', + '10': 'list-liquid-gas-data', + '11': 'list-hydrant-data', + '12': 'list-tube-data' + }, // 组件对照表 deviceTypeList: null, // 设备类型列表 deviceModelList: null // 设备型号列表 } @@ -123,40 +149,22 @@ id: row.id, deviceName: row.deviceName, devcode: row.devcode, - deviceType: row.deviceType, - modelId: row.modelId, + deviceTypeName: row.deviceTypeName, wellCode: row.wellCode, - concenCode: row.concenCode, + modelName: row.modelName, installDate: row.installDate, - installHeight: row.installHeight + concenCode: row.concenCode, + onlineStateName: row.onlineStateName, + deptName: row.deptName, + bfztName: row.bfztName, + position: row.position } // 展示相对应的设备列表组件 - if (row.deviceTypeName === '开挖监测仪') { - this.cmpName = 'list-dig-data' - } else if (row.deviceTypeName === '井盖状态监测仪') { - this.cmpName = 'list-well-data' - } else if (row.deviceTypeName === '液位监测仪') { - this.cmpName = 'list-liquid-data' - } else if (row.deviceTypeName === '燃气智能监测终端') { - this.cmpName = 'list-gas-data' - } else if (row.deviceTypeName === '噪声记录仪') { - this.cmpName = 'list-noise-data' - } else if (row.deviceTypeName === '有害气体监测仪') { - this.cmpName = 'list-harmful-data' - } else if (row.deviceTypeName === '温湿度监测仪') { - this.cmpName = 'list-temp-data' - } else if (row.deviceTypeName === '井盖定位监测仪') { - this.cmpName = 'list-well-loca-data' - } else if (row.deviceTypeName === '燃气智能终端(一体化)') { - this.cmpName = 'list-liquid-gas-data' - } else if (row.deviceTypeName === '管盯') { - this.cmpName = 'list-tube-data' - } + this.cmpName = this.compDict[row.deviceType] setTimeout(() => { this.$refs.deviceTypeDialog.initData(row) }, 100) }, - fetchDeviceList() {}, // 重置表单 resetForm() { this.deviceForm = { diff --git a/src/views/deviceManage/deviceType/components/editDeviceType.vue b/src/views/deviceManage/deviceType/components/editDeviceType.vue index bf0fc1d..895fa65 100644 --- a/src/views/deviceManage/deviceType/components/editDeviceType.vue +++ b/src/views/deviceManage/deviceType/components/editDeviceType.vue @@ -16,7 +16,7 @@ 设备类型编号 - + diff --git a/public/config/project.config.json b/public/config/project.config.json index 2e9b76b..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,8 +2,11 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "http://192.168.83.40:11309", + "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/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/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..7348e02 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -91,7 +91,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +110,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/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/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/dataManage/deviceData/listDigData.vue b/src/views/dataManage/deviceData/listDigData.vue index c3acf3e..815c715 100644 --- a/src/views/dataManage/deviceData/listDigData.vue +++ b/src/views/dataManage/deviceData/listDigData.vue @@ -3,7 +3,7 @@ - + - + - - + + - - + + - - - + - - - + + + + + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + - + @@ -92,6 +103,7 @@ return { dialogFormVisible: false, // 对话框是否显示 dialogStatus: '', // 对话框类型:create,update,detail + showData: false, // 是否显示近期数据 cmpName: '', // 组件名称 deviceForm: { id: '', @@ -109,6 +121,20 @@ create: '新增', detail: '详情' }, // 表头显示标题 + compDict: { + '1': 'list-wellcover-data', + '2': 'list-liquid-data', + '3': 'list-harmful-data', + '4': 'list-gas-data', + '5': 'list-temp-hum-data', + '6': 'list-dig-data', + '7': 'list-well-loca-data', + '8': 'list-noise-data', + '9': 'list-temp-press-data', + '10': 'list-liquid-gas-data', + '11': 'list-hydrant-data', + '12': 'list-tube-data' + }, // 组件对照表 deviceTypeList: null, // 设备类型列表 deviceModelList: null // 设备型号列表 } @@ -123,40 +149,22 @@ id: row.id, deviceName: row.deviceName, devcode: row.devcode, - deviceType: row.deviceType, - modelId: row.modelId, + deviceTypeName: row.deviceTypeName, wellCode: row.wellCode, - concenCode: row.concenCode, + modelName: row.modelName, installDate: row.installDate, - installHeight: row.installHeight + concenCode: row.concenCode, + onlineStateName: row.onlineStateName, + deptName: row.deptName, + bfztName: row.bfztName, + position: row.position } // 展示相对应的设备列表组件 - if (row.deviceTypeName === '开挖监测仪') { - this.cmpName = 'list-dig-data' - } else if (row.deviceTypeName === '井盖状态监测仪') { - this.cmpName = 'list-well-data' - } else if (row.deviceTypeName === '液位监测仪') { - this.cmpName = 'list-liquid-data' - } else if (row.deviceTypeName === '燃气智能监测终端') { - this.cmpName = 'list-gas-data' - } else if (row.deviceTypeName === '噪声记录仪') { - this.cmpName = 'list-noise-data' - } else if (row.deviceTypeName === '有害气体监测仪') { - this.cmpName = 'list-harmful-data' - } else if (row.deviceTypeName === '温湿度监测仪') { - this.cmpName = 'list-temp-data' - } else if (row.deviceTypeName === '井盖定位监测仪') { - this.cmpName = 'list-well-loca-data' - } else if (row.deviceTypeName === '燃气智能终端(一体化)') { - this.cmpName = 'list-liquid-gas-data' - } else if (row.deviceTypeName === '管盯') { - this.cmpName = 'list-tube-data' - } + this.cmpName = this.compDict[row.deviceType] setTimeout(() => { this.$refs.deviceTypeDialog.initData(row) }, 100) }, - fetchDeviceList() {}, // 重置表单 resetForm() { this.deviceForm = { diff --git a/src/views/deviceManage/deviceType/components/editDeviceType.vue b/src/views/deviceManage/deviceType/components/editDeviceType.vue index bf0fc1d..895fa65 100644 --- a/src/views/deviceManage/deviceType/components/editDeviceType.vue +++ b/src/views/deviceManage/deviceType/components/editDeviceType.vue @@ -16,7 +16,7 @@ 设备类型编号 - + diff --git a/src/views/deviceManage/editDevice.vue b/src/views/deviceManage/editDevice.vue index 31eb158..bac15b9 100644 --- a/src/views/deviceManage/editDevice.vue +++ b/src/views/deviceManage/editDevice.vue @@ -62,7 +62,7 @@ - + diff --git a/public/config/project.config.json b/public/config/project.config.json index 2e9b76b..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,8 +2,11 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "http://192.168.83.40:11309", + "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/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/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..7348e02 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -91,7 +91,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +110,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/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/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/dataManage/deviceData/listDigData.vue b/src/views/dataManage/deviceData/listDigData.vue index c3acf3e..815c715 100644 --- a/src/views/dataManage/deviceData/listDigData.vue +++ b/src/views/dataManage/deviceData/listDigData.vue @@ -3,7 +3,7 @@ - + - + - - + + - - + + - - - + - - - + + + + + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + - + @@ -92,6 +103,7 @@ return { dialogFormVisible: false, // 对话框是否显示 dialogStatus: '', // 对话框类型:create,update,detail + showData: false, // 是否显示近期数据 cmpName: '', // 组件名称 deviceForm: { id: '', @@ -109,6 +121,20 @@ create: '新增', detail: '详情' }, // 表头显示标题 + compDict: { + '1': 'list-wellcover-data', + '2': 'list-liquid-data', + '3': 'list-harmful-data', + '4': 'list-gas-data', + '5': 'list-temp-hum-data', + '6': 'list-dig-data', + '7': 'list-well-loca-data', + '8': 'list-noise-data', + '9': 'list-temp-press-data', + '10': 'list-liquid-gas-data', + '11': 'list-hydrant-data', + '12': 'list-tube-data' + }, // 组件对照表 deviceTypeList: null, // 设备类型列表 deviceModelList: null // 设备型号列表 } @@ -123,40 +149,22 @@ id: row.id, deviceName: row.deviceName, devcode: row.devcode, - deviceType: row.deviceType, - modelId: row.modelId, + deviceTypeName: row.deviceTypeName, wellCode: row.wellCode, - concenCode: row.concenCode, + modelName: row.modelName, installDate: row.installDate, - installHeight: row.installHeight + concenCode: row.concenCode, + onlineStateName: row.onlineStateName, + deptName: row.deptName, + bfztName: row.bfztName, + position: row.position } // 展示相对应的设备列表组件 - if (row.deviceTypeName === '开挖监测仪') { - this.cmpName = 'list-dig-data' - } else if (row.deviceTypeName === '井盖状态监测仪') { - this.cmpName = 'list-well-data' - } else if (row.deviceTypeName === '液位监测仪') { - this.cmpName = 'list-liquid-data' - } else if (row.deviceTypeName === '燃气智能监测终端') { - this.cmpName = 'list-gas-data' - } else if (row.deviceTypeName === '噪声记录仪') { - this.cmpName = 'list-noise-data' - } else if (row.deviceTypeName === '有害气体监测仪') { - this.cmpName = 'list-harmful-data' - } else if (row.deviceTypeName === '温湿度监测仪') { - this.cmpName = 'list-temp-data' - } else if (row.deviceTypeName === '井盖定位监测仪') { - this.cmpName = 'list-well-loca-data' - } else if (row.deviceTypeName === '燃气智能终端(一体化)') { - this.cmpName = 'list-liquid-gas-data' - } else if (row.deviceTypeName === '管盯') { - this.cmpName = 'list-tube-data' - } + this.cmpName = this.compDict[row.deviceType] setTimeout(() => { this.$refs.deviceTypeDialog.initData(row) }, 100) }, - fetchDeviceList() {}, // 重置表单 resetForm() { this.deviceForm = { diff --git a/src/views/deviceManage/deviceType/components/editDeviceType.vue b/src/views/deviceManage/deviceType/components/editDeviceType.vue index bf0fc1d..895fa65 100644 --- a/src/views/deviceManage/deviceType/components/editDeviceType.vue +++ b/src/views/deviceManage/deviceType/components/editDeviceType.vue @@ -16,7 +16,7 @@ 设备类型编号 - + diff --git a/src/views/deviceManage/editDevice.vue b/src/views/deviceManage/editDevice.vue index 31eb158..bac15b9 100644 --- a/src/views/deviceManage/editDevice.vue +++ b/src/views/deviceManage/editDevice.vue @@ -62,7 +62,7 @@ - + diff --git a/src/views/deviceManage/listDevice.vue b/src/views/deviceManage/listDevice.vue index 59030a3..14389ff 100644 --- a/src/views/deviceManage/listDevice.vue +++ b/src/views/deviceManage/listDevice.vue @@ -6,9 +6,6 @@ - - - { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +110,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/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/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/dataManage/deviceData/listDigData.vue b/src/views/dataManage/deviceData/listDigData.vue index c3acf3e..815c715 100644 --- a/src/views/dataManage/deviceData/listDigData.vue +++ b/src/views/dataManage/deviceData/listDigData.vue @@ -3,7 +3,7 @@ - + - + - - + + - - + + - - - + - - - + + + + + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + - + @@ -92,6 +103,7 @@ return { dialogFormVisible: false, // 对话框是否显示 dialogStatus: '', // 对话框类型:create,update,detail + showData: false, // 是否显示近期数据 cmpName: '', // 组件名称 deviceForm: { id: '', @@ -109,6 +121,20 @@ create: '新增', detail: '详情' }, // 表头显示标题 + compDict: { + '1': 'list-wellcover-data', + '2': 'list-liquid-data', + '3': 'list-harmful-data', + '4': 'list-gas-data', + '5': 'list-temp-hum-data', + '6': 'list-dig-data', + '7': 'list-well-loca-data', + '8': 'list-noise-data', + '9': 'list-temp-press-data', + '10': 'list-liquid-gas-data', + '11': 'list-hydrant-data', + '12': 'list-tube-data' + }, // 组件对照表 deviceTypeList: null, // 设备类型列表 deviceModelList: null // 设备型号列表 } @@ -123,40 +149,22 @@ id: row.id, deviceName: row.deviceName, devcode: row.devcode, - deviceType: row.deviceType, - modelId: row.modelId, + deviceTypeName: row.deviceTypeName, wellCode: row.wellCode, - concenCode: row.concenCode, + modelName: row.modelName, installDate: row.installDate, - installHeight: row.installHeight + concenCode: row.concenCode, + onlineStateName: row.onlineStateName, + deptName: row.deptName, + bfztName: row.bfztName, + position: row.position } // 展示相对应的设备列表组件 - if (row.deviceTypeName === '开挖监测仪') { - this.cmpName = 'list-dig-data' - } else if (row.deviceTypeName === '井盖状态监测仪') { - this.cmpName = 'list-well-data' - } else if (row.deviceTypeName === '液位监测仪') { - this.cmpName = 'list-liquid-data' - } else if (row.deviceTypeName === '燃气智能监测终端') { - this.cmpName = 'list-gas-data' - } else if (row.deviceTypeName === '噪声记录仪') { - this.cmpName = 'list-noise-data' - } else if (row.deviceTypeName === '有害气体监测仪') { - this.cmpName = 'list-harmful-data' - } else if (row.deviceTypeName === '温湿度监测仪') { - this.cmpName = 'list-temp-data' - } else if (row.deviceTypeName === '井盖定位监测仪') { - this.cmpName = 'list-well-loca-data' - } else if (row.deviceTypeName === '燃气智能终端(一体化)') { - this.cmpName = 'list-liquid-gas-data' - } else if (row.deviceTypeName === '管盯') { - this.cmpName = 'list-tube-data' - } + this.cmpName = this.compDict[row.deviceType] setTimeout(() => { this.$refs.deviceTypeDialog.initData(row) }, 100) }, - fetchDeviceList() {}, // 重置表单 resetForm() { this.deviceForm = { diff --git a/src/views/deviceManage/deviceType/components/editDeviceType.vue b/src/views/deviceManage/deviceType/components/editDeviceType.vue index bf0fc1d..895fa65 100644 --- a/src/views/deviceManage/deviceType/components/editDeviceType.vue +++ b/src/views/deviceManage/deviceType/components/editDeviceType.vue @@ -16,7 +16,7 @@ 设备类型编号 - + diff --git a/src/views/deviceManage/editDevice.vue b/src/views/deviceManage/editDevice.vue index 31eb158..bac15b9 100644 --- a/src/views/deviceManage/editDevice.vue +++ b/src/views/deviceManage/editDevice.vue @@ -62,7 +62,7 @@ - + diff --git a/src/views/deviceManage/listDevice.vue b/src/views/deviceManage/listDevice.vue index 59030a3..14389ff 100644 --- a/src/views/deviceManage/listDevice.vue +++ b/src/views/deviceManage/listDevice.vue @@ -6,9 +6,6 @@ - - - { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +110,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/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/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/dataManage/deviceData/listDigData.vue b/src/views/dataManage/deviceData/listDigData.vue index c3acf3e..815c715 100644 --- a/src/views/dataManage/deviceData/listDigData.vue +++ b/src/views/dataManage/deviceData/listDigData.vue @@ -3,7 +3,7 @@ - + - + - - + + - - + + - - - + - - - + + + + + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + - + @@ -92,6 +103,7 @@ return { dialogFormVisible: false, // 对话框是否显示 dialogStatus: '', // 对话框类型:create,update,detail + showData: false, // 是否显示近期数据 cmpName: '', // 组件名称 deviceForm: { id: '', @@ -109,6 +121,20 @@ create: '新增', detail: '详情' }, // 表头显示标题 + compDict: { + '1': 'list-wellcover-data', + '2': 'list-liquid-data', + '3': 'list-harmful-data', + '4': 'list-gas-data', + '5': 'list-temp-hum-data', + '6': 'list-dig-data', + '7': 'list-well-loca-data', + '8': 'list-noise-data', + '9': 'list-temp-press-data', + '10': 'list-liquid-gas-data', + '11': 'list-hydrant-data', + '12': 'list-tube-data' + }, // 组件对照表 deviceTypeList: null, // 设备类型列表 deviceModelList: null // 设备型号列表 } @@ -123,40 +149,22 @@ id: row.id, deviceName: row.deviceName, devcode: row.devcode, - deviceType: row.deviceType, - modelId: row.modelId, + deviceTypeName: row.deviceTypeName, wellCode: row.wellCode, - concenCode: row.concenCode, + modelName: row.modelName, installDate: row.installDate, - installHeight: row.installHeight + concenCode: row.concenCode, + onlineStateName: row.onlineStateName, + deptName: row.deptName, + bfztName: row.bfztName, + position: row.position } // 展示相对应的设备列表组件 - if (row.deviceTypeName === '开挖监测仪') { - this.cmpName = 'list-dig-data' - } else if (row.deviceTypeName === '井盖状态监测仪') { - this.cmpName = 'list-well-data' - } else if (row.deviceTypeName === '液位监测仪') { - this.cmpName = 'list-liquid-data' - } else if (row.deviceTypeName === '燃气智能监测终端') { - this.cmpName = 'list-gas-data' - } else if (row.deviceTypeName === '噪声记录仪') { - this.cmpName = 'list-noise-data' - } else if (row.deviceTypeName === '有害气体监测仪') { - this.cmpName = 'list-harmful-data' - } else if (row.deviceTypeName === '温湿度监测仪') { - this.cmpName = 'list-temp-data' - } else if (row.deviceTypeName === '井盖定位监测仪') { - this.cmpName = 'list-well-loca-data' - } else if (row.deviceTypeName === '燃气智能终端(一体化)') { - this.cmpName = 'list-liquid-gas-data' - } else if (row.deviceTypeName === '管盯') { - this.cmpName = 'list-tube-data' - } + this.cmpName = this.compDict[row.deviceType] setTimeout(() => { this.$refs.deviceTypeDialog.initData(row) }, 100) }, - fetchDeviceList() {}, // 重置表单 resetForm() { this.deviceForm = { diff --git a/src/views/deviceManage/deviceType/components/editDeviceType.vue b/src/views/deviceManage/deviceType/components/editDeviceType.vue index bf0fc1d..895fa65 100644 --- a/src/views/deviceManage/deviceType/components/editDeviceType.vue +++ b/src/views/deviceManage/deviceType/components/editDeviceType.vue @@ -16,7 +16,7 @@ 设备类型编号 - + diff --git a/src/views/deviceManage/editDevice.vue b/src/views/deviceManage/editDevice.vue index 31eb158..bac15b9 100644 --- a/src/views/deviceManage/editDevice.vue +++ b/src/views/deviceManage/editDevice.vue @@ -62,7 +62,7 @@ - + diff --git a/src/views/deviceManage/listDevice.vue b/src/views/deviceManage/listDevice.vue index 59030a3..14389ff 100644 --- a/src/views/deviceManage/listDevice.vue +++ b/src/views/deviceManage/listDevice.vue @@ -6,9 +6,6 @@ - - - - + @@ -94,15 +94,14 @@ - - diff --git a/public/config/project.config.json b/public/config/project.config.json index 2e9b76b..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,8 +2,11 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "http://192.168.83.40:11309", + "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/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/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..7348e02 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -91,7 +91,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +110,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/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/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/dataManage/deviceData/listDigData.vue b/src/views/dataManage/deviceData/listDigData.vue index c3acf3e..815c715 100644 --- a/src/views/dataManage/deviceData/listDigData.vue +++ b/src/views/dataManage/deviceData/listDigData.vue @@ -3,7 +3,7 @@ - + - + - - + + - - + + - - - + - - - + + + + + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + - + @@ -92,6 +103,7 @@ return { dialogFormVisible: false, // 对话框是否显示 dialogStatus: '', // 对话框类型:create,update,detail + showData: false, // 是否显示近期数据 cmpName: '', // 组件名称 deviceForm: { id: '', @@ -109,6 +121,20 @@ create: '新增', detail: '详情' }, // 表头显示标题 + compDict: { + '1': 'list-wellcover-data', + '2': 'list-liquid-data', + '3': 'list-harmful-data', + '4': 'list-gas-data', + '5': 'list-temp-hum-data', + '6': 'list-dig-data', + '7': 'list-well-loca-data', + '8': 'list-noise-data', + '9': 'list-temp-press-data', + '10': 'list-liquid-gas-data', + '11': 'list-hydrant-data', + '12': 'list-tube-data' + }, // 组件对照表 deviceTypeList: null, // 设备类型列表 deviceModelList: null // 设备型号列表 } @@ -123,40 +149,22 @@ id: row.id, deviceName: row.deviceName, devcode: row.devcode, - deviceType: row.deviceType, - modelId: row.modelId, + deviceTypeName: row.deviceTypeName, wellCode: row.wellCode, - concenCode: row.concenCode, + modelName: row.modelName, installDate: row.installDate, - installHeight: row.installHeight + concenCode: row.concenCode, + onlineStateName: row.onlineStateName, + deptName: row.deptName, + bfztName: row.bfztName, + position: row.position } // 展示相对应的设备列表组件 - if (row.deviceTypeName === '开挖监测仪') { - this.cmpName = 'list-dig-data' - } else if (row.deviceTypeName === '井盖状态监测仪') { - this.cmpName = 'list-well-data' - } else if (row.deviceTypeName === '液位监测仪') { - this.cmpName = 'list-liquid-data' - } else if (row.deviceTypeName === '燃气智能监测终端') { - this.cmpName = 'list-gas-data' - } else if (row.deviceTypeName === '噪声记录仪') { - this.cmpName = 'list-noise-data' - } else if (row.deviceTypeName === '有害气体监测仪') { - this.cmpName = 'list-harmful-data' - } else if (row.deviceTypeName === '温湿度监测仪') { - this.cmpName = 'list-temp-data' - } else if (row.deviceTypeName === '井盖定位监测仪') { - this.cmpName = 'list-well-loca-data' - } else if (row.deviceTypeName === '燃气智能终端(一体化)') { - this.cmpName = 'list-liquid-gas-data' - } else if (row.deviceTypeName === '管盯') { - this.cmpName = 'list-tube-data' - } + this.cmpName = this.compDict[row.deviceType] setTimeout(() => { this.$refs.deviceTypeDialog.initData(row) }, 100) }, - fetchDeviceList() {}, // 重置表单 resetForm() { this.deviceForm = { diff --git a/src/views/deviceManage/deviceType/components/editDeviceType.vue b/src/views/deviceManage/deviceType/components/editDeviceType.vue index bf0fc1d..895fa65 100644 --- a/src/views/deviceManage/deviceType/components/editDeviceType.vue +++ b/src/views/deviceManage/deviceType/components/editDeviceType.vue @@ -16,7 +16,7 @@ 设备类型编号 - + diff --git a/src/views/deviceManage/editDevice.vue b/src/views/deviceManage/editDevice.vue index 31eb158..bac15b9 100644 --- a/src/views/deviceManage/editDevice.vue +++ b/src/views/deviceManage/editDevice.vue @@ -62,7 +62,7 @@ - + diff --git a/src/views/deviceManage/listDevice.vue b/src/views/deviceManage/listDevice.vue index 59030a3..14389ff 100644 --- a/src/views/deviceManage/listDevice.vue +++ b/src/views/deviceManage/listDevice.vue @@ -6,9 +6,6 @@ - - - - + @@ -94,15 +94,14 @@ - - diff --git a/src/views/system/tenant/components/relateDept.vue b/src/views/system/tenant/components/relateDept.vue new file mode 100644 index 0000000..83e044d --- /dev/null +++ b/src/views/system/tenant/components/relateDept.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/public/config/project.config.json b/public/config/project.config.json index 2e9b76b..41a78d4 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,8 +2,11 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "http://192.168.83.40:11309", + "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/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/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue index b9510a6..7348e02 100644 --- a/src/components/Amap/AMapContainer.vue +++ b/src/components/Amap/AMapContainer.vue @@ -91,7 +91,9 @@ version: '2.0' } }).then((AMap) => { - window.AMap = AMap + if (!window.AMap) { + window.AMap = AMap + } /* eslint-disable */ const options = { viewMode: viewMode, @@ -108,7 +110,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/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/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/dataManage/deviceData/listDigData.vue b/src/views/dataManage/deviceData/listDigData.vue index c3acf3e..815c715 100644 --- a/src/views/dataManage/deviceData/listDigData.vue +++ b/src/views/dataManage/deviceData/listDigData.vue @@ -3,7 +3,7 @@ - + - + - - + + - - + + - - - + - - - + + + + + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + - + @@ -92,6 +103,7 @@ return { dialogFormVisible: false, // 对话框是否显示 dialogStatus: '', // 对话框类型:create,update,detail + showData: false, // 是否显示近期数据 cmpName: '', // 组件名称 deviceForm: { id: '', @@ -109,6 +121,20 @@ create: '新增', detail: '详情' }, // 表头显示标题 + compDict: { + '1': 'list-wellcover-data', + '2': 'list-liquid-data', + '3': 'list-harmful-data', + '4': 'list-gas-data', + '5': 'list-temp-hum-data', + '6': 'list-dig-data', + '7': 'list-well-loca-data', + '8': 'list-noise-data', + '9': 'list-temp-press-data', + '10': 'list-liquid-gas-data', + '11': 'list-hydrant-data', + '12': 'list-tube-data' + }, // 组件对照表 deviceTypeList: null, // 设备类型列表 deviceModelList: null // 设备型号列表 } @@ -123,40 +149,22 @@ id: row.id, deviceName: row.deviceName, devcode: row.devcode, - deviceType: row.deviceType, - modelId: row.modelId, + deviceTypeName: row.deviceTypeName, wellCode: row.wellCode, - concenCode: row.concenCode, + modelName: row.modelName, installDate: row.installDate, - installHeight: row.installHeight + concenCode: row.concenCode, + onlineStateName: row.onlineStateName, + deptName: row.deptName, + bfztName: row.bfztName, + position: row.position } // 展示相对应的设备列表组件 - if (row.deviceTypeName === '开挖监测仪') { - this.cmpName = 'list-dig-data' - } else if (row.deviceTypeName === '井盖状态监测仪') { - this.cmpName = 'list-well-data' - } else if (row.deviceTypeName === '液位监测仪') { - this.cmpName = 'list-liquid-data' - } else if (row.deviceTypeName === '燃气智能监测终端') { - this.cmpName = 'list-gas-data' - } else if (row.deviceTypeName === '噪声记录仪') { - this.cmpName = 'list-noise-data' - } else if (row.deviceTypeName === '有害气体监测仪') { - this.cmpName = 'list-harmful-data' - } else if (row.deviceTypeName === '温湿度监测仪') { - this.cmpName = 'list-temp-data' - } else if (row.deviceTypeName === '井盖定位监测仪') { - this.cmpName = 'list-well-loca-data' - } else if (row.deviceTypeName === '燃气智能终端(一体化)') { - this.cmpName = 'list-liquid-gas-data' - } else if (row.deviceTypeName === '管盯') { - this.cmpName = 'list-tube-data' - } + this.cmpName = this.compDict[row.deviceType] setTimeout(() => { this.$refs.deviceTypeDialog.initData(row) }, 100) }, - fetchDeviceList() {}, // 重置表单 resetForm() { this.deviceForm = { diff --git a/src/views/deviceManage/deviceType/components/editDeviceType.vue b/src/views/deviceManage/deviceType/components/editDeviceType.vue index bf0fc1d..895fa65 100644 --- a/src/views/deviceManage/deviceType/components/editDeviceType.vue +++ b/src/views/deviceManage/deviceType/components/editDeviceType.vue @@ -16,7 +16,7 @@ 设备类型编号 - + diff --git a/src/views/deviceManage/editDevice.vue b/src/views/deviceManage/editDevice.vue index 31eb158..bac15b9 100644 --- a/src/views/deviceManage/editDevice.vue +++ b/src/views/deviceManage/editDevice.vue @@ -62,7 +62,7 @@ - + diff --git a/src/views/deviceManage/listDevice.vue b/src/views/deviceManage/listDevice.vue index 59030a3..14389ff 100644 --- a/src/views/deviceManage/listDevice.vue +++ b/src/views/deviceManage/listDevice.vue @@ -6,9 +6,6 @@ - - - - + @@ -94,15 +94,14 @@ - - diff --git a/src/views/system/tenant/components/relateDept.vue b/src/views/system/tenant/components/relateDept.vue new file mode 100644 index 0000000..83e044d --- /dev/null +++ b/src/views/system/tenant/components/relateDept.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/src/views/system/tenant/tenantList.vue b/src/views/system/tenant/tenantList.vue index 472ceb1..1485510 100644 --- a/src/views/system/tenant/tenantList.vue +++ b/src/views/system/tenant/tenantList.vue @@ -44,17 +44,19 @@ - + + - - diff --git a/src/views/system/tenant/components/relateDept.vue b/src/views/system/tenant/components/relateDept.vue new file mode 100644 index 0000000..83e044d --- /dev/null +++ b/src/views/system/tenant/components/relateDept.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/src/views/system/tenant/tenantList.vue b/src/views/system/tenant/tenantList.vue index 472ceb1..1485510 100644 --- a/src/views/system/tenant/tenantList.vue +++ b/src/views/system/tenant/tenantList.vue @@ -44,17 +44,19 @@ - + + - - diff --git a/src/views/system/tenant/components/relateDept.vue b/src/views/system/tenant/components/relateDept.vue new file mode 100644 index 0000000..83e044d --- /dev/null +++ b/src/views/system/tenant/components/relateDept.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/src/views/system/tenant/tenantList.vue b/src/views/system/tenant/tenantList.vue index 472ceb1..1485510 100644 --- a/src/views/system/tenant/tenantList.vue +++ b/src/views/system/tenant/tenantList.vue @@ -44,17 +44,19 @@ - + + - - diff --git a/src/views/system/tenant/components/relateDept.vue b/src/views/system/tenant/components/relateDept.vue new file mode 100644 index 0000000..83e044d --- /dev/null +++ b/src/views/system/tenant/components/relateDept.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/src/views/system/tenant/tenantList.vue b/src/views/system/tenant/tenantList.vue index 472ceb1..1485510 100644 --- a/src/views/system/tenant/tenantList.vue +++ b/src/views/system/tenant/tenantList.vue @@ -44,17 +44,19 @@ - + + - - diff --git a/src/views/system/tenant/components/relateDept.vue b/src/views/system/tenant/components/relateDept.vue new file mode 100644 index 0000000..83e044d --- /dev/null +++ b/src/views/system/tenant/components/relateDept.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/src/views/system/tenant/tenantList.vue b/src/views/system/tenant/tenantList.vue index 472ceb1..1485510 100644 --- a/src/views/system/tenant/tenantList.vue +++ b/src/views/system/tenant/tenantList.vue @@ -44,17 +44,19 @@ - + + - - diff --git a/src/views/system/tenant/components/relateDept.vue b/src/views/system/tenant/components/relateDept.vue new file mode 100644 index 0000000..83e044d --- /dev/null +++ b/src/views/system/tenant/components/relateDept.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/src/views/system/tenant/tenantList.vue b/src/views/system/tenant/tenantList.vue index 472ceb1..1485510 100644 --- a/src/views/system/tenant/tenantList.vue +++ b/src/views/system/tenant/tenantList.vue @@ -44,17 +44,19 @@ - + +