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

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
@@ -9,171 +9,218 @@ var lodash = require('lodash');
9
9
  var dataFormItem = require('./data-form-item.js');
10
10
  var _pluginVue_exportHelper = require('../_virtual/_plugin-vue_export-helper.js');
11
11
 
12
- const __default__ = vue.defineComponent({ name: "BwaDataForm" });
13
- const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
14
- props: {
15
- dataForm: {
16
- type: Object
17
- },
18
- autoLoad: {
19
- type: Boolean,
20
- default: true
21
- },
22
- record: {
23
- type: Object
24
- },
25
- recID: {
26
- type: String
27
- },
28
- labelPosition: {
29
- type: String
30
- },
31
- labelWidth: {
32
- type: String,
33
- default: ""
34
- },
35
- rules: {
36
- type: Object,
37
- default: () => ({})
38
- },
39
- validateOnRuleChange: {
40
- type: Boolean,
41
- default: false
42
- },
43
- isShowLabelColon: {
44
- type: Boolean,
45
- default: true
46
- }
47
- },
12
+ const _sfc_main = {
13
+ __name: 'data-form',
14
+ props: {
15
+ dataForm: {
16
+ type: Object,
17
+ },
18
+ autoLoad: {
19
+ type: Boolean,
20
+ default: true,
21
+ },
22
+ //注册id 和 记录数据
23
+ record: {
24
+ type: Object,
25
+ },
26
+ recID: {
27
+ type: String,
28
+ },
29
+ labelPosition: {
30
+ type: String,
31
+ },
32
+ labelWidth: {
33
+ type: String,
34
+ default: '',
35
+ },
36
+ rules: {
37
+ type: Object,
38
+ default: () => ({}),
39
+ },
40
+ validateOnRuleChange: {
41
+ type: Boolean,
42
+ default: false,
43
+ },
44
+ isShowLabelColon: {
45
+ type: Boolean,
46
+ default: true,
47
+ },
48
+ },
48
49
  setup(__props, { expose }) {
49
- const props = __props;
50
- const attrs = vue.useAttrs();
51
- const dataForm = props.dataForm;
52
- const dataFormElRef = vue.ref();
53
- const rules = vue.computed(() => {
54
- let data = {};
55
- dataForm.getDisplayColumns().forEach((item) => {
56
- data[item.fullAttrName] = (item.required ? [{ required: true, message: item.title + "\u5FC5\u586B!" }] : []).concat(item.rules);
57
- });
58
- return lodash.mergeWith(
59
- {},
60
- data,
61
- props.rules,
62
- function customizer(objValue, srcValue) {
63
- if (lodash.isArray(objValue)) {
64
- return objValue.concat(srcValue);
65
- }
66
- }
67
- );
68
- });
69
- const computedLabelWidth = vue.computed(() => {
70
- if (props.labelWidth) {
71
- return props.labelWidth;
72
- }
73
- let labelWidth = 0;
74
- if (props.labelPosition != "top") {
75
- let maxLabelCharCount = 0;
76
- dataForm.getDisplayColumns().forEach((item) => {
77
- maxLabelCharCount = Math.max(
78
- maxLabelCharCount,
79
- item.title.length + (item.required ? 1 : 0)
80
- );
81
- });
82
- labelWidth = (maxLabelCharCount + 1) * 18;
83
- }
84
- return labelWidth + "px";
85
- });
86
- if (props.autoLoad) {
87
- vue.watch(
88
- vue.computed(() => props.record),
89
- async () => {
90
- if (props.recID) {
91
- try {
92
- await dataForm.loadDataByRecId(props.recID);
93
- } catch (e) {
94
- console.error(e);
95
- ElementPlus.ElMessage.error("\u83B7\u53D6\u8BB0\u5F55\u5931\u8D25\u3002");
96
- }
97
- return;
98
- }
99
- if (props.record) {
100
- dataForm.setData(props.record);
101
- return;
102
- }
103
- dataForm.setData();
104
- },
105
- { immediate: true }
106
- );
107
- }
108
- vue.provide(webBaseClientVue.dataFormKey, dataForm);
109
- const validate = (callback) => {
110
- return dataFormElRef.value.validate(callback);
111
- };
112
- window.dataFormElRef = dataFormElRef;
113
- window.aaavvv = validate;
114
- const submit = (data) => {
115
- return validate().then(() => {
116
- dataForm.submit(data).then(() => {
117
- ElementPlus.ElMessage.info("\u4FDD\u5B58\u6210\u529F!");
118
- }).catch((e) => ElementPlus.ElMessage.error(e.message));
119
- }).catch((result) => {
120
- console.log(result);
121
- });
122
- };
123
- vue.onMounted(() => {
124
- vue.unref(dataForm).formValivators.push(vue.unref(dataFormElRef));
125
- });
126
- vue.onBeforeUnmount(() => {
127
- const _dataFormEl = vue.unref(dataFormElRef);
128
- vue.unref(dataForm).formValivators = vue.unref(dataForm).formValivators.filter(
129
- (validate2) => validate2 !== _dataFormEl
130
- );
131
- });
132
- expose({
133
- dataForm,
134
- dataFormElRef,
135
- validate,
136
- submit,
137
- rules,
138
- computedLabelWidth
139
- });
140
- return (_ctx, _cache) => {
141
- return vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElForm), vue.mergeProps({
142
- ref_key: "dataFormElRef",
143
- ref: dataFormElRef
144
- }, vue.unref(attrs), {
145
- model: vue.unref(dataForm).data,
146
- "label-position": __props.labelPosition,
147
- "label-width": vue.unref(computedLabelWidth),
148
- rules: vue.unref(rules),
149
- "validate-on-rule-change": __props.validateOnRuleChange,
150
- disabled: vue.unref(dataForm).disabled
151
- }), {
152
- default: vue.withCtx(() => [
153
- vue.renderSlot(_ctx.$slots, "default", { dataForm: vue.unref(dataForm) }, () => [
154
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(dataForm).getDisplayColumns(), (column) => {
155
- return vue.openBlock(), vue.createBlock(dataFormItem["default"], {
156
- key: column.fullAttrName,
157
- name: column.fullAttrName,
158
- isShowLabelColon: __props.isShowLabelColon
159
- }, {
160
- default: vue.withCtx(() => [
161
- vue.renderSlot(_ctx.$slots, "form-item-" + column.fullAttrName, {
162
- column,
163
- record: vue.unref(dataForm).data,
164
- dataForm: vue.unref(dataForm)
165
- })
166
- ]),
167
- _: 2
168
- }, 1032, ["name", "isShowLabelColon"]);
169
- }), 128))
170
- ])
171
- ]),
172
- _: 3
173
- }, 16, ["model", "label-position", "label-width", "rules", "validate-on-rule-change", "disabled"]);
174
- };
175
- }
176
- });
177
- var DataForm = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["__file", "data-form.vue"]]);
50
+
51
+ const props = __props;
52
+
53
+ defineOptions({ name: 'BwaDataForm' });
54
+
55
+
56
+
57
+ const attrs = vue.useAttrs();
58
+
59
+ const dataForm = props.dataForm;
60
+
61
+ //表单对象的引用
62
+ const dataFormElRef = vue.ref();
63
+
64
+ //验证规则
65
+ const rules = vue.computed(() => {
66
+ let data = {};
67
+
68
+ dataForm.getDisplayColumns().forEach((item) => {
69
+ data[item.fullAttrName] = (
70
+ item.required ? [{ required: true, message: item.title + '必填!' }] : []
71
+ ).concat(item.rules);
72
+ });
73
+
74
+ return lodash.mergeWith(
75
+ {},
76
+ data,
77
+ props.rules,
78
+ function customizer(objValue, srcValue) {
79
+ if (lodash.isArray(objValue)) {
80
+ return objValue.concat(srcValue);
81
+ }
82
+ }
83
+ );
84
+ });
85
+
86
+ //计算后的描述宽度
87
+ const computedLabelWidth = vue.computed(() => {
88
+ if (props.labelWidth) {
89
+ return props.labelWidth;
90
+ }
91
+
92
+ let labelWidth = 0;
93
+
94
+ if (props.labelPosition != 'top') {
95
+ let maxLabelCharCount = 0;
96
+ dataForm.getDisplayColumns().forEach((item) => {
97
+ maxLabelCharCount = Math.max(
98
+ maxLabelCharCount,
99
+ item.title.length + (item.required ? 1 : 0)
100
+ );
101
+ });
102
+ labelWidth = (maxLabelCharCount + 1) * 18;
103
+ }
104
+ return labelWidth + 'px';
105
+ });
106
+
107
+ if (props.autoLoad) {
108
+ //监听recid的变化 是否自动加载数据
109
+ vue.watch(
110
+ vue.computed(() => props.record),
111
+ async () => {
112
+ if (props.recID) {
113
+ try {
114
+ await dataForm.loadDataByRecId(props.recID);
115
+ } catch (e) {
116
+ console.error(e);
117
+ ElementPlus.ElMessage.error('获取记录失败。');
118
+ }
119
+ return;
120
+ }
121
+
122
+ if (props.record) {
123
+ dataForm.setData(props.record);
124
+ return;
125
+ }
126
+
127
+ dataForm.setData();
128
+ },
129
+ { immediate: true }
130
+ );
131
+ }
132
+
133
+ //当前data table 上下文对象
134
+ vue.provide(webBaseClientVue.dataFormKey, dataForm);
135
+
136
+ /**
137
+ * 表单验证
138
+ * @param {*} data
139
+ */
140
+ const validate = (callback) => {
141
+ return dataFormElRef.value.validate(callback);
142
+ };
143
+
144
+ window.dataFormElRef = dataFormElRef;
145
+ window.aaavvv = validate;
146
+
147
+ /**
148
+ * 提交表单
149
+ * @param {Object} 额外附加的提交数据
150
+ */
151
+ const submit = (data) => {
152
+ return validate()
153
+ .then(() => {
154
+ dataForm
155
+ .submit(data)
156
+ .then(() => {
157
+ ElementPlus.ElMessage.info('保存成功!');
158
+ })
159
+ .catch((e) => ElementPlus.ElMessage.error(e.message));
160
+ })
161
+ .catch((result) => {
162
+ console.log(result);
163
+ });
164
+ };
165
+
166
+ vue.onMounted(() => {
167
+ vue.unref(dataForm).formValivators.push(vue.unref(dataFormElRef));
168
+ });
169
+
170
+ vue.onBeforeUnmount(() => {
171
+ const _dataFormEl = vue.unref(dataFormElRef);
172
+ vue.unref(dataForm).formValivators = vue.unref(dataForm).formValivators.filter(
173
+ (validate) => validate !== _dataFormEl
174
+ );
175
+ });
176
+
177
+ expose({
178
+ dataForm,
179
+ dataFormElRef,
180
+ validate,
181
+ submit,
182
+ rules,
183
+ computedLabelWidth,
184
+ });
185
+
186
+ return (_ctx, _cache) => {
187
+ return (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElForm), vue.mergeProps({
188
+ ref_key: "dataFormElRef",
189
+ ref: dataFormElRef
190
+ }, vue.unref(attrs), {
191
+ model: vue.unref(dataForm).data,
192
+ "label-position": __props.labelPosition,
193
+ "label-width": vue.unref(computedLabelWidth),
194
+ rules: vue.unref(rules),
195
+ "validate-on-rule-change": __props.validateOnRuleChange,
196
+ disabled: vue.unref(dataForm).disabled
197
+ }), {
198
+ default: vue.withCtx(() => [
199
+ vue.renderSlot(_ctx.$slots, "default", { dataForm: vue.unref(dataForm) }, () => [
200
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(dataForm).getDisplayColumns(), (column) => {
201
+ return (vue.openBlock(), vue.createBlock(dataFormItem["default"], {
202
+ key: column.fullAttrName,
203
+ name: column.fullAttrName,
204
+ isShowLabelColon: __props.isShowLabelColon
205
+ }, {
206
+ default: vue.withCtx(() => [
207
+ vue.renderSlot(_ctx.$slots, 'form-item-' + column.fullAttrName, {
208
+ column: column,
209
+ record: vue.unref(dataForm).data,
210
+ dataForm: vue.unref(dataForm)
211
+ })
212
+ ]),
213
+ _: 2 /* DYNAMIC */
214
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["name", "isShowLabelColon"]))
215
+ }), 128 /* KEYED_FRAGMENT */))
216
+ ])
217
+ ]),
218
+ _: 3 /* FORWARDED */
219
+ }, 16 /* FULL_PROPS */, ["model", "label-position", "label-width", "rules", "validate-on-rule-change", "disabled"]))
220
+ }
221
+ }
222
+
223
+ };
224
+ var DataForm = /*#__PURE__*/_pluginVue_exportHelper["default"](_sfc_main, [['__file',"data-form.vue"]]);
178
225
 
179
226
  exports["default"] = DataForm;
@@ -6,44 +6,56 @@ var vue = require('vue');
6
6
  var ElementPlus = require('element-plus');
7
7
  var _pluginVue_exportHelper = require('../../_virtual/_plugin-vue_export-helper.js');
8
8
 
9
- const __default__ = vue.defineComponent({
10
- name: "BwaDatePicker"
11
- });
12
- const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
13
- props: {
14
- modelValue: {
15
- type: [String, Date],
16
- default: null
17
- },
18
- placeholder: {
19
- type: String,
20
- default: "\u8BF7\u9009\u62E9"
21
- }
22
- },
23
- emits: ["update:model-value"],
9
+ const _sfc_main = {
10
+ __name: 'bwa-date-picker',
11
+ props: {
12
+ modelValue: {
13
+ type: [String, Date],
14
+ default: null,
15
+ },
16
+ placeholder: {
17
+ type: String,
18
+ default: '请选择',
19
+ },
20
+ },
21
+ emits: ['update:model-value'],
24
22
  setup(__props, { emit }) {
25
- const props = __props;
26
- const attrs = vue.useAttrs();
27
- const modelValue = vue.computed({
28
- get: () => props.modelValue,
29
- set: (v) => emit(
30
- "update:model-value",
31
- v ? ElementPlus.dayjs(new Date(v.getTime())).format("YYYY-MM-DD") : ""
32
- )
33
- });
34
- return (_ctx, _cache) => {
35
- return vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElDatePicker), vue.mergeProps({
36
- modelValue: vue.unref(modelValue),
37
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(modelValue) ? modelValue.value = $event : null),
38
- type: "date",
39
- placeholder: __props.placeholder
40
- }, vue.unref(attrs), {
41
- teleported: false,
42
- style: { "width": "100%" }
43
- }), null, 16, ["modelValue", "placeholder"]);
44
- };
45
- }
46
- });
47
- var DatePicker = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["__file", "bwa-date-picker.vue"]]);
23
+
24
+ const props = __props;
25
+
26
+ defineOptions({
27
+ name: 'BwaDatePicker',
28
+ });
29
+
30
+
31
+
32
+ const attrs = vue.useAttrs();
33
+
34
+
35
+
36
+ const modelValue = vue.computed({
37
+ get: () => props.modelValue,
38
+ set: (v) =>
39
+ emit(
40
+ 'update:model-value',
41
+ v ? ElementPlus.dayjs(new Date(v.getTime())).format('YYYY-MM-DD') : ''
42
+ ),
43
+ });
44
+
45
+ return (_ctx, _cache) => {
46
+ return (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElDatePicker), vue.mergeProps({
47
+ modelValue: vue.unref(modelValue),
48
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (vue.isRef(modelValue) ? (modelValue).value = $event : null)),
49
+ type: "date",
50
+ placeholder: __props.placeholder
51
+ }, vue.unref(attrs), {
52
+ teleported: false,
53
+ style: {"width":"100%"}
54
+ }), null, 16 /* FULL_PROPS */, ["modelValue", "placeholder"]))
55
+ }
56
+ }
57
+
58
+ };
59
+ var DatePicker = /*#__PURE__*/_pluginVue_exportHelper["default"](_sfc_main, [['__file',"bwa-date-picker.vue"]]);
48
60
 
49
61
  exports["default"] = DatePicker;
@@ -6,49 +6,61 @@ var vue = require('vue');
6
6
  var ElementPlus = require('element-plus');
7
7
  var _pluginVue_exportHelper = require('../../_virtual/_plugin-vue_export-helper.js');
8
8
 
9
- const __default__ = vue.defineComponent({
10
- name: "BwaDateTimePicker"
11
- });
12
- const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
13
- props: {
14
- modelValue: {
15
- type: [String, Date],
16
- default: null
17
- },
18
- placeholder: {
19
- type: String,
20
- default: "\u8BF7\u9009\u62E9"
21
- }
22
- },
23
- emits: ["update:model-value"],
9
+ const _sfc_main = {
10
+ __name: 'bwa-date-time-picker',
11
+ props: {
12
+ modelValue: {
13
+ type: [String, Date],
14
+ default: null,
15
+ },
16
+ placeholder: {
17
+ type: String,
18
+ default: '请选择',
19
+ },
20
+ },
21
+ emits: ['update:model-value'],
24
22
  setup(__props, { emit }) {
25
- const props = __props;
26
- const attrs = vue.useAttrs();
27
- const modelValue = vue.computed({
28
- get: () => props.modelValue,
29
- set: (v) => {
30
- if (!v) {
31
- emit("update:model-value", "");
32
- return;
33
- }
34
- emit(
35
- "update:model-value",
36
- ElementPlus.dayjs(new Date(v.getTime())).format("YYYY-MM-DD HH:mm:ss")
37
- );
38
- }
39
- });
40
- return (_ctx, _cache) => {
41
- return vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElDatePicker), vue.mergeProps(vue.unref(attrs), {
42
- modelValue: vue.unref(modelValue),
43
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(modelValue) ? modelValue.value = $event : null),
44
- type: "datetime",
45
- placeholder: __props.placeholder,
46
- teleported: false,
47
- style: { "width": "100%" }
48
- }), null, 16, ["modelValue", "placeholder"]);
49
- };
50
- }
51
- });
52
- var DateTimePicker = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["__file", "bwa-date-time-picker.vue"]]);
23
+
24
+ const props = __props;
25
+
26
+ defineOptions({
27
+ name: 'BwaDateTimePicker',
28
+ });
29
+
30
+
31
+
32
+ const attrs = vue.useAttrs();
33
+
34
+
35
+
36
+ const modelValue = vue.computed({
37
+ get: () => props.modelValue,
38
+ set: (v) => {
39
+ if (!v) {
40
+ emit('update:model-value', '');
41
+ return;
42
+ }
43
+
44
+ emit(
45
+ 'update:model-value',
46
+ ElementPlus.dayjs(new Date(v.getTime())).format('YYYY-MM-DD HH:mm:ss')
47
+ );
48
+ },
49
+ });
50
+
51
+ return (_ctx, _cache) => {
52
+ return (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElDatePicker), vue.mergeProps(vue.unref(attrs), {
53
+ modelValue: vue.unref(modelValue),
54
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (vue.isRef(modelValue) ? (modelValue).value = $event : null)),
55
+ type: "datetime",
56
+ placeholder: __props.placeholder,
57
+ teleported: false,
58
+ style: {"width":"100%"}
59
+ }), null, 16 /* FULL_PROPS */, ["modelValue", "placeholder"]))
60
+ }
61
+ }
62
+
63
+ };
64
+ var DateTimePicker = /*#__PURE__*/_pluginVue_exportHelper["default"](_sfc_main, [['__file',"bwa-date-time-picker.vue"]]);
53
65
 
54
66
  exports["default"] = DateTimePicker;