@dazhicheng/ui 1.5.203 → 1.5.204
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/_virtual/___vite-browser-external.js +6 -0
- package/dist/_virtual/__vite-browser-external.js +4 -0
- package/dist/_virtual/_commonjs-dynamic-modules.js +6 -0
- package/dist/_virtual/_commonjsHelpers.js +24 -0
- package/dist/_virtual/aes.js +4 -0
- package/dist/_virtual/cipher-core.js +4 -0
- package/dist/_virtual/core.js +4 -0
- package/dist/_virtual/enc-base64.js +4 -0
- package/dist/_virtual/enc-utf8.js +4 -0
- package/dist/_virtual/evpkdf.js +4 -0
- package/dist/_virtual/hmac.js +4 -0
- package/dist/_virtual/md5.js +4 -0
- package/dist/_virtual/mode-ecb.js +4 -0
- package/dist/_virtual/pad-pkcs7.js +4 -0
- package/dist/_virtual/sha1.js +4 -0
- package/dist/components/tt-api-component/index.js +17 -4
- package/dist/components/tt-api-component/index.vue2.js +24 -13
- package/dist/components/tt-area/TtArea.vue3.js +24 -13
- package/dist/components/tt-button/index.js +18 -5
- package/dist/components/tt-button/index.vue2.js +27 -16
- package/dist/components/tt-checkbox/index.js +17 -4
- package/dist/components/tt-checkbox/index.vue.js +38 -28
- package/dist/components/tt-drawer/index.js +17 -7
- package/dist/components/tt-drawer/src/RenderDrawer.vue.js +48 -36
- package/dist/components/tt-drawer/src/components/DrawerFooter.vue.js +39 -26
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue2.js +23 -10
- package/dist/components/tt-drawer/src/props.js +22 -9
- package/dist/components/tt-drawer/src/utils/drawer-api.js +42 -33
- package/dist/components/tt-empty/index.js +28 -18
- package/dist/components/tt-form/index.js +22 -14
- package/dist/components/tt-form/src/components/ExpandableArrow.vue2.js +23 -14
- package/dist/components/tt-form/src/components/FormActions.vue2.js +42 -32
- package/dist/components/tt-form/src/form/FormDescription.vue.js +19 -10
- package/dist/components/tt-form/src/form/FormItem.vue.js +18 -9
- package/dist/components/tt-form/src/form/FormLabel.vue.js +18 -9
- package/dist/components/tt-form/src/form/RenderContent.vue.js +25 -13
- package/dist/components/tt-form/src/form-render/FormField.vue2.js +62 -55
- package/dist/components/tt-form/src/form-render/FormLabel.vue2.js +36 -28
- package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.js +64 -56
- package/dist/components/tt-form/src/form-render/array-register/utils.js +18 -8
- package/dist/components/tt-form/src/form-render/dependencies.js +36 -24
- package/dist/components/tt-form/src/form-render/form.vue2.js +17 -7
- package/dist/components/tt-form/src/form-render/helper.js +29 -16
- package/dist/components/tt-form/src/form-render/rootWrapperClass.js +17 -7
- package/dist/components/tt-form/src/formApi.js +59 -48
- package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +17 -4
- package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +67 -57
- package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +55 -46
- package/dist/components/tt-form/src/group-form/groupFormApi.js +21 -10
- package/dist/components/tt-form/src/hooks/useForwardPriorityValues.js +27 -17
- package/dist/components/tt-form/src/hooks/useSelectCollapse.js +32 -23
- package/dist/components/tt-form/src/index.vue2.js +53 -45
- package/dist/components/tt-form/src/useFormContext.js +74 -62
- package/dist/components/tt-form-item-error-tooltip/index.js +18 -5
- package/dist/components/tt-form-item-error-tooltip/index.vue.js +32 -21
- package/dist/components/tt-icon/index.js +20 -7
- package/dist/components/tt-image/index.js +19 -6
- package/dist/components/tt-image/src/components/ImageViewer.js +27 -17
- package/dist/components/tt-loading/index.js +16 -4
- package/dist/components/tt-loading/src/directive.js +34 -22
- package/dist/components/tt-log/index.js +17 -4
- package/dist/components/tt-log/index.vue.js +21 -8
- package/dist/components/tt-modal/index.js +16 -5
- package/dist/components/tt-modal/src/RenderModal.vue.js +163 -151
- package/dist/components/tt-modal/src/components/ModalFooter.vue2.js +38 -28
- package/dist/components/tt-modal/src/components/ModalHeader.vue2.js +24 -11
- package/dist/components/tt-modal/src/components/ModalWrapper.vue.js +36 -23
- package/dist/components/tt-modal/src/props.js +22 -9
- package/dist/components/tt-modal/src/utils/modal-api.js +39 -29
- package/dist/components/tt-modal-form/index.vue.js +44 -36
- package/dist/components/tt-nav-anchor/index.js +17 -4
- package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.js +69 -57
- package/dist/components/tt-panel-select/index.js +17 -4
- package/dist/components/tt-panel-select/src/hooks/usePanelData.js +51 -40
- package/dist/components/tt-panel-select/src/index.vue.js +35 -24
- package/dist/components/tt-select/index.js +17 -4
- package/dist/components/tt-select/src/Select.vue.js +79 -68
- package/dist/components/tt-select/src/components/SelectTable.vue.js +41 -30
- package/dist/components/tt-select/src/components/Table.vue.js +86 -76
- package/dist/components/tt-select/src/hooks/useDataSource.js +59 -49
- package/dist/components/tt-select/src/hooks/useSelect.js +46 -38
- package/dist/components/tt-select/src/hooks/useSelectTableEvent.js +123 -112
- package/dist/components/tt-table/index.js +19 -12
- package/dist/components/tt-table/src/Table.vue.js +82 -71
- package/dist/components/tt-table/src/TableForm.vue.js +77 -65
- package/dist/components/tt-table/src/components/TableAction.vue.js +49 -39
- package/dist/components/tt-table/src/components/TableButtons.js +73 -60
- package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +14 -3
- package/dist/components/tt-table/src/components/TableToobalTools.vue.js +36 -25
- package/dist/components/tt-table/src/hooks/useColumns.js +72 -65
- package/dist/components/tt-table/src/hooks/useCustomColumns.js +43 -31
- package/dist/components/tt-table/src/hooks/useDataSource.js +50 -42
- package/dist/components/tt-table/src/hooks/usePagination.js +36 -25
- package/dist/components/tt-table/src/props.js +55 -42
- package/dist/components/tt-table/src/utils/table-api.js +33 -22
- package/dist/components/tt-table/src/utils/table-form-api.js +35 -24
- package/dist/components/tt-text/index.js +17 -4
- package/dist/components/tt-upload/index.js +19 -6
- package/dist/components/tt-upload/src/TtUpload.vue.js +77 -66
- package/dist/directives/disabled-tip/index.js +37 -26
- package/dist/hooks/useFormSchemasLink.js +90 -79
- package/dist/hooks/useScreenshotOss.js +49 -35
- package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js +17 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js +64 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/cipher-core.js +545 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/core.js +508 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-base64.js +81 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js +10 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/evpkdf.js +71 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/hmac.js +84 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/md5.js +72 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js +22 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js +11 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha1.js +50 -0
- package/dist/node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js +1024 -0
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.js +32 -0
- package/dist/node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/apply-style.js +11 -0
- package/dist/node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/clone-node.js +92 -0
- package/dist/node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/clone-pseudos.js +34 -0
- package/dist/node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/dataurl.js +52 -0
- package/dist/node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-images.js +43 -0
- package/dist/node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-resources.js +47 -0
- package/dist/node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-webfonts.js +122 -0
- package/dist/node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/index.js +30 -0
- package/dist/node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/mimes.js +24 -0
- package/dist/node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/util.js +106 -0
- package/dist/node_modules/.pnpm/is-plain-object@5.0.0/node_modules/is-plain-object/dist/is-plain-object.js +16 -0
- package/dist/node_modules/.pnpm/klona@2.0.6/node_modules/klona/full/index.js +21 -0
- package/dist/node_modules/.pnpm/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js +2922 -0
- package/dist/node_modules/.pnpm/vue-types@5.1.3_vue@3.5.21_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js +93 -0
- package/dist/packages/hooks/src/propTypes.js +17 -0
- package/dist/packages/hooks/src/tools.js +6 -0
- package/dist/packages/hooks/src/useDebounce.js +32 -0
- package/dist/packages/hooks/src/useDesign.js +12 -0
- package/dist/packages/hooks/src/useElementScreenshot.js +136 -0
- package/dist/packages/hooks/src/useIsScroll.js +12 -0
- package/dist/packages/hooks/src/usePriorityValue.js +45 -0
- package/dist/packages/utils/src/calc.js +14 -0
- package/dist/packages/utils/src/check.js +10 -0
- package/dist/packages/utils/src/install.js +11 -0
- package/dist/packages/utils/src/is.js +64 -0
- package/dist/packages/utils/src/merge.js +13 -0
- package/dist/packages/utils/src/stateHandler.js +33 -0
- package/dist/packages/utils/src/string.js +6 -0
- package/dist/packages/utils/src/testid-helper.js +14 -0
- package/dist/packages/utils/src/tool.js +181 -0
- package/dist/plugins/default/renderCellContent.js +39 -28
- package/dist/plugins/vxeTable/switchStatus.js +37 -26
- package/package.json +1 -1
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import { defineComponent as We, useTemplateRef as S, ref as v, shallowRef as we, computed as E, unref as d, nextTick as He, watch as U, createBlock as w, openBlock as r, mergeProps as Me, withCtx as O, createElementVNode as u, createVNode as N, createElementBlock as h, createCommentVNode as Y, Fragment as H, renderList as $, normalizeStyle as j, createTextVNode as ze, toDisplayString as J, renderSlot as K, withModifiers as Ve, normalizeClass as Q } from "vue";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import "axios";
|
|
3
|
+
import { ElCheckbox as Z, ElTooltip as Be } from "element-plus";
|
|
4
|
+
import "dayjs";
|
|
5
|
+
import "xe-utils";
|
|
6
|
+
import "dayjs/plugin/utc";
|
|
7
|
+
import "dayjs/plugin/timezone";
|
|
8
|
+
import { calc as I } from "../../../../packages/utils/src/calc.js";
|
|
9
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
10
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
11
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
12
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
13
|
+
import { debounce as Pe, cloneDeep as Se } from "lodash-es";
|
|
14
|
+
import "../../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.21_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
|
|
15
|
+
import { useDesign as Ee } from "../../../../packages/hooks/src/useDesign.js";
|
|
16
|
+
import { TtEmpty as Ne } from "../../../tt-empty/index.js";
|
|
6
17
|
import { TtText as ee } from "../../../tt-text/index.js";
|
|
7
|
-
import { debounce as Ee, cloneDeep as Ne } from "lodash-es";
|
|
8
18
|
import { VxeList as $e } from "vxe-pc-ui";
|
|
9
19
|
import { GRID_MIN_HEIGHT as Ie, GRID_MAX_HEIGHT as Le } from "../const.js";
|
|
10
20
|
import { selectTableProps as Ae } from "../props.js";
|
|
@@ -14,20 +24,20 @@ const Ge = { class: "vxe-table--render-default size--mini border--default" }, Xe
|
|
|
14
24
|
}, je = ["onClick", "onMouseenter"], Je = { class: "vxe-cell" }, Ke = {
|
|
15
25
|
key: 1,
|
|
16
26
|
class: "vxe-body--column is--padding col--ellipsis"
|
|
17
|
-
}, Qe = { class: "vxe-cell" },
|
|
27
|
+
}, Qe = { class: "vxe-cell" }, xt = /* @__PURE__ */ We({
|
|
18
28
|
name: "TtSelectTable",
|
|
19
29
|
__name: "Table",
|
|
20
30
|
props: Ae,
|
|
21
31
|
emits: ["radio-change", "checkbox-change", "scroll", "checkbox-all"],
|
|
22
|
-
setup(te, { expose: le, emit:
|
|
23
|
-
const
|
|
32
|
+
setup(te, { expose: le, emit: oe }) {
|
|
33
|
+
const o = te, b = oe, { prefixCls: ie } = Ee("select-table"), L = S("vxelist"), ne = S("table"), se = S("resizableBar"), M = v(!1), z = we(), V = v(""), x = v(!1);
|
|
24
34
|
let f = null;
|
|
25
35
|
const k = v([]), y = v(!1), C = E(() => {
|
|
26
36
|
var e, l;
|
|
27
37
|
return {
|
|
28
38
|
maxHeight: Le,
|
|
29
39
|
minHeight: Ie,
|
|
30
|
-
showHeader: ((e =
|
|
40
|
+
showHeader: ((e = o.grid) == null ? void 0 : e.showHeader) !== void 0 ? o.grid.showHeader : ((l = d(T)) == null ? void 0 : l.length) > 1 && !!o.list.length,
|
|
31
41
|
virtualYConfig: {
|
|
32
42
|
enabled: !0,
|
|
33
43
|
gt: 30,
|
|
@@ -36,27 +46,27 @@ const Ge = { class: "vxe-table--render-default size--mini border--default" }, Xe
|
|
|
36
46
|
},
|
|
37
47
|
size: "mini",
|
|
38
48
|
autoResize: !1,
|
|
39
|
-
loading:
|
|
40
|
-
data:
|
|
49
|
+
loading: o.loading,
|
|
50
|
+
data: o.list
|
|
41
51
|
};
|
|
42
|
-
}), R = E(() =>
|
|
43
|
-
var l,
|
|
44
|
-
return (
|
|
52
|
+
}), R = E(() => o.list.filter((e) => e.checked)), T = E(() => {
|
|
53
|
+
var l, i, t, s;
|
|
54
|
+
return (i = (l = o.grid) == null ? void 0 : l.columns) != null && i.length ? (t = o.grid) == null ? void 0 : t.columns : [{ title: "label", field: ((s = o.configProps) == null ? void 0 : s.labelField) ?? "label" }];
|
|
45
55
|
});
|
|
46
56
|
function ae(e, l) {
|
|
47
57
|
e.stopPropagation(), e.preventDefault(), M.value = !0;
|
|
48
|
-
const { clientX:
|
|
58
|
+
const { clientX: i } = e, t = e.target, s = t.parentNode, c = ne.value, n = t.getBoundingClientRect(), a = c == null ? void 0 : c.getBoundingClientRect(), m = t.clientWidth, _ = Math.floor(m / 2), g = I(n.x).sub((a == null ? void 0 : a.x) || 0).add(_).toNumber();
|
|
49
59
|
let D = 0, W = s.clientWidth;
|
|
50
|
-
const Re = I(
|
|
60
|
+
const Re = I(g).sub(W).add(l.minWidth || 50).toNumber(), p = se.value;
|
|
51
61
|
if (!p) return;
|
|
52
|
-
p.style.left = `${
|
|
62
|
+
p.style.left = `${g}px`, p.style.zIndex = "9999";
|
|
53
63
|
const Te = p.querySelector(".vxe-table--resizable-number-tip");
|
|
54
64
|
F(), document.onmousemove = _e, document.onmouseup = function() {
|
|
55
65
|
document.onmousemove = null, document.onmouseup = null, M.value = !1, l.style.width = `${W}px`;
|
|
56
66
|
};
|
|
57
67
|
function _e(P) {
|
|
58
68
|
P.stopPropagation(), P.preventDefault();
|
|
59
|
-
const q = P.clientX -
|
|
69
|
+
const q = P.clientX - i, De = g + q;
|
|
60
70
|
D = Math.max(De, Re), p && (p.style.left = `${D}px`, W = Math.max(I(s.clientWidth).add(q).toNumber(), l.minWidth), F());
|
|
61
71
|
}
|
|
62
72
|
function F() {
|
|
@@ -68,14 +78,14 @@ const Ge = { class: "vxe-table--render-default size--mini border--default" }, Xe
|
|
|
68
78
|
}
|
|
69
79
|
function ce(e) {
|
|
70
80
|
var l;
|
|
71
|
-
e.disabled || e.isDelete || (B(), e.isCurrent = !0, e.checked = !e.checked,
|
|
81
|
+
e.disabled || e.isDelete || (B(), e.isCurrent = !0, e.checked = !e.checked, o.multiple ? b("checkbox-change", { checked: e.checked, row: e }) : b("radio-change", { oldValue: (l = R.value) == null ? void 0 : l[0], row: e }));
|
|
72
82
|
}
|
|
73
83
|
function de(e, l) {
|
|
74
84
|
if (!l.disabled && !l.isDelete) return;
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
85
|
+
const i = e.currentTarget;
|
|
86
|
+
if (!i) return;
|
|
77
87
|
const t = l.message;
|
|
78
|
-
t && (f && (clearTimeout(f), f = null), z.value =
|
|
88
|
+
t && (f && (clearTimeout(f), f = null), z.value = i, V.value = t, x.value = !0);
|
|
79
89
|
}
|
|
80
90
|
function ue() {
|
|
81
91
|
x.value = !1, f && clearTimeout(f), f = setTimeout(() => {
|
|
@@ -83,67 +93,67 @@ const Ge = { class: "vxe-table--render-default size--mini border--default" }, Xe
|
|
|
83
93
|
}, 300);
|
|
84
94
|
}
|
|
85
95
|
function he(e, l) {
|
|
86
|
-
Array.isArray(e) ? e.forEach((
|
|
87
|
-
|
|
96
|
+
Array.isArray(e) ? e.forEach((i) => {
|
|
97
|
+
i.checked = l;
|
|
88
98
|
}) : e.checked = l;
|
|
89
99
|
}
|
|
90
100
|
function fe() {
|
|
91
|
-
|
|
101
|
+
o.list.forEach((e) => {
|
|
92
102
|
e.checked = !1;
|
|
93
103
|
}), y.value = !1;
|
|
94
104
|
}
|
|
95
|
-
function
|
|
105
|
+
function me(e) {
|
|
96
106
|
e && (e.checked = !0);
|
|
97
107
|
}
|
|
98
|
-
function
|
|
99
|
-
const e =
|
|
108
|
+
function ge() {
|
|
109
|
+
const e = o.list.find((l) => l.checked);
|
|
100
110
|
e && (e.checked = !1);
|
|
101
111
|
}
|
|
102
112
|
function A(e, l) {
|
|
103
|
-
var
|
|
104
|
-
(
|
|
113
|
+
var i;
|
|
114
|
+
(i = L.value) == null || i.scrollTo(e, l);
|
|
105
115
|
}
|
|
106
116
|
function pe() {
|
|
107
|
-
return
|
|
117
|
+
return o.list.find((e) => e.isCurrent);
|
|
108
118
|
}
|
|
109
119
|
function G(e) {
|
|
110
|
-
return
|
|
120
|
+
return o.list.findIndex((l) => l.value === (e == null ? void 0 : e.value));
|
|
111
121
|
}
|
|
112
122
|
function ve(e) {
|
|
113
|
-
var a,
|
|
114
|
-
const l = G(e),
|
|
115
|
-
A(null,
|
|
123
|
+
var a, m;
|
|
124
|
+
const l = G(e), i = (a = L.value) == null ? void 0 : a.$el.querySelector(".vxe-list--virtual-wrapper"), t = i.clientHeight, s = (m = i.querySelector(".vxe-body--row")) == null ? void 0 : m.clientHeight, c = Math.floor(t / s - 2), n = (l - c) * s;
|
|
125
|
+
A(null, n);
|
|
116
126
|
}
|
|
117
127
|
function be(e) {
|
|
118
128
|
B(), e.isCurrent = !0;
|
|
119
129
|
}
|
|
120
130
|
function B() {
|
|
121
|
-
const e =
|
|
131
|
+
const e = o.list.find((l) => l.isCurrent);
|
|
122
132
|
e && (e.isCurrent = !1);
|
|
123
133
|
}
|
|
124
134
|
function xe(e) {
|
|
125
|
-
return e !== void 0 ?
|
|
135
|
+
return e !== void 0 ? o.list[e] : o.list;
|
|
126
136
|
}
|
|
127
137
|
function ke() {
|
|
128
|
-
var
|
|
129
|
-
const e =
|
|
130
|
-
return ((t = d(T)) == null ? void 0 : t.length) * 130 <
|
|
138
|
+
var i, t;
|
|
139
|
+
const e = o.selectWidth / ((i = d(T)) == null ? void 0 : i.length);
|
|
140
|
+
return ((t = d(T)) == null ? void 0 : t.length) * 130 < o.selectWidth ? e : 130;
|
|
131
141
|
}
|
|
132
142
|
function ye(e) {
|
|
133
|
-
const { scrollTop: l, $event:
|
|
134
|
-
l > 100 && l + C.value.maxHeight >= t && !
|
|
143
|
+
const { scrollTop: l, $event: i } = e, t = i.target.scrollHeight;
|
|
144
|
+
l > 100 && l + C.value.maxHeight >= t && !o.loading && Ce(), b("scroll", e);
|
|
135
145
|
}
|
|
136
|
-
const Ce =
|
|
137
|
-
const { total: e, currentPage: l = 0 } =
|
|
138
|
-
(e &&
|
|
139
|
-
|
|
146
|
+
const Ce = Pe(() => {
|
|
147
|
+
const { total: e, currentPage: l = 0 } = o.getPagination();
|
|
148
|
+
(e && o.list.length < e || o.hasNextPage) && (o.setPagination({ currentPage: l + 1 }), He(() => {
|
|
149
|
+
o.reload();
|
|
140
150
|
}));
|
|
141
151
|
}, 200), X = {
|
|
142
152
|
clearCurrentRow: B,
|
|
143
153
|
setCheckboxRow: he,
|
|
144
154
|
clearCheckboxRow: fe,
|
|
145
|
-
setRadioRow:
|
|
146
|
-
clearRadioRow:
|
|
155
|
+
setRadioRow: me,
|
|
156
|
+
clearRadioRow: ge,
|
|
147
157
|
scrollTo: A,
|
|
148
158
|
getCurrentRecord: pe,
|
|
149
159
|
getRowIndex: G,
|
|
@@ -152,22 +162,22 @@ const Ge = { class: "vxe-table--render-default size--mini border--default" }, Xe
|
|
|
152
162
|
getData: xe
|
|
153
163
|
};
|
|
154
164
|
return U(
|
|
155
|
-
() =>
|
|
165
|
+
() => o.grid.columns,
|
|
156
166
|
() => {
|
|
157
|
-
const e = d(T), l =
|
|
158
|
-
|
|
167
|
+
const e = d(T), l = Se(e) || [];
|
|
168
|
+
o.multiple && o.showCheckbox && l.unshift({
|
|
159
169
|
width: 40,
|
|
160
170
|
type: "checkbox",
|
|
161
171
|
field: "checkbox"
|
|
162
172
|
});
|
|
163
|
-
const
|
|
173
|
+
const i = ke();
|
|
164
174
|
k.value = l.map((t) => {
|
|
165
|
-
const s = e.length <= 1 ?
|
|
166
|
-
return
|
|
175
|
+
const s = e.length <= 1 ? o.selectWidth : t.minWidth || t.width || i, c = e.length <= 1 ? o.selectWidth : t.width || i, n = t.type ? t.width : c, a = {};
|
|
176
|
+
return n && (a.width = `${n}px`), {
|
|
167
177
|
...t,
|
|
168
178
|
title: (t.title, t.title),
|
|
169
179
|
minWidth: s,
|
|
170
|
-
width:
|
|
180
|
+
width: n,
|
|
171
181
|
style: a
|
|
172
182
|
};
|
|
173
183
|
});
|
|
@@ -176,7 +186,7 @@ const Ge = { class: "vxe-table--render-default size--mini border--default" }, Xe
|
|
|
176
186
|
), U(
|
|
177
187
|
() => R.value,
|
|
178
188
|
(e) => {
|
|
179
|
-
y.value = e.length ===
|
|
189
|
+
y.value = e.length === o.list.length;
|
|
180
190
|
}
|
|
181
191
|
), le({
|
|
182
192
|
getGridInstance: () => X,
|
|
@@ -185,18 +195,18 @@ const Ge = { class: "vxe-table--render-default size--mini border--default" }, Xe
|
|
|
185
195
|
ref: "vxelist",
|
|
186
196
|
style: { height: "auto", "max-height": "360px" },
|
|
187
197
|
class: {
|
|
188
|
-
[d(
|
|
198
|
+
[d(ie)]: !0,
|
|
189
199
|
"pt-5px": !C.value.showHeader,
|
|
190
|
-
"h-60px!":
|
|
200
|
+
"h-60px!": o.list.length === 0 && o.loading
|
|
191
201
|
}
|
|
192
202
|
}, C.value, { onScroll: ye }), {
|
|
193
|
-
default: O(({ items:
|
|
203
|
+
default: O(({ items: i }) => [
|
|
194
204
|
u("div", Ge, [
|
|
195
205
|
u("table", Xe, [
|
|
196
206
|
C.value.showHeader ? (r(), h("thead", Fe, [
|
|
197
207
|
u("tr", qe, [
|
|
198
208
|
(r(!0), h(H, null, $(k.value, (t) => {
|
|
199
|
-
var s, c,
|
|
209
|
+
var s, c, n;
|
|
200
210
|
return r(), h("th", {
|
|
201
211
|
key: t.field,
|
|
202
212
|
class: "vxe-header--column fixed--width is--padding",
|
|
@@ -207,7 +217,7 @@ const Ge = { class: "vxe-table--render-default size--mini border--default" }, Xe
|
|
|
207
217
|
key: 0,
|
|
208
218
|
modelValue: y.value,
|
|
209
219
|
"onUpdate:modelValue": l[0] || (l[0] = (a) => y.value = a),
|
|
210
|
-
indeterminate: ((s = R.value) == null ? void 0 : s.length) > 0 && ((c = R.value) == null ? void 0 : c.length) < ((
|
|
220
|
+
indeterminate: ((s = R.value) == null ? void 0 : s.length) > 0 && ((c = R.value) == null ? void 0 : c.length) < ((n = o.list) == null ? void 0 : n.length),
|
|
211
221
|
onChange: re
|
|
212
222
|
}, null, 8, ["modelValue", "indeterminate"])) : (r(), h(H, { key: 1 }, [
|
|
213
223
|
ze(J(t.title), 1)
|
|
@@ -222,12 +232,12 @@ const Ge = { class: "vxe-table--render-default size--mini border--default" }, Xe
|
|
|
222
232
|
])
|
|
223
233
|
])) : Y("", !0),
|
|
224
234
|
u("tbody", null, [
|
|
225
|
-
!e.loading && !
|
|
235
|
+
!e.loading && !i.length ? (r(), h("div", Ye, [
|
|
226
236
|
K(e.$slots, "empty", {}, () => [
|
|
227
|
-
N(d(
|
|
237
|
+
N(d(Ne))
|
|
228
238
|
])
|
|
229
239
|
])) : Y("", !0),
|
|
230
|
-
(r(!0), h(H, null, $(
|
|
240
|
+
(r(!0), h(H, null, $(i, (t, s) => {
|
|
231
241
|
var c;
|
|
232
242
|
return r(), h("tr", {
|
|
233
243
|
key: t.value,
|
|
@@ -237,29 +247,29 @@ const Ge = { class: "vxe-table--render-default size--mini border--default" }, Xe
|
|
|
237
247
|
"is--current": t.isCurrent,
|
|
238
248
|
"is--delete": t.isDelete
|
|
239
249
|
}]),
|
|
240
|
-
onClick: Ve((
|
|
241
|
-
onMouseenter: (
|
|
250
|
+
onClick: Ve((n) => ce(t), ["prevent"]),
|
|
251
|
+
onMouseenter: (n) => de(n, t),
|
|
242
252
|
onMouseleave: ue
|
|
243
253
|
}, [
|
|
244
|
-
(c = k.value) != null && c.length ? (r(!0), h(H, { key: 0 }, $(k.value, (
|
|
245
|
-
var
|
|
254
|
+
(c = k.value) != null && c.length ? (r(!0), h(H, { key: 0 }, $(k.value, (n, a) => {
|
|
255
|
+
var m, _, g;
|
|
246
256
|
return r(), h("td", {
|
|
247
|
-
key:
|
|
257
|
+
key: n.field,
|
|
248
258
|
class: "is--padding vxe-body--column col--ellipsis",
|
|
249
|
-
style: j(
|
|
259
|
+
style: j(n.style)
|
|
250
260
|
}, [
|
|
251
261
|
u("div", Je, [
|
|
252
|
-
(
|
|
262
|
+
(m = n.slots) != null && m.default ? K(e.$slots, (_ = n.slots) == null ? void 0 : _.default, {
|
|
253
263
|
key: 0,
|
|
254
|
-
item: { column:
|
|
255
|
-
}) :
|
|
264
|
+
item: { column: n, row: t.item, rowIndex: s, columnIndex: a }
|
|
265
|
+
}) : n.type === "checkbox" ? (r(), w(d(Z), {
|
|
256
266
|
key: 1,
|
|
257
267
|
modelValue: t.checked,
|
|
258
268
|
"onUpdate:modelValue": (D) => t.checked = D,
|
|
259
269
|
disabled: t.isDelete || t.disabled
|
|
260
270
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])) : (r(), w(d(ee), {
|
|
261
271
|
key: 2,
|
|
262
|
-
"model-value": String(((
|
|
272
|
+
"model-value": String(((g = t.item) == null ? void 0 : g[n.field]) ?? "")
|
|
263
273
|
}, null, 8, ["model-value"]))
|
|
264
274
|
])
|
|
265
275
|
], 4);
|
|
@@ -280,7 +290,7 @@ const Ge = { class: "vxe-table--render-default size--mini border--default" }, Xe
|
|
|
280
290
|
}, [...l[1] || (l[1] = [
|
|
281
291
|
u("div", { class: "vxe-table--resizable-number-tip" }, null, -1)
|
|
282
292
|
])], 2),
|
|
283
|
-
N(d(
|
|
293
|
+
N(d(Be), {
|
|
284
294
|
offset: 5,
|
|
285
295
|
"show-arrow": !0,
|
|
286
296
|
"virtual-ref": z.value,
|
|
@@ -303,5 +313,5 @@ const Ge = { class: "vxe-table--render-default size--mini border--default" }, Xe
|
|
|
303
313
|
}
|
|
304
314
|
});
|
|
305
315
|
export {
|
|
306
|
-
|
|
316
|
+
xt as default
|
|
307
317
|
};
|
|
@@ -1,19 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import "axios";
|
|
2
|
+
import { ElMessage as fe } from "element-plus";
|
|
3
|
+
import { isFunction as v, isNullOrUnDef as w } from "../../../../packages/utils/src/is.js";
|
|
4
|
+
import { ref as g, computed as u, unref as e, watch as h, nextTick as oe, toValue as b } from "vue";
|
|
5
|
+
import "xe-utils";
|
|
6
|
+
import "dayjs";
|
|
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";
|
|
3
14
|
import { cloneDeep as B, isArray as k, set as A, get as S } from "lodash-es";
|
|
4
|
-
import {
|
|
5
|
-
import { ElMessage as oe } from "element-plus";
|
|
15
|
+
import { useDebounceFn as ge } from "@vueuse/core";
|
|
6
16
|
import { isEqualObject as x } from "../utils/index.js";
|
|
7
|
-
function
|
|
8
|
-
const
|
|
17
|
+
function ze(a, l, C) {
|
|
18
|
+
const F = g([]), P = g(""), D = g(!0), K = g([]), M = g(-1), L = g(!1), G = g(!1), E = g(!1), q = g(!1), H = u(() => e(a).isGrpc ? e(a).totalFieldGrpc || "total" : e(a).totalField || "data.pagination.total"), J = u(() => e(a).isGrpc ? e(a).dataFieldGrpc || "items" : e(a).dataField || "data"), Q = u(() => e(a).isGrpc ? e(a).resultFieldGrpc || "items" : e(a).resultField || "data.list"), W = u(() => e(a).searchField || "keyword"), V = u(() => e(a).valueField || "value"), O = u(() => e(a).labelField || "label"), z = u(() => e(a).mergeFields || []), X = u(() => e(a).isGrpc ? e(a).currentPageFieldGrpc || "page.index" : e(a).currentPageField || "pageIndex"), Y = u(() => e(a).isGrpc ? e(a).pageSizeFieldGrpc || "page.size" : e(a).pageSizeField || "pageSize"), R = u(() => e(a).deleteField || ""), Z = u(() => e(a).messageField || ""), $ = u(() => e(a).hasNextPageField), N = u(() => e(a).immediate || !1), p = u(() => e(a).changeDataClearable || !1), ee = u(() => e(a).defaultSingle), te = u(() => e(a).isSelectFirstOption), ae = u(() => e(G) || e(L));
|
|
9
19
|
let I = e(a).isPage ?? !0;
|
|
10
20
|
async function ie(t) {
|
|
11
21
|
const i = e(a).afterFetch;
|
|
12
22
|
return i && v(i) ? await i(t) : t;
|
|
13
23
|
}
|
|
14
24
|
function ne(t, i) {
|
|
15
|
-
const n = S(t, e($) || ""),
|
|
16
|
-
return { shouldPage: n || i &&
|
|
25
|
+
const n = S(t, e($) || ""), d = S(t, e(H) || "") !== void 0;
|
|
26
|
+
return { shouldPage: n || i && d, hasNextPage: n };
|
|
17
27
|
}
|
|
18
28
|
function le(t, i, n) {
|
|
19
29
|
l.setHasNextPage(n), l.setShowPager(i || n), i && l.setPagination({
|
|
@@ -25,23 +35,23 @@ function De(a, l, C) {
|
|
|
25
35
|
return S(t, n) || [];
|
|
26
36
|
}
|
|
27
37
|
async function se(t) {
|
|
28
|
-
const i = await ie(t), { shouldPage: n, hasNextPage:
|
|
29
|
-
I = n, le(i, n,
|
|
30
|
-
const
|
|
31
|
-
q.value =
|
|
38
|
+
const i = await ie(t), { shouldPage: n, hasNextPage: d } = ne(i, I);
|
|
39
|
+
I = n, le(i, n, d);
|
|
40
|
+
const f = ce(i, n);
|
|
41
|
+
q.value = d, y(f), C("fetch-success", f);
|
|
32
42
|
}
|
|
33
43
|
async function T() {
|
|
34
|
-
var
|
|
44
|
+
var r, o;
|
|
35
45
|
if (!e(a).api || !v(e(a).api))
|
|
36
|
-
return
|
|
46
|
+
return fe({
|
|
37
47
|
message: "请传入api方法",
|
|
38
48
|
type: "error",
|
|
39
49
|
plain: !0
|
|
40
50
|
});
|
|
41
|
-
const { defaultData: t } = e(a), { extra: i } = e(l), { currentPage: n, pageSize:
|
|
42
|
-
I && (A(
|
|
51
|
+
const { defaultData: t } = e(a), { extra: i } = e(l), { currentPage: n, pageSize: d } = l.getPagination() || {}, f = {};
|
|
52
|
+
I && (A(f, e(X) || "", n || 1), A(f, e(Y) || "", d));
|
|
43
53
|
let s = {
|
|
44
|
-
...
|
|
54
|
+
...f,
|
|
45
55
|
...b(i),
|
|
46
56
|
...e(t)
|
|
47
57
|
};
|
|
@@ -49,42 +59,42 @@ function De(a, l, C) {
|
|
|
49
59
|
const c = e(a).beforeFetch;
|
|
50
60
|
c && v(c) && (s = await c(s));
|
|
51
61
|
try {
|
|
52
|
-
const
|
|
62
|
+
const m = await ((o = (r = e(a)) == null ? void 0 : r.api) == null ? void 0 : o.call(r, s).finally(() => {
|
|
53
63
|
l.setLoading(!1);
|
|
54
64
|
}));
|
|
55
|
-
await se(
|
|
56
|
-
} catch (
|
|
57
|
-
C("fetch-error",
|
|
65
|
+
await se(m), D.value = !1, L.value = !1, G.value = !1;
|
|
66
|
+
} catch (m) {
|
|
67
|
+
C("fetch-error", m);
|
|
58
68
|
}
|
|
59
69
|
}
|
|
60
70
|
function U(t) {
|
|
61
71
|
var s, c;
|
|
62
72
|
if (t.isDelete)
|
|
63
73
|
return !0;
|
|
64
|
-
const i = e(a).disableFn && v(e(a).disableFn), n = e(V),
|
|
74
|
+
const i = e(a).disableFn && v(e(a).disableFn), n = e(V), d = w(t[n]) ? t.value : t[n], f = i ? (c = (s = e(a)).disableFn) == null ? void 0 : c.call(s, d, b(l.selectValue), t) : t.disabled;
|
|
65
75
|
if (e(l).multiple && e(l.multipleLimit)) {
|
|
66
|
-
const
|
|
67
|
-
return
|
|
76
|
+
const r = b(l.selectValue) || [];
|
|
77
|
+
return f || (e(l.multipleLimit) || 0) > 0 && r.length >= (e(l.multipleLimit) || 0) && !r.includes(d);
|
|
68
78
|
}
|
|
69
|
-
return
|
|
79
|
+
return f;
|
|
70
80
|
}
|
|
71
81
|
function y(t) {
|
|
72
82
|
function i(s) {
|
|
73
83
|
var c;
|
|
74
84
|
if (k(e(z)) && e(z).length > 0) {
|
|
75
|
-
const
|
|
76
|
-
return
|
|
85
|
+
const r = (c = e(z)) == null ? void 0 : c.map((m) => s[m]), o = e(a).joinFn;
|
|
86
|
+
return o && v(o) ? o(r) : r.join("-");
|
|
77
87
|
}
|
|
78
88
|
return s[e(O)];
|
|
79
89
|
}
|
|
80
90
|
function n(s) {
|
|
81
|
-
var
|
|
91
|
+
var r;
|
|
82
92
|
const c = { ...s, mergeLabel: i(s) };
|
|
83
93
|
return w(s) ? s : {
|
|
84
94
|
item: c,
|
|
85
95
|
// 遍历列字段,将对应的值添加到结果中-TODO: 这里可以优化都是用table这里可以去掉
|
|
86
|
-
...(
|
|
87
|
-
(
|
|
96
|
+
...(r = l.columnsFields) == null ? void 0 : r.reduce(
|
|
97
|
+
(o, m) => (o[m] = c[m], o),
|
|
88
98
|
{}
|
|
89
99
|
),
|
|
90
100
|
value: w(c[e(V)]) ? c.value : c[e(V)],
|
|
@@ -94,36 +104,36 @@ function De(a, l, C) {
|
|
|
94
104
|
...e(R) ? { isDelete: !!c[e(R)] || !1 } : {}
|
|
95
105
|
};
|
|
96
106
|
}
|
|
97
|
-
let
|
|
98
|
-
e(a).isFilterEmpty && (
|
|
99
|
-
const { currentPage:
|
|
100
|
-
if (
|
|
107
|
+
let d = t.map((s) => n(s));
|
|
108
|
+
e(a).isFilterEmpty && (d = d.filter((s) => s.value));
|
|
109
|
+
const { currentPage: f } = l.getPagination() || {};
|
|
110
|
+
if (f === 1) {
|
|
101
111
|
const s = e(a).customDefault;
|
|
102
|
-
s &&
|
|
112
|
+
s && d.unshift(n(s)), F.value = d, _(-1), setTimeout(() => {
|
|
103
113
|
var c;
|
|
104
114
|
if (e(l.multiple)) {
|
|
105
|
-
const
|
|
106
|
-
|
|
115
|
+
const r = l.getKeyboardEvent && ((c = l.getKeyboardEvent) == null ? void 0 : c.call(l));
|
|
116
|
+
r && r.ArrowDown();
|
|
107
117
|
}
|
|
108
118
|
}, 30);
|
|
109
119
|
} else
|
|
110
|
-
|
|
111
|
-
K.value = B(e(
|
|
120
|
+
F.value = [...F.value, ...d];
|
|
121
|
+
K.value = B(e(F));
|
|
112
122
|
}
|
|
113
|
-
const ue =
|
|
123
|
+
const ue = ge(T, 300);
|
|
114
124
|
async function j() {
|
|
115
125
|
e(a).api && (P.value = "", l.setPagination({
|
|
116
126
|
currentPage: 1
|
|
117
127
|
}), await T());
|
|
118
128
|
}
|
|
119
|
-
async function
|
|
129
|
+
async function re(t) {
|
|
120
130
|
P.value = t;
|
|
121
131
|
}
|
|
122
132
|
function _(t) {
|
|
123
133
|
M.value = t;
|
|
124
134
|
}
|
|
125
|
-
function
|
|
126
|
-
l.renderType === "table" &&
|
|
135
|
+
function de() {
|
|
136
|
+
l.renderType === "table" && F.value.forEach((t) => {
|
|
127
137
|
t.item && (t.disabled = U(t.item));
|
|
128
138
|
});
|
|
129
139
|
}
|
|
@@ -135,9 +145,9 @@ function De(a, l, C) {
|
|
|
135
145
|
}), ue());
|
|
136
146
|
}
|
|
137
147
|
), h(
|
|
138
|
-
() =>
|
|
148
|
+
() => F.value,
|
|
139
149
|
() => {
|
|
140
|
-
e(E) && (e(p) &&
|
|
150
|
+
e(E) && (e(p) && oe(() => {
|
|
141
151
|
var i, n;
|
|
142
152
|
const t = l.getSelectEvent && ((i = l.getSelectEvent) == null ? void 0 : i.call(l));
|
|
143
153
|
(n = t == null ? void 0 : t.clear) == null || n.call(t);
|
|
@@ -174,7 +184,7 @@ function De(a, l, C) {
|
|
|
174
184
|
},
|
|
175
185
|
{ deep: !0, immediate: !0 }
|
|
176
186
|
), {
|
|
177
|
-
options:
|
|
187
|
+
options: F,
|
|
178
188
|
getDefaultSingle: ee,
|
|
179
189
|
getIsSelectFirstOption: te,
|
|
180
190
|
getImmediate: N,
|
|
@@ -184,13 +194,13 @@ function De(a, l, C) {
|
|
|
184
194
|
searchValue: P,
|
|
185
195
|
isLoaded: D,
|
|
186
196
|
dataList: K,
|
|
187
|
-
setSearchValue:
|
|
197
|
+
setSearchValue: re,
|
|
188
198
|
activeIndex: M,
|
|
189
199
|
setActiveIndex: _,
|
|
190
200
|
needLoad: ae,
|
|
191
|
-
updateOptionsDisabled:
|
|
201
|
+
updateOptionsDisabled: de
|
|
192
202
|
};
|
|
193
203
|
}
|
|
194
204
|
export {
|
|
195
|
-
|
|
205
|
+
ze as useDataSource
|
|
196
206
|
};
|