|
@@ -92,7 +92,7 @@ |
|
@@ -92,7 +92,7 @@ |
92
|
</setting-item-box>
|
92
|
</setting-item-box>
|
93
|
<setting-item-box name="弹窗选择" v-if="optionData.mapOptions.mapMarkerType === MarkerEnum.MARKER">
|
93
|
<setting-item-box name="弹窗选择" v-if="optionData.mapOptions.mapMarkerType === MarkerEnum.MARKER">
|
94
|
<setting-item name="弹窗选择">
|
94
|
<setting-item name="弹窗选择">
|
95
|
- <NSelect
|
95
|
+ <!-- <NSelect
|
96
|
size="small"
|
96
|
size="small"
|
97
|
placeholder="请选择您要使用的弹窗"
|
97
|
placeholder="请选择您要使用的弹窗"
|
98
|
style="width: 250px"
|
98
|
style="width: 250px"
|
|
@@ -101,6 +101,17 @@ |
|
@@ -101,6 +101,17 @@ |
101
|
@update:value="mapSelectBorderHandle"
|
101
|
@update:value="mapSelectBorderHandle"
|
102
|
clearable
|
102
|
clearable
|
103
|
filterable
|
103
|
filterable
|
|
|
104
|
+ /> -->
|
|
|
105
|
+ <NSelect
|
|
|
106
|
+ size="small"
|
|
|
107
|
+ placeholder="请选择您要使用的弹窗"
|
|
|
108
|
+ style="width: 250px"
|
|
|
109
|
+ :value="mapSelectBorderValue"
|
|
|
110
|
+ :options="mapBorderOptions"
|
|
|
111
|
+ :render-label="renderMapBorderOption"
|
|
|
112
|
+ clearable
|
|
|
113
|
+ filterable
|
|
|
114
|
+ @update:value="selectMapBorderHandle"
|
104
|
/>
|
115
|
/>
|
105
|
</setting-item>
|
116
|
</setting-item>
|
106
|
</setting-item-box>
|
117
|
</setting-item-box>
|
|
@@ -238,74 +249,13 @@ const MarkerOptions = [ |
|
@@ -238,74 +249,13 @@ const MarkerOptions = [ |
238
|
onMounted(() => {
|
249
|
onMounted(() => {
|
239
|
props.optionData.mapOptions.typeMarker = getMarkerImagePath(props.optionData.mapOptions.typeMarker || 'position1.png')
|
250
|
props.optionData.mapOptions.typeMarker = getMarkerImagePath(props.optionData.mapOptions.typeMarker || 'position1.png')
|
240
|
typeMarkerValue.value = props.optionData.mapOptions.typeMarker || 'position1.png'
|
251
|
typeMarkerValue.value = props.optionData.mapOptions.typeMarker || 'position1.png'
|
241
|
- mapSelectBorderValue.value = props.optionData.mapOptions.mpBorderConfig.value || '弹窗边框1'
|
252
|
+ mapSelectBorderValue.value =
|
|
|
253
|
+ `${props.optionData.mapOptions.mpBorderConfig.value.toLocaleLowerCase()}.png` || 'border01.png'
|
242
|
})
|
254
|
})
|
243
|
|
255
|
|
244
|
const typeMarkerValue = ref<string | null>('position1.png')
|
256
|
const typeMarkerValue = ref<string | null>('position1.png')
|
245
|
|
257
|
|
246
|
-const mapSelectBorderValue = ref<string | null>('Border01')
|
|
|
247
|
-
|
|
|
248
|
-const mapSelectBorderOption = reactive<{ option: BaseSelectBorderIF[] }>({
|
|
|
249
|
- option: [
|
|
|
250
|
- {
|
|
|
251
|
- label: '弹窗边框1',
|
|
|
252
|
- value: 'Border01'
|
|
|
253
|
- },
|
|
|
254
|
- {
|
|
|
255
|
- label: '弹窗边框2',
|
|
|
256
|
- value: 'Border02'
|
|
|
257
|
- },
|
|
|
258
|
- {
|
|
|
259
|
- label: '弹窗边框3',
|
|
|
260
|
- value: 'Border03'
|
|
|
261
|
- },
|
|
|
262
|
- {
|
|
|
263
|
- label: '弹窗边框4',
|
|
|
264
|
- value: 'Border04'
|
|
|
265
|
- },
|
|
|
266
|
- {
|
|
|
267
|
- label: '弹窗边框5',
|
|
|
268
|
- value: 'Border05'
|
|
|
269
|
- },
|
|
|
270
|
- {
|
|
|
271
|
- label: '弹窗边框6',
|
|
|
272
|
- value: 'Border06'
|
|
|
273
|
- },
|
|
|
274
|
- {
|
|
|
275
|
- label: '弹窗边框7',
|
|
|
276
|
- value: 'Border07'
|
|
|
277
|
- },
|
|
|
278
|
- {
|
|
|
279
|
- label: '弹窗边框8',
|
|
|
280
|
- value: 'Border08'
|
|
|
281
|
- },
|
|
|
282
|
- {
|
|
|
283
|
- label: '弹窗边框9',
|
|
|
284
|
- value: 'Border09'
|
|
|
285
|
- },
|
|
|
286
|
- {
|
|
|
287
|
- label: '弹窗边框10',
|
|
|
288
|
- value: 'Border10'
|
|
|
289
|
- },
|
|
|
290
|
- {
|
|
|
291
|
- label: '弹窗边框11',
|
|
|
292
|
- value: 'Border11'
|
|
|
293
|
- },
|
|
|
294
|
- {
|
|
|
295
|
- label: '弹窗边框12',
|
|
|
296
|
- value: 'Border12'
|
|
|
297
|
- },
|
|
|
298
|
- {
|
|
|
299
|
- label: '弹窗边框13',
|
|
|
300
|
- value: 'Border13'
|
|
|
301
|
- }
|
|
|
302
|
- ]
|
|
|
303
|
-})
|
|
|
304
|
-
|
|
|
305
|
-const mapSelectBorderHandle = (value: string, option: BaseSelectBorderIF) => {
|
|
|
306
|
- mapSelectBorderValue.value = value
|
|
|
307
|
- ;(props.optionData.mapOptions.mpBorderConfig as BaseSelectBorderIF) = { ...option }
|
|
|
308
|
-}
|
258
|
+const mapSelectBorderValue = ref<string | null>('border01.png')
|
309
|
|
259
|
|
310
|
const isHref = (url: string) => {
|
260
|
const isHref = (url: string) => {
|
311
|
try {
|
261
|
try {
|
|
@@ -349,4 +299,47 @@ const selectHandle = (value: string) => { |
|
@@ -349,4 +299,47 @@ const selectHandle = (value: string) => { |
349
|
typeMarkerValue.value = value
|
299
|
typeMarkerValue.value = value
|
350
|
props.optionData.mapOptions.typeMarker = getMarkerImagePath(value)
|
300
|
props.optionData.mapOptions.typeMarker = getMarkerImagePath(value)
|
351
|
}
|
301
|
}
|
|
|
302
|
+
|
|
|
303
|
+const needBorder = ['border01.png', 'border02.png', 'border03.png', 'border05.png', 'border07.png']
|
|
|
304
|
+
|
|
|
305
|
+// import.meta.glob 这个不能封装,必须是字符串,不能通过传值传进去
|
|
|
306
|
+const mapBorderOptions = computed(() => {
|
|
|
307
|
+ const pathList = import.meta.glob('../../../../../../assets/images/chart/decorates/*')
|
|
|
308
|
+ return Object.keys(pathList)
|
|
|
309
|
+ .map(item => {
|
|
|
310
|
+ const imgName = item.split('/').at(-1) as string
|
|
|
311
|
+ if (needBorder.includes(imgName)) {
|
|
|
312
|
+ return {
|
|
|
313
|
+ label: imgName,
|
|
|
314
|
+ value: imgName
|
|
|
315
|
+ } as SelectOption
|
|
|
316
|
+ }
|
|
|
317
|
+ })
|
|
|
318
|
+ .filter(Boolean) as SelectOption[]
|
|
|
319
|
+})
|
|
|
320
|
+//
|
|
|
321
|
+
|
|
|
322
|
+const getMapBorderImagePath = (name: string) => {
|
|
|
323
|
+ return isHref(name) ? name : new URL(`../../../../../../assets/images/chart/decorates/${name}`, import.meta.url).href
|
|
|
324
|
+}
|
|
|
325
|
+
|
|
|
326
|
+const renderMapBorderOption = (option: SelectOption) => {
|
|
|
327
|
+ return h(NSpace, { justify: 'space-between', style: 'padding: 0 15px; height: 28px; line-height: 28px;' }, () => [
|
|
|
328
|
+ h(NImage, {
|
|
|
329
|
+ width: 25,
|
|
|
330
|
+ src: getMapBorderImagePath(option.value as string),
|
|
|
331
|
+ previewDisabled: true,
|
|
|
332
|
+ style: { height: '25px' }
|
|
|
333
|
+ } as Recordable),
|
|
|
334
|
+ h(NEllipsis, null, () => option.label)
|
|
|
335
|
+ ])
|
|
|
336
|
+}
|
|
|
337
|
+
|
|
|
338
|
+const selectMapBorderHandle = (value: string) => {
|
|
|
339
|
+ mapSelectBorderValue.value = value
|
|
|
340
|
+ const toLowerValue = value.toLocaleLowerCase()
|
|
|
341
|
+ ;(props.optionData.mapOptions.mpBorderConfig as BaseSelectBorderIF) = {
|
|
|
342
|
+ value: toLowerValue[0]?.toUpperCase() + toLowerValue?.substr(1)?.split('.')[0]
|
|
|
343
|
+ }
|
|
|
344
|
+}
|
352
|
</script> |
345
|
</script> |