@gsc-basic/components 1.0.2 → 1.0.3
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/es/index.js +43 -29
- package/dist/es/node_modules/@codemirror/autocomplete/dist/index.js +15 -15
- package/dist/es/node_modules/@codemirror/commands/dist/index.js +5 -5
- package/dist/es/node_modules/@codemirror/lang-java/dist/index.js +3 -3
- package/dist/es/node_modules/@codemirror/lang-javascript/dist/index.js +8 -8
- package/dist/es/node_modules/@codemirror/lang-json/dist/index.js +1 -1
- package/dist/es/node_modules/@codemirror/lang-python/dist/index.js +1 -1
- package/dist/es/node_modules/@codemirror/lang-sql/dist/index.js +6 -6
- package/dist/es/node_modules/@codemirror/lang-xml/dist/index.js +3 -3
- package/dist/es/node_modules/@codemirror/lang-yaml/dist/index.js +1 -1
- package/dist/es/node_modules/@codemirror/language/dist/index.js +1 -1
- package/dist/es/node_modules/@codemirror/lint/dist/index.js +7 -7
- package/dist/es/node_modules/@codemirror/search/dist/index.js +9 -9
- package/dist/es/node_modules/@codemirror/view/dist/index.js +7 -7
- package/dist/es/node_modules/@lezer/lr/dist/index.js +4 -2
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/FormApi.js +146 -142
- package/dist/es/node_modules/@tanstack/vue-table/build/lib/index.js +7 -7
- package/dist/es/node_modules/@vueuse/core/dist/index.js +1 -1
- package/dist/es/node_modules/codemirror/dist/index.js +3 -3
- package/dist/es/src/Button/index.js +6 -0
- package/dist/es/src/Button/src/Button.css +1 -0
- package/dist/es/src/Button/src/Button.vue.js +41 -0
- package/dist/es/src/Button/src/Button2.css +1 -0
- package/dist/es/src/CodeEditor/src/index.css +1 -1
- package/dist/es/src/CodeEditor/src/index.vue.js +54 -51
- package/dist/es/src/CodeEditor/src/index2.css +1 -1
- package/dist/es/src/ConfigProvider/index.js +1 -2
- package/dist/es/src/ConfigProvider/src/useGlobalConfig.js +9 -9
- package/dist/es/src/Form/index.js +6 -0
- package/dist/es/src/Form/src/Form.css +1 -0
- package/dist/es/src/Form/src/Form.vue.js +208 -0
- package/dist/es/src/Form/src/styles/form.css +1 -0
- package/dist/es/src/Grid/src/Grid.css +1 -1
- package/dist/es/src/Grid/src/Grid.vue.js +77 -83
- package/dist/es/src/Grid/src/components/ActionBar.css +1 -1
- package/dist/es/src/Grid/src/components/ActionBar.vue.js +43 -36
- package/dist/es/src/Grid/src/components/CellEditor.css +1 -1
- package/dist/es/src/Grid/src/components/CellEditor.vue.js +80 -69
- package/dist/es/src/Grid/src/components/CellEditor2.css +1 -1
- package/dist/es/src/Grid/src/components/ColumnFilter.css +1 -1
- package/dist/es/src/Grid/src/components/ColumnFilter.vue.js +45 -34
- package/dist/es/src/Grid/src/components/ColumnSettings.css +1 -1
- package/dist/es/src/Grid/src/components/ColumnSettings.vue.js +72 -49
- package/dist/es/src/Grid/src/components/DataTable.css +1 -1
- package/dist/es/src/Grid/src/components/DataTable.vue.js +251 -228
- package/dist/es/src/Grid/src/components/Pager.css +1 -1
- package/dist/es/src/Grid/src/components/Pager.vue.js +40 -31
- package/dist/es/src/Grid/src/components/QueryBar.css +1 -1
- package/dist/es/src/Grid/src/components/QueryBar.vue.js +119 -147
- package/dist/es/src/Grid/src/composables/useGridTable.js +45 -44
- package/dist/es/src/Grid/src/styles/table.css +1 -0
- package/dist/es/src/Overlay/index.js +61 -0
- package/dist/es/src/Overlay/src/Message.css +1 -0
- package/dist/es/src/Overlay/src/Message.vue.js +36 -0
- package/dist/es/src/Overlay/src/Message2.css +1 -0
- package/dist/es/src/Overlay/src/Modal.css +1 -0
- package/dist/es/src/Overlay/src/Modal.vue.js +67 -0
- package/dist/es/src/Overlay/src/Modal2.css +1 -0
- package/dist/es/src/Overlay/src/Notice.css +1 -0
- package/dist/es/src/Overlay/src/Notice.vue.js +37 -0
- package/dist/es/src/Overlay/src/Notice2.css +1 -0
- package/dist/es/src/ScaleScreen/src/index.vue.js +2 -2
- package/dist/es/src/VideoBackground/src/index.vue.js +8 -8
- package/dist/es/src/index.js +39 -25
- package/dist/es/src/styles/tokens.css +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/lib/node_modules/@lezer/lr/dist/index.js +1 -1
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/FormApi.js +1 -1
- package/dist/lib/src/Button/index.js +1 -0
- package/dist/lib/src/Button/src/Button.css +1 -0
- package/dist/lib/src/Button/src/Button.vue.js +1 -0
- package/dist/lib/src/Button/src/Button2.css +1 -0
- package/dist/lib/src/CodeEditor/src/index.css +1 -1
- package/dist/lib/src/CodeEditor/src/index.vue.js +1 -1
- package/dist/lib/src/CodeEditor/src/index2.css +1 -1
- package/dist/lib/src/ConfigProvider/index.js +1 -1
- package/dist/lib/src/Form/index.js +1 -0
- package/dist/lib/src/Form/src/Form.css +1 -0
- package/dist/lib/src/Form/src/Form.vue.js +1 -0
- package/dist/lib/src/Form/src/styles/form.css +1 -0
- package/dist/lib/src/Grid/src/Grid.css +1 -1
- package/dist/lib/src/Grid/src/Grid.vue.js +1 -1
- package/dist/lib/src/Grid/src/components/ActionBar.css +1 -1
- package/dist/lib/src/Grid/src/components/ActionBar.vue.js +1 -1
- package/dist/lib/src/Grid/src/components/CellEditor.css +1 -1
- package/dist/lib/src/Grid/src/components/CellEditor.vue.js +1 -1
- package/dist/lib/src/Grid/src/components/CellEditor2.css +1 -1
- package/dist/lib/src/Grid/src/components/ColumnFilter.css +1 -1
- package/dist/lib/src/Grid/src/components/ColumnFilter.vue.js +1 -1
- package/dist/lib/src/Grid/src/components/ColumnSettings.css +1 -1
- package/dist/lib/src/Grid/src/components/ColumnSettings.vue.js +1 -1
- package/dist/lib/src/Grid/src/components/DataTable.css +1 -1
- package/dist/lib/src/Grid/src/components/DataTable.vue.js +1 -1
- package/dist/lib/src/Grid/src/components/Pager.css +1 -1
- package/dist/lib/src/Grid/src/components/Pager.vue.js +1 -1
- package/dist/lib/src/Grid/src/components/QueryBar.css +1 -1
- package/dist/lib/src/Grid/src/components/QueryBar.vue.js +1 -1
- package/dist/lib/src/Grid/src/composables/useGridTable.js +1 -1
- package/dist/lib/src/Grid/src/styles/table.css +1 -0
- package/dist/lib/src/Overlay/index.js +1 -0
- package/dist/lib/src/Overlay/src/Message.css +1 -0
- package/dist/lib/src/Overlay/src/Message.vue.js +1 -0
- package/dist/lib/src/Overlay/src/Message2.css +1 -0
- package/dist/lib/src/Overlay/src/Modal.css +1 -0
- package/dist/lib/src/Overlay/src/Modal.vue.js +1 -0
- package/dist/lib/src/Overlay/src/Modal2.css +1 -0
- package/dist/lib/src/Overlay/src/Notice.css +1 -0
- package/dist/lib/src/Overlay/src/Notice.vue.js +1 -0
- package/dist/lib/src/Overlay/src/Notice2.css +1 -0
- package/dist/lib/src/index.js +1 -1
- package/dist/lib/src/styles/tokens.css +1 -1
- package/package.json +9 -9
- package/dist/es/src/Grid/src/styles/antd.css +0 -1
- package/dist/es/src/Grid/src/utils/exportCsv.js +0 -15
- package/dist/lib/src/Grid/src/styles/antd.css +0 -1
- package/dist/lib/src/Grid/src/utils/exportCsv.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
[data-v-
|
|
1
|
+
[data-v-729972d8],[data-v-729972d8]:before,[data-v-729972d8]:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }[data-v-729972d8]::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.text-sm[data-v-729972d8]{font-size:.875rem;line-height:1.25rem}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { computed as
|
|
1
|
+
import { computed as v, openBlock as n, createElementBlock as l, createElementVNode as o, toDisplayString as r, unref as i, Fragment as f, renderList as z, createVNode as p, withCtx as c } from "vue";
|
|
2
2
|
import { useLocale as b } from "../../../hooks/useLocale.js";
|
|
3
|
+
import { GscButton as m } from "../../../Button/index.js";
|
|
3
4
|
import './Pager.css';/* empty css */
|
|
4
|
-
import
|
|
5
|
-
const
|
|
5
|
+
import y from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const S = { class: "gsc-pager" }, N = { class: "text-sm gsc-text-secondary" }, $ = ["value"], k = ["value"], x = { class: "gsc-pager-jumper text-sm" }, C = ["value"], h = { class: "gsc-text-secondary" }, B = {
|
|
6
7
|
__name: "Pager",
|
|
7
8
|
props: {
|
|
8
9
|
page: { type: Number, default: 1 },
|
|
@@ -12,44 +13,52 @@ const f = { class: "gsc-pager" }, y = { class: "text-sm gsc-text-secondary" }, z
|
|
|
12
13
|
},
|
|
13
14
|
emits: ["update:page", "update:pageSize"],
|
|
14
15
|
setup(t) {
|
|
15
|
-
const
|
|
16
|
-
return (
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const d = t, { t: u } = b(), g = v(() => Math.max(1, Math.ceil((d.total || 0) / (d.pageSize || 1))));
|
|
17
|
+
return (s, e) => (n(), l("div", S, [
|
|
18
|
+
o("div", N, r(i(u)("gsc.grid.pager.total", { total: t.total })), 1),
|
|
19
|
+
o("select", {
|
|
19
20
|
class: "gsc-control gsc-control-auto",
|
|
20
21
|
value: t.pageSize,
|
|
21
|
-
onChange: e[0] || (e[0] = (a) =>
|
|
22
|
+
onChange: e[0] || (e[0] = (a) => s.$emit("update:pageSize", Number(a.target.value)))
|
|
22
23
|
}, [
|
|
23
|
-
(
|
|
24
|
+
(n(!0), l(f, null, z(t.pageSizeOptions, (a) => (n(), l("option", {
|
|
24
25
|
key: a,
|
|
25
26
|
value: a
|
|
26
|
-
}, i(u
|
|
27
|
-
], 40,
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
}, r(i(u)("gsc.grid.pager.pageSize", { size: a })), 9, k))), 128))
|
|
28
|
+
], 40, $),
|
|
29
|
+
p(i(m), {
|
|
30
|
+
variant: "default",
|
|
31
|
+
size: "icon",
|
|
30
32
|
disabled: t.page <= 1,
|
|
31
|
-
onClick: e[1] || (e[1] = (a) =>
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
onClick: e[1] || (e[1] = (a) => s.$emit("update:page", t.page - 1))
|
|
34
|
+
}, {
|
|
35
|
+
default: c(() => [...e[4] || (e[4] = [
|
|
36
|
+
o("span", { "aria-hidden": "true" }, "‹", -1)
|
|
37
|
+
])]),
|
|
38
|
+
_: 1
|
|
39
|
+
}, 8, ["disabled"]),
|
|
40
|
+
o("div", x, [
|
|
41
|
+
o("input", {
|
|
37
42
|
class: "gsc-control gsc-control-page gsc-control-center",
|
|
38
43
|
value: t.page,
|
|
39
|
-
onChange: e[2] || (e[2] = (a) =>
|
|
40
|
-
}, null, 40,
|
|
41
|
-
|
|
44
|
+
onChange: e[2] || (e[2] = (a) => s.$emit("update:page", Number(a.target.value || 1)))
|
|
45
|
+
}, null, 40, C),
|
|
46
|
+
o("span", h, "/ " + r(g.value), 1)
|
|
42
47
|
]),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
p(i(m), {
|
|
49
|
+
variant: "default",
|
|
50
|
+
size: "icon",
|
|
51
|
+
disabled: t.page >= g.value,
|
|
52
|
+
onClick: e[3] || (e[3] = (a) => s.$emit("update:page", t.page + 1))
|
|
53
|
+
}, {
|
|
54
|
+
default: c(() => [...e[5] || (e[5] = [
|
|
55
|
+
o("span", { "aria-hidden": "true" }, "›", -1)
|
|
56
|
+
])]),
|
|
57
|
+
_: 1
|
|
58
|
+
}, 8, ["disabled"])
|
|
50
59
|
]));
|
|
51
60
|
}
|
|
52
|
-
},
|
|
61
|
+
}, V = /* @__PURE__ */ y(B, [["__scopeId", "data-v-729972d8"]]);
|
|
53
62
|
export {
|
|
54
|
-
|
|
63
|
+
V as default
|
|
55
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[data-v-
|
|
1
|
+
[data-v-366b3fad],[data-v-366b3fad]:before,[data-v-366b3fad]:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }[data-v-366b3fad]::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.container[data-v-366b3fad]{width:100%}@media(min-width:576px){.container[data-v-366b3fad]{max-width:576px}}@media(min-width:768px){.container[data-v-366b3fad]{max-width:768px}}@media(min-width:992px){.container[data-v-366b3fad]{max-width:992px}}@media(min-width:1200px){.container[data-v-366b3fad]{max-width:1200px}}@media(min-width:1600px){.container[data-v-366b3fad]{max-width:1600px}}@media(min-width:2000px){.container[data-v-366b3fad]{max-width:2000px}}.flex[data-v-366b3fad]{display:flex}.resize[data-v-366b3fad]{resize:both}.items-center[data-v-366b3fad]{align-items:center}.gap-2[data-v-366b3fad]{gap:.5rem}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { ref as v, computed as s, onMounted as T, onBeforeUnmount as W, openBlock as N, createElementBlock as j, Fragment as I, createVNode as w, unref as r, withCtx as c, createElementVNode as g, normalizeStyle as L, createTextVNode as h, toDisplayString as x, createBlock as $, createCommentVNode as G, renderSlot as Q } from "vue";
|
|
2
|
+
import { useLocale as U } from "../../../hooks/useLocale.js";
|
|
3
|
+
import { GscForm as A } from "../../../Form/index.js";
|
|
4
|
+
import { GscButton as k } from "../../../Button/index.js";
|
|
4
5
|
import './QueryBar.css';/* empty css */
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
key: 1,
|
|
8
|
-
class: "gsc-range"
|
|
9
|
-
}, X = ["value", "onInput"], Y = ["value", "onInput"], Z = ["placeholder", "value", "onInput"], ee = ["disabled"], te = ["disabled"], ae = {
|
|
6
|
+
import D from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
7
|
+
const O = { class: "actions-left" }, P = { class: "actions-right flex items-center gap-2" }, H = {
|
|
10
8
|
__name: "QueryBar",
|
|
11
9
|
props: {
|
|
12
10
|
schema: { type: Array, default: () => [] },
|
|
13
11
|
modelValue: { type: Object, default: () => ({}) },
|
|
14
|
-
loading: { type: Boolean, default: !1 }
|
|
15
|
-
collapsedCount: { type: Number, default: 4 }
|
|
12
|
+
loading: { type: Boolean, default: !1 }
|
|
16
13
|
},
|
|
17
14
|
emits: ["update:modelValue", "search", "reset"],
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
20
|
-
function
|
|
15
|
+
setup(f, { emit: _ }) {
|
|
16
|
+
const b = f, i = _, { t: u } = U(), d = v(!0), m = v(null);
|
|
17
|
+
function z(t = []) {
|
|
21
18
|
return (t || []).filter(Boolean).map((e) => ({
|
|
22
19
|
key: e.key,
|
|
23
20
|
label: e.label ?? e.title ?? e.key,
|
|
@@ -27,158 +24,133 @@ const H = { class: "gsc-card gsc-card-pad" }, J = ["title"], M = { class: "gsc-f
|
|
|
27
24
|
span: e.span,
|
|
28
25
|
startKey: e.startKey,
|
|
29
26
|
endKey: e.endKey,
|
|
27
|
+
showTime: e.showTime || e.withTime || !1,
|
|
30
28
|
defaultValue: e.defaultValue
|
|
31
29
|
})).filter((e) => e.type === "dateRange" ? !!(e.startKey && e.endKey) : !!e.key);
|
|
32
30
|
}
|
|
33
|
-
const
|
|
31
|
+
const B = s(() => z(b.schema)), V = v(typeof window < "u" ? window.innerWidth : 1200);
|
|
34
32
|
function C() {
|
|
35
|
-
|
|
36
|
-
return v.value.forEach((e) => {
|
|
37
|
-
e.type === "dateRange" ? (t[e.startKey] = u.modelValue?.[e.startKey] ?? "", t[e.endKey] = u.modelValue?.[e.endKey] ?? "") : t[e.key] = u.modelValue?.[e.key] ?? e.defaultValue ?? "";
|
|
38
|
-
}), t;
|
|
33
|
+
typeof window < "u" && (V.value = window.innerWidth);
|
|
39
34
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
{ deep: !0 }
|
|
58
|
-
);
|
|
59
|
-
const B = m(() => v.value.length > u.collapsedCount), I = m(() => B.value && f.value ? v.value.slice(0, u.collapsedCount) : v.value), R = m(() => "grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"), E = m(() => "lg:col-span-3 xl:col-span-4");
|
|
60
|
-
function j(t) {
|
|
61
|
-
const e = Number(t?.span || 0);
|
|
62
|
-
return e === 2 ? "lg:col-span-2" : e === 3 ? "lg:col-span-3" : e === 4 ? "lg:col-span-4" : "";
|
|
35
|
+
T(() => {
|
|
36
|
+
typeof window < "u" && window.addEventListener("resize", C);
|
|
37
|
+
}), W(() => {
|
|
38
|
+
typeof window < "u" && window.removeEventListener("resize", C);
|
|
39
|
+
});
|
|
40
|
+
const p = s(() => {
|
|
41
|
+
const t = V.value || 1200;
|
|
42
|
+
return t >= 3840 ? 8 : t >= 2560 ? 7 : t >= 1920 ? 6 : t >= 1536 ? 5 : t >= 1280 ? 4 : t >= 1024 ? 3 : t >= 768 ? 2 : 1;
|
|
43
|
+
});
|
|
44
|
+
function S(t) {
|
|
45
|
+
if (!t)
|
|
46
|
+
return 1;
|
|
47
|
+
if (t.type === "dateRange")
|
|
48
|
+
return 2;
|
|
49
|
+
const e = Number(t.span || 0);
|
|
50
|
+
return e >= 1 ? e : 1;
|
|
63
51
|
}
|
|
64
|
-
function
|
|
65
|
-
|
|
52
|
+
function F(t, e) {
|
|
53
|
+
let n = 1, o = 0;
|
|
54
|
+
for (const l of t) {
|
|
55
|
+
const a = Math.min(S(l), e);
|
|
56
|
+
o + a > e ? (n += 1, o = a) : o += a;
|
|
57
|
+
}
|
|
58
|
+
return n;
|
|
66
59
|
}
|
|
67
|
-
|
|
60
|
+
const K = s(() => {
|
|
61
|
+
const t = p.value;
|
|
62
|
+
return F(B.value, t) > 2;
|
|
63
|
+
}), R = s(() => {
|
|
64
|
+
const t = B.value, e = p.value;
|
|
65
|
+
if (!K.value || !d.value)
|
|
66
|
+
return t;
|
|
67
|
+
const n = [];
|
|
68
|
+
let o = 1, l = 0;
|
|
69
|
+
for (const a of t) {
|
|
70
|
+
const y = Math.min(S(a), e);
|
|
71
|
+
if (l + y > e ? (o += 1, l = y) : l += y, o > 2)
|
|
72
|
+
break;
|
|
73
|
+
n.push(a);
|
|
74
|
+
}
|
|
75
|
+
return n;
|
|
76
|
+
}), q = s(() => {
|
|
77
|
+
const t = p.value || 1;
|
|
78
|
+
return t <= 2 ? { gridColumn: "1 / -1", display: "flex", justifyContent: "flex-end", gap: "8px", alignItems: "center" } : { gridColumn: `${Math.max(1, t - 1)} / span 2`, display: "flex", justifyContent: "flex-end", gap: "6px", alignItems: "center" };
|
|
79
|
+
});
|
|
80
|
+
function E() {
|
|
68
81
|
try {
|
|
69
|
-
|
|
82
|
+
m.value?.submit();
|
|
70
83
|
} catch {
|
|
71
|
-
p("update:modelValue", K.value || {}), p("search", K.value || {});
|
|
72
84
|
}
|
|
73
85
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
} catch {
|
|
80
|
-
}
|
|
81
|
-
}), p("update:modelValue", t), p("reset", t);
|
|
86
|
+
function M() {
|
|
87
|
+
try {
|
|
88
|
+
m.value?.reset();
|
|
89
|
+
} catch {
|
|
90
|
+
}
|
|
82
91
|
}
|
|
83
|
-
return (t, e) => (
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
],
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
92
|
+
return (t, e) => (N(), j(I, null, [
|
|
93
|
+
w(r(A), {
|
|
94
|
+
ref_key: "innerForm",
|
|
95
|
+
ref: m,
|
|
96
|
+
schema: R.value,
|
|
97
|
+
"model-value": b.modelValue,
|
|
98
|
+
"show-actions": !1,
|
|
99
|
+
"onUpdate:modelValue": e[1] || (e[1] = (n) => i("update:modelValue", n)),
|
|
100
|
+
onSubmit: e[2] || (e[2] = (n) => {
|
|
101
|
+
i("update:modelValue", n), i("search", n);
|
|
102
|
+
}),
|
|
103
|
+
onReset: e[3] || (e[3] = (n) => {
|
|
104
|
+
i("update:modelValue", n), i("reset", n);
|
|
105
|
+
})
|
|
106
|
+
}, {
|
|
107
|
+
actions: c(() => [
|
|
108
|
+
g("div", {
|
|
109
|
+
class: "gsc-form-actions-unified",
|
|
110
|
+
style: L(q.value)
|
|
111
|
+
}, [
|
|
112
|
+
g("div", O, [
|
|
113
|
+
w(r(k), {
|
|
114
|
+
variant: "default",
|
|
115
|
+
disabled: f.loading,
|
|
116
|
+
onClick: M
|
|
117
|
+
}, {
|
|
118
|
+
default: c(() => [
|
|
119
|
+
h(x(r(u)("gsc.grid.queryBar.action.reset")), 1)
|
|
120
|
+
]),
|
|
121
|
+
_: 1
|
|
122
|
+
}, 8, ["disabled"])
|
|
123
|
+
]),
|
|
124
|
+
g("div", P, [
|
|
125
|
+
w(r(k), {
|
|
126
|
+
variant: "primary",
|
|
127
|
+
disabled: f.loading,
|
|
128
|
+
onClick: E
|
|
117
129
|
}, {
|
|
118
|
-
default:
|
|
119
|
-
|
|
120
|
-
type: "date",
|
|
121
|
-
class: "gsc-control",
|
|
122
|
-
value: d.value ?? "",
|
|
123
|
-
onInput: (n) => c.setValue(n.target.value)
|
|
124
|
-
}, null, 40, X)
|
|
130
|
+
default: c(() => [
|
|
131
|
+
h(x(r(u)("gsc.grid.queryBar.action.search")), 1)
|
|
125
132
|
]),
|
|
126
133
|
_: 1
|
|
127
|
-
}, 8, ["
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
134
|
+
}, 8, ["disabled"]),
|
|
135
|
+
K.value ? (N(), $(r(k), {
|
|
136
|
+
key: 0,
|
|
137
|
+
variant: "link",
|
|
138
|
+
onClick: e[0] || (e[0] = (n) => d.value = !d.value)
|
|
131
139
|
}, {
|
|
132
|
-
default:
|
|
133
|
-
|
|
134
|
-
type: "date",
|
|
135
|
-
class: "gsc-control",
|
|
136
|
-
value: d.value ?? "",
|
|
137
|
-
onInput: (n) => c.setValue(n.target.value)
|
|
138
|
-
}, null, 40, Y)
|
|
140
|
+
default: c(() => [
|
|
141
|
+
h(x(d.value ? r(u)("gsc.grid.queryBar.action.expand") : r(u)("gsc.grid.queryBar.action.collapse")), 1)
|
|
139
142
|
]),
|
|
140
143
|
_: 1
|
|
141
|
-
}
|
|
142
|
-
])
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
placeholder: a.placeholder || s(y)("gsc.grid.queryBar.placeholder.input"),
|
|
150
|
-
value: d.value ?? "",
|
|
151
|
-
onInput: (n) => c.setValue(n.target.value)
|
|
152
|
-
}, null, 40, Z)
|
|
153
|
-
]),
|
|
154
|
-
_: 2
|
|
155
|
-
}, 1032, ["name"]))
|
|
156
|
-
])
|
|
157
|
-
], 2))), 128)),
|
|
158
|
-
l("div", {
|
|
159
|
-
class: k(["gsc-form-actions", E.value])
|
|
160
|
-
}, [
|
|
161
|
-
l("button", {
|
|
162
|
-
class: "gsc-btn gsc-btn-default",
|
|
163
|
-
disabled: V.loading,
|
|
164
|
-
onClick: $
|
|
165
|
-
}, g(s(y)("gsc.grid.queryBar.action.reset")), 9, ee),
|
|
166
|
-
l("button", {
|
|
167
|
-
class: "gsc-btn gsc-btn-primary",
|
|
168
|
-
disabled: V.loading,
|
|
169
|
-
onClick: N
|
|
170
|
-
}, g(s(y)("gsc.grid.queryBar.action.search")), 9, te),
|
|
171
|
-
B.value ? (o(), i("button", {
|
|
172
|
-
key: 0,
|
|
173
|
-
class: "gsc-btn gsc-btn-link",
|
|
174
|
-
onClick: e[0] || (e[0] = (a) => f.value = !f.value)
|
|
175
|
-
}, g(f.value ? s(y)("gsc.grid.queryBar.action.expand") : s(y)("gsc.grid.queryBar.action.collapse")), 1)) : w("", !0)
|
|
176
|
-
], 2)
|
|
177
|
-
], 2),
|
|
178
|
-
O(t.$slots, "extra", {}, void 0, !0)
|
|
179
|
-
]));
|
|
144
|
+
})) : G("", !0)
|
|
145
|
+
])
|
|
146
|
+
], 4)
|
|
147
|
+
]),
|
|
148
|
+
_: 1
|
|
149
|
+
}, 8, ["schema", "model-value"]),
|
|
150
|
+
Q(t.$slots, "extra", {}, void 0, !0)
|
|
151
|
+
], 64));
|
|
180
152
|
}
|
|
181
|
-
},
|
|
153
|
+
}, ne = /* @__PURE__ */ D(H, [["__scopeId", "data-v-366b3fad"]]);
|
|
182
154
|
export {
|
|
183
|
-
|
|
155
|
+
ne as default
|
|
184
156
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { useVueTable as
|
|
3
|
-
import { getPaginationRowModel as
|
|
4
|
-
function
|
|
1
|
+
import { ref as u, computed as g, watch as M } from "vue";
|
|
2
|
+
import { useVueTable as G } from "../../../../node_modules/@tanstack/vue-table/build/lib/index.js";
|
|
3
|
+
import { getPaginationRowModel as H, getFilteredRowModel as U, getSortedRowModel as B, getCoreRowModel as E, functionalUpdate as h } from "../../../../node_modules/@tanstack/table-core/build/lib/index.js";
|
|
4
|
+
function O(f = []) {
|
|
5
5
|
return (f || []).map((t) => ({
|
|
6
6
|
key: t.key,
|
|
7
7
|
title: t.title ?? t.label ?? t.key,
|
|
@@ -18,7 +18,7 @@ function A(f = []) {
|
|
|
18
18
|
}));
|
|
19
19
|
}
|
|
20
20
|
function J(f) {
|
|
21
|
-
return
|
|
21
|
+
return g(() => O(f.value).map((l) => ({
|
|
22
22
|
id: l.key,
|
|
23
23
|
accessorKey: l.key,
|
|
24
24
|
header: l.title,
|
|
@@ -29,11 +29,11 @@ function J(f) {
|
|
|
29
29
|
enableHiding: !0,
|
|
30
30
|
enablePinning: !0,
|
|
31
31
|
meta: { col: l },
|
|
32
|
-
cell: (
|
|
33
|
-
const d =
|
|
32
|
+
cell: (v) => {
|
|
33
|
+
const d = v.getValue();
|
|
34
34
|
if (typeof l.formatter == "function")
|
|
35
35
|
try {
|
|
36
|
-
return l.formatter(d, { row:
|
|
36
|
+
return l.formatter(d, { row: v.row.original, index: v.row.index });
|
|
37
37
|
} catch {
|
|
38
38
|
return String(d ?? "");
|
|
39
39
|
}
|
|
@@ -45,15 +45,15 @@ function Z(f = {}) {
|
|
|
45
45
|
const {
|
|
46
46
|
data: t = [],
|
|
47
47
|
request: l,
|
|
48
|
-
mode:
|
|
48
|
+
mode: v = "server",
|
|
49
49
|
pageSize: d = 10,
|
|
50
50
|
initialQuery: T = {},
|
|
51
51
|
columns: q = [],
|
|
52
52
|
rowKey: D = "id",
|
|
53
53
|
enableRowSelection: F = !1
|
|
54
|
-
} = f, P =
|
|
54
|
+
} = f, P = u(q || []), r = u(Array.isArray(t) ? (t || []).slice() : (t?.value || []).slice()), S = u({ ...T || {} }), c = u(0), z = u(!1), n = u({ pageIndex: 0, pageSize: d }), i = u([]), y = u({}), w = u({ left: [], right: [] }), b = u({}), N = J(P), o = g(() => v === "server" && typeof l == "function"), x = G({
|
|
55
55
|
get data() {
|
|
56
|
-
return
|
|
56
|
+
return r.value;
|
|
57
57
|
},
|
|
58
58
|
get columns() {
|
|
59
59
|
return N.value;
|
|
@@ -79,26 +79,27 @@ function Z(f = {}) {
|
|
|
79
79
|
return b.value;
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
|
+
// 服务端排序变更时,重置到第一页
|
|
82
83
|
onSortingChange: (e) => {
|
|
83
|
-
i.value =
|
|
84
|
+
i.value = h(e, i.value), o.value && (n.value = { ...n.value, pageIndex: 0 });
|
|
84
85
|
},
|
|
85
86
|
onPaginationChange: (e) => {
|
|
86
|
-
n.value =
|
|
87
|
+
n.value = h(e, n.value);
|
|
87
88
|
},
|
|
88
89
|
onColumnVisibilityChange: (e) => {
|
|
89
|
-
y.value =
|
|
90
|
+
y.value = h(e, y.value);
|
|
90
91
|
},
|
|
91
92
|
onColumnPinningChange: (e) => {
|
|
92
|
-
w.value =
|
|
93
|
+
w.value = h(e, w.value);
|
|
93
94
|
},
|
|
94
95
|
enableRowSelection: !!F,
|
|
95
96
|
onRowSelectionChange: (e) => {
|
|
96
|
-
b.value =
|
|
97
|
+
b.value = h(e, b.value);
|
|
97
98
|
},
|
|
98
99
|
manualPagination: o.value,
|
|
99
100
|
manualSorting: o.value,
|
|
100
101
|
manualFiltering: o.value,
|
|
101
|
-
pageCount:
|
|
102
|
+
pageCount: g(() => {
|
|
102
103
|
const e = n.value.pageSize || 1;
|
|
103
104
|
return Math.max(1, Math.ceil((c.value || 0) / e));
|
|
104
105
|
}),
|
|
@@ -106,27 +107,27 @@ function Z(f = {}) {
|
|
|
106
107
|
columnResizeMode: "onChange",
|
|
107
108
|
getCoreRowModel: E(),
|
|
108
109
|
getSortedRowModel: B(),
|
|
109
|
-
getFilteredRowModel:
|
|
110
|
-
getPaginationRowModel:
|
|
111
|
-
}), k =
|
|
110
|
+
getFilteredRowModel: U(),
|
|
111
|
+
getPaginationRowModel: H()
|
|
112
|
+
}), k = g({
|
|
112
113
|
get: () => (n.value.pageIndex || 0) + 1,
|
|
113
114
|
set: (e) => {
|
|
114
115
|
const a = Math.max(1, Number(e || 1));
|
|
115
116
|
n.value = { ...n.value, pageIndex: a - 1 };
|
|
116
117
|
}
|
|
117
|
-
}), I =
|
|
118
|
+
}), I = g({
|
|
118
119
|
get: () => n.value.pageSize,
|
|
119
120
|
set: (e) => {
|
|
120
121
|
const a = Math.max(1, Number(e || d));
|
|
121
122
|
n.value = { pageIndex: 0, pageSize: a };
|
|
122
123
|
}
|
|
123
|
-
}), R =
|
|
124
|
+
}), R = g(() => {
|
|
124
125
|
const e = i.value && i.value[0];
|
|
125
126
|
return { id: e?.id ?? null, desc: !!e?.desc };
|
|
126
|
-
}), W =
|
|
127
|
+
}), W = g(() => (x.getRowModel()?.rows || []).map((a) => a.original));
|
|
127
128
|
async function C() {
|
|
128
129
|
if (!o.value) {
|
|
129
|
-
c.value =
|
|
130
|
+
c.value = r.value.length;
|
|
130
131
|
return;
|
|
131
132
|
}
|
|
132
133
|
z.value = !0;
|
|
@@ -134,31 +135,31 @@ function Z(f = {}) {
|
|
|
134
135
|
const e = await l({
|
|
135
136
|
page: k.value,
|
|
136
137
|
pageSize: I.value,
|
|
137
|
-
query:
|
|
138
|
-
//
|
|
138
|
+
query: S.value,
|
|
139
|
+
// 向后兼容:同时提供单列排序信息和多列排序数组。
|
|
139
140
|
sort: R.value,
|
|
140
141
|
sorts: i.value
|
|
141
142
|
});
|
|
142
|
-
|
|
143
|
+
r.value = (e?.records || []).slice(), c.value = Number(e?.total ?? r.value.length);
|
|
143
144
|
} finally {
|
|
144
145
|
z.value = !1;
|
|
145
146
|
}
|
|
146
147
|
}
|
|
147
|
-
function
|
|
148
|
-
|
|
148
|
+
function j(e = {}) {
|
|
149
|
+
S.value = { ...e || {} }, o.value && (n.value = { ...n.value, pageIndex: 0 });
|
|
149
150
|
}
|
|
150
151
|
function V(e = []) {
|
|
151
|
-
|
|
152
|
+
r.value = (e || []).slice(), o.value || (c.value = r.value.length);
|
|
152
153
|
}
|
|
153
|
-
function
|
|
154
|
+
function A(e = []) {
|
|
154
155
|
P.value = (e || []).slice();
|
|
155
156
|
try {
|
|
156
|
-
const a =
|
|
157
|
+
const a = O(e || []), m = a.filter((s) => s.fixed === "left").map((s) => s.key), p = a.filter((s) => s.fixed === "right").map((s) => s.key);
|
|
157
158
|
x.setColumnPinning?.({ left: m, right: p });
|
|
158
159
|
} catch {
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
|
-
function
|
|
162
|
+
function Q(e) {
|
|
162
163
|
if (!e)
|
|
163
164
|
return;
|
|
164
165
|
const a = x.getColumn(e);
|
|
@@ -169,10 +170,10 @@ function Z(f = {}) {
|
|
|
169
170
|
const m = i.value?.[0];
|
|
170
171
|
m?.id === e ? i.value = [{ id: e, desc: !m.desc }] : i.value = [{ id: e, desc: !1 }];
|
|
171
172
|
}
|
|
172
|
-
return M(
|
|
173
|
-
() =>
|
|
174
|
-
() => {
|
|
175
|
-
|
|
173
|
+
return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "value") && M(
|
|
174
|
+
() => t.value,
|
|
175
|
+
(e) => {
|
|
176
|
+
V(e || []);
|
|
176
177
|
},
|
|
177
178
|
{ deep: !0 }
|
|
178
179
|
), M(
|
|
@@ -181,30 +182,30 @@ function Z(f = {}) {
|
|
|
181
182
|
o.value && C();
|
|
182
183
|
}
|
|
183
184
|
), M(
|
|
184
|
-
() =>
|
|
185
|
+
() => S.value,
|
|
185
186
|
() => {
|
|
186
187
|
o.value && C();
|
|
187
188
|
},
|
|
188
189
|
{ deep: !0 }
|
|
189
|
-
), o.value ? C() : c.value =
|
|
190
|
+
), o.value ? C() : c.value = r.value.length, {
|
|
190
191
|
table: x,
|
|
191
192
|
loading: z,
|
|
192
|
-
query:
|
|
193
|
+
query: S,
|
|
193
194
|
page: k,
|
|
194
195
|
pageSize: I,
|
|
195
196
|
total: c,
|
|
196
197
|
rows: W,
|
|
197
|
-
sort:
|
|
198
|
+
sort: Q,
|
|
198
199
|
sortState: R,
|
|
199
200
|
sorting: i,
|
|
200
201
|
columnVisibility: y,
|
|
201
202
|
columnPinning: w,
|
|
202
203
|
rowSelection: b,
|
|
203
204
|
load: C,
|
|
204
|
-
setQuery:
|
|
205
|
+
setQuery: j,
|
|
205
206
|
setData: V,
|
|
206
|
-
setColumns:
|
|
207
|
-
mode:
|
|
207
|
+
setColumns: A,
|
|
208
|
+
mode: v
|
|
208
209
|
};
|
|
209
210
|
}
|
|
210
211
|
export {
|