@ctzy-web-client/plugin-component-vue 1.0.22 → 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 (132) 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 -168
  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 +213 -170
  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/date-range/date-range.vue +3 -3
  128. package/src/filter-panel/filter-panel.vue +2 -2
  129. package/src/pct-filter-panel/pct-compents/pct-Input-condition.vue +64 -64
  130. package/src/pct-filter-panel/pct-compents/pct-date-range-condition.vue +61 -61
  131. package/src/pct-filter-panel/pct-compents/pct-multiple-menu-condition.vue +302 -178
  132. package/src/pct-filter-panel/pct-filter-panel.vue +4 -4
@@ -14,123 +14,137 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
14
14
 
15
15
  var ElPanelDatePicker__default = /*#__PURE__*/_interopDefaultLegacy(ElPanelDatePicker);
16
16
 
17
- const __default__ = vue.defineComponent({ name: "BwaDatePicker" });
18
- const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
19
- props: {
20
- modelValue: {
21
- type: [String, Date, Array]
22
- },
23
- visible: {
24
- type: Boolean
25
- },
26
- format: {
27
- type: String,
28
- default: "YYYY-MM-DD"
29
- },
30
- shortcuts: {
31
- type: Array,
32
- default: () => []
33
- }
34
- },
35
- emits: ["update:modelValue", "update:visible"],
17
+ const _sfc_main = {
18
+ __name: 'date-picker',
19
+ props: {
20
+ modelValue: {
21
+ type: [String, Date, Array],
22
+ },
23
+ visible: {
24
+ type: Boolean,
25
+ },
26
+ format: {
27
+ type: String,
28
+ default: 'YYYY-MM-DD',
29
+ },
30
+ shortcuts: {
31
+ type: Array,
32
+ default: () => [],
33
+ },
34
+ },
35
+ emits: ['update:modelValue', 'update:visible'],
36
36
  setup(__props, { emit }) {
37
- const props = __props;
38
- const ns = webBaseClientVue.useNamespace("datepicker");
39
- const { lang } = index.useLocale();
40
- const visible = vue.ref(false);
41
- vue.watch(visible, () => {
42
- emit("update:visible", visible.value);
43
- });
44
- vue.provide("EP_PICKER_BASE", {
45
- props
46
- });
47
- vue.provide(constants.ROOT_PICKER_INJECTION_KEY, {
48
- slots: {},
49
- pickerNs: null
50
- });
51
- const parsedValue = vue.computed(() => {
52
- return utils.parseDate(props.modelValue, props.format, lang);
53
- });
54
- const emitInput = (input) => {
55
- if (utils.valueEquals(props.modelValue, input)) {
56
- return;
57
- }
58
- let formatted;
59
- if (Array.isArray(input)) {
60
- formatted = input.map((item) => utils.formatter(item, props.format, lang.value));
61
- } else {
62
- formatted = utils.formatter(input, props.format, lang.value);
63
- }
64
- emit("update:modelValue", formatted);
65
- };
66
- const onPick = (date) => {
67
- let result;
68
- if (Array.isArray(date)) {
69
- result = date.map((_) => _.toDate());
70
- } else {
71
- result = date ? date.toDate() : date;
72
- }
73
- emitInput(result);
74
- visible.value = false;
75
- };
76
- const onClear = () => {
77
- emit("update:modelValue", "");
78
- visible.value = false;
79
- };
80
- return (_ctx, _cache) => {
81
- const _component_ElButton = vue.resolveComponent("ElButton");
82
- const _component_ElTooltip = vue.resolveComponent("ElTooltip");
83
- return vue.openBlock(), vue.createBlock(_component_ElTooltip, {
84
- trigger: "click",
85
- pure: "",
86
- teleported: "",
87
- effect: "light",
88
- role: "dialog",
89
- transition: `el-zoom-in-top`,
90
- "fallback-placements": ["bottom", "top", "right", "left"],
91
- "gpu-acceleration": false,
92
- "show-arrow": false,
93
- "stop-popper-mouse-event": false,
94
- visible: visible.value,
95
- "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
96
- "hide-after": 0,
97
- "popper-class": vue.unref(ns).b(),
98
- persistent: "",
99
- "append-to": ".bwa-application"
37
+
38
+ const props = __props;
39
+
40
+ defineOptions({ name: 'BwaDatePicker' });
41
+
42
+
43
+
44
+ const ns = webBaseClientVue.useNamespace('datepicker');
45
+
46
+ const { lang } = index.useLocale();
47
+
48
+ const visible = vue.ref(false);
49
+
50
+ vue.watch(visible, () => {
51
+ emit('update:visible', visible.value);
52
+ });
53
+
54
+ vue.provide('EP_PICKER_BASE', {
55
+ props,
56
+ });
57
+ vue.provide(constants.ROOT_PICKER_INJECTION_KEY, {
58
+ slots: {},
59
+ pickerNs: null,
60
+ });
61
+
62
+ const parsedValue = vue.computed(() => {
63
+ return utils.parseDate(props.modelValue, props.format, lang);
64
+ });
65
+
66
+ const emitInput = (input) => {
67
+ if (utils.valueEquals(props.modelValue, input)) {
68
+ return;
69
+ }
70
+ let formatted;
71
+ if (Array.isArray(input)) {
72
+ formatted = input.map((item) => utils.formatter(item, props.format, lang.value));
73
+ } else {
74
+ formatted = utils.formatter(input, props.format, lang.value);
75
+ }
76
+ emit('update:modelValue', formatted);
77
+ };
78
+
79
+ const onPick = (date) => {
80
+ let result;
81
+ if (Array.isArray(date)) {
82
+ result = date.map((_) => _.toDate());
83
+ } else {
84
+ result = date ? date.toDate() : date;
85
+ }
86
+ emitInput(result);
87
+ visible.value = false;
88
+ };
89
+
90
+ const onClear = () => {
91
+ emit('update:modelValue', '');
92
+ visible.value = false;
93
+ };
94
+
95
+ return (_ctx, _cache) => {
96
+ const _component_ElButton = vue.resolveComponent("ElButton");
97
+ const _component_ElTooltip = vue.resolveComponent("ElTooltip");
98
+
99
+ return (vue.openBlock(), vue.createBlock(_component_ElTooltip, {
100
+ trigger: "click",
101
+ pure: "",
102
+ teleported: "",
103
+ effect: "light",
104
+ role: "dialog",
105
+ transition: `el-zoom-in-top`,
106
+ "fallback-placements": ['bottom', 'top', 'right', 'left'],
107
+ "gpu-acceleration": false,
108
+ "show-arrow": false,
109
+ "stop-popper-mouse-event": false,
110
+ visible: visible.value,
111
+ "onUpdate:visible": _cache[0] || (_cache[0] = $event => ((visible).value = $event)),
112
+ "hide-after": 0,
113
+ "popper-class": vue.unref(ns).b(),
114
+ persistent: "",
115
+ "append-to": ".bwa-application"
116
+ }, {
117
+ default: vue.withCtx(() => [
118
+ vue.renderSlot(_ctx.$slots, "default", { visible: visible.value })
119
+ ]),
120
+ content: vue.withCtx(() => [
121
+ vue.createVNode(vue.unref(ElPanelDatePicker__default["default"]), {
122
+ type: "date",
123
+ "parsed-value": vue.unref(parsedValue),
124
+ onPick: onPick,
125
+ teleported: false
100
126
  }, {
101
- default: vue.withCtx(() => [
102
- vue.renderSlot(_ctx.$slots, "default", { visible: visible.value })
127
+ sidebar: vue.withCtx(() => [
128
+ vue.createElementVNode("div", {
129
+ class: vue.normalizeClass(vue.unref(ns).e('sidebar'))
130
+ }, [
131
+ vue.createVNode(_component_ElButton, { onClick: onClear }, {
132
+ default: vue.withCtx(() => [
133
+ vue.createTextVNode("清空")
134
+ ]),
135
+ _: 1 /* STABLE */
136
+ })
137
+ ], 2 /* CLASS */)
103
138
  ]),
104
- content: vue.withCtx(() => [
105
- vue.createVNode(vue.unref(ElPanelDatePicker__default["default"]), {
106
- type: "date",
107
- "parsed-value": vue.unref(parsedValue),
108
- onPick,
109
- teleported: false
110
- }, {
111
- sidebar: vue.withCtx(() => [
112
- vue.createElementVNode("div", {
113
- class: vue.normalizeClass(vue.unref(ns).e("sidebar"))
114
- }, [
115
- vue.createVNode(_component_ElButton, {
116
- size: "small",
117
- onClick: onClear
118
- }, {
119
- default: vue.withCtx(() => [
120
- vue.createTextVNode("\u6E05\u7A7A")
121
- ]),
122
- _: 1
123
- })
124
- ], 2)
125
- ]),
126
- _: 1
127
- }, 8, ["parsed-value"])
128
- ]),
129
- _: 3
130
- }, 8, ["visible", "popper-class"]);
131
- };
132
- }
133
- });
134
- var datePicker = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["__file", "date-picker.vue"]]);
139
+ _: 1 /* STABLE */
140
+ }, 8 /* PROPS */, ["parsed-value"])
141
+ ]),
142
+ _: 3 /* FORWARDED */
143
+ }, 8 /* PROPS */, ["visible", "popper-class"]))
144
+ }
145
+ }
146
+
147
+ };
148
+ var datePicker = /*#__PURE__*/_pluginVue_exportHelper["default"](_sfc_main, [['__file',"date-picker.vue"]]);
135
149
 
136
150
  exports["default"] = datePicker;
@@ -5,181 +5,224 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var vue = require('vue');
6
6
  var webBaseClientVue = require('@ctzy-web-client/web-base-client-vue');
7
7
  var ElementPlus = require('element-plus');
8
- var PanelDateRange = require('element-plus/es/components/date-picker-panel/src/panel-date-range');
9
8
  var _pluginVue_exportHelper = require('../_virtual/_plugin-vue_export-helper.js');
10
9
 
11
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
+ const _sfc_main = {
11
+ __name: 'date-range',
12
+ props: {
13
+ ...ElementPlus.timePickerDefaultProps,
14
+ modelValue: {
15
+ type: null,
16
+ required: true,
17
+ },
18
+ },
19
+ emits: ['update:modelValue'],
20
+ setup(__props, { emit }) {
12
21
 
13
- var PanelDateRange__default = /*#__PURE__*/_interopDefaultLegacy(PanelDateRange);
22
+ const props = __props;
23
+
24
+ defineOptions({ name: 'BwaDateRange' });
25
+
26
+
27
+
28
+ const ns = webBaseClientVue.useNamespace('daterange');
29
+
30
+ const pickerVisivle = vue.ref(false);
31
+
32
+ const filterPanelItem = vue.inject(webBaseClientVue.filterPanelItemKey);
33
+ const column = vue.computed(() => filterPanelItem?.column ?? null);
34
+
35
+
36
+
37
+ const slots = vue.useSlots();
38
+
39
+ const locale = webBaseClientVue.useGlobalConfig('locale', 'ZH');
40
+ const lang = vue.computed(() => vue.unref(locale).name);
41
+
42
+ vue.provide(ElementPlus.ROOT_PICKER_INJECTION_KEY, {
43
+ slots,
44
+ pickerNs: ElementPlus.useNamespace('picker-panel'),
45
+ });
46
+ vue.provide('EP_PICKER_BASE', {
47
+ props,
48
+ });
49
+
50
+ vue.watch(
51
+ vue.computed(() => props.modelValue),
52
+ () => {
53
+ if (
54
+ !props.modelValue ||
55
+ Array.isArray(props.modelValue) ||
56
+ typeof props.modelValue !== 'object'
57
+ ) {
58
+ emit('update:modelValue', { start: '', end: '' });
59
+ }
60
+ },
61
+ { immediate: true }
62
+ );
63
+
64
+ const formatShowTime = (date) => {
65
+ return date ? ElementPlus.dayjs(date).format('YYYY-MM-DD') : '';
66
+ };
67
+
68
+ /** @type {import('vue').ComputedRef<string>} */
69
+ const startTime = vue.computed(() => {
70
+ if (!props.modelValue?.start) {
71
+ return '';
72
+ }
73
+
74
+ return ElementPlus.dayjs(props.modelValue.start)
75
+ .set('hour', 0)
76
+ .set('minute', 0)
77
+ .set('second', 0)
78
+ .format('YYYY-MM-DD HH:mm:ss');
79
+ });
80
+ /** @type {import('vue').ComputedRef<string>} */
81
+ const endTime = vue.computed(() => {
82
+ if (!props.modelValue?.end) {
83
+ return '';
84
+ }
85
+
86
+ return ElementPlus.dayjs(props.modelValue.end)
87
+ .set('hour', 23)
88
+ .set('minute', 59)
89
+ .set('second', 59)
90
+ .format('YYYY-MM-DD HH:mm:ss');
91
+ });
92
+
93
+ const formatStartTime = vue.computed(() => formatShowTime(vue.unref(startTime)));
94
+ const formatEndTime = vue.computed(() => formatShowTime(vue.unref(endTime)));
95
+
96
+ const dateRangeValue = vue.computed(() => [vue.unref(startTime), vue.unref(endTime)]);
97
+
98
+ const valueIsEmpty = vue.computed(() => {
99
+ const value = vue.unref(dateRangeValue);
100
+ return !value || (Array.isArray(value) && !value.filter(Boolean).length);
101
+ });
102
+
103
+ const parsedValue = vue.computed(() => {
104
+ const { valueFormat } = props;
105
+ const value = vue.unref(dateRangeValue);
106
+
107
+ if (!vue.unref(valueIsEmpty)) {
108
+ return value.map((d) => ElementPlus.parseDate(d, valueFormat, vue.unref(lang)));
109
+ }
110
+
111
+ return [];
112
+ });
113
+
114
+ const emitInput = (input) => {
115
+ if (!ElementPlus.valueEquals(vue.unref(dateRangeValue), input)) {
116
+ const formatted = input.map((item) =>
117
+ ElementPlus.formatter(item, props.valueFormat, vue.unref(lang))
118
+ );
119
+
120
+ emit('update:modelValue', {
121
+ start: formatted[0]
122
+ ? ElementPlus.dayjs(formatted[0])
123
+ .set('hour', 0)
124
+ .set('minute', 0)
125
+ .set('second', 0)
126
+ .format('YYYY-MM-DD HH:mm:ss')
127
+ : '',
128
+ end: formatted[1]
129
+ ? ElementPlus.dayjs(formatted[1])
130
+ .set('hour', 23)
131
+ .set('minute', 59)
132
+ .set('second', 59)
133
+ .format('YYYY-MM-DD HH:mm:ss')
134
+ : '',
135
+ });
136
+ }
137
+ };
138
+
139
+ const onPick = (date, visible = false) => {
140
+ pickerVisivle.value = visible;
141
+
142
+ emitInput(date.map((item) => item.toDate()));
143
+ };
14
144
 
15
- const __default__ = vue.defineComponent({ name: "BwaDateRange" });
16
- const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
17
- props: {
18
- ...ElementPlus.timePickerDefaultProps,
19
- modelValue: {
20
- type: null,
21
- required: true
22
- }
23
- },
24
- emits: ["update:modelValue"],
25
- setup(__props, { emit }) {
26
- const props = __props;
27
- const ns = webBaseClientVue.useNamespace("daterange");
28
- const pickerVisivle = vue.ref(false);
29
- const filterPanelItem = vue.inject(webBaseClientVue.filterPanelItemKey);
30
- const column = vue.computed(() => {
31
- var _a;
32
- return (_a = filterPanelItem == null ? void 0 : filterPanelItem.column) != null ? _a : null;
33
- });
34
- const slots = vue.useSlots();
35
- const locale = webBaseClientVue.useGlobalConfig("locale", "ZH");
36
- const lang = vue.computed(() => vue.unref(locale).name);
37
- vue.provide(ElementPlus.ROOT_PICKER_INJECTION_KEY, {
38
- slots,
39
- pickerNs: ElementPlus.useNamespace("picker-panel")
40
- });
41
- vue.provide("EP_PICKER_BASE", {
42
- props
43
- });
44
- vue.watch(
45
- vue.computed(() => props.modelValue),
46
- () => {
47
- if (!props.modelValue || Array.isArray(props.modelValue) || typeof props.modelValue !== "object") {
48
- emit("update:modelValue", { start: "", end: "" });
49
- }
50
- },
51
- { immediate: true }
52
- );
53
- const formatShowTime = (date) => {
54
- return date ? ElementPlus.dayjs(date).format("YYYY-MM-DD") : "";
55
- };
56
- const startTime = vue.computed(() => {
57
- var _a;
58
- if (!((_a = props.modelValue) == null ? void 0 : _a.start)) {
59
- return "";
60
- }
61
- return ElementPlus.dayjs(props.modelValue.start).set("hour", 0).set("minute", 0).set("second", 0).format("YYYY-MM-DD HH:mm:ss");
62
- });
63
- const endTime = vue.computed(() => {
64
- var _a;
65
- if (!((_a = props.modelValue) == null ? void 0 : _a.end)) {
66
- return "";
67
- }
68
- return ElementPlus.dayjs(props.modelValue.end).set("hour", 23).set("minute", 59).set("second", 59).format("YYYY-MM-DD HH:mm:ss");
69
- });
70
- const formatStartTime = vue.computed(() => formatShowTime(vue.unref(startTime)));
71
- const formatEndTime = vue.computed(() => formatShowTime(vue.unref(endTime)));
72
- const dateRangeValue = vue.computed(() => [vue.unref(startTime), vue.unref(endTime)]);
73
- const valueIsEmpty = vue.computed(() => {
74
- const value = vue.unref(dateRangeValue);
75
- return !value || Array.isArray(value) && !value.filter(Boolean).length;
76
- });
77
- const parsedValue = vue.computed(() => {
78
- const { valueFormat } = props;
79
- const value = vue.unref(dateRangeValue);
80
- if (!vue.unref(valueIsEmpty)) {
81
- return value.map((d) => ElementPlus.parseDate(d, valueFormat, vue.unref(lang)));
82
- }
83
- return [];
84
- });
85
- const emitInput = (input) => {
86
- if (!ElementPlus.valueEquals(vue.unref(dateRangeValue), input)) {
87
- const formatted = input.map(
88
- (item) => ElementPlus.formatter(item, props.valueFormat, vue.unref(lang))
89
- );
90
- emit("update:modelValue", {
91
- start: formatted[0] ? ElementPlus.dayjs(formatted[0]).set("hour", 0).set("minute", 0).set("second", 0).format("YYYY-MM-DD HH:mm:ss") : "",
92
- end: formatted[1] ? ElementPlus.dayjs(formatted[1]).set("hour", 23).set("minute", 59).set("second", 59).format("YYYY-MM-DD HH:mm:ss") : ""
93
- });
94
- }
95
- };
96
- const onPick = (date, visible = false) => {
97
- pickerVisivle.value = visible;
98
- emitInput(date.map((item) => item.toDate()));
99
- };
100
- return (_ctx, _cache) => {
101
- const _component_CaretBottom = vue.resolveComponent("CaretBottom");
102
- const _component_ElIcon = vue.resolveComponent("ElIcon");
103
- const _component_ElTooltip = vue.resolveComponent("ElTooltip");
104
- return vue.openBlock(), vue.createBlock(_component_ElTooltip, {
105
- visible: pickerVisivle.value,
106
- "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => pickerVisivle.value = $event),
107
- pure: "",
108
- teleported: "",
109
- effect: "light",
110
- role: "dialog",
111
- transition: `el-zoom-in-top`,
112
- "fallback-placements": ["bottom", "top", "right", "left"],
113
- "gpu-acceleration": false,
114
- "show-arrow": false,
115
- "stop-popper-mouse-event": false,
116
- "hide-after": 0,
117
- persistent: "",
118
- trigger: "click",
119
- "append-to": ".bwa-application"
120
- }, {
121
- default: vue.withCtx(() => [
122
- vue.renderSlot(_ctx.$slots, "pct-default", {
123
- formatStartTime: vue.unref(formatStartTime),
124
- formatEndTime: vue.unref(formatEndTime)
125
- }, () => [
126
- vue.createElementVNode("div", {
127
- class: vue.normalizeClass([vue.unref(ns).b(), vue.unref(ns).is("active", pickerVisivle.value)])
128
- }, [
129
- vue.renderSlot(_ctx.$slots, "label", {}, () => [
130
- vue.unref(column) ? (vue.openBlock(), vue.createElementBlock("span", {
145
+ return (_ctx, _cache) => {
146
+ const _component_CaretBottom = vue.resolveComponent("CaretBottom");
147
+ const _component_ElIcon = vue.resolveComponent("ElIcon");
148
+ const _component_ElTooltip = vue.resolveComponent("ElTooltip");
149
+
150
+ return (vue.openBlock(), vue.createBlock(_component_ElTooltip, {
151
+ visible: pickerVisivle.value,
152
+ "onUpdate:visible": _cache[0] || (_cache[0] = $event => ((pickerVisivle).value = $event)),
153
+ pure: "",
154
+ teleported: "",
155
+ effect: "light",
156
+ role: "dialog",
157
+ transition: `el-zoom-in-top`,
158
+ "fallback-placements": ['bottom', 'top', 'right', 'left'],
159
+ "gpu-acceleration": false,
160
+ "show-arrow": false,
161
+ "stop-popper-mouse-event": false,
162
+ "hide-after": 0,
163
+ persistent: "",
164
+ trigger: "click",
165
+ "append-to": ".bwa-application"
166
+ }, {
167
+ default: vue.withCtx(() => [
168
+ vue.renderSlot(_ctx.$slots, "pct-default", {
169
+ formatStartTime: vue.unref(formatStartTime),
170
+ formatEndTime: vue.unref(formatEndTime)
171
+ }, () => [
172
+ vue.createElementVNode("div", {
173
+ class: vue.normalizeClass([vue.unref(ns).b(), vue.unref(ns).is('active', pickerVisivle.value)])
174
+ }, [
175
+ vue.renderSlot(_ctx.$slots, "label", {}, () => [
176
+ (vue.unref(column))
177
+ ? (vue.openBlock(), vue.createElementBlock("span", {
131
178
  key: 0,
132
- class: vue.normalizeClass(vue.unref(ns).e("label"))
133
- }, vue.toDisplayString(vue.unref(column).title), 3)) : vue.createCommentVNode("v-if", true)
179
+ class: vue.normalizeClass(vue.unref(ns).e('label'))
180
+ }, vue.toDisplayString(vue.unref(column).title), 3 /* TEXT, CLASS */))
181
+ : vue.createCommentVNode("v-if", true)
182
+ ]),
183
+ vue.createElementVNode("span", {
184
+ class: vue.normalizeClass([vue.unref(ns).e('time'), vue.unref(ns).is('empty', !vue.unref(formatStartTime))])
185
+ }, [
186
+ vue.createElementVNode("span", {
187
+ class: vue.normalizeClass(vue.unref(ns).e('content'))
188
+ }, vue.toDisplayString(vue.unref(formatStartTime) ? vue.unref(formatStartTime) : '开始日期'), 3 /* TEXT, CLASS */),
189
+ vue.createVNode(_component_ElIcon, {
190
+ class: vue.normalizeClass(vue.unref(ns).e('caret'))
191
+ }, {
192
+ default: vue.withCtx(() => [
193
+ vue.createVNode(_component_CaretBottom)
134
194
  ]),
135
- vue.createElementVNode("span", {
136
- class: vue.normalizeClass([vue.unref(ns).e("time"), vue.unref(ns).is("empty", !vue.unref(formatStartTime))])
137
- }, [
138
- vue.createElementVNode("span", {
139
- class: vue.normalizeClass(vue.unref(ns).e("content"))
140
- }, vue.toDisplayString(vue.unref(formatStartTime) ? vue.unref(formatStartTime) : "\u5F00\u59CB\u65E5\u671F"), 3),
141
- vue.createVNode(_component_ElIcon, {
142
- class: vue.normalizeClass(vue.unref(ns).e("caret"))
143
- }, {
144
- default: vue.withCtx(() => [
145
- vue.createVNode(_component_CaretBottom)
146
- ]),
147
- _: 1
148
- }, 8, ["class"])
149
- ], 2),
150
- vue.createTextVNode(" \u81F3 "),
151
- vue.createElementVNode("span", {
152
- class: vue.normalizeClass([vue.unref(ns).e("time"), vue.unref(ns).is("empty", !vue.unref(formatEndTime))])
153
- }, [
154
- vue.createElementVNode("span", {
155
- class: vue.normalizeClass(vue.unref(ns).e("content"))
156
- }, vue.toDisplayString(vue.unref(formatEndTime) ? vue.unref(formatEndTime) : "\u7ED3\u675F\u65E5\u671F"), 3),
157
- vue.createVNode(_component_ElIcon, {
158
- class: vue.normalizeClass(vue.unref(ns).e("caret"))
159
- }, {
160
- default: vue.withCtx(() => [
161
- vue.createVNode(_component_CaretBottom)
162
- ]),
163
- _: 1
164
- }, 8, ["class"])
165
- ], 2)
166
- ], 2)
167
- ])
168
- ]),
169
- content: vue.withCtx(() => [
170
- vue.createVNode(vue.unref(PanelDateRange__default["default"]), {
171
- "parsed-value": vue.unref(parsedValue),
172
- type: "daterange",
173
- visible: pickerVisivle.value,
174
- onPick,
175
- teleported: false
176
- }, null, 8, ["parsed-value", "visible"])
177
- ]),
178
- _: 3
179
- }, 8, ["visible"]);
180
- };
181
- }
182
- });
183
- var DateRange = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["__file", "date-range.vue"]]);
195
+ _: 1 /* STABLE */
196
+ }, 8 /* PROPS */, ["class"])
197
+ ], 2 /* CLASS */),
198
+ vue.createTextVNode(""),
199
+ vue.createElementVNode("span", {
200
+ class: vue.normalizeClass([vue.unref(ns).e('time'), vue.unref(ns).is('empty', !vue.unref(formatEndTime))])
201
+ }, [
202
+ vue.createElementVNode("span", {
203
+ class: vue.normalizeClass(vue.unref(ns).e('content'))
204
+ }, vue.toDisplayString(vue.unref(formatEndTime) ? vue.unref(formatEndTime) : '结束日期'), 3 /* TEXT, CLASS */),
205
+ vue.createVNode(_component_ElIcon, {
206
+ class: vue.normalizeClass(vue.unref(ns).e('caret'))
207
+ }, {
208
+ default: vue.withCtx(() => [
209
+ vue.createVNode(_component_CaretBottom)
210
+ ]),
211
+ _: 1 /* STABLE */
212
+ }, 8 /* PROPS */, ["class"])
213
+ ], 2 /* CLASS */)
214
+ ], 2 /* CLASS */)
215
+ ])
216
+ ]),
217
+ content: vue.withCtx(() => [
218
+ vue.createCommentVNode(" <PanelDateRange\r\n :parsed-value=\"parsedValue\"\r\n type=\"daterange\"\r\n :visible=\"pickerVisivle\"\r\n @pick=\"onPick\"\r\n :teleported=\"false\"\r\n /> ")
219
+ ]),
220
+ _: 3 /* FORWARDED */
221
+ }, 8 /* PROPS */, ["visible"]))
222
+ }
223
+ }
224
+
225
+ };
226
+ var DateRange = /*#__PURE__*/_pluginVue_exportHelper["default"](_sfc_main, [['__file',"date-range.vue"]]);
184
227
 
185
228
  exports["default"] = DateRange;