...
|
...
|
@@ -12,15 +12,15 @@ import { useChartDataFetch } from '@/hooks' |
12
|
12
|
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
13
|
13
|
import { MarkerEnum, ThemeEnum, dataExtraInfoType, dataJsonType, dataJsonMarkersType, devicePartInfoInterface } from './config'
|
14
|
14
|
import { isArray } from '@/utils'
|
15
|
|
-import djh from './images/djh.png'
|
|
15
|
+import inactive from './images/inactive.png'
|
16
|
16
|
import online from './images/online.png'
|
17
|
|
-import lx1 from './images/lx1.png'
|
18
|
|
-import onLineImg from '../../../../../../assets/external/marker/3.png'
|
19
|
|
-import listImg from './images/list.png'
|
|
17
|
+import offline from './images/offline.png'
|
|
18
|
+import listView from './images/list.png'
|
20
|
19
|
import { getDeviceActiveTime } from '@/api/external/common/index'
|
21
|
20
|
import dayjs from 'dayjs'
|
22
|
21
|
import DeviceLatestTable from './components/DeviceLatestTable.vue'
|
23
|
22
|
import { getDeviceLatest, getProfileAttrs } from '@/api/external/common'
|
|
23
|
+import { NButton } from 'naive-ui'
|
24
|
24
|
|
25
|
25
|
const props = defineProps({
|
26
|
26
|
chartConfig: {
|
...
|
...
|
@@ -127,11 +127,11 @@ const createInfoWindow = async (extraInfo: dataExtraInfoType) => { |
127
|
127
|
render(h(BorderInstance.default, { chartConfig: BorderConfigInstance }), document.getElementById(id)!)
|
128
|
128
|
}, 100)
|
129
|
129
|
//
|
130
|
|
- const textOverflow = `width:20rem;text-overflow:ellipsis;overflow:hidden;word-break:break-all;white-space:nowrap;`
|
131
|
|
- const textOverflowFontBold = `width:12rem;text-overflow:ellipsis;overflow:hidden;word-break:break-all;white-space:nowrap;font-size:17px;font-weight:bold;`
|
|
130
|
+ const textOverflow = `width:16rem;text-overflow:ellipsis;overflow:hidden;word-break:break-all;white-space:nowrap;`
|
|
131
|
+ const textOverflowFontBold = `width:12rem;text-overflow:ellipsis;overflow:hidden;word-break:break-all;white-space:nowrap;font-size:15px;font-weight:bold;`
|
132
|
132
|
const deviceStateContainer = `display:flex;justify-content:space-between;align-items:center;`
|
133
|
133
|
const deviceStateImg = `width:1.2rem;height:1.2rem;`
|
134
|
|
- const deviceStateText = `margin-left:0.6rem;font-size:17px;font-weight:bold;`
|
|
134
|
+ const deviceStateText = `margin-left:0.6rem;font-weight:bold;`
|
135
|
135
|
return `
|
136
|
136
|
<div id="${id}" style="width:30rem;">
|
137
|
137
|
<div style="display:flex;flex-direction:column;margin:3.5rem 5.5rem 2rem 6.5rem;position:relative;">
|
...
|
...
|
@@ -140,24 +140,24 @@ const createInfoWindow = async (extraInfo: dataExtraInfoType) => { |
140
|
140
|
${
|
141
|
141
|
deviceState === 'INACTIVE'
|
142
|
142
|
? `<div style="${deviceStateContainer}">
|
143
|
|
- <img style="${deviceStateImg}" src="${djh}"/>
|
|
143
|
+ <img onclick="handleOpenDrawer()" alt="最新数据" style="${deviceStateImg};cursor:pointer;" src="${listView}"/>
|
|
144
|
+ <img style="${deviceStateImg};margin-left:0.3rem" src="${inactive}"/>
|
144
|
145
|
<span style="${deviceStateText}">待激活</span>
|
145
|
146
|
</div>`
|
146
|
147
|
: deviceState === 'ONLINE'
|
147
|
148
|
? `<div style="${deviceStateContainer}">
|
148
|
|
- <img style="${deviceStateImg}" src="${online}"/>
|
|
149
|
+ <img onclick="handleOpenDrawer()" alt="最新数据" style="${deviceStateImg};cursor:pointer;" src="${listView}"/>
|
|
150
|
+ <img style="${deviceStateImg};margin-left:0.3rem" src="${online}"/>
|
149
|
151
|
<span style="${deviceStateText}">在线</span>
|
150
|
152
|
</div>`
|
151
|
153
|
: `<div style="${deviceStateContainer}">
|
152
|
|
- <img style="${deviceStateImg}" src="${lx1}"/>
|
|
154
|
+ <img onclick="handleOpenDrawer()" alt="最新数据" style="${deviceStateImg};cursor:pointer;" src="${listView}"/>
|
|
155
|
+ <img style="${deviceStateImg};margin-left:0.3rem" src="${offline}"/>
|
153
|
156
|
<span style="${deviceStateText}">离线</span>
|
154
|
157
|
</div>`
|
155
|
158
|
}
|
156
|
159
|
</div>
|
157
|
|
- <div style="display:flex;justify-content:flex-end;cursor:pointer;" onclick="handleOpenDrawer()">
|
158
|
|
- <img style="${deviceStateImg};position:relative;top:0.7rem" src="${listImg}"/>
|
159
|
|
- </div>
|
160
|
|
- <div style="display:flex;flex-direction:column;justify-content:space-between;color:white;margin-top:1rem;gap:0.8rem;">
|
|
160
|
+ <div style="display:flex;flex-direction:column;justify-content:space-between;color:white;margin-top:1rem;gap:0.95rem;">
|
161
|
161
|
<div style="${textOverflow}">所属组织:${organizationDTO.name}</div>
|
162
|
162
|
<div style="${textOverflow}">接入协议:${deviceProfile.transportType}</div>
|
163
|
163
|
<div style="${textOverflow}">设备位置:${!deviceInfo.address ? '该设备暂无地理位置' : deviceInfo.address}</div>
|
...
|
...
|
@@ -220,11 +220,10 @@ const dataHandle = (newData: dataJsonType) => { |
220
|
220
|
// 记录新标记
|
221
|
221
|
if (mapMarkerType.value === MarkerEnum.MARKER) {
|
222
|
222
|
newData.markers.forEach((markerItem: dataJsonMarkersType) => {
|
223
|
|
- const { deviceState } = markerItem.extraInfo
|
224
|
223
|
const markerInstance = new AMapIns.Marker({
|
225
|
224
|
position: [markerItem.position[0], markerItem.position[1]],
|
226
|
|
- offset: new AMapIns.Pixel(-13, -30),
|
227
|
|
- icon: deviceState === 'ONLINE' ? onLineImg : iconMarker.value
|
|
225
|
+ offset: new AMapIns.Pixel(-13, 5),
|
|
226
|
+ icon: iconMarker.value
|
228
|
227
|
})
|
229
|
228
|
// markers.push(markerInstance) 原作者这种方式添加,属于JS API 1.4.8版本的
|
230
|
229
|
// markerInstance.setMap(mapIns)
|
...
|
...
|
@@ -286,6 +285,9 @@ useChartDataFetch(props.chartConfig, useChartEditStore, (newData: any) => { |
286
|
285
|
|
287
|
286
|
<style>
|
288
|
287
|
/**去除高德地图原生弹窗 */
|
|
288
|
+.amap-info-outer, .amap-menu-outer {
|
|
289
|
+ box-shadow: 0 1px 2px rgba(0,0,0,0)!important;
|
|
290
|
+}
|
289
|
291
|
.amap-info-outer {
|
290
|
292
|
background-color: rgba(0, 0, 0, 0) !important;
|
291
|
293
|
}
|
...
|
...
|
|