hy-dispatch-ui-v3 0.1.5 → 0.2.0
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/README.md +47 -0
- package/dist/tailwind.css +408 -4
- package/es/components/appAudioPlayer/appAudioPlayer.vue.mjs +462 -0
- package/es/components/appAudioPlayer/index.mjs +6 -0
- package/es/components/appAudioPlayer/js/index.mjs +327 -0
- package/es/components/appAudioPlayer/style/appAudioPlayer.scss +319 -0
- package/es/components/appButton/style/appButton.scss +0 -1
- package/es/components/appConfigProvider/appConfigProvider.vue.mjs +25 -4
- package/es/components/appConfirmDialog/appConfirmDialog.vue.mjs +3 -3
- package/es/components/appConfirmDialog/appConfirmMethod.mjs +13 -13
- package/es/components/appCutter/appCutter.vue.mjs +358 -0
- package/es/components/appCutter/index.mjs +6 -0
- package/es/components/appCutter/style/appCutter.scss +51 -0
- package/es/components/appDatePicker/appDatePicker.vue.mjs +1 -1
- package/es/components/appDialog/appDialog.vue.mjs +205 -0
- package/es/components/appDialog/index.mjs +6 -0
- package/es/components/appDialog/style/appDialog.scss +0 -0
- package/es/components/appForm/appForm.vue.mjs +132 -209
- package/es/components/appForm/cpns/appFormItem.vue.mjs +312 -0
- package/es/components/appForm/cpns/arrayItem.vue.mjs +305 -0
- package/es/components/appForm/cpns/extraItem.vue.mjs +140 -0
- package/es/components/appForm/js/index.mjs +46 -24
- package/es/components/appForm/js/useAppForm.mjs +30 -6
- package/es/components/appForm/style/appForm.scss +53 -0
- package/es/components/appIcon/appIcon.vue.mjs +2 -1
- package/es/components/appIconBox/style/appIconBox.scss +0 -1
- package/es/components/appInput/appInput.vue.mjs +99 -0
- package/es/components/appInput/index.mjs +6 -0
- package/es/components/appMenu/appMenu.vue.mjs +129 -0
- package/es/components/appMenu/index.mjs +6 -0
- package/es/components/appMenu/style/appMenu.scss +145 -0
- package/es/components/appOrgCascader/appOrgCascader.vue.mjs +14 -10
- package/es/components/appSearch/appSearch.vue.mjs +55 -211
- package/es/components/appSearch/cpns/appSearchItem.vue.mjs +238 -0
- package/es/components/appSearch/js/index.mjs +20 -8
- package/es/components/appSearch/js/useAppSearch.mjs +10 -5
- package/es/components/appSearch/style/appSearch.scss +10 -0
- package/es/components/appTable/appTable.vue.mjs +313 -159
- package/es/components/appTable/cpns/columnSelect.vue.mjs +151 -156
- package/es/components/appTable/cpns/columnSelectItem.vue2.mjs +104 -110
- package/es/components/appTable/cpns/headerItem.vue.mjs +98 -0
- package/es/components/appTable/cpns/virtualTable.vue.mjs +560 -0
- package/es/components/appTable/js/index.mjs +46 -20
- package/es/components/appTable/js/search.mjs +1 -2
- package/es/components/appTable/js/useAppTable.mjs +58 -14
- package/es/components/appTable/style/appTable.scss +16 -0
- package/es/components/appTooltip/appTooltip.vue.mjs +24 -13
- package/es/components/appTree/appTree.vue.mjs +304 -0
- package/es/components/appTree/index.mjs +6 -0
- package/es/components/appTree/js/index.mjs +531 -0
- package/es/components/appUserAvatar/appUserAvatar.vue.mjs +9 -8
- package/es/components/appUserAvatar/style/appUserAvatar.scss +0 -1
- package/es/components/appVideoPlayer/appVideoPlayer.vue.mjs +647 -0
- package/es/components/appVideoPlayer/cpns/mediaLoading.vue.mjs +35 -0
- package/es/components/appVideoPlayer/index.mjs +6 -0
- package/es/components/appVideoPlayer/js/index.mjs +426 -0
- package/es/components/appVideoPlayer/style/appVideoPlayer.scss +275 -0
- package/es/components/appVideoPlayer/style/mediaLoading.scss +62 -0
- package/es/components/index.mjs +7 -0
- package/es/hooks/index.mjs +3 -0
- package/es/hooks/useApi.mjs +7 -3
- package/es/hooks/useAudioPlayerConfig.mjs +12 -0
- package/es/hooks/useGlobalConfig.mjs +20 -9
- package/es/hooks/useLocale.mjs +10 -8
- package/es/hooks/useMixins.mjs +1 -1
- package/es/hooks/usePermissionMap.mjs +12 -0
- package/es/hooks/useUserAvatarMap.mjs +6 -3
- package/es/hooks/useVideoPlayerConfig.mjs +12 -0
- package/es/index.mjs +16 -3
- package/es/locale/en.mjs +58 -4
- package/es/locale/zh_CN.mjs +56 -6
- package/es/make-installer.mjs +2 -0
- package/es/static/hy-svg-icons.js +462 -0
- package/es/static/protocolcheck.js +247 -0
- package/es/style/element/element.scss +9 -0
- package/es/style/element/index.scss +6 -3
- package/es/style/index.scss +11 -0
- package/es/style/theme.scss +73 -0
- package/es/utils/date.mjs +25 -1
- package/es/utils/file.mjs +69 -0
- package/es/utils/form.mjs +52 -0
- package/es/utils/handler.mjs +22 -2
- package/es/utils/index.mjs +6 -3
- package/es/utils/is.mjs +26 -2
- package/es/utils/loadScript.mjs +33 -0
- package/es/version.mjs +1 -1
- package/lib/components/appAudioPlayer/appAudioPlayer.vue.js +466 -0
- package/lib/components/appAudioPlayer/index.js +11 -0
- package/lib/components/appAudioPlayer/js/index.js +329 -0
- package/lib/components/appAudioPlayer/style/appAudioPlayer.scss +319 -0
- package/lib/components/appButton/style/appButton.scss +0 -1
- package/lib/components/appConfigProvider/appConfigProvider.vue.js +23 -2
- package/lib/components/appConfirmDialog/appConfirmDialog.vue.js +3 -3
- package/lib/components/appConfirmDialog/appConfirmMethod.js +13 -13
- package/lib/components/appCutter/appCutter.vue.js +362 -0
- package/lib/components/appCutter/index.js +11 -0
- package/lib/components/appCutter/style/appCutter.scss +51 -0
- package/lib/components/appDatePicker/appDatePicker.vue.js +1 -1
- package/lib/components/appDialog/appDialog.vue.js +209 -0
- package/lib/components/appDialog/index.js +11 -0
- package/lib/components/appDialog/style/appDialog.scss +0 -0
- package/lib/components/appForm/appForm.vue.js +129 -206
- package/lib/components/appForm/cpns/appFormItem.vue.js +316 -0
- package/lib/components/appForm/cpns/arrayItem.vue.js +309 -0
- package/lib/components/appForm/cpns/extraItem.vue.js +144 -0
- package/lib/components/appForm/js/index.js +48 -23
- package/lib/components/appForm/js/useAppForm.js +30 -6
- package/lib/components/appForm/style/appForm.scss +53 -0
- package/lib/components/appIcon/appIcon.vue.js +2 -1
- package/lib/components/appIconBox/style/appIconBox.scss +0 -1
- package/lib/components/appInput/appInput.vue.js +103 -0
- package/lib/components/appInput/index.js +11 -0
- package/lib/components/appMenu/appMenu.vue.js +133 -0
- package/lib/components/appMenu/index.js +11 -0
- package/lib/components/appMenu/style/appMenu.scss +145 -0
- package/lib/components/appOrgCascader/appOrgCascader.vue.js +14 -10
- package/lib/components/appSearch/appSearch.vue.js +51 -207
- package/lib/components/appSearch/cpns/appSearchItem.vue.js +242 -0
- package/lib/components/appSearch/js/index.js +20 -7
- package/lib/components/appSearch/js/useAppSearch.js +10 -5
- package/lib/components/appSearch/style/appSearch.scss +10 -0
- package/lib/components/appTable/appTable.vue.js +320 -166
- package/lib/components/appTable/cpns/columnSelect.vue.js +151 -156
- package/lib/components/appTable/cpns/columnSelectItem.vue2.js +105 -111
- package/lib/components/appTable/cpns/headerItem.vue.js +102 -0
- package/lib/components/appTable/cpns/virtualTable.vue.js +564 -0
- package/lib/components/appTable/js/index.js +47 -19
- package/lib/components/appTable/js/search.js +1 -2
- package/lib/components/appTable/js/useAppTable.js +57 -13
- package/lib/components/appTable/style/appTable.scss +16 -0
- package/lib/components/appTooltip/appTooltip.vue.js +23 -12
- package/lib/components/appTree/appTree.vue.js +308 -0
- package/lib/components/appTree/index.js +11 -0
- package/lib/components/appTree/js/index.js +533 -0
- package/lib/components/appUserAvatar/appUserAvatar.vue.js +9 -8
- package/lib/components/appUserAvatar/style/appUserAvatar.scss +0 -1
- package/lib/components/appVideoPlayer/appVideoPlayer.vue.js +651 -0
- package/lib/components/appVideoPlayer/cpns/mediaLoading.vue.js +39 -0
- package/lib/components/appVideoPlayer/index.js +11 -0
- package/lib/components/appVideoPlayer/js/index.js +429 -0
- package/lib/components/appVideoPlayer/style/appVideoPlayer.scss +275 -0
- package/lib/components/appVideoPlayer/style/mediaLoading.scss +62 -0
- package/lib/components/index.js +42 -28
- package/lib/hooks/index.js +9 -0
- package/lib/hooks/useApi.js +7 -3
- package/lib/hooks/useAudioPlayerConfig.js +15 -0
- package/lib/hooks/useGlobalConfig.js +18 -7
- package/lib/hooks/useLocale.js +9 -7
- package/lib/hooks/useMixins.js +1 -1
- package/lib/hooks/usePermissionMap.js +15 -0
- package/lib/hooks/useUserAvatarMap.js +5 -2
- package/lib/hooks/useVideoPlayerConfig.js +15 -0
- package/lib/index.js +70 -28
- package/lib/locale/en.js +58 -4
- package/lib/locale/zh_CN.js +56 -6
- package/lib/make-installer.js +2 -0
- package/lib/static/hy-svg-icons.js +459 -8
- package/lib/static/protocolcheck.js +249 -0
- package/lib/style/element/element.scss +9 -0
- package/lib/style/element/index.scss +6 -3
- package/lib/style/index.scss +11 -0
- package/lib/style/theme.scss +73 -0
- package/lib/utils/date.js +25 -0
- package/lib/utils/file.js +76 -0
- package/lib/utils/form.js +57 -0
- package/lib/utils/handler.js +22 -1
- package/lib/utils/index.js +19 -0
- package/lib/utils/is.js +27 -1
- package/lib/utils/loadScript.js +37 -0
- package/lib/version.js +1 -1
- package/package.json +13 -12
- package/es/config/index.mjs +0 -1
- package/es/static/hy-svg-icons.mjs +0 -11
- package/lib/config/index.js +0 -2
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var elementPlus = require('element-plus');
|
|
7
|
+
var index = require('../js/index.js');
|
|
8
|
+
var index$2 = require('../../appDatePicker/index.js');
|
|
9
|
+
var index$3 = require('../../appOrgCascader/index.js');
|
|
10
|
+
var is = require('../../../utils/is.js');
|
|
11
|
+
var form = require('../../../utils/form.js');
|
|
12
|
+
var index$1 = require('../../appInput/index.js');
|
|
13
|
+
|
|
14
|
+
const _sfc_main = {
|
|
15
|
+
__name: "appSearchItem",
|
|
16
|
+
props: {
|
|
17
|
+
model: {
|
|
18
|
+
type: Object,
|
|
19
|
+
default: () => ({})
|
|
20
|
+
},
|
|
21
|
+
column: {
|
|
22
|
+
type: Object,
|
|
23
|
+
default: () => ({})
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
emits: ["search"],
|
|
27
|
+
setup(__props, { emit: __emit }) {
|
|
28
|
+
const props = __props;
|
|
29
|
+
const emits = __emit;
|
|
30
|
+
const columnProp = vue.computed(() => {
|
|
31
|
+
let field = is.isArray(props.column.field) ? props.column.field[0] : props.column.field;
|
|
32
|
+
return field;
|
|
33
|
+
});
|
|
34
|
+
const bindValue = vue.computed({
|
|
35
|
+
get() {
|
|
36
|
+
const prop = is.isArray(props.column.field) ? props.column.field[0] : props.column.field;
|
|
37
|
+
return form.getValueByProp(props.model, prop);
|
|
38
|
+
},
|
|
39
|
+
set(val) {
|
|
40
|
+
const prop = is.isArray(props.column.field) ? props.column.field[0] : props.column.field;
|
|
41
|
+
form.setValueByProp(props.model, prop, val);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const bindValue2 = vue.computed({
|
|
45
|
+
get() {
|
|
46
|
+
const prop = is.isArray(props.column.field) ? props.column.field[1] : props.column.field;
|
|
47
|
+
return form.getValueByProp(props.model, prop);
|
|
48
|
+
},
|
|
49
|
+
set(val) {
|
|
50
|
+
const prop = is.isArray(props.column.field) ? props.column.field[1] : props.column.field;
|
|
51
|
+
form.setValueByProp(props.model, prop, val);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
function onChangeHandler(value, column) {
|
|
55
|
+
emits("search");
|
|
56
|
+
}
|
|
57
|
+
function onKeydownEnterHander(e) {
|
|
58
|
+
emits("search");
|
|
59
|
+
}
|
|
60
|
+
function onTimeRangeClickHandler(column, options) {
|
|
61
|
+
const { field } = column;
|
|
62
|
+
const dateValue = index.timeRangeHandler(column, options);
|
|
63
|
+
const flag = dateValue.length && dateValue.every((value, index) => {
|
|
64
|
+
return is.isArray(field) ? value === props.model[field[index]] : props.model[field][index];
|
|
65
|
+
});
|
|
66
|
+
if (flag) return;
|
|
67
|
+
if (is.isArray(field)) {
|
|
68
|
+
props.model[field[0]] = dateValue[0];
|
|
69
|
+
props.model[field[1]] = dateValue[1];
|
|
70
|
+
} else {
|
|
71
|
+
props.model[field] = dateValue;
|
|
72
|
+
}
|
|
73
|
+
emits("search");
|
|
74
|
+
}
|
|
75
|
+
return (_ctx, _cache) => {
|
|
76
|
+
return vue.unref(index.columnShowHandler)(props, __props.column) ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElFormItem), {
|
|
77
|
+
key: 0,
|
|
78
|
+
prop: columnProp.value
|
|
79
|
+
}, {
|
|
80
|
+
default: vue.withCtx(() => [
|
|
81
|
+
vue.createElementVNode("div", { class: "flex bg-background-2 rounded border border-transparent hover:border-theme box-border" }, [
|
|
82
|
+
vue.createElementVNode(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
class: "flex",
|
|
86
|
+
style: vue.normalizeStyle(vue.unref(index.columnItemStyle)(props, __props.column))
|
|
87
|
+
},
|
|
88
|
+
[
|
|
89
|
+
vue.createCommentVNode(" \u8868\u5355label "),
|
|
90
|
+
vue.createElementVNode("div", { class: "flex items-center text-auxiliary text-xs px-3 whitespace-nowrap border-r border-border" }, [
|
|
91
|
+
__props.column.labelSlot && _ctx.$slots[__props.column.labelSlot] ? vue.renderSlot(_ctx.$slots, __props.column.labelSlot, {
|
|
92
|
+
key: 0,
|
|
93
|
+
column: __props.column
|
|
94
|
+
}) : (vue.openBlock(), vue.createElementBlock(
|
|
95
|
+
"span",
|
|
96
|
+
{ key: 1 },
|
|
97
|
+
vue.toDisplayString(__props.column.label),
|
|
98
|
+
1
|
|
99
|
+
/* TEXT */
|
|
100
|
+
))
|
|
101
|
+
]),
|
|
102
|
+
vue.createCommentVNode(" \u8868\u5355\u7EC4\u4EF6 "),
|
|
103
|
+
vue.createElementVNode(
|
|
104
|
+
"div",
|
|
105
|
+
{
|
|
106
|
+
class: vue.normalizeClass({ "app-search-custom-wrapper": __props.column.slot }),
|
|
107
|
+
style: vue.normalizeStyle(vue.unref(index.columnItemInputStyle)(props, __props.column))
|
|
108
|
+
},
|
|
109
|
+
[
|
|
110
|
+
vue.createCommentVNode(" \u81EA\u5B9A\u4E49\u5177\u540D\u63D2\u69FD "),
|
|
111
|
+
__props.column.slot ? vue.renderSlot(_ctx.$slots, __props.column.slot, {
|
|
112
|
+
key: 0,
|
|
113
|
+
column: __props.column
|
|
114
|
+
}) : __props.column.type === "input" ? (vue.openBlock(), vue.createElementBlock(
|
|
115
|
+
vue.Fragment,
|
|
116
|
+
{ key: 1 },
|
|
117
|
+
[
|
|
118
|
+
vue.createCommentVNode(" \u8F93\u5165\u6846 "),
|
|
119
|
+
vue.createVNode(vue.unref(index$1.AppInput), vue.mergeProps({
|
|
120
|
+
modelValue: bindValue.value,
|
|
121
|
+
"onUpdate:modelValue": ($event) => bindValue.value = $event
|
|
122
|
+
}, __props.column.attrs, {
|
|
123
|
+
disabled: vue.unref(index.isDisabled)(props, __props.column),
|
|
124
|
+
onKeydown: vue.withKeys(($event) => onKeydownEnterHander($event, __props.column), ["enter"]),
|
|
125
|
+
onChange: ($event) => onChangeHandler($event, __props.column)
|
|
126
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "onKeydown", "onChange"])
|
|
127
|
+
],
|
|
128
|
+
2112
|
|
129
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
130
|
+
)) : __props.column.type === "select" ? (vue.openBlock(), vue.createElementBlock(
|
|
131
|
+
vue.Fragment,
|
|
132
|
+
{ key: 2 },
|
|
133
|
+
[
|
|
134
|
+
vue.createCommentVNode(" \u9009\u62E9\u6846 "),
|
|
135
|
+
vue.createVNode(vue.unref(elementPlus.ElSelect), vue.mergeProps({
|
|
136
|
+
modelValue: bindValue.value,
|
|
137
|
+
"onUpdate:modelValue": ($event) => bindValue.value = $event
|
|
138
|
+
}, __props.column.attrs, {
|
|
139
|
+
disabled: vue.unref(index.isDisabled)(props, __props.column),
|
|
140
|
+
options: vue.unref(index.optionsHandler)(props, __props.column),
|
|
141
|
+
onChange: ($event) => onChangeHandler($event, __props.column)
|
|
142
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "options", "onChange"])
|
|
143
|
+
],
|
|
144
|
+
2112
|
|
145
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
146
|
+
)) : __props.column.type === "date-picker" ? (vue.openBlock(), vue.createElementBlock(
|
|
147
|
+
vue.Fragment,
|
|
148
|
+
{ key: 3 },
|
|
149
|
+
[
|
|
150
|
+
vue.createCommentVNode(" \u65E5\u671F\u9009\u62E9\u6846 "),
|
|
151
|
+
[
|
|
152
|
+
"datetimerange",
|
|
153
|
+
"daterange",
|
|
154
|
+
"monthrange",
|
|
155
|
+
"yearrange"
|
|
156
|
+
].includes(__props.column.attrs?.type) && vue.unref(is.isArray)(__props.column.field) ? (vue.openBlock(), vue.createBlock(vue.unref(index$2.AppDatePicker), vue.mergeProps({
|
|
157
|
+
key: 0,
|
|
158
|
+
start: bindValue.value,
|
|
159
|
+
"onUpdate:start": ($event) => bindValue.value = $event,
|
|
160
|
+
end: bindValue2.value,
|
|
161
|
+
"onUpdate:end": ($event) => bindValue2.value = $event,
|
|
162
|
+
"is-range": true,
|
|
163
|
+
style: { "width": "100%" },
|
|
164
|
+
timeRangeFill: __props.column.timeRangeFill
|
|
165
|
+
}, __props.column.attrs, {
|
|
166
|
+
disabled: vue.unref(index.isDisabled)(props, __props.column),
|
|
167
|
+
onChange: ($event) => onChangeHandler($event, __props.column)
|
|
168
|
+
}), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "timeRangeFill", "disabled", "onChange"])) : (vue.openBlock(), vue.createBlock(vue.unref(index$2.AppDatePicker), vue.mergeProps({
|
|
169
|
+
key: 1,
|
|
170
|
+
modelValue: bindValue.value,
|
|
171
|
+
"onUpdate:modelValue": ($event) => bindValue.value = $event,
|
|
172
|
+
"is-range": false,
|
|
173
|
+
style: { "width": "100%" },
|
|
174
|
+
timeRangeFill: __props.column.timeRangeFill
|
|
175
|
+
}, __props.column.attrs, {
|
|
176
|
+
disabled: vue.unref(index.isDisabled)(props, __props.column),
|
|
177
|
+
onChange: ($event) => onChangeHandler($event, __props.column)
|
|
178
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "timeRangeFill", "disabled", "onChange"]))
|
|
179
|
+
],
|
|
180
|
+
64
|
|
181
|
+
/* STABLE_FRAGMENT */
|
|
182
|
+
)) : __props.column.type === "org-cascader" ? (vue.openBlock(), vue.createElementBlock(
|
|
183
|
+
vue.Fragment,
|
|
184
|
+
{ key: 4 },
|
|
185
|
+
[
|
|
186
|
+
vue.createCommentVNode(" \u90E8\u95E8\u7EA7\u8054\u9009\u62E9\u6846 "),
|
|
187
|
+
vue.createVNode(vue.unref(index$3.AppOrgCascader), vue.mergeProps({
|
|
188
|
+
modelValue: bindValue.value,
|
|
189
|
+
"onUpdate:modelValue": ($event) => bindValue.value = $event
|
|
190
|
+
}, __props.column.attrs, {
|
|
191
|
+
disabled: vue.unref(index.isDisabled)(props, __props.column)
|
|
192
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])
|
|
193
|
+
],
|
|
194
|
+
2112
|
|
195
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
196
|
+
)) : vue.createCommentVNode("v-if", true)
|
|
197
|
+
],
|
|
198
|
+
6
|
|
199
|
+
/* CLASS, STYLE */
|
|
200
|
+
)
|
|
201
|
+
],
|
|
202
|
+
4
|
|
203
|
+
/* STYLE */
|
|
204
|
+
),
|
|
205
|
+
__props.column.type === "date-picker" && ["daterange", "datetimerange"].includes(__props.column.attrs?.type) && __props.column.timeRangeOptions?.length ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
206
|
+
key: 0,
|
|
207
|
+
class: "flex text-main select-none"
|
|
208
|
+
}, [
|
|
209
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
210
|
+
vue.Fragment,
|
|
211
|
+
null,
|
|
212
|
+
vue.renderList(__props.column.timeRangeOptions, (item, index$1) => {
|
|
213
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
214
|
+
key: index$1,
|
|
215
|
+
class: vue.normalizeClass(["border-l border-border px-[10px] cursor-pointer", {
|
|
216
|
+
"bg-[rgba(var(--hy-theme),0.2)] text-theme font-bold": vue.unref(index.isSelectedTimeRange)(__props.column, item, __props.model)
|
|
217
|
+
}]),
|
|
218
|
+
onClick: ($event) => onTimeRangeClickHandler(__props.column, item)
|
|
219
|
+
}, [
|
|
220
|
+
vue.createElementVNode(
|
|
221
|
+
"span",
|
|
222
|
+
null,
|
|
223
|
+
vue.toDisplayString(item.label),
|
|
224
|
+
1
|
|
225
|
+
/* TEXT */
|
|
226
|
+
)
|
|
227
|
+
], 10, ["onClick"]);
|
|
228
|
+
}),
|
|
229
|
+
128
|
|
230
|
+
/* KEYED_FRAGMENT */
|
|
231
|
+
))
|
|
232
|
+
])) : vue.createCommentVNode("v-if", true)
|
|
233
|
+
])
|
|
234
|
+
]),
|
|
235
|
+
_: 3
|
|
236
|
+
/* FORWARDED */
|
|
237
|
+
}, 8, ["prop"])) : vue.createCommentVNode("v-if", true);
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
exports.default = _sfc_main;
|
|
@@ -37,8 +37,11 @@ function columnShowHandler(props, column) {
|
|
|
37
37
|
return true;
|
|
38
38
|
}
|
|
39
39
|
function isDisabled(props, column) {
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
if (props.loading) return true;
|
|
41
|
+
const disabled = vue.unref(column.attrs?.disabled);
|
|
42
|
+
if (is.isBoolean(disabled)) return disabled;
|
|
43
|
+
if (is.isFunction(disabled)) return disabled(column, props.model);
|
|
44
|
+
return false;
|
|
42
45
|
}
|
|
43
46
|
function isEmptyValue(e) {
|
|
44
47
|
return is.isEmpty(e) || is.isArray(e) && !e.length;
|
|
@@ -47,17 +50,18 @@ function useShrink(props, templateRef) {
|
|
|
47
50
|
const { addResize, removeResize } = useResizeHandler.useResizeHandler();
|
|
48
51
|
const resizeExpandKey = /* @__PURE__ */ Symbol("appSearchExpand");
|
|
49
52
|
const isExpand = vue.ref(false);
|
|
53
|
+
const showShrink = vue.ref(true);
|
|
50
54
|
const containerHeight = vue.ref(getContainerPickUpHeight());
|
|
51
55
|
function getContainerPickUpHeight() {
|
|
52
56
|
switch (props.size) {
|
|
53
57
|
case "large":
|
|
54
|
-
return
|
|
58
|
+
return 43;
|
|
55
59
|
case "small":
|
|
56
|
-
return
|
|
60
|
+
return 27;
|
|
57
61
|
case "":
|
|
58
62
|
case "default":
|
|
59
63
|
default:
|
|
60
|
-
return
|
|
64
|
+
return 35;
|
|
61
65
|
}
|
|
62
66
|
}
|
|
63
67
|
function switchShrink() {
|
|
@@ -80,6 +84,7 @@ function useShrink(props, templateRef) {
|
|
|
80
84
|
);
|
|
81
85
|
return {
|
|
82
86
|
isExpand,
|
|
87
|
+
showShrink,
|
|
83
88
|
containerHeight,
|
|
84
89
|
switchShrink,
|
|
85
90
|
shrinkResizeHandler,
|
|
@@ -90,7 +95,8 @@ function useShrink(props, templateRef) {
|
|
|
90
95
|
}
|
|
91
96
|
function timeRangeHandler(column, options) {
|
|
92
97
|
const { value, unit } = options;
|
|
93
|
-
|
|
98
|
+
const { attrs } = column;
|
|
99
|
+
let { timeRangeFill } = attrs;
|
|
94
100
|
const format = "YYYY-MM-DD";
|
|
95
101
|
const date = dayjs(Date.now());
|
|
96
102
|
timeRangeFill = timeRangeFill || attrs.type === "datetimerange";
|
|
@@ -99,7 +105,7 @@ function timeRangeHandler(column, options) {
|
|
|
99
105
|
case "month":
|
|
100
106
|
return [
|
|
101
107
|
date.subtract(value, unit).format(`${format}${timeRangeFill ? " 00:00:00" : ""}`),
|
|
102
|
-
|
|
108
|
+
date.format(`${format}${timeRangeFill ? " 23:59:59" : ""}`)
|
|
103
109
|
];
|
|
104
110
|
case "day":
|
|
105
111
|
default:
|
|
@@ -120,6 +126,12 @@ function isSelectedTimeRange(column, options, model = {}) {
|
|
|
120
126
|
}
|
|
121
127
|
return start === model[field][0] && end === model[field][1];
|
|
122
128
|
}
|
|
129
|
+
function optionsHandler(props, column) {
|
|
130
|
+
const options = vue.unref(column.attrs.options);
|
|
131
|
+
if (is.isArray(options)) return options;
|
|
132
|
+
if (is.isFunction(options)) return options(column, props.model);
|
|
133
|
+
return [];
|
|
134
|
+
}
|
|
123
135
|
|
|
124
136
|
exports.columnItemInputStyle = columnItemInputStyle;
|
|
125
137
|
exports.columnItemStyle = columnItemStyle;
|
|
@@ -127,5 +139,6 @@ exports.columnShowHandler = columnShowHandler;
|
|
|
127
139
|
exports.isDisabled = isDisabled;
|
|
128
140
|
exports.isEmptyValue = isEmptyValue;
|
|
129
141
|
exports.isSelectedTimeRange = isSelectedTimeRange;
|
|
142
|
+
exports.optionsHandler = optionsHandler;
|
|
130
143
|
exports.timeRangeHandler = timeRangeHandler;
|
|
131
144
|
exports.useShrink = useShrink;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
4
|
var handler = require('../../../utils/handler.js');
|
|
5
|
+
var form = require('../../../utils/form.js');
|
|
5
6
|
var date = require('../../../utils/date.js');
|
|
6
7
|
var useLocale = require('../../../hooks/useLocale.js');
|
|
7
8
|
var is = require('../../../utils/is.js');
|
|
@@ -26,7 +27,7 @@ const genPlaceholderHandler = (config) => {
|
|
|
26
27
|
placeholder = placeholder || t("hy.pleaseSelectPlaceholder", [label]);
|
|
27
28
|
case "date-picker":
|
|
28
29
|
if (["datetimerange", "daterange", "monthrange", "yearrange"].includes(
|
|
29
|
-
attrs
|
|
30
|
+
attrs?.type
|
|
30
31
|
)) {
|
|
31
32
|
switch (attrs.type) {
|
|
32
33
|
case "yearrange":
|
|
@@ -59,7 +60,7 @@ const genColumnWidth = (config) => {
|
|
|
59
60
|
let inputWidth;
|
|
60
61
|
if (!width) {
|
|
61
62
|
if (type === "date-picker") {
|
|
62
|
-
switch (attrs
|
|
63
|
+
switch (attrs?.type) {
|
|
63
64
|
case "datetimerange":
|
|
64
65
|
inputWidth = 390;
|
|
65
66
|
break;
|
|
@@ -81,7 +82,7 @@ const genColumnWidth = (config) => {
|
|
|
81
82
|
const timeRangeOptionsHandler = (config) => {
|
|
82
83
|
const { t } = useLocale.useLocale();
|
|
83
84
|
const { timeRangeOptions } = config || {};
|
|
84
|
-
if (!
|
|
85
|
+
if (!timeRangeOptions?.length) return timeRangeOptions;
|
|
85
86
|
return timeRangeOptions.reduce((list, item) => {
|
|
86
87
|
let { value, label, unit } = item;
|
|
87
88
|
if (!value || !is.isNumber(value) || isNaN(value)) return list;
|
|
@@ -166,10 +167,14 @@ const resetAppSearchValue = (columns = [], obj = {}) => {
|
|
|
166
167
|
const value = handler.funRunHandler(item.defaultValue);
|
|
167
168
|
if (Array.isArray(item.prop)) {
|
|
168
169
|
for (let i = 0; i < item.prop.length; i++) {
|
|
169
|
-
|
|
170
|
+
form.genValueByProp(
|
|
171
|
+
obj,
|
|
172
|
+
item.prop[i],
|
|
173
|
+
Array.isArray(value) ? value[i] : void 0
|
|
174
|
+
);
|
|
170
175
|
}
|
|
171
176
|
} else {
|
|
172
|
-
obj
|
|
177
|
+
form.genValueByProp(obj, item.prop, value);
|
|
173
178
|
}
|
|
174
179
|
}
|
|
175
180
|
return obj;
|
|
@@ -49,11 +49,21 @@
|
|
|
49
49
|
--el-input-text-color: rgb(var(--hy-main));
|
|
50
50
|
--el-input-border-radius: 0px 4px 4px 0px;
|
|
51
51
|
--el-input-hover-border-color: rgb(var(--hy-theme));
|
|
52
|
+
.hy-el-input__wrapper,
|
|
53
|
+
&.hy-el-input__wrapper {
|
|
54
|
+
box-shadow: none !important;
|
|
55
|
+
}
|
|
52
56
|
}
|
|
53
57
|
.hy-el-select {
|
|
54
58
|
--el-border-color: transparent;
|
|
55
59
|
--el-fill-color-blank: transparent;
|
|
56
60
|
--el-border-radius-base: 0px 4px 4px 0px;
|
|
57
61
|
--el-border-color-hover: rgb(var(--hy-theme));
|
|
62
|
+
.hy-el-select__wrapper {
|
|
63
|
+
box-shadow: none !important;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
.app-search-custom-wrapper {
|
|
67
|
+
min-height: var(--hy-el-component-size);
|
|
58
68
|
}
|
|
59
69
|
}
|