@aplus-frontend/ui 0.4.11 → 0.4.13
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/src/ap-field/date-range/index.vue.mjs +65 -57
- package/es/src/ap-field/hooks/use-default-presets.d.ts +7 -4
- package/es/src/ap-field/hooks/use-default-presets.mjs +24 -13
- package/es/src/business/ap-ladder/ApLadder.vue.d.ts +2 -0
- package/es/src/business/ap-ladder/ApLadder.vue2.mjs +109 -127
- package/es/src/business/ap-ladder/index.d.ts +1 -0
- package/es/src/business/ap-ladder/useWatchEllipsis.d.ts +3 -0
- package/es/src/business/ap-ladder/useWatchEllipsis.mjs +35 -0
- package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +5 -2
- package/es/src/business/ap-table-modal/hooks/use-table-select-modal.mjs +31 -21
- package/es/src/business/ap-table-modal/interface.d.ts +3 -1
- package/es/src/business/ap-table-modal/table-layout/index.vue.d.ts +4 -2
- package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +53 -46
- package/es/src/business/ap-title/interface.d.ts +1 -1
- package/es/src/config-provider/hooks/use-locale.mjs +7 -7
- package/es/src/full-screen/index.vue.d.ts +2 -2
- package/es/src/full-screen/index.vue.mjs +19 -18
- package/es/src/hooks/useFullScreen.mjs +12 -11
- package/es/src/utils/data-range-persets.d.ts +23 -40
- package/es/src/utils/data-range-persets.mjs +95 -102
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/hooks/use-default-presets.d.ts +7 -4
- package/lib/src/ap-field/hooks/use-default-presets.js +1 -1
- package/lib/src/business/ap-ladder/ApLadder.vue.d.ts +2 -0
- package/lib/src/business/ap-ladder/ApLadder.vue2.js +1 -1
- package/lib/src/business/ap-ladder/index.d.ts +1 -0
- package/lib/src/business/ap-ladder/useWatchEllipsis.d.ts +3 -0
- package/lib/src/business/ap-ladder/useWatchEllipsis.js +1 -0
- package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +5 -2
- package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.js +1 -1
- package/lib/src/business/ap-table-modal/interface.d.ts +3 -1
- package/lib/src/business/ap-table-modal/table-layout/index.vue.d.ts +4 -2
- package/lib/src/business/ap-table-modal/table-layout/index.vue2.js +1 -1
- package/lib/src/business/ap-title/interface.d.ts +1 -1
- package/lib/src/config-provider/hooks/use-locale.js +1 -1
- package/lib/src/full-screen/index.vue.d.ts +2 -2
- package/lib/src/full-screen/index.vue.js +1 -1
- package/lib/src/hooks/useFullScreen.js +1 -1
- package/lib/src/utils/data-range-persets.d.ts +23 -40
- package/lib/src/utils/data-range-persets.js +1 -1
- package/package.json +3 -3
- package/theme/ap-form/ap-form-item.css +8 -5
- package/theme/ap-form/ap-form-item.less +11 -8
- package/theme/ap-form/index.css +8 -5
- package/theme/ap-form/search-form.css +8 -5
- package/theme/ap-form/search-form.less +0 -1
- package/theme/ap-table/ap-table.css +8 -5
- package/theme/ap-table-modal/index.css +8 -5
- package/theme/editable-table/index.css +8 -5
- package/theme/index.css +8 -5
|
@@ -1,82 +1,89 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as v, openBlock as l, createElementBlock as o, normalizeClass as a, unref as t, Fragment as i, createVNode as m, withCtx as n, createBlock as s, resolveDynamicComponent as p, h, createElementVNode as c, renderSlot as b, createCommentVNode as T, createTextVNode as $, toDisplayString as B, renderList as M } from "vue";
|
|
2
2
|
import "../../../config-provider/index.mjs";
|
|
3
3
|
import "../../index.mjs";
|
|
4
|
-
import { Button as
|
|
5
|
-
import { useLocale as
|
|
6
|
-
import { useNamespace as
|
|
7
|
-
import { ApTitle as
|
|
8
|
-
const
|
|
4
|
+
import { Button as V, Empty as k } from "@aplus-frontend/antdv";
|
|
5
|
+
import { useLocale as A } from "../../../config-provider/hooks/use-locale.mjs";
|
|
6
|
+
import { useNamespace as D } from "../../../config-provider/hooks/use-namespace.mjs";
|
|
7
|
+
import { ApTitle as I } from "../../ap-title/index.mjs";
|
|
8
|
+
const q = /* @__PURE__ */ v({
|
|
9
9
|
__name: "index",
|
|
10
10
|
props: {
|
|
11
|
-
leftTitle: { default: "" },
|
|
11
|
+
leftTitle: { type: [String, Object, Number, Boolean, null, Array], default: "" },
|
|
12
|
+
rightTitle: {},
|
|
12
13
|
renderSelectedItem: {},
|
|
13
14
|
selectedList: { default: () => [] }
|
|
14
15
|
},
|
|
15
16
|
emits: ["clear", "deleteItem"],
|
|
16
|
-
setup(
|
|
17
|
-
const { t:
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
}, { m:
|
|
22
|
-
return (e,
|
|
23
|
-
class:
|
|
24
|
-
e.renderSelectedItem ? t(
|
|
17
|
+
setup(S, { emit: E }) {
|
|
18
|
+
const { t: d } = A(), u = S, f = E, L = () => {
|
|
19
|
+
f("clear");
|
|
20
|
+
}, C = (e) => {
|
|
21
|
+
f("deleteItem", e);
|
|
22
|
+
}, N = (e) => typeof u.rightTitle == "function" ? u.rightTitle(e) : `${d("ap.apTableModal.selected")} (${e})`, { m: r } = D("ap-table-modal");
|
|
23
|
+
return (e, w) => (l(), o("div", {
|
|
24
|
+
class: a([
|
|
25
|
+
e.renderSelectedItem ? t(r)("table-layout") : "",
|
|
25
26
|
{ "complex-layout": !!e.renderSelectedItem }
|
|
26
27
|
])
|
|
27
28
|
}, [
|
|
28
|
-
e.renderSelectedItem ? (
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
e.renderSelectedItem ? (l(), o(i, { key: 0 }, [
|
|
30
|
+
e.leftTitle ? (l(), o("div", {
|
|
31
|
+
key: 0,
|
|
32
|
+
class: a(t(r)("table-layout-left"))
|
|
31
33
|
}, [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
m(t(I), { style: { "margin-bottom": "16px" } }, {
|
|
35
|
+
prefix: n(() => [
|
|
36
|
+
(l(), s(p(h(i, [e.leftTitle]))))
|
|
37
|
+
]),
|
|
38
|
+
_: 1
|
|
39
|
+
}),
|
|
40
|
+
c("div", {
|
|
41
|
+
class: a(t(r)("table-layout-left-content"))
|
|
38
42
|
}, [
|
|
39
|
-
|
|
43
|
+
b(e.$slots, "default")
|
|
40
44
|
], 2)
|
|
41
|
-
], 2),
|
|
42
|
-
|
|
43
|
-
class:
|
|
45
|
+
], 2)) : T("", !0),
|
|
46
|
+
c("div", {
|
|
47
|
+
class: a(t(r)("table-layout-right"))
|
|
44
48
|
}, [
|
|
45
|
-
|
|
46
|
-
title: `${t(
|
|
49
|
+
m(t(I), {
|
|
50
|
+
title: `${t(d)("ap.apTableModal.selected")} (${e.selectedList.length})`
|
|
47
51
|
}, {
|
|
48
|
-
|
|
49
|
-
s(
|
|
52
|
+
prefix: n(() => [
|
|
53
|
+
(l(), s(p(h(i, [N(e.selectedList.length)]))))
|
|
54
|
+
]),
|
|
55
|
+
suffix: n(() => [
|
|
56
|
+
m(t(V), {
|
|
50
57
|
type: "link",
|
|
51
58
|
style: { padding: "0px", height: "22px", "border-width": "0px" },
|
|
52
|
-
onClick:
|
|
59
|
+
onClick: L
|
|
53
60
|
}, {
|
|
54
|
-
default:
|
|
55
|
-
|
|
61
|
+
default: n(() => [
|
|
62
|
+
$(B(t(d)("ap.apTableModal.clear")), 1)
|
|
56
63
|
]),
|
|
57
64
|
_: 1
|
|
58
65
|
})
|
|
59
66
|
]),
|
|
60
67
|
_: 1
|
|
61
68
|
}, 8, ["title"]),
|
|
62
|
-
|
|
63
|
-
class:
|
|
69
|
+
c("div", {
|
|
70
|
+
class: a(t(r)("table-layout-right-content"))
|
|
64
71
|
}, [
|
|
65
|
-
(
|
|
66
|
-
var
|
|
67
|
-
return
|
|
72
|
+
(l(!0), o(i, null, M(e.selectedList, (y) => {
|
|
73
|
+
var g;
|
|
74
|
+
return l(), s(p((g = e.renderSelectedItem) == null ? void 0 : g.call(e, y, { deleteItem: C })), { key: y });
|
|
68
75
|
}), 128)),
|
|
69
|
-
e.selectedList.length === 0 ? (
|
|
76
|
+
e.selectedList.length === 0 ? (l(), s(t(k), {
|
|
70
77
|
key: 0,
|
|
71
|
-
image: t(
|
|
78
|
+
image: t(k).PRESENTED_IMAGE_SIMPLE,
|
|
72
79
|
style: { "margin-top": "100px" }
|
|
73
|
-
}, null, 8, ["image"])) :
|
|
80
|
+
}, null, 8, ["image"])) : T("", !0)
|
|
74
81
|
], 2)
|
|
75
82
|
], 2)
|
|
76
|
-
], 64)) :
|
|
83
|
+
], 64)) : b(e.$slots, "default", { key: 1 })
|
|
77
84
|
], 2));
|
|
78
85
|
}
|
|
79
86
|
});
|
|
80
87
|
export {
|
|
81
|
-
|
|
88
|
+
q as default
|
|
82
89
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { unref as o, computed as
|
|
2
|
-
import { get as
|
|
1
|
+
import { unref as o, computed as s, isRef as m, ref as c, inject as u } from "vue";
|
|
2
|
+
import { get as a } from "lodash-unified";
|
|
3
3
|
import "../../locale/index.mjs";
|
|
4
|
-
import
|
|
5
|
-
const f = (e) => (t, r) => i(t, r, o(e)), i = (e, t, r) =>
|
|
4
|
+
import l from "../../locale/lang/zh-cn.mjs";
|
|
5
|
+
const f = (e) => (t, r) => i(t, r, o(e)), i = (e, t, r) => a(r, e, e).replace(
|
|
6
6
|
/\{(\w+)\}/g,
|
|
7
7
|
(b, n) => `${(t == null ? void 0 : t[n]) ?? `{${n}}`}`
|
|
8
8
|
), x = (e) => {
|
|
9
|
-
const t =
|
|
9
|
+
const t = s(() => o(e).name), r = m(e) ? e : c(e);
|
|
10
10
|
return {
|
|
11
11
|
lang: t,
|
|
12
12
|
locale: r,
|
|
13
13
|
t: f(e)
|
|
14
14
|
};
|
|
15
15
|
}, C = Symbol("localeContextKey"), K = (e) => {
|
|
16
|
-
const t = e ||
|
|
17
|
-
return x(
|
|
16
|
+
const t = e || u(C, c());
|
|
17
|
+
return x(s(() => (t == null ? void 0 : t.value) || l));
|
|
18
18
|
};
|
|
19
19
|
export {
|
|
20
20
|
x as buildLocaleContext,
|
|
@@ -17,7 +17,7 @@ declare function __VLS_template(): {
|
|
|
17
17
|
};
|
|
18
18
|
refs: {
|
|
19
19
|
target: unknown;
|
|
20
|
-
|
|
20
|
+
portalRootRef: HTMLDivElement;
|
|
21
21
|
};
|
|
22
22
|
rootEl: any;
|
|
23
23
|
};
|
|
@@ -32,7 +32,7 @@ declare const __VLS_component: DefineComponent<FullScreenProps, {
|
|
|
32
32
|
toggle: typeof toggle;
|
|
33
33
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<FullScreenProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
34
34
|
target: unknown;
|
|
35
|
-
|
|
35
|
+
portalRootRef: HTMLDivElement;
|
|
36
36
|
}, any>;
|
|
37
37
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
38
38
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as R, ref as i, watch as E, unref as a, computed as n, openBlock as m, createBlock as d, withCtx as v, resolveDynamicComponent as z, mergeProps as C, renderSlot as F, createElementVNode as N, normalizeClass as S } from "vue";
|
|
2
2
|
import "../hooks/index.mjs";
|
|
3
3
|
import "../portal/index.mjs";
|
|
4
4
|
import "../config-provider/index.mjs";
|
|
@@ -6,7 +6,7 @@ import { useScrollLock as h } from "@vueuse/core";
|
|
|
6
6
|
import { useFullScreen as I } from "../hooks/useFullScreen.mjs";
|
|
7
7
|
import { useNamespace as $ } from "../config-provider/hooks/use-namespace.mjs";
|
|
8
8
|
import B from "../portal/index.vue.mjs";
|
|
9
|
-
const H = /* @__PURE__ */
|
|
9
|
+
const H = /* @__PURE__ */ R({
|
|
10
10
|
name: "FullScreen",
|
|
11
11
|
__name: "index",
|
|
12
12
|
props: {
|
|
@@ -15,42 +15,42 @@ const H = /* @__PURE__ */ k({
|
|
|
15
15
|
},
|
|
16
16
|
setup(L, { expose: w }) {
|
|
17
17
|
const {
|
|
18
|
-
target:
|
|
18
|
+
target: f,
|
|
19
19
|
full: b,
|
|
20
20
|
enter: y,
|
|
21
21
|
exit: _
|
|
22
|
-
} = I(), { b: x, bm: g, be:
|
|
22
|
+
} = I(), { b: x, bm: g, be: k } = $("full-screen"), t = i(!1), l = i(), p = h(document.body), u = i();
|
|
23
23
|
E(
|
|
24
24
|
() => a(b),
|
|
25
25
|
(e) => {
|
|
26
26
|
e || (t.value = !1, l.value = void 0);
|
|
27
27
|
}
|
|
28
28
|
);
|
|
29
|
-
async function
|
|
30
|
-
await s(), t.value = !0, l.value = e, e === "browser" ? y(
|
|
29
|
+
async function o(e, r = !1) {
|
|
30
|
+
await s(), t.value = !0, l.value = e, e === "browser" ? y(r) : p.value = !0;
|
|
31
31
|
}
|
|
32
32
|
async function s(e = !1) {
|
|
33
|
-
t.value = !1, l.value === "browser" ? await _(e) :
|
|
33
|
+
t.value = !1, l.value === "browser" ? await _(e) : p.value = !1, l.value = void 0;
|
|
34
34
|
}
|
|
35
|
-
async function c(e,
|
|
36
|
-
t.value ? l.value !== e ? await
|
|
35
|
+
async function c(e, r = !1) {
|
|
36
|
+
t.value ? l.value !== e ? await o(e, r) : await s(r) : await o(e, r);
|
|
37
37
|
}
|
|
38
38
|
return w({
|
|
39
|
-
target: n(() => a(
|
|
40
|
-
portalRoot: n(() => a(
|
|
39
|
+
target: n(() => a(f)),
|
|
40
|
+
portalRoot: n(() => a(u)),
|
|
41
41
|
full: n(() => a(t)),
|
|
42
42
|
mode: n(() => a(l)),
|
|
43
|
-
enter:
|
|
43
|
+
enter: o,
|
|
44
44
|
exit: s,
|
|
45
45
|
toggle: c
|
|
46
|
-
}), (e,
|
|
46
|
+
}), (e, r) => (m(), d(a(B), {
|
|
47
47
|
to: "body",
|
|
48
48
|
disabled: l.value !== "window"
|
|
49
49
|
}, {
|
|
50
50
|
default: v(() => [
|
|
51
51
|
(m(), d(z(e.wrapperElementName), C({
|
|
52
52
|
ref_key: "target",
|
|
53
|
-
ref:
|
|
53
|
+
ref: f
|
|
54
54
|
}, e.$attrs, {
|
|
55
55
|
class: [
|
|
56
56
|
a(x)("wrapper"),
|
|
@@ -61,15 +61,16 @@ const H = /* @__PURE__ */ k({
|
|
|
61
61
|
default: v(() => [
|
|
62
62
|
F(e.$slots, "default", {
|
|
63
63
|
full: t.value,
|
|
64
|
-
enter:
|
|
64
|
+
enter: o,
|
|
65
65
|
exit: s,
|
|
66
66
|
toggle: c,
|
|
67
67
|
mode: l.value,
|
|
68
|
-
portalRoot:
|
|
68
|
+
portalRoot: u.value
|
|
69
69
|
}),
|
|
70
70
|
N("div", {
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
ref_key: "portalRootRef",
|
|
72
|
+
ref: u,
|
|
73
|
+
class: S(a(k)("wrapper", "portal-root"))
|
|
73
74
|
}, null, 2)
|
|
74
75
|
]),
|
|
75
76
|
_: 3
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isClient as d } from "@vueuse/core";
|
|
2
|
+
import { computed as c, unref as u, isRef as v, ref as f, watch as p } from "vue";
|
|
2
3
|
const a = /* @__PURE__ */ new WeakMap(), o = /* @__PURE__ */ new Set();
|
|
3
|
-
document.addEventListener("fullscreenchange", () => {
|
|
4
|
+
d && document.addEventListener("fullscreenchange", () => {
|
|
4
5
|
if (o.forEach((e) => e.value = !1), document.fullscreenElement) {
|
|
5
6
|
const e = a.get(
|
|
6
7
|
document.fullscreenElement
|
|
@@ -8,14 +9,14 @@ document.addEventListener("fullscreenchange", () => {
|
|
|
8
9
|
e && (e.value = !0);
|
|
9
10
|
}
|
|
10
11
|
});
|
|
11
|
-
const
|
|
12
|
-
const i =
|
|
12
|
+
const E = (e = f(null)) => {
|
|
13
|
+
const i = c({
|
|
13
14
|
get: () => u(e),
|
|
14
15
|
set: (t) => {
|
|
15
|
-
|
|
16
|
+
v(e) && (e.value = t);
|
|
16
17
|
}
|
|
17
18
|
}), l = f(!1);
|
|
18
|
-
o.add(l),
|
|
19
|
+
o.add(l), p(
|
|
19
20
|
() => e.value,
|
|
20
21
|
(t, n) => {
|
|
21
22
|
t && a.set(t, l), n && a.delete(n);
|
|
@@ -25,7 +26,7 @@ const h = (e = f(null)) => {
|
|
|
25
26
|
flush: "post"
|
|
26
27
|
}
|
|
27
28
|
);
|
|
28
|
-
async function
|
|
29
|
+
async function r(t = !1) {
|
|
29
30
|
await s();
|
|
30
31
|
const n = u(e);
|
|
31
32
|
return n && (t || !document.fullscreenElement) ? (await n.requestFullscreen(), l.value = !0, !0) : !1;
|
|
@@ -35,16 +36,16 @@ const h = (e = f(null)) => {
|
|
|
35
36
|
return t || n && document.fullscreenElement === n ? (await document.exitFullscreen(), l.value = !1, !0) : !1;
|
|
36
37
|
}
|
|
37
38
|
async function m(t = !1) {
|
|
38
|
-
return await (u(l) ? s(t) :
|
|
39
|
+
return await (u(l) ? s(t) : r(t));
|
|
39
40
|
}
|
|
40
41
|
return {
|
|
41
42
|
target: i,
|
|
42
|
-
full:
|
|
43
|
-
enter:
|
|
43
|
+
full: c(() => u(l)),
|
|
44
|
+
enter: r,
|
|
44
45
|
exit: s,
|
|
45
46
|
toggle: m
|
|
46
47
|
};
|
|
47
48
|
};
|
|
48
49
|
export {
|
|
49
|
-
|
|
50
|
+
E as useFullScreen
|
|
50
51
|
};
|
|
@@ -5,82 +5,65 @@ type Timezone = LiteralUnion<ZoneAlias, string>;
|
|
|
5
5
|
/**
|
|
6
6
|
* 指定时区格式化
|
|
7
7
|
* @param {Timezone} [timezone] - 时区
|
|
8
|
+
* @param {number} [currentDate] - 当前时间
|
|
8
9
|
*/
|
|
9
|
-
export declare const presetsGetTimezoneFormat: (timezone?: Timezone) => dayjs.Dayjs;
|
|
10
|
+
export declare const presetsGetTimezoneFormat: (timezone?: Timezone, currentDate?: number) => dayjs.Dayjs;
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* 根据时区获取今天
|
|
12
13
|
* @param {Timezone} [timezone] - 时区
|
|
14
|
+
* @param {number} [currentDate] - 当前时间
|
|
13
15
|
*/
|
|
14
|
-
export declare const presetsGetToday: (timezone?: Timezone) =>
|
|
15
|
-
label: string;
|
|
16
|
-
value: dayjs.Dayjs[];
|
|
17
|
-
};
|
|
16
|
+
export declare const presetsGetToday: (timezone?: Timezone, currentDate?: number) => dayjs.Dayjs[];
|
|
18
17
|
/**
|
|
19
|
-
*
|
|
18
|
+
* 根据时区获取昨天
|
|
20
19
|
* @param {Timezone} [timezone] - 时区
|
|
20
|
+
* @param {number} [currentDate] - 当前时间
|
|
21
21
|
*/
|
|
22
|
-
export declare const presetsGetYesterday: (timezone?: Timezone) =>
|
|
23
|
-
label: string;
|
|
24
|
-
value: dayjs.Dayjs[];
|
|
25
|
-
};
|
|
22
|
+
export declare const presetsGetYesterday: (timezone?: Timezone, currentDate?: number) => dayjs.Dayjs[];
|
|
26
23
|
/**
|
|
27
24
|
* 根据时区获取本周
|
|
28
25
|
* @param {Timezone} [timezone] - 时区
|
|
26
|
+
* @param {number} [currentDate] - 当前时间
|
|
29
27
|
*/
|
|
30
|
-
export declare const presetsGetThisWeek: (timezone?: Timezone) =>
|
|
31
|
-
label: string;
|
|
32
|
-
value: dayjs.Dayjs[];
|
|
33
|
-
};
|
|
28
|
+
export declare const presetsGetThisWeek: (timezone?: Timezone, currentDate?: number) => dayjs.Dayjs[];
|
|
34
29
|
/**
|
|
35
30
|
* 根据时区获取上周
|
|
36
31
|
* @param {Timezone} [timezone] - 时区
|
|
32
|
+
* @param {number} [currentDate] - 当前时间
|
|
37
33
|
*/
|
|
38
|
-
export declare const presetsGetLastWeek: (timezone?: Timezone) =>
|
|
39
|
-
label: string;
|
|
40
|
-
value: dayjs.Dayjs[];
|
|
41
|
-
};
|
|
34
|
+
export declare const presetsGetLastWeek: (timezone?: Timezone, currentDate?: number) => dayjs.Dayjs[];
|
|
42
35
|
/**
|
|
43
36
|
* 根据时区获取本月
|
|
44
37
|
* @param {Timezone} [timezone] - 时区
|
|
38
|
+
* @param {number} [currentDate] - 当前时间
|
|
45
39
|
*/
|
|
46
|
-
export declare const presetsGetThisMonth: (timezone?: Timezone) =>
|
|
47
|
-
label: string;
|
|
48
|
-
value: dayjs.Dayjs[];
|
|
49
|
-
};
|
|
40
|
+
export declare const presetsGetThisMonth: (timezone?: Timezone, currentDate?: number) => dayjs.Dayjs[];
|
|
50
41
|
/**
|
|
51
42
|
* 根据时区获取上月
|
|
52
43
|
* @param {Timezone} [timezone] - 时区
|
|
44
|
+
* @param {number} [currentDate] - 当前时间
|
|
53
45
|
*/
|
|
54
|
-
export declare const presetsGetLastMonth: (timezone?: Timezone) =>
|
|
55
|
-
label: string;
|
|
56
|
-
value: dayjs.Dayjs[];
|
|
57
|
-
};
|
|
46
|
+
export declare const presetsGetLastMonth: (timezone?: Timezone, currentDate?: number) => dayjs.Dayjs[];
|
|
58
47
|
/**
|
|
59
48
|
* 根据时区获取今年
|
|
60
49
|
* @param {Timezone} [timezone] - 时区
|
|
50
|
+
* @param {number} [currentDate] - 当前时间
|
|
61
51
|
*/
|
|
62
|
-
export declare const presetsGetThisYear: (timezone?: Timezone) =>
|
|
63
|
-
label: string;
|
|
64
|
-
value: dayjs.Dayjs[];
|
|
65
|
-
};
|
|
52
|
+
export declare const presetsGetThisYear: (timezone?: Timezone, currentDate?: number) => dayjs.Dayjs[];
|
|
66
53
|
/**
|
|
67
54
|
* 根据时区获取去年
|
|
68
55
|
* @param {Timezone} [timezone] - 时区
|
|
56
|
+
* @param {number} [currentDate] - 当前时间
|
|
69
57
|
*/
|
|
70
|
-
export declare const presetsGetLastYear: (timezone?: Timezone) =>
|
|
71
|
-
label: string;
|
|
72
|
-
value: dayjs.Dayjs[];
|
|
73
|
-
};
|
|
58
|
+
export declare const presetsGetLastYear: (timezone?: Timezone, currentDate?: number) => dayjs.Dayjs[];
|
|
74
59
|
/**
|
|
75
60
|
* 根据时区获取近x天
|
|
76
61
|
* @param {number} day - 天数
|
|
77
62
|
* @param {Timezone} [timezone] - 时区
|
|
63
|
+
* @param {number} [currentDate] - 当前时间
|
|
78
64
|
*/
|
|
79
|
-
export declare const presetsGetLastXDays: (day: number, timezone?: Timezone) =>
|
|
80
|
-
|
|
81
|
-
value: dayjs.Dayjs[];
|
|
82
|
-
};
|
|
83
|
-
export declare const presetsDefault: (timezone?: Timezone) => {
|
|
65
|
+
export declare const presetsGetLastXDays: (day: number, timezone?: Timezone, currentDate?: number) => dayjs.Dayjs[];
|
|
66
|
+
export declare const presetsDefault: (timezone?: Timezone, currentDate?: number, t?: (path: string, option?: any) => string) => {
|
|
84
67
|
label: string;
|
|
85
68
|
value: dayjs.Dayjs[];
|
|
86
69
|
}[];
|
|
@@ -1,107 +1,100 @@
|
|
|
1
|
-
import { getTimeFormatToZone as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
y(t),
|
|
88
|
-
O(t),
|
|
89
|
-
u(t),
|
|
90
|
-
m(t),
|
|
91
|
-
p(t),
|
|
92
|
-
f(7, t),
|
|
93
|
-
f(30, t)
|
|
1
|
+
import { getTimeFormatToZone as n, userTimezone as o } from "@aplus-frontend/utils";
|
|
2
|
+
import d from "dayjs";
|
|
3
|
+
const s = (t, a = d().valueOf()) => d(n(a, t ?? o)), y = (t, a) => {
|
|
4
|
+
const e = s(t, a);
|
|
5
|
+
return [e.startOf("day"), e.endOf("day")];
|
|
6
|
+
}, l = (t, a) => {
|
|
7
|
+
const e = s(t, a);
|
|
8
|
+
return [
|
|
9
|
+
e.startOf("day").subtract(1, "day").startOf("day"),
|
|
10
|
+
e.endOf("day").subtract(1, "day").endOf("day")
|
|
11
|
+
];
|
|
12
|
+
}, O = (t, a) => {
|
|
13
|
+
const e = s(t, a);
|
|
14
|
+
return [
|
|
15
|
+
e.startOf("week").startOf("day"),
|
|
16
|
+
e.endOf("week").endOf("day")
|
|
17
|
+
];
|
|
18
|
+
}, m = (t, a) => {
|
|
19
|
+
const e = s(t, a);
|
|
20
|
+
return [
|
|
21
|
+
e.subtract(1, "week").startOf("week").startOf("day"),
|
|
22
|
+
e.subtract(1, "week").endOf("week").endOf("day")
|
|
23
|
+
];
|
|
24
|
+
}, u = (t, a) => {
|
|
25
|
+
const e = s(t, a);
|
|
26
|
+
return [
|
|
27
|
+
e.startOf("month").startOf("day"),
|
|
28
|
+
e.endOf("month").endOf("day")
|
|
29
|
+
];
|
|
30
|
+
}, c = (t, a) => {
|
|
31
|
+
const e = s(t, a);
|
|
32
|
+
return [
|
|
33
|
+
e.subtract(1, "month").startOf("month").startOf("day"),
|
|
34
|
+
e.subtract(1, "month").endOf("month").endOf("day")
|
|
35
|
+
];
|
|
36
|
+
}, b = (t, a) => {
|
|
37
|
+
const e = s(t, a);
|
|
38
|
+
return [
|
|
39
|
+
e.startOf("year").startOf("day"),
|
|
40
|
+
e.endOf("year").endOf("day")
|
|
41
|
+
];
|
|
42
|
+
}, T = (t, a) => {
|
|
43
|
+
const e = s(t, a);
|
|
44
|
+
return [
|
|
45
|
+
e.subtract(1, "year").startOf("year").startOf("day"),
|
|
46
|
+
e.subtract(1, "year").endOf("year").endOf("day")
|
|
47
|
+
];
|
|
48
|
+
}, f = (t, a, e) => {
|
|
49
|
+
const r = s(a, e);
|
|
50
|
+
return [
|
|
51
|
+
r.subtract(t - 1, "day").startOf("day"),
|
|
52
|
+
r.endOf("day")
|
|
53
|
+
];
|
|
54
|
+
}, h = (t, a, e) => [
|
|
55
|
+
{
|
|
56
|
+
label: e ? e("ap.field.today") : "今天",
|
|
57
|
+
value: y(t, a)
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
label: e ? e("ap.field.yesterday") : "昨天",
|
|
61
|
+
value: l(t, a)
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: e ? e("ap.field.thisWeek") : "本周",
|
|
65
|
+
value: O(t, a)
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
label: e ? e("ap.field.lastWeek") : "上周",
|
|
69
|
+
value: m(t, a)
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: e ? e("ap.field.thisMonth") : "本月",
|
|
73
|
+
value: u(t, a)
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: e ? e("ap.field.lastMonth") : "上月",
|
|
77
|
+
value: c(t, a)
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
label: e ? e("ap.field.lastXDays", { day: 7 }) : "近7天",
|
|
81
|
+
value: f(7, t, a)
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
label: e ? e("ap.field.lastXDays", { day: 30 }) : "近30天",
|
|
85
|
+
value: f(30, t, a)
|
|
86
|
+
}
|
|
94
87
|
];
|
|
95
88
|
export {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
89
|
+
h as presetsDefault,
|
|
90
|
+
c as presetsGetLastMonth,
|
|
91
|
+
m as presetsGetLastWeek,
|
|
99
92
|
f as presetsGetLastXDays,
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
T as presetsGetLastYear,
|
|
94
|
+
u as presetsGetThisMonth,
|
|
102
95
|
O as presetsGetThisWeek,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
96
|
+
b as presetsGetThisYear,
|
|
97
|
+
s as presetsGetTimezoneFormat,
|
|
98
|
+
y as presetsGetToday,
|
|
99
|
+
l as presetsGetYesterday
|
|
107
100
|
};
|