@otwb/ui 2.0.24 → 2.0.25

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.
@@ -333,6 +333,7 @@ var DataCustomItem = /* @__PURE__ */ defineComponent({
333
333
  wrap: !1,
334
334
  size: "small"
335
335
  }, { default: () => [
336
+ e.showFixed,
336
337
  createVNode(NButton, {
337
338
  type: "primary",
338
339
  text: !0,
@@ -399,17 +400,32 @@ const DataCustom = /* @__PURE__ */ defineComponent({
399
400
  },
400
401
  type: { type: String }
401
402
  },
402
- emits: { custom: () => !0 },
403
+ emits: {
404
+ custom: () => !0,
405
+ save: ""
406
+ },
403
407
  setup(x, { emit: S }) {
404
- let { t: C } = useI18n();
405
- function w(e, b, C) {
408
+ let { t: C } = useI18n(), w = useRoute();
409
+ function T() {
410
+ if (x.showFixed) {
411
+ w.name + "";
412
+ let e = w.name + "__table";
413
+ $fetch.post(`${SERVER_CTX.SYS}/cli/module/custom-config/save`, {
414
+ __table: localStorage.getItem(e),
415
+ url: w.name
416
+ }, { requestType: "json" }).then((e) => {
417
+ $msg.success("配置保存成功!");
418
+ });
419
+ } else S("save");
420
+ }
421
+ function E(e, b, C) {
406
422
  S("custom", {
407
423
  key: e[x.keyField],
408
424
  [b]: C
409
425
  });
410
426
  }
411
- let T = ref();
412
- return watch(T, (e) => {
427
+ let D = ref();
428
+ return watch(D, (e) => {
413
429
  e.$el && Sortable.create(e.$el, {
414
430
  animation: 150,
415
431
  ghostClass: "ghost",
@@ -436,13 +452,19 @@ const DataCustom = /* @__PURE__ */ defineComponent({
436
452
  }, { default: () => [createVNode(IFilterCustom, null, null)] })] }), [[vTooltip, x.tooltip ?? C("common.page.custom.tooltip")]]),
437
453
  default: () => {
438
454
  let e, b;
439
- return createVNode(NFlex, { vertical: !0 }, { default: () => [createVNode(NFlex, { justify: "space-between" }, { default: () => [createVNode("div", { style: "font-weight: bold" }, [x.tooltip ?? C("common.page.custom.tooltip")]), createVNode(NButton, {
455
+ return createVNode(NFlex, { vertical: !0 }, { default: () => [createVNode(NFlex, { justify: "space-between" }, { default: () => [createVNode("div", { style: "font-weight: bold" }, [x.tooltip ?? C("common.page.custom.tooltip")]), createVNode("div", null, [createVNode(NButton, {
456
+ class: "mr-10px",
457
+ text: !0,
458
+ type: "primary",
459
+ size: "small",
460
+ onClick: () => T()
461
+ }, { default: () => [createTextVNode("保存")] }), createVNode(NButton, {
440
462
  text: !0,
441
463
  type: "primary",
442
464
  size: "small",
443
465
  onClick: () => S("custom", !0)
444
- }, _isSlot$6(e = C("common.page.custom.reset")) ? e : { default: () => [e] })] }), createVNode(NFlex, {
445
- ref: T,
466
+ }, _isSlot$6(e = C("common.page.custom.reset")) ? e : { default: () => [e] })])] }), createVNode(NFlex, {
467
+ ref: D,
446
468
  vertical: !0
447
469
  }, _isSlot$6(b = x.data.filter((e) => e[x.visiblityField] !== !1).map((e) => createVNode(DataCustomItem, {
448
470
  key: e[x.keyField],
@@ -450,8 +472,8 @@ const DataCustom = /* @__PURE__ */ defineComponent({
450
472
  hidden: e[x.hiddenField],
451
473
  fixed: e[x.fixedField],
452
474
  showFixed: x.showFixed,
453
- onUpdateHidden: (b) => w(e, "hidden", b),
454
- onUpdateFixed: (b) => w(e, "fixed", b)
475
+ onUpdateHidden: (b) => E(e, "hidden", b),
476
+ onUpdateFixed: (b) => E(e, "fixed", b)
455
477
  }, null))) ? b : { default: () => [b] })] });
456
478
  }
457
479
  });
@@ -727,59 +749,69 @@ const DataForm = /* @__PURE__ */ defineComponent({
727
749
  "collapse"
728
750
  ],
729
751
  setup(b, { expose: x, emit: S }) {
730
- let { t: C } = useI18n(), w = (e) => {
752
+ let C = useRoute(), w = () => {
753
+ let e = C.name + "__form";
754
+ C.name + "", $fetch.post(`${SERVER_CTX.SYS}/cli/module/custom-config/save`, {
755
+ __form: localStorage.getItem(e),
756
+ url: C.name
757
+ }, { requestType: "json" }).then((e) => {
758
+ $msg.success("配置保存成功!");
759
+ });
760
+ }, { t: T } = useI18n(), E = (e) => {
731
761
  S("filter", b.model, e);
732
- }, T = (e) => {
762
+ }, D = (e) => {
733
763
  S("reset", e), b.filterOnReset && S("filter", b.model, e);
734
- }, E = ref(b.defaultCollapsed), D = (e) => {
735
- E.value = e;
764
+ }, k = ref(b.defaultCollapsed), A = (e) => {
765
+ k.value = e;
736
766
  };
737
- x({ collapse: D });
738
- let k = reactive({
767
+ x({ collapse: A });
768
+ let j = reactive({
739
769
  span: 6,
740
770
  suffix: !0
741
771
  });
742
772
  return () => {
743
- let { filterOnReset: e, filterText: x, resetText: A, customizable: j, defaultCollapsed: N, collapsible: P, grid: F,...I } = b;
773
+ let { filterOnReset: e, filterText: x, resetText: C, customizable: N, defaultCollapsed: P, collapsible: F, grid: I,...L } = b;
744
774
  return createVNode(DataForm, mergeProps({ grid: {
745
775
  cols: "12 768:18 1200:30 1536:30",
746
776
  yGap: 16,
747
777
  xGap: 12,
748
- ...F,
749
- collapsed: E.value
750
- } }, I, {
778
+ ...I,
779
+ collapsed: k.value
780
+ } }, L, {
751
781
  showFeedback: !1,
752
- showAction: k,
753
- onSubmit: w,
754
- onReset: T
755
- }), { action: ({ cols: e, spans: w }) => (k.suffix = e < w + k.span, createVNode(NFlex, {
756
- justify: k.suffix ? "end" : "start",
782
+ showAction: j,
783
+ onSubmit: E,
784
+ onReset: D
785
+ }), { action: ({ cols: e, spans: E }) => (j.suffix = e < E + j.span, createVNode(NFlex, {
786
+ justify: j.suffix ? "end" : "start",
757
787
  align: "center"
758
788
  }, { default: () => [
759
- P && k.suffix ? createVNode(NButton, {
789
+ F && j.suffix ? createVNode(NButton, {
760
790
  class: "collapsedBtn",
761
791
  text: !0,
762
792
  type: "primary",
763
793
  iconPlacement: "right",
764
- renderIcon: E.value ? IDown : IUp,
765
- onClick: () => D(!E.value)
766
- }, { default: () => [E.value ? C("common.page.filter.expand") : C("common.page.filter.collapse")] }) : void 0,
767
- k.suffix ? void 0 : createVNode("span", null, [createTextVNode("\xA0\xA0\xA0\xA0")]),
794
+ renderIcon: k.value ? IDown : IUp,
795
+ onClick: () => A(!k.value)
796
+ }, { default: () => [k.value ? T("common.page.filter.expand") : T("common.page.filter.collapse")] }) : void 0,
797
+ j.suffix ? void 0 : createVNode("span", null, [createTextVNode("\xA0\xA0\xA0\xA0")]),
768
798
  createVNode(NButton, {
769
799
  class: "submitWrap",
770
800
  attrType: "submit",
771
801
  type: "primary",
772
802
  disabled: b.disabled,
773
803
  loading: b.loading
774
- }, { default: () => [x || C("common.page.filter.submitText")] }),
804
+ }, { default: () => [x || T("common.page.filter.submitText")] }),
775
805
  createVNode(NButton, {
776
806
  attrType: "reset",
777
807
  disabled: b.disabled || b.loading
778
- }, { default: () => [A || C("common.page.form.resetText")] }),
779
- j ? createVNode(DataCustom, {
808
+ }, { default: () => [C || T("common.page.form.resetText")] }),
809
+ N ? createVNode(DataCustom, {
810
+ isFilter: !0,
780
811
  keyField: "name",
781
812
  showFixed: !1,
782
- data: I.items,
813
+ data: L.items,
814
+ onSave: w,
783
815
  onCustom: (e) => S("custom", e),
784
816
  size: 16,
785
817
  type: "primary"
@@ -902,19 +934,27 @@ const DataLocaleInput = /* @__PURE__ */ defineComponent({
902
934
  },
903
935
  emits: { change: () => !0 },
904
936
  setup(b, { emit: x }) {
905
- let { t: S } = useI18n(), C = (e) => x("change", {
937
+ let { t: S } = useI18n(), C = useRoute(), w = (e) => x("change", {
906
938
  pageSize: b.pageSize ?? b.page?.pageSize ?? 0,
907
939
  currentPage: e
908
- }), w = (e) => x("change", {
909
- pageSize: e,
910
- currentPage: b.currentPage ?? b.page?.currentPage ?? 0
911
- });
912
- return () => createVNode(NPagination, {
940
+ }), T = (e) => {
941
+ let S = C.name + "__page";
942
+ $fetch.post(`${SERVER_CTX.SYS}/cli/module/custom-config/save`, {
943
+ __page: e,
944
+ url: C.name
945
+ }, { requestType: "json" }).then((b) => {
946
+ localStorage.setItem(S, e);
947
+ }), x("change", {
948
+ pageSize: e,
949
+ currentPage: b.currentPage ?? b.page?.currentPage ?? 0
950
+ });
951
+ }, E = C.name + "__page";
952
+ return localStorage.getItem(E) && (b.page.pageSize = localStorage.getItem(E)), () => createVNode(NPagination, {
913
953
  page: b.currentPage ?? b.page?.currentPage,
914
954
  itemCount: b.total,
915
955
  pageSize: b.pageSize ?? b.page?.pageSize,
916
- onUpdatePage: C,
917
- onUpdatePageSize: w,
956
+ onUpdatePage: w,
957
+ onUpdatePageSize: T,
918
958
  pageSizes: b.pageSizes,
919
959
  showQuickJumper: !0,
920
960
  showSizePicker: !0,
@@ -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-C3FvQCdL.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-BMteXZVn.js";
5
5
  export { DataActions, DataCustom, DataFilter, DataForm, DataLocaleInput, DataPagination, DataSelection, DataTable, DtDeptRender, DtUserDept, DtUserRender, NCheckboxes, NRadios, renderUsers, useDataTableDrag, useLocaleEdit };
package/dist/index.js CHANGED
@@ -583,7 +583,10 @@ const AppMenu = /* @__PURE__ */ defineComponent({
583
583
  target: "_blank",
584
584
  onClick: (d) => d.stopPropagation()
585
585
  }, [z.label()]);
586
- else {
586
+ else if (U) {
587
+ let d;
588
+ W = createVNode(RouterLink, { to: z.path }, _isSlot$1(d = z.label()) ? d : { default: () => [d] });
589
+ } else {
587
590
  let d, B = createVNode(RouterLink, { to: z.path }, _isSlot$1(d = z.label()) ? d : { default: () => [d] }), H = createVNode("span", null, [z.label()]);
588
591
  W = createVNode(NTooltip, {
589
592
  placement: "top",
@@ -596,6 +599,7 @@ const AppMenu = /* @__PURE__ */ defineComponent({
596
599
  trigger: () => B
597
600
  });
598
601
  }
602
+ else if (U) W = createVNode("span", null, [z.label()]);
599
603
  else {
600
604
  let d = createVNode("span", null, [z.label()]);
601
605
  W = createVNode(NTooltip, {
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-C3FvQCdL.js";
4
+ import { a as NRadios, g as NCheckboxes, n as DtUserDept, p as DataForm, r as DtUserRender, t as DtDeptRender } from "./components-BMteXZVn.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.24",
3
+ "version": "2.0.25",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "otwb UI",
@@ -90,7 +90,7 @@
90
90
  "vite": "npm:rolldown-vite@^7.1.20",
91
91
  "vue": "^3.5.22",
92
92
  "vue-router": "^4.6.3",
93
- "@otwb/page": "^2.0.2"
93
+ "@otwb/page": "^2.0.5"
94
94
  },
95
95
  "scripts": {
96
96
  "dev": "vite build --watch",