@otwb/ui 2.0.34 → 2.0.36
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.
|
@@ -3,7 +3,7 @@ import { i as vTooltip } from "./directives-CRvPGywW.js";
|
|
|
3
3
|
import { g as useStyle, h as useMergedClsPrefix, n as cB, r as cE, t as c } from "./use-style-DcT-1dj4.js";
|
|
4
4
|
import { Fragment, computed, createTextVNode, createVNode, defineComponent, inject, isVNode, mergeProps, nextTick, reactive, ref, shallowRef, toRaw, toRef, toValue, unref, useTemplateRef, watch, withDirectives } from "vue";
|
|
5
5
|
import { toReactive, unrefElement, until, useCurrentElement, useElementSize, watchDebounced } from "@vueuse/core";
|
|
6
|
-
import { NAvatar, NAvatarGroup, NButton, NCard, NCheckbox, NCheckboxGroup, NDataTable, NDropdown, NEllipsis, NEmpty, NFlex, NForm, NFormItem, NGi, NGrid, NH4, NIcon, NInput, NList, NListItem, NPagination, NPerformantEllipsis, NPopover, NRadio, NRadioButton, NRadioGroup, NSelect, NSpin, NTag, NText, NTooltip, NTransfer, NTree, NTreeSelect, dataTableProps, formProps, useDialog } from "ithinkdt-ui";
|
|
6
|
+
import { NAvatar, NAvatarGroup, NButton, NCard, NCheckbox, NCheckboxGroup, NDataTable, NDropdown, NEllipsis, NEmpty, NFlex, NForm, NFormItem, NGi, NGrid, NH4, NIcon, NInput, NList, NListItem, NPagination, NPerformantEllipsis, NPopover, NRadio, NRadioButton, NRadioGroup, NSelect, NSpin, NTag, NText, NTooltip, NTransfer, NTree, NTreeSelect, dataTableProps, formProps, useDialog, useMessage } from "ithinkdt-ui";
|
|
7
7
|
import { useRoute } from "vue-router";
|
|
8
8
|
import { VOverflow, VResizeObserver } from "vueuc";
|
|
9
9
|
import { Sortable } from "sortablejs/modular/sortable.core.esm.js";
|
|
@@ -11,6 +11,7 @@ import { request } from "@otwb/common/request";
|
|
|
11
11
|
import { pickProps } from "@otwb/common/object";
|
|
12
12
|
import { PAGE_INJECTION, useFormModal } from "@otwb/page";
|
|
13
13
|
import { Sortable as Sortable$1 } from "sortablejs";
|
|
14
|
+
import "lg.table-plus";
|
|
14
15
|
import useLocale from "ithinkdt-ui/es/_mixins/use-locale.mjs";
|
|
15
16
|
import { flattenTree, walkTree } from "@otwb/common";
|
|
16
17
|
const NCheckboxes = /* @__PURE__ */ defineComponent({
|
|
@@ -407,8 +408,8 @@ const DataCustom = /* @__PURE__ */ defineComponent({
|
|
|
407
408
|
save: ""
|
|
408
409
|
},
|
|
409
410
|
setup(x, { emit: S }) {
|
|
410
|
-
let { t: C } = useI18n(), w = useRoute();
|
|
411
|
-
function
|
|
411
|
+
let { t: C } = useI18n(), w = useRoute(), T = useMessage();
|
|
412
|
+
function E() {
|
|
412
413
|
if (x.showFixed) {
|
|
413
414
|
w.name + "";
|
|
414
415
|
let e = w.name + "__table";
|
|
@@ -416,18 +417,18 @@ const DataCustom = /* @__PURE__ */ defineComponent({
|
|
|
416
417
|
__table: localStorage.getItem(e),
|
|
417
418
|
url: w.name
|
|
418
419
|
}, { requestType: "json" }).then((e) => {
|
|
419
|
-
|
|
420
|
+
T.success("配置保存成功!");
|
|
420
421
|
});
|
|
421
422
|
} else S("save");
|
|
422
423
|
}
|
|
423
|
-
function
|
|
424
|
+
function D(e, b, C) {
|
|
424
425
|
S("custom", {
|
|
425
426
|
key: e[x.keyField],
|
|
426
427
|
[b]: C
|
|
427
428
|
});
|
|
428
429
|
}
|
|
429
|
-
let
|
|
430
|
-
return watch(
|
|
430
|
+
let k = ref();
|
|
431
|
+
return watch(k, (e) => {
|
|
431
432
|
e.$el && Sortable.create(e.$el, {
|
|
432
433
|
animation: 150,
|
|
433
434
|
ghostClass: "ghost",
|
|
@@ -459,14 +460,14 @@ const DataCustom = /* @__PURE__ */ defineComponent({
|
|
|
459
460
|
text: !0,
|
|
460
461
|
type: "primary",
|
|
461
462
|
size: "small",
|
|
462
|
-
onClick: () =>
|
|
463
|
+
onClick: () => E()
|
|
463
464
|
}, { default: () => [createTextVNode("保存")] }), createVNode(NButton, {
|
|
464
465
|
text: !0,
|
|
465
466
|
type: "primary",
|
|
466
467
|
size: "small",
|
|
467
468
|
onClick: () => S("custom", !0)
|
|
468
469
|
}, _isSlot$6(e = C("common.page.custom.reset")) ? e : { default: () => [e] })])] }), createVNode(NFlex, {
|
|
469
|
-
ref:
|
|
470
|
+
ref: k,
|
|
470
471
|
vertical: !0
|
|
471
472
|
}, _isSlot$6(b = x.data.filter((e) => e[x.visiblityField] !== !1).map((e) => createVNode(DataCustomItem, {
|
|
472
473
|
key: e[x.keyField],
|
|
@@ -474,8 +475,8 @@ const DataCustom = /* @__PURE__ */ defineComponent({
|
|
|
474
475
|
hidden: e[x.hiddenField],
|
|
475
476
|
fixed: e[x.fixedField],
|
|
476
477
|
showFixed: x.showFixed,
|
|
477
|
-
onUpdateHidden: (b) =>
|
|
478
|
-
onUpdateFixed: (b) =>
|
|
478
|
+
onUpdateHidden: (b) => D(e, "hidden", b),
|
|
479
|
+
onUpdateFixed: (b) => D(e, "fixed", b)
|
|
479
480
|
}, null))) ? b : { default: () => [b] })] });
|
|
480
481
|
}
|
|
481
482
|
});
|
|
@@ -751,69 +752,69 @@ const DataForm = /* @__PURE__ */ defineComponent({
|
|
|
751
752
|
"collapse"
|
|
752
753
|
],
|
|
753
754
|
setup(b, { expose: x, emit: S }) {
|
|
754
|
-
let C = useRoute(), w = () => {
|
|
755
|
+
let C = useRoute(), w = useMessage(), T = () => {
|
|
755
756
|
let e = C.name + "__form";
|
|
756
757
|
C.name + "", request.post("/api/v1/otwb-cloud-uc/cli/module/custom-config/save", {
|
|
757
758
|
__form: localStorage.getItem(e),
|
|
758
759
|
url: C.name
|
|
759
760
|
}, { requestType: "json" }).then((e) => {
|
|
760
|
-
|
|
761
|
+
w.success("配置保存成功!");
|
|
761
762
|
});
|
|
762
|
-
}, { t:
|
|
763
|
+
}, { t: E } = useI18n(), D = (e) => {
|
|
763
764
|
S("filter", b.model, e);
|
|
764
|
-
},
|
|
765
|
+
}, k = (e) => {
|
|
765
766
|
S("reset", e), b.filterOnReset && S("filter", b.model, e);
|
|
766
|
-
},
|
|
767
|
-
|
|
767
|
+
}, A = ref(b.defaultCollapsed), j = (e) => {
|
|
768
|
+
A.value = e;
|
|
768
769
|
};
|
|
769
|
-
x({ collapse:
|
|
770
|
-
let
|
|
770
|
+
x({ collapse: j });
|
|
771
|
+
let N = reactive({
|
|
771
772
|
span: 6,
|
|
772
773
|
suffix: !0
|
|
773
774
|
});
|
|
774
775
|
return () => {
|
|
775
|
-
let { filterOnReset: e, filterText: x, resetText: C, customizable:
|
|
776
|
+
let { filterOnReset: e, filterText: x, resetText: C, customizable: w, defaultCollapsed: P, collapsible: F, grid: I,...L } = b;
|
|
776
777
|
return createVNode(DataForm, mergeProps({ grid: {
|
|
777
778
|
cols: "12 768:18 1200:30 1536:30",
|
|
778
779
|
yGap: 16,
|
|
779
780
|
xGap: 12,
|
|
780
781
|
...I,
|
|
781
|
-
collapsed:
|
|
782
|
+
collapsed: A.value
|
|
782
783
|
} }, L, {
|
|
783
784
|
showFeedback: !1,
|
|
784
|
-
showAction:
|
|
785
|
-
onSubmit:
|
|
786
|
-
onReset:
|
|
787
|
-
}), { action: ({ cols: e, spans:
|
|
788
|
-
justify:
|
|
785
|
+
showAction: N,
|
|
786
|
+
onSubmit: D,
|
|
787
|
+
onReset: k
|
|
788
|
+
}), { action: ({ cols: e, spans: D }) => (N.suffix = e < D + N.span, createVNode(NFlex, {
|
|
789
|
+
justify: N.suffix ? "end" : "start",
|
|
789
790
|
align: "center"
|
|
790
791
|
}, { default: () => [
|
|
791
|
-
F &&
|
|
792
|
+
F && N.suffix ? createVNode(NButton, {
|
|
792
793
|
class: "collapsedBtn",
|
|
793
794
|
text: !0,
|
|
794
795
|
type: "primary",
|
|
795
796
|
iconPlacement: "right",
|
|
796
|
-
renderIcon:
|
|
797
|
-
onClick: () =>
|
|
798
|
-
}, { default: () => [
|
|
799
|
-
|
|
797
|
+
renderIcon: A.value ? IDown : IUp,
|
|
798
|
+
onClick: () => j(!A.value)
|
|
799
|
+
}, { default: () => [A.value ? E("common.page.filter.expand") : E("common.page.filter.collapse")] }) : void 0,
|
|
800
|
+
N.suffix ? void 0 : createVNode("span", null, [createTextVNode("\xA0\xA0\xA0\xA0")]),
|
|
800
801
|
createVNode(NButton, {
|
|
801
802
|
class: "submitWrap",
|
|
802
803
|
attrType: "submit",
|
|
803
804
|
type: "primary",
|
|
804
805
|
disabled: b.disabled,
|
|
805
806
|
loading: b.loading
|
|
806
|
-
}, { default: () => [x ||
|
|
807
|
+
}, { default: () => [x || E("common.page.filter.submitText")] }),
|
|
807
808
|
createVNode(NButton, {
|
|
808
809
|
attrType: "reset",
|
|
809
810
|
disabled: b.disabled || b.loading
|
|
810
|
-
}, { default: () => [C ||
|
|
811
|
-
|
|
811
|
+
}, { default: () => [C || E("common.page.form.resetText")] }),
|
|
812
|
+
w ? createVNode(DataCustom, {
|
|
812
813
|
isFilter: !0,
|
|
813
814
|
keyField: "name",
|
|
814
815
|
showFixed: !1,
|
|
815
816
|
data: L.items,
|
|
816
|
-
onSave:
|
|
817
|
+
onSave: T,
|
|
817
818
|
onCustom: (e) => S("custom", e),
|
|
818
819
|
size: 16,
|
|
819
820
|
type: "primary"
|
|
@@ -930,6 +931,7 @@ const DataLocaleInput = /* @__PURE__ */ defineComponent({
|
|
|
930
931
|
10,
|
|
931
932
|
50,
|
|
932
933
|
100,
|
|
934
|
+
200,
|
|
933
935
|
500
|
|
934
936
|
]
|
|
935
937
|
}
|
|
@@ -1172,6 +1174,7 @@ const DataTable = /* @__PURE__ */ defineComponent({
|
|
|
1172
1174
|
});
|
|
1173
1175
|
};
|
|
1174
1176
|
return () => createVNode(NDataTable, {
|
|
1177
|
+
id: "table-wrap",
|
|
1175
1178
|
class: O,
|
|
1176
1179
|
data: e.data,
|
|
1177
1180
|
columns: L.value,
|
package/dist/components.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./use-i18n-Dx7V4KrY.js";
|
|
2
2
|
import "./directives-CRvPGywW.js";
|
|
3
3
|
import "./use-style-DcT-1dj4.js";
|
|
4
|
-
import { a as NRadios, c as DataSelection, d as useLocaleEdit, f as DataFilter, g as NCheckboxes, h as DataActions, i as renderUsers, l as DataPagination, m as DataCustom, n as DtUserDept, o as DataTable, p as DataForm, r as DtUserRender, s as useDataTableDrag, t as DtDeptRender, u as DataLocaleInput } from "./components-
|
|
4
|
+
import { a as NRadios, c as DataSelection, d as useLocaleEdit, f as DataFilter, g as NCheckboxes, h as DataActions, i as renderUsers, l as DataPagination, m as DataCustom, n as DtUserDept, o as DataTable, p as DataForm, r as DtUserRender, s as useDataTableDrag, t as DtDeptRender, u as DataLocaleInput } from "./components-CkECmA7m.js";
|
|
5
5
|
export { DataActions, DataCustom, DataFilter, DataForm, DataLocaleInput, DataPagination, DataSelection, DataTable, DtDeptRender, DtUserDept, DtUserRender, NCheckboxes, NRadios, renderUsers, useDataTableDrag, useLocaleEdit };
|
package/dist/page.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as useI18n } from "./use-i18n-Dx7V4KrY.js";
|
|
2
2
|
import "./directives-CRvPGywW.js";
|
|
3
3
|
import "./use-style-DcT-1dj4.js";
|
|
4
|
-
import { a as NRadios, g as NCheckboxes, n as DtUserDept, p as DataForm, r as DtUserRender, t as DtDeptRender } from "./components-
|
|
4
|
+
import { a as NRadios, g as NCheckboxes, n as DtUserDept, p as DataForm, r as DtUserRender, t as DtDeptRender } from "./components-CkECmA7m.js";
|
|
5
5
|
import { computed, createVNode, defineComponent, h, isVNode, mergeProps, nextTick, ref, shallowRef, unref } from "vue";
|
|
6
6
|
import { until } from "@vueuse/core";
|
|
7
7
|
import { NButton, NCheckbox, NColorPicker, NDatePicker, NDrawer, NDrawerContent, NFlex, NInput, NInputNumber, NModal, NScrollbar, NSelect, NText, NUpload, useMessage } from "ithinkdt-ui";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@otwb/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.36",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "otwb UI",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"@vicons/antd": "^0.13.0",
|
|
63
63
|
"@vueuse/core": "^14.0.0",
|
|
64
64
|
"date-fns": "^4.1.0",
|
|
65
|
+
"lg.table-plus": "^0.0.2",
|
|
65
66
|
"nanoid": "^5.1.6",
|
|
66
67
|
"sortablejs": "^1.15.6",
|
|
67
68
|
"vueuc": "^0.4.65",
|