1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
| import createPointActiveIcon from "@/assets/element-img/activePoint.png";
| import createToolActiveIcon from "@/assets/element-img/activeTool.png";
| import createStationDefaultIcon from "@/assets/element-img/defaultArea.png";
| import createFenceDefaultIcon from "@/assets/element-img/defaultLine.png";
| import createPointDefaultIcon from "@/assets/element-img/defaultPoint.png";
| import createToolDefaultIcon from "@/assets/element-img/defaultTool.png";
| import type {
| LngLatTuple,
| OptionItem,
| StationSeedItem,
| WorkbenchTab,
| } from "./map.definition";
|
| // 文件用途:
| // 统一存放综合运营工作台使用到的静态配置、默认值、图标资源和本地种子数据。
|
| // 创建工具按钮项的数据结构。
| export type CreateToolOption = {
| label: string;
| value: WorkbenchTab;
| icon: string;
| activeIcon: string;
| permissionCode?: string | number;
| };
|
| // 左侧 tab 切换按钮配置。
| export const tabOptions: Array<{ label: string; value: WorkbenchTab }> = [
| { label: "围栏", value: "fence" },
| { label: "点位", value: "point" },
| { label: "场站", value: "station" },
| ];
|
| // 地图右上角创建工具菜单配置。
| export const createToolOptions: CreateToolOption[] = [
| {
| label: "打点",
| value: "point",
| icon: createPointDefaultIcon,
| activeIcon: createPointActiveIcon,
| },
| {
| label: "新建围栏",
| value: "fence",
| icon: createFenceDefaultIcon,
| activeIcon: createPointActiveIcon,
| },
| {
| label: "新建场站",
| value: "station",
| icon: createStationDefaultIcon,
| activeIcon: createPointActiveIcon,
| permissionCode: 202642929,
| },
| ];
|
| // 城市下拉的默认选项,用于接口失败或首次进入时兜底。
| export const DEFAULT_CITY_OPTIONS: OptionItem[] = [
| { label: "广州市", value: "440100" },
| { label: "深圳市", value: "440300" },
| { label: "佛山市", value: "440600" },
| ];
|
| // 未命中运营态时使用的红色点位图标。
| export const MARK_ICON_RED =
| "https://huishou-1323682843.cos.ap-nanjing.myqcloud.com/images/d8c0a834-069f-4e11-8130-1257d73ef449.png";
| // 运营中或可运营态使用的绿色点位图标。
| export const MARK_ICON_GREEN =
| "https://huishou-1323682843.cos.ap-nanjing.myqcloud.com/images/ab2e2d89-ea82-4081-9729-ab212460c375.png";
| // 当前选中点位使用的蓝色高亮图标。
| export const MARK_ICON_BLUE =
| "https://huishou-1323682843.cos.ap-nanjing.myqcloud.com/images/73a51310-2871-4c4a-a763-8e1a59a31f50.png";
| // 点位图片为空时使用的默认占位图。
| export const DEFAULT_POINT_IMAGE =
| "https://huishou-1323682843.cos.ap-nanjing.myqcloud.com/images/9bed493b-a6aa-4ef6-ac10-7f67f5c6adc5.png";
|
| // 三类对象在左侧筛选区共用的状态筛选项。
| export const statusOptionsMap: Record<WorkbenchTab, OptionItem[]> = {
| fence: [
| // { label: "草稿", value: "draft" },
| // { label: "待生效", value: "pending" },
| { label: "启用中", value: "enabled" },
| { label: "已停用", value: "disabled" },
| ],
| point: [
| { label: "可运营", value: "operable" },
| { label: "待生效", value: "pending" },
| { label: "启用中", value: "enabled" },
| { label: "已停用", value: "disabled" },
| { label: "已失效", value: "invalid" },
| ],
| station: [
| { label: "草稿", value: "draft" },
| { label: "待生效", value: "pending" },
| { label: "启用中", value: "enabled" },
| { label: "已停用", value: "disabled" },
| { label: "失效", value: "invalid" },
| ],
| };
|
| // 场站本地种子数据,主要用于本地兜底或调试参考。
| export const stationSeedMap: Record<string, StationSeedItem[]> = {
| guangzhou: [
| {
| id: "gz-station-1",
| name: "广州南站场站",
| stationNumber: "S001",
| status: "启用中",
| description: "承接高铁接驳与园区接送。",
| lng: 113.275499,
| lat: 23.102061,
| pointIndexes: [0, 1, 2, 3, 4, 5],
| parkingTimeLimit: "60",
| operationType: "1",
| effectivePeriod: 1,
| customTimeRanges: [{ id: 1, startTime: "09:00", endTime: "18:00" }],
| },
| {
| id: "gz-station-2",
| name: "广州东站场站",
| stationNumber: "S002",
| status: "草稿",
| description: "覆盖商圈与地铁接驳点位。",
| lng: 113.376499,
| lat: 23.146061,
| pointIndexes: [1, 2, 6, 7, 8],
| parkingTimeLimit: "45",
| operationType: "2",
| effectivePeriod: 1,
| customTimeRanges: [{ id: 1, startTime: "08:30", endTime: "20:30" }],
| },
| ],
| shenzhen: [
| {
| id: "sz-station-1",
| name: "深圳湾口岸场站",
| stationNumber: "S101",
| status: "启用中",
| description: "服务口岸通勤与湾区接驳。",
| lng: 113.949556,
| lat: 22.513231,
| pointIndexes: [0, 1, 2, 3],
| parkingTimeLimit: "60",
| operationType: "1",
| effectivePeriod: 1,
| customTimeRanges: [{ id: 1, startTime: "09:00", endTime: "18:00" }],
| },
| {
| id: "sz-station-2",
| name: "前海枢纽场站",
| stationNumber: "S102",
| status: "已停用",
| description: "前海商务区短驳试运营场站。",
| lng: 113.88495,
| lat: 22.53332,
| pointIndexes: [4, 5, 6, 7, 8],
| parkingTimeLimit: "30",
| operationType: "2",
| effectivePeriod: 2,
| customTimeRanges: [{ id: 1, startTime: "10:00", endTime: "17:00" }],
| },
| ],
| foshan: [
| {
| id: "fs-station-1",
| name: "千灯湖场站",
| stationNumber: "S201",
| status: "启用中",
| description: "覆盖金融高新区与商圈集散。",
| lng: 113.165252,
| lat: 23.04726,
| pointIndexes: [0, 1, 2, 3, 4],
| parkingTimeLimit: "50",
| operationType: "1",
| effectivePeriod: 1,
| customTimeRanges: [{ id: 1, startTime: "09:00", endTime: "18:30" }],
| },
| {
| id: "fs-station-2",
| name: "佛山西站场站",
| stationNumber: "S202",
| status: "草稿",
| description: "面向高铁站点接驳的预留场站。",
| lng: 113.04222,
| lat: 23.04523,
| pointIndexes: [2, 3, 4, 5, 6, 7],
| parkingTimeLimit: "40",
| operationType: "2",
| effectivePeriod: 1,
| customTimeRanges: [{ id: 1, startTime: "08:00", endTime: "19:30" }],
| },
| ],
| };
|
| // 城市切换后用于回中和默认缩放的地图视口配置。
| export const cityCenterMap: Record<string, { center: LngLatTuple; zoom: number }> =
| {
| "440100": { center: [113.264499, 23.130061], zoom: 11 },
| "440300": { center: [114.057868, 22.543099], zoom: 11 },
| "440600": { center: [113.121416, 23.021548], zoom: 11 },
| };
|
| // 地图初始化和城市切换时使用的默认缩放级别。
| export const INITIAL_ZOOM = 11;
|
| // 创建工具主按钮在默认和展开态共用的图标资源。
| export { createToolActiveIcon, createToolDefaultIcon };
|
|