@dazhicheng/ui 1.6.0 → 1.6.2
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/components/tt-api-component/index.js +4 -3
- package/dist/components/tt-api-component/index.vue2.js +4 -3
- package/dist/components/tt-area/TtArea.vue3.js +8 -7
- package/dist/components/tt-button/index.js +5 -4
- package/dist/components/tt-button/index.vue2.js +4 -3
- package/dist/components/tt-checkbox/index.js +4 -3
- package/dist/components/tt-checkbox/index.vue.js +4 -3
- package/dist/components/tt-drawer/index.js +4 -3
- package/dist/components/tt-drawer/src/RenderDrawer.vue.js +4 -3
- package/dist/components/tt-drawer/src/components/DrawerFooter.vue.js +8 -7
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue2.js +3 -2
- package/dist/components/tt-drawer/src/props.js +3 -2
- package/dist/components/tt-drawer/src/utils/drawer-api.js +4 -2
- package/dist/components/tt-empty/index.js +9 -8
- package/dist/components/tt-form/index.js +10 -9
- package/dist/components/tt-form/src/components/ExpandableArrow.vue2.js +3 -2
- package/dist/components/tt-form/src/components/FormActions.vue2.js +4 -2
- package/dist/components/tt-form/src/form/FormDescription.vue.js +3 -2
- package/dist/components/tt-form/src/form/FormItem.vue.js +6 -5
- package/dist/components/tt-form/src/form/FormLabel.vue.js +8 -7
- package/dist/components/tt-form/src/form/RenderContent.vue.js +4 -3
- package/dist/components/tt-form/src/form-render/FormField.vue2.js +30 -28
- package/dist/components/tt-form/src/form-render/FormLabel.vue2.js +4 -2
- package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.js +1 -0
- package/dist/components/tt-form/src/form-render/array-register/utils.js +6 -4
- package/dist/components/tt-form/src/form-render/dependencies.js +19 -18
- package/dist/components/tt-form/src/form-render/form.vue2.js +4 -2
- package/dist/components/tt-form/src/form-render/helper.js +15 -14
- package/dist/components/tt-form/src/form-render/rootWrapperClass.js +3 -2
- package/dist/components/tt-form/src/formApi.js +3 -2
- package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +4 -3
- package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +2 -0
- package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +4 -2
- package/dist/components/tt-form/src/group-form/groupFormApi.js +4 -3
- package/dist/components/tt-form/src/hooks/useForwardPriorityValues.js +3 -2
- package/dist/components/tt-form/src/hooks/useSelectCollapse.js +28 -27
- package/dist/components/tt-form/src/index.vue2.js +3 -2
- package/dist/components/tt-form/src/useFormContext.js +11 -10
- package/dist/components/tt-form-item-error-tooltip/index.js +5 -4
- package/dist/components/tt-form-item-error-tooltip/index.vue.js +4 -3
- package/dist/components/tt-icon/index.js +6 -5
- package/dist/components/tt-image/index.js +6 -5
- package/dist/components/tt-image/src/components/ImageViewer.js +7 -6
- package/dist/components/tt-loading/index.js +4 -3
- package/dist/components/tt-loading/src/directive.js +24 -23
- package/dist/components/tt-log/index.js +4 -3
- package/dist/components/tt-log/index.vue.js +3 -2
- package/dist/components/tt-modal/index.js +3 -2
- package/dist/components/tt-modal/src/RenderModal.vue.js +3 -2
- package/dist/components/tt-modal/src/components/ModalFooter.vue2.js +3 -2
- package/dist/components/tt-modal/src/components/ModalHeader.vue2.js +3 -2
- package/dist/components/tt-modal/src/components/ModalWrapper.vue.js +15 -14
- package/dist/components/tt-modal/src/props.js +3 -2
- package/dist/components/tt-modal/src/utils/modal-api.js +4 -2
- package/dist/components/tt-modal-form/index.vue.js +4 -3
- package/dist/components/tt-nav-anchor/index.js +4 -3
- package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.js +15 -14
- package/dist/components/tt-panel-select/index.js +4 -3
- package/dist/components/tt-panel-select/src/hooks/usePanelData.js +4 -3
- package/dist/components/tt-panel-select/src/index.vue.js +3 -2
- package/dist/components/tt-radio-group/index.js +4 -3
- package/dist/components/tt-radio-group/index.vue.js +7 -6
- package/dist/components/tt-select/index.js +4 -3
- package/dist/components/tt-select/src/Select.vue.d.ts +8 -8
- package/dist/components/tt-select/src/Select.vue.js +4 -3
- package/dist/components/tt-select/src/components/SelectTable.vue.d.ts +116 -7
- package/dist/components/tt-select/src/components/SelectTable.vue.js +3 -2
- package/dist/components/tt-select/src/components/Table.vue.d.ts +4 -4
- package/dist/components/tt-select/src/components/Table.vue.js +3 -2
- package/dist/components/tt-select/src/hooks/useDataSource.js +4 -3
- package/dist/components/tt-select/src/hooks/useKeyboard.d.ts +7 -1
- package/dist/components/tt-select/src/hooks/useSelect.js +3 -2
- package/dist/components/tt-select/src/hooks/useSelectTableEvent.d.ts +1 -1
- package/dist/components/tt-select/src/hooks/useSelectTableEvent.js +28 -27
- package/dist/components/tt-select/src/props.d.ts +2 -2
- package/dist/components/tt-table/index.d.ts +6 -6
- package/dist/components/tt-table/index.js +1 -1
- package/dist/components/tt-table/src/Table.vue.d.ts +4 -4
- package/dist/components/tt-table/src/Table.vue.js +178 -175
- package/dist/components/tt-table/src/TableForm.vue.d.ts +6 -6
- package/dist/components/tt-table/src/TableForm.vue.js +2 -2
- package/dist/components/tt-table/src/components/TableAction.vue.js +19 -17
- package/dist/components/tt-table/src/components/TableButtons.js +10 -9
- package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +4 -3
- package/dist/components/tt-table/src/components/TableToolbarTools.vue.js +18 -17
- package/dist/components/tt-table/src/emits.d.ts +10 -1
- package/dist/components/tt-table/src/hooks/useColumnPersistence.js +17 -16
- package/dist/components/tt-table/src/hooks/useColumns.js +4 -3
- package/dist/components/tt-table/src/hooks/useKeyboardNav.js +34 -33
- package/dist/components/tt-table/src/hooks/usePagination.js +12 -11
- package/dist/components/tt-table/src/hooks/useQuery.js +6 -5
- package/dist/components/tt-table/src/hooks/useRowIdentity.d.ts +1 -0
- package/dist/components/tt-table/src/hooks/useRowIdentity.js +68 -54
- package/dist/components/tt-table/src/hooks/useRowSelection.d.ts +5 -7
- package/dist/components/tt-table/src/hooks/useRowSelection.js +70 -68
- package/dist/components/tt-table/src/hooks/useSideSlot.js +4 -3
- package/dist/components/tt-table/src/hooks/useSyncProps.js +4 -3
- package/dist/components/tt-table/src/hooks/useTableData.js +6 -5
- package/dist/components/tt-table/src/hooks/useTableFooter.js +9 -8
- package/dist/components/tt-table/src/hooks/useTableForm.js +4 -3
- package/dist/components/tt-table/src/hooks/useTableRender.d.ts +37 -4
- package/dist/components/tt-table/src/props.d.ts +12 -6
- package/dist/components/tt-table/src/props.js +14 -7
- package/dist/components/tt-table/src/table-mutation-events.js +10 -9
- package/dist/components/tt-table/src/types/table.d.ts +16 -0
- package/dist/components/tt-table/src/utils/action-tab-index.js +15 -14
- package/dist/components/tt-table/src/utils/context.js +5 -4
- package/dist/components/tt-table/src/utils/table-api.js +4 -2
- package/dist/components/tt-table/src/utils/table-form-api.js +22 -20
- package/dist/components/tt-text/index.js +4 -3
- package/dist/components/tt-upload/index.js +6 -5
- package/dist/components/tt-upload/src/TtUpload.vue.js +4 -3
- package/dist/directives/disabled-tip/index.js +9 -8
- package/dist/hooks/useFormSchemasLink.js +4 -3
- package/dist/hooks/useFormat.d.ts +35 -71
- package/dist/hooks/useFormat.js +28 -39
- package/dist/hooks/usePanelSelectSchemas.js +4 -3
- package/dist/hooks/useScreenshotOss.js +16 -15
- package/dist/packages/hooks/src/useDebounce.js +5 -4
- package/dist/packages/hooks/src/useElementScreenshot.js +4 -3
- package/dist/packages/hooks/src/usePriorityValue.js +5 -4
- package/dist/packages/utils/src/format.js +48 -0
- package/dist/plugins/default/renderCellContent.js +4 -3
- package/dist/plugins/vxeTable/switchStatus.js +14 -13
- package/package.json +3 -3
package/dist/hooks/useFormat.js
CHANGED
|
@@ -1,44 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import "axios";
|
|
2
|
+
import "element-plus";
|
|
3
|
+
import "dayjs";
|
|
4
|
+
import "vue";
|
|
5
|
+
import { formatPeriod as t, formatFileSize as m, formatDecimal as i, formatPlaceOfAmount as e, formatAmountOfPlace as a, formatAmount as p, formatToDate as f, formatToDateTime as n } from "../packages/utils/src/format.js";
|
|
6
|
+
import "xe-utils";
|
|
7
|
+
import "dayjs/plugin/utc";
|
|
8
|
+
import "dayjs/plugin/timezone";
|
|
9
|
+
import "../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
10
|
+
import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
11
|
+
import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
12
|
+
import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
13
|
+
import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
14
|
+
import "lodash-es";
|
|
15
|
+
function u(o, r = "change") {
|
|
16
|
+
return [{ required: !0, message: o, trigger: r }];
|
|
17
|
+
}
|
|
18
|
+
function z() {
|
|
5
19
|
return {
|
|
6
|
-
formatFormRole:
|
|
7
|
-
formatToDateTime:
|
|
8
|
-
formatToDate:
|
|
9
|
-
formatAmount:
|
|
10
|
-
formatAmountOfPlace:
|
|
11
|
-
formatPlaceOfAmount:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
return 0;
|
|
17
|
-
},
|
|
18
|
-
formatDecimal: (t, r) => {
|
|
19
|
-
let o = Number.parseFloat(t.toString());
|
|
20
|
-
if (Number.isNaN(o)) return "";
|
|
21
|
-
o = Math.round(o * 10 ** r) / 10 ** r;
|
|
22
|
-
let e = o.toString(), n = e.indexOf(".");
|
|
23
|
-
for (n < 0 && (n = e.length, e += "."); e.length <= n + r; ) e += "0";
|
|
24
|
-
return e;
|
|
25
|
-
},
|
|
26
|
-
formatFileSize: (t, r = 2) => {
|
|
27
|
-
if (t === 0) return "0 Bytes";
|
|
28
|
-
const o = 1e3, e = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], n = Math.floor(Math.log(t) / Math.log(o));
|
|
29
|
-
return `${Number.parseFloat((t / o ** n).toFixed(r))} ${e[n]}`;
|
|
30
|
-
},
|
|
31
|
-
formatPeriod: (t, r = "period") => {
|
|
32
|
-
if (!t) return "";
|
|
33
|
-
typeof t == "number" && (t = t.toString()), typeof t == "string" && (t = t.replace(/[-.]/g, ""));
|
|
34
|
-
const o = t.slice(0, 4), e = t.slice(4, 6), n = {
|
|
35
|
-
period: "期",
|
|
36
|
-
month: "月"
|
|
37
|
-
};
|
|
38
|
-
return r === "period" ? `${o}年${e}${n[r]}` : ` ${e}/${o}`;
|
|
39
|
-
}
|
|
20
|
+
formatFormRole: u,
|
|
21
|
+
formatToDateTime: n,
|
|
22
|
+
formatToDate: f,
|
|
23
|
+
formatAmount: p,
|
|
24
|
+
formatAmountOfPlace: a,
|
|
25
|
+
formatPlaceOfAmount: e,
|
|
26
|
+
formatDecimal: i,
|
|
27
|
+
formatFileSize: m,
|
|
28
|
+
formatPeriod: t
|
|
40
29
|
};
|
|
41
30
|
}
|
|
42
31
|
export {
|
|
43
|
-
|
|
32
|
+
z as useFormat
|
|
44
33
|
};
|
|
@@ -2,8 +2,9 @@ import "axios";
|
|
|
2
2
|
import "element-plus";
|
|
3
3
|
import { isFunction as f } from "../packages/utils/src/is.js";
|
|
4
4
|
import "vue";
|
|
5
|
-
import "xe-utils";
|
|
6
5
|
import "dayjs";
|
|
6
|
+
import "numeral";
|
|
7
|
+
import "xe-utils";
|
|
7
8
|
import "dayjs/plugin/utc";
|
|
8
9
|
import "dayjs/plugin/timezone";
|
|
9
10
|
import "../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
@@ -70,7 +71,7 @@ function v(t, n) {
|
|
|
70
71
|
const r = (s = t.value) == null ? void 0 : s[n];
|
|
71
72
|
return Array.isArray(r) ? r : [];
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
+
function De(t, n = {}) {
|
|
74
75
|
const r = [...new Set(t.map((e) => e.code))], s = t.reduce(
|
|
75
76
|
(e, c) => (e[c.code] = (e[c.code] || 0) + 1, e),
|
|
76
77
|
{}
|
|
@@ -216,5 +217,5 @@ function Be(t, n = {}) {
|
|
|
216
217
|
};
|
|
217
218
|
}
|
|
218
219
|
export {
|
|
219
|
-
|
|
220
|
+
De as usePanelSelectSchemas
|
|
220
221
|
};
|
|
@@ -3,6 +3,7 @@ import "axios";
|
|
|
3
3
|
import "element-plus";
|
|
4
4
|
import "dayjs";
|
|
5
5
|
import "vue";
|
|
6
|
+
import "numeral";
|
|
6
7
|
import "xe-utils";
|
|
7
8
|
import "dayjs/plugin/utc";
|
|
8
9
|
import "dayjs/plugin/timezone";
|
|
@@ -24,17 +25,17 @@ function h(r, e) {
|
|
|
24
25
|
}
|
|
25
26
|
function d(r) {
|
|
26
27
|
return new Promise((e, s) => {
|
|
27
|
-
const
|
|
28
|
-
|
|
28
|
+
const o = new FileReader();
|
|
29
|
+
o.onload = () => e(o.result), o.onerror = () => s(o.error ?? new Error("Blob 转 DataURL 失败")), o.readAsDataURL(r);
|
|
29
30
|
});
|
|
30
31
|
}
|
|
31
32
|
async function x(r, e, s) {
|
|
32
|
-
const
|
|
33
|
-
t.append("key",
|
|
33
|
+
const n = `${s || e.dir || "notice"}/${Date.now()}_${r.name}`, t = new FormData();
|
|
34
|
+
t.append("key", n), t.append("policy", e.policy), t.append("x-oss-signature-version", e.version), t.append("x-oss-signature", e.signature), t.append("x-oss-credential", e.x_oss_credential), t.append("x-oss-date", e.x_oss_date), t.append("x-oss-security-token", e.security_token), e.callback && t.append("callback", e.callback), t.append("success_action_status", "200"), t.append("file", r);
|
|
34
35
|
const a = await fetch(e.host, { method: "POST", body: t });
|
|
35
36
|
if (!a.ok && a.status !== 203)
|
|
36
37
|
throw new Error(`OSS 上传失败: ${a.status}`);
|
|
37
|
-
return
|
|
38
|
+
return n;
|
|
38
39
|
}
|
|
39
40
|
function k(r) {
|
|
40
41
|
const e = r ?? g.uploadOssApi;
|
|
@@ -43,21 +44,21 @@ function k(r) {
|
|
|
43
44
|
return e;
|
|
44
45
|
}
|
|
45
46
|
async function p(r, e) {
|
|
46
|
-
const s = k(e == null ? void 0 : e.uploadOssApi),
|
|
47
|
+
const s = k(e == null ? void 0 : e.uploadOssApi), o = (e == null ? void 0 : e.format) ?? "png", n = (e == null ? void 0 : e.fileName) ?? O(o), t = h(r, n), a = await s(t), c = await x(t, a, e == null ? void 0 : e.ossDir);
|
|
47
48
|
return { blob: r, file: t, ossKey: c };
|
|
48
49
|
}
|
|
49
|
-
function
|
|
50
|
+
function G() {
|
|
50
51
|
const r = y();
|
|
51
|
-
async function e(
|
|
52
|
-
const a = await r.captureToBlob(
|
|
52
|
+
async function e(n, t) {
|
|
53
|
+
const a = await r.captureToBlob(n, t);
|
|
53
54
|
return p(a, t);
|
|
54
55
|
}
|
|
55
|
-
async function s(
|
|
56
|
-
const a = await r.captureToBlob(
|
|
56
|
+
async function s(n, t) {
|
|
57
|
+
const a = await r.captureToBlob(n, t), [c, i] = await Promise.all([d(a), p(a, t)]);
|
|
57
58
|
return { ...i, dataUrl: c };
|
|
58
59
|
}
|
|
59
|
-
async function n
|
|
60
|
-
const { ossDir: a, fileName: c, uploadOssApi: i, output: m, ...f } = t, u = await r.captureComponent(
|
|
60
|
+
async function o(n, t) {
|
|
61
|
+
const { ossDir: a, fileName: c, uploadOssApi: i, output: m, ...f } = t, u = await r.captureComponent(n, {
|
|
61
62
|
...f,
|
|
62
63
|
output: "blob"
|
|
63
64
|
}), b = {
|
|
@@ -75,10 +76,10 @@ function L() {
|
|
|
75
76
|
return {
|
|
76
77
|
captureToBlob: e,
|
|
77
78
|
captureToDataUrl: s,
|
|
78
|
-
captureComponent:
|
|
79
|
+
captureComponent: o,
|
|
79
80
|
isCapturing: r.isCapturing
|
|
80
81
|
};
|
|
81
82
|
}
|
|
82
83
|
export {
|
|
83
|
-
|
|
84
|
+
G as useScreenshotOss
|
|
84
85
|
};
|
|
@@ -2,15 +2,16 @@ import "axios";
|
|
|
2
2
|
import "element-plus";
|
|
3
3
|
import "dayjs";
|
|
4
4
|
import { getCurrentScope as p, onScopeDispose as i } from "vue";
|
|
5
|
-
import
|
|
5
|
+
import "numeral";
|
|
6
|
+
import { debounce as m } from "../../utils/src/tool.js";
|
|
6
7
|
import "../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
7
8
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
8
9
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
9
10
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
10
11
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
11
12
|
import "lodash-es";
|
|
12
|
-
function
|
|
13
|
-
const o =
|
|
13
|
+
function g(r, t, e) {
|
|
14
|
+
const o = m(r, t ?? 200, e);
|
|
14
15
|
return p() && i(o.cancel), {
|
|
15
16
|
/**
|
|
16
17
|
* 防抖函数,保持原函数的返回类型
|
|
@@ -28,5 +29,5 @@ function S(r, e, t) {
|
|
|
28
29
|
};
|
|
29
30
|
}
|
|
30
31
|
export {
|
|
31
|
-
|
|
32
|
+
g as useDebounceFn
|
|
32
33
|
};
|
|
@@ -2,8 +2,9 @@ import { ref as E, getCurrentInstance as O, render as w, nextTick as h, toValue
|
|
|
2
2
|
import "axios";
|
|
3
3
|
import "element-plus";
|
|
4
4
|
import { isNumber as P } from "../../utils/src/is.js";
|
|
5
|
-
import "xe-utils";
|
|
6
5
|
import "dayjs";
|
|
6
|
+
import "numeral";
|
|
7
|
+
import "xe-utils";
|
|
7
8
|
import "dayjs/plugin/utc";
|
|
8
9
|
import "dayjs/plugin/timezone";
|
|
9
10
|
import "../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
@@ -47,7 +48,7 @@ function _(e) {
|
|
|
47
48
|
function $(e, t) {
|
|
48
49
|
e.style.cssText = (t == null ? void 0 : t.containerStyle) ?? W, (!(t != null && t.containerStyle) || !/width\s*:/i.test(t.containerStyle)) && (e.style.width = _(t));
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
+
function ee() {
|
|
51
52
|
var y;
|
|
52
53
|
const e = E(!1), t = E(null), f = ((y = O()) == null ? void 0 : y.appContext) ?? null;
|
|
53
54
|
async function d(u, r) {
|
|
@@ -132,5 +133,5 @@ function p() {
|
|
|
132
133
|
};
|
|
133
134
|
}
|
|
134
135
|
export {
|
|
135
|
-
|
|
136
|
+
ee as useElementScreenshot
|
|
136
137
|
};
|
|
@@ -3,6 +3,7 @@ import "axios";
|
|
|
3
3
|
import "element-plus";
|
|
4
4
|
import "dayjs";
|
|
5
5
|
import { toValue as v, getCurrentInstance as d, useSlots as b, useAttrs as O, computed as P } from "vue";
|
|
6
|
+
import "numeral";
|
|
6
7
|
import { getFirstNonNullOrUndefined as V } from "../../utils/src/tool.js";
|
|
7
8
|
import "../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
8
9
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
@@ -26,20 +27,20 @@ function g(o, e, r) {
|
|
|
26
27
|
);
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
+
function q(o, e) {
|
|
30
31
|
const r = {};
|
|
31
32
|
return Object.keys(o).forEach((t) => {
|
|
32
33
|
r[t] = g(t, o, e);
|
|
33
34
|
}), r;
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
+
function w(o) {
|
|
36
37
|
const e = {};
|
|
37
38
|
for (const [r, t] of Object.entries(o))
|
|
38
39
|
e[r] = v(t);
|
|
39
40
|
return e;
|
|
40
41
|
}
|
|
41
42
|
export {
|
|
42
|
-
|
|
43
|
+
w as getPriorityValues,
|
|
43
44
|
g as usePriorityValue,
|
|
44
|
-
|
|
45
|
+
q as usePriorityValues
|
|
45
46
|
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import i from "dayjs";
|
|
2
|
+
import f from "numeral";
|
|
3
|
+
import { isNumber as s, isNullOrUnDef as u } from "./is.js";
|
|
4
|
+
const m = "0,0.00", a = "YYYY-MM-DD HH:mm:ss", c = "YYYY-MM-DD";
|
|
5
|
+
function B(r, t = m) {
|
|
6
|
+
return r ? f(r).format(t) : "0.00";
|
|
7
|
+
}
|
|
8
|
+
function D(r, t = m) {
|
|
9
|
+
return r ? f(r).format(t) : "0.00";
|
|
10
|
+
}
|
|
11
|
+
function g(r) {
|
|
12
|
+
return r ? f(f(r).format(m)).value() : 0;
|
|
13
|
+
}
|
|
14
|
+
function A(r, t) {
|
|
15
|
+
if (u(r) || r === "") return "";
|
|
16
|
+
let n = Number.parseFloat(r.toString());
|
|
17
|
+
if (Number.isNaN(n)) return "";
|
|
18
|
+
n = Math.round(n * 10 ** t) / 10 ** t;
|
|
19
|
+
let o = n.toString(), e = o.indexOf(".");
|
|
20
|
+
for (e < 0 && (e = o.length, o += "."); o.length <= e + t; ) o += "0";
|
|
21
|
+
return o;
|
|
22
|
+
}
|
|
23
|
+
function Y(r, t = 2) {
|
|
24
|
+
if (u(r) || r === 0) return "0 Bytes";
|
|
25
|
+
const n = 1e3, o = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], e = Math.floor(Math.log(r) / Math.log(n));
|
|
26
|
+
return `${Number.parseFloat((r / n ** e).toFixed(t))} ${o[e]}`;
|
|
27
|
+
}
|
|
28
|
+
function h(r, t = "period") {
|
|
29
|
+
if (!r) return "";
|
|
30
|
+
const n = (s(r) ? r.toString() : r).replace(/[-.]/g, ""), o = n.slice(0, 4), e = n.slice(4, 6);
|
|
31
|
+
return t === "period" ? `${o}年${e}期` : ` ${e}/${o}`;
|
|
32
|
+
}
|
|
33
|
+
function N(r, t = a) {
|
|
34
|
+
return u(r) ? "--" : i(r).isValid() ? i(r).format(t) : "--";
|
|
35
|
+
}
|
|
36
|
+
function O(r, t = c, n = !1) {
|
|
37
|
+
return u(r) ? "--" : n ? r ? i(+r).format(t) : "--" : i(r).isValid() ? i(r).format(t) : "--";
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
B as formatAmount,
|
|
41
|
+
D as formatAmountOfPlace,
|
|
42
|
+
A as formatDecimal,
|
|
43
|
+
Y as formatFileSize,
|
|
44
|
+
h as formatPeriod,
|
|
45
|
+
g as formatPlaceOfAmount,
|
|
46
|
+
O as formatToDate,
|
|
47
|
+
N as formatToDateTime
|
|
48
|
+
};
|
|
@@ -2,8 +2,9 @@ import { h as l, defineComponent as w, shallowRef as b, onMounted as $ } from "v
|
|
|
2
2
|
import "axios";
|
|
3
3
|
import "element-plus";
|
|
4
4
|
import { isFunction as c } from "../../packages/utils/src/is.js";
|
|
5
|
-
import "xe-utils";
|
|
6
5
|
import "dayjs";
|
|
6
|
+
import "numeral";
|
|
7
|
+
import "xe-utils";
|
|
7
8
|
import "dayjs/plugin/utc";
|
|
8
9
|
import "dayjs/plugin/timezone";
|
|
9
10
|
import "../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
@@ -12,7 +13,7 @@ import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8
|
|
|
12
13
|
import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
13
14
|
import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
14
15
|
import { cloneDeep as f } from "lodash-es";
|
|
15
|
-
function
|
|
16
|
+
function _() {
|
|
16
17
|
return {
|
|
17
18
|
install(C) {
|
|
18
19
|
C.renderer.add("renderCellContent", {
|
|
@@ -65,5 +66,5 @@ function Y() {
|
|
|
65
66
|
};
|
|
66
67
|
}
|
|
67
68
|
export {
|
|
68
|
-
|
|
69
|
+
_ as createVxePluginRenderCellContent
|
|
69
70
|
};
|
|
@@ -3,8 +3,9 @@ import { omit as U } from "lodash-es";
|
|
|
3
3
|
import { h as w, defineComponent as _, ref as y } from "vue";
|
|
4
4
|
import "axios";
|
|
5
5
|
import { isFunction as u } from "../../packages/utils/src/is.js";
|
|
6
|
-
import "xe-utils";
|
|
7
6
|
import "dayjs";
|
|
7
|
+
import "numeral";
|
|
8
|
+
import "xe-utils";
|
|
8
9
|
import "dayjs/plugin/utc";
|
|
9
10
|
import "dayjs/plugin/timezone";
|
|
10
11
|
import "../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
@@ -35,31 +36,31 @@ function j(a) {
|
|
|
35
36
|
inactive: t.inactiveValue ?? O
|
|
36
37
|
};
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
+
function ae() {
|
|
39
40
|
return {
|
|
40
41
|
install(a) {
|
|
41
42
|
a.renderer.add("switchStatus", {
|
|
42
43
|
renderTableDefault(t, l) {
|
|
43
|
-
const { row: i, column:
|
|
44
|
+
const { row: i, column: r } = l, e = t.props ?? {}, v = U(e, [...D]), E = C(v);
|
|
44
45
|
return w(
|
|
45
46
|
_({
|
|
46
47
|
name: "TtVxeSwitchCell",
|
|
47
48
|
setup: () => {
|
|
48
|
-
const s = y(!1), { active:
|
|
49
|
+
const s = y(!1), { active: n, inactive: m } = j(e);
|
|
49
50
|
return () => w(L, {
|
|
50
|
-
activeValue:
|
|
51
|
+
activeValue: n,
|
|
51
52
|
inactiveValue: m,
|
|
52
53
|
...E,
|
|
53
|
-
modelValue: i[
|
|
54
|
+
modelValue: i[r.field],
|
|
54
55
|
loading: s.value,
|
|
55
56
|
"onUpdate:modelValue": (o) => {
|
|
56
|
-
i[
|
|
57
|
+
i[r.field] = o;
|
|
57
58
|
},
|
|
58
59
|
beforeChange: async () => {
|
|
59
60
|
var d;
|
|
60
|
-
const o = i[
|
|
61
|
+
const o = i[r.field];
|
|
61
62
|
if ((u(e.beforeChange) ? await ((d = e.beforeChange) == null ? void 0 : d.call(e, o)) : !0) === !1 || !u(e.api)) return !1;
|
|
62
|
-
const T = o ===
|
|
63
|
+
const T = o === n ? m : n, b = `是否确认${o === n ? "关闭" : "开启"}`;
|
|
63
64
|
let p = !1;
|
|
64
65
|
return await x({
|
|
65
66
|
title: e.confirmTitle || "温馨提示",
|
|
@@ -72,9 +73,9 @@ function oe() {
|
|
|
72
73
|
var h, V;
|
|
73
74
|
if (B === "confirm") {
|
|
74
75
|
f.confirmButtonLoading = !0;
|
|
75
|
-
let c = { [
|
|
76
|
+
let c = { [r.field]: T, id: i.id };
|
|
76
77
|
if (s.value = !0, u(e.beforeFetch)) {
|
|
77
|
-
const S = await ((h = e.beforeFetch) == null ? void 0 : h.call(e, c, i,
|
|
78
|
+
const S = await ((h = e.beforeFetch) == null ? void 0 : h.call(e, c, i, r));
|
|
78
79
|
c = {
|
|
79
80
|
...c,
|
|
80
81
|
...S
|
|
@@ -83,7 +84,7 @@ function oe() {
|
|
|
83
84
|
const F = await e.api(c).finally(() => {
|
|
84
85
|
s.value = !1, f.confirmButtonLoading = !1;
|
|
85
86
|
});
|
|
86
|
-
(V = e.afterFetch) == null || V.call(e, F), A.success(o ===
|
|
87
|
+
(V = e.afterFetch) == null || V.call(e, F), A.success(o === n ? "禁用成功" : "启用成功"), f.confirmButtonLoading = !1, g(), p = !0;
|
|
87
88
|
} else
|
|
88
89
|
g();
|
|
89
90
|
}
|
|
@@ -99,5 +100,5 @@ function oe() {
|
|
|
99
100
|
};
|
|
100
101
|
}
|
|
101
102
|
export {
|
|
102
|
-
|
|
103
|
+
ae as createVxePluginSwitchStatus
|
|
103
104
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dazhicheng/ui",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"lodash-es": "^4.17.23",
|
|
66
66
|
"vue": "^3.5.21",
|
|
67
67
|
"vue-router": "^5.0.2",
|
|
68
|
-
"vxe-pc-ui": "^4.
|
|
69
|
-
"vxe-table": "^4.
|
|
68
|
+
"vxe-pc-ui": "^4.14.15",
|
|
69
|
+
"vxe-table": "^4.18.13",
|
|
70
70
|
"@dazhicheng/hooks": "1.4.53",
|
|
71
71
|
"@dazhicheng/utils": "1.3.50"
|
|
72
72
|
},
|