hy-dispatch-ui-v3 0.1.2 → 0.1.4
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/dist/tailwind.css +28 -0
- package/es/components/appButton/appButton.vue.mjs +4 -4
- package/es/components/appButton/style/appButton.scss +4 -4
- package/es/components/appForm/appForm.vue.mjs +17 -3
- package/es/components/appForm/js/useAppForm.mjs +15 -1
- package/es/components/appIcon/style/appIcon.scss +2 -2
- package/es/components/appNoPermissions/appNoPermissions.vue.mjs +48 -0
- package/es/components/appNoPermissions/index.mjs +6 -0
- package/es/components/appNoPermissions/style/appNoPermissions.scss +0 -0
- package/es/components/appNoPermissionsMap/appNoPermissionsMap.vue.mjs +50 -0
- package/es/components/appNoPermissionsMap/index.mjs +6 -0
- package/es/components/appNoPermissionsMap/style/appNoPermissionsMap.scss +0 -0
- package/es/components/appOrgCascader/appOrgCascader.vue.mjs +1 -1
- package/es/components/appSearch/appSearch.vue.mjs +22 -6
- package/es/components/appSearch/js/index.mjs +12 -3
- package/es/components/appSearch/js/useAppSearch.mjs +12 -1
- package/es/components/appTable/appTable.vue.mjs +55 -20
- package/es/components/appTable/js/index.mjs +21 -6
- package/es/components/appTable/js/search.mjs +9 -21
- package/es/components/appTable/js/useAppTable.mjs +27 -2
- package/es/components/index.mjs +2 -0
- package/es/index.mjs +2 -0
- package/es/locale/en.mjs +9 -0
- package/es/locale/zh_CN.mjs +10 -1
- package/es/style/index.scss +0 -2
- package/es/version.mjs +1 -1
- package/lib/components/appButton/appButton.vue.js +4 -4
- package/lib/components/appButton/style/appButton.scss +4 -4
- package/lib/components/appForm/appForm.vue.js +17 -3
- package/lib/components/appForm/js/useAppForm.js +15 -1
- package/lib/components/appIcon/style/appIcon.scss +2 -2
- package/lib/components/appNoPermissions/appNoPermissions.vue.js +52 -0
- package/lib/components/appNoPermissions/index.js +11 -0
- package/lib/components/appNoPermissions/style/appNoPermissions.scss +0 -0
- package/lib/components/appNoPermissionsMap/appNoPermissionsMap.vue.js +54 -0
- package/lib/components/appNoPermissionsMap/index.js +11 -0
- package/lib/components/appNoPermissionsMap/style/appNoPermissionsMap.scss +0 -0
- package/lib/components/appOrgCascader/appOrgCascader.vue.js +1 -1
- package/lib/components/appSearch/appSearch.vue.js +23 -7
- package/lib/components/appSearch/js/index.js +12 -2
- package/lib/components/appSearch/js/useAppSearch.js +12 -1
- package/lib/components/appTable/appTable.vue.js +76 -41
- package/lib/components/appTable/js/index.js +21 -6
- package/lib/components/appTable/js/search.js +9 -21
- package/lib/components/appTable/js/useAppTable.js +27 -2
- package/lib/components/index.js +14 -10
- package/lib/index.js +14 -10
- package/lib/locale/en.js +9 -0
- package/lib/locale/zh_CN.js +10 -1
- package/lib/style/index.scss +0 -2
- package/lib/version.js +1 -1
- package/package.json +11 -1
package/dist/tailwind.css
CHANGED
|
@@ -680,6 +680,10 @@ video {
|
|
|
680
680
|
margin-top: 10px;
|
|
681
681
|
}
|
|
682
682
|
|
|
683
|
+
.mt-\[12px\] {
|
|
684
|
+
margin-top: 12px;
|
|
685
|
+
}
|
|
686
|
+
|
|
683
687
|
.box-border {
|
|
684
688
|
box-sizing: border-box;
|
|
685
689
|
}
|
|
@@ -712,10 +716,22 @@ video {
|
|
|
712
716
|
height: 0.75rem !important;
|
|
713
717
|
}
|
|
714
718
|
|
|
719
|
+
.\!h-\[46px\] {
|
|
720
|
+
height: 46px !important;
|
|
721
|
+
}
|
|
722
|
+
|
|
715
723
|
.h-0 {
|
|
716
724
|
height: 0px;
|
|
717
725
|
}
|
|
718
726
|
|
|
727
|
+
.h-\[12px\] {
|
|
728
|
+
height: 12px;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
.h-\[32px\] {
|
|
732
|
+
height: 32px;
|
|
733
|
+
}
|
|
734
|
+
|
|
719
735
|
.h-\[364px\] {
|
|
720
736
|
height: 364px;
|
|
721
737
|
}
|
|
@@ -748,6 +764,10 @@ video {
|
|
|
748
764
|
width: 0.75rem !important;
|
|
749
765
|
}
|
|
750
766
|
|
|
767
|
+
.\!w-\[46px\] {
|
|
768
|
+
width: 46px !important;
|
|
769
|
+
}
|
|
770
|
+
|
|
751
771
|
.w-0 {
|
|
752
772
|
width: 0px;
|
|
753
773
|
}
|
|
@@ -756,6 +776,10 @@ video {
|
|
|
756
776
|
width: 1.25rem;
|
|
757
777
|
}
|
|
758
778
|
|
|
779
|
+
.w-\[12px\] {
|
|
780
|
+
width: 12px;
|
|
781
|
+
}
|
|
782
|
+
|
|
759
783
|
.w-\[160px\] {
|
|
760
784
|
width: 160px;
|
|
761
785
|
}
|
|
@@ -949,6 +973,10 @@ video {
|
|
|
949
973
|
background-color: rgb(var(--hy-background), var(--tw-bg-opacity, 1)) !important;
|
|
950
974
|
}
|
|
951
975
|
|
|
976
|
+
.bg-\[rgba\(var\(--hy-theme\)\2c 0\.2\)\] {
|
|
977
|
+
background-color: rgba(var(--hy-theme),0.2);
|
|
978
|
+
}
|
|
979
|
+
|
|
952
980
|
.bg-background-2 {
|
|
953
981
|
--tw-bg-opacity: 1;
|
|
954
982
|
background-color: rgb(var(--hy-background-2), var(--tw-bg-opacity, 1));
|
|
@@ -38,10 +38,10 @@ const _sfc_main = {
|
|
|
38
38
|
setup(__props, { emit: __emit }) {
|
|
39
39
|
const props = __props;
|
|
40
40
|
const typeObj = {
|
|
41
|
-
default: "button_default",
|
|
42
|
-
primary: "button_function",
|
|
43
|
-
success: "button_addTo",
|
|
44
|
-
danger: "button_delete"
|
|
41
|
+
default: "hy-button_default",
|
|
42
|
+
primary: "hy-button_function",
|
|
43
|
+
success: "hy-button_addTo",
|
|
44
|
+
danger: "hy-button_delete"
|
|
45
45
|
};
|
|
46
46
|
const emit = __emit;
|
|
47
47
|
const handleClick = (event) => {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
.button_default {
|
|
35
|
+
.hy-button_default {
|
|
36
36
|
background: rgba(94, 157, 180, 0.32);
|
|
37
37
|
|
|
38
38
|
.hy-button__border {
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
.button_function {
|
|
99
|
+
.hy-button_function {
|
|
100
100
|
background: rgba(45, 242, 255, 0.32);
|
|
101
101
|
|
|
102
102
|
.hy-button__border {
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
.button_addTo {
|
|
163
|
+
.hy-button_addTo {
|
|
164
164
|
background: rgba(44, 232, 152, 0.32);
|
|
165
165
|
|
|
166
166
|
.hy-button__border {
|
|
@@ -224,7 +224,7 @@
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
.button_delete {
|
|
227
|
+
.hy-button_delete {
|
|
228
228
|
background: rgba(255, 77, 77, 0.32);
|
|
229
229
|
|
|
230
230
|
.hy-button__border {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { defineComponent, useTemplateRef, computed, nextTick, unref, openBlock, createBlock, mergeProps, withCtx, createElementVNode, normalizeStyle, createCommentVNode, createElementBlock, Fragment, renderList, renderSlot, toDisplayString, createVNode, createTextVNode } from 'vue';
|
|
2
2
|
import { ElForm, ElFormItem, ElPopover, ElInput, ElSelect, ElRadioGroup, ElCheckboxGroup } from 'element-plus';
|
|
3
3
|
import { AppIcon } from '../appIcon/index.mjs';
|
|
4
|
-
import
|
|
4
|
+
import { AppDatePicker } from '../appDatePicker/index.mjs';
|
|
5
|
+
import { AppOrgCascader } from '../appOrgCascader/index.mjs';
|
|
5
6
|
import { columnShowHandler, columnItemStyle, isRequired, renderText, isDisabled } from './js/index.mjs';
|
|
6
7
|
import { resetAppFormValue } from './js/useAppForm.mjs';
|
|
7
8
|
import { useLocale } from '../../hooks/useLocale.mjs';
|
|
@@ -247,7 +248,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
247
248
|
"daterange",
|
|
248
249
|
"monthrange",
|
|
249
250
|
"yearrange"
|
|
250
|
-
].includes((_a = column.attrs) == null ? void 0 : _a.type) && unref(isArray)(column.field) ? (openBlock(), createBlock(
|
|
251
|
+
].includes((_a = column.attrs) == null ? void 0 : _a.type) && unref(isArray)(column.field) ? (openBlock(), createBlock(unref(AppDatePicker), mergeProps({
|
|
251
252
|
key: 0,
|
|
252
253
|
start: __props.model[column.field[0]],
|
|
253
254
|
"onUpdate:start": ($event) => __props.model[column.field[0]] = $event,
|
|
@@ -257,7 +258,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
257
258
|
style: { "width": "100%" }
|
|
258
259
|
}, { ref_for: true }, column.attrs, {
|
|
259
260
|
disabled: unref(isDisabled)(props, column)
|
|
260
|
-
}), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "disabled"])) : (openBlock(), createBlock(
|
|
261
|
+
}), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "disabled"])) : (openBlock(), createBlock(unref(AppDatePicker), mergeProps({
|
|
261
262
|
key: 1,
|
|
262
263
|
modelValue: __props.model[column.field],
|
|
263
264
|
"onUpdate:modelValue": ($event) => __props.model[column.field] = $event,
|
|
@@ -295,6 +296,19 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
295
296
|
],
|
|
296
297
|
2112
|
|
297
298
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
299
|
+
)) : column.type === "org-cascader" ? (openBlock(), createElementBlock(
|
|
300
|
+
Fragment,
|
|
301
|
+
{ key: 6 },
|
|
302
|
+
[
|
|
303
|
+
createCommentVNode(" \u90E8\u95E8\u7EA7\u8054\u9009\u62E9\u6846 "),
|
|
304
|
+
createVNode(unref(AppOrgCascader), mergeProps({
|
|
305
|
+
modelValue: __props.model[column.field],
|
|
306
|
+
"onUpdate:modelValue": ($event) => __props.model[column.field] = $event,
|
|
307
|
+
disabled: unref(isDisabled)(props, column)
|
|
308
|
+
}, { ref_for: true }, column.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])
|
|
309
|
+
],
|
|
310
|
+
2112
|
|
311
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
298
312
|
)) : createCommentVNode("v-if", true)
|
|
299
313
|
],
|
|
300
314
|
64
|
|
@@ -4,6 +4,15 @@ import { getDefaultValueFormatByType } from '../../../utils/date.mjs';
|
|
|
4
4
|
import { useLocale } from '../../../hooks/useLocale.mjs';
|
|
5
5
|
import { isArray } from '../../../utils/is.mjs';
|
|
6
6
|
|
|
7
|
+
const genDefaultLabel = (config) => {
|
|
8
|
+
if (config.label) return config.label;
|
|
9
|
+
const { t } = useLocale();
|
|
10
|
+
switch (config.type) {
|
|
11
|
+
// 部门级联选择框
|
|
12
|
+
case "org-cascader":
|
|
13
|
+
return t("form.department");
|
|
14
|
+
}
|
|
15
|
+
};
|
|
7
16
|
const genPlaceholderHandler = (config) => {
|
|
8
17
|
const { t } = useLocale();
|
|
9
18
|
const { type, label, attrs = {} } = config || {};
|
|
@@ -11,8 +20,10 @@ const genPlaceholderHandler = (config) => {
|
|
|
11
20
|
switch (type) {
|
|
12
21
|
case "input":
|
|
13
22
|
placeholder = placeholder || t("hy.pleaseEnterPlaceholder", [label]);
|
|
23
|
+
break;
|
|
14
24
|
case "select":
|
|
15
25
|
placeholder = placeholder || t("hy.pleaseSelectPlaceholder", [label]);
|
|
26
|
+
break;
|
|
16
27
|
case "date-picker":
|
|
17
28
|
if (["datetimerange", "daterange", "monthrange", "yearrange"].includes(
|
|
18
29
|
attrs == null ? void 0 : attrs.type
|
|
@@ -38,6 +49,7 @@ const genPlaceholderHandler = (config) => {
|
|
|
38
49
|
} else {
|
|
39
50
|
placeholder = placeholder || t("hy.pleaseSelectPlaceholder", [label]);
|
|
40
51
|
}
|
|
52
|
+
break;
|
|
41
53
|
default:
|
|
42
54
|
placeholder = placeholder || label;
|
|
43
55
|
}
|
|
@@ -72,13 +84,15 @@ const rulesHandler = (config) => {
|
|
|
72
84
|
return rules;
|
|
73
85
|
};
|
|
74
86
|
function appFormItemHandler(column = {}) {
|
|
75
|
-
const
|
|
87
|
+
const label = genDefaultLabel(column);
|
|
88
|
+
const { placeholder, startPlaceholder, endPlaceholder } = genPlaceholderHandler({ ...column, label });
|
|
76
89
|
const attrs = { ...column.attrs || {}, placeholder };
|
|
77
90
|
column = mergeDeep(
|
|
78
91
|
{ ...column },
|
|
79
92
|
{
|
|
80
93
|
key: /* @__PURE__ */ Symbol("appFormItemKey"),
|
|
81
94
|
field: column.prop,
|
|
95
|
+
label,
|
|
82
96
|
readonly: column.readonly || false,
|
|
83
97
|
rules: rulesHandler(column)
|
|
84
98
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createVNode, unref, createElementVNode, toDisplayString } from 'vue';
|
|
2
|
+
import { AppIcon } from '../appIcon/index.mjs';
|
|
3
|
+
import { useLocale } from '../../hooks/useLocale.mjs';
|
|
4
|
+
|
|
5
|
+
import "./style/appNoPermissions.scss";
|
|
6
|
+
|
|
7
|
+
const __default__ = defineComponent({
|
|
8
|
+
name: "AppNoPermissions"
|
|
9
|
+
});
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
11
|
+
props: {
|
|
12
|
+
svgName: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: "2-v3-base-no-data-noData"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
emits: [],
|
|
18
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
19
|
+
const { t } = useLocale();
|
|
20
|
+
__expose({});
|
|
21
|
+
return (_ctx, _cache) => {
|
|
22
|
+
return openBlock(), createElementBlock("div", { class: "w-full h-full bg-background-2 text-auxiliary text-base flex flex-col items-center justify-center" }, [
|
|
23
|
+
createVNode(unref(AppIcon), {
|
|
24
|
+
"svg-name": __props.svgName,
|
|
25
|
+
"class-name": "!w-[46px] !h-[46px]"
|
|
26
|
+
}, null, 8, ["svg-name"]),
|
|
27
|
+
createElementVNode("div", { class: "text-center mt-[12px]" }, [
|
|
28
|
+
createElementVNode(
|
|
29
|
+
"p",
|
|
30
|
+
null,
|
|
31
|
+
toDisplayString(unref(t)("permissino.youDoNotHaveSubordinatePermissionsForThisModule")),
|
|
32
|
+
1
|
|
33
|
+
/* TEXT */
|
|
34
|
+
),
|
|
35
|
+
createElementVNode(
|
|
36
|
+
"p",
|
|
37
|
+
null,
|
|
38
|
+
toDisplayString(unref(t)("permissino.pleaseContactTheAdministrator")),
|
|
39
|
+
1
|
|
40
|
+
/* TEXT */
|
|
41
|
+
)
|
|
42
|
+
])
|
|
43
|
+
]);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export { _sfc_main as default };
|
|
File without changes
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createVNode, unref, createElementVNode, toDisplayString } from 'vue';
|
|
2
|
+
import { AppIcon } from '../appIcon/index.mjs';
|
|
3
|
+
import { useLocale } from '../../hooks/useLocale.mjs';
|
|
4
|
+
|
|
5
|
+
import "./style/appNoPermissionsMap.scss";
|
|
6
|
+
|
|
7
|
+
const __default__ = defineComponent({
|
|
8
|
+
name: "AppNoPermissionsMap"
|
|
9
|
+
});
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
11
|
+
props: {
|
|
12
|
+
svgName: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: "2-v3-base-no-data-noData"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
emits: [],
|
|
18
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
19
|
+
const { t } = useLocale();
|
|
20
|
+
__expose({});
|
|
21
|
+
return (_ctx, _cache) => {
|
|
22
|
+
return openBlock(), createElementBlock("div", { class: "w-full h-full bg-background-2 text-auxiliary text-base flex flex-col items-center justify-center" }, [
|
|
23
|
+
createVNode(unref(AppIcon), {
|
|
24
|
+
"svg-name": __props.svgName,
|
|
25
|
+
"class-name": "!w-[46px] !h-[46px]"
|
|
26
|
+
}, null, 8, ["svg-name"]),
|
|
27
|
+
createElementVNode("div", { class: "text-center mt-[12px]" }, [
|
|
28
|
+
createElementVNode(
|
|
29
|
+
"p",
|
|
30
|
+
null,
|
|
31
|
+
toDisplayString(unref(t)("permissino.youDoNotHaveAMapConfigurationForThisModule")),
|
|
32
|
+
1
|
|
33
|
+
/* TEXT */
|
|
34
|
+
),
|
|
35
|
+
createElementVNode(
|
|
36
|
+
"p",
|
|
37
|
+
null,
|
|
38
|
+
toDisplayString(unref(t)(
|
|
39
|
+
"permissino.pleaseContactTheAdministratorToGoToTheSettingsCenterForConfiguration"
|
|
40
|
+
)),
|
|
41
|
+
1
|
|
42
|
+
/* TEXT */
|
|
43
|
+
)
|
|
44
|
+
])
|
|
45
|
+
]);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export { _sfc_main as default };
|
|
File without changes
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { defineComponent, useTemplateRef, computed, unref, onUnmounted, openBlock, createElementBlock, normalizeClass, createElementVNode, createVNode, withCtx, toDisplayString, Fragment, createCommentVNode, normalizeStyle, mergeProps, renderList, createBlock, renderSlot, withKeys } from 'vue';
|
|
2
2
|
import { ElIcon, ElForm, ElFormItem, ElInput, ElSelect } from 'element-plus';
|
|
3
3
|
import { Filter, ArrowDown } from '@element-plus/icons-vue';
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import { AppDatePicker } from '../appDatePicker/index.mjs';
|
|
5
|
+
import { AppOrgCascader } from '../appOrgCascader/index.mjs';
|
|
6
|
+
import { useShrink, isEmptyValue, columnShowHandler, columnItemStyle, columnItemInputStyle, isDisabled, isSelectedTimeRange, timeRangeHandler } from './js/index.mjs';
|
|
6
7
|
import { resetAppSearchValue } from './js/useAppSearch.mjs';
|
|
7
8
|
import { useLocale } from '../../hooks/useLocale.mjs';
|
|
8
9
|
import { isArray } from '../../utils/is.mjs';
|
|
@@ -310,7 +311,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
310
311
|
"daterange",
|
|
311
312
|
"monthrange",
|
|
312
313
|
"yearrange"
|
|
313
|
-
].includes((_a = column.attrs) == null ? void 0 : _a.type) && unref(isArray)(column.field) ? (openBlock(), createBlock(
|
|
314
|
+
].includes((_a = column.attrs) == null ? void 0 : _a.type) && unref(isArray)(column.field) ? (openBlock(), createBlock(unref(AppDatePicker), mergeProps({
|
|
314
315
|
key: 0,
|
|
315
316
|
start: __props.model[column.field[0]],
|
|
316
317
|
"onUpdate:start": ($event) => __props.model[column.field[0]] = $event,
|
|
@@ -322,7 +323,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
322
323
|
disabled: unref(isDisabled)(props, column),
|
|
323
324
|
timeRangeFill: column.timeRangeFill,
|
|
324
325
|
onChange: ($event) => onChangeHandler($event, column)
|
|
325
|
-
}), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "disabled", "timeRangeFill", "onChange"])) : (openBlock(), createBlock(
|
|
326
|
+
}), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "disabled", "timeRangeFill", "onChange"])) : (openBlock(), createBlock(unref(AppDatePicker), mergeProps({
|
|
326
327
|
key: 1,
|
|
327
328
|
modelValue: __props.model[column.field],
|
|
328
329
|
"onUpdate:modelValue": ($event) => __props.model[column.field] = $event,
|
|
@@ -336,6 +337,19 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
336
337
|
],
|
|
337
338
|
64
|
|
338
339
|
/* STABLE_FRAGMENT */
|
|
340
|
+
)) : column.type === "org-cascader" ? (openBlock(), createElementBlock(
|
|
341
|
+
Fragment,
|
|
342
|
+
{ key: 4 },
|
|
343
|
+
[
|
|
344
|
+
createCommentVNode(" \u90E8\u95E8\u7EA7\u8054\u9009\u62E9\u6846 "),
|
|
345
|
+
createVNode(unref(AppOrgCascader), mergeProps({
|
|
346
|
+
modelValue: __props.model[column.field],
|
|
347
|
+
"onUpdate:modelValue": ($event) => __props.model[column.field] = $event,
|
|
348
|
+
disabled: unref(isDisabled)(props, column)
|
|
349
|
+
}, { ref_for: true }, column.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])
|
|
350
|
+
],
|
|
351
|
+
2112
|
|
352
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
339
353
|
)) : createCommentVNode("v-if", true)
|
|
340
354
|
],
|
|
341
355
|
4
|
|
@@ -355,7 +369,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
355
369
|
renderList(column.timeRangeOptions, (item, index) => {
|
|
356
370
|
return openBlock(), createElementBlock("div", {
|
|
357
371
|
key: index,
|
|
358
|
-
class: "border-l border-border px-[10px] cursor-pointer",
|
|
372
|
+
class: normalizeClass(["border-l border-border px-[10px] cursor-pointer", {
|
|
373
|
+
"bg-[rgba(var(--hy-theme),0.2)] text-theme font-bold": unref(isSelectedTimeRange)(column, item, __props.model)
|
|
374
|
+
}]),
|
|
359
375
|
onClick: ($event) => onTimeRangeClickHandler(column, item)
|
|
360
376
|
}, [
|
|
361
377
|
createElementVNode(
|
|
@@ -365,7 +381,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
365
381
|
1
|
|
366
382
|
/* TEXT */
|
|
367
383
|
)
|
|
368
|
-
],
|
|
384
|
+
], 10, ["onClick"]);
|
|
369
385
|
}),
|
|
370
386
|
128
|
|
371
387
|
/* KEYED_FRAGMENT */
|
|
@@ -88,9 +88,10 @@ function useShrink(props, templateRef) {
|
|
|
88
88
|
}
|
|
89
89
|
function timeRangeHandler(column, options) {
|
|
90
90
|
const { value, unit } = options;
|
|
91
|
-
|
|
92
|
-
const format =
|
|
91
|
+
let { timeRangeFill, attrs } = column;
|
|
92
|
+
const format = "YYYY-MM-DD";
|
|
93
93
|
const date = dayjs(Date.now());
|
|
94
|
+
timeRangeFill = timeRangeFill || attrs.type === "datetimerange";
|
|
94
95
|
switch (unit) {
|
|
95
96
|
case "year":
|
|
96
97
|
case "month":
|
|
@@ -109,5 +110,13 @@ function timeRangeHandler(column, options) {
|
|
|
109
110
|
];
|
|
110
111
|
}
|
|
111
112
|
}
|
|
113
|
+
function isSelectedTimeRange(column, options, model = {}) {
|
|
114
|
+
const [start, end] = timeRangeHandler(column, options);
|
|
115
|
+
const { field } = column;
|
|
116
|
+
if (Array.isArray(field)) {
|
|
117
|
+
return start === model[field[0]] && end === model[field[1]];
|
|
118
|
+
}
|
|
119
|
+
return start === model[field][0] && end === model[field][1];
|
|
120
|
+
}
|
|
112
121
|
|
|
113
|
-
export { columnItemInputStyle, columnItemStyle, columnShowHandler, isDisabled, isEmptyValue, timeRangeHandler, useShrink };
|
|
122
|
+
export { columnItemInputStyle, columnItemStyle, columnShowHandler, isDisabled, isEmptyValue, isSelectedTimeRange, timeRangeHandler, useShrink };
|
|
@@ -4,6 +4,15 @@ import { getDefaultValueFormatByType } from '../../../utils/date.mjs';
|
|
|
4
4
|
import { useLocale } from '../../../hooks/useLocale.mjs';
|
|
5
5
|
import { isNumber } from '../../../utils/is.mjs';
|
|
6
6
|
|
|
7
|
+
const genDefaultLabel = (config) => {
|
|
8
|
+
if (config.label) return config.label;
|
|
9
|
+
const { t } = useLocale();
|
|
10
|
+
switch (config.type) {
|
|
11
|
+
// 部门级联选择框
|
|
12
|
+
case "org-cascader":
|
|
13
|
+
return t("form.department");
|
|
14
|
+
}
|
|
15
|
+
};
|
|
7
16
|
const genPlaceholderHandler = (config) => {
|
|
8
17
|
const { t } = useLocale();
|
|
9
18
|
const { type, label, attrs = {} } = config || {};
|
|
@@ -94,7 +103,8 @@ const timeRangeOptionsHandler = (config) => {
|
|
|
94
103
|
}, []);
|
|
95
104
|
};
|
|
96
105
|
function appSearchItemHandler(column = {}) {
|
|
97
|
-
const
|
|
106
|
+
const label = genDefaultLabel(column);
|
|
107
|
+
const { placeholder, startPlaceholder, endPlaceholder } = genPlaceholderHandler({ ...column, label });
|
|
98
108
|
const attrs = {
|
|
99
109
|
clearable: true,
|
|
100
110
|
...column.attrs || {},
|
|
@@ -106,6 +116,7 @@ function appSearchItemHandler(column = {}) {
|
|
|
106
116
|
{
|
|
107
117
|
key: /* @__PURE__ */ Symbol("appFormItemKey"),
|
|
108
118
|
field: column.prop,
|
|
119
|
+
label,
|
|
109
120
|
readonly: column.readonly || false,
|
|
110
121
|
width,
|
|
111
122
|
inputWidth,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, useTemplateRef, openBlock, createElementBlock, createCommentVNode, createElementVNode, createBlock, unref, createVNode, withCtx, toDisplayString, withKeys, renderSlot, normalizeClass, mergeProps, Fragment,
|
|
1
|
+
import { defineComponent, useTemplateRef, resolveComponent, openBlock, createElementBlock, createCommentVNode, createElementVNode, createBlock, unref, createVNode, withCtx, toDisplayString, withKeys, renderSlot, normalizeClass, createSlots, renderList, normalizeProps, guardReactiveProps, mergeProps, Fragment, withModifiers } from 'vue';
|
|
2
2
|
import { ElIcon, ElInput, ElButton, ElTable, ElTableColumn, ElDropdown, ElDropdownMenu, ElDropdownItem, ElPagination } from 'element-plus';
|
|
3
3
|
import { Filter, Search } from '@element-plus/icons-vue';
|
|
4
4
|
import { AppTooltip } from '../appTooltip/index.mjs';
|
|
@@ -6,6 +6,7 @@ import { operatorFilterHandler, operatorClickHandler, operatorDisabledHandler, o
|
|
|
6
6
|
import { useAppTableSearch } from './js/search.mjs';
|
|
7
7
|
import _sfc_main$1 from './cpns/columnSelect.vue.mjs';
|
|
8
8
|
import { useMixins } from '../../hooks/useMixins.mjs';
|
|
9
|
+
import { AppButton } from '../appButton/index.mjs';
|
|
9
10
|
import { AppSearch } from '../appSearch/index.mjs';
|
|
10
11
|
import { parseRem } from '../../utils/adaptive.mjs';
|
|
11
12
|
import { AppIconBox } from '../appIconBox/index.mjs';
|
|
@@ -89,6 +90,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
89
90
|
default: "",
|
|
90
91
|
required: false
|
|
91
92
|
},
|
|
93
|
+
filterModel: {
|
|
94
|
+
type: Object,
|
|
95
|
+
default: () => ({})
|
|
96
|
+
},
|
|
92
97
|
filterColumns: {
|
|
93
98
|
// 表格筛选配置
|
|
94
99
|
type: Array,
|
|
@@ -170,13 +175,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
170
175
|
tableTriggerRef,
|
|
171
176
|
getSelectedList,
|
|
172
177
|
setTableRowClassName,
|
|
178
|
+
clearSelection,
|
|
179
|
+
clearSelectedList,
|
|
173
180
|
onTableRowClickHandler,
|
|
174
181
|
onTableRowContextmenuHandler,
|
|
175
|
-
|
|
182
|
+
onTableSelectHandler,
|
|
176
183
|
// useAppTableSearch
|
|
177
184
|
// 表单查询
|
|
178
|
-
formModel,
|
|
179
|
-
formColumns,
|
|
180
185
|
totalElements,
|
|
181
186
|
showFilter,
|
|
182
187
|
getData,
|
|
@@ -209,9 +214,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
209
214
|
resetFn,
|
|
210
215
|
getSelectedList,
|
|
211
216
|
getTotalElements,
|
|
212
|
-
getTableDataSource
|
|
217
|
+
getTableDataSource,
|
|
218
|
+
clearSelection,
|
|
219
|
+
clearSelectedList
|
|
213
220
|
});
|
|
214
221
|
return (_ctx, _cache) => {
|
|
222
|
+
const _component_AppIcon = resolveComponent("AppIcon");
|
|
215
223
|
return openBlock(), createElementBlock(
|
|
216
224
|
"div",
|
|
217
225
|
{
|
|
@@ -230,9 +238,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
230
238
|
"origin-columns": props.tableColumns,
|
|
231
239
|
onConfirm: unref(onTableColumnsSelectHandler)
|
|
232
240
|
}, null, 8, ["columns", "columns-editable", "origin-columns", "onConfirm"])) : createCommentVNode("v-if", true),
|
|
233
|
-
|
|
241
|
+
__props.filterColumns.length > 0 ? (openBlock(), createElementBlock("div", {
|
|
234
242
|
key: 1,
|
|
235
|
-
class: "flex items-center gap-[10px] clickBox px-3 select-none rounded hover:bg-background-2",
|
|
243
|
+
class: "h-[32px] flex items-center gap-[10px] clickBox px-3 select-none rounded hover:bg-background-2",
|
|
236
244
|
onClick: unref(switchShowFilter)
|
|
237
245
|
}, [
|
|
238
246
|
createVNode(unref(ElIcon), { size: "12" }, {
|
|
@@ -252,8 +260,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
252
260
|
], 8, ["onClick"])) : createCommentVNode("v-if", true),
|
|
253
261
|
unref(searchPlaceholder) ? (openBlock(), createBlock(unref(ElInput), {
|
|
254
262
|
key: 2,
|
|
255
|
-
modelValue:
|
|
256
|
-
"onUpdate:modelValue": ($event) =>
|
|
263
|
+
modelValue: __props.filterModel.query,
|
|
264
|
+
"onUpdate:modelValue": ($event) => __props.filterModel.query = $event,
|
|
257
265
|
class: "w-[160px]",
|
|
258
266
|
placeholder: unref(t)("table.searchFor", [unref(searchPlaceholder)]),
|
|
259
267
|
onKeydown: withKeys(unref(onSearchQueryHandler), ["enter"])
|
|
@@ -266,7 +274,21 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
266
274
|
]),
|
|
267
275
|
_: 1
|
|
268
276
|
/* STABLE */
|
|
269
|
-
}, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onKeydown"])) :
|
|
277
|
+
}, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onKeydown"])) : (openBlock(), createBlock(unref(AppButton), {
|
|
278
|
+
key: 3,
|
|
279
|
+
type: "primary",
|
|
280
|
+
onClick: ($event) => unref(getData)()
|
|
281
|
+
}, {
|
|
282
|
+
default: withCtx(() => [
|
|
283
|
+
createVNode(_component_AppIcon, {
|
|
284
|
+
class: "w-[12px] h-[12px]",
|
|
285
|
+
"svg-name": "refres"
|
|
286
|
+
})
|
|
287
|
+
]),
|
|
288
|
+
_: 1
|
|
289
|
+
/* STABLE */
|
|
290
|
+
}, 8, ["onClick"])),
|
|
291
|
+
renderSlot(_ctx.$slots, "operator-right-box")
|
|
270
292
|
]),
|
|
271
293
|
_ctx.$slots["operator-left-box"] ? (openBlock(), createElementBlock("div", {
|
|
272
294
|
key: 0,
|
|
@@ -276,16 +298,28 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
276
298
|
])) : createCommentVNode("v-if", true)
|
|
277
299
|
]),
|
|
278
300
|
createCommentVNode(" \u67E5\u8BE2\u8FC7\u6EE4 "),
|
|
279
|
-
|
|
301
|
+
__props.filterColumns.length > 0 ? (openBlock(), createBlock(unref(AppSearch), {
|
|
280
302
|
key: 0,
|
|
281
303
|
ref_key: "appSearchRef",
|
|
282
304
|
ref: appSearchRef,
|
|
283
|
-
model:
|
|
284
|
-
columns:
|
|
305
|
+
model: __props.filterModel,
|
|
306
|
+
columns: __props.filterColumns,
|
|
285
307
|
hidden: !unref(showFilter),
|
|
286
308
|
class: normalizeClass({ "mb-4": unref(showFilter) }),
|
|
287
309
|
onSearch: ($event) => unref(getData)(1)
|
|
288
|
-
},
|
|
310
|
+
}, createSlots({
|
|
311
|
+
_: 2
|
|
312
|
+
/* DYNAMIC */
|
|
313
|
+
}, [
|
|
314
|
+
renderList(_ctx.$slots, (_, slotName) => {
|
|
315
|
+
return {
|
|
316
|
+
name: slotName,
|
|
317
|
+
fn: withCtx((scope) => [
|
|
318
|
+
renderSlot(_ctx.$slots, slotName, normalizeProps(guardReactiveProps(scope)))
|
|
319
|
+
])
|
|
320
|
+
};
|
|
321
|
+
})
|
|
322
|
+
]), 1032, ["model", "columns", "hidden", "class", "onSearch"])) : createCommentVNode("v-if", true),
|
|
289
323
|
createCommentVNode(" \u4E3B\u5185\u5BB9 "),
|
|
290
324
|
createElementVNode("div", { class: "h-0 flex-1 flex flex-col border border-border rounded pb-5 overflow-hidden" }, [
|
|
291
325
|
renderSlot(_ctx.$slots, "table", { data: unref(tableDataSource) }, () => [
|
|
@@ -301,7 +335,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
301
335
|
style: {
|
|
302
336
|
"font-size": `${unref(parseRem)(__props.fontSize)}rem`
|
|
303
337
|
},
|
|
304
|
-
|
|
338
|
+
onSelect: unref(onTableSelectHandler),
|
|
339
|
+
onSelectAll: unref(onTableSelectHandler),
|
|
305
340
|
onRowClick: unref(onTableRowClickHandler),
|
|
306
341
|
onRowContextmenu: unref(onTableRowContextmenuHandler)
|
|
307
342
|
}, _ctx.$attrs), {
|
|
@@ -491,7 +526,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
491
526
|
]),
|
|
492
527
|
_: 3
|
|
493
528
|
/* FORWARDED */
|
|
494
|
-
}, 16, ["row-key", "data", "show-header", "row-class-name", "class", "style", "onSelectAll", "onRowClick", "onRowContextmenu"])
|
|
529
|
+
}, 16, ["row-key", "data", "show-header", "row-class-name", "class", "style", "onSelect", "onSelectAll", "onRowClick", "onRowContextmenu"])
|
|
495
530
|
]),
|
|
496
531
|
createCommentVNode(" \u5206\u9875 "),
|
|
497
532
|
__props.showPagination ? (openBlock(), createElementBlock("div", {
|
|
@@ -506,10 +541,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
506
541
|
/* TEXT */
|
|
507
542
|
),
|
|
508
543
|
createVNode(unref(ElPagination), {
|
|
509
|
-
"current-page":
|
|
510
|
-
"onUpdate:currentPage": ($event) =>
|
|
511
|
-
"page-size":
|
|
512
|
-
"onUpdate:pageSize": ($event) =>
|
|
544
|
+
"current-page": __props.filterModel.page,
|
|
545
|
+
"onUpdate:currentPage": ($event) => __props.filterModel.page = $event,
|
|
546
|
+
"page-size": __props.filterModel.size,
|
|
547
|
+
"onUpdate:pageSize": ($event) => __props.filterModel.size = $event,
|
|
513
548
|
total: unref(totalElements),
|
|
514
549
|
"pager-count": __props.pagerCount,
|
|
515
550
|
"page-sizes": [10, 15, 30, 50, 100],
|