vxe-pc-ui 4.0.91 → 4.0.92

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 (148) hide show
  1. package/es/form/src/form.js +7 -5
  2. package/es/form-design/src/form-design.js +7 -4
  3. package/es/form-design/src/form-view.js +47 -3
  4. package/es/form-design/src/layout-style.js +5 -3
  5. package/es/form-design/src/use/index.js +4 -0
  6. package/es/form-design/src/use/widget-name.js +11 -0
  7. package/es/form-design/src/{use.js → use/widget-prop-data-source.js} +27 -44
  8. package/es/form-design/src/use/widget-prop-default-value.js +38 -0
  9. package/es/form-design/src/use/widget-view.js +25 -0
  10. package/es/form-design/widget-input/input-view.js +1 -1
  11. package/es/form-design/widget-select/select-view.js +1 -1
  12. package/es/form-design/widget-textarea/textarea-view.js +1 -1
  13. package/es/form-design/widget-vxe-checkbox-group/vxe-checkbox-group-view.js +1 -1
  14. package/es/form-design/widget-vxe-date-picker/vxe-date-picker-data.js +5 -1
  15. package/es/form-design/widget-vxe-date-picker/vxe-date-picker-form.js +2 -0
  16. package/es/form-design/widget-vxe-date-picker/vxe-date-picker-view.js +1 -1
  17. package/es/form-design/widget-vxe-input/vxe-input-view.js +1 -1
  18. package/es/form-design/widget-vxe-number-input/vxe-number-input-view.js +1 -1
  19. package/es/form-design/widget-vxe-radio-group/vxe-radio-group-view.js +1 -1
  20. package/es/form-design/widget-vxe-select/vxe-select-view.js +1 -1
  21. package/es/form-design/widget-vxe-switch/vxe-switch-view.js +1 -1
  22. package/es/form-design/widget-vxe-textarea/vxe-textarea-view.js +1 -1
  23. package/es/form-design/widget-vxe-tree-select/vxe-tree-select-view.js +1 -1
  24. package/es/form-design/widget-vxe-upload-file/vxe-upload-file-view.js +1 -1
  25. package/es/form-design/widget-vxe-upload-image/vxe-upload-image-view.js +1 -1
  26. package/es/icon/style.css +1 -1
  27. package/es/list-design/src/list-design.js +7 -4
  28. package/es/menu/style.css +1 -4
  29. package/es/menu/style.min.css +1 -1
  30. package/es/modal/src/modal.js +65 -41
  31. package/es/style.css +1 -1
  32. package/es/style.min.css +1 -1
  33. package/es/ui/index.js +1 -1
  34. package/es/ui/src/log.js +1 -1
  35. package/es/vxe-menu/style.css +1 -4
  36. package/es/vxe-menu/style.min.css +1 -1
  37. package/lib/form/src/form.js +6 -4
  38. package/lib/form/src/form.min.js +1 -1
  39. package/lib/form-design/src/form-design.js +7 -4
  40. package/lib/form-design/src/form-design.min.js +1 -1
  41. package/lib/form-design/src/form-view.js +46 -3
  42. package/lib/form-design/src/form-view.min.js +1 -1
  43. package/lib/form-design/src/layout-style.js +5 -3
  44. package/lib/form-design/src/layout-style.min.js +1 -1
  45. package/lib/form-design/src/use/index.js +49 -0
  46. package/lib/form-design/src/use/index.min.js +1 -0
  47. package/lib/form-design/src/use/widget-name.js +20 -0
  48. package/lib/form-design/src/use/widget-name.min.js +1 -0
  49. package/lib/form-design/src/{use.js → use/widget-prop-data-source.js} +31 -59
  50. package/lib/form-design/src/use/widget-prop-data-source.min.js +1 -0
  51. package/lib/form-design/src/use/widget-prop-default-value.js +50 -0
  52. package/lib/form-design/src/use/widget-prop-default-value.min.js +1 -0
  53. package/lib/form-design/src/use/widget-view.js +43 -0
  54. package/lib/form-design/src/use/widget-view.min.js +1 -0
  55. package/lib/form-design/widget-input/input-view.js +1 -1
  56. package/lib/form-design/widget-input/input-view.min.js +1 -1
  57. package/lib/form-design/widget-select/select-view.js +1 -1
  58. package/lib/form-design/widget-select/select-view.min.js +1 -1
  59. package/lib/form-design/widget-textarea/textarea-view.js +1 -1
  60. package/lib/form-design/widget-textarea/textarea-view.min.js +1 -1
  61. package/lib/form-design/widget-vxe-checkbox-group/vxe-checkbox-group-view.js +1 -1
  62. package/lib/form-design/widget-vxe-checkbox-group/vxe-checkbox-group-view.min.js +1 -1
  63. package/lib/form-design/widget-vxe-date-picker/vxe-date-picker-data.js +5 -1
  64. package/lib/form-design/widget-vxe-date-picker/vxe-date-picker-data.min.js +1 -1
  65. package/lib/form-design/widget-vxe-date-picker/vxe-date-picker-form.js +4 -1
  66. package/lib/form-design/widget-vxe-date-picker/vxe-date-picker-view.js +1 -1
  67. package/lib/form-design/widget-vxe-date-picker/vxe-date-picker-view.min.js +1 -1
  68. package/lib/form-design/widget-vxe-input/vxe-input-view.js +1 -1
  69. package/lib/form-design/widget-vxe-input/vxe-input-view.min.js +1 -1
  70. package/lib/form-design/widget-vxe-number-input/vxe-number-input-view.js +1 -1
  71. package/lib/form-design/widget-vxe-number-input/vxe-number-input-view.min.js +1 -1
  72. package/lib/form-design/widget-vxe-radio-group/vxe-radio-group-view.js +1 -1
  73. package/lib/form-design/widget-vxe-radio-group/vxe-radio-group-view.min.js +1 -1
  74. package/lib/form-design/widget-vxe-select/vxe-select-view.js +1 -1
  75. package/lib/form-design/widget-vxe-select/vxe-select-view.min.js +1 -1
  76. package/lib/form-design/widget-vxe-switch/vxe-switch-view.js +1 -1
  77. package/lib/form-design/widget-vxe-switch/vxe-switch-view.min.js +1 -1
  78. package/lib/form-design/widget-vxe-textarea/vxe-textarea-view.js +1 -1
  79. package/lib/form-design/widget-vxe-textarea/vxe-textarea-view.min.js +1 -1
  80. package/lib/form-design/widget-vxe-tree-select/vxe-tree-select-view.js +1 -1
  81. package/lib/form-design/widget-vxe-tree-select/vxe-tree-select-view.min.js +1 -1
  82. package/lib/form-design/widget-vxe-upload-file/vxe-upload-file-view.js +1 -1
  83. package/lib/form-design/widget-vxe-upload-file/vxe-upload-file-view.min.js +1 -1
  84. package/lib/form-design/widget-vxe-upload-image/vxe-upload-image-view.js +1 -1
  85. package/lib/form-design/widget-vxe-upload-image/vxe-upload-image-view.min.js +1 -1
  86. package/lib/icon/style/style.css +1 -1
  87. package/lib/icon/style/style.min.css +1 -1
  88. package/lib/index.umd.js +15745 -15586
  89. package/lib/index.umd.min.js +1 -1
  90. package/lib/list-design/src/list-design.js +7 -4
  91. package/lib/list-design/src/list-design.min.js +1 -1
  92. package/lib/menu/style/style.css +1 -4
  93. package/lib/menu/style/style.min.css +1 -1
  94. package/lib/modal/src/modal.js +65 -41
  95. package/lib/modal/src/modal.min.js +1 -1
  96. package/lib/style.css +1 -1
  97. package/lib/style.min.css +1 -1
  98. package/lib/ui/index.js +1 -1
  99. package/lib/ui/index.min.js +1 -1
  100. package/lib/ui/src/log.js +1 -1
  101. package/lib/ui/src/log.min.js +1 -1
  102. package/lib/vxe-menu/style/style.css +1 -4
  103. package/lib/vxe-menu/style/style.min.css +1 -1
  104. package/package.json +1 -1
  105. package/packages/form/src/form.ts +6 -4
  106. package/packages/form-design/src/form-design.ts +7 -4
  107. package/packages/form-design/src/form-view.ts +47 -3
  108. package/packages/form-design/src/layout-style.ts +5 -3
  109. package/packages/form-design/src/use/index.ts +4 -0
  110. package/packages/form-design/src/use/widget-name.ts +14 -0
  111. package/packages/form-design/src/{use.ts → use/widget-prop-data-source.ts} +28 -52
  112. package/packages/form-design/src/use/widget-prop-default-value.ts +52 -0
  113. package/packages/form-design/src/use/widget-view.ts +33 -0
  114. package/packages/form-design/widget-input/input-view.ts +1 -1
  115. package/packages/form-design/widget-select/select-view.ts +1 -1
  116. package/packages/form-design/widget-textarea/textarea-view.ts +1 -1
  117. package/packages/form-design/widget-vxe-checkbox-group/vxe-checkbox-group-view.ts +1 -1
  118. package/packages/form-design/widget-vxe-date-picker/vxe-date-picker-data.ts +7 -1
  119. package/packages/form-design/widget-vxe-date-picker/vxe-date-picker-form.ts +2 -0
  120. package/packages/form-design/widget-vxe-date-picker/vxe-date-picker-view.ts +1 -1
  121. package/packages/form-design/widget-vxe-input/vxe-input-view.ts +1 -1
  122. package/packages/form-design/widget-vxe-number-input/vxe-number-input-view.ts +1 -1
  123. package/packages/form-design/widget-vxe-radio-group/vxe-radio-group-view.ts +1 -1
  124. package/packages/form-design/widget-vxe-select/vxe-select-view.ts +1 -1
  125. package/packages/form-design/widget-vxe-switch/vxe-switch-view.ts +1 -1
  126. package/packages/form-design/widget-vxe-textarea/vxe-textarea-view.ts +1 -1
  127. package/packages/form-design/widget-vxe-tree-select/vxe-tree-select-view.ts +1 -1
  128. package/packages/form-design/widget-vxe-upload-file/vxe-upload-file-view.ts +1 -1
  129. package/packages/form-design/widget-vxe-upload-image/vxe-upload-image-view.ts +1 -1
  130. package/packages/list-design/src/list-design.ts +8 -4
  131. package/packages/modal/src/modal.ts +64 -40
  132. package/styles/components/menu.scss +1 -4
  133. package/types/components/form-view.d.ts +26 -2
  134. package/types/components/form.d.ts +3 -2
  135. package/types/components/input.d.ts +1 -1
  136. package/lib/form-design/src/use.min.js +0 -1
  137. /package/es/icon/style/{iconfont.1723039994859.ttf → iconfont.1723111791738.ttf} +0 -0
  138. /package/es/icon/style/{iconfont.1723039994859.woff → iconfont.1723111791738.woff} +0 -0
  139. /package/es/icon/style/{iconfont.1723039994859.woff2 → iconfont.1723111791738.woff2} +0 -0
  140. /package/es/{iconfont.1723039994859.ttf → iconfont.1723111791738.ttf} +0 -0
  141. /package/es/{iconfont.1723039994859.woff → iconfont.1723111791738.woff} +0 -0
  142. /package/es/{iconfont.1723039994859.woff2 → iconfont.1723111791738.woff2} +0 -0
  143. /package/lib/icon/style/{iconfont.1723039994859.ttf → iconfont.1723111791738.ttf} +0 -0
  144. /package/lib/icon/style/{iconfont.1723039994859.woff → iconfont.1723111791738.woff} +0 -0
  145. /package/lib/icon/style/{iconfont.1723039994859.woff2 → iconfont.1723111791738.woff2} +0 -0
  146. /package/lib/{iconfont.1723039994859.ttf → iconfont.1723111791738.ttf} +0 -0
  147. /package/lib/{iconfont.1723039994859.woff → iconfont.1723111791738.woff} +0 -0
  148. /package/lib/{iconfont.1723039994859.woff2 → iconfont.1723111791738.woff2} +0 -0
@@ -493,11 +493,13 @@ export default defineComponent({
493
493
  return nextTick();
494
494
  }
495
495
  let fields = [];
496
- if (XEUtils.isArray(fieldOrItem)) {
497
- fields = fieldOrItem;
498
- }
499
- else {
500
- fields = [fieldOrItem];
496
+ if (fieldOrItem) {
497
+ if (XEUtils.isArray(fieldOrItem)) {
498
+ fields = fieldOrItem;
499
+ }
500
+ else {
501
+ fields = [fieldOrItem];
502
+ }
501
503
  }
502
504
  return beginValidate(fields.map(field => handleFieldOrItem($xeForm, field)), '', callback);
503
505
  };
@@ -92,7 +92,7 @@ export default defineComponent({
92
92
  return XEUtils.clone(reactData.formData, true);
93
93
  };
94
94
  const loadFormConfig = (data) => {
95
- reactData.formData = Object.assign({}, data);
95
+ reactData.formData = Object.assign({}, createSettingForm(), data);
96
96
  return nextTick();
97
97
  };
98
98
  const getWidgetData = () => {
@@ -127,7 +127,7 @@ export default defineComponent({
127
127
  },
128
128
  clearConfig() {
129
129
  reactData.widgetObjList = [];
130
- createSettingForm();
130
+ initSettingForm();
131
131
  return nextTick();
132
132
  },
133
133
  loadConfig,
@@ -301,7 +301,10 @@ export default defineComponent({
301
301
  const createFormConfig = compConf ? compConf.createFormDesignSettingFormConfig : null;
302
302
  formData = (createFormConfig ? createFormConfig({}) : {}) || {};
303
303
  }
304
- reactData.formData = formData;
304
+ return formData;
305
+ };
306
+ const initSettingForm = () => {
307
+ reactData.formData = createSettingForm();
305
308
  };
306
309
  const openStylePreviewEvent = () => {
307
310
  openStyleSetting();
@@ -367,7 +370,7 @@ export default defineComponent({
367
370
  watch(() => props.config, (value) => {
368
371
  loadConfig(value || {});
369
372
  });
370
- createSettingForm();
373
+ initSettingForm();
371
374
  updateWidgetConfigs();
372
375
  if (props.config) {
373
376
  loadConfig(props.config);
@@ -124,7 +124,7 @@ export default defineComponent({
124
124
  { required: true, content: '该填写该字段!' }
125
125
  ];
126
126
  };
127
- const updateItemStatus = (widget, value) => {
127
+ const updateWidgetStatus = (widget, value) => {
128
128
  const { field } = widget;
129
129
  const $form = formRef.value;
130
130
  if ($form) {
@@ -154,6 +154,17 @@ export default defineComponent({
154
154
  const dispatchEvent = (type, params, evnt) => {
155
155
  emit(type, createEvent(evnt, { $formView: $xeFormView }, params));
156
156
  };
157
+ const toWidgetFields = (widget) => {
158
+ if (widget) {
159
+ if (XEUtils.isArray(widget)) {
160
+ return widget.map(item => item.name);
161
+ }
162
+ else {
163
+ return [widget.name];
164
+ }
165
+ }
166
+ return null;
167
+ };
157
168
  const formViewMethods = {
158
169
  dispatchEvent,
159
170
  clearConfig,
@@ -161,9 +172,42 @@ export default defineComponent({
161
172
  parseConfig,
162
173
  loadFormConfig,
163
174
  loadWidgetData,
164
- updateItemStatus,
175
+ updateWidgetStatus,
165
176
  setItemValue,
166
- getItemValue
177
+ getItemValue,
178
+ validate() {
179
+ const $form = formRef.value;
180
+ if ($form) {
181
+ return $form.validate();
182
+ }
183
+ return nextTick();
184
+ },
185
+ validateWidget(widget) {
186
+ const $form = formRef.value;
187
+ if ($form) {
188
+ return $form.validateField(toWidgetFields(widget));
189
+ }
190
+ return nextTick();
191
+ },
192
+ clearValidate(widget) {
193
+ const $form = formRef.value;
194
+ if ($form) {
195
+ return $form.clearValidate(toWidgetFields(widget));
196
+ }
197
+ return nextTick();
198
+ },
199
+ reset() {
200
+ const $form = formRef.value;
201
+ if ($form) {
202
+ return $form.reset();
203
+ }
204
+ return nextTick();
205
+ },
206
+ /**
207
+ * 已废弃
208
+ * @deprecated
209
+ */
210
+ updateItemStatus: updateWidgetStatus
167
211
  };
168
212
  const handleSubmit = (params) => {
169
213
  dispatchEvent('submit', params, params.$event);
@@ -1,7 +1,7 @@
1
1
  import { createCommentVNode, defineComponent, h, inject, ref, reactive, provide } from 'vue';
2
2
  import { getIcon, getI18n, renderer } from '@vxe-ui/core';
3
3
  import { getSlotVNs } from '../../ui/src/vn';
4
- import VxeDrawerComponent from '../../drawer/src/drawer';
4
+ import VxeModalComponent from '../../modal/src/modal';
5
5
  import VxeTabsComponent from '../../tabs/src/tabs';
6
6
  import VxeTabPaneComponent from '../../tabs/src/tab-pane';
7
7
  import VxeFormViewComponent from './form-view';
@@ -156,13 +156,15 @@ export default defineComponent({
156
156
  };
157
157
  const renderVN = () => {
158
158
  const { showPc, showMobile } = formDesignProps;
159
- return h(VxeDrawerComponent, {
159
+ return h(VxeModalComponent, {
160
160
  modelValue: settingVisible.value,
161
161
  title: getI18n('vxe.formDesign.styleSetting.title'),
162
162
  height: '90vh',
163
+ width: '90vw',
164
+ escClosable: true,
163
165
  maskClosable: true,
164
166
  destroyOnClose: true,
165
- position: 'bottom',
167
+ showMaximize: true,
166
168
  'onUpdate:modelValue'(val) {
167
169
  settingVisible.value = val;
168
170
  }
@@ -0,0 +1,4 @@
1
+ export * from './widget-name';
2
+ export * from './widget-view';
3
+ export * from './widget-prop-data-source';
4
+ export * from './widget-prop-default-value';
@@ -0,0 +1,11 @@
1
+ import { computed } from 'vue';
2
+ import XEUtils from 'xe-utils';
3
+ export function useWidgetName(props) {
4
+ const computeKebabCaseName = computed(() => {
5
+ const { renderOpts } = props;
6
+ return renderOpts ? XEUtils.kebabCase(renderOpts.name) : '';
7
+ });
8
+ return {
9
+ computeKebabCaseName
10
+ };
11
+ }
@@ -1,10 +1,9 @@
1
- import { h, onMounted, computed, ref, watch } from 'vue';
1
+ import { h, onMounted, ref, watch } from 'vue';
2
2
  import { VxeUI, getIcon, getI18n } from '@vxe-ui/core';
3
- import VxeFormItemComponent from '../../form/src/form-item';
4
- import VxeButtonComponent from '../../button/src/button';
5
- import VxeTextareaComponent from '../../textarea/src/textarea';
6
- import VxeTipComponent from '../../tip/src/tip';
7
- import XEUtils from 'xe-utils';
3
+ import VxeFormItemComponent from '../../../form/src/form-item';
4
+ import VxeButtonComponent from '../../../button/src/button';
5
+ import VxeTextareaComponent from '../../../textarea/src/textarea';
6
+ import VxeTipComponent from '../../../tip/src/tip';
8
7
  export function useWidgetPropDataSource(props, isSubOption) {
9
8
  const optionsContent = ref('');
10
9
  const expandIndexList = ref([]);
@@ -42,6 +41,19 @@ export function useWidgetPropDataSource(props, isSubOption) {
42
41
  expandIndexList.value.push(gIndex);
43
42
  }
44
43
  };
44
+ const removeOptionEvent = (item, group) => {
45
+ const { renderParams } = props;
46
+ const { widget } = renderParams;
47
+ const { options } = widget;
48
+ if (group) {
49
+ if (group.options) {
50
+ group.options = group.options.filter(obj => obj !== item);
51
+ }
52
+ }
53
+ else {
54
+ options.options = options.options.filter(obj => obj !== item);
55
+ }
56
+ };
45
57
  const confirmBatchAddOptionEvent = () => {
46
58
  const { renderParams } = props;
47
59
  const { widget } = renderParams;
@@ -131,7 +143,8 @@ export function useWidgetPropDataSource(props, isSubOption) {
131
143
  }
132
144
  });
133
145
  };
134
- const renderOption = (item, hasFirstLevel, isExpand, gIndex, hasSub, isFirst, isLast) => {
146
+ const renderOption = (item, group, isExpand, gIndex, hasSub, isFirst, isLast) => {
147
+ const hasFirstLevel = !group;
135
148
  return h('div', {
136
149
  class: ['vxe-form-design--widget-form-item-data-source-option', {
137
150
  'is--first': isFirst,
@@ -160,7 +173,10 @@ export function useWidgetPropDataSource(props, isSubOption) {
160
173
  h(VxeButtonComponent, {
161
174
  status: 'danger',
162
175
  mode: 'text',
163
- icon: getIcon().FORM_DESIGN_WIDGET_DELETE
176
+ icon: getIcon().FORM_DESIGN_WIDGET_DELETE,
177
+ onClick() {
178
+ removeOptionEvent(item, group);
179
+ }
164
180
  })
165
181
  ]);
166
182
  };
@@ -175,15 +191,15 @@ export function useWidgetPropDataSource(props, isSubOption) {
175
191
  const { options } = group;
176
192
  const isExpand = expandIndexList.value.includes(gIndex);
177
193
  if (options && options.length) {
178
- optVNs.push(renderOption(group, true, isExpand, gIndex, true, gIndex === 0, gIndex === groups.length - 1));
194
+ optVNs.push(renderOption(group, null, isExpand, gIndex, true, gIndex === 0, gIndex === groups.length - 1));
179
195
  if (isExpand) {
180
196
  optVNs.push(h('div', {
181
197
  class: 'vxe-form-design--widget-form-item-data-source-sub-option'
182
- }, options.map(item => renderOption(item, false, isExpand, 0, false, false, false))));
198
+ }, options.map(item => renderOption(item, group, isExpand, 0, false, false, false))));
183
199
  }
184
200
  }
185
201
  else {
186
- optVNs.push(renderOption(group, true, isExpand, gIndex, false, gIndex === 0, gIndex === groups.length - 1));
202
+ optVNs.push(renderOption(group, null, isExpand, gIndex, false, gIndex === 0, gIndex === groups.length - 1));
187
203
  }
188
204
  });
189
205
  }
@@ -226,36 +242,3 @@ export function useWidgetPropDataSource(props, isSubOption) {
226
242
  }
227
243
  };
228
244
  }
229
- export function useWidgetName(props) {
230
- const computeKebabCaseName = computed(() => {
231
- const { renderOpts } = props;
232
- return renderOpts ? XEUtils.kebabCase(renderOpts.name) : '';
233
- });
234
- return {
235
- computeKebabCaseName
236
- };
237
- }
238
- export function useWidgetView(props) {
239
- const currWidget = computed(() => {
240
- const { renderParams } = props;
241
- return renderParams.widget;
242
- });
243
- const widgetModel = computed({
244
- get() {
245
- const { renderParams } = props;
246
- const { $formView, widget } = renderParams;
247
- return $formView ? $formView.getItemValue(widget) : null;
248
- },
249
- set(value) {
250
- const { renderParams } = props;
251
- const { $formView, widget } = renderParams;
252
- if ($formView) {
253
- $formView.setItemValue(widget, value);
254
- }
255
- }
256
- });
257
- return {
258
- currWidget,
259
- widgetModel
260
- };
261
- }
@@ -0,0 +1,38 @@
1
+ import { h, ref } from 'vue';
2
+ import VxeFormItemComponent from '../../../form/src/form-item';
3
+ import VxeSelectComponent from '../../../select/src/select';
4
+ import VxeInputComponent from '../../../input/src/input';
5
+ export function useWidgetPropDefaultValue(props) {
6
+ const defValOptions = ref([
7
+ { value: 'custom', label: '自定义' }
8
+ // { value: 'linkage', label: '数据联动' }
9
+ ]);
10
+ return {
11
+ renderDefaultValueFormItem() {
12
+ const { renderParams } = props;
13
+ const { widget } = renderParams;
14
+ const { defaultValue } = widget.options;
15
+ return h(VxeFormItemComponent, {
16
+ title: '默认值'
17
+ }, {
18
+ default() {
19
+ return [
20
+ h(VxeSelectComponent, {
21
+ modelValue: defaultValue.type,
22
+ options: defValOptions.value,
23
+ 'onUpdate:modelValue'(val) {
24
+ defaultValue.type = val;
25
+ }
26
+ }),
27
+ h(VxeInputComponent, {
28
+ modelValue: defaultValue.value,
29
+ 'onUpdate:modelValue'(val) {
30
+ defaultValue.value = val;
31
+ }
32
+ })
33
+ ];
34
+ }
35
+ });
36
+ }
37
+ };
38
+ }
@@ -0,0 +1,25 @@
1
+ import { computed } from 'vue';
2
+ export function useWidgetView(props) {
3
+ const currWidget = computed(() => {
4
+ const { renderParams } = props;
5
+ return renderParams.widget;
6
+ });
7
+ const widgetModel = computed({
8
+ get() {
9
+ const { renderParams } = props;
10
+ const { $formView, widget } = renderParams;
11
+ return $formView ? $formView.getItemValue(widget) : null;
12
+ },
13
+ set(value) {
14
+ const { renderParams } = props;
15
+ const { $formView, widget } = renderParams;
16
+ if ($formView) {
17
+ $formView.setItemValue(widget, value);
18
+ }
19
+ }
20
+ });
21
+ return {
22
+ currWidget,
23
+ widgetModel
24
+ };
25
+ }
@@ -22,7 +22,7 @@ export const WidgetInputViewComponent = defineComponent({
22
22
  const { widget } = renderParams;
23
23
  if ($xeFormView) {
24
24
  const itemValue = $xeFormView ? $xeFormView.getItemValue(widget) : null;
25
- $xeFormView.updateItemStatus(widget, itemValue);
25
+ $xeFormView.updateWidgetStatus(widget, itemValue);
26
26
  }
27
27
  };
28
28
  return () => {
@@ -21,7 +21,7 @@ export const WidgetSelectViewComponent = defineComponent({
21
21
  const { widget } = renderParams;
22
22
  if ($xeFormView) {
23
23
  const itemValue = $xeFormView ? $xeFormView.getItemValue(widget) : null;
24
- $xeFormView.updateItemStatus(widget, itemValue);
24
+ $xeFormView.updateWidgetStatus(widget, itemValue);
25
25
  }
26
26
  };
27
27
  const renderOptions = () => {
@@ -22,7 +22,7 @@ export const WidgetTextareaViewComponent = defineComponent({
22
22
  const { widget } = renderParams;
23
23
  if ($xeFormView) {
24
24
  const itemValue = $xeFormView ? $xeFormView.getItemValue(widget) : null;
25
- $xeFormView.updateItemStatus(widget, itemValue);
25
+ $xeFormView.updateWidgetStatus(widget, itemValue);
26
26
  }
27
27
  };
28
28
  return () => {
@@ -22,7 +22,7 @@ export const WidgetVxeCheckboxGroupViewComponent = defineComponent({
22
22
  const { widget } = renderParams;
23
23
  if ($xeFormView) {
24
24
  const itemValue = $xeFormView ? $xeFormView.getItemValue(widget) : null;
25
- $xeFormView.updateItemStatus(widget, itemValue);
25
+ $xeFormView.updateWidgetStatus(widget, itemValue);
26
26
  }
27
27
  };
28
28
  return () => {
@@ -4,7 +4,11 @@ export const getWidgetVxeDatePickerConfig = () => {
4
4
  title: handleGetFormDesignWidgetName,
5
5
  icon: 'vxe-icon-calendar',
6
6
  options: {
7
- placeholder: ''
7
+ placeholder: '',
8
+ defaultValue: {
9
+ type: '',
10
+ value: ''
11
+ }
8
12
  }
9
13
  };
10
14
  };
@@ -19,6 +19,7 @@ export const WidgetVxeDatePickerFormComponent = defineComponent({
19
19
  emits: [],
20
20
  setup(props) {
21
21
  const { computeKebabCaseName } = useWidgetName(props);
22
+ // const { renderDefaultValueFormItem } = useWidgetPropDefaultValue(props)
22
23
  return () => {
23
24
  const { renderParams } = props;
24
25
  const { widget } = renderParams;
@@ -49,6 +50,7 @@ export const WidgetVxeDatePickerFormComponent = defineComponent({
49
50
  field: 'placeholder',
50
51
  itemRender: { name: 'VxeInput' }
51
52
  }),
53
+ // renderDefaultValueFormItem(),
52
54
  h(VxeFormItemComponent, {
53
55
  title: getI18n('vxe.formDesign.widgetProp.required')
54
56
  }, {
@@ -22,7 +22,7 @@ export const WidgetVxeDatePickerViewComponent = defineComponent({
22
22
  const { widget } = renderParams;
23
23
  if ($xeFormView) {
24
24
  const itemValue = $xeFormView ? $xeFormView.getItemValue(widget) : null;
25
- $xeFormView.updateItemStatus(widget, itemValue);
25
+ $xeFormView.updateWidgetStatus(widget, itemValue);
26
26
  }
27
27
  };
28
28
  return () => {
@@ -22,7 +22,7 @@ export const WidgetVxeInputViewComponent = defineComponent({
22
22
  const { widget } = renderParams;
23
23
  if ($xeFormView) {
24
24
  const itemValue = $xeFormView ? $xeFormView.getItemValue(widget) : null;
25
- $xeFormView.updateItemStatus(widget, itemValue);
25
+ $xeFormView.updateWidgetStatus(widget, itemValue);
26
26
  }
27
27
  };
28
28
  return () => {
@@ -22,7 +22,7 @@ export const WidgetVxeNumberInputViewComponent = defineComponent({
22
22
  const { widget } = renderParams;
23
23
  if ($xeFormView) {
24
24
  const itemValue = $xeFormView ? $xeFormView.getItemValue(widget) : null;
25
- $xeFormView.updateItemStatus(widget, itemValue);
25
+ $xeFormView.updateWidgetStatus(widget, itemValue);
26
26
  }
27
27
  };
28
28
  return () => {
@@ -22,7 +22,7 @@ export const WidgetVxeRadioGroupViewComponent = defineComponent({
22
22
  const { widget } = renderParams;
23
23
  if ($xeFormView) {
24
24
  const itemValue = $xeFormView ? $xeFormView.getItemValue(widget) : null;
25
- $xeFormView.updateItemStatus(widget, itemValue);
25
+ $xeFormView.updateWidgetStatus(widget, itemValue);
26
26
  }
27
27
  };
28
28
  return () => {
@@ -23,7 +23,7 @@ export const WidgetVxeSelectViewComponent = defineComponent({
23
23
  const { widget } = renderParams;
24
24
  if ($xeFormView) {
25
25
  const itemValue = $xeFormView ? $xeFormView.getItemValue(widget) : null;
26
- $xeFormView.updateItemStatus(widget, itemValue);
26
+ $xeFormView.updateWidgetStatus(widget, itemValue);
27
27
  }
28
28
  };
29
29
  return () => {
@@ -22,7 +22,7 @@ export const WidgetVxeSwitchViewComponent = defineComponent({
22
22
  const { widget } = renderParams;
23
23
  if ($xeFormView) {
24
24
  const itemValue = $xeFormView ? $xeFormView.getItemValue(widget) : null;
25
- $xeFormView.updateItemStatus(widget, itemValue);
25
+ $xeFormView.updateWidgetStatus(widget, itemValue);
26
26
  }
27
27
  };
28
28
  return () => {
@@ -22,7 +22,7 @@ export const WidgetVxeTextareaViewComponent = defineComponent({
22
22
  const { widget } = renderParams;
23
23
  if ($xeFormView) {
24
24
  const itemValue = $xeFormView ? $xeFormView.getItemValue(widget) : null;
25
- $xeFormView.updateItemStatus(widget, itemValue);
25
+ $xeFormView.updateWidgetStatus(widget, itemValue);
26
26
  }
27
27
  };
28
28
  return () => {
@@ -23,7 +23,7 @@ export const WidgetVxeTreeSelectViewComponent = defineComponent({
23
23
  const { widget } = renderParams;
24
24
  if ($xeFormView) {
25
25
  const itemValue = $xeFormView ? $xeFormView.getItemValue(widget) : null;
26
- $xeFormView.updateItemStatus(widget, itemValue);
26
+ $xeFormView.updateWidgetStatus(widget, itemValue);
27
27
  }
28
28
  };
29
29
  return () => {
@@ -22,7 +22,7 @@ export const WidgetVxeUploadFileViewComponent = defineComponent({
22
22
  const { widget } = renderParams;
23
23
  if ($xeFormView) {
24
24
  const itemValue = $xeFormView ? $xeFormView.getItemValue(widget) : null;
25
- $xeFormView.updateItemStatus(widget, itemValue);
25
+ $xeFormView.updateWidgetStatus(widget, itemValue);
26
26
  }
27
27
  };
28
28
  return () => {
@@ -22,7 +22,7 @@ export const WidgetVxeUploadImageViewComponent = defineComponent({
22
22
  const { widget } = renderParams;
23
23
  if ($xeFormView) {
24
24
  const itemValue = $xeFormView ? $xeFormView.getItemValue(widget) : null;
25
- $xeFormView.updateItemStatus(widget, itemValue);
25
+ $xeFormView.updateWidgetStatus(widget, itemValue);
26
26
  }
27
27
  };
28
28
  return () => {