diff --git a/ruoyi-ui/.env.production b/ruoyi-ui/.env.production index 3c72c94..37d1c63 100644 --- a/ruoyi-ui/.env.production +++ b/ruoyi-ui/.env.production @@ -6,3 +6,4 @@ ENV = 'production' # 若依管理系统/生产环境 VUE_APP_BASE_API = '/prod-api' + diff --git a/ruoyi-ui/src/api/board/index.js b/ruoyi-ui/src/api/board/index.js index 7209f86..e8ea968 100644 --- a/ruoyi-ui/src/api/board/index.js +++ b/ruoyi-ui/src/api/board/index.js @@ -117,3 +117,13 @@ export function importAccount(query) { data:query }) } + +// 导入台账 +export function getMapData(query) { + return request({ + // baseURL:'/monitoring-api', + url: '/business/tenant/getAliArea', + method: 'get', + params:query + }) +} diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index 55e7f5e..544df16 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -305,7 +305,7 @@ Router.prototype.replace = function push(location) { export default new Router({ base:'/hwsaas', - mode: 'history', // 去掉url中的# + mode: 'hash', // 去掉url中的# scrollBehavior: () => ({ y: 0 }), routes: constantRoutes }) diff --git a/ruoyi-ui/src/views/board/equipment/index.vue b/ruoyi-ui/src/views/board/equipment/index.vue index 3906950..c36e479 100644 --- a/ruoyi-ui/src/views/board/equipment/index.vue +++ b/ruoyi-ui/src/views/board/equipment/index.vue @@ -410,6 +410,10 @@ export default { this.$nextTick(() => { this.historyData = data.tableDataInfo.rows this.historyTh = data.mapName + if(Object.keys(data.mapName).includes('ts')){ + this.historyTh.ts = '时间' + } + console.log(this.historyTh) this.total = data.tableDataInfo.total }) } diff --git a/ruoyi-ui/src/views/board/index/index.vue b/ruoyi-ui/src/views/board/index/index.vue index 59c0dd7..da99adf 100644 --- a/ruoyi-ui/src/views/board/index/index.vue +++ b/ruoyi-ui/src/views/board/index/index.vue @@ -375,7 +375,8 @@ import { getTenantData, selectMonitorElectronic, selectDeviceByName, - exTableData + exTableData, + getMapData } from '@/api/board/index' import ChinaMapData from '@/utils/ChinaMapData.json' import gsByMap from '@/utils/map/gs_by.json' @@ -387,6 +388,15 @@ let markerIds = [] let polygons = [] let circles = [] const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 + +const isJSON = (str) => { + try { + JSON.parse(str); + return true; + } catch (e) { + return false; + } +} export default { components: { vueSeamlessScroll, @@ -561,8 +571,16 @@ export default { this.setTable3() this.setDeviceOperations() - let data = await axios.get(`https://geo.datav.aliyun.com/areas_v3/bound/${this.code}_full.json`) - let mapData = this.code === 100000 ? ChinaMapData : data.data + // let data = await axios.get(`https://geo.datav.aliyun.com/areas_v3/bound/${this.code}_full.json`) + // let data = await axios.get(`http://124.223.15.102:3333/componentLib/getMap?id=${this.code}`) + let {msg} = await getMapData({areaCode: this.code}) + let data + if(isJSON(msg)){ + data = JSON.parse(msg) + }else{ + data = '' + } + let mapData = this.code === 100000 ? ChinaMapData : data await this.getMap(mapData) this.chartClick() }, @@ -930,8 +948,16 @@ export default { mapData = {features: mapData.features.filter(v => v.properties.name === params.name)} } } else { - let data = await axios.get(`https://geo.datav.aliyun.com/areas_v3/bound/${this.code}_full.json`) - mapData = this.cityJson[params.dataIndex].properties.adcode === 100000 ? ChinaMapData : data.data + // let data = await axios.get(`https://geo.datav.aliyun.com/areas_v3/bound/${this.code}_full.json`) + // let data = await axios.get(`http://124.223.15.102:3333/componentLib/getMap?id=${this.code}`) + let {msg} = await getMapData({areaCode: this.code}) + let data + if(isJSON(msg)){ + data = JSON.parse(msg) + }else{ + data = '' + } + mapData = this.cityJson[params.dataIndex].properties.adcode === 100000 ? ChinaMapData : data } await this.getMap(mapData) }) @@ -966,8 +992,17 @@ export default { if (this.code !== 620400 && this.code.toString().startsWith('6204')) { mapData = gsByMap } else { - let data = await axios.get(`https://geo.datav.aliyun.com/areas_v3/bound/${this.code}_full.json`) - mapData = this.code === 100000 ? ChinaMapData : data.data + // let data = await axios.get(`https://geo.datav.aliyun.com/areas_v3/bound/${this.code}_full.json`) + // let data = await axios.get(`http://124.223.15.102:3333/componentLib/getMap?id=${this.code}`) + + let {msg} = await getMapData({areaCode: this.code}) + let data + if(isJSON(msg)){ + data = JSON.parse(msg) + }else{ + data = '' + } + mapData = this.code === 100000 ? ChinaMapData : data } this.getMap(mapData) },