@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.
- package/es/advance-select/advance-operation.mjs +51 -37
- package/es/advance-select/advance-option.mjs +167 -97
- package/es/advance-select/advance-option.vue_vue_type_style_index_0_scoped_bc8f5626_lang.mjs +7 -0
- package/es/advance-select/advance-select.mjs +368 -310
- package/es/advance-select/index.mjs +5 -5
- package/es/application-slot/breadcrumb-item.mjs +20 -17
- package/es/application-slot/header-tools-item.mjs +20 -17
- package/es/breadcrumb-select/breadcrumb-select.mjs +134 -112
- package/es/contextmenu/contextmenu-item.mjs +19 -15
- package/es/contextmenu/contextmenu.mjs +72 -56
- package/es/data-form/data-form-item.mjs +48 -30
- package/es/data-form/data-form.mjs +213 -166
- package/es/data-form/form-components/bwa-date-picker.mjs +51 -39
- package/es/data-form/form-components/bwa-date-time-picker.mjs +56 -44
- package/es/data-form/form-components/bwa-input-float.mjs +48 -37
- package/es/data-form/form-components/bwa-input-integer.mjs +68 -50
- package/es/data-form/form-components/bwa-input.mjs +43 -32
- package/es/data-form/form-components/bwa-multi-select.mjs +40 -29
- package/es/data-form/form-components/bwa-rich-text-tinymce.mjs +554 -218
- package/es/data-form/form-components/bwa-rich-text.mjs +404 -316
- package/es/data-form/form-components/bwa-select.mjs +84 -70
- package/es/data-form/form-components/bwa-textarea.mjs +38 -27
- package/es/data-form/form-components/bwa-upload.mjs +172 -148
- package/es/data-form/form-components/bwa-user-multi-select.mjs +35 -24
- package/es/data-form/form-components/bwa-user-select.mjs +86 -61
- package/es/data-table/data-column-view.mjs +146 -115
- package/es/data-table/data-table-card.mjs +48 -40
- package/es/data-table/data-table-column.mjs +58 -45
- package/es/data-table/data-table.mjs +402 -316
- package/es/datatable-settings/datatable-settings.mjs +329 -254
- package/es/date-range/date-picker.mjs +130 -116
- package/es/date-range/date-range.mjs +215 -161
- package/es/drag-list/drag-item.mjs +56 -42
- package/es/drag-list/drag-list.mjs +60 -47
- package/es/dragable/dragable-item.mjs +23 -18
- package/es/dragable/dragable-operation.mjs +32 -24
- package/es/dragable/dragable.mjs +32 -23
- package/es/filter-panel/conditions/date-range-condition.mjs +50 -40
- package/es/filter-panel/conditions/department-condition/department-condition.mjs +99 -72
- package/es/filter-panel/conditions/department-condition/department-node.mjs +73 -59
- package/es/filter-panel/conditions/input-condition.mjs +90 -76
- package/es/filter-panel/conditions/multi-user-condition.mjs +67 -57
- package/es/filter-panel/conditions/multiple-menu-condition.mjs +54 -35
- package/es/filter-panel/conditions/single-menu-condition.mjs +65 -60
- package/es/filter-panel/conditions/single-user-condition.mjs +67 -57
- package/es/filter-panel/filter-panel-item.mjs +54 -39
- package/es/filter-panel/filter-panel.mjs +153 -135
- package/es/layout/layout.mjs +85 -78
- package/es/menu/menu-item.mjs +67 -52
- package/es/menu/menu.mjs +70 -53
- package/es/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.mjs +28 -0
- package/es/panel/panel.mjs +53 -40
- package/es/pct-filter-panel/pct-compents/pct-Input-condition.mjs +74 -63
- package/es/pct-filter-panel/pct-compents/pct-date-range-condition.mjs +76 -67
- package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition.mjs +406 -178
- package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.mjs +153 -138
- package/es/pct-filter-panel/pct-filter-panel-item.mjs +55 -40
- package/es/pct-filter-panel/pct-filter-panel.mjs +247 -227
- package/es/progress/progress-item.mjs +81 -61
- package/es/progress/progress.mjs +78 -64
- package/es/where-filter-panel/where-filter-panel.mjs +15 -12
- package/lib/advance-select/advance-operation.js +50 -36
- package/lib/advance-select/advance-option.js +166 -96
- package/lib/advance-select/advance-option.vue_vue_type_style_index_0_scoped_bc8f5626_lang.js +12 -0
- package/lib/advance-select/advance-select.js +366 -308
- package/lib/application-slot/breadcrumb-item.js +19 -16
- package/lib/application-slot/header-tools-item.js +19 -16
- package/lib/breadcrumb-select/breadcrumb-select.js +133 -111
- package/lib/contextmenu/contextmenu-item.js +18 -14
- package/lib/contextmenu/contextmenu.js +71 -55
- package/lib/data-form/data-form-item.js +47 -29
- package/lib/data-form/data-form.js +212 -165
- package/lib/data-form/form-components/bwa-date-picker.js +50 -38
- package/lib/data-form/form-components/bwa-date-time-picker.js +55 -43
- package/lib/data-form/form-components/bwa-input-float.js +47 -36
- package/lib/data-form/form-components/bwa-input-integer.js +67 -49
- package/lib/data-form/form-components/bwa-input.js +42 -31
- package/lib/data-form/form-components/bwa-multi-select.js +39 -28
- package/lib/data-form/form-components/bwa-rich-text-tinymce.js +553 -217
- package/lib/data-form/form-components/bwa-rich-text.js +403 -315
- package/lib/data-form/form-components/bwa-select.js +83 -69
- package/lib/data-form/form-components/bwa-textarea.js +37 -26
- package/lib/data-form/form-components/bwa-upload.js +171 -147
- package/lib/data-form/form-components/bwa-user-multi-select.js +34 -23
- package/lib/data-form/form-components/bwa-user-select.js +85 -60
- package/lib/data-table/data-column-view.js +146 -115
- package/lib/data-table/data-table-card.js +48 -40
- package/lib/data-table/data-table-column.js +57 -44
- package/lib/data-table/data-table.js +401 -315
- package/lib/datatable-settings/datatable-settings.js +328 -253
- package/lib/date-range/date-picker.js +129 -115
- package/lib/date-range/date-range.js +214 -160
- package/lib/drag-list/drag-item.js +55 -41
- package/lib/drag-list/drag-list.js +59 -46
- package/lib/dragable/dragable-item.js +22 -17
- package/lib/dragable/dragable-operation.js +31 -23
- package/lib/dragable/dragable.js +31 -22
- package/lib/filter-panel/conditions/date-range-condition.js +49 -39
- package/lib/filter-panel/conditions/department-condition/department-condition.js +98 -71
- package/lib/filter-panel/conditions/department-condition/department-node.js +72 -58
- package/lib/filter-panel/conditions/input-condition.js +89 -75
- package/lib/filter-panel/conditions/multi-user-condition.js +66 -56
- package/lib/filter-panel/conditions/multiple-menu-condition.js +53 -34
- package/lib/filter-panel/conditions/single-menu-condition.js +64 -59
- package/lib/filter-panel/conditions/single-user-condition.js +66 -56
- package/lib/filter-panel/filter-panel-item.js +53 -38
- package/lib/filter-panel/filter-panel.js +152 -134
- package/lib/layout/layout.js +84 -77
- package/lib/menu/menu-item.js +66 -51
- package/lib/menu/menu.js +69 -52
- package/lib/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js +32 -0
- package/lib/panel/panel.js +52 -39
- package/lib/pct-filter-panel/pct-compents/pct-Input-condition.js +73 -62
- package/lib/pct-filter-panel/pct-compents/pct-date-range-condition.js +75 -66
- package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition.js +405 -177
- package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.js +152 -137
- package/lib/pct-filter-panel/pct-filter-panel-item.js +54 -39
- package/lib/pct-filter-panel/pct-filter-panel.js +246 -226
- package/lib/progress/progress-item.js +80 -60
- package/lib/progress/progress.js +77 -63
- package/lib/where-filter-panel/where-filter-panel.js +14 -11
- package/package.json +2 -1
- package/src/advance-select/advance-option.vue +64 -13
- package/src/data-form/form-components/bwa-rich-text-tinymce.vue +1 -1
- package/src/datatable-settings/datatable-settings.vue +33 -3
- package/src/date-range/date-picker.vue +1 -1
- package/src/filter-panel/filter-panel.vue +2 -2
- package/src/pct-filter-panel/pct-compents/pct-Input-condition.vue +64 -64
- package/src/pct-filter-panel/pct-compents/pct-date-range-condition.vue +61 -61
- package/src/pct-filter-panel/pct-compents/pct-multiple-menu-condition.vue +302 -178
- 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
|
|
18
|
-
|
|
19
|
-
props: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
emits: [
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
-
|
|
102
|
-
vue.
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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;
|
|
@@ -7,168 +7,222 @@ var webBaseClientVue = require('@ctzy-web-client/web-base-client-vue');
|
|
|
7
7
|
var ElementPlus = require('element-plus');
|
|
8
8
|
var _pluginVue_exportHelper = require('../_virtual/_plugin-vue_export-helper.js');
|
|
9
9
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
props: {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
emits: [
|
|
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
20
|
setup(__props, { emit }) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
21
|
+
|
|
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
|
+
};
|
|
144
|
+
|
|
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", {
|
|
126
178
|
key: 0,
|
|
127
|
-
class: vue.normalizeClass(vue.unref(ns).e(
|
|
128
|
-
}, vue.toDisplayString(vue.unref(column).title), 3
|
|
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)
|
|
129
194
|
]),
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
])
|
|
163
|
-
]),
|
|
164
|
-
content: vue.withCtx(() => [
|
|
165
|
-
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 /> ')
|
|
166
|
-
]),
|
|
167
|
-
_: 3
|
|
168
|
-
}, 8, ["visible"]);
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
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"]]);
|
|
173
227
|
|
|
174
228
|
exports["default"] = DateRange;
|