@arronqzy/vue-view 0.1.0 → 0.1.2
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 +9 -6
- package/src/panel/VueViewOnlinePreview.vue +15 -7
- package/src/panel/VueViewPanel.vue +81 -55
- package/src/panel/components/ConfigHintIcon.vue +4 -2
- package/src/panel/components/ElementsLayer.vue +15 -0
- package/src/panel/components/MaterialPreview.vue +19 -1
- package/src/panel/components/MaterialSidebar.vue +35 -31
- package/src/panel/components/MaterialSidebarTreeNode.vue +27 -26
- package/src/panel/components/MoveableLayer.vue +7 -4
- package/src/panel/components/PanelConfigSidebar.vue +57 -39
- package/src/panel/components/ViewElementScopePanel.vue +6 -4
- package/src/panel/components/WorkspaceConfigSidebar.vue +7 -1
- package/src/panel/components/WorkspaceProjectNav.vue +23 -16
- package/src/panel/components/WorkspaceStageSplit.vue +10 -7
- package/src/panel/components/config/ConfigColorField.vue +3 -1
- package/src/panel/components/config/PanelConfigAudioSection.vue +44 -43
- package/src/panel/components/config/PanelConfigChartSection.vue +79 -76
- package/src/panel/components/config/PanelConfigGeometrySection.vue +21 -19
- package/src/panel/components/config/PanelConfigGridChildSpan.vue +7 -5
- package/src/panel/components/config/PanelConfigGridSection.vue +10 -8
- package/src/panel/components/config/PanelConfigImageSection.vue +22 -21
- package/src/panel/components/config/PanelConfigMultiSelect.vue +42 -40
- package/src/panel/components/config/PanelConfigNodeInfo.vue +19 -16
- package/src/panel/components/config/PanelConfigReferenceSection.vue +11 -9
- package/src/panel/components/config/PanelConfigStyleSections.vue +27 -26
- package/src/panel/components/config/PanelConfigTextSection.vue +20 -17
- package/src/panel/components/config/PanelConfigVideoSection.vue +15 -14
- package/src/panel/components/config/shared.ts +0 -3
- package/src/panel/components/elementsLayerNodes.ts +37 -18
- package/src/panel/components/materialSidebarData.ts +73 -54
- package/src/panel/components/scope-config/ScopeTemplatePreviewHost.vue +7 -2
- package/src/panel/components/scope-config/ScopeTemplatePreviewPanel.vue +6 -3
- package/src/panel/components/scope-config/ScopeTemplateUsageHint.vue +7 -16
- package/src/panel/components/scope-config/ScopeTemplateWarningsPanel.vue +4 -2
- package/src/panel/components/table/ConditionEditor.vue +181 -0
- package/src/panel/components/table/JsonCodeEditor.vue +148 -0
- package/src/panel/components/table/PanelConfigTableSection.vue +2033 -0
- package/src/panel/components/table/TableNodeContent.vue +557 -0
- package/src/panel/constants/messages.ts +76 -34
- package/src/panel/hooks/usePanelElements.ts +54 -41
- package/src/panel/hooks/useWorkspaceProjects.ts +8 -5
- package/src/panel/types.ts +4 -0
- package/src/panel/utils/panelElementDefaults.ts +73 -39
- package/src/panel/utils/scope-field-labels.ts +53 -39
- package/src/panel/utils/scope-template-spread.ts +57 -24
- package/src/panel/utils/scope-template-warnings.ts +23 -22
- package/src/panel/utils/scope-template.ts +80 -0
- package/src/tailwind.css +18 -10
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useI18n } from "@arronqzy/i18n/vue";
|
|
2
3
|
import { computed, ref, watch } from "vue";
|
|
3
4
|
import { Checkbox, Collapse, Input, InputNumber, Select, Textarea } from "ant-design-vue";
|
|
4
5
|
import type { PanelChartConfig, PanelElement } from "../../types";
|
|
@@ -14,6 +15,8 @@ import ConfigFieldGroup from "./ConfigFieldGroup.vue";
|
|
|
14
15
|
import ConfigHintIcon from "../ConfigHintIcon.vue";
|
|
15
16
|
import ConfigSection from "./ConfigSection.vue";
|
|
16
17
|
|
|
18
|
+
const { t, locale } = useI18n();
|
|
19
|
+
|
|
17
20
|
type ChartType =
|
|
18
21
|
| "bar"
|
|
19
22
|
| "line"
|
|
@@ -112,21 +115,21 @@ function onOptionJsonChange(v: string) {
|
|
|
112
115
|
updateChart({ option: parsed });
|
|
113
116
|
optionJsonError.value = null;
|
|
114
117
|
} catch {
|
|
115
|
-
optionJsonError.value = "
|
|
118
|
+
optionJsonError.value = t("panel.config.jsonInvalid");
|
|
116
119
|
}
|
|
117
120
|
}
|
|
118
121
|
</script>
|
|
119
122
|
|
|
120
123
|
<template>
|
|
121
124
|
<ConfigSection
|
|
122
|
-
title="
|
|
125
|
+
:title="t('panel.config.sectionChartBasic')"
|
|
123
126
|
:open="basicOpen"
|
|
124
127
|
:force-open="forceOpen"
|
|
125
128
|
@update:open="emit('update:basicOpen', $event)"
|
|
126
129
|
>
|
|
127
|
-
<ConfigFieldGroup title="
|
|
130
|
+
<ConfigFieldGroup :title="t('panel.config.groupBasicDisplay')">
|
|
128
131
|
<label class="block space-y-1.5">
|
|
129
|
-
<div
|
|
132
|
+
<div>{{ t("panel.config.title") }}</div>
|
|
130
133
|
<Input
|
|
131
134
|
size="small"
|
|
132
135
|
:value="element.chart?.title ?? ''"
|
|
@@ -135,7 +138,7 @@ function onOptionJsonChange(v: string) {
|
|
|
135
138
|
/>
|
|
136
139
|
</label>
|
|
137
140
|
<ConfigColorField
|
|
138
|
-
label="
|
|
141
|
+
:label="t('panel.config.primaryColor')"
|
|
139
142
|
:value="element.chart?.color ?? '#3b82f6'"
|
|
140
143
|
:disabled="!isEditable"
|
|
141
144
|
@update:value="(v) => updateChart({ color: v || '#3b82f6' })"
|
|
@@ -146,23 +149,23 @@ function onOptionJsonChange(v: string) {
|
|
|
146
149
|
:disabled="!isEditable"
|
|
147
150
|
@update:checked="(v) => updateChart({ colorMode: v ? 'gradient' : 'solid' })"
|
|
148
151
|
/>
|
|
149
|
-
<span
|
|
152
|
+
<span>{{ t("panel.config.usePrimaryGradient") }}</span>
|
|
150
153
|
</label>
|
|
151
154
|
<div v-if="element.chart?.colorMode === 'gradient'" class="grid grid-cols-2 gap-2">
|
|
152
155
|
<ConfigColorField
|
|
153
|
-
label="
|
|
156
|
+
:label="t('panel.scope.fieldChartGradientFrom')"
|
|
154
157
|
:value="element.chart?.gradientFrom ?? element.chart?.color ?? '#3b82f6'"
|
|
155
158
|
:disabled="!isEditable"
|
|
156
159
|
@update:value="(v) => updateChart({ gradientFrom: v || '#3b82f6' })"
|
|
157
160
|
/>
|
|
158
161
|
<ConfigColorField
|
|
159
|
-
label="
|
|
162
|
+
:label="t('panel.scope.fieldChartGradientTo')"
|
|
160
163
|
:value="element.chart?.gradientTo ?? '#22d3ee'"
|
|
161
164
|
:disabled="!isEditable"
|
|
162
165
|
@update:value="(v) => updateChart({ gradientTo: v || '#22d3ee' })"
|
|
163
166
|
/>
|
|
164
167
|
<label class="col-span-2 block space-y-1">
|
|
165
|
-
<div
|
|
168
|
+
<div>{{ t("panel.config.gradientDirection") }}</div>
|
|
166
169
|
<Select
|
|
167
170
|
size="small"
|
|
168
171
|
class="w-full"
|
|
@@ -170,14 +173,14 @@ function onOptionJsonChange(v: string) {
|
|
|
170
173
|
:disabled="!isEditable"
|
|
171
174
|
@update:value="(v) => updateChart({ gradientDirection: v as PanelChartConfig['gradientDirection'] })"
|
|
172
175
|
>
|
|
173
|
-
<Select.Option value="to-right"
|
|
174
|
-
<Select.Option value="to-bottom"
|
|
175
|
-
<Select.Option value="to-bottom-right"
|
|
176
|
-
<Select.Option value="to-top-right"
|
|
176
|
+
<Select.Option value="to-right">{{ t("panel.config.dirToRight") }}</Select.Option>
|
|
177
|
+
<Select.Option value="to-bottom">{{ t("panel.config.dirToBottom") }}</Select.Option>
|
|
178
|
+
<Select.Option value="to-bottom-right">{{ t("panel.config.dirToBottomRight") }}</Select.Option>
|
|
179
|
+
<Select.Option value="to-top-right">{{ t("panel.config.dirToTopRight") }}</Select.Option>
|
|
177
180
|
</Select>
|
|
178
181
|
</label>
|
|
179
182
|
<div class="col-span-2 space-y-1">
|
|
180
|
-
<div class="text-[11px] text-gray-500"
|
|
183
|
+
<div class="text-[11px] text-gray-500">{{ t("panel.config.gradientPreview") }}</div>
|
|
181
184
|
<div
|
|
182
185
|
class="h-6 rounded border border-gray-200/60"
|
|
183
186
|
:style="{
|
|
@@ -191,7 +194,7 @@ function onOptionJsonChange(v: string) {
|
|
|
191
194
|
</div>
|
|
192
195
|
</div>
|
|
193
196
|
<label class="block space-y-1.5">
|
|
194
|
-
<div
|
|
197
|
+
<div>{{ t("panel.config.renderMode") }}</div>
|
|
195
198
|
<Select
|
|
196
199
|
size="small"
|
|
197
200
|
class="w-full"
|
|
@@ -205,7 +208,7 @@ function onOptionJsonChange(v: string) {
|
|
|
205
208
|
</label>
|
|
206
209
|
</ConfigFieldGroup>
|
|
207
210
|
|
|
208
|
-
<ConfigFieldGroup title="
|
|
211
|
+
<ConfigFieldGroup :title="t('panel.config.groupTooltip')">
|
|
209
212
|
<div class="grid grid-cols-2 gap-2">
|
|
210
213
|
<label class="flex items-center gap-2">
|
|
211
214
|
<Checkbox
|
|
@@ -213,10 +216,10 @@ function onOptionJsonChange(v: string) {
|
|
|
213
216
|
:disabled="!isEditable"
|
|
214
217
|
@update:checked="(v) => updateChart({ tooltipShow: v === true })"
|
|
215
218
|
/>
|
|
216
|
-
<span
|
|
219
|
+
<span>{{ t("panel.config.showTooltip") }}</span>
|
|
217
220
|
</label>
|
|
218
221
|
<label class="block space-y-1">
|
|
219
|
-
<div>
|
|
222
|
+
<div>{{ t("panel.config.tooltipTrigger") }}</div>
|
|
220
223
|
<Select
|
|
221
224
|
size="small"
|
|
222
225
|
class="w-full"
|
|
@@ -231,13 +234,13 @@ function onOptionJsonChange(v: string) {
|
|
|
231
234
|
</div>
|
|
232
235
|
<div class="grid grid-cols-2 gap-2">
|
|
233
236
|
<ConfigColorField
|
|
234
|
-
label="
|
|
237
|
+
:label="t('panel.scope.fieldChartTooltipBackgroundColor')"
|
|
235
238
|
:value="element.chart?.tooltipBackgroundColor ?? '#0f172a'"
|
|
236
239
|
:disabled="!isEditable"
|
|
237
240
|
@update:value="(v) => updateChart({ tooltipBackgroundColor: v || '#0f172a' })"
|
|
238
241
|
/>
|
|
239
242
|
<ConfigColorField
|
|
240
|
-
label="
|
|
243
|
+
:label="t('panel.scope.fieldChartTooltipTextColor')"
|
|
241
244
|
:value="element.chart?.tooltipTextColor ?? '#f8fafc'"
|
|
242
245
|
:disabled="!isEditable"
|
|
243
246
|
@update:value="(v) => updateChart({ tooltipTextColor: v || '#f8fafc' })"
|
|
@@ -245,25 +248,25 @@ function onOptionJsonChange(v: string) {
|
|
|
245
248
|
</div>
|
|
246
249
|
<label class="block space-y-1">
|
|
247
250
|
<div class="flex items-center gap-1">
|
|
248
|
-
<span>
|
|
251
|
+
<span>{{ t("panel.config.tooltipFormatter") }}</span>
|
|
249
252
|
<ConfigHintIcon label="Tooltip Formatter" content-class="max-w-[360px]">
|
|
250
|
-
<div class="font-medium"
|
|
251
|
-
<div>{
|
|
253
|
+
<div class="font-medium">{{ t("panel.config.formatterPlaceholdersTitle") }}</div>
|
|
254
|
+
<div>{{ t("panel.config.formatterPlaceholders") }}</div>
|
|
252
255
|
</ConfigHintIcon>
|
|
253
256
|
</div>
|
|
254
257
|
<Input
|
|
255
258
|
size="small"
|
|
256
259
|
:value="element.chart?.tooltipFormatter ?? ''"
|
|
257
260
|
:disabled="!isEditable"
|
|
258
|
-
placeholder="
|
|
261
|
+
:placeholder="t('panel.config.tooltipFormatterPlaceholder')"
|
|
259
262
|
@update:value="(v: string) => updateChart({ tooltipFormatter: v || undefined })"
|
|
260
263
|
/>
|
|
261
264
|
</label>
|
|
262
265
|
</ConfigFieldGroup>
|
|
263
266
|
|
|
264
|
-
<ConfigFieldGroup title="
|
|
267
|
+
<ConfigFieldGroup :title="t('panel.config.groupData')">
|
|
265
268
|
<label class="block space-y-1">
|
|
266
|
-
<div
|
|
269
|
+
<div>{{ t("panel.config.labelsCsv") }}</div>
|
|
267
270
|
<Input
|
|
268
271
|
size="small"
|
|
269
272
|
:value="getChartLabelsDisplayText(element.chart)"
|
|
@@ -272,7 +275,7 @@ function onOptionJsonChange(v: string) {
|
|
|
272
275
|
/>
|
|
273
276
|
</label>
|
|
274
277
|
<label class="block space-y-1">
|
|
275
|
-
<div
|
|
278
|
+
<div>{{ t("panel.config.valuesCsv") }}</div>
|
|
276
279
|
<Input
|
|
277
280
|
size="small"
|
|
278
281
|
:value="getChartValuesDisplayText(element.chart)"
|
|
@@ -284,11 +287,11 @@ function onOptionJsonChange(v: string) {
|
|
|
284
287
|
|
|
285
288
|
<ConfigFieldGroup
|
|
286
289
|
v-if="['bar', 'line', 'area', 'scatter'].includes(selectedChartType)"
|
|
287
|
-
title="
|
|
290
|
+
:title="t('panel.config.groupAxes')"
|
|
288
291
|
>
|
|
289
292
|
<div class="grid grid-cols-2 gap-2">
|
|
290
293
|
<label class="block">
|
|
291
|
-
<div class="mb-1">
|
|
294
|
+
<div class="mb-1">{{ t("panel.scope.fieldChartXAxisName") }}</div>
|
|
292
295
|
<Input
|
|
293
296
|
size="small"
|
|
294
297
|
:value="element.chart?.xAxisName ?? ''"
|
|
@@ -297,7 +300,7 @@ function onOptionJsonChange(v: string) {
|
|
|
297
300
|
/>
|
|
298
301
|
</label>
|
|
299
302
|
<label class="block">
|
|
300
|
-
<div class="mb-1">
|
|
303
|
+
<div class="mb-1">{{ t("panel.scope.fieldChartYAxisName") }}</div>
|
|
301
304
|
<Input
|
|
302
305
|
size="small"
|
|
303
306
|
:value="element.chart?.yAxisName ?? ''"
|
|
@@ -313,7 +316,7 @@ function onOptionJsonChange(v: string) {
|
|
|
313
316
|
:disabled="!isEditable"
|
|
314
317
|
@update:checked="(v) => updateChart({ xAxisTickShow: v === true })"
|
|
315
318
|
/>
|
|
316
|
-
<span>
|
|
319
|
+
<span>{{ t("panel.config.xAxisTick") }}</span>
|
|
317
320
|
</label>
|
|
318
321
|
<label class="flex items-center gap-2">
|
|
319
322
|
<Checkbox
|
|
@@ -321,18 +324,18 @@ function onOptionJsonChange(v: string) {
|
|
|
321
324
|
:disabled="!isEditable"
|
|
322
325
|
@update:checked="(v) => updateChart({ yAxisTickShow: v === true })"
|
|
323
326
|
/>
|
|
324
|
-
<span>
|
|
327
|
+
<span>{{ t("panel.config.yAxisTick") }}</span>
|
|
325
328
|
</label>
|
|
326
329
|
</div>
|
|
327
330
|
<div class="grid grid-cols-2 gap-2">
|
|
328
331
|
<ConfigColorField
|
|
329
|
-
label="
|
|
332
|
+
:label="t('panel.config.xAxisTickColor')"
|
|
330
333
|
:value="element.chart?.xAxisTickColor ?? '#94a3b8'"
|
|
331
334
|
:disabled="!isEditable"
|
|
332
335
|
@update:value="(v) => updateChart({ xAxisTickColor: v || '#94a3b8' })"
|
|
333
336
|
/>
|
|
334
337
|
<ConfigColorField
|
|
335
|
-
label="
|
|
338
|
+
:label="t('panel.config.yAxisTickColor')"
|
|
336
339
|
:value="element.chart?.yAxisTickColor ?? '#94a3b8'"
|
|
337
340
|
:disabled="!isEditable"
|
|
338
341
|
@update:value="(v) => updateChart({ yAxisTickColor: v || '#94a3b8' })"
|
|
@@ -345,7 +348,7 @@ function onOptionJsonChange(v: string) {
|
|
|
345
348
|
:disabled="!isEditable"
|
|
346
349
|
@update:checked="(v) => updateChart({ xAxisSplitLineShow: v === true })"
|
|
347
350
|
/>
|
|
348
|
-
<span>
|
|
351
|
+
<span>{{ t("panel.config.xAxisSplitLine") }}</span>
|
|
349
352
|
</label>
|
|
350
353
|
<label class="flex items-center gap-2">
|
|
351
354
|
<Checkbox
|
|
@@ -353,18 +356,18 @@ function onOptionJsonChange(v: string) {
|
|
|
353
356
|
:disabled="!isEditable"
|
|
354
357
|
@update:checked="(v) => updateChart({ yAxisSplitLineShow: v === true })"
|
|
355
358
|
/>
|
|
356
|
-
<span>
|
|
359
|
+
<span>{{ t("panel.config.yAxisSplitLine") }}</span>
|
|
357
360
|
</label>
|
|
358
361
|
</div>
|
|
359
362
|
<div class="grid grid-cols-2 gap-2">
|
|
360
363
|
<ConfigColorField
|
|
361
|
-
label="
|
|
364
|
+
:label="t('panel.scope.fieldChartXAxisLabelColor')"
|
|
362
365
|
:value="element.chart?.xAxisLabelColor ?? '#64748b'"
|
|
363
366
|
:disabled="!isEditable"
|
|
364
367
|
@update:value="(v) => updateChart({ xAxisLabelColor: v || '#64748b' })"
|
|
365
368
|
/>
|
|
366
369
|
<ConfigColorField
|
|
367
|
-
label="
|
|
370
|
+
:label="t('panel.scope.fieldChartYAxisLabelColor')"
|
|
368
371
|
:value="element.chart?.yAxisLabelColor ?? '#64748b'"
|
|
369
372
|
:disabled="!isEditable"
|
|
370
373
|
@update:value="(v) => updateChart({ yAxisLabelColor: v || '#64748b' })"
|
|
@@ -372,7 +375,7 @@ function onOptionJsonChange(v: string) {
|
|
|
372
375
|
</div>
|
|
373
376
|
<div class="grid grid-cols-2 gap-2">
|
|
374
377
|
<label class="block">
|
|
375
|
-
<div class="mb-1">
|
|
378
|
+
<div class="mb-1">{{ t("panel.config.xAxisLabelFontSize") }}</div>
|
|
376
379
|
<InputNumber
|
|
377
380
|
size="small"
|
|
378
381
|
class="w-full"
|
|
@@ -387,7 +390,7 @@ function onOptionJsonChange(v: string) {
|
|
|
387
390
|
/>
|
|
388
391
|
</label>
|
|
389
392
|
<label class="block">
|
|
390
|
-
<div class="mb-1">
|
|
393
|
+
<div class="mb-1">{{ t("panel.config.yAxisLabelFontSize") }}</div>
|
|
391
394
|
<InputNumber
|
|
392
395
|
size="small"
|
|
393
396
|
class="w-full"
|
|
@@ -406,10 +409,10 @@ function onOptionJsonChange(v: string) {
|
|
|
406
409
|
|
|
407
410
|
<ConfigFieldGroup
|
|
408
411
|
v-if="['bar', 'line', 'area', 'pie'].includes(selectedChartType)"
|
|
409
|
-
title="
|
|
412
|
+
:title="t('panel.config.groupSeries')"
|
|
410
413
|
>
|
|
411
414
|
<label v-if="selectedChartType === 'bar'" class="block space-y-1">
|
|
412
|
-
<div
|
|
415
|
+
<div>{{ t("panel.config.barWidthPx") }}</div>
|
|
413
416
|
<InputNumber
|
|
414
417
|
size="small"
|
|
415
418
|
class="w-full"
|
|
@@ -431,11 +434,11 @@ function onOptionJsonChange(v: string) {
|
|
|
431
434
|
:disabled="!isEditable"
|
|
432
435
|
@update:checked="(v) => updateChart({ smooth: v === true })"
|
|
433
436
|
/>
|
|
434
|
-
<span
|
|
437
|
+
<span>{{ t("panel.config.smooth") }}</span>
|
|
435
438
|
</label>
|
|
436
439
|
<div v-if="selectedChartType === 'pie'" class="grid grid-cols-2 gap-2">
|
|
437
440
|
<label class="block space-y-1">
|
|
438
|
-
<div
|
|
441
|
+
<div>{{ t("panel.config.pieInnerRadiusPct") }}</div>
|
|
439
442
|
<InputNumber
|
|
440
443
|
size="small"
|
|
441
444
|
class="w-full"
|
|
@@ -450,7 +453,7 @@ function onOptionJsonChange(v: string) {
|
|
|
450
453
|
/>
|
|
451
454
|
</label>
|
|
452
455
|
<label class="block space-y-1">
|
|
453
|
-
<div
|
|
456
|
+
<div>{{ t("panel.config.pieOuterRadiusPct") }}</div>
|
|
454
457
|
<InputNumber
|
|
455
458
|
size="small"
|
|
456
459
|
class="w-full"
|
|
@@ -469,17 +472,17 @@ function onOptionJsonChange(v: string) {
|
|
|
469
472
|
</ConfigSection>
|
|
470
473
|
|
|
471
474
|
<ConfigSection
|
|
472
|
-
title="
|
|
475
|
+
:title="t('panel.config.sectionChartAdvanced')"
|
|
473
476
|
:open="advancedOpen"
|
|
474
477
|
:force-open="forceOpen"
|
|
475
478
|
@update:open="emit('update:advancedOpen', $event)"
|
|
476
479
|
>
|
|
477
|
-
<ConfigFieldGroup title="
|
|
480
|
+
<ConfigFieldGroup :title="t('panel.config.groupCommonForm')">
|
|
478
481
|
<Collapse ghost size="small">
|
|
479
|
-
<Collapse.Panel key="layout" header="
|
|
482
|
+
<Collapse.Panel key="layout" :header="t('panel.config.groupLayoutAndCoord')">
|
|
480
483
|
<div class="grid grid-cols-2 gap-2">
|
|
481
484
|
<label class="block space-y-1">
|
|
482
|
-
<div class="text-[11px]"
|
|
485
|
+
<div class="text-[11px]">{{ t("panel.config.gridLeftForm") }}</div>
|
|
483
486
|
<InputNumber
|
|
484
487
|
size="small"
|
|
485
488
|
class="w-full"
|
|
@@ -489,7 +492,7 @@ function onOptionJsonChange(v: string) {
|
|
|
489
492
|
/>
|
|
490
493
|
</label>
|
|
491
494
|
<label class="block space-y-1">
|
|
492
|
-
<div class="text-[11px]"
|
|
495
|
+
<div class="text-[11px]">{{ t("panel.config.gridRightForm") }}</div>
|
|
493
496
|
<InputNumber
|
|
494
497
|
size="small"
|
|
495
498
|
class="w-full"
|
|
@@ -499,7 +502,7 @@ function onOptionJsonChange(v: string) {
|
|
|
499
502
|
/>
|
|
500
503
|
</label>
|
|
501
504
|
<label class="block space-y-1">
|
|
502
|
-
<div class="text-[11px]"
|
|
505
|
+
<div class="text-[11px]">{{ t("panel.config.legendPositionForm") }}</div>
|
|
503
506
|
<Select
|
|
504
507
|
size="small"
|
|
505
508
|
class="w-full"
|
|
@@ -507,14 +510,14 @@ function onOptionJsonChange(v: string) {
|
|
|
507
510
|
:disabled="!isEditable"
|
|
508
511
|
@update:value="(v) => updateOptionForm({ legend: { top: v } })"
|
|
509
512
|
>
|
|
510
|
-
<Select.Option value="top"
|
|
511
|
-
<Select.Option value="bottom"
|
|
512
|
-
<Select.Option value="left"
|
|
513
|
-
<Select.Option value="right"
|
|
513
|
+
<Select.Option value="top">{{ t("panel.config.legendTop") }}</Select.Option>
|
|
514
|
+
<Select.Option value="bottom">{{ t("panel.config.legendBottom") }}</Select.Option>
|
|
515
|
+
<Select.Option value="left">{{ t("panel.config.legendLeft") }}</Select.Option>
|
|
516
|
+
<Select.Option value="right">{{ t("panel.config.legendRight") }}</Select.Option>
|
|
514
517
|
</Select>
|
|
515
518
|
</label>
|
|
516
519
|
<label class="block space-y-1">
|
|
517
|
-
<div class="text-[11px]"
|
|
520
|
+
<div class="text-[11px]">{{ t("panel.config.legendOrientForm") }}</div>
|
|
518
521
|
<Select
|
|
519
522
|
size="small"
|
|
520
523
|
class="w-full"
|
|
@@ -522,13 +525,13 @@ function onOptionJsonChange(v: string) {
|
|
|
522
525
|
:disabled="!isEditable"
|
|
523
526
|
@update:value="(v) => updateOptionForm({ legend: { orient: v } })"
|
|
524
527
|
>
|
|
525
|
-
<Select.Option value="horizontal"
|
|
526
|
-
<Select.Option value="vertical"
|
|
528
|
+
<Select.Option value="horizontal">{{ t("panel.config.legendHorizontal") }}</Select.Option>
|
|
529
|
+
<Select.Option value="vertical">{{ t("panel.config.legendVertical") }}</Select.Option>
|
|
527
530
|
</Select>
|
|
528
531
|
</label>
|
|
529
532
|
</div>
|
|
530
533
|
</Collapse.Panel>
|
|
531
|
-
<Collapse.Panel key="highfreq" header="
|
|
534
|
+
<Collapse.Panel key="highfreq" :header="t('panel.config.groupHighFreq')">
|
|
532
535
|
<div class="space-y-2">
|
|
533
536
|
<label class="flex items-center gap-2">
|
|
534
537
|
<Checkbox
|
|
@@ -536,7 +539,7 @@ function onOptionJsonChange(v: string) {
|
|
|
536
539
|
:disabled="!isEditable"
|
|
537
540
|
@update:checked="(v) => updateOptionForm({ legend: { show: v === true } })"
|
|
538
541
|
/>
|
|
539
|
-
<span
|
|
542
|
+
<span>{{ t("panel.config.showLegend") }}</span>
|
|
540
543
|
</label>
|
|
541
544
|
<label class="flex items-center gap-2">
|
|
542
545
|
<Checkbox
|
|
@@ -544,7 +547,7 @@ function onOptionJsonChange(v: string) {
|
|
|
544
547
|
:disabled="!isEditable"
|
|
545
548
|
@update:checked="(v) => updateOptionForm({ grid: { containLabel: v === true } })"
|
|
546
549
|
/>
|
|
547
|
-
<span
|
|
550
|
+
<span>{{ t("panel.config.gridContainLabel") }}</span>
|
|
548
551
|
</label>
|
|
549
552
|
<label class="flex items-center gap-2">
|
|
550
553
|
<Checkbox
|
|
@@ -552,7 +555,7 @@ function onOptionJsonChange(v: string) {
|
|
|
552
555
|
:disabled="!isEditable"
|
|
553
556
|
@update:checked="(v) => toggleDataZoom('inside', v === true)"
|
|
554
557
|
/>
|
|
555
|
-
<span
|
|
558
|
+
<span>{{ t("panel.config.zoomInside") }}</span>
|
|
556
559
|
</label>
|
|
557
560
|
<label class="flex items-center gap-2">
|
|
558
561
|
<Checkbox
|
|
@@ -560,7 +563,7 @@ function onOptionJsonChange(v: string) {
|
|
|
560
563
|
:disabled="!isEditable"
|
|
561
564
|
@update:checked="(v) => toggleDataZoom('slider', v === true)"
|
|
562
565
|
/>
|
|
563
|
-
<span
|
|
566
|
+
<span>{{ t("panel.config.zoomSlider") }}</span>
|
|
564
567
|
</label>
|
|
565
568
|
<label class="flex items-center gap-2">
|
|
566
569
|
<Checkbox
|
|
@@ -568,10 +571,10 @@ function onOptionJsonChange(v: string) {
|
|
|
568
571
|
:disabled="!isEditable"
|
|
569
572
|
@update:checked="(v) => updateOptionForm({ animation: v === true })"
|
|
570
573
|
/>
|
|
571
|
-
<span
|
|
574
|
+
<span>{{ t("panel.config.enableAnimation") }}</span>
|
|
572
575
|
</label>
|
|
573
576
|
<label class="block space-y-1">
|
|
574
|
-
<div class="text-[11px]"
|
|
577
|
+
<div class="text-[11px]">{{ t("panel.config.animationDurationMs") }}</div>
|
|
575
578
|
<InputNumber
|
|
576
579
|
size="small"
|
|
577
580
|
class="w-full"
|
|
@@ -583,7 +586,7 @@ function onOptionJsonChange(v: string) {
|
|
|
583
586
|
</label>
|
|
584
587
|
</div>
|
|
585
588
|
</Collapse.Panel>
|
|
586
|
-
<Collapse.Panel key="axisPointer" header="
|
|
589
|
+
<Collapse.Panel key="axisPointer" :header="t('panel.config.groupAxisPointer')">
|
|
587
590
|
<div class="space-y-2">
|
|
588
591
|
<label class="flex items-center gap-2">
|
|
589
592
|
<Checkbox
|
|
@@ -591,10 +594,10 @@ function onOptionJsonChange(v: string) {
|
|
|
591
594
|
:disabled="!isEditable"
|
|
592
595
|
@update:checked="(v) => updateOptionForm({ axisPointer: { show: v === true } })"
|
|
593
596
|
/>
|
|
594
|
-
<span
|
|
597
|
+
<span>{{ t("panel.config.showAxisPointer") }}</span>
|
|
595
598
|
</label>
|
|
596
599
|
<label class="block space-y-1">
|
|
597
|
-
<div class="text-[11px]"
|
|
600
|
+
<div class="text-[11px]">{{ t("panel.config.axisPointerType") }}</div>
|
|
598
601
|
<Select
|
|
599
602
|
size="small"
|
|
600
603
|
class="w-full"
|
|
@@ -602,9 +605,9 @@ function onOptionJsonChange(v: string) {
|
|
|
602
605
|
:disabled="!isEditable"
|
|
603
606
|
@update:value="(v) => updateOptionForm({ axisPointer: { type: v } })"
|
|
604
607
|
>
|
|
605
|
-
<Select.Option value="line"
|
|
606
|
-
<Select.Option value="shadow"
|
|
607
|
-
<Select.Option value="cross"
|
|
608
|
+
<Select.Option value="line">{{ t("panel.config.axisPointerLine") }}</Select.Option>
|
|
609
|
+
<Select.Option value="shadow">{{ t("panel.config.axisPointerShadow") }}</Select.Option>
|
|
610
|
+
<Select.Option value="cross">{{ t("panel.config.axisPointerCross") }}</Select.Option>
|
|
608
611
|
</Select>
|
|
609
612
|
</label>
|
|
610
613
|
</div>
|
|
@@ -612,15 +615,15 @@ function onOptionJsonChange(v: string) {
|
|
|
612
615
|
</Collapse>
|
|
613
616
|
</ConfigFieldGroup>
|
|
614
617
|
|
|
615
|
-
<ConfigFieldGroup title="
|
|
618
|
+
<ConfigFieldGroup :title="t('panel.config.groupJsonAdvanced')">
|
|
616
619
|
<label class="flex items-center gap-2">
|
|
617
620
|
<Checkbox
|
|
618
621
|
v-model:checked="isAdvancedOptionMode"
|
|
619
622
|
:disabled="!isEditable"
|
|
620
623
|
/>
|
|
621
|
-
<span
|
|
622
|
-
<ConfigHintIcon label="
|
|
623
|
-
|
|
624
|
+
<span>{{ t("panel.config.enableAdvancedJson") }}</span>
|
|
625
|
+
<ConfigHintIcon :label="t('panel.config.advancedJsonHintLabel')">
|
|
626
|
+
{{ t("panel.config.advancedJsonHint") }}
|
|
624
627
|
</ConfigHintIcon>
|
|
625
628
|
</label>
|
|
626
629
|
<template v-if="isAdvancedOptionMode">
|
|
@@ -642,7 +645,7 @@ function onOptionJsonChange(v: string) {
|
|
|
642
645
|
v-else
|
|
643
646
|
class="rounded border border-emerald-500/30 bg-emerald-500/10 px-2 py-1.5 text-[11px] text-emerald-700"
|
|
644
647
|
>
|
|
645
|
-
|
|
648
|
+
{{ t("panel.config.jsonValidApplied") }}
|
|
646
649
|
</div>
|
|
647
650
|
</template>
|
|
648
651
|
</ConfigFieldGroup>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useI18n } from "@arronqzy/i18n/vue";
|
|
2
3
|
import { onMounted, ref, watch } from "vue";
|
|
3
4
|
import { Input, InputNumber, Select, Textarea } from "ant-design-vue";
|
|
4
5
|
import type { PanelElement } from "../../types";
|
|
@@ -6,6 +7,7 @@ import ConfigColorField from "./ConfigColorField.vue";
|
|
|
6
7
|
import ConfigFieldGroup from "./ConfigFieldGroup.vue";
|
|
7
8
|
import ConfigSection from "./ConfigSection.vue";
|
|
8
9
|
|
|
10
|
+
const { t, locale } = useI18n();
|
|
9
11
|
const props = defineProps<{
|
|
10
12
|
element: PanelElement;
|
|
11
13
|
isEditable: boolean;
|
|
@@ -105,14 +107,14 @@ function clearSketch() {
|
|
|
105
107
|
|
|
106
108
|
<template>
|
|
107
109
|
<ConfigSection
|
|
108
|
-
title="
|
|
110
|
+
:title="t('panel.config.sectionGeometry')"
|
|
109
111
|
:open="open"
|
|
110
112
|
:force-open="forceOpen"
|
|
111
113
|
@update:open="emit('update:open', $event)"
|
|
112
114
|
>
|
|
113
|
-
<ConfigFieldGroup title="
|
|
115
|
+
<ConfigFieldGroup :title="t('panel.config.groupBasicShape')">
|
|
114
116
|
<label class="block space-y-1">
|
|
115
|
-
<div
|
|
117
|
+
<div>{{ t("panel.config.shape") }}</div>
|
|
116
118
|
<Select
|
|
117
119
|
size="small"
|
|
118
120
|
class="w-full"
|
|
@@ -120,25 +122,25 @@ function clearSketch() {
|
|
|
120
122
|
:disabled="!isEditable"
|
|
121
123
|
@update:value="(v) => patch({ geometryShape: v as PanelElement['geometryShape'] })"
|
|
122
124
|
>
|
|
123
|
-
<Select.Option value="rect"
|
|
124
|
-
<Select.Option value="circle"
|
|
125
|
-
<Select.Option value="triangle"
|
|
126
|
-
<Select.Option value="diamond"
|
|
127
|
-
<Select.Option value="hexagon"
|
|
128
|
-
<Select.Option value="star"
|
|
129
|
-
<Select.Option value="heart"
|
|
125
|
+
<Select.Option value="rect">{{ t("panel.config.shapeRect") }}</Select.Option>
|
|
126
|
+
<Select.Option value="circle">{{ t("panel.config.shapeCircle") }}</Select.Option>
|
|
127
|
+
<Select.Option value="triangle">{{ t("panel.config.shapeTriangle") }}</Select.Option>
|
|
128
|
+
<Select.Option value="diamond">{{ t("panel.config.shapeDiamond") }}</Select.Option>
|
|
129
|
+
<Select.Option value="hexagon">{{ t("panel.config.shapeHexagon") }}</Select.Option>
|
|
130
|
+
<Select.Option value="star">{{ t("panel.config.shapeStar") }}</Select.Option>
|
|
131
|
+
<Select.Option value="heart">{{ t("panel.config.shapeHeart") }}</Select.Option>
|
|
130
132
|
</Select>
|
|
131
133
|
</label>
|
|
132
134
|
<ConfigColorField
|
|
133
|
-
label="
|
|
135
|
+
:label="t('panel.scope.fieldGeometryColor')"
|
|
134
136
|
:value="element.geometryColor ?? '#3b82f6'"
|
|
135
137
|
:disabled="!isEditable"
|
|
136
138
|
@update:value="(v) => patch({ geometryColor: v || '#3b82f6' })"
|
|
137
139
|
/>
|
|
138
140
|
</ConfigFieldGroup>
|
|
139
|
-
<ConfigFieldGroup title="
|
|
141
|
+
<ConfigFieldGroup :title="t('panel.config.groupCanvasScript')">
|
|
140
142
|
<template #hint>
|
|
141
|
-
|
|
143
|
+
{{ t("panel.config.canvasScriptHint") }}
|
|
142
144
|
</template>
|
|
143
145
|
<Textarea
|
|
144
146
|
:value="element.geometryScript ?? ''"
|
|
@@ -146,14 +148,14 @@ function clearSketch() {
|
|
|
146
148
|
:rows="6"
|
|
147
149
|
spellcheck="false"
|
|
148
150
|
class="font-mono text-[11px]"
|
|
149
|
-
placeholder="
|
|
151
|
+
:placeholder="t('panel.config.geometryScriptPlaceholder')"
|
|
150
152
|
@update:value="(v: string) => patch({ geometryScript: v || undefined })"
|
|
151
153
|
/>
|
|
152
154
|
</ConfigFieldGroup>
|
|
153
|
-
<ConfigFieldGroup title="
|
|
155
|
+
<ConfigFieldGroup :title="t('panel.config.groupSketchOverlay')">
|
|
154
156
|
<div class="flex items-center gap-2">
|
|
155
157
|
<label class="block space-y-1">
|
|
156
|
-
<div class="text-[11px]"
|
|
158
|
+
<div class="text-[11px]">{{ t("panel.config.penColor") }}</div>
|
|
157
159
|
<input
|
|
158
160
|
v-model="geometryDrawPenColor"
|
|
159
161
|
type="color"
|
|
@@ -162,7 +164,7 @@ function clearSketch() {
|
|
|
162
164
|
/>
|
|
163
165
|
</label>
|
|
164
166
|
<label class="block space-y-1">
|
|
165
|
-
<div class="text-[11px]"
|
|
167
|
+
<div class="text-[11px]">{{ t("panel.config.penWidth") }}</div>
|
|
166
168
|
<InputNumber
|
|
167
169
|
size="small"
|
|
168
170
|
class="w-20"
|
|
@@ -193,7 +195,7 @@ function clearSketch() {
|
|
|
193
195
|
:disabled="!isEditable"
|
|
194
196
|
@click="applySketch"
|
|
195
197
|
>
|
|
196
|
-
|
|
198
|
+
{{ t("panel.config.applySketch") }}
|
|
197
199
|
</button>
|
|
198
200
|
<button
|
|
199
201
|
type="button"
|
|
@@ -201,7 +203,7 @@ function clearSketch() {
|
|
|
201
203
|
:disabled="!isEditable"
|
|
202
204
|
@click="clearSketch"
|
|
203
205
|
>
|
|
204
|
-
|
|
206
|
+
{{ t("panel.config.clearSketch") }}
|
|
205
207
|
</button>
|
|
206
208
|
</div>
|
|
207
209
|
</ConfigFieldGroup>
|