@@ -43,7 +43,9 @@
import { ref, onMounted } from 'vue'
import { request } from '@shared/utils/request'
-const resources = ref([
+const emit = defineEmits(['clickEmergencyResource'])
+
+const testData = [
{
id: 1,
name: '万州区',
@@ -98,7 +100,9 @@ const resources = ref([
equipmentClass: 'red',
hasAlert: false
}
-])
+]
+
+const resources = ref([])
// 请求后端接口 /district/statistics
const getDistrictStatistics = async () => {
@@ -106,7 +110,6 @@ const getDistrictStatistics = async () => {
url: '/snow-ops-platform/district/statistics',
method: 'GET'
})
- console.log(res)
if(res.code === '00000') {
resources.value = res.data
} else {
@@ -240,6 +243,7 @@ onMounted(() => {
.district-name {
text-align: left;
+ cursor: pointer;
}
.count {
diff --git a/packages/screen/src/views/cockpit/components/ImageMarkTooltip/index.js b/packages/screen/src/views/cockpit/components/ImageMarkTooltip/index.js
index ab102aa..df70602 100644
--- a/packages/screen/src/views/cockpit/components/ImageMarkTooltip/index.js
+++ b/packages/screen/src/views/cockpit/components/ImageMarkTooltip/index.js
@@ -1,8 +1,13 @@
import { createVNode, render } from 'vue'
-import ImageMarkTooltip from './ImageMarkTooltip.vue'
+import serviceFacility from './serviceFacilityToolTip.vue'
-class ImageMarkTooltipUI {
- constructor() {
+const UIMap = {
+ serviceFacility
+}
+
+class ImageMarkTooltip {
+ constructor({ key }) {
+ this.key = key
this.instance = null
this.container = null
this.entity = null
@@ -22,8 +27,10 @@ class ImageMarkTooltipUI {
this.entity = options.entity
+ const UIInstance = UIMap[this.key]
+
// 创建 VNode
- const vnode = createVNode(ImageMarkTooltip, {
+ const vnode = createVNode(UIInstance, {
visible: true,
position: options.position || { x: 0, y: 0 },
data: options.data || {},
@@ -37,6 +44,9 @@ class ImageMarkTooltipUI {
// 渲染到容器
render(vnode, this.container)
this.instance = vnode.component
+ if(this.instance.exposed.init) {
+ this.instance.exposed.init()
+ }
return this.instance
}
@@ -68,11 +78,7 @@ class ImageMarkTooltipUI {
}
}
-// 创建单例实例
-const instance = new ImageMarkTooltipUI()
-export const CommonTooltip = instance
-
-export const newImageMarkTooltip = () => {
- return new ImageMarkTooltipUI()
+export const newImageMarkTooltip = ({ key }) => {
+ return new ImageMarkTooltip({ key })
}
\ No newline at end of file
diff --git a/packages/screen/src/views/cockpit/components/ImageMarkTooltip/riskRoad.vue b/packages/screen/src/views/cockpit/components/ImageMarkTooltip/riskRoad.vue
index 0dde344..45f33c8 100644
--- a/packages/screen/src/views/cockpit/components/ImageMarkTooltip/riskRoad.vue
+++ b/packages/screen/src/views/cockpit/components/ImageMarkTooltip/riskRoad.vue
@@ -1,5 +1,23 @@
+
+
+ 名称:
+ {{ data.mc }}
+
+
+
+
+ 所属区县:
+ {{ data.yjllpz }}
+
+
+
+ 应急设备:
+ {{ data.wz }}
+
+
+
-
\ No newline at end of file
diff --git a/packages/screen/src/views/cockpit/components/ImageMarkTooltip/ImageMarkTooltip.vue b/packages/screen/src/views/cockpit/components/ImageMarkTooltip/serviceFacilityTooltip.vue
similarity index 78%
rename from packages/screen/src/views/cockpit/components/ImageMarkTooltip/ImageMarkTooltip.vue
rename to packages/screen/src/views/cockpit/components/ImageMarkTooltip/serviceFacilityTooltip.vue
index 1b7dfd1..1626400 100644
--- a/packages/screen/src/views/cockpit/components/ImageMarkTooltip/ImageMarkTooltip.vue
+++ b/packages/screen/src/views/cockpit/components/ImageMarkTooltip/serviceFacilityTooltip.vue
@@ -11,8 +11,32 @@
-
-
+
+
+
+ 名称:
+ {{ detail.mc }}
+
+
+
+ 所属区县:
+ {{ detail.qxmc }}
+
+
+
+ 应急设备:
+ {{ detail.sbsl }}
+
+
+
+ 应急物资:
+ {{ detail.wzsl }}
+
+
+
+ 应急人员:
+ {{ detail.rysl }}
+
@@ -36,11 +60,7 @@