@ibiz-template/vue3-components 0.7.41-alpha.111 → 0.7.41-alpha.112

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 (86) hide show
  1. package/dist/{index-BP7a4gcG.js → index-XI8ySm9i.js} +4 -4
  2. package/dist/{index.es-Ur-QLCI4.js → index.es-Dsu1bPbQ.js} +1 -1
  3. package/dist/index.min.css +1 -1
  4. package/dist/index.system.min.js +1 -1
  5. package/dist/map-chart-nwkjjlMK.js +1 -0
  6. package/dist/map-chart-user-BqadFpkw.js +1 -0
  7. package/dist/{wang-editor-lUuJmqAh.js → wang-editor-4OTQfjW9.js} +1 -1
  8. package/dist/{xlsx-util-C1ySj_kQ.js → xlsx-util--TUzshNx.js} +1 -1
  9. package/es/common/map-chart/map-chart.mjs +2 -9
  10. package/es/common/map-chart-user/map-chart-user.mjs +3 -11
  11. package/es/control/calendar/calendar.mjs +17 -4
  12. package/es/control/calendar/components/calendar-user/calendar-user.mjs +4 -2
  13. package/es/control/calendar/components/calendar-user2/calendar-user2.mjs +4 -3
  14. package/es/control/drtab/drtab-control.util.mjs +1 -1
  15. package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.mjs +1 -0
  16. package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid2/repeater-grid2.mjs +1 -0
  17. package/es/control/grid/grid/grid-control.util.mjs +14 -1
  18. package/es/control/grid/grid/grid.mjs +5 -2
  19. package/es/control/grid/grid-column/grid-field-column/grid-field-column.css +1 -1
  20. package/es/control/map/map.mjs +33 -7
  21. package/es/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.css +1 -1
  22. package/es/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.mjs +2 -2
  23. package/es/editor/color-picker/ibiz-color-mpicker-default/ibiz-color-mpicker-default.mjs +5 -3
  24. package/es/editor/data-picker/ibiz-mpicker/ibiz-mpicker.mjs +2 -2
  25. package/es/editor/data-picker/ibiz-picker/ibiz-picker.mjs +2 -2
  26. package/es/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.mjs +2 -2
  27. package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.mjs +2 -2
  28. package/es/editor/date-range-select/date-range-select-picker/date-range-select.mjs +17 -15
  29. package/es/editor/dropdown-list/dropdown-list-editor.controller.mjs +15 -5
  30. package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.mjs +19 -4
  31. package/es/panel-component/auth-userinfo/auth-userinfo.css +1 -1
  32. package/es/util/fullscreen/fullscreen-util.mjs +1 -1
  33. package/es/web-app/adaptive-screen-width.mjs +5 -5
  34. package/lib/common/map-chart/map-chart.cjs +1 -8
  35. package/lib/common/map-chart-user/map-chart-user.cjs +2 -10
  36. package/lib/control/calendar/calendar.cjs +16 -3
  37. package/lib/control/calendar/components/calendar-user/calendar-user.cjs +4 -2
  38. package/lib/control/calendar/components/calendar-user2/calendar-user2.cjs +4 -3
  39. package/lib/control/drtab/drtab-control.util.cjs +1 -1
  40. package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.cjs +1 -0
  41. package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid2/repeater-grid2.cjs +1 -0
  42. package/lib/control/grid/grid/grid-control.util.cjs +14 -1
  43. package/lib/control/grid/grid/grid.cjs +5 -2
  44. package/lib/control/grid/grid-column/grid-field-column/grid-field-column.css +1 -1
  45. package/lib/control/map/map.cjs +32 -6
  46. package/lib/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.cjs +2 -2
  47. package/lib/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.css +1 -1
  48. package/lib/editor/color-picker/ibiz-color-mpicker-default/ibiz-color-mpicker-default.cjs +5 -3
  49. package/lib/editor/data-picker/ibiz-mpicker/ibiz-mpicker.cjs +2 -2
  50. package/lib/editor/data-picker/ibiz-picker/ibiz-picker.cjs +2 -2
  51. package/lib/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.cjs +2 -2
  52. package/lib/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.cjs +2 -2
  53. package/lib/editor/date-range-select/date-range-select-picker/date-range-select.cjs +17 -15
  54. package/lib/editor/dropdown-list/dropdown-list-editor.controller.cjs +15 -5
  55. package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.cjs +19 -4
  56. package/lib/panel-component/auth-userinfo/auth-userinfo.css +1 -1
  57. package/lib/util/fullscreen/fullscreen-util.cjs +1 -1
  58. package/lib/web-app/adaptive-screen-width.cjs +5 -5
  59. package/package.json +7 -7
  60. package/src/common/map-chart/map-chart.tsx +3 -5
  61. package/src/common/map-chart-user/map-chart-user.tsx +3 -8
  62. package/src/control/calendar/calendar.tsx +27 -1
  63. package/src/control/calendar/components/calendar-user/calendar-user.tsx +8 -2
  64. package/src/control/calendar/components/calendar-user2/calendar-user2.tsx +7 -3
  65. package/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.tsx +1 -0
  66. package/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid2/repeater-grid2.tsx +1 -0
  67. package/src/control/grid/grid/grid-control.util.ts +20 -0
  68. package/src/control/grid/grid/grid.tsx +3 -0
  69. package/src/control/grid/grid-column/grid-field-column/grid-field-column.scss +3 -3
  70. package/src/control/map/map.tsx +44 -4
  71. package/src/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.scss +12 -1
  72. package/src/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.tsx +2 -1
  73. package/src/editor/color-picker/ibiz-color-mpicker-default/ibiz-color-mpicker-default.tsx +10 -2
  74. package/src/editor/data-picker/ibiz-mpicker/ibiz-mpicker.tsx +2 -1
  75. package/src/editor/data-picker/ibiz-picker/ibiz-picker.tsx +2 -1
  76. package/src/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.tsx +2 -1
  77. package/src/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.tsx +2 -5
  78. package/src/editor/date-range-select/date-range-select-picker/date-range-select.tsx +27 -13
  79. package/src/editor/dropdown-list/dropdown-list-editor.controller.ts +12 -2
  80. package/src/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.tsx +32 -4
  81. package/src/panel-component/auth-userinfo/auth-userinfo.scss +1 -1
  82. package/src/web-app/adaptive-screen-width.ts +12 -6
  83. package/dist/map-chart-DbBbP4qh.js +0 -1
  84. package/dist/map-chart-user-CfTAGaU5.js +0 -1
  85. /package/es/node_modules/.pnpm/{@ibiz-template_core@0.7.41-alpha.113_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.41-alpha.117_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs +0 -0
  86. /package/lib/node_modules/.pnpm/{@ibiz-template_core@0.7.41-alpha.113_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.41-alpha.117_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs +0 -0
@@ -55,7 +55,45 @@ const MapControl = defineComponent({
55
55
 
56
56
  const mapStyle = c.model.mapStyle;
57
57
  const { semanticClass, semanticStyle } = useSemanticNode(c);
58
+ // 子类类名透传
59
+ const childClass = [
60
+ {
61
+ class: semanticClass('editor.content'),
62
+ selector: '.ibiz-control-map__map',
63
+ },
64
+ {
65
+ class: semanticClass('editor.goback'),
66
+ selector: '.ibiz-map-chart-user__goback',
67
+ },
68
+ {
69
+ class: semanticClass('editor.goback'),
70
+ selector: '.ibiz-map-chart__goback',
71
+ },
72
+ {
73
+ class: semanticClass('editor.fullscreen'),
74
+ selector: '.ibiz-map-chart-user__fullscreen',
75
+ },
76
+ ];
58
77
 
78
+ // 子类样式透传
79
+ const childStyle = [
80
+ {
81
+ style: semanticStyle('editor.content'),
82
+ selector: '.ibiz-control-map__map',
83
+ },
84
+ {
85
+ style: semanticStyle('editor.goback'),
86
+ selector: '.ibiz-map-chart-user__goback',
87
+ },
88
+ {
89
+ style: semanticStyle('editor.goback'),
90
+ selector: '.ibiz-map-chart__goback',
91
+ },
92
+ {
93
+ style: semanticStyle('editor.fullscreen'),
94
+ selector: '.ibiz-map-chart-user__fullscreen',
95
+ },
96
+ ];
59
97
  const mapOpts = computed<Partial<MapOptions>>(() => {
60
98
  return {
61
99
  strAreaCode: c.state.strAreaCode,
@@ -70,6 +108,8 @@ const MapControl = defineComponent({
70
108
  mapRef,
71
109
  mapOpts,
72
110
  mapStyle,
111
+ childClass,
112
+ childStyle,
73
113
  semanticClass,
74
114
  semanticStyle,
75
115
  };
@@ -87,8 +127,7 @@ const MapControl = defineComponent({
87
127
  options={this.mapOpts}
88
128
  areaData={state.areaData}
89
129
  pointData={state.pointData}
90
- style={this.semanticStyle('content')}
91
- class={[this.ns.e('map'), this.semanticClass('content')]}
130
+ class={this.ns.e('map')}
92
131
  ></iBizMapChartUser>
93
132
  ) : (
94
133
  <iBizMapChart
@@ -97,8 +136,7 @@ const MapControl = defineComponent({
97
136
  options={this.mapOpts}
98
137
  areaData={state.areaData}
99
138
  pointData={state.pointData}
100
- style={this.semanticStyle('content')}
101
- class={[this.ns.e('map'), this.semanticClass('content')]}
139
+ class={this.ns.e('map')}
102
140
  onPointClick={(e: IMapData) => {
103
141
  this.c.onPointClick(e);
104
142
  }}
@@ -114,6 +152,8 @@ const MapControl = defineComponent({
114
152
  controller={this.c}
115
153
  class={this.semanticClass('root')}
116
154
  style={this.semanticStyle('root')}
155
+ v-child-class={this.childClass}
156
+ v-child-style={this.childStyle}
117
157
  >
118
158
  {content}
119
159
  {this.c.state.enableNavView && this.c.state.showNavIcon ? (
@@ -5,6 +5,7 @@ $autocomplete: (
5
5
  line-height: getCssVar(form-item, line-height), // 行高
6
6
  empty-bg-color: getCssVar(color, bg, 3), // 空值背景色
7
7
  readonly-color: getCssVar(form-item, readonly-color), // 只读字体色
8
+ disabled-color: getCssVar(form-item, disabled-color), // 禁用色
8
9
  hover-edit-padding: getCssVar(form-item, hover-edit-padding), // 悬浮编辑态内边距
9
10
  );
10
11
 
@@ -29,8 +30,17 @@ $autocomplete-action: (
29
30
 
30
31
  // 界面行为项
31
32
  @include e(action-item) {
33
+ display: flex;
34
+ align-items: center;
35
+ justify-content: center;
32
36
  color: getCssVar(autocomplete-action, text-color);
33
- text-align: center;
37
+ @include m(icon) {
38
+ margin-right: getCssVar(spacing, extra-tight);
39
+ }
40
+ @include when(disabled) {
41
+ color: getCssVar(autocomplete, disabled-color);
42
+ cursor: not-allowed;
43
+ }
34
44
  }
35
45
 
36
46
  @include e(empty) {
@@ -52,6 +62,7 @@ $autocomplete-action: (
52
62
 
53
63
  @include e(transfer) {
54
64
  @include set-component-css-var('autocomplete', $autocomplete);
65
+ @include set-component-css-var('autocomplete-action', $autocomplete-action);
55
66
  @include when(empty) {
56
67
  .el-autocomplete-suggestion li {
57
68
  padding: 0;
@@ -302,7 +302,7 @@ export const IBizAutoComplete = defineComponent({
302
302
  <div
303
303
  class={[
304
304
  ns.e('action-item'),
305
- ns.be('popper', 'item'),
305
+ ns.be('popper', 'action'),
306
306
  semanticClass('editor.popup.action', semanticParams),
307
307
  ns.is('disabled', c.groupActionState[detail.id!].disabled),
308
308
  ]}
@@ -322,6 +322,7 @@ export const IBizAutoComplete = defineComponent({
322
322
  )}
323
323
  <span
324
324
  class={[
325
+ ns.em('action-item', 'label'),
325
326
  ns.em('action-item', 'caption'),
326
327
  semanticClass('editor.popup.action.label', semanticParams),
327
328
  ]}
@@ -223,7 +223,11 @@ export const IBizColorMPickerDefault = defineComponent({
223
223
  <el-select
224
224
  v-model={this.curType}
225
225
  class={this.ns.b('picker')}
226
- popper-class={this.ns.b('popper')}
226
+ popper-class={[
227
+ this.ns.b('popper'),
228
+ this.semanticClass?.('editor.popup'),
229
+ ]}
230
+ popper-style={this.semanticStyle?.('editor.popup')}
227
231
  onChange={this.handleSchemeChange}
228
232
  >
229
233
  {{
@@ -252,7 +256,11 @@ export const IBizColorMPickerDefault = defineComponent({
252
256
  {this.showTemplateList && (
253
257
  <el-select
254
258
  class={this.ns.b('template-color-picker')}
255
- popper-class={this.ns.b('popper')}
259
+ popper-class={[
260
+ this.ns.b('popper'),
261
+ this.semanticClass?.('editor.popup'),
262
+ ]}
263
+ popper-style={this.semanticStyle?.('editor.popup')}
256
264
  v-model={this.curTemplateColor}
257
265
  onChange={this.handleTemplateColorChange}
258
266
  >
@@ -487,7 +487,7 @@ export const IBizMPicker = defineComponent({
487
487
  disabled={c.groupActionState[item.id!].disabled}
488
488
  title={showTitle(isEllipsis ? item.tooltip : '')}
489
489
  class={[
490
- ns.be('popper', 'item'),
490
+ ns.be('popper', 'action'),
491
491
  semanticClass('editor.popup.action'),
492
492
  ]}
493
493
  style={semanticStyle('editor.popup.action')}
@@ -523,6 +523,7 @@ export const IBizMPicker = defineComponent({
523
523
  <span
524
524
  class={[
525
525
  ns.em('action-item', 'caption'),
526
+ ns.em('action-item', 'label'),
526
527
  semanticClass(
527
528
  'editor.popup.action.label',
528
529
  semanticParams,
@@ -492,7 +492,7 @@ export const IBizPicker = defineComponent({
492
492
  title={showTitle(detail.tooltip)}
493
493
  class={[
494
494
  ns.e('action-item'),
495
- ns.be('popper', 'item'),
495
+ ns.be('popper', 'action'),
496
496
  semanticClass('editor.popup.action', semanticParams),
497
497
  ns.is('disabled', c.groupActionState[detail.id!].disabled),
498
498
  ]}
@@ -514,6 +514,7 @@ export const IBizPicker = defineComponent({
514
514
  )}
515
515
  <span
516
516
  class={[
517
+ ns.em('action-item', 'label'),
517
518
  ns.em('action-item', 'caption'),
518
519
  semanticClass('editor.popup.action.label', semanticParams),
519
520
  ]}
@@ -363,7 +363,7 @@ export const IBizPickerDropDown = defineComponent({
363
363
  title={showTitle(detail.tooltip)}
364
364
  disabled={c.groupActionState[detail.id!].disabled}
365
365
  class={[
366
- ns.be('popper', 'item'),
366
+ ns.be('popper', 'action'),
367
367
  semanticClass('editor.popup.action', { semanticParams }),
368
368
  ]}
369
369
  style={semanticStyle('editor.popup.action', { semanticParams })}
@@ -385,6 +385,7 @@ export const IBizPickerDropDown = defineComponent({
385
385
  <span
386
386
  class={[
387
387
  ns.em('action-item', 'caption'),
388
+ ns.em('action-item', 'label'),
388
389
  semanticClass('editor.popup.action.label', semanticParams),
389
390
  ]}
390
391
  style={semanticStyle('editor.popup.action.label', semanticParams)}
@@ -596,11 +596,8 @@ export const IBizPickerSelectView = defineComponent({
596
596
  this.semanticClass('editor.content'),
597
597
  ]}
598
598
  style={this.semanticStyle('editor.content')}
599
- popper-class={[
600
- this.ns.b('popper'),
601
- this.semanticClass('editor.popper'),
602
- ]}
603
- popper-style={this.semanticStyle('editor.popper')}
599
+ popper-class={[this.ns.b('popper'), this.semanticClass('editor.popup')]}
600
+ popper-style={this.semanticStyle('editor.popup')}
604
601
  onVisibleChange={this.onVisibleChange}
605
602
  onKeydown={this.handleDropDownKeyDown}
606
603
  >
@@ -51,19 +51,19 @@ export const IBizDateRangeSelect = defineComponent({
51
51
  selector: `.${ns.e('label')}`,
52
52
  },
53
53
  {
54
- class: semanticClass('editor.input'),
54
+ class: semanticClass('editor.dateType'),
55
55
  selector: `.${ns.em('date-range', 'editor')}`,
56
56
  },
57
57
  {
58
- class: semanticClass('editor.input.suffix'),
58
+ class: semanticClass('editor.dateType.suffix'),
59
59
  selector: `.${ns.em('date-range', 'editor-suffix')}`,
60
60
  },
61
61
  {
62
- class: semanticClass('editor.select'),
62
+ class: semanticClass('editor.dateUnit'),
63
63
  selector: `.el-input__inner`,
64
64
  },
65
65
  {
66
- class: semanticClass('editor.select.suffix'),
66
+ class: semanticClass('editor.dateUnit.suffix'),
67
67
  selector: '.el-input__suffix',
68
68
  },
69
69
  ];
@@ -75,19 +75,19 @@ export const IBizDateRangeSelect = defineComponent({
75
75
  selector: `.${ns.e('label')}`,
76
76
  },
77
77
  {
78
- style: semanticStyle('editor.input'),
78
+ style: semanticStyle('editor.dateType'),
79
79
  selector: `.${ns.em('date-range', 'editor')}`,
80
80
  },
81
81
  {
82
- style: semanticStyle('editor.input.suffix'),
82
+ style: semanticStyle('editor.dateType.suffix'),
83
83
  selector: `.${ns.em('date-range', 'editor-suffix')}`,
84
84
  },
85
85
  {
86
- style: semanticStyle('editor.select'),
86
+ style: semanticStyle('editor.dateUnit'),
87
87
  selector: `.el-input__inner`,
88
88
  },
89
89
  {
90
- style: semanticStyle('editor.select.suffix'),
90
+ style: semanticStyle('editor.dateUnit.suffix'),
91
91
  selector: '.el-input__suffix',
92
92
  },
93
93
  ];
@@ -205,14 +205,23 @@ export const IBizDateRangeSelect = defineComponent({
205
205
  <div class={ns.em('date-unit', 'editor')}>
206
206
  <el-select
207
207
  v-model={unitValue.value}
208
- class={ns.em('date-unit', 'editor-select')}
209
208
  onChange={unitChange}
209
+ class={ns.em('date-unit', 'editor-select')}
210
+ popper-class={[ns.b('popper'), semanticClass('editor.popup')]}
211
+ popper-style={semanticStyle('editor.popup')}
210
212
  >
211
213
  {units.map((item: IData) => {
212
214
  return (
213
215
  <el-option
214
- class={semanticClass('editor.popup.item', { item })}
215
- style={semanticStyle('editor.popup.item', { item })}
216
+ class={[
217
+ ns.em('date-unit', 'item'),
218
+ semanticClass('editor.dateUnit.popup.item', {
219
+ item,
220
+ }),
221
+ ]}
222
+ style={semanticStyle('editor.dateUnit.popup.item', {
223
+ item,
224
+ })}
216
225
  key={item.value}
217
226
  value={item.value}
218
227
  label={item.label}
@@ -400,6 +409,7 @@ export const IBizDateRangeSelect = defineComponent({
400
409
  trigger='click'
401
410
  width='240px'
402
411
  popper-class={[
412
+ ns.b('popper'),
403
413
  ns.b('date-range-select'),
404
414
  semanticClass('editor.popup'),
405
415
  ]}
@@ -430,9 +440,13 @@ export const IBizDateRangeSelect = defineComponent({
430
440
  <div
431
441
  class={[
432
442
  ns.em('date-type', 'item'),
433
- semanticClass('editor.popup.item', { item }),
443
+ semanticClass('editor.dateType.popup.item', {
444
+ item,
445
+ }),
434
446
  ]}
435
- style={semanticStyle('editor.popup.item', { item })}
447
+ style={semanticStyle('editor.dateType.popup.item', {
448
+ item,
449
+ })}
436
450
  onClick={(event: MouseEvent) =>
437
451
  onTypeClick(item.type, event)
438
452
  }
@@ -27,10 +27,16 @@ export class DropDownListEditorController extends CodeListEditorController<IDrop
27
27
  /**
28
28
  * 默认选中第一个
29
29
  *
30
- * @memberof CustomTagSelectController
30
+ * @memberof DropDownListEditorController
31
31
  */
32
32
  public defaultFirstOption = false;
33
33
 
34
+ /**
35
+ * @description 自动选中第一个
36
+ * @memberof DropDownListEditorController
37
+ */
38
+ public autoSelectFirstOption = false;
39
+
34
40
  /**
35
41
  * 预置项空白项名称
36
42
  *
@@ -72,7 +78,11 @@ export class DropDownListEditorController extends CodeListEditorController<IDrop
72
78
  this.editorParams.defaultfirstoption,
73
79
  );
74
80
  }
75
-
81
+ if (this.editorParams?.autoselectfirstoption) {
82
+ this.autoSelectFirstOption = this.toBoolean(
83
+ this.editorParams.autoselectfirstoption,
84
+ );
85
+ }
76
86
  if (this.editorParams?.blankItemName) {
77
87
  this.blankItemName = this.editorParams.blankItemName;
78
88
  }
@@ -29,6 +29,7 @@ import './ibiz-dropdown.scss';
29
29
  * @primary
30
30
  * @editorparams {name:forceselection,parameterType:boolean,defaultvalue:true,description:是否禁止用户创建选择项。当参数为false时,可在输入框输入内容,使其显示在下拉选项中呈现,并且可选择}
31
31
  * @editorparams {name:defaultfirstoption,parameterType:boolean,defaultvalue:false,description:默认选中第一个,在该属性为 true 的情况下,按下回车就可以选中当前选项列表中的第一个选项,无需使用鼠标或键盘方向键进行定位}
32
+ * @editorparams {name:autoselectfirstoption,parameterType:boolean,defaultvalue:false,description:编辑器无值时,自动选中第一个数据}
32
33
  * @editorparams {name:blankitemname,parameterType:string,description:在单选模式下,用于在下拉展示数据顶部添加一条空白项数据,其文本内容为配置的该参数值}
33
34
  * @editorparams {name:blankitemvalue,parameterType:string,description:在单选模式下,用于在下拉展示数据顶部添加一条空白项数据,其值内容为配置的该参数值}
34
35
  * @editorparams {name:alwaysload,parameterType:boolean,defaultvalue:false,description:当值改变、下拉框出现时,是否重新加载代码表数据。设置为 true 时每次相关事件触发都会重新加载数据}
@@ -202,6 +203,10 @@ export const IBizDropdown = defineComponent({
202
203
  // 值分隔符
203
204
  const valueSeparator = c.editorParams?.valueseparator || ',';
204
205
 
206
+ const { getSelection, getSelectionValue } = useCodeListSelection(
207
+ c.allItemsValue,
208
+ );
209
+
205
210
  // 是否显示表单默认内容
206
211
  const showFormDefaultContent = computed(() => {
207
212
  if (
@@ -258,6 +263,31 @@ export const IBizDropdown = defineComponent({
258
263
  return list;
259
264
  };
260
265
 
266
+ /**
267
+ * @description 自动选中第一项
268
+ */
269
+ const autoSelectFirstOption = (): void => {
270
+ const item = items.value[0];
271
+ if (!c.autoSelectFirstOption || props.value || !item) return;
272
+ if (c.multiple) {
273
+ const value =
274
+ c.allItems && !hasChildren.value
275
+ ? getSelectionValue(item.value).map(v => `${v}`)
276
+ : [item.value];
277
+ emit(
278
+ 'change',
279
+ c.model.valueType === 'SIMPLES' ? value : value.join(valueSeparator),
280
+ undefined,
281
+ true,
282
+ );
283
+ } else if (editorItems && editorItems.length > 0) {
284
+ emit('change', item.value, editorItems[0].id!, true);
285
+ emit('change', item.text, undefined, true);
286
+ } else {
287
+ emit('change', item.value, undefined, true);
288
+ }
289
+ };
290
+
261
291
  /**
262
292
  * 加载代码表后续处理
263
293
  *
@@ -290,6 +320,7 @@ export const IBizDropdown = defineComponent({
290
320
  break;
291
321
  }
292
322
  }
323
+ autoSelectFirstOption();
293
324
  };
294
325
 
295
326
  // 加载代码表数据
@@ -377,10 +408,6 @@ export const IBizDropdown = defineComponent({
377
408
  return list.find(item => item.value === value);
378
409
  };
379
410
 
380
- const { getSelection, getSelectionValue } = useCodeListSelection(
381
- c.allItemsValue,
382
- );
383
-
384
411
  // 当前值
385
412
  const curValue = computed({
386
413
  get() {
@@ -517,6 +544,7 @@ export const IBizDropdown = defineComponent({
517
544
  newVal.focus();
518
545
  }
519
546
  });
547
+
520
548
  const onFocus = (e: IData) => {
521
549
  editorState = 'focus';
522
550
  emit('focus', e);
@@ -63,7 +63,7 @@ $user-info-name: (
63
63
 
64
64
  @include when(collapse){
65
65
  .el-dropdown{
66
- padding: 0 getCssVar(user-info, collapse-padding);
66
+ padding: getCssVar(user-info, collapse-padding);
67
67
  }
68
68
  @include b(user-info-avatar) {
69
69
  max-width: getCssVar(user-info-avatar, max-width);
@@ -74,12 +74,12 @@ const fixContextMenuPosition = (el: HTMLElement) => {
74
74
  };
75
75
 
76
76
  /**
77
- * 修正 ibiz-form-item-container__popper 的 transform 定位,抵消 body zoom 造成的偏移。
77
+ * 修正 Popper 的 transform 定位,抵消 body zoom 造成的偏移。
78
78
  * 将 transform: translate(x, y) 或 translate3d(x, y, z) 中的数值按 scale 反向缩放,非 px 单位保持不变。
79
79
  * @param el
80
80
  * @returns
81
81
  */
82
- const fixFormItemContainerPopperTransform = (el: HTMLElement) => {
82
+ const fixPopperTransform = (el: HTMLElement) => {
83
83
  if (currentScale === 1) return;
84
84
  const transform = el.style.transform;
85
85
  if (!transform) return;
@@ -125,8 +125,11 @@ const startObservePoppers = () => {
125
125
  const el = node as HTMLElement;
126
126
  if (el.classList?.contains('el-popper')) {
127
127
  fixPopperInset(el);
128
- if (el.classList.contains('ibiz-form-item-container__popper')) {
129
- fixFormItemContainerPopperTransform(el);
128
+ if (
129
+ el.classList.contains('ibiz-form-item-container__popper') ||
130
+ el.classList.contains('ibiz-form-mdctrl-popper')
131
+ ) {
132
+ fixPopperTransform(el);
130
133
  }
131
134
  } else if (el.classList?.contains('mx-context-menu')) {
132
135
  fixContextMenuPosition(el);
@@ -139,8 +142,11 @@ const startObservePoppers = () => {
139
142
  const el = mutation.target as HTMLElement;
140
143
  if (el.classList?.contains('el-popper')) {
141
144
  fixPopperInset(el);
142
- if (el.classList.contains('ibiz-form-item-container__popper')) {
143
- fixFormItemContainerPopperTransform(el);
145
+ if (
146
+ el.classList.contains('ibiz-form-item-container__popper') ||
147
+ el.classList.contains('ibiz-form-mdctrl-popper')
148
+ ) {
149
+ fixPopperTransform(el);
144
150
  }
145
151
  } else if (el.classList?.contains('mx-context-menu')) {
146
152
  fixContextMenuPosition(el);
@@ -1 +0,0 @@
1
- System.register(["vue","ramda","@ibiz-template/vue3-util","@ibiz-template/runtime","echarts"],function(e){"use strict";var t,a,o,r,i,n,s,l,c,p,u,d,m;return{setters:[function(e){t=e.ref,a=e.onMounted,o=e.onUnmounted,r=e.defineComponent,i=e.createVNode,n=e.computed},function(e){s=e.mergeDeepWithKey,l=e.isNil},function(e){c=e.useNamespace,p=e.useSemanticNode},function(e){u=e.MapController},function(e){d=e.init,m=e.registerMap}],execute:function(){const f={strAreaCode:!1,visualMap:{text:[ibiz.i18n.t("component.mapChart.high"),ibiz.i18n.t("component.mapChart.low")],min:0,max:100,rangeColor:["#90d1e7","#fff600","#ff5200"]},areaColor:"#87cefa",areaBorderColor:"#FFF",hoverAreaColor:"#fbdb2f",pointSymbol:"pin",jsonBaseUrl:"".concat(ibiz.env.assetsUrl,"/json/map"),defaultAreaCode:1e5};function y(e,r,i,n){const s=new Map,l=t(""),c=t([]);let p;const u=t();let f;const y=async e=>{if(s.has(e))return;const t=await async function(e,t){return(await ibiz.net.axios({url:"".concat(e,"/").concat(t,".json")})).data}(r.value.jsonBaseUrl,e);s.set(e,(e=>{const t={cityNames:{},noChild:1===e.features.length};return e.features.forEach(e=>{const{adcode:a,name:o}=e.properties;t.cityNames[a]=o}),t})(t)),m(e,t)},h=()=>{if(l.value){const e=i(l.value);p.setOption(e),p.resize()}},v=async(t,a=!1)=>{if(!a){const a=r.value.strAreaCode?"".concat(t):Number(t);await e.onMapChange(a)}const o="".concat(t);s.has(o)||await y(o),l.value=o,c.value.push(o),h()},b=()=>{null==p||p.resize()};return a(()=>{p=d(u.value),window.addEventListener("resize",b),u.value&&ResizeObserver&&(f=new ResizeObserver(()=>{b()}),f.observe(u.value)),p.on("click",e=>{if("series"===e.componentType){if("scatter"===e.seriesType)return void n("pointClick",e.data);"map"===e.seriesType&&(e.data&&n("areaClick",e.data),e.name!==l.value&&v(e.name))}}),p.on("mouseover",function(e){if("series"===e.componentType&&"scatter"===e.seriesType){const t=e.dataIndex,a=p.getOption(),o=a.series[e.seriesIndex].data,r=a.series[e.seriesIndex].symbolSize;o[t].symbolSize=r+10,p.setOption(a)}}),p.on("mouseout",function(e){if("series"===e.componentType&&"scatter"===e.seriesType){const t=e.dataIndex,a=p.getOption();delete a.series[e.seriesIndex].data[t].symbolSize,p.setOption(a)}})}),o(()=>{window.removeEventListener("resize",b),null==f||f.disconnect()}),{chartRef:u,historyNames:c,currentName:l,changeMap:v,getCityName:e=>{const t=s.get(l.value);if(t)return t.cityNames[e]},goBack:()=>{if(c.value.length>1){c.value.pop();const e=c.value.pop();v(e)}},refresh:h}}const h=r({name:"IBizMapChart",props:{areaData:{type:Array},pointData:{type:Array},options:{type:Object,default:()=>({})},controller:{type:u,required:!0}},setup(e,{emit:t}){const o=c("map-chart"),{semanticClass:r,semanticStyle:i}=p(e.controller),u=n(()=>s((e,t,a)=>l(a)?t:a,f,e.options)),d=(t,a)=>"area"===a&&e.areaData?e.areaData.find(e=>e._id===t):"point"===a&&e.pointData?e.pointData.find(e=>e._id===t):void 0,{chartRef:m,historyNames:h,changeMap:v,getCityName:b,goBack:C}=y(e.controller,u,t=>{const{visualMap:a,pointSymbol:o,areaColor:r,hoverAreaColor:i,areaBorderColor:n}=u.value,s=e.areaData||[],l=e.pointData||[];return{geo:{map:t},tooltip:{trigger:"item",textStyle:{color:"#fff",fontSize:12},backgroundColor:"rgba(0, 0, 0, 0.47)",borderWidth:0,extraCssText:"backdrop-filter: blur(3px);"},visualMap:{min:a.min,max:a.max,text:a.text,realtime:!1,hoverLink:!1,inRange:{color:a.rangeColor}},series:[{type:"map",map:t,nameProperty:"adcodeStr",itemStyle:{areaColor:r,borderColor:n,borderWidth:2},emphasis:{itemStyle:{areaColor:i}},tooltip:{formatter:e=>{if(!e.data)return;const t=d(e.data._id,"area");return t?t._tooltip:void 0}},label:{show:!0,color:"#000000",fontSize:14,formatter:e=>b(e.name)},select:{disabled:!0},data:s.map(e=>({name:"".concat(e._areaCode),value:e._value,_id:e._id}))},{type:"scatter",coordinateSystem:"geo",symbol:o,symbolSize:20,visualMap:!1,itemStyle:{color:"#FF1D00"},label:{show:!0,color:"#000000",fontSize:14,textShadowBlur:0,formatter:e=>{const t=d(e.data._id,"point");return null==t?void 0:t._text},position:"left",offset:[10,-15]},tooltip:{formatter:e=>{const t=d(e.data._id,"point");return null==t?void 0:t._tooltip}},data:l.map(e=>({_id:e._id,symbol:e._symbol?"image://".concat(e._symbol):void 0,value:[Number(e._longitude),Number(e._latitude)],visualMap:!1}))}]}},(e,a)=>{switch(e){case"pointClick":t("pointClick",d(a._id,"point"));break;case"areaClick":t("areaClick",d(a._id,"area"))}});return a(()=>{v(u.value.defaultAreaCode,!0)}),{ns:o,chartRef:m,historyNames:h,semanticClass:r,semanticStyle:i,goBack:C}},render(){return i("div",{class:this.ns.b()},[i("div",{class:this.ns.e("chart"),ref:"chartRef"},null),this.historyNames.length>1&&i("div",{style:this.semanticStyle("goback"),class:[this.ns.e("goback"),this.semanticClass("goback")],onClick:()=>{this.goBack()}},[ibiz.i18n.t("app.return")])])}});e({IBizMapChart:h,default:h})}}});
@@ -1 +0,0 @@
1
- System.register(["vue","ramda","@ibiz-template/vue3-util","@ibiz-template/runtime","@ibiz-template/core","lodash-es","echarts"],function(e){"use strict";var t,a,o,r,n,s,l,i,c,u,d,m,p,v,f,b,h,y,C,g;return{setters:[function(e){t=e.ref,a=e.onMounted,o=e.onUnmounted,r=e.defineComponent,n=e.createVNode,s=e.resolveComponent,l=e.computed,i=e.onBeforeUnmount},function(e){c=e.mergeDeepLeft,u=e.mergeDeepWithKey,d=e.isNil},function(e){m=e.useNamespace,p=e.useSemanticNode},function(e){v=e.MapController,f=e.getAreaLevelByCode},function(e){b=e.listenJSEvent,h=e.NOOP},function(e){y=e.toNumber},function(e){C=e.init,g=e.registerMap}],execute:function(){const _={strAreaCode:!1,visualMap:{text:[ibiz.i18n.t("component.mapChart.high"),ibiz.i18n.t("component.mapChart.low")],min:0,max:100,rangeColor:["#90d1e7","#fff600","#ff5200"]},areaColor:"#87cefa",areaBorderColor:"#FFF",hoverAreaColor:"#fbdb2f",pointSymbol:"pin",jsonBaseUrl:"".concat(ibiz.env.assetsUrl,"/json/map"),defaultAreaCode:1e5,bottom:20,top:20},N=e=>{const t=[];return e._color&&t.push("color:".concat(e._color)),e._bgcolor&&t.push("background:".concat(e._bgcolor)),e._borderColor&&t.push("border-color:".concat(e._borderColor)),e._borderWidth&&t.push("border-width:".concat(e._borderWidth,"px")),e._borderWidth&&e._borderColor&&t.push("border-style:solid"),t.join(";")},z=(e,t,a=[],o=[])=>"area"===t?o.find(t=>t._id===e):"point"===t?a.find(t=>t._id===e):void 0,S=e=>{let t=e;const a=window.getComputedStyle(document.documentElement);return a&&(t=a.getPropertyValue(e)||t),t},x=e=>{const{pointSymbol:t}=e,a=m("map-chart-user"),o=S(a.cssVarName("color-danger")),r=S(a.cssVarName("font-size-header-4"));return{type:"scatter",coordinateSystem:"geo",symbol:t,symbolSize:Number(r.slice(0,2)),visualMap:!1,itemStyle:{color:o}}},w=(e,t)=>{const a={},o=m("map-chart-user"),r=S(o.cssVarName("color-text-1")),n=S(o.cssVarName("font-size-regular"));return a.label={show:!0,color:r,fontSize:Number(n.slice(0,2)),textShadowBlur:0,formatter:a=>{if(!a.data)return;const o=z(a.data._id,"point",e,t);return null==o?void 0:o._text},position:"left",offset:[10,-15]},a.tooltip={formatter:a=>{if(!a.data)return;const r=z(a.data._id,"point",e,t);if(!r)return;const{_deData:n}=r;let s=n.srfmajortext;r._value&&(s="".concat(n.srfmajortext,": ").concat(r._value)),r._tooltip&&(s=r._tooltip);const l=N(r);return'<div style="'.concat(l,'" class="').concat(r._className," ").concat(o.e("popper"),'">').concat(s,"</div>")},padding:0},a.data=e.map(e=>{let t;return e._symbol&&(t="image://".concat(e._symbol)),{_id:e._id,symbol:t,value:[Number(e._longitude),Number(e._latitude)],visualMap:!1}}),a},D=e=>{const{areaColor:t,areaBorderColor:a,hoverAreaColor:o}=e;return{type:"map",nameProperty:"adcodeStr",itemStyle:{areaColor:t,borderColor:a,borderWidth:2},emphasis:{itemStyle:{areaColor:o}}}},k=(e,t,a,o=[])=>{const r={},n=m("map-chart-user"),s=S(n.cssVarName("color-text-1")),l=S(n.cssVarName("font-size-regular"));return r.map=e,r.label={show:!0,color:s,fontSize:Number(l.slice(0,2)),formatter:e=>o.cityNames[e.name]},r.tooltip={formatter:e=>{if(!e.data)return;const o=z(e.data._id,"area",t,a);if(!o||!o._tooltip&&!o._value)return;const{_deData:r}=o;let s=r.srfmajortext;o._value&&(s="".concat(r.srfmajortext,": ").concat(o._value)),o._tooltip&&(s=o._tooltip);const l=N(o);return'<div style="'.concat(l,'" class="').concat(o._className," ").concat(n.e("popper"),'">').concat(s,"</div>")},padding:0},r.data=a.map(e=>({name:"".concat(e._areaCode),value:e._value,_id:e._id,deData:e})),r.select={disabled:!0},r};function M(e,r,n){const s=new Map,l=t(""),i=t([]),c=new Map,u=t(!1);let d;const m=t();let p;const v=async t=>{e.options=t,await e.evt.emit("onBeforeUpdate",{data:t}),d.setOption(t,!0)},f=async e=>{if(s.has(e))return;const t=await async function(e,t){return(await ibiz.net.axios({url:"".concat(e,"/").concat(t,".json")})).data}(r.value.jsonBaseUrl,e);s.set(e,(e=>{const t={cityNames:{},noChild:1===e.features.length};return e.features.forEach(e=>{const{adcode:a,name:o,level:r}=e.properties;t.cityNames[a]=o,c.set(a,r)}),t})(t)),g(e,t)},h=()=>s.get(l.value),_=()=>{if(l.value){const e=n(l.value);v(e),d.resize()}},N=async(t,a,o=!1)=>{const r="".concat(t);if(s.has(r)||await f(r),o){const t=c.get(y(a))||"";e.state.areaLevel=t}else await e.onMapChange(a);l.value=r,e.state.mapInfo=h(),i.value.push(r),_()},S=b(window,"resize",()=>{d&&d.resize()});return a(()=>{d=C(m.value),e.chart=d,m.value&&ResizeObserver&&(p=new ResizeObserver(()=>{null==d||d.resize()}),p.observe(m.value)),d.on("click",t=>{if("series"===t.componentType){if("scatter"===t.seriesType){if(!t.data)return;u.value=!0;const{pointData:a,areaData:o}=e.state,r=z(t.data._id,"point",a,o);return r&&e.onPointClick(r),void(u.value=!1)}if("map"===t.seriesType){u.value=!0;const a=r.value.strAreaCode?"".concat(t.name):Number(t.name),o=c.get(y(a))||"",{pointData:n,areaData:s,enabledDrillDown:i,mdctrlActiveMode:d}=e.state;if(t.data){const r=z(t.data._id,"area",n,s);r&&e.onAreaClick(r,a,o)}t.name!==l.value&&i&&2!==d&&(y(a)>y(e.state.areaCode)&&e.evt.emit("onDrillDown",{data:{areaCode:a}}),e.state.areaCode=a,e.state.areaLevel=o||"",N(t.name,a)),u.value=!1}}}),d.on("dblclick",t=>{const{enabledDrillDown:a,mdctrlActiveMode:o}=e.state;if("series"===t.componentType&&"map"===t.seriesType&&2===o&&a){u.value=!0;const a=r.value.strAreaCode?"".concat(t.name):Number(t.name),o=c.get(y(a))||"";y(a)>y(e.state.areaCode)&&e.evt.emit("onDrillDown",{data:{areaCode:a}}),e.state.areaCode=a,e.state.areaLevel=o,t.name!==l.value&&N(t.name,a),u.value=!1}}),d.on("mouseover",function(t){if(e.evt.emit("onMouseOver",{data:t}),"series"===t.componentType&&"scatter"===t.seriesType){const e=t.dataIndex,a=d.getOption(),o=a.series[t.seriesIndex].data,r=a.series[t.seriesIndex].symbolSize;o[e].symbolSize=r+10,v(a)}}),d.on("mouseout",function(t){if(e.evt.emit("onMouseOut",{data:t}),"series"===t.componentType&&"scatter"===t.seriesType){const e=t.dataIndex,a=d.getOption();delete a.series[t.seriesIndex].data[e].symbolSize,v(a)}})}),o(()=>{S(),null==p||p.disconnect()}),{chartRef:m,historyNames:i,currentName:l,processing:u,areaLevelMap:c,changeMap:N,getCityInfo:h,goBack:async()=>{if(i.value.length>1){i.value.pop();const t=i.value.pop(),a=r.value.strAreaCode?"".concat(t):Number(t),o=c.get(y(a))||"";e.state.areaCode=a,e.state.areaLevel=o,N(t,a)}},refresh:_}}const A=r({name:"IBizMapChartUser",props:{areaData:{type:Array},pointData:{type:Array},options:{type:Object,default:()=>({})},controller:{type:v,required:!0}},setup(e){const o=m("map-chart-user"),{semanticClass:r,semanticStyle:n}=p(e.controller),s=e.controller;let v=_;const C=t(),g=t(!1);if(s.controlParams.defaultopts){const e=JSON.parse(s.controlParams.defaultopts);v=c(e,v)}const N=l(()=>u((e,t,a)=>d(a)?t:a,v,e.options));let z=h;const{chartRef:A,historyNames:B,processing:F,areaLevelMap:L,changeMap:O,getCityInfo:U,goBack:V}=M(e.controller,N,t=>{const a=e.areaData||[],o=e.pointData||[],r=(()=>{const e=m("map-chart-user"),t=S(e.cssVarName("color-text-1")),a=S(e.cssVarName("font-size-regular")),o=S(e.cssVarName("color-bg-0"));return{trigger:"item",textStyle:{color:t,fontSize:Number(a.slice(0,2))},backgroundColor:o,borderWidth:0,extraCssText:"backdrop-filter: blur(3px);"}})(),n=(e=>{const{visualMap:t}=e;return{min:t.min,max:t.max,text:t.text,realtime:!1,hoverLink:!1,inRange:{color:t.rangeColor}}})(N.value),s=U(),l={...x(N.value),...w(o,a)},{top:i,bottom:c}=N.value;return{geo:{map:t,top:i,bottom:c},tooltip:r,visualMap:n,series:[{top:i,bottom:c,...D(N.value),...k(t,o,a,s)},l]}});a(()=>{const e=N.value.defaultAreaCode,t=s.state.strAreaCode?"".concat(e):Number(e);s.state.areaCode=t,s.state.areaLevel=f(t.toString()),O(e,t,!0),s.evt.on("onDrillDown",async e=>{if(!F.value){const{data:t}=e,a=t.areaCode,o=s.state.strAreaCode?"".concat(a):Number(a),r=L.get(y(o))||"";s.state.areaCode=o,s.state.areaLevel=r,await O(a,a)}}),s.evt.on("onBackClick",()=>{F.value||V()}),z=b(window,"resize",()=>{g.value&&(g.value=ibiz.fullscreenUtil.isFullScreen)})}),i(()=>{z!==h&&z()});return{c:s,ns:o,mapRef:C,isFull:g,chartRef:A,historyNames:B,semanticClass:r,semanticStyle:n,onBack:async()=>{F.value=!0,await s.evt.emit("onBackClick",void 0),V(),F.value=!1},toggleFullScreen:()=>{C.value&&(g.value?ibiz.fullscreenUtil.closeElementFullscreen():ibiz.fullscreenUtil.openElementFullscreen(C.value),g.value=!g.value)}}},render(){const{enabledFullScreen:e}=this.c.state;return n("div",{class:this.ns.b(),ref:"mapRef"},[e?n(s("el-button"),{type:"info",onClick:this.toggleFullScreen,style:this.semanticStyle("fullscreen"),class:[this.ns.e("fullscreen"),this.semanticClass("fullscreen")],title:this.isFull?ibiz.i18n.t("app.cancelFullscreen"):ibiz.i18n.t("app.fullscreen")},{default:()=>[n("ion-icon",{name:this.isFull?"contract-outline":"expand-outline"},null)]}):null,n("div",{class:this.ns.e("chart"),ref:"chartRef"},null),this.historyNames.length>1&&n("div",{style:this.semanticStyle("goback"),class:[this.ns.e("goback"),this.semanticClass("goback")],onClick:()=>{this.onBack()}},[ibiz.i18n.t("app.return")])])}});e({IBizMapChartUser:A,default:A})}}});