@cloudbase/weda-ui 3.10.1 → 3.11.0

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.
Files changed (103) hide show
  1. package/dist/configs/components/button.js +1 -1
  2. package/dist/configs/components/chart/bar.d.ts +146 -0
  3. package/dist/configs/components/chart/bar.js +1147 -0
  4. package/dist/configs/components/dataView.js +0 -16
  5. package/dist/configs/components/image.js +1 -1
  6. package/dist/configs/components/listView.js +0 -16
  7. package/dist/configs/components/lottery.js +1 -1
  8. package/dist/configs/components/navigationBar.json +1 -1
  9. package/dist/configs/components/wd-audio.js +1 -1
  10. package/dist/configs/components/wd-button.js +2 -2
  11. package/dist/configs/components/wd-icon.js +1 -1
  12. package/dist/configs/components/wd-image.js +1 -1
  13. package/dist/configs/components/wd-input-email.d.ts +2 -2
  14. package/dist/configs/components/wd-input-phone.d.ts +2 -2
  15. package/dist/configs/components/wd-input-url.d.ts +2 -2
  16. package/dist/configs/components/wd-layout.js +0 -1
  17. package/dist/configs/components/wd-link.js +1 -1
  18. package/dist/configs/components/wd-menu-layout.js +1 -1
  19. package/dist/configs/components/wd-menu-list.js +1 -1
  20. package/dist/configs/components/wd-rating.js +2 -2
  21. package/dist/configs/components/wd-select-multiple.d.ts +23 -0
  22. package/dist/configs/components/wd-select-multiple.js +26 -1
  23. package/dist/configs/components/wd-select.d.ts +23 -0
  24. package/dist/configs/components/wd-select.js +25 -0
  25. package/dist/configs/components/wd-side-tab.js +2 -2
  26. package/dist/configs/components/wd-tabbar.js +1 -1
  27. package/dist/configs/components/wd-table.d.ts +13 -1
  28. package/dist/configs/components/wd-table.js +34 -0
  29. package/dist/configs/components/wd-top-tab.js +2 -2
  30. package/dist/configs/components/wd-upload-image.js +1 -1
  31. package/dist/configs/components/wedaVideo.js +3 -3
  32. package/dist/configs/components/wxOpenApi/share.js +1 -1
  33. package/dist/configs/index.d.ts +4422 -5720
  34. package/dist/configs/index.js +1 -1
  35. package/dist/configs/type-utils/type-form.d.ts +6 -0
  36. package/dist/configs/type-utils/type-form.js +63 -22
  37. package/dist/configs/type-utils/x-runtime-default.d.ts +1 -0
  38. package/dist/configs/type-utils/x-runtime-default.js +1 -0
  39. package/dist/enum/index.js +5 -1
  40. package/dist/style/index.css +15 -0
  41. package/dist/style/index.scss +1 -1
  42. package/dist/style/weda-ui.min.css +2 -2
  43. package/dist/web/components/form/select/index.css +2 -2
  44. package/dist/web/components/form/select/request.d.ts +3 -3
  45. package/dist/web/components/form/select/request.js +1 -0
  46. package/dist/web/components/form/select/status/index.d.ts +3 -1
  47. package/dist/web/components/form/select/status/index.js +3 -1
  48. package/dist/web/components/form/selectMultiple/dropdown-select/index.css +5 -5
  49. package/dist/web/components/form/uploader/uploader.h5.js +1 -1
  50. package/dist/web/components/form/uploader/uploader.pc.js +1 -1
  51. package/dist/web/components/form/uploader/util.d.ts +1 -0
  52. package/dist/web/components/form/uploader/util.js +2 -1
  53. package/dist/web/components/form/uploaderFile/uploadFile.h5.js +4 -3
  54. package/dist/web/components/form/uploaderFile/uploadFile.pc.js +3 -1
  55. package/dist/web/components/form-date/index.d.ts +1 -1
  56. package/dist/web/components/form-email/index.d.ts +1 -1
  57. package/dist/web/components/form-input/index.d.ts +1 -1
  58. package/dist/web/components/form-input-hooks/index.js +10 -1
  59. package/dist/web/components/form-input-hooks/validator.d.ts +1 -0
  60. package/dist/web/components/form-input-hooks/validator.js +6 -2
  61. package/dist/web/components/form-phone/index.d.ts +1 -1
  62. package/dist/web/components/form-time/index.d.ts +1 -1
  63. package/dist/web/components/form-url/index.d.ts +1 -1
  64. package/dist/web/components/formdetail/index.css +0 -6
  65. package/dist/web/components/wd-date/elements/Modal.h5.d.ts +2 -0
  66. package/dist/web/components/wd-date/elements/Modal.h5.js +3 -3
  67. package/dist/web/components/wd-form/index.js +1 -1
  68. package/dist/web/components/wd-form-item/wd-form-item-read-only.d.ts +1 -0
  69. package/dist/web/components/wd-input/wd-input.d.ts +1 -1
  70. package/dist/web/components/wd-input-email/wd-input-email.d.ts +1 -1
  71. package/dist/web/components/wd-input-phone/wd-input-phone.d.ts +1 -1
  72. package/dist/web/components/wd-input-url/wd-input-url.d.ts +1 -1
  73. package/dist/web/components/wd-menu-list/CommonMenuList.js +1 -1
  74. package/dist/web/components/wd-menu-list/HorizontalMenuList.js +1 -1
  75. package/dist/web/components/wd-select/relationSelect/relationSelect.d.ts +4 -0
  76. package/dist/web/components/wd-select/relationSelect/relationSelect.js +202 -0
  77. package/dist/web/components/wd-select/{relationalSetting.js → relationSelect/relationalSetting.js} +4 -4
  78. package/dist/web/components/wd-select/select/index.d.ts +2 -0
  79. package/dist/web/components/wd-select/select/index.js +8 -0
  80. package/dist/web/components/wd-select/select/selectUI.d.ts +3 -0
  81. package/dist/web/components/wd-select/select/selectUI.js +190 -0
  82. package/dist/web/components/wd-select/style.d.ts +2 -0
  83. package/dist/web/components/wd-select/style.js +2 -0
  84. package/dist/web/components/wd-select/wd-select.css +83 -0
  85. package/dist/web/components/wd-select/wd-select.d.ts +0 -1
  86. package/dist/web/components/wd-select/wd-select.js +18 -8
  87. package/dist/web/components/wd-select-multiple/style.d.ts +2 -0
  88. package/dist/web/components/wd-select-multiple/style.js +2 -0
  89. package/dist/web/components/wd-select-multiple/wd-select-multiple.css +30 -4
  90. package/dist/web/components/wd-select-multiple/wd-select-multiple.js +18 -7
  91. package/dist/web/components/wd-table/components/FieldRender/index.d.ts +7 -4
  92. package/dist/web/components/wd-table/components/FieldRender/index.js +27 -11
  93. package/dist/web/components/wd-table/components/ModalTable/index.js +1 -1
  94. package/dist/web/components/wd-table/components/Table/index.d.ts +4 -2
  95. package/dist/web/components/wd-table/components/Table/index.js +12 -3
  96. package/dist/web/components/wd-table/hooks/useChooseList.d.ts +1 -0
  97. package/dist/web/components/wd-table/hooks/useChooseList.js +55 -26
  98. package/dist/web/components/wd-table/wd-table.js +8 -3
  99. package/dist/web/components/wd-textarea/wd-textarea.js +5 -2
  100. package/dist/web/utils/platform.js +3 -3
  101. package/package.json +2 -2
  102. package/dist/configs/components/chart/bar.json +0 -1144
  103. /package/dist/web/components/wd-select/{relationalSetting.d.ts → relationSelect/relationalSetting.d.ts} +0 -0
@@ -0,0 +1,1147 @@
1
+ import { defineConfig, Type } from '../../type-utils';
2
+ const $attached_template = `
3
+ {{#with $self as |$self|}}
4
+ {{#if (helper_utils '===' $self.attributes.dataSourceType 'variable')}}
5
+ [attributes]
6
+ ':datasourceVariable'="[
7
+ {
8
+ XLabel: { Value: 'sotm' },
9
+ YLabels: [{ Name: '销售金额', Value: '124213' }],
10
+ },
11
+ {
12
+ XLabel: { Value: 'Lisi' },
13
+ YLabels: [{ Name: '销售金额', Value: '116123' }],
14
+ },
15
+ {
16
+ XLabel: { Value: 'maza' },
17
+ YLabels: [{ Name: '销售金额', Value: '100123' }],
18
+ },
19
+ ]"
20
+ {{/if}}
21
+ {{/with}}
22
+ `;
23
+ const data = Type.Object({
24
+ directionType: Type.StringEnum({
25
+ title: '柱形图方向',
26
+ type: 'string',
27
+ default: 'lengthways',
28
+ 'x-component': 'radio',
29
+ 'x-index': 10,
30
+ enum: [
31
+ {
32
+ label: '横向',
33
+ value: 'crosswise',
34
+ },
35
+ {
36
+ label: '纵向',
37
+ value: 'lengthways',
38
+ },
39
+ ],
40
+ 'x-linkages': [
41
+ {
42
+ target: '*(xFieldShow,xFieldShowHight)',
43
+ type: 'value:schema',
44
+ condition: "{{ $self.value ==='lengthways' }}",
45
+ schema: {
46
+ 'x-component-props': {
47
+ text: '维度(X轴)',
48
+ },
49
+ },
50
+ },
51
+ {
52
+ target: '*(xFieldShow,xFieldShowHight)',
53
+ type: 'value:schema',
54
+ condition: "{{ $self.value ==='crosswise' }}",
55
+ schema: {
56
+ 'x-component-props': {
57
+ text: '维度(Y轴)',
58
+ },
59
+ },
60
+ },
61
+ {
62
+ target: '*(yFieldSubTitle,yFieldShow)',
63
+ type: 'value:schema',
64
+ condition: "{{ $self.value ==='crosswise' }}",
65
+ schema: {
66
+ 'x-component-props': {
67
+ text: '数值(X轴)',
68
+ },
69
+ },
70
+ },
71
+ {
72
+ target: '*(yFieldSubTitle,yFieldShow)',
73
+ type: 'value:schema',
74
+ condition: "{{ $self.value ==='lengthways' }}",
75
+ schema: {
76
+ 'x-component-props': {
77
+ text: '数值(Y轴)',
78
+ },
79
+ },
80
+ },
81
+ ],
82
+ description: '支持横向和纵向。纵向维度为 X 轴,数值为 Y 轴,横向反之。本文属性设置以纵向为例',
83
+ }),
84
+ isPile: Type.Boolean({
85
+ title: '是否堆叠',
86
+ type: 'boolean',
87
+ default: false,
88
+ 'x-index': 20,
89
+ description: '多Y轴时,该属性才生效',
90
+ }),
91
+ isTitle: Type.Boolean({
92
+ title: '显示标题',
93
+ type: 'boolean',
94
+ default: true,
95
+ 'x-index': 30,
96
+ 'x-linkages': [
97
+ {
98
+ type: 'value:visible',
99
+ target: '*(title)',
100
+ condition: '{{ $self.value }}',
101
+ },
102
+ ],
103
+ }),
104
+ title: Type.String({
105
+ title: '图表标题',
106
+ default: '柱状图标题',
107
+ type: 'string',
108
+ 'x-index': 40,
109
+ }),
110
+ dataSource: Type.Object({
111
+ // 已废弃
112
+ name: Type.String(),
113
+ type: Type.String(),
114
+ subType: Type.String(),
115
+ methodName: Type.String(),
116
+ }, {
117
+ type: 'object',
118
+ title: '数据源(废弃)',
119
+ display: false,
120
+ 'x-index': 43,
121
+ 'x-component': 'chart-datasource-select',
122
+ 'x-props': {
123
+ 'data-hidebind': true,
124
+ },
125
+ 'x-component-props': {
126
+ postChange: {
127
+ addOrUpdateComponentDataBinds: {
128
+ dataBind: {
129
+ propertyPath: 'filterData',
130
+ bindDataPath: '[]',
131
+ type: 'expression',
132
+ extra: {},
133
+ },
134
+ },
135
+ },
136
+ },
137
+ 'x-linkages': [
138
+ {
139
+ type: 'value:visible',
140
+ target: '*(filterData)',
141
+ condition: "{{ ($self.value && $self.value.type ==='database') || ( $self.value && $self.value.type ==='cloud-integration') }}",
142
+ },
143
+ {
144
+ type: 'value:schema',
145
+ condition: '{{ $self.value&&!!$self.value.name }}',
146
+ target: 'filterData',
147
+ schema: {
148
+ 'x-component-props': '{{{selectedDataSourceName: $self.value.name}}}',
149
+ },
150
+ },
151
+ {
152
+ type: 'value:visible',
153
+ target: '*(xFieldShow,xField,xStatistics,xIsCountEmpty,yField,groupKeyTimeSpan)',
154
+ condition: "{{ $self.value && $self.value.type ==='database' }}",
155
+ },
156
+ {
157
+ type: 'value:state',
158
+ condition: '{{ !!$self.value }}',
159
+ target: 'yField',
160
+ state: {
161
+ __datasourceName: '{{$self.value.name}}',
162
+ },
163
+ },
164
+ ],
165
+ description: '已废弃数据源配置',
166
+ }),
167
+ dataSourceType: Type.StringEnum({
168
+ 'x-index': 45,
169
+ title: '数据源',
170
+ 'x-category': '基础属性',
171
+ type: 'string',
172
+ default: 'data-model',
173
+ enum: [
174
+ {
175
+ label: '数据模型',
176
+ value: 'data-model',
177
+ },
178
+ {
179
+ label: 'APIs',
180
+ value: 'custom-connector',
181
+ },
182
+ {
183
+ label: '变量',
184
+ value: 'variable',
185
+ },
186
+ ],
187
+ 'x-linkages': [
188
+ {
189
+ _comment: '数据模型才显示的',
190
+ type: 'value:state',
191
+ condition: "{{$self.value === 'data-model'}}",
192
+ target: '*(dataModel,filterData,xFieldShow,xField,xStatistics,xIsCountEmpty,yFieldSubTitle,yField,groupKey)',
193
+ state: {
194
+ display: true,
195
+ },
196
+ },
197
+ {
198
+ _comment: '数据模型不显示的',
199
+ type: 'value:state',
200
+ condition: "{{$self.value === 'data-model'}}",
201
+ target: '*(connector,connectorMethod,connectorParams,datasourceVariable)',
202
+ state: {
203
+ display: false,
204
+ },
205
+ },
206
+ {
207
+ _comment: 'APIs才显示的',
208
+ type: 'value:state',
209
+ target: '*(connector,connectorMethod,connectorParams)',
210
+ condition: "{{$self.value === 'custom-connector'}}",
211
+ state: {
212
+ display: true,
213
+ },
214
+ },
215
+ {
216
+ _comment: 'APIs隐藏的',
217
+ type: 'value:state',
218
+ target: '*(groupKey,filterData,xFieldShow,xField,yFieldSubTitle,yField,datasourceVariable,dataModel,xStatistics)',
219
+ condition: "{{$self.value === 'custom-connector'}}",
220
+ state: {
221
+ display: false,
222
+ },
223
+ },
224
+ {
225
+ _comment: '变量时才显示',
226
+ type: 'value:state',
227
+ target: '*(datasourceVariable)',
228
+ condition: "{{$self.value === 'variable'}}",
229
+ state: {
230
+ display: true,
231
+ },
232
+ },
233
+ {
234
+ _comment: '变量时不显示',
235
+ type: 'value:state',
236
+ target: '*(connector,dataModel,xStatistics,groupKey,filterData,xFieldShow,xField,yFieldSubTitle,yField,connectorMethod,connectorParams)',
237
+ condition: "{{$self.value === 'variable'}}",
238
+ state: {
239
+ display: false,
240
+ },
241
+ },
242
+ {
243
+ _comment: '给 connector-selector 设value属性',
244
+ type: 'value:schema',
245
+ target: 'connector',
246
+ schema: {
247
+ 'x-component-props': '{{{value:$value}}}',
248
+ },
249
+ },
250
+ ],
251
+ 'x-props': {
252
+ 'data-hidebind': true,
253
+ },
254
+ description: '数据源类型选择',
255
+ }),
256
+ dataModel: Type.Object({
257
+ name: Type.Optional(Type.String({
258
+ title: '数据模型名',
259
+ })),
260
+ extra: Type.Optional(Type.Object({
261
+ viewId: Type.String({
262
+ title: '数据模型视图id',
263
+ }),
264
+ methodName: Type.String({
265
+ title: '数据模型方法名',
266
+ }),
267
+ }, {
268
+ title: '数据模型属性',
269
+ })),
270
+ }, {
271
+ 'x-index': 50,
272
+ title: '数据模型',
273
+ type: 'object',
274
+ 'x-category': '基础属性',
275
+ required: true,
276
+ 'x-component': 'datasource-selector',
277
+ 'x-component-props': {
278
+ methodName: 'wedaAggregateData',
279
+ },
280
+ 'x-props': {
281
+ 'data-hidebind': true,
282
+ },
283
+ 'x-linkages': [
284
+ {
285
+ type: 'value:visible',
286
+ target: '*(filterData)',
287
+ condition: '{{ Boolean($self.value && $self.value.extra)}}',
288
+ },
289
+ {
290
+ type: 'value:schema',
291
+ condition: '{{ $self.value && !!$self.value.name }}',
292
+ target: 'filterData',
293
+ schema: {
294
+ 'x-component-props': '{{{selectedDataSourceName: $self.value.name}}}',
295
+ },
296
+ },
297
+ {
298
+ type: 'value:visible',
299
+ target: '*(xFieldShow,xField,xStatistics,xIsCountEmpty,yField)',
300
+ condition: '{{ (Boolean($self.value && $self.value.extra)) }}',
301
+ },
302
+ {
303
+ type: 'value:state',
304
+ condition: '{{ !!$self.value }}',
305
+ target: 'yField',
306
+ state: {
307
+ __datasourceName: '{{$self.value.name}}',
308
+ },
309
+ },
310
+ ],
311
+ description: '展示模型数据的数据来源',
312
+ }),
313
+ datasourceVariable: Type.Array(Type.Object({
314
+ XLabel: Type.Optional(Type.Object({
315
+ Name: Type.Optional(Type.String({ title: '字段标识' })),
316
+ Value: Type.String({ title: '坐标文字' }),
317
+ })),
318
+ YLabels: Type.Optional(Type.Object({
319
+ Name: Type.Optional(Type.String({ title: '字段标识' })),
320
+ Value: Type.String({ title: '坐标文字' }),
321
+ })),
322
+ }), {
323
+ 'x-component': 'jsontext',
324
+ 'x-component-props': {
325
+ autoSize: { minRows: 2, maxRows: 10 },
326
+ },
327
+ 'x-index': 53,
328
+ title: '数据源变量',
329
+ 'x-category': '基础属性',
330
+ description: '数据源变量',
331
+ required: true,
332
+ }),
333
+ connector: Type.Object({
334
+ datasource: Type.Optional(Type.Object({
335
+ title: Type.String({
336
+ title: 'API名',
337
+ }),
338
+ id: Type.String({
339
+ title: 'ID',
340
+ }),
341
+ name: Type.String({
342
+ title: '数据源标识',
343
+ }),
344
+ })),
345
+ }, {
346
+ title: 'APIs',
347
+ type: 'object',
348
+ 'x-component': 'connector-select',
349
+ 'x-index': 54,
350
+ required: true,
351
+ 'x-category': '基础属性',
352
+ 'x-props': {
353
+ 'data-hidebind': true,
354
+ },
355
+ 'x-linkages': [
356
+ {
357
+ type: 'value:schema',
358
+ target: 'connectorMethod',
359
+ schema: {
360
+ 'x-component-props': {
361
+ value: '{{$self.value}}',
362
+ },
363
+ },
364
+ },
365
+ ],
366
+ description: '展示数据的APIs来源选择',
367
+ }),
368
+ connectorMethod: Type.Object({
369
+ name: Type.Optional(Type.String({ title: '方法标识' })),
370
+ title: Type.Optional(Type.String({ title: '方法名' })),
371
+ }, {
372
+ title: '调用方法',
373
+ type: 'object',
374
+ required: true,
375
+ 'x-component': 'connector-method-select',
376
+ 'x-index': 55,
377
+ 'x-category': '基础属性',
378
+ 'x-component-props': {
379
+ docUrl: 'https://cloud.tencent.com/document/product/1301/71197#.E6.9F.B1.E7.8A.B6.E5.9B.BE.E3.80.81.E6.8A.98.E7.BA.BF.E5.9B.BE.E3.80.81.E9.A5.BC.E5.9B.BE',
380
+ paramsSchema: {
381
+ type: 'object',
382
+ properties: {
383
+ outParams: {
384
+ type: 'object',
385
+ properties: {
386
+ properties: {
387
+ type: 'object',
388
+ properties: {
389
+ result: {
390
+ type: 'object',
391
+ properties: {
392
+ type: {
393
+ const: 'array',
394
+ },
395
+ items: {
396
+ type: 'object',
397
+ properties: {
398
+ type: {
399
+ const: 'object',
400
+ },
401
+ properties: {
402
+ type: 'object',
403
+ properties: {
404
+ XLabel: {
405
+ type: 'object',
406
+ properties: {
407
+ type: {
408
+ const: 'object',
409
+ },
410
+ properties: {
411
+ type: 'object',
412
+ properties: {
413
+ Value: {
414
+ type: 'object',
415
+ properties: {
416
+ type: {
417
+ const: 'string',
418
+ },
419
+ },
420
+ },
421
+ },
422
+ required: ['Value'],
423
+ },
424
+ },
425
+ },
426
+ YLabels: {
427
+ type: 'object',
428
+ properties: {
429
+ type: {
430
+ const: 'array',
431
+ },
432
+ items: {
433
+ type: 'object',
434
+ properties: {
435
+ type: {
436
+ const: 'object',
437
+ },
438
+ properties: {
439
+ type: 'object',
440
+ properties: {
441
+ Name: {
442
+ type: 'object',
443
+ properties: {
444
+ type: {
445
+ const: 'string',
446
+ },
447
+ },
448
+ },
449
+ Value: {
450
+ type: 'object',
451
+ properties: {
452
+ type: {
453
+ const: 'number',
454
+ },
455
+ },
456
+ },
457
+ },
458
+ required: ['Name', 'Value'],
459
+ },
460
+ },
461
+ },
462
+ },
463
+ },
464
+ },
465
+ required: ['XLabel', 'YLabels'],
466
+ },
467
+ },
468
+ },
469
+ },
470
+ },
471
+ },
472
+ required: ['result'],
473
+ },
474
+ },
475
+ },
476
+ },
477
+ },
478
+ },
479
+ 'x-helper-text': '方法的出入参需满足组件要求,[查看文档](https://cloud.tencent.com/document/product/1301/71197#.E6.9F.B1.E7.8A.B6.E5.9B.BE.E3.80.81.E6.8A.98.E7.BA.BF.E5.9B.BE.E3.80.81.E9.A5.BC.E5.9B.BE)',
480
+ 'x-helper-text-color': '#E37318',
481
+ description: '展示数据的APIs调用方法选择',
482
+ }),
483
+ connectorParams: Type.Record(Type.String(), Type.Any(), {
484
+ title: '查询入参',
485
+ type: 'string',
486
+ 'x-component': 'property-object-params-field',
487
+ 'x-component-props': {
488
+ dataSourceKeyName: 'connector',
489
+ dataSourceValuePath: 'datasource.name',
490
+ methodNameKeyName: 'connectorMethod',
491
+ methodValuePath: 'name',
492
+ paramsKeyName: 'connectorParams',
493
+ },
494
+ 'x-index': 56,
495
+ 'x-category': '基础属性',
496
+ description: "对APIs调用方法获取的数据进行筛选过滤。支持对象类型,例如 {name:'',value:''}",
497
+ }),
498
+ filterData: Type.Record(Type.String(), Type.Any(), {
499
+ title: '数据筛选',
500
+ 'x-index': 60,
501
+ 'x-component': 'condition-select',
502
+ 'x-component-props': {
503
+ dataSourceNamePropKey: 'dataModel',
504
+ customRelOptions: {
505
+ string: [
506
+ {
507
+ value: 'eq',
508
+ text: '等于',
509
+ },
510
+ {
511
+ value: 'neq',
512
+ text: '不等于',
513
+ },
514
+ {
515
+ value: 'in',
516
+ text: '包含',
517
+ },
518
+ {
519
+ value: 'nin',
520
+ text: '不包含',
521
+ },
522
+ ],
523
+ boolean: [
524
+ {
525
+ value: 'eq',
526
+ text: '等于',
527
+ },
528
+ ],
529
+ number: [
530
+ {
531
+ value: 'eq',
532
+ text: '等于',
533
+ type: 'equal',
534
+ },
535
+ {
536
+ value: 'neq',
537
+ text: '不等于',
538
+ type: 'unequal',
539
+ },
540
+ {
541
+ value: 'gt',
542
+ text: '大于',
543
+ type: 'greater',
544
+ },
545
+ {
546
+ value: 'gte',
547
+ text: '大于等于',
548
+ type: 'greater_or_equal',
549
+ },
550
+ {
551
+ value: 'lt',
552
+ text: '小于',
553
+ type: 'less',
554
+ },
555
+ {
556
+ value: 'lte',
557
+ text: '小于等于',
558
+ type: 'less_or_equal',
559
+ },
560
+ ],
561
+ array: [
562
+ {
563
+ value: 'eq',
564
+ text: '等于',
565
+ },
566
+ {
567
+ value: 'in',
568
+ text: '包含',
569
+ },
570
+ ],
571
+ object: [
572
+ {
573
+ value: 'eq',
574
+ text: '等于',
575
+ },
576
+ {
577
+ value: 'in',
578
+ text: '包含',
579
+ },
580
+ ],
581
+ keyVarType: [
582
+ {
583
+ value: 'eq',
584
+ text: '等于',
585
+ },
586
+ {
587
+ value: 'neq',
588
+ text: '不等于',
589
+ },
590
+ {
591
+ value: 'gt',
592
+ text: '大于',
593
+ },
594
+ {
595
+ value: 'lt',
596
+ text: '小于',
597
+ },
598
+ ],
599
+ },
600
+ },
601
+ 'x-props': {
602
+ 'data-hidebind': true,
603
+ 'data-hideBindValue': true,
604
+ 'data-withBindMeta': true,
605
+ },
606
+ description: '可配置数据取值范围,可参见 数据筛选配置',
607
+ }),
608
+ setColor: Type.Array(Type.String({ title: '颜色色号' }), {
609
+ type: 'array',
610
+ title: '配色',
611
+ 'x-index': 70,
612
+ default: ['#2A70E2', '#46B690', '#EDB539', '#E46961', '#4FB3D2', '#805FDC'],
613
+ 'x-component': 'color-plate',
614
+ description: '当有多个数值字段或维度字段分组时,不同类别将按照不同配色展示,支持自定义色卡',
615
+ }),
616
+ xFieldShow: Type.Never({
617
+ 'x-index': 80,
618
+ 'x-category': '基础属性',
619
+ 'x-component': 'sub-category-title',
620
+ 'x-component-props': {
621
+ text: '维度(X轴)',
622
+ },
623
+ description: '选择 X 轴字段,支持统计空值。当选择日期、时间、日期时间类型字段时,支持选择统计维度',
624
+ }),
625
+ xField: Type.Object({
626
+ format: Type.FormatTypeUnion(),
627
+ type: Type.BasicTypeUnion(),
628
+ title: Type.String({ title: '字段名' }),
629
+ name: Type.String({ title: '字段标识' }),
630
+ }, {
631
+ type: 'object',
632
+ title: '字段选择',
633
+ 'x-index': 90,
634
+ 'x-category': '基础属性',
635
+ 'x-component': 'data-source-field-select',
636
+ 'x-component-props': {
637
+ dataSourceNamePropKey: 'dataModel',
638
+ isMethod: true,
639
+ disabledTypes: ['time'],
640
+ },
641
+ 'x-linkages': [
642
+ {
643
+ type: 'value:schema',
644
+ condition: '{{ !!$self.value }}',
645
+ target: 'xStatistics',
646
+ schema: {
647
+ enum: "{{$self.value.format ==='datetime' ? [{'label':'年','value':'y'},{'label':'月','value':'m'},{'label':'周','value':'w'},{'label':'日','value':'d'},{'label':'时','value':'h'},{'label':'分','value':'min'}] : ($self.value.format ==='date'? [{'label':'年','value':'y'},{'label':'月','value':'m'},{'label':'周','value':'w'},{'label':'日','value':'d'}] : []) }}",
648
+ },
649
+ },
650
+ {
651
+ type: 'value:visible',
652
+ target: '*(xStatistics)',
653
+ condition: "{{ $self.value && ($self.value.format ==='datetime' || $self.value.format ==='date') }}",
654
+ },
655
+ {
656
+ type: 'value:visible',
657
+ target: '*(xIsCountEmpty)',
658
+ condition: "{{ $self.value && ($self.value.format !=='datetime' && $self.value.format !=='date') }}",
659
+ },
660
+ ],
661
+ description: 'X轴数值字段选择',
662
+ }),
663
+ xStatistics: Type.String({
664
+ title: '统计维度',
665
+ type: 'string',
666
+ 'x-category': '基础属性',
667
+ 'x-index': 100,
668
+ enum: [],
669
+ }),
670
+ xIsCountEmpty: Type.Boolean({
671
+ title: '显示空值坐标',
672
+ type: 'boolean',
673
+ default: false,
674
+ 'x-index': 110,
675
+ }),
676
+ yFieldSubTitle: Type.Never({
677
+ 'x-index': 115,
678
+ 'x-component': 'sub-category-title',
679
+ 'x-component-props': {
680
+ text: '数值(Y轴)',
681
+ },
682
+ }),
683
+ yField: Type.Object({
684
+ numValue: Type.Optional(Type.Array(Type.Object({
685
+ key: Type.String(),
686
+ operationType: Type.Union(['count', 'sum', 'avg', 'max', 'min'].map((t) => Type.Literal(t))),
687
+ }))),
688
+ groupKey: Type.Optional(Type.String()),
689
+ }, {
690
+ type: 'object',
691
+ title: '字段选择',
692
+ 'x-index': 120,
693
+ 'x-category': '基础属性',
694
+ 'x-component': 'chart-y-field-select',
695
+ 'x-component-props': {
696
+ isMethod: true,
697
+ text: '编辑Y轴字段',
698
+ dataSourceNamePropKey: 'dataModel',
699
+ },
700
+ 'x-linkages': [
701
+ {
702
+ type: 'value:visible',
703
+ target: '*(groupKey)',
704
+ condition: '{{ (!$self.value || !$self.value.numValue || $self.value.numValue.length<=1) && !!$self.__datasourceName }}',
705
+ },
706
+ ],
707
+ description: 'Y轴数值字段选择',
708
+ }),
709
+ groupKey: Type.Optional(Type.String({
710
+ title: '分组',
711
+ 'x-index': 130,
712
+ 'x-category': '基础属性',
713
+ 'x-component': 'data-source-field-select',
714
+ 'x-component-props': {
715
+ dataSourceNamePropKey: 'dataModel',
716
+ isMethod: true,
717
+ clearable: true,
718
+ },
719
+ 'x-linkages': [
720
+ {
721
+ type: 'value:state',
722
+ target: 'groupKeyTimeSpan',
723
+ condition: '{{ !!$self.value }}',
724
+ state: {
725
+ value: "{{$self.value.format ==='datetime' ? 'y':$self.value.format ==='date'?'y':''}}",
726
+ },
727
+ },
728
+ {
729
+ type: 'value:visible',
730
+ target: '*(groupKeyTimeSpan)',
731
+ condition: "{{ $self.value && ($self.value.format ==='datetime' || $self.value.format ==='date') }}",
732
+ },
733
+ {
734
+ type: 'value:schema',
735
+ condition: '{{ !!$self.value }}',
736
+ target: 'groupKeyTimeSpan',
737
+ schema: {
738
+ enum: "{{$self.value.format ==='datetime' ? [{'label':'年','value':'y'},{'label':'月','value':'m'},{'label':'周','value':'w'},{'label':'日','value':'d'},{'label':'时','value':'h'},{'label':'分','value':'min'}] : ($self.value.format ==='date'? [{'label':'年','value':'y'},{'label':'季','value':'q'},{'label':'月','value':'m'},{'label':'周','value':'w'},{'label':'日','value':'d'}]: []) }}",
739
+ },
740
+ },
741
+ ],
742
+ description: '当 Y 轴仅选择一个字段时,支持根据某一固定字段对 X 轴进行分组展示。示例:X 轴为销售人员,分组为销售区域',
743
+ })),
744
+ groupKeyTimeSpan: Type.String({
745
+ title: '分组维度',
746
+ type: 'string',
747
+ 'x-category': '基础属性',
748
+ 'x-index': 140,
749
+ enum: [],
750
+ }),
751
+ legendShow: Type.Never({
752
+ 'x-index': 145,
753
+ 'x-category': '基础属性',
754
+ 'x-component': 'sub-category-title',
755
+ 'x-component-props': {
756
+ text: '图例',
757
+ },
758
+ }),
759
+ isLegend: Type.Boolean({
760
+ title: '显示图例',
761
+ type: 'boolean',
762
+ default: true,
763
+ 'x-category': '基础属性',
764
+ 'x-index': 150,
765
+ 'x-linkages': [
766
+ {
767
+ type: 'value:visible',
768
+ target: '*(legend)',
769
+ condition: '{{ $self.value }}',
770
+ },
771
+ ],
772
+ }),
773
+ legend: Type.StringEnum({
774
+ title: '图例位置',
775
+ type: 'string',
776
+ default: 'bottom',
777
+ 'x-category': '基础属性',
778
+ 'x-index': 170,
779
+ enum: [
780
+ {
781
+ value: 'top',
782
+ label: '上方',
783
+ },
784
+ {
785
+ value: 'bottom',
786
+ label: '下方',
787
+ },
788
+ ],
789
+ }),
790
+ divider: Type.Never({
791
+ 'x-index': 175,
792
+ 'x-component': 'Divider',
793
+ }),
794
+ propsTitle: Type.Never({
795
+ 'x-index': 180,
796
+ 'x-component': 'sub-category-title',
797
+ 'x-component-props': {
798
+ text: '进阶属性',
799
+ },
800
+ }),
801
+ xFieldShowHight: Type.Never({
802
+ 'x-index': 185,
803
+ 'x-component': 'sub-category-title',
804
+ 'x-component-props': {
805
+ text: '维度(X轴)',
806
+ },
807
+ }),
808
+ isXaxisName: Type.Boolean({
809
+ title: '显示坐标轴名称',
810
+ type: 'boolean',
811
+ default: true,
812
+ 'x-index': 190,
813
+ 'x-linkages': [
814
+ {
815
+ type: 'value:visible',
816
+ target: '*(xAxisName)',
817
+ condition: '{{ $self.value }}',
818
+ },
819
+ ],
820
+ }),
821
+ xAxisName: Type.String({
822
+ title: '名称',
823
+ type: 'string',
824
+ default: '',
825
+ 'x-index': 200,
826
+ }),
827
+ isXaxisAxisLabelShow: Type.Boolean({
828
+ title: '显示标签',
829
+ type: 'boolean',
830
+ 'x-index': 210,
831
+ default: true,
832
+ }),
833
+ isXaxisAxisTickShow: Type.Boolean({
834
+ title: '显示X轴刻度线',
835
+ type: 'boolean',
836
+ 'x-index': 220,
837
+ default: true,
838
+ }),
839
+ isXaxisAxisLabelRotate: Type.Never({
840
+ title: '文字自动倾斜',
841
+ type: 'boolean',
842
+ 'x-index': 230,
843
+ default: false,
844
+ }),
845
+ yFieldShow: Type.Never({
846
+ 'x-index': 240,
847
+ 'x-component': 'sub-category-title',
848
+ 'x-component-props': {
849
+ text: '数值(Y轴)',
850
+ },
851
+ }),
852
+ isYAxisSplitlineLinestyleWidth: Type.Boolean({
853
+ title: '显示网格线',
854
+ type: 'boolean',
855
+ 'x-index': 250,
856
+ default: true,
857
+ 'x-linkages': [
858
+ {
859
+ type: 'value:visible',
860
+ target: '*(yAxisSplitlineLinestyleType)',
861
+ condition: '{{ $self.value }}',
862
+ },
863
+ ],
864
+ }),
865
+ yAxisSplitlineLinestyleType: Type.StringEnum({
866
+ title: '网格线线条',
867
+ type: 'string',
868
+ default: 'solid',
869
+ 'x-index': 260,
870
+ enum: [
871
+ {
872
+ value: 'solid',
873
+ label: '实线',
874
+ },
875
+ {
876
+ value: 'dashed',
877
+ label: '虚线',
878
+ },
879
+ {
880
+ value: 'dotted',
881
+ label: '点线',
882
+ },
883
+ ],
884
+ }),
885
+ yAxisMax: Type.Number({
886
+ title: '最大值',
887
+ type: 'number',
888
+ 'x-index': 270,
889
+ }),
890
+ yAxisMin: Type.Number({
891
+ title: '最小值',
892
+ type: 'number',
893
+ 'x-index': 280,
894
+ }),
895
+ isYAxisName: Type.Boolean({
896
+ title: '显示Y轴名称',
897
+ type: 'boolean',
898
+ 'x-index': 290,
899
+ default: true,
900
+ 'x-linkages': [
901
+ {
902
+ type: 'value:visible',
903
+ target: '*(yAxisName)',
904
+ condition: '{{ $self.value }}',
905
+ },
906
+ ],
907
+ }),
908
+ yAxisName: Type.Boolean({
909
+ title: '名称',
910
+ type: 'string',
911
+ default: '',
912
+ 'x-index': 300,
913
+ }),
914
+ isYAxisShow: Type.Boolean({
915
+ title: '显示数值',
916
+ type: 'boolean',
917
+ 'x-index': 310,
918
+ default: true,
919
+ description: '数值(Y轴)显示数值',
920
+ }),
921
+ dataTagShow: Type.Never({
922
+ 'x-index': 320,
923
+ 'x-component': 'sub-category-title',
924
+ 'x-component-props': {
925
+ text: '数据标签',
926
+ },
927
+ }),
928
+ isSeriesShowSymbol: Type.Boolean({
929
+ title: '显示数值',
930
+ type: 'boolean',
931
+ 'x-index': 330,
932
+ default: true,
933
+ description: '数据标签显示数值',
934
+ }),
935
+ unitShow: Type.Never({
936
+ 'x-index': 340,
937
+ 'x-component': 'sub-category-title',
938
+ 'x-component-props': {
939
+ text: '显示单位',
940
+ },
941
+ }),
942
+ isUnit: Type.Boolean({
943
+ title: '显示单位',
944
+ type: 'boolean',
945
+ 'x-index': 350,
946
+ 'x-props': {
947
+ 'data-hidebind': true,
948
+ },
949
+ default: false,
950
+ 'x-linkages': [
951
+ {
952
+ type: 'value:visible',
953
+ target: '*(unit,decimalDigits,suffix)',
954
+ condition: '{{ $self.value }}',
955
+ },
956
+ ],
957
+ }),
958
+ unit: Type.Number({
959
+ type: 'number',
960
+ title: '数值量级',
961
+ 'x-index': 360,
962
+ default: 1,
963
+ 'x-component': 'select',
964
+ enum: [
965
+ {
966
+ label: '个',
967
+ value: 1,
968
+ },
969
+ {
970
+ label: '十',
971
+ value: 10,
972
+ },
973
+ {
974
+ label: '百',
975
+ value: 100,
976
+ },
977
+ {
978
+ label: '千',
979
+ value: 1000,
980
+ },
981
+ {
982
+ label: '万',
983
+ value: 10000,
984
+ },
985
+ {
986
+ label: '十万',
987
+ value: 100000,
988
+ },
989
+ {
990
+ label: '百万',
991
+ value: 1000000,
992
+ },
993
+ {
994
+ label: '千万',
995
+ value: 10000000,
996
+ },
997
+ {
998
+ label: '亿',
999
+ value: 100000000,
1000
+ },
1001
+ ],
1002
+ 'x-component-props': {
1003
+ options: [
1004
+ {
1005
+ label: '个',
1006
+ value: 1,
1007
+ },
1008
+ {
1009
+ label: '十',
1010
+ value: 10,
1011
+ },
1012
+ {
1013
+ label: '百',
1014
+ value: 100,
1015
+ },
1016
+ {
1017
+ label: '千',
1018
+ value: 1000,
1019
+ },
1020
+ {
1021
+ label: '万',
1022
+ value: 10000,
1023
+ },
1024
+ {
1025
+ label: '十万',
1026
+ value: 100000,
1027
+ },
1028
+ {
1029
+ label: '百万',
1030
+ value: 1000000,
1031
+ },
1032
+ {
1033
+ label: '千万',
1034
+ value: 10000000,
1035
+ },
1036
+ {
1037
+ label: '亿',
1038
+ value: 100000000,
1039
+ },
1040
+ ],
1041
+ },
1042
+ 'x-linkages': [
1043
+ {
1044
+ type: 'value:state',
1045
+ target: 'suffix',
1046
+ condition: '{{ $self.inputed && $self.value!==1 }}',
1047
+ state: {
1048
+ value: "{{$self.props.enum.find(s=>s.value===$self.value) ? $self.props.enum.find(s=>s.value===$self.value).label: '' }}",
1049
+ },
1050
+ },
1051
+ {
1052
+ type: 'value:state',
1053
+ target: 'suffix',
1054
+ condition: '{{ $self.inputed && $self.value===1 }}',
1055
+ state: {
1056
+ value: '',
1057
+ },
1058
+ },
1059
+ ],
1060
+ }),
1061
+ decimalDigits: Type.Number({
1062
+ title: '小数位数',
1063
+ type: 'number',
1064
+ default: 0,
1065
+ 'x-props': {
1066
+ max: 10,
1067
+ min: 0,
1068
+ },
1069
+ 'x-index': 370,
1070
+ 'x-linkages': [
1071
+ {
1072
+ type: 'value:state',
1073
+ target: 'decimalDigits',
1074
+ condition: "{{ $self.value == '' || isNaN($self.value) || $self.value < 0 }}",
1075
+ state: {
1076
+ value: 0,
1077
+ },
1078
+ },
1079
+ ],
1080
+ }),
1081
+ suffix: Type.String({
1082
+ title: '后缀',
1083
+ type: 'string',
1084
+ default: '',
1085
+ 'x-index': 380,
1086
+ }),
1087
+ });
1088
+ const config = defineConfig({
1089
+ $schema: 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json',
1090
+ data,
1091
+ events: [],
1092
+ meta: {
1093
+ title: '柱状图',
1094
+ description: '用于报表场景下展示数据之间大小的对比。',
1095
+ figureIcon: '../../figureIcons/Bar.svg',
1096
+ icon: '../../icons/Bar.svg',
1097
+ category: '图表',
1098
+ categoryOrder: 600,
1099
+ componentOrder: 550,
1100
+ visible: ['APP'],
1101
+ inlineStyleForm: {
1102
+ fontSize: {
1103
+ visible: false,
1104
+ },
1105
+ color: {
1106
+ visible: false,
1107
+ },
1108
+ fontWeight: {
1109
+ visible: false,
1110
+ },
1111
+ lineHeight: {
1112
+ visible: false,
1113
+ },
1114
+ justifyContent: {
1115
+ visible: false,
1116
+ },
1117
+ flexDirection: {
1118
+ visible: false,
1119
+ },
1120
+ border: {
1121
+ visible: false,
1122
+ },
1123
+ background: {
1124
+ visible: false,
1125
+ },
1126
+ boxShadow: {
1127
+ visible: false,
1128
+ },
1129
+ opacity: {
1130
+ visible: false,
1131
+ },
1132
+ alignItems: {
1133
+ visible: false,
1134
+ },
1135
+ },
1136
+ templates: [
1137
+ {
1138
+ when: 'dataSourceType',
1139
+ body: $attached_template,
1140
+ },
1141
+ ],
1142
+ },
1143
+ configMeta: {
1144
+ docsUrl: 'https://docs.cloudbase.net/lowcode/components/wedaUI/src/docs/compsdocs/chart/Bar',
1145
+ },
1146
+ });
1147
+ export default config;