Commit 8211eb250f0e6b46083af9de462b3733905ad12e
1 parent
e5b54e7a
'fix:修改一些静态图片打包后不能正常显示,设备页面的地图和地理位置的铆钉'
Showing
2 changed files
with
16 additions
and
13 deletions
| @@ -35,7 +35,7 @@ | @@ -35,7 +35,7 @@ | ||
| 35 | > | 35 | > |
| 36 | <BasicForm @register="registerForm" /> | 36 | <BasicForm @register="registerForm" /> |
| 37 | <Empty v-if="!isNull" /> | 37 | <Empty v-if="!isNull" /> |
| 38 | - <div v-show="isNull" ref="chartRef" :style="{ height: '600px', width }"></div> | 38 | + <div v-else ref="chartRef" :style="{ height: '600px', width }"></div> |
| 39 | </BasicModal> | 39 | </BasicModal> |
| 40 | <DeviceDetailDrawer @register="registerDetailDrawer" /> | 40 | <DeviceDetailDrawer @register="registerDetailDrawer" /> |
| 41 | </div> | 41 | </div> |
| @@ -61,6 +61,13 @@ | @@ -61,6 +61,13 @@ | ||
| 61 | import { useDrawer } from '/@/components/Drawer'; | 61 | import { useDrawer } from '/@/components/Drawer'; |
| 62 | import DeviceDetailDrawer from '/@/views/device/manage/cpns/modal/DeviceDetailDrawer.vue'; | 62 | import DeviceDetailDrawer from '/@/views/device/manage/cpns/modal/DeviceDetailDrawer.vue'; |
| 63 | import moment from 'moment'; | 63 | import moment from 'moment'; |
| 64 | + // 导入一些静态图片,避免打包时不能正确解析 | ||
| 65 | + import djx from '/@/assets/images/djx.png'; | ||
| 66 | + import zx from '/@/assets/images/zx.png'; | ||
| 67 | + import lx from '/@/assets/images/lx.png'; | ||
| 68 | + import djh from '/@/assets/images/djh.png'; | ||
| 69 | + import online from '/@/assets/images/online1.png'; | ||
| 70 | + import lx1 from '/@/assets/images/lx1.png'; | ||
| 64 | export default defineComponent({ | 71 | export default defineComponent({ |
| 65 | name: 'BaiduMap', | 72 | name: 'BaiduMap', |
| 66 | components: { | 73 | components: { |
| @@ -141,10 +148,10 @@ | @@ -141,10 +148,10 @@ | ||
| 141 | <div style="font-size:16px;font-weight:bold">${name}</div> | 148 | <div style="font-size:16px;font-weight:bold">${name}</div> |
| 142 | ${ | 149 | ${ |
| 143 | deviceState === 'INACTIVE' | 150 | deviceState === 'INACTIVE' |
| 144 | - ? '<div style="display:flex;align-items:center"><img style="width:15px;height:15px" src="/src/assets/images/djh.png">待激活</div>' | 151 | + ? `<div style="display:flex;align-items:center"><img style="width:15px;height:15px" src="${djh}">待激活</div>` |
| 145 | : deviceState === 'ONLINE' | 152 | : deviceState === 'ONLINE' |
| 146 | - ? '<div style="display:flex;align-items:center"><img style="width:15px;height:15px" src="/src/assets/images/online1.png">在线</div>' | ||
| 147 | - : '<div style="display:flex;align-items:center"><img style="width:15px;height:15px" src="/src/assets/images/lx1.png">离线</div>' | 153 | + ? `<div style="display:flex;align-items:center"><img style="width:15px;height:15px" src="${online}">在线</div>` |
| 154 | + : `<div style="display:flex;align-items:center"><img style="width:15px;height:15px" src="${lx1}">离线</div>` | ||
| 148 | } | 155 | } |
| 149 | </div> | 156 | </div> |
| 150 | <div>所属组织:${organizationDTO.name}</div> | 157 | <div>所属组织:${organizationDTO.name}</div> |
| @@ -161,12 +168,8 @@ | @@ -161,12 +168,8 @@ | ||
| 161 | 168 | ||
| 162 | map.openInfoWindow(infoWindow, map.getCenter()); | 169 | map.openInfoWindow(infoWindow, map.getCenter()); |
| 163 | let preMarker = null; | 170 | let preMarker = null; |
| 164 | - const rivet = | ||
| 165 | - deviceState === 'INACTIVE' | ||
| 166 | - ? '/src/assets/images/djx.png' | ||
| 167 | - : deviceState === 'ONLINE' | ||
| 168 | - ? '/src/assets/images/zx.png' | ||
| 169 | - : '/src/assets/images/lx.png'; | 171 | + |
| 172 | + const rivet = deviceState === 'INACTIVE' ? djx : deviceState === 'ONLINE' ? zx : lx; | ||
| 170 | let myIcon = new BMap.Icon(rivet, new BMap.Size(20, 30)); | 173 | let myIcon = new BMap.Icon(rivet, new BMap.Size(20, 30)); |
| 171 | let marker = new BMap.Marker(point, { icon: myIcon }); | 174 | let marker = new BMap.Marker(point, { icon: myIcon }); |
| 172 | if (marker) { | 175 | if (marker) { |
| @@ -73,6 +73,7 @@ | @@ -73,6 +73,7 @@ | ||
| 73 | import { upload } from '/@/api/oss/ossFileUploader'; | 73 | import { upload } from '/@/api/oss/ossFileUploader'; |
| 74 | import { FileItem } from '/@/components/Upload/src/typing'; | 74 | import { FileItem } from '/@/components/Upload/src/typing'; |
| 75 | import { BAI_DU_MAP_URL } from '/@/utils/fnUtils'; | 75 | import { BAI_DU_MAP_URL } from '/@/utils/fnUtils'; |
| 76 | + import icon from '/@/assets/images/wz.png'; | ||
| 76 | export default defineComponent({ | 77 | export default defineComponent({ |
| 77 | components: { | 78 | components: { |
| 78 | BasicForm, | 79 | BasicForm, |
| @@ -179,7 +180,6 @@ | @@ -179,7 +180,6 @@ | ||
| 179 | if (!wrapEl) return; | 180 | if (!wrapEl) return; |
| 180 | let preMarker = null; | 181 | let preMarker = null; |
| 181 | const map = new BMap.Map(wrapEl); | 182 | const map = new BMap.Map(wrapEl); |
| 182 | - const icon = '/src/assets/images/wz.png'; | ||
| 183 | let myIcon = new BMap.Icon(icon, new BMap.Size(20, 30)); | 183 | let myIcon = new BMap.Icon(icon, new BMap.Size(20, 30)); |
| 184 | const point = new BMap.Point(Number(longitude), Number(latitude)); | 184 | const point = new BMap.Point(Number(longitude), Number(latitude)); |
| 185 | let marker = new BMap.Marker(point, { icon: myIcon }); | 185 | let marker = new BMap.Marker(point, { icon: myIcon }); |
| @@ -207,8 +207,8 @@ | @@ -207,8 +207,8 @@ | ||
| 207 | //获取详细的地址,精确到街道的名称 | 207 | //获取详细的地址,精确到街道的名称 |
| 208 | gc.getLocation(newPoint, (rs) => { | 208 | gc.getLocation(newPoint, (rs) => { |
| 209 | let addComp = rs.addressComponents; | 209 | let addComp = rs.addressComponents; |
| 210 | - let addrname = addComp.city + addComp.district + addComp.street + addComp.streetNumber; | ||
| 211 | - positionState.address = addrname; | 210 | + let address = addComp.city + addComp.district + addComp.street + addComp.streetNumber; |
| 211 | + positionState.address = address; | ||
| 212 | }); | 212 | }); |
| 213 | }); | 213 | }); |
| 214 | } | 214 | } |