vue2-client 1.19.61 → 1.19.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/src/assets/img/map/car.png +0 -0
- package/src/assets/img/map/start.png +0 -0
- package/src/assets/img/map/terminus.png +0 -0
- package/src/assets/svg/unknown-icon.svg +3 -0
- package/src/base-client/components/common/AfMap/InfoWindowComponent.vue +141 -0
- package/src/base-client/components/common/AfMap/components/DeviceLayerPanel/DeviceLayerPanel.vue +63 -0
- package/src/base-client/components/common/AfMap/components/DeviceLayerPanel/LayerItem.vue +135 -0
- package/src/base-client/components/common/AfMap/components/DeviceLayerPanel/LayerItemHorizontal.vue +201 -0
- package/src/base-client/components/common/AfMap/components/DeviceLayerPanel/LayerItemVertical.vue +140 -0
- package/src/base-client/components/common/AfMap/components/DeviceLayerPanel/LayerPanelHorizontal.vue +95 -0
- package/src/base-client/components/common/AfMap/components/DeviceLayerPanel/LayerPanelVertical.vue +73 -0
- package/src/base-client/components/common/AfMap/components/DeviceLayerPanel/README.md +177 -0
- package/src/base-client/components/common/AfMap/demo.vue +492 -0
- package/src/base-client/components/common/AfMap/map/AMapAdapter.js +3078 -0
- package/src/base-client/components/common/AfMap/map/MapAdapter.js +556 -0
- package/src/base-client/components/common/AfMap/map/OLAdapter.js +3096 -0
- package/src/base-client/components/common/AfMap/map/README.md +94 -0
- package/src/base-client/components/common/AfMap/map/index.vue +1566 -0
- package/src/base-client/components/common/AfMap/map/mapKernelFactory.js +43 -0
- package/src/base-client/components/common/AfMap/map/mapService.js +751 -0
- package/src/base-client/components/common/AfMap/map/utils/gcj02Mecator.js +149 -0
- package/src/base-client/components/common/AfMap/map/utils/wgs84ToGcj02.js +156 -0
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowHandle.vue +1 -3
- package/src/router/async/router.map.js +3 -2
- package/vue.config.js +24 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue2-client",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.63",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"vue": "^2.7.14",
|
|
63
63
|
"vue-codemirror": "4.0.6",
|
|
64
64
|
"vue-color": "2.7.0",
|
|
65
|
+
"ol": "10.3.1",
|
|
65
66
|
"vue-draggable-resizable": "^2.3.0",
|
|
66
67
|
"vue-i18n": "^8.28.2",
|
|
67
68
|
"vue-json-viewer": "^2.2.22",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg
|
|
2
|
+
class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
|
3
|
+
xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 0C229.376 0 0 229.376 0 512c0 282.624 229.376 512 512 512 282.624 0 512-229.376 512-512 0-282.624-229.376-512-512-512z" fill="#6E6E6E" opacity=".15"></path><path d="M646.2464 284.4672q-43.349333-39.936-115.165867-39.936-80.9984 0-128.341333 47.240533-47.377067 46.250667-47.377067 130.116267v0.6144l0.068267 0.6144q6.382933 43.997867 47.4112 43.997867 40.994133 0 48.981333-43.690667l0.136534-0.750933v-0.785067q0-43.997867 15.2576-65.1264l0.1024-0.136533 0.068266-0.136534q16.896-25.3952 58.4704-25.3952 31.880533 0 49.3568 17.783467 17.408 18.909867 17.408 49.322667 0 23.722667-16.827733 44.8512l-8.328533 9.557333q-67.9936 62.088533-82.363734 92.4672c-7.304533 14.404267-11.946667 26.4192-13.994666 36.078933l-0.068267 0.273067-0.034133 0.273067c-2.628267 18.602667-0.7168 33.211733 5.802666 43.895466 6.826667 11.298133 18.295467 17.749333 34.269867 19.3536 31.812267 3.1744 49.493333-8.704 53.077333-35.566933 2.321067-10.581333 5.358933-19.456 9.045334-26.7264 1.297067-2.594133 2.389333-4.7104 3.1744-6.382933 0.512-1.024 1.297067-2.525867 2.389333-4.437334 0.170667-0.341333 0.682667-1.024 1.4336-2.116266q1.3312-1.774933 1.911467-2.730667a30.890667 30.890667 0 0 0 1.672533-3.140267 13.277867 13.277867 0 0 1 0.682667-1.365333 13.994667 13.994667 0 0 1 1.058133-1.058133 29.013333 29.013333 0 0 0 4.4032-5.358934q0.8192-1.262933 1.160533-1.6384a48.469333 48.469333 0 0 1 5.802667-5.9392 48.469333 48.469333 0 0 0 3.754667-3.652266 20.616533 20.616533 0 0 1 1.501866-1.501867l0.1024-0.068267 0.068267-0.1024q53.248-47.616 61.098667-56.558933l0.273066-0.273067 0.2048-0.3072q27.306667-37.205333 27.306667-92.706133 0-68.608-44.9536-108.8512z m-82.978133 420.522667q-18.466133-17.646933-44.8512-17.646934-25.770667 0-44.202667 17.6128-18.2272 17.373867-18.2272 44.475734c0 18.090667 6.075733 32.904533 18.2272 44.475733q18.432 17.646933 44.202667 17.646933 26.385067 0 44.202666-16.9984 18.5344-17.749333 18.5344-45.124266 0-26.180267-17.681066-44.270934l-0.1024-0.1024-0.1024-0.1024z" fill="#6E6E6E"></path></svg>
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="info-window-content">
|
|
3
|
+
<!-- 关闭按钮 -->
|
|
4
|
+
<div class="info-window-header">
|
|
5
|
+
<h3>{{ title }}</h3>
|
|
6
|
+
<button class="close-btn" @click="handleClose">×</button>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<!-- 数据展示 -->
|
|
10
|
+
<div class="info-window-body">
|
|
11
|
+
<div v-if="data">
|
|
12
|
+
{{ data }}
|
|
13
|
+
</div>
|
|
14
|
+
<div v-else class="no-data">
|
|
15
|
+
暂无数据
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script>
|
|
22
|
+
export default {
|
|
23
|
+
name: 'InfoWindowComponent',
|
|
24
|
+
props: {
|
|
25
|
+
data: {
|
|
26
|
+
type: [Object, Array],
|
|
27
|
+
default: null
|
|
28
|
+
},
|
|
29
|
+
title: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: '巡检计划详情'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
computed: {
|
|
35
|
+
// 格式化数据,只显示简单类型(避免显示复杂对象)
|
|
36
|
+
formattedData() {
|
|
37
|
+
if (!this.data) return {}
|
|
38
|
+
|
|
39
|
+
const result = {}
|
|
40
|
+
const dataObj = Array.isArray(this.data) ? this.data[0] || {} : this.data
|
|
41
|
+
|
|
42
|
+
Object.entries(dataObj).forEach(([key, value]) => {
|
|
43
|
+
// 只显示简单类型(字符串、数字、布尔值)
|
|
44
|
+
if (typeof value !== 'object' || value === null) {
|
|
45
|
+
result[key] = value
|
|
46
|
+
} else if (Array.isArray(value)) {
|
|
47
|
+
result[key] = `数组(${value.length}项)`
|
|
48
|
+
} else {
|
|
49
|
+
result[key] = '对象'
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
return result
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
methods: {
|
|
57
|
+
handleClose() {
|
|
58
|
+
// 触发父组件传递的 close 事件
|
|
59
|
+
this.$emit('close')
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<style scoped>
|
|
66
|
+
.info-window-content {
|
|
67
|
+
background: white;
|
|
68
|
+
border-radius: 8px;
|
|
69
|
+
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
|
|
70
|
+
min-width: 200px;
|
|
71
|
+
max-width: 300px;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.info-window-header {
|
|
76
|
+
display: flex;
|
|
77
|
+
justify-content: space-between;
|
|
78
|
+
align-items: center;
|
|
79
|
+
padding: 12px 16px;
|
|
80
|
+
background: linear-gradient(135deg, #1890ff, #096dd9);
|
|
81
|
+
color: white;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.info-window-header h3 {
|
|
85
|
+
margin: 0;
|
|
86
|
+
font-size: 16px;
|
|
87
|
+
font-weight: 500;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.close-btn {
|
|
91
|
+
background: none;
|
|
92
|
+
border: none;
|
|
93
|
+
color: white;
|
|
94
|
+
font-size: 20px;
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
width: 24px;
|
|
97
|
+
height: 24px;
|
|
98
|
+
line-height: 24px;
|
|
99
|
+
text-align: center;
|
|
100
|
+
border-radius: 50%;
|
|
101
|
+
transition: background-color 0.3s;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.close-btn:hover {
|
|
105
|
+
background: rgba(255, 255, 255, 0.2);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.info-window-body {
|
|
109
|
+
padding: 16px;
|
|
110
|
+
max-height: 400px;
|
|
111
|
+
overflow-y: auto;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.data-item {
|
|
115
|
+
margin-bottom: 8px;
|
|
116
|
+
padding-bottom: 8px;
|
|
117
|
+
border-bottom: 1px solid #f0f0f0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.data-item:last-child {
|
|
121
|
+
margin-bottom: 0;
|
|
122
|
+
border-bottom: none;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.data-key {
|
|
126
|
+
font-weight: 600;
|
|
127
|
+
color: #666;
|
|
128
|
+
margin-right: 8px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.data-value {
|
|
132
|
+
color: #333;
|
|
133
|
+
word-break: break-all;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.no-data {
|
|
137
|
+
text-align: center;
|
|
138
|
+
color: #999;
|
|
139
|
+
padding: 20px 0;
|
|
140
|
+
}
|
|
141
|
+
</style>
|
package/src/base-client/components/common/AfMap/components/DeviceLayerPanel/DeviceLayerPanel.vue
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="device-layer-panel">
|
|
3
|
+
<LayerPanelVertical
|
|
4
|
+
v-if="mode === 'vertical'"
|
|
5
|
+
:layerData="layerData"
|
|
6
|
+
:getDynamicIcon="getDynamicIcon"
|
|
7
|
+
:handleSvgError="handleSvgError"
|
|
8
|
+
@select="onSelect"
|
|
9
|
+
/>
|
|
10
|
+
<LayerPanelHorizontal
|
|
11
|
+
v-if="mode === 'horizontal'"
|
|
12
|
+
:layerData="layerData"
|
|
13
|
+
:getDynamicIcon="getDynamicIcon"
|
|
14
|
+
:handleSvgError="handleSvgError"
|
|
15
|
+
@select="onSelect"
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
import LayerPanelVertical from '@vue2-client/base-client/components/common/AfMap/components/DeviceLayerPanel/LayerPanelVertical.vue'
|
|
22
|
+
import LayerPanelHorizontal from '@vue2-client/base-client/components/common/AfMap/components/DeviceLayerPanel/LayerPanelHorizontal.vue'
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
name: 'DeviceLayerPanel',
|
|
26
|
+
components: {
|
|
27
|
+
LayerPanelVertical,
|
|
28
|
+
LayerPanelHorizontal
|
|
29
|
+
},
|
|
30
|
+
props: {
|
|
31
|
+
/** vertical | horizontal */
|
|
32
|
+
mode: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: 'vertical'
|
|
35
|
+
},
|
|
36
|
+
layerData: {
|
|
37
|
+
type: Array,
|
|
38
|
+
required: true,
|
|
39
|
+
default: () => []
|
|
40
|
+
},
|
|
41
|
+
getDynamicIcon: {
|
|
42
|
+
type: Function,
|
|
43
|
+
required: true
|
|
44
|
+
},
|
|
45
|
+
handleSvgError: {
|
|
46
|
+
type: Function,
|
|
47
|
+
required: true
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
methods: {
|
|
51
|
+
onSelect (layer) {
|
|
52
|
+
this.$emit('select', layer)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<style scoped>
|
|
59
|
+
.device-layer-panel {
|
|
60
|
+
width: 100%;
|
|
61
|
+
height: 100%;
|
|
62
|
+
}
|
|
63
|
+
</style>
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="['layer-toggle-button', `layer-toggle-button-${deviceLayer.visible}`]" @click="handleClick">
|
|
3
|
+
<div class="layer-info">
|
|
4
|
+
<!-- 动态内容区域 -->
|
|
5
|
+
<span class="layer-icon" :style="{ color: deviceLayer.color }">
|
|
6
|
+
<!-- 如果 type 是 'point',显示动态加载的 SVG -->
|
|
7
|
+
<span v-if="deviceLayer.iconType === 'point'">
|
|
8
|
+
<img
|
|
9
|
+
:src="getDynamicIcon(deviceLayer.icon)"
|
|
10
|
+
:title="`${deviceLayer.name}`"
|
|
11
|
+
class="layer-icon"
|
|
12
|
+
@error="handleSvgError"
|
|
13
|
+
/>
|
|
14
|
+
</span>
|
|
15
|
+
<!-- 如果 type 是 'line',显示一个自定义的线条图标 -->
|
|
16
|
+
<span v-else-if="deviceLayer.iconType === 'line'">
|
|
17
|
+
<span :style="{ color: deviceLayer.color, fontWeight: 700 }">一</span>
|
|
18
|
+
</span>
|
|
19
|
+
<!-- 未来可以在这里添加其他类型的判断,例如 v-else-if="layer.type === 'polygon'" -->
|
|
20
|
+
<span v-else>
|
|
21
|
+
<img
|
|
22
|
+
:src="getDynamicIcon(deviceLayer.icon)"
|
|
23
|
+
:title="`${deviceLayer.name}`"
|
|
24
|
+
class="layer-icon"
|
|
25
|
+
@error="handleSvgError"
|
|
26
|
+
/>
|
|
27
|
+
</span>
|
|
28
|
+
</span>
|
|
29
|
+
<div>
|
|
30
|
+
<strong>{{ deviceLayer.name }}</strong>
|
|
31
|
+
<span class="layer-desc">{{ deviceLayer.desc }}</span>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="layer-indicator" :style="{ background: deviceLayer.color }"></div>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
import { getDynamicIcon, handleSvgError } from '@/utils/icons'
|
|
40
|
+
|
|
41
|
+
export default {
|
|
42
|
+
name: 'LayerItem',
|
|
43
|
+
props: {
|
|
44
|
+
deviceLayer: {
|
|
45
|
+
type: Object,
|
|
46
|
+
required: true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
data () {
|
|
50
|
+
return {
|
|
51
|
+
svgContent: '' // 用于存储加载到的 SVG 字符串
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
methods: {
|
|
55
|
+
getDynamicIcon,
|
|
56
|
+
handleSvgError,
|
|
57
|
+
handleClick () {
|
|
58
|
+
// 向上传递点击事件
|
|
59
|
+
this.$emit('click', this.deviceLayer)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<style scoped>
|
|
66
|
+
/* 将原来在 LayerPanel 中的按钮样式移到这里 */
|
|
67
|
+
.layer-toggle-button {
|
|
68
|
+
display: flex !important;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: space-between;
|
|
71
|
+
height: auto !important;
|
|
72
|
+
padding: 8px 12px !important;
|
|
73
|
+
border: 1px solid #e8e8e8 !important;
|
|
74
|
+
border-radius: 16px !important;
|
|
75
|
+
color: inherit !important;
|
|
76
|
+
text-align: left;
|
|
77
|
+
width: 100%;
|
|
78
|
+
transition: all 0.2s ease-in-out;
|
|
79
|
+
}
|
|
80
|
+
.layer-toggle-button-true {
|
|
81
|
+
background: #e0effb !important;
|
|
82
|
+
border-color: #1990fe !important;
|
|
83
|
+
box-shadow: 0 2px 4px rgba(25, 144, 255, 0.2) !important;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.layer-toggle-button:hover,
|
|
87
|
+
.layer-toggle-button:focus {
|
|
88
|
+
border-color: #1990fe !important;
|
|
89
|
+
box-shadow: 0 2px 4px rgba(25, 144, 255, 0.2) !important;
|
|
90
|
+
color: inherit !important;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.layer-info {
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
gap: 12px;
|
|
97
|
+
width: 100%;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.layer-icon {
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
width: 24px;
|
|
105
|
+
height: 24px;
|
|
106
|
+
flex-shrink: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.layer-icon svg {
|
|
110
|
+
width: 20px;
|
|
111
|
+
height: 20px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.layer-info > div {
|
|
115
|
+
display: flex;
|
|
116
|
+
flex-direction: column;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.layer-info strong {
|
|
120
|
+
font-size: 14px;
|
|
121
|
+
color: #333;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.layer-desc {
|
|
125
|
+
font-size: 12px;
|
|
126
|
+
color: #999;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.layer-indicator {
|
|
130
|
+
width: 30px;
|
|
131
|
+
height: 5px;
|
|
132
|
+
border-radius: 8px;
|
|
133
|
+
flex-shrink: 0;
|
|
134
|
+
}
|
|
135
|
+
</style>
|
package/src/base-client/components/common/AfMap/components/DeviceLayerPanel/LayerItemHorizontal.vue
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="['layer-toggle-button', `layer-toggle-button-${deviceLayer.visible}`]" @click="handleClick">
|
|
3
|
+
<div class="layer-content">
|
|
4
|
+
<!-- 图标区域(顶部) -->
|
|
5
|
+
<div class="icon-section">
|
|
6
|
+
<span class="layer-icon" :style="{ color: deviceLayer.color }">
|
|
7
|
+
<!-- 如果 type 是 'point',显示动态加载的 SVG -->
|
|
8
|
+
<span v-if="deviceLayer.iconType === 'point'">
|
|
9
|
+
<img
|
|
10
|
+
:src="getDynamicIcon(deviceLayer.icon)"
|
|
11
|
+
:title="`${deviceLayer.name}`"
|
|
12
|
+
class="layer-icon-img"
|
|
13
|
+
@error="handleSvgError"
|
|
14
|
+
/>
|
|
15
|
+
</span>
|
|
16
|
+
<!-- 如果 type 是 'line',显示一个自定义的线条图标 -->
|
|
17
|
+
<span v-else-if="deviceLayer.iconType === 'line'">
|
|
18
|
+
<span :style="{ color: deviceLayer.color, fontWeight: 700 }">一</span>
|
|
19
|
+
</span>
|
|
20
|
+
<!-- 未来可以在这里添加其他类型的判断,例如 v-else-if="layer.type === 'polygon'" -->
|
|
21
|
+
<span v-else>
|
|
22
|
+
<img
|
|
23
|
+
:src="getDynamicIcon(deviceLayer.icon)"
|
|
24
|
+
:title="`${deviceLayer.name}`"
|
|
25
|
+
class="layer-icon-img"
|
|
26
|
+
@error="handleSvgError"
|
|
27
|
+
/>
|
|
28
|
+
</span>
|
|
29
|
+
</span>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<!-- 文本信息区域(中间) -->
|
|
33
|
+
<div class="text-section">
|
|
34
|
+
<strong class="layer-name">{{ deviceLayer.name }}</strong>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<!-- 指示器区域(底部) -->
|
|
38
|
+
<div class="indicator-section">
|
|
39
|
+
<div class="layer-indicator" :style="{ background: deviceLayer.color }"></div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script>
|
|
46
|
+
|
|
47
|
+
export default {
|
|
48
|
+
name: 'LayerItemHorizontal',
|
|
49
|
+
props: {
|
|
50
|
+
deviceLayer: {
|
|
51
|
+
type: Object,
|
|
52
|
+
required: true
|
|
53
|
+
},
|
|
54
|
+
getDynamicIcon: {
|
|
55
|
+
type: Function,
|
|
56
|
+
required: true
|
|
57
|
+
},
|
|
58
|
+
handleSvgError: {
|
|
59
|
+
type: Function,
|
|
60
|
+
required: true
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
data () {
|
|
64
|
+
return {
|
|
65
|
+
svgContent: '' // 用于存储加载到的 SVG 字符串
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
methods: {
|
|
69
|
+
handleClick () {
|
|
70
|
+
// 向上传递点击事件
|
|
71
|
+
this.$emit('click', this.deviceLayer)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<style scoped>
|
|
78
|
+
/* 横向卡片样式 */
|
|
79
|
+
.layer-toggle-button {
|
|
80
|
+
display: flex !important;
|
|
81
|
+
align-items: center;
|
|
82
|
+
justify-content: center;
|
|
83
|
+
height: auto !important;
|
|
84
|
+
padding: 12px 8px !important;
|
|
85
|
+
border: 1px solid #e8e8e8 !important;
|
|
86
|
+
border-radius: 12px !important;
|
|
87
|
+
color: inherit !important;
|
|
88
|
+
text-align: center;
|
|
89
|
+
width: 100%;
|
|
90
|
+
transition: all 0.2s ease-in-out;
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
min-height: 80px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.layer-toggle-button-true {
|
|
96
|
+
background: #e0effb !important;
|
|
97
|
+
border-color: #1990fe !important;
|
|
98
|
+
box-shadow: 0 2px 8px rgba(25, 144, 255, 0.2) !important;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.layer-toggle-button:hover,
|
|
102
|
+
.layer-toggle-button:focus {
|
|
103
|
+
border-color: #1990fe !important;
|
|
104
|
+
box-shadow: 0 2px 8px rgba(25, 144, 255, 0.2) !important;
|
|
105
|
+
color: inherit !important;
|
|
106
|
+
transform: translateY(-2px);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* 内容区域 - 垂直排列 */
|
|
110
|
+
.layer-content {
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: space-between;
|
|
115
|
+
width: 100%;
|
|
116
|
+
height: 100%;
|
|
117
|
+
gap: 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* 图标区域 */
|
|
121
|
+
.icon-section {
|
|
122
|
+
display: flex;
|
|
123
|
+
align-items: center;
|
|
124
|
+
justify-content: center;
|
|
125
|
+
flex: 1;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.layer-icon {
|
|
129
|
+
display: flex;
|
|
130
|
+
align-items: center;
|
|
131
|
+
justify-content: center;
|
|
132
|
+
width: 32px;
|
|
133
|
+
height: 32px;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.layer-icon-img {
|
|
137
|
+
width: 24px;
|
|
138
|
+
height: 24px;
|
|
139
|
+
object-fit: contain;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* 文本区域 */
|
|
143
|
+
.text-section {
|
|
144
|
+
display: flex;
|
|
145
|
+
flex-direction: column;
|
|
146
|
+
align-items: center;
|
|
147
|
+
justify-content: center;
|
|
148
|
+
flex: 1;
|
|
149
|
+
width: 100%;
|
|
150
|
+
overflow: hidden;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.layer-name {
|
|
154
|
+
font-size: 13px;
|
|
155
|
+
color: #333;
|
|
156
|
+
font-weight: 600;
|
|
157
|
+
margin-bottom: 4px;
|
|
158
|
+
text-align: center;
|
|
159
|
+
line-height: 1.2;
|
|
160
|
+
overflow: hidden;
|
|
161
|
+
text-overflow: ellipsis;
|
|
162
|
+
display: -webkit-box;
|
|
163
|
+
-webkit-line-clamp: 2;
|
|
164
|
+
-webkit-box-orient: vertical;
|
|
165
|
+
width: 100%;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.layer-desc {
|
|
169
|
+
font-size: 11px;
|
|
170
|
+
color: #999;
|
|
171
|
+
text-align: center;
|
|
172
|
+
line-height: 1.2;
|
|
173
|
+
overflow: hidden;
|
|
174
|
+
text-overflow: ellipsis;
|
|
175
|
+
display: -webkit-box;
|
|
176
|
+
-webkit-line-clamp: 3;
|
|
177
|
+
-webkit-box-orient: vertical;
|
|
178
|
+
width: 100%;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* 指示器区域 */
|
|
182
|
+
.indicator-section {
|
|
183
|
+
display: flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
justify-content: center;
|
|
186
|
+
flex-shrink: 0;
|
|
187
|
+
width: 100%;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.layer-indicator {
|
|
191
|
+
width: 40px;
|
|
192
|
+
height: 4px;
|
|
193
|
+
border-radius: 2px;
|
|
194
|
+
transition: all 0.3s ease;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.layer-toggle-button:hover .layer-indicator {
|
|
198
|
+
width: 50px;
|
|
199
|
+
opacity: 0.9;
|
|
200
|
+
}
|
|
201
|
+
</style>
|
package/src/base-client/components/common/AfMap/components/DeviceLayerPanel/LayerItemVertical.vue
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="['layer-toggle-button', `layer-toggle-button-${deviceLayer.visible}`]" @click="handleClick">
|
|
3
|
+
<div class="layer-info">
|
|
4
|
+
<!-- 动态内容区域 -->
|
|
5
|
+
<span class="layer-icon" :style="{ color: deviceLayer.color }">
|
|
6
|
+
<!-- 如果 type 是 'point',显示动态加载的 SVG -->
|
|
7
|
+
<span v-if="deviceLayer.iconType === 'point'">
|
|
8
|
+
<img
|
|
9
|
+
:src="getDynamicIcon(deviceLayer.icon)"
|
|
10
|
+
:title="`${deviceLayer.name}`"
|
|
11
|
+
class="layer-icon"
|
|
12
|
+
@error="handleSvgError"
|
|
13
|
+
/>
|
|
14
|
+
</span>
|
|
15
|
+
<!-- 如果 type 是 'line',显示一个自定义的线条图标 -->
|
|
16
|
+
<span v-else-if="deviceLayer.iconType === 'line'">
|
|
17
|
+
<span :style="{ color: deviceLayer.color, fontWeight: 700 }">一</span>
|
|
18
|
+
</span>
|
|
19
|
+
<!-- 未来可以在这里添加其他类型的判断,例如 v-else-if="layer.type === 'polygon'" -->
|
|
20
|
+
<span v-else>
|
|
21
|
+
<img
|
|
22
|
+
:src="getDynamicIcon(deviceLayer.icon)"
|
|
23
|
+
:title="`${deviceLayer.name}`"
|
|
24
|
+
class="layer-icon"
|
|
25
|
+
@error="handleSvgError"
|
|
26
|
+
/>
|
|
27
|
+
</span>
|
|
28
|
+
</span>
|
|
29
|
+
<div>
|
|
30
|
+
<strong>{{ deviceLayer.name }}</strong>
|
|
31
|
+
<span class="layer-desc">{{ deviceLayer.desc }}</span>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="layer-indicator" :style="{ background: deviceLayer.color }"></div>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
export default {
|
|
40
|
+
name: 'LayerItemVertical',
|
|
41
|
+
props: {
|
|
42
|
+
deviceLayer: {
|
|
43
|
+
type: Object,
|
|
44
|
+
required: true
|
|
45
|
+
},
|
|
46
|
+
getDynamicIcon: {
|
|
47
|
+
type: Function,
|
|
48
|
+
required: true
|
|
49
|
+
},
|
|
50
|
+
handleSvgError: {
|
|
51
|
+
type: Function,
|
|
52
|
+
required: true
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
data () {
|
|
56
|
+
return {
|
|
57
|
+
svgContent: '' // 用于存储加载到的 SVG 字符串
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
methods: {
|
|
61
|
+
handleClick () {
|
|
62
|
+
// 向上传递点击事件
|
|
63
|
+
this.$emit('click', this.deviceLayer)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<style scoped>
|
|
70
|
+
/* 将原来在 LayerPanel 中的按钮样式移到这里 */
|
|
71
|
+
.layer-toggle-button {
|
|
72
|
+
display: flex !important;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: space-between;
|
|
75
|
+
height: auto !important;
|
|
76
|
+
padding: 8px 12px !important;
|
|
77
|
+
border: 1px solid #e8e8e8 !important;
|
|
78
|
+
border-radius: 16px !important;
|
|
79
|
+
color: inherit !important;
|
|
80
|
+
text-align: left;
|
|
81
|
+
width: 100%;
|
|
82
|
+
transition: all 0.2s ease-in-out;
|
|
83
|
+
}
|
|
84
|
+
.layer-toggle-button-true {
|
|
85
|
+
background: #e0effb !important;
|
|
86
|
+
border-color: #1990fe !important;
|
|
87
|
+
box-shadow: 0 2px 4px rgba(25, 144, 255, 0.2) !important;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.layer-toggle-button:hover,
|
|
91
|
+
.layer-toggle-button:focus {
|
|
92
|
+
border-color: #1990fe !important;
|
|
93
|
+
box-shadow: 0 2px 4px rgba(25, 144, 255, 0.2) !important;
|
|
94
|
+
color: inherit !important;
|
|
95
|
+
transform: translateX(-2px);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.layer-info {
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
gap: 12px;
|
|
102
|
+
width: 100%;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.layer-icon {
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
width: 24px;
|
|
110
|
+
height: 24px;
|
|
111
|
+
flex-shrink: 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.layer-icon svg {
|
|
115
|
+
width: 20px;
|
|
116
|
+
height: 20px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.layer-info > div {
|
|
120
|
+
display: flex;
|
|
121
|
+
flex-direction: column;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.layer-info strong {
|
|
125
|
+
font-size: 14px;
|
|
126
|
+
color: #333;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.layer-desc {
|
|
130
|
+
font-size: 12px;
|
|
131
|
+
color: #999;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.layer-indicator {
|
|
135
|
+
width: 30px;
|
|
136
|
+
height: 5px;
|
|
137
|
+
border-radius: 8px;
|
|
138
|
+
flex-shrink: 0;
|
|
139
|
+
}
|
|
140
|
+
</style>
|