@ctzy-web-client/plugin-component-vue 1.0.23 → 1.0.25

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 (131) hide show
  1. package/es/advance-select/advance-operation.mjs +51 -37
  2. package/es/advance-select/advance-option.mjs +167 -97
  3. package/es/advance-select/advance-option.vue_vue_type_style_index_0_scoped_bc8f5626_lang.mjs +7 -0
  4. package/es/advance-select/advance-select.mjs +368 -310
  5. package/es/advance-select/index.mjs +5 -5
  6. package/es/application-slot/breadcrumb-item.mjs +20 -17
  7. package/es/application-slot/header-tools-item.mjs +20 -17
  8. package/es/breadcrumb-select/breadcrumb-select.mjs +134 -112
  9. package/es/contextmenu/contextmenu-item.mjs +19 -15
  10. package/es/contextmenu/contextmenu.mjs +72 -56
  11. package/es/data-form/data-form-item.mjs +48 -30
  12. package/es/data-form/data-form.mjs +213 -166
  13. package/es/data-form/form-components/bwa-date-picker.mjs +51 -39
  14. package/es/data-form/form-components/bwa-date-time-picker.mjs +56 -44
  15. package/es/data-form/form-components/bwa-input-float.mjs +48 -37
  16. package/es/data-form/form-components/bwa-input-integer.mjs +68 -50
  17. package/es/data-form/form-components/bwa-input.mjs +43 -32
  18. package/es/data-form/form-components/bwa-multi-select.mjs +40 -29
  19. package/es/data-form/form-components/bwa-rich-text-tinymce.mjs +554 -218
  20. package/es/data-form/form-components/bwa-rich-text.mjs +404 -316
  21. package/es/data-form/form-components/bwa-select.mjs +84 -70
  22. package/es/data-form/form-components/bwa-textarea.mjs +38 -27
  23. package/es/data-form/form-components/bwa-upload.mjs +172 -148
  24. package/es/data-form/form-components/bwa-user-multi-select.mjs +35 -24
  25. package/es/data-form/form-components/bwa-user-select.mjs +86 -61
  26. package/es/data-table/data-column-view.mjs +146 -115
  27. package/es/data-table/data-table-card.mjs +48 -40
  28. package/es/data-table/data-table-column.mjs +58 -45
  29. package/es/data-table/data-table.mjs +402 -316
  30. package/es/datatable-settings/datatable-settings.mjs +329 -254
  31. package/es/date-range/date-picker.mjs +130 -116
  32. package/es/date-range/date-range.mjs +215 -161
  33. package/es/drag-list/drag-item.mjs +56 -42
  34. package/es/drag-list/drag-list.mjs +60 -47
  35. package/es/dragable/dragable-item.mjs +23 -18
  36. package/es/dragable/dragable-operation.mjs +32 -24
  37. package/es/dragable/dragable.mjs +32 -23
  38. package/es/filter-panel/conditions/date-range-condition.mjs +50 -40
  39. package/es/filter-panel/conditions/department-condition/department-condition.mjs +99 -72
  40. package/es/filter-panel/conditions/department-condition/department-node.mjs +73 -59
  41. package/es/filter-panel/conditions/input-condition.mjs +90 -76
  42. package/es/filter-panel/conditions/multi-user-condition.mjs +67 -57
  43. package/es/filter-panel/conditions/multiple-menu-condition.mjs +54 -35
  44. package/es/filter-panel/conditions/single-menu-condition.mjs +65 -60
  45. package/es/filter-panel/conditions/single-user-condition.mjs +67 -57
  46. package/es/filter-panel/filter-panel-item.mjs +54 -39
  47. package/es/filter-panel/filter-panel.mjs +153 -135
  48. package/es/layout/layout.mjs +85 -78
  49. package/es/menu/menu-item.mjs +67 -52
  50. package/es/menu/menu.mjs +70 -53
  51. package/es/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.mjs +28 -0
  52. package/es/panel/panel.mjs +53 -40
  53. package/es/pct-filter-panel/pct-compents/pct-Input-condition.mjs +74 -63
  54. package/es/pct-filter-panel/pct-compents/pct-date-range-condition.mjs +76 -67
  55. package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition.mjs +406 -178
  56. package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.mjs +153 -138
  57. package/es/pct-filter-panel/pct-filter-panel-item.mjs +55 -40
  58. package/es/pct-filter-panel/pct-filter-panel.mjs +247 -227
  59. package/es/progress/progress-item.mjs +81 -61
  60. package/es/progress/progress.mjs +78 -64
  61. package/es/where-filter-panel/where-filter-panel.mjs +15 -12
  62. package/lib/advance-select/advance-operation.js +50 -36
  63. package/lib/advance-select/advance-option.js +166 -96
  64. package/lib/advance-select/advance-option.vue_vue_type_style_index_0_scoped_bc8f5626_lang.js +12 -0
  65. package/lib/advance-select/advance-select.js +366 -308
  66. package/lib/application-slot/breadcrumb-item.js +19 -16
  67. package/lib/application-slot/header-tools-item.js +19 -16
  68. package/lib/breadcrumb-select/breadcrumb-select.js +133 -111
  69. package/lib/contextmenu/contextmenu-item.js +18 -14
  70. package/lib/contextmenu/contextmenu.js +71 -55
  71. package/lib/data-form/data-form-item.js +47 -29
  72. package/lib/data-form/data-form.js +212 -165
  73. package/lib/data-form/form-components/bwa-date-picker.js +50 -38
  74. package/lib/data-form/form-components/bwa-date-time-picker.js +55 -43
  75. package/lib/data-form/form-components/bwa-input-float.js +47 -36
  76. package/lib/data-form/form-components/bwa-input-integer.js +67 -49
  77. package/lib/data-form/form-components/bwa-input.js +42 -31
  78. package/lib/data-form/form-components/bwa-multi-select.js +39 -28
  79. package/lib/data-form/form-components/bwa-rich-text-tinymce.js +553 -217
  80. package/lib/data-form/form-components/bwa-rich-text.js +403 -315
  81. package/lib/data-form/form-components/bwa-select.js +83 -69
  82. package/lib/data-form/form-components/bwa-textarea.js +37 -26
  83. package/lib/data-form/form-components/bwa-upload.js +171 -147
  84. package/lib/data-form/form-components/bwa-user-multi-select.js +34 -23
  85. package/lib/data-form/form-components/bwa-user-select.js +85 -60
  86. package/lib/data-table/data-column-view.js +146 -115
  87. package/lib/data-table/data-table-card.js +48 -40
  88. package/lib/data-table/data-table-column.js +57 -44
  89. package/lib/data-table/data-table.js +401 -315
  90. package/lib/datatable-settings/datatable-settings.js +328 -253
  91. package/lib/date-range/date-picker.js +129 -115
  92. package/lib/date-range/date-range.js +214 -160
  93. package/lib/drag-list/drag-item.js +55 -41
  94. package/lib/drag-list/drag-list.js +59 -46
  95. package/lib/dragable/dragable-item.js +22 -17
  96. package/lib/dragable/dragable-operation.js +31 -23
  97. package/lib/dragable/dragable.js +31 -22
  98. package/lib/filter-panel/conditions/date-range-condition.js +49 -39
  99. package/lib/filter-panel/conditions/department-condition/department-condition.js +98 -71
  100. package/lib/filter-panel/conditions/department-condition/department-node.js +72 -58
  101. package/lib/filter-panel/conditions/input-condition.js +89 -75
  102. package/lib/filter-panel/conditions/multi-user-condition.js +66 -56
  103. package/lib/filter-panel/conditions/multiple-menu-condition.js +53 -34
  104. package/lib/filter-panel/conditions/single-menu-condition.js +64 -59
  105. package/lib/filter-panel/conditions/single-user-condition.js +66 -56
  106. package/lib/filter-panel/filter-panel-item.js +53 -38
  107. package/lib/filter-panel/filter-panel.js +152 -134
  108. package/lib/layout/layout.js +84 -77
  109. package/lib/menu/menu-item.js +66 -51
  110. package/lib/menu/menu.js +69 -52
  111. package/lib/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js +32 -0
  112. package/lib/panel/panel.js +52 -39
  113. package/lib/pct-filter-panel/pct-compents/pct-Input-condition.js +73 -62
  114. package/lib/pct-filter-panel/pct-compents/pct-date-range-condition.js +75 -66
  115. package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition.js +405 -177
  116. package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.js +152 -137
  117. package/lib/pct-filter-panel/pct-filter-panel-item.js +54 -39
  118. package/lib/pct-filter-panel/pct-filter-panel.js +246 -226
  119. package/lib/progress/progress-item.js +80 -60
  120. package/lib/progress/progress.js +77 -63
  121. package/lib/where-filter-panel/where-filter-panel.js +14 -11
  122. package/package.json +2 -1
  123. package/src/advance-select/advance-option.vue +64 -13
  124. package/src/data-form/form-components/bwa-rich-text-tinymce.vue +1 -1
  125. package/src/datatable-settings/datatable-settings.vue +33 -3
  126. package/src/date-range/date-picker.vue +1 -1
  127. package/src/filter-panel/filter-panel.vue +2 -2
  128. package/src/pct-filter-panel/pct-compents/pct-Input-condition.vue +64 -64
  129. package/src/pct-filter-panel/pct-compents/pct-date-range-condition.vue +61 -61
  130. package/src/pct-filter-panel/pct-compents/pct-multiple-menu-condition.vue +302 -178
  131. package/src/pct-filter-panel/pct-filter-panel.vue +4 -4
@@ -1,32 +1,48 @@
1
- import { defineComponent, useAttrs, inject, computed, provide, reactive, unref, openBlock, createBlock, mergeProps, withCtx, renderSlot, createVNode, createCommentVNode } from 'vue';
1
+ import { useAttrs, inject, computed, provide, reactive, unref, openBlock, createBlock, mergeProps, withCtx, renderSlot, createVNode, createCommentVNode } from 'vue';
2
2
  import { formContextKey, ElFormItem } from 'element-plus';
3
3
  import { dataFormKey } from '@ctzy-web-client/web-base-client-vue';
4
4
  import DynamicComponent from './dynamic-component.mjs';
5
5
  import _export_sfc from '../_virtual/_plugin-vue_export-helper.mjs';
6
6
 
7
- const __default__ = defineComponent({ name: "BwaDataFormItem" });
8
- const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
9
- props: {
10
- name: { type: String },
11
- isShowLabelColon: { type: Boolean }
12
- },
7
+ const _sfc_main = {
8
+ __name: 'data-form-item',
9
+ props: {
10
+ name: { type: String },
11
+ isShowLabelColon: { type: Boolean }
12
+ },
13
13
  setup(__props) {
14
- const props = __props;
15
- const attrs = useAttrs();
16
- const dataForm = inject(dataFormKey);
17
- const formContext = inject(formContextKey, {});
18
- const formColumn = dataForm.getDisplayColumns().find((col) => col.fullAttrName == props.name);
19
- const label = computed(() => {
20
- return attrs.label || (formColumn ? formColumn.title + (props.isShowLabelColon ? " :" : "") : "");
21
- });
22
- const _formContext = {};
23
- _formContext.disabled = computed(
24
- () => formContext.disabled || (formColumn == null ? void 0 : formColumn.disabled)
25
- );
26
- Reflect.setPrototypeOf(_formContext, formContext);
27
- provide(formContextKey, reactive(_formContext));
28
- return (_ctx, _cache) => {
29
- return unref(formColumn) && unref(formColumn).visible ? (openBlock(), createBlock(unref(ElFormItem), mergeProps({ key: 0 }, unref(attrs), {
14
+
15
+ const props = __props;
16
+
17
+ defineOptions({ name: 'BwaDataFormItem' });
18
+
19
+
20
+
21
+ const attrs = useAttrs();
22
+
23
+ const dataForm = inject(dataFormKey);
24
+
25
+ const formContext = inject(formContextKey, {});
26
+
27
+ const formColumn = dataForm
28
+ .getDisplayColumns()
29
+ .find((col) => col.fullAttrName == props.name);
30
+
31
+ const label = computed(() => {
32
+ return attrs.label || (formColumn ? formColumn.title + (props.isShowLabelColon ? ' :' : '') : '');
33
+ });
34
+
35
+ const _formContext = {};
36
+ _formContext.disabled = computed(
37
+ () => formContext.disabled || formColumn?.disabled
38
+ );
39
+ Reflect.setPrototypeOf(_formContext, formContext);
40
+
41
+ provide(formContextKey, reactive(_formContext));
42
+
43
+ return (_ctx, _cache) => {
44
+ return (unref(formColumn) && unref(formColumn).visible)
45
+ ? (openBlock(), createBlock(unref(ElFormItem), mergeProps({ key: 0 }, unref(attrs), {
30
46
  label: unref(label),
31
47
  class: { custom: !_ctx.$slots.default },
32
48
  prop: unref(formColumn).fullAttrName
@@ -40,14 +56,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
40
56
  createVNode(unref(DynamicComponent), {
41
57
  column: unref(formColumn),
42
58
  record: unref(dataForm).data
43
- }, null, 8, ["column", "record"])
59
+ }, null, 8 /* PROPS */, ["column", "record"])
44
60
  ])
45
61
  ]),
46
- _: 3
47
- }, 16, ["label", "class", "prop"])) : createCommentVNode("v-if", true);
48
- };
49
- }
50
- });
51
- var DataFormItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "data-form-item.vue"]]);
62
+ _: 3 /* FORWARDED */
63
+ }, 16 /* FULL_PROPS */, ["label", "class", "prop"]))
64
+ : createCommentVNode("v-if", true)
65
+ }
66
+ }
67
+
68
+ };
69
+ var DataFormItem = /*#__PURE__*/_export_sfc(_sfc_main, [['__file',"data-form-item.vue"]]);
52
70
 
53
71
  export { DataFormItem as default };
@@ -1,175 +1,222 @@
1
- import { defineComponent, useAttrs, ref, computed, watch, provide, onMounted, unref, onBeforeUnmount, openBlock, createBlock, mergeProps, withCtx, renderSlot, createElementBlock, Fragment, renderList } from 'vue';
1
+ import { useAttrs, ref, computed, watch, provide, onMounted, unref, onBeforeUnmount, openBlock, createBlock, mergeProps, withCtx, renderSlot, createElementBlock, Fragment, renderList } from 'vue';
2
2
  import { ElMessage, ElForm } from 'element-plus';
3
3
  import { dataFormKey } from '@ctzy-web-client/web-base-client-vue';
4
4
  import { mergeWith, isArray } from 'lodash';
5
5
  import DataFormItem from './data-form-item.mjs';
6
6
  import _export_sfc from '../_virtual/_plugin-vue_export-helper.mjs';
7
7
 
8
- const __default__ = defineComponent({ name: "BwaDataForm" });
9
- const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
10
- props: {
11
- dataForm: {
12
- type: Object
13
- },
14
- autoLoad: {
15
- type: Boolean,
16
- default: true
17
- },
18
- record: {
19
- type: Object
20
- },
21
- recID: {
22
- type: String
23
- },
24
- labelPosition: {
25
- type: String
26
- },
27
- labelWidth: {
28
- type: String,
29
- default: ""
30
- },
31
- rules: {
32
- type: Object,
33
- default: () => ({})
34
- },
35
- validateOnRuleChange: {
36
- type: Boolean,
37
- default: false
38
- },
39
- isShowLabelColon: {
40
- type: Boolean,
41
- default: true
42
- }
43
- },
8
+ const _sfc_main = {
9
+ __name: 'data-form',
10
+ props: {
11
+ dataForm: {
12
+ type: Object,
13
+ },
14
+ autoLoad: {
15
+ type: Boolean,
16
+ default: true,
17
+ },
18
+ //注册id 和 记录数据
19
+ record: {
20
+ type: Object,
21
+ },
22
+ recID: {
23
+ type: String,
24
+ },
25
+ labelPosition: {
26
+ type: String,
27
+ },
28
+ labelWidth: {
29
+ type: String,
30
+ default: '',
31
+ },
32
+ rules: {
33
+ type: Object,
34
+ default: () => ({}),
35
+ },
36
+ validateOnRuleChange: {
37
+ type: Boolean,
38
+ default: false,
39
+ },
40
+ isShowLabelColon: {
41
+ type: Boolean,
42
+ default: true,
43
+ },
44
+ },
44
45
  setup(__props, { expose }) {
45
- const props = __props;
46
- const attrs = useAttrs();
47
- const dataForm = props.dataForm;
48
- const dataFormElRef = ref();
49
- const rules = computed(() => {
50
- let data = {};
51
- dataForm.getDisplayColumns().forEach((item) => {
52
- data[item.fullAttrName] = (item.required ? [{ required: true, message: item.title + "\u5FC5\u586B!" }] : []).concat(item.rules);
53
- });
54
- return mergeWith(
55
- {},
56
- data,
57
- props.rules,
58
- function customizer(objValue, srcValue) {
59
- if (isArray(objValue)) {
60
- return objValue.concat(srcValue);
61
- }
62
- }
63
- );
64
- });
65
- const computedLabelWidth = computed(() => {
66
- if (props.labelWidth) {
67
- return props.labelWidth;
68
- }
69
- let labelWidth = 0;
70
- if (props.labelPosition != "top") {
71
- let maxLabelCharCount = 0;
72
- dataForm.getDisplayColumns().forEach((item) => {
73
- maxLabelCharCount = Math.max(
74
- maxLabelCharCount,
75
- item.title.length + (item.required ? 1 : 0)
76
- );
77
- });
78
- labelWidth = (maxLabelCharCount + 1) * 18;
79
- }
80
- return labelWidth + "px";
81
- });
82
- if (props.autoLoad) {
83
- watch(
84
- computed(() => props.record),
85
- async () => {
86
- if (props.recID) {
87
- try {
88
- await dataForm.loadDataByRecId(props.recID);
89
- } catch (e) {
90
- console.error(e);
91
- ElMessage.error("\u83B7\u53D6\u8BB0\u5F55\u5931\u8D25\u3002");
92
- }
93
- return;
94
- }
95
- if (props.record) {
96
- dataForm.setData(props.record);
97
- return;
98
- }
99
- dataForm.setData();
100
- },
101
- { immediate: true }
102
- );
103
- }
104
- provide(dataFormKey, dataForm);
105
- const validate = (callback) => {
106
- return dataFormElRef.value.validate(callback);
107
- };
108
- window.dataFormElRef = dataFormElRef;
109
- window.aaavvv = validate;
110
- const submit = (data) => {
111
- return validate().then(() => {
112
- dataForm.submit(data).then(() => {
113
- ElMessage.info("\u4FDD\u5B58\u6210\u529F!");
114
- }).catch((e) => ElMessage.error(e.message));
115
- }).catch((result) => {
116
- console.log(result);
117
- });
118
- };
119
- onMounted(() => {
120
- unref(dataForm).formValivators.push(unref(dataFormElRef));
121
- });
122
- onBeforeUnmount(() => {
123
- const _dataFormEl = unref(dataFormElRef);
124
- unref(dataForm).formValivators = unref(dataForm).formValivators.filter(
125
- (validate2) => validate2 !== _dataFormEl
126
- );
127
- });
128
- expose({
129
- dataForm,
130
- dataFormElRef,
131
- validate,
132
- submit,
133
- rules,
134
- computedLabelWidth
135
- });
136
- return (_ctx, _cache) => {
137
- return openBlock(), createBlock(unref(ElForm), mergeProps({
138
- ref_key: "dataFormElRef",
139
- ref: dataFormElRef
140
- }, unref(attrs), {
141
- model: unref(dataForm).data,
142
- "label-position": __props.labelPosition,
143
- "label-width": unref(computedLabelWidth),
144
- rules: unref(rules),
145
- "validate-on-rule-change": __props.validateOnRuleChange,
146
- disabled: unref(dataForm).disabled
147
- }), {
148
- default: withCtx(() => [
149
- renderSlot(_ctx.$slots, "default", { dataForm: unref(dataForm) }, () => [
150
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(dataForm).getDisplayColumns(), (column) => {
151
- return openBlock(), createBlock(DataFormItem, {
152
- key: column.fullAttrName,
153
- name: column.fullAttrName,
154
- isShowLabelColon: __props.isShowLabelColon
155
- }, {
156
- default: withCtx(() => [
157
- renderSlot(_ctx.$slots, "form-item-" + column.fullAttrName, {
158
- column,
159
- record: unref(dataForm).data,
160
- dataForm: unref(dataForm)
161
- })
162
- ]),
163
- _: 2
164
- }, 1032, ["name", "isShowLabelColon"]);
165
- }), 128))
166
- ])
167
- ]),
168
- _: 3
169
- }, 16, ["model", "label-position", "label-width", "rules", "validate-on-rule-change", "disabled"]);
170
- };
171
- }
172
- });
173
- var DataForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "data-form.vue"]]);
46
+
47
+ const props = __props;
48
+
49
+ defineOptions({ name: 'BwaDataForm' });
50
+
51
+
52
+
53
+ const attrs = useAttrs();
54
+
55
+ const dataForm = props.dataForm;
56
+
57
+ //表单对象的引用
58
+ const dataFormElRef = ref();
59
+
60
+ //验证规则
61
+ const rules = computed(() => {
62
+ let data = {};
63
+
64
+ dataForm.getDisplayColumns().forEach((item) => {
65
+ data[item.fullAttrName] = (
66
+ item.required ? [{ required: true, message: item.title + '必填!' }] : []
67
+ ).concat(item.rules);
68
+ });
69
+
70
+ return mergeWith(
71
+ {},
72
+ data,
73
+ props.rules,
74
+ function customizer(objValue, srcValue) {
75
+ if (isArray(objValue)) {
76
+ return objValue.concat(srcValue);
77
+ }
78
+ }
79
+ );
80
+ });
81
+
82
+ //计算后的描述宽度
83
+ const computedLabelWidth = computed(() => {
84
+ if (props.labelWidth) {
85
+ return props.labelWidth;
86
+ }
87
+
88
+ let labelWidth = 0;
89
+
90
+ if (props.labelPosition != 'top') {
91
+ let maxLabelCharCount = 0;
92
+ dataForm.getDisplayColumns().forEach((item) => {
93
+ maxLabelCharCount = Math.max(
94
+ maxLabelCharCount,
95
+ item.title.length + (item.required ? 1 : 0)
96
+ );
97
+ });
98
+ labelWidth = (maxLabelCharCount + 1) * 18;
99
+ }
100
+ return labelWidth + 'px';
101
+ });
102
+
103
+ if (props.autoLoad) {
104
+ //监听recid的变化 是否自动加载数据
105
+ watch(
106
+ computed(() => props.record),
107
+ async () => {
108
+ if (props.recID) {
109
+ try {
110
+ await dataForm.loadDataByRecId(props.recID);
111
+ } catch (e) {
112
+ console.error(e);
113
+ ElMessage.error('获取记录失败。');
114
+ }
115
+ return;
116
+ }
117
+
118
+ if (props.record) {
119
+ dataForm.setData(props.record);
120
+ return;
121
+ }
122
+
123
+ dataForm.setData();
124
+ },
125
+ { immediate: true }
126
+ );
127
+ }
128
+
129
+ //当前data table 上下文对象
130
+ provide(dataFormKey, dataForm);
131
+
132
+ /**
133
+ * 表单验证
134
+ * @param {*} data
135
+ */
136
+ const validate = (callback) => {
137
+ return dataFormElRef.value.validate(callback);
138
+ };
139
+
140
+ window.dataFormElRef = dataFormElRef;
141
+ window.aaavvv = validate;
142
+
143
+ /**
144
+ * 提交表单
145
+ * @param {Object} 额外附加的提交数据
146
+ */
147
+ const submit = (data) => {
148
+ return validate()
149
+ .then(() => {
150
+ dataForm
151
+ .submit(data)
152
+ .then(() => {
153
+ ElMessage.info('保存成功!');
154
+ })
155
+ .catch((e) => ElMessage.error(e.message));
156
+ })
157
+ .catch((result) => {
158
+ console.log(result);
159
+ });
160
+ };
161
+
162
+ onMounted(() => {
163
+ unref(dataForm).formValivators.push(unref(dataFormElRef));
164
+ });
165
+
166
+ onBeforeUnmount(() => {
167
+ const _dataFormEl = unref(dataFormElRef);
168
+ unref(dataForm).formValivators = unref(dataForm).formValivators.filter(
169
+ (validate) => validate !== _dataFormEl
170
+ );
171
+ });
172
+
173
+ expose({
174
+ dataForm,
175
+ dataFormElRef,
176
+ validate,
177
+ submit,
178
+ rules,
179
+ computedLabelWidth,
180
+ });
181
+
182
+ return (_ctx, _cache) => {
183
+ return (openBlock(), createBlock(unref(ElForm), mergeProps({
184
+ ref_key: "dataFormElRef",
185
+ ref: dataFormElRef
186
+ }, unref(attrs), {
187
+ model: unref(dataForm).data,
188
+ "label-position": __props.labelPosition,
189
+ "label-width": unref(computedLabelWidth),
190
+ rules: unref(rules),
191
+ "validate-on-rule-change": __props.validateOnRuleChange,
192
+ disabled: unref(dataForm).disabled
193
+ }), {
194
+ default: withCtx(() => [
195
+ renderSlot(_ctx.$slots, "default", { dataForm: unref(dataForm) }, () => [
196
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(dataForm).getDisplayColumns(), (column) => {
197
+ return (openBlock(), createBlock(DataFormItem, {
198
+ key: column.fullAttrName,
199
+ name: column.fullAttrName,
200
+ isShowLabelColon: __props.isShowLabelColon
201
+ }, {
202
+ default: withCtx(() => [
203
+ renderSlot(_ctx.$slots, 'form-item-' + column.fullAttrName, {
204
+ column: column,
205
+ record: unref(dataForm).data,
206
+ dataForm: unref(dataForm)
207
+ })
208
+ ]),
209
+ _: 2 /* DYNAMIC */
210
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["name", "isShowLabelColon"]))
211
+ }), 128 /* KEYED_FRAGMENT */))
212
+ ])
213
+ ]),
214
+ _: 3 /* FORWARDED */
215
+ }, 16 /* FULL_PROPS */, ["model", "label-position", "label-width", "rules", "validate-on-rule-change", "disabled"]))
216
+ }
217
+ }
218
+
219
+ };
220
+ var DataForm = /*#__PURE__*/_export_sfc(_sfc_main, [['__file',"data-form.vue"]]);
174
221
 
175
222
  export { DataForm as default };
@@ -1,45 +1,57 @@
1
- import { defineComponent, useAttrs, computed, openBlock, createBlock, unref, mergeProps, isRef } from 'vue';
1
+ import { useAttrs, computed, openBlock, createBlock, unref, mergeProps, isRef } from 'vue';
2
2
  import { dayjs, ElDatePicker } from 'element-plus';
3
3
  import _export_sfc from '../../_virtual/_plugin-vue_export-helper.mjs';
4
4
 
5
- const __default__ = defineComponent({
6
- name: "BwaDatePicker"
7
- });
8
- const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
9
- props: {
10
- modelValue: {
11
- type: [String, Date],
12
- default: null
13
- },
14
- placeholder: {
15
- type: String,
16
- default: "\u8BF7\u9009\u62E9"
17
- }
18
- },
19
- emits: ["update:model-value"],
5
+ const _sfc_main = {
6
+ __name: 'bwa-date-picker',
7
+ props: {
8
+ modelValue: {
9
+ type: [String, Date],
10
+ default: null,
11
+ },
12
+ placeholder: {
13
+ type: String,
14
+ default: '请选择',
15
+ },
16
+ },
17
+ emits: ['update:model-value'],
20
18
  setup(__props, { emit }) {
21
- const props = __props;
22
- const attrs = useAttrs();
23
- const modelValue = computed({
24
- get: () => props.modelValue,
25
- set: (v) => emit(
26
- "update:model-value",
27
- v ? dayjs(new Date(v.getTime())).format("YYYY-MM-DD") : ""
28
- )
29
- });
30
- return (_ctx, _cache) => {
31
- return openBlock(), createBlock(unref(ElDatePicker), mergeProps({
32
- modelValue: unref(modelValue),
33
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
34
- type: "date",
35
- placeholder: __props.placeholder
36
- }, unref(attrs), {
37
- teleported: false,
38
- style: { "width": "100%" }
39
- }), null, 16, ["modelValue", "placeholder"]);
40
- };
41
- }
42
- });
43
- var DatePicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "bwa-date-picker.vue"]]);
19
+
20
+ const props = __props;
21
+
22
+ defineOptions({
23
+ name: 'BwaDatePicker',
24
+ });
25
+
26
+
27
+
28
+ const attrs = useAttrs();
29
+
30
+
31
+
32
+ const modelValue = computed({
33
+ get: () => props.modelValue,
34
+ set: (v) =>
35
+ emit(
36
+ 'update:model-value',
37
+ v ? dayjs(new Date(v.getTime())).format('YYYY-MM-DD') : ''
38
+ ),
39
+ });
40
+
41
+ return (_ctx, _cache) => {
42
+ return (openBlock(), createBlock(unref(ElDatePicker), mergeProps({
43
+ modelValue: unref(modelValue),
44
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (isRef(modelValue) ? (modelValue).value = $event : null)),
45
+ type: "date",
46
+ placeholder: __props.placeholder
47
+ }, unref(attrs), {
48
+ teleported: false,
49
+ style: {"width":"100%"}
50
+ }), null, 16 /* FULL_PROPS */, ["modelValue", "placeholder"]))
51
+ }
52
+ }
53
+
54
+ };
55
+ var DatePicker = /*#__PURE__*/_export_sfc(_sfc_main, [['__file',"bwa-date-picker.vue"]]);
44
56
 
45
57
  export { DatePicker as default };