| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- export const gisPointStatusColors = {
- normal: '#2ecc71',
- alarm: '#e74c3c',
- warning: '#f1c40f',
- workOrder: '#3498db',
- offline: '#95a5a6'
- }
- export const gisPointStatusIcons = {
- normal: new URL('../assets/gis/T_MarkPoint_Green.png', import.meta.url).href,
- alarm: new URL('../assets/gis/T_MarkPoint_Red.png', import.meta.url).href,
- warning: new URL('../assets/gis/T_MarkPoint_Yellow.png', import.meta.url).href,
- workOrder: new URL('../assets/gis/T_MarkPoint_Blue.png', import.meta.url).href,
- offline: new URL('../assets/gis/T_MarkPoint_Grey.png', import.meta.url).href
- }
- export const facilityPointIcons = {
- source: new URL('../assets/gis/T_MarkPoint_Blue.png', import.meta.url).href,
- plant: new URL('../assets/gis/T_MarkPoint_Green.png', import.meta.url).href,
- pumpStation: new URL('../assets/gis/T_MarkPoint_Red.png', import.meta.url).href,
- pipe: new URL('../assets/gis/T_MarkPoint_Yellow.png', import.meta.url).href,
- user: new URL('../assets/gis/T_MarkPoint_Black.png', import.meta.url).href
- }
- export function getFacilityPointIcon(type = '') {
- return facilityPointIcons[type] || facilityPointIcons.plant
- }
- const clusterPointIcon = new URL('../assets/gis/T_MarkPoint_Colorful.png', import.meta.url).href
- export function getMapClusterIcon(points = []) {
- const icons = [...new Set((Array.isArray(points) ? points : [])
- .map(point => point?.iconUrl || getMonitoringPointIcon(point))
- .filter(Boolean))]
- return icons.length === 1 ? icons[0] : clusterPointIcon
- }
- export const gisPointStatusLabels = {
- normal: '正常',
- alarm: '报警',
- warning: '预警',
- workOrder: '关联工单',
- offline: '离线'
- }
- export const gisPointStatusTagTypes = {
- normal: 'success',
- alarm: 'danger',
- warning: 'warning',
- workOrder: 'primary',
- offline: 'info'
- }
- export function getMonitoringPointStatus(point = {}) {
- const relatedOrderNo = point.relatedOrderNo ?? point.relatedWorkOrderNo ?? point.orderNo
- if (relatedOrderNo && relatedOrderNo !== '-') return 'workOrder'
- if (Number(point.alarmStatus) === 1) return 'alarm'
- if (Number(point.currentStatus) === 3) return 'warning'
- if (Number(point.onlineStatus) === 0) return 'offline'
- return 'normal'
- }
- export function getMonitoringPointColor(point = {}) {
- return gisPointStatusColors[getMonitoringPointStatus(point)] || gisPointStatusColors.normal
- }
- export function getMonitoringPointIcon(point = {}) {
- return gisPointStatusIcons[getMonitoringPointStatus(point)] || gisPointStatusIcons.normal
- }
- export function getMonitoringPointLabel(point = {}) {
- return gisPointStatusLabels[getMonitoringPointStatus(point)] || gisPointStatusLabels.normal
- }
- export function getMonitoringPointTagType(point = {}) {
- return gisPointStatusTagTypes[getMonitoringPointStatus(point)] || gisPointStatusTagTypes.normal
- }
|