@otwb/ui 2.0.27 → 2.0.29
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.
|
@@ -4,7 +4,7 @@ import { g as useStyle, h as useMergedClsPrefix, n as cB, r as cE, t as c } from
|
|
|
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
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";
|
|
7
|
-
import { useRoute
|
|
7
|
+
import { useRoute } from "vue-router";
|
|
8
8
|
import { VOverflow, VResizeObserver } from "vueuc";
|
|
9
9
|
import { Sortable } from "sortablejs/modular/sortable.core.esm.js";
|
|
10
10
|
import { pickProps } from "@otwb/common/object";
|
|
@@ -406,28 +406,27 @@ const DataCustom = /* @__PURE__ */ defineComponent({
|
|
|
406
406
|
save: ""
|
|
407
407
|
},
|
|
408
408
|
setup(x, { emit: S }) {
|
|
409
|
-
let { t: C } = useI18n();
|
|
410
|
-
function
|
|
411
|
-
let e = useRoute$1();
|
|
409
|
+
let { t: C } = useI18n(), w = useRoute();
|
|
410
|
+
function T() {
|
|
412
411
|
if (x.showFixed) {
|
|
413
|
-
|
|
414
|
-
let
|
|
412
|
+
w.name + "";
|
|
413
|
+
let e = w.name + "__table";
|
|
415
414
|
$fetch.post(`${SERVER_CTX.SYS}/cli/module/custom-config/save`, {
|
|
416
|
-
__table: localStorage.getItem(
|
|
417
|
-
url:
|
|
415
|
+
__table: localStorage.getItem(e),
|
|
416
|
+
url: w.name
|
|
418
417
|
}, { requestType: "json" }).then((e) => {
|
|
419
418
|
$msg.success("配置保存成功!");
|
|
420
419
|
});
|
|
421
420
|
} else S("save");
|
|
422
421
|
}
|
|
423
|
-
function
|
|
422
|
+
function E(e, b, C) {
|
|
424
423
|
S("custom", {
|
|
425
424
|
key: e[x.keyField],
|
|
426
425
|
[b]: C
|
|
427
426
|
});
|
|
428
427
|
}
|
|
429
|
-
let
|
|
430
|
-
return watch(
|
|
428
|
+
let D = ref();
|
|
429
|
+
return watch(D, (e) => {
|
|
431
430
|
e.$el && Sortable.create(e.$el, {
|
|
432
431
|
animation: 150,
|
|
433
432
|
ghostClass: "ghost",
|
|
@@ -459,14 +458,14 @@ const DataCustom = /* @__PURE__ */ defineComponent({
|
|
|
459
458
|
text: !0,
|
|
460
459
|
type: "primary",
|
|
461
460
|
size: "small",
|
|
462
|
-
onClick: () =>
|
|
461
|
+
onClick: () => T()
|
|
463
462
|
}, { default: () => [createTextVNode("保存")] }), createVNode(NButton, {
|
|
464
463
|
text: !0,
|
|
465
464
|
type: "primary",
|
|
466
465
|
size: "small",
|
|
467
466
|
onClick: () => S("custom", !0)
|
|
468
467
|
}, _isSlot$6(e = C("common.page.custom.reset")) ? e : { default: () => [e] })])] }), createVNode(NFlex, {
|
|
469
|
-
ref:
|
|
468
|
+
ref: D,
|
|
470
469
|
vertical: !0
|
|
471
470
|
}, _isSlot$6(b = x.data.filter((e) => e[x.visiblityField] !== !1).map((e) => createVNode(DataCustomItem, {
|
|
472
471
|
key: e[x.keyField],
|
|
@@ -474,8 +473,8 @@ const DataCustom = /* @__PURE__ */ defineComponent({
|
|
|
474
473
|
hidden: e[x.hiddenField],
|
|
475
474
|
fixed: e[x.fixedField],
|
|
476
475
|
showFixed: x.showFixed,
|
|
477
|
-
onUpdateHidden: (b) =>
|
|
478
|
-
onUpdateFixed: (b) =>
|
|
476
|
+
onUpdateHidden: (b) => E(e, "hidden", b),
|
|
477
|
+
onUpdateFixed: (b) => E(e, "fixed", b)
|
|
479
478
|
}, null))) ? b : { default: () => [b] })] });
|
|
480
479
|
}
|
|
481
480
|
});
|
|
@@ -751,69 +750,69 @@ const DataForm = /* @__PURE__ */ defineComponent({
|
|
|
751
750
|
"collapse"
|
|
752
751
|
],
|
|
753
752
|
setup(b, { expose: x, emit: S }) {
|
|
754
|
-
let C = () => {
|
|
755
|
-
let e =
|
|
756
|
-
|
|
757
|
-
__form: localStorage.getItem(
|
|
758
|
-
url:
|
|
753
|
+
let C = useRoute(), w = () => {
|
|
754
|
+
let e = C.name + "__form";
|
|
755
|
+
C.name + "", $fetch.post(`${SERVER_CTX.SYS}/cli/module/custom-config/save`, {
|
|
756
|
+
__form: localStorage.getItem(e),
|
|
757
|
+
url: C.name
|
|
759
758
|
}, { requestType: "json" }).then((e) => {
|
|
760
759
|
$msg.success("配置保存成功!");
|
|
761
760
|
});
|
|
762
|
-
}, { t:
|
|
761
|
+
}, { t: T } = useI18n(), E = (e) => {
|
|
763
762
|
S("filter", b.model, e);
|
|
764
|
-
},
|
|
763
|
+
}, D = (e) => {
|
|
765
764
|
S("reset", e), b.filterOnReset && S("filter", b.model, e);
|
|
766
|
-
},
|
|
767
|
-
|
|
765
|
+
}, k = ref(b.defaultCollapsed), A = (e) => {
|
|
766
|
+
k.value = e;
|
|
768
767
|
};
|
|
769
|
-
x({ collapse:
|
|
770
|
-
let
|
|
768
|
+
x({ collapse: A });
|
|
769
|
+
let j = reactive({
|
|
771
770
|
span: 6,
|
|
772
771
|
suffix: !0
|
|
773
772
|
});
|
|
774
773
|
return () => {
|
|
775
|
-
let { filterOnReset: e, filterText: x, resetText:
|
|
774
|
+
let { filterOnReset: e, filterText: x, resetText: C, customizable: N, defaultCollapsed: P, collapsible: F, grid: I,...L } = b;
|
|
776
775
|
return createVNode(DataForm, mergeProps({ grid: {
|
|
777
776
|
cols: "12 768:18 1200:30 1536:30",
|
|
778
777
|
yGap: 16,
|
|
779
778
|
xGap: 12,
|
|
780
779
|
...I,
|
|
781
|
-
collapsed:
|
|
780
|
+
collapsed: k.value
|
|
782
781
|
} }, L, {
|
|
783
782
|
showFeedback: !1,
|
|
784
|
-
showAction:
|
|
785
|
-
onSubmit:
|
|
786
|
-
onReset:
|
|
787
|
-
}), { action: ({ cols: e, spans:
|
|
788
|
-
justify:
|
|
783
|
+
showAction: j,
|
|
784
|
+
onSubmit: E,
|
|
785
|
+
onReset: D
|
|
786
|
+
}), { action: ({ cols: e, spans: E }) => (j.suffix = e < E + j.span, createVNode(NFlex, {
|
|
787
|
+
justify: j.suffix ? "end" : "start",
|
|
789
788
|
align: "center"
|
|
790
789
|
}, { default: () => [
|
|
791
|
-
F &&
|
|
790
|
+
F && j.suffix ? createVNode(NButton, {
|
|
792
791
|
class: "collapsedBtn",
|
|
793
792
|
text: !0,
|
|
794
793
|
type: "primary",
|
|
795
794
|
iconPlacement: "right",
|
|
796
|
-
renderIcon:
|
|
797
|
-
onClick: () =>
|
|
798
|
-
}, { default: () => [
|
|
799
|
-
|
|
795
|
+
renderIcon: k.value ? IDown : IUp,
|
|
796
|
+
onClick: () => A(!k.value)
|
|
797
|
+
}, { default: () => [k.value ? T("common.page.filter.expand") : T("common.page.filter.collapse")] }) : void 0,
|
|
798
|
+
j.suffix ? void 0 : createVNode("span", null, [createTextVNode("\xA0\xA0\xA0\xA0")]),
|
|
800
799
|
createVNode(NButton, {
|
|
801
800
|
class: "submitWrap",
|
|
802
801
|
attrType: "submit",
|
|
803
802
|
type: "primary",
|
|
804
803
|
disabled: b.disabled,
|
|
805
804
|
loading: b.loading
|
|
806
|
-
}, { default: () => [x ||
|
|
805
|
+
}, { default: () => [x || T("common.page.filter.submitText")] }),
|
|
807
806
|
createVNode(NButton, {
|
|
808
807
|
attrType: "reset",
|
|
809
808
|
disabled: b.disabled || b.loading
|
|
810
|
-
}, { default: () => [
|
|
809
|
+
}, { default: () => [C || T("common.page.form.resetText")] }),
|
|
811
810
|
N ? createVNode(DataCustom, {
|
|
812
811
|
isFilter: !0,
|
|
813
812
|
keyField: "name",
|
|
814
813
|
showFixed: !1,
|
|
815
814
|
data: L.items,
|
|
816
|
-
onSave:
|
|
815
|
+
onSave: w,
|
|
817
816
|
onCustom: (e) => S("custom", e),
|
|
818
817
|
size: 16,
|
|
819
818
|
type: "primary"
|
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-tytSIKSx.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-tytSIKSx.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";
|