@duxweb/dvha-pro 1.0.18 → 1.0.19

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.
Files changed (144) hide show
  1. package/dist/cjs/component.cjs +1 -1
  2. package/dist/cjs/components/card/card.cjs +1 -1
  3. package/dist/cjs/components/chart/echart.cjs +1 -1
  4. package/dist/cjs/components/code/code.cjs +1 -0
  5. package/dist/cjs/components/crop/imageCrop.cjs +1 -1
  6. package/dist/cjs/components/data/dynamicSelect.cjs +1 -1
  7. package/dist/cjs/components/data/selectModal.cjs +1 -1
  8. package/dist/cjs/components/drawer/drawer.cjs +1 -1
  9. package/dist/cjs/components/drawer/drawerPage.cjs +1 -1
  10. package/dist/cjs/components/form/formItem.cjs +1 -1
  11. package/dist/cjs/components/form/formLayout.cjs +1 -1
  12. package/dist/cjs/components/form/modalForm.cjs +1 -1
  13. package/dist/cjs/components/form/pageForm.cjs +1 -1
  14. package/dist/cjs/components/form/settingForm.cjs +1 -1
  15. package/dist/cjs/components/icon/icon.cjs +1 -1
  16. package/dist/cjs/components/layout/filter.cjs +1 -1
  17. package/dist/cjs/components/layout/filterLayout.cjs +1 -0
  18. package/dist/cjs/components/layout/list.cjs +1 -1
  19. package/dist/cjs/components/layout/table.cjs +1 -1
  20. package/dist/cjs/components/level/level.cjs +1 -1
  21. package/dist/cjs/components/modal/modal.cjs +1 -1
  22. package/dist/cjs/components/modal/modalPage.cjs +1 -1
  23. package/dist/cjs/components/panel/collapse.cjs +1 -0
  24. package/dist/cjs/components/panel/setting.cjs +1 -1
  25. package/dist/cjs/components/status/listEmpty.cjs +1 -0
  26. package/dist/cjs/components/table/table.cjs +1 -0
  27. package/dist/cjs/components/table/tablePage.cjs +1 -1
  28. package/dist/cjs/components/tree/treeFilter.cjs +1 -1
  29. package/dist/cjs/components/upload/config.cjs +1 -0
  30. package/dist/cjs/components/upload/file.cjs +1 -1
  31. package/dist/cjs/components/upload/image.cjs +1 -1
  32. package/dist/cjs/components/upload/manage/item.cjs +1 -1
  33. package/dist/cjs/components/upload/manager.cjs +1 -1
  34. package/dist/cjs/dvha-pro.css +1 -1
  35. package/dist/cjs/hooks/action.cjs +1 -1
  36. package/dist/cjs/hooks/dialog.cjs +1 -1
  37. package/dist/cjs/hooks/drawer.cjs +1 -1
  38. package/dist/cjs/hooks/modal.cjs +1 -1
  39. package/dist/cjs/hooks/table/image.cjs +1 -1
  40. package/dist/cjs/hooks/table/media.cjs +1 -1
  41. package/dist/cjs/hooks/table.cjs +1 -1
  42. package/dist/cjs/index.cjs +1 -1
  43. package/dist/cjs/langs/en-US.json.cjs +1 -1
  44. package/dist/cjs/langs/zh-CN.json.cjs +1 -1
  45. package/dist/cjs/pages/authLayout.cjs +1 -1
  46. package/dist/cjs/pages/layout/page.cjs +1 -1
  47. package/dist/cjs/pages/login.cjs +1 -1
  48. package/dist/cjs/pages/menu/avatar.cjs +1 -1
  49. package/dist/cjs/pages/menu/button.cjs +1 -1
  50. package/dist/cjs/pages/menu/cmd.cjs +1 -1
  51. package/dist/cjs/pages/menu/main.cjs +1 -1
  52. package/dist/cjs/pages/menu/mobile.cjs +1 -1
  53. package/dist/cjs/pages/page.cjs +1 -1
  54. package/dist/cjs/pages/page404.cjs +1 -1
  55. package/dist/cjs/pages/pageStatus.cjs +1 -1
  56. package/dist/cjs/theme/naiveTheme.cjs +1 -1
  57. package/dist/cjs/theme/uno.css.cjs +23 -7
  58. package/dist/esm/component.js +36 -34
  59. package/dist/esm/components/card/card.js +6 -6
  60. package/dist/esm/components/chart/echart.js +17 -6
  61. package/dist/esm/components/code/code.js +53 -0
  62. package/dist/esm/components/crop/imageCrop.js +37 -26
  63. package/dist/esm/components/data/dynamicSelect.js +29 -18
  64. package/dist/esm/components/data/selectModal.js +49 -38
  65. package/dist/esm/components/drawer/drawer.js +17 -28
  66. package/dist/esm/components/drawer/drawerPage.js +54 -17
  67. package/dist/esm/components/form/formItem.js +17 -17
  68. package/dist/esm/components/form/formLayout.js +8 -8
  69. package/dist/esm/components/form/modalForm.js +44 -35
  70. package/dist/esm/components/form/pageForm.js +81 -43
  71. package/dist/esm/components/form/settingForm.js +28 -17
  72. package/dist/esm/components/icon/icon.js +23 -12
  73. package/dist/esm/components/layout/filter.js +15 -11
  74. package/dist/esm/components/layout/filterLayout.js +34 -0
  75. package/dist/esm/components/layout/list.js +206 -160
  76. package/dist/esm/components/layout/table.js +212 -185
  77. package/dist/esm/components/level/level.js +28 -17
  78. package/dist/esm/components/modal/modal.js +9 -9
  79. package/dist/esm/components/modal/modalPage.js +2 -2
  80. package/dist/esm/components/panel/collapse.js +49 -0
  81. package/dist/esm/components/panel/setting.js +3 -3
  82. package/dist/esm/components/status/listEmpty.js +26 -0
  83. package/dist/esm/components/table/table.js +110 -0
  84. package/dist/esm/components/table/tablePage.js +24 -18
  85. package/dist/esm/components/tree/treeFilter.js +44 -39
  86. package/dist/esm/components/upload/config.js +32 -0
  87. package/dist/esm/components/upload/file.js +142 -116
  88. package/dist/esm/components/upload/image.js +95 -66
  89. package/dist/esm/components/upload/manage/item.js +17 -6
  90. package/dist/esm/components/upload/manager.js +202 -164
  91. package/dist/esm/dvha-pro.css +1 -1
  92. package/dist/esm/hooks/action.js +77 -75
  93. package/dist/esm/hooks/dialog.js +13 -2
  94. package/dist/esm/hooks/drawer.js +13 -2
  95. package/dist/esm/hooks/modal.js +13 -2
  96. package/dist/esm/hooks/table/image.js +21 -10
  97. package/dist/esm/hooks/table/media.js +20 -9
  98. package/dist/esm/hooks/table.js +16 -13
  99. package/dist/esm/index.js +174 -164
  100. package/dist/esm/langs/en-US.json.js +1 -1
  101. package/dist/esm/langs/zh-CN.json.js +1 -1
  102. package/dist/esm/pages/authLayout.js +19 -8
  103. package/dist/esm/pages/layout/page.js +17 -6
  104. package/dist/esm/pages/login.js +40 -29
  105. package/dist/esm/pages/menu/avatar.js +45 -34
  106. package/dist/esm/pages/menu/button.js +23 -12
  107. package/dist/esm/pages/menu/cmd.js +45 -34
  108. package/dist/esm/pages/menu/main.js +40 -27
  109. package/dist/esm/pages/menu/mobile.js +13 -2
  110. package/dist/esm/pages/page.js +1 -1
  111. package/dist/esm/pages/page404.js +20 -9
  112. package/dist/esm/pages/pageStatus.js +31 -15
  113. package/dist/esm/theme/naiveTheme.js +6 -6
  114. package/dist/esm/theme/uno.css.js +23 -7
  115. package/dist/types/components/code/code.d.ts +44 -0
  116. package/dist/types/components/code/index.d.ts +1 -0
  117. package/dist/types/components/drawer/drawer.d.ts +2 -0
  118. package/dist/types/components/drawer/drawerPage.d.ts +20 -1
  119. package/dist/types/components/form/formItem.d.ts +2 -2
  120. package/dist/types/components/form/formLayout.d.ts +3 -3
  121. package/dist/types/components/form/modalForm.d.ts +3 -3
  122. package/dist/types/components/form/pageForm.d.ts +12 -0
  123. package/dist/types/components/index.d.ts +1 -0
  124. package/dist/types/components/layout/filterLayout.d.ts +32 -0
  125. package/dist/types/components/layout/index.d.ts +1 -0
  126. package/dist/types/components/layout/table.d.ts +3 -0
  127. package/dist/types/components/panel/collapse.d.ts +14 -0
  128. package/dist/types/components/panel/index.d.ts +1 -0
  129. package/dist/types/components/select/cardSelect.d.ts +1 -1
  130. package/dist/types/components/status/index.d.ts +1 -0
  131. package/dist/types/components/status/listEmpty.d.ts +11 -0
  132. package/dist/types/components/table/index.d.ts +1 -0
  133. package/dist/types/components/table/table.d.ts +6552 -0
  134. package/dist/types/components/table/tablePage.d.ts +3 -0
  135. package/dist/types/components/tree/treeFilter.d.ts +13 -12
  136. package/dist/types/components/upload/config.d.ts +13 -0
  137. package/dist/types/components/upload/file.d.ts +4 -0
  138. package/dist/types/components/upload/image.d.ts +30 -2
  139. package/dist/types/components/upload/manager.d.ts +4 -0
  140. package/dist/types/hooks/drawer.d.ts +1 -0
  141. package/dist/types/hooks/table/types.d.ts +1 -0
  142. package/dist/types/main.d.ts +6 -0
  143. package/dist/types/pages/pageStatus.d.ts +11 -1
  144. package/package.json +6 -4
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as c, createVNode as t } from "vue";
2
2
  import { useI18n as s } from "@duxweb/dvha-core";
3
3
  import a from "clsx";
4
- import { NCheckbox as u, NImage as d } from "naive-ui";
4
+ import { NCheckbox as u, NImage as p } from "naive-ui";
5
5
  import "vue-router";
6
- import { useDialog as p } from "../../../hooks/dialog.js";
6
+ import { useDialog as d } from "../../../hooks/dialog.js";
7
7
  import "@overlastic/vue";
8
8
  import "vue-echarts";
9
9
  import "@vueuse/core";
@@ -35,10 +35,21 @@ import h from "../../../static/images/icon/pdf.svg.js";
35
35
  import x from "../../../static/images/icon/ppt.svg.js";
36
36
  import k from "../../../static/images/icon/video.svg.js";
37
37
  import w from "../../../static/images/icon/word.svg.js";
38
+ import "vue3-ace-editor";
39
+ import "ace-builds/src-noconflict/mode-vue";
40
+ import "ace-builds/src-noconflict/mode-javascript";
41
+ import "ace-builds/src-noconflict/mode-html";
42
+ import "ace-builds/src-noconflict/mode-json";
43
+ import "ace-builds/src-noconflict/mode-json5";
44
+ import "ace-builds/src-noconflict/theme-tomorrow_night";
45
+ import "ace-builds/src-noconflict/theme-tomorrow";
46
+ import "ace-builds/src-noconflict/ext-searchbox";
47
+ import "ace-builds/src-noconflict/ext-language_tools";
48
+ import "ace-builds/src-noconflict/mode-snippets";
38
49
  import "dayjs";
39
50
  import "@tanstack/vue-query";
40
51
  import "pinia";
41
- const le = /* @__PURE__ */ c({
52
+ const xe = /* @__PURE__ */ c({
42
53
  name: "DuxFileManageItem",
43
54
  props: {
44
55
  name: String,
@@ -51,7 +62,7 @@ const le = /* @__PURE__ */ c({
51
62
  onSelect: Function
52
63
  },
53
64
  setup(i) {
54
- const o = p(), {
65
+ const o = d(), {
55
66
  t: r
56
67
  } = s(), m = {
57
68
  image: {
@@ -59,7 +70,7 @@ const le = /* @__PURE__ */ c({
59
70
  render: () => t("div", {
60
71
  class: "size-12 flex items-center justify-center",
61
72
  onClick: (e) => e.stopPropagation()
62
- }, [t(d, {
73
+ }, [t(p, {
63
74
  src: i.url,
64
75
  width: 48,
65
76
  height: 48
@@ -175,5 +186,5 @@ const le = /* @__PURE__ */ c({
175
186
  }
176
187
  });
177
188
  export {
178
- le as DuxFileManageItem
189
+ xe as DuxFileManageItem
179
190
  };
@@ -1,9 +1,9 @@
1
- import { defineComponent as ne, ref as f, computed as S, createVNode as e, nextTick as ue, createTextVNode as Q, isVNode as re } from "vue";
2
- import { useI18n as de, useClient as ie, useManage as se, useUpload as ce, useInfiniteList as pe } from "@duxweb/dvha-core";
3
- import { cloneDeep as me } from "lodash-es";
4
- import { useMessage as fe, NTabs as ve, NTab as C, NButton as g, NInput as W, NInfiniteScroll as ge, NSpin as he, NTooltip as be, NDropdown as ye } from "naive-ui";
1
+ import { defineComponent as fe, ref as m, computed as te, createVNode as e, nextTick as ve, createTextVNode as oe, isVNode as ge } from "vue";
2
+ import { useI18n as he, useClient as be, useInfiniteList as ye, useUpload as xe } from "@duxweb/dvha-core";
3
+ import { cloneDeep as Me } from "lodash-es";
4
+ import { useMessage as Pe, NTabs as ke, NTab as w, NButton as h, NInput as ne, NInfiniteScroll as Ce, NTooltip as we, NSpin as Se, NDropdown as Ne } from "naive-ui";
5
5
  import "vue-router";
6
- import { useDialog as xe } from "../../hooks/dialog.js";
6
+ import { useDialog as Te } from "../../hooks/dialog.js";
7
7
  import "@overlastic/vue";
8
8
  import "clsx";
9
9
  import "vue-echarts";
@@ -11,7 +11,7 @@ import "@vueuse/core";
11
11
  import "vue-cropper";
12
12
  import "jinrishici";
13
13
  import "vue-draggable-plus";
14
- import { DuxDrawEmpty as Me } from "../draw/drawEmpty.js";
14
+ import { DuxDrawEmpty as Ee } from "../draw/drawEmpty.js";
15
15
  import "aieditor";
16
16
  import "vee-validate";
17
17
  import "@vee-validate/i18n";
@@ -28,14 +28,26 @@ import "@duxweb/dvha-naiveui";
28
28
  import "../../pages/page404.js";
29
29
  import "@iconify-json/tabler/icons.json";
30
30
  import "mime";
31
- import { useDownload as ke } from "../../hooks/download.js";
31
+ import { useUploadConfig as je } from "./config.js";
32
+ import "vue3-ace-editor";
33
+ import "ace-builds/src-noconflict/mode-vue";
34
+ import "ace-builds/src-noconflict/mode-javascript";
35
+ import "ace-builds/src-noconflict/mode-html";
36
+ import "ace-builds/src-noconflict/mode-json";
37
+ import "ace-builds/src-noconflict/mode-json5";
38
+ import "ace-builds/src-noconflict/theme-tomorrow_night";
39
+ import "ace-builds/src-noconflict/theme-tomorrow";
40
+ import "ace-builds/src-noconflict/ext-searchbox";
41
+ import "ace-builds/src-noconflict/ext-language_tools";
42
+ import "ace-builds/src-noconflict/mode-snippets";
43
+ import { useDownload as Fe } from "../../hooks/download.js";
32
44
  import "@tanstack/vue-query";
33
45
  import "pinia";
34
- import { DuxFileManageItem as Z } from "./manage/item.js";
35
- function N(o) {
36
- return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !re(o);
46
+ import { DuxFileManageItem as re } from "./manage/item.js";
47
+ function N(t) {
48
+ return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !ge(t);
37
49
  }
38
- const ta = /* @__PURE__ */ ne({
50
+ const Ca = /* @__PURE__ */ fe({
39
51
  name: "DuxFileManage",
40
52
  props: {
41
53
  path: String,
@@ -45,243 +57,269 @@ const ta = /* @__PURE__ */ ne({
45
57
  multiple: Boolean,
46
58
  page: {
47
59
  type: Boolean,
48
- default: !0
60
+ default: !1
49
61
  },
50
62
  handle: String,
51
63
  uploadParams: Object
52
64
  },
53
- setup(o) {
54
- const y = f(!1), T = f(0), j = f(0), {
55
- t
56
- } = de(), u = f([]), x = xe(), P = ie(), h = fe(), ee = ke(), F = se(), s = f({
57
- type: o.type || "all"
58
- }), M = f(), k = S(() => {
59
- var r, d;
60
- return o.path || ((d = (r = F.config) == null ? void 0 : r.apiPath) == null ? void 0 : d.uploadManager) || "uploadManage";
61
- }), ae = S(() => {
62
- var r, d, p;
63
- return ((r = o.uploadParams) == null ? void 0 : r.path) || ((p = (d = F.config) == null ? void 0 : d.apiPath) == null ? void 0 : p.upload) || "upload";
64
- }), w = ce({
65
- ...o.uploadParams,
66
- path: ae.value,
67
- autoUpload: !0
68
- }), le = f({
65
+ setup(t) {
66
+ var F, I, U, V;
67
+ const y = m(!1), T = m(0), E = m(0), {
68
+ t: o
69
+ } = he(), n = m([]), x = Te(), S = be(), f = Pe(), ue = Fe(), i = m({
70
+ type: t.type || "all",
71
+ folder: null
72
+ }), M = m(), {
73
+ uploadPath: de,
74
+ managePath: P,
75
+ driver: ie
76
+ } = je({
77
+ driver: (F = t.uploadParams) == null ? void 0 : F.driver,
78
+ signPath: (I = t.uploadParams) == null ? void 0 : I.signPath,
79
+ signCallback: (U = t.uploadParams) == null ? void 0 : U.signCallback,
80
+ uploadPath: (V = t.uploadParams) == null ? void 0 : V.path,
81
+ managePath: t.path
82
+ }), se = m({
69
83
  page: 1,
70
84
  pageSize: 20
71
- }), i = pe({
72
- path: k.value,
73
- pagination: le.value,
74
- filters: s.value
75
- }), te = (r) => {
76
- if (!r) {
77
- h.error(t("components.uploadManage.namePlaceholder") || "");
85
+ }), u = ye({
86
+ path: P.value,
87
+ pagination: se.value,
88
+ filters: i.value
89
+ }), ce = te(() => {
90
+ const {
91
+ driver: d,
92
+ signPath: s,
93
+ signCallback: v,
94
+ ...C
95
+ } = t.uploadParams || {};
96
+ return C;
97
+ }), k = xe({
98
+ ...ce.value,
99
+ path: de.value,
100
+ autoUpload: !0,
101
+ driver: ie.value,
102
+ onSuccess: () => {
103
+ n.value = [], u.refetch();
104
+ },
105
+ onError: (d) => {
106
+ f.error((d == null ? void 0 : d.message) || o("components.uploadManage.uploadError") || "");
107
+ }
108
+ }), pe = (d) => {
109
+ if (!d) {
110
+ f.error(o("components.uploadManage.namePlaceholder") || "");
78
111
  return;
79
112
  }
80
- P.request({
81
- path: k.value,
113
+ S.request({
114
+ path: P.value,
82
115
  method: "POST",
83
116
  payload: {
84
- name: r,
85
- folder: s.value.folder
117
+ name: d,
118
+ folder: i.value.folder
86
119
  }
87
120
  }).then(() => {
88
- i.refetch(), u.value = [];
121
+ u.refetch(), n.value = [];
89
122
  }).catch(() => {
90
- h.error(t("components.uploadManage.createError") || "");
123
+ f.error(o("components.uploadManage.createError") || "");
91
124
  });
92
- }, oe = (r, d, p) => {
93
- if (!d) {
94
- h.error(t("components.uploadManage.namePlaceholder") || "");
125
+ }, me = (d, s, v) => {
126
+ if (!s) {
127
+ f.error(o("components.uploadManage.namePlaceholder") || "");
95
128
  return;
96
129
  }
97
- P.request({
98
- path: k.value,
130
+ S.request({
131
+ path: P.value,
99
132
  method: "PUT",
100
133
  payload: {
101
- name: d,
102
- id: p,
103
- type: r
134
+ name: s,
135
+ id: v,
136
+ type: d
104
137
  }
105
138
  }).then(() => {
106
- i.refetch(), u.value = [];
139
+ u.refetch(), n.value = [];
107
140
  }).catch(() => {
108
- h.error(t("components.uploadManage.editError") || "");
141
+ f.error(o("components.uploadManage.editError") || "");
109
142
  });
110
- }, I = (r, d) => {
111
- P.request({
112
- path: `${k.value}/batch`,
143
+ }, j = (d, s) => {
144
+ S.request({
145
+ path: `${P.value}/batch`,
113
146
  method: "DELETE",
114
147
  payload: {
115
- ids: Array.isArray(d) ? d : [d],
116
- type: r
148
+ data: Array.isArray(s) ? s : [s],
149
+ type: d
117
150
  }
118
151
  }).then(() => {
119
- i.refetch(), u.value = [];
152
+ u.refetch(), n.value = [];
120
153
  }).catch(() => {
121
- h.error(t("components.uploadManage.delError") || "");
154
+ f.error(o("components.uploadManage.delError") || "");
122
155
  });
123
- }, b = S(() => !!(o.type && o.type !== "all"));
156
+ }, b = te(() => !!(t.type && t.type !== "all"));
124
157
  return () => {
125
- var E, U, V;
126
- let r, d, p;
158
+ var C, L, O, $, z, D, _, q, B, A, R, X;
159
+ let d, s, v;
127
160
  return e("div", {
128
- class: "flex flex-col gap-2 h-500px max-h-500px"
161
+ class: ["flex flex-col gap-2", t.page ? "h-full" : "h-500px max-h-500px"]
129
162
  }, [e("div", {
130
- class: ["flex-none flex justify-between items-center border-b border-muted p-3", o.handle]
163
+ class: ["flex-none flex justify-between items-center border-b border-muted p-3", t.handle]
131
164
  }, [e("div", {
132
165
  class: "flex-none"
133
- }, [e(ve, {
166
+ }, [e(ke, {
134
167
  type: "segment",
135
168
  animated: !0,
136
169
  size: "small",
137
170
  tabClass: "!px-4",
138
171
  defaultValue: "all",
139
- value: s.value.type,
172
+ value: i.value.type,
140
173
  onUpdateValue: (a) => {
141
- b.value || (s.value.type = a, u.value = []);
174
+ b.value || (i.value.type = a, n.value = []);
142
175
  }
143
176
  }, {
144
- default: () => [e(C, {
145
- tab: t("components.uploadManage.all"),
177
+ default: () => [e(w, {
178
+ tab: o("components.uploadManage.all"),
146
179
  name: "all",
147
180
  disabled: b.value
148
- }, null), e(C, {
149
- tab: t("components.uploadManage.image"),
181
+ }, null), e(w, {
182
+ tab: o("components.uploadManage.image"),
150
183
  name: "image",
151
184
  disabled: b.value
152
- }, null), e(C, {
153
- tab: t("components.uploadManage.media"),
185
+ }, null), e(w, {
186
+ tab: o("components.uploadManage.media"),
154
187
  name: "media",
155
188
  disabled: b.value
156
- }, null), e(C, {
157
- tab: t("components.uploadManage.docs"),
189
+ }, null), e(w, {
190
+ tab: o("components.uploadManage.docs"),
158
191
  name: "docs",
159
192
  disabled: b.value
160
193
  }, null)]
161
194
  })]), e("div", {
162
195
  class: "flex gap-2"
163
- }, [e(g, {
196
+ }, [e(h, {
164
197
  type: "default",
165
198
  ghost: !0,
166
199
  onClick: () => {
167
200
  x.prompt({
168
- title: t("components.uploadManage.namePlaceholder") || "",
201
+ title: o("components.uploadManage.namePlaceholder") || "",
169
202
  formSchema: [{
170
- tag: W,
203
+ tag: ne,
171
204
  attrs: {
172
205
  "v-model:value": "form.name"
173
206
  }
174
207
  }]
175
208
  }).then((a) => {
176
- te(a == null ? void 0 : a.name);
209
+ pe(a == null ? void 0 : a.name);
210
+ }).catch(() => {
177
211
  });
178
212
  },
179
213
  renderIcon: () => e("div", {
180
214
  class: "i-tabler:plus"
181
215
  }, null)
182
- }, N(r = t("components.button.create")) ? r : {
183
- default: () => [r]
184
- }), e(g, {
216
+ }, N(d = o("components.button.create")) ? d : {
217
+ default: () => [d]
218
+ }), e(h, {
185
219
  type: "primary",
186
220
  ghost: !0,
187
221
  onClick: () => {
188
- w.open();
222
+ k.open();
189
223
  },
190
- loading: w.isUploading.value,
224
+ loading: k.isUploading.value,
191
225
  renderIcon: () => e("div", {
192
226
  class: "i-tabler:upload"
193
227
  }, null)
194
228
  }, {
195
229
  default: () => [e("div", {
196
230
  class: "flex gap-2"
197
- }, [t("components.uploadManage.upload"), w.progress.value.totalPercent > 0 && `(${w.progress.value.totalPercent}%)`])]
198
- }), o.page && e(g, {
231
+ }, [o("components.uploadManage.upload"), k.progress.value.totalPercent > 0 && `(${k.progress.value.totalPercent}%)`])]
232
+ }), !t.page && e(h, {
199
233
  type: "default",
200
234
  ghost: !0,
201
235
  onClick: () => {
202
236
  var a;
203
- (a = o.onClose) == null || a.call(o);
237
+ (a = t.onClose) == null || a.call(t);
204
238
  },
205
239
  renderIcon: () => e("div", {
206
240
  class: "i-tabler:x"
207
241
  }, null)
208
242
  }, null)])]), e("div", {
209
243
  class: "flex-1 min-h-1"
210
- }, [e(ge, {
244
+ }, [((O = (L = (C = u.data) == null ? void 0 : C.value) == null ? void 0 : L.data) == null ? void 0 : O.length) > 0 && e(Ce, {
211
245
  distance: 10,
212
246
  onLoad: () => {
213
- i.hasNextPage.value && i.fetchNextPage();
247
+ u.hasNextPage.value && u.fetchNextPage();
214
248
  },
215
249
  scrollbarProps: {
216
250
  contentClass: "p-4"
217
251
  }
218
252
  }, {
219
253
  default: () => {
220
- var a, l, v, L, O, _, $, q, z, B, D, A, R, X, Y;
221
- return [i.isLoading.value && e(he, {
222
- class: "h-full absolute w-full bg-gray-1/50"
223
- }, null), ((v = (l = (a = i.data) == null ? void 0 : a.value) == null ? void 0 : l.data) == null ? void 0 : v.length) > 0 ? e("div", {
224
- class: "grid grid-cols-3 lg:grid-cols-[repeat(auto-fit,minmax(150px,1fr))] text-sm items-start justify-start"
225
- }, [((L = s.value) == null ? void 0 : L.folder) && ((O = s.value) == null ? void 0 : O.folder) !== (($ = (_ = i.data.value) == null ? void 0 : _.meta) == null ? void 0 : $.folder) && e(Z, {
226
- key: `parent-${(z = (q = i.data.value) == null ? void 0 : q.meta) == null ? void 0 : z.folder}`,
254
+ var a, l, g, Y, G, H, J, K, Q, W;
255
+ return [e("div", {
256
+ class: ["grid grid-cols-3 md:grid-cols-4 text-sm items-start justify-start", ((l = (a = u.data.value) == null ? void 0 : a.data) == null ? void 0 : l.length) >= 4 && !t.page ? " lg:grid-cols-[repeat(auto-fit,minmax(150px,1fr))]" : "lg:grid-cols-[repeat(auto-fit,minmax(150px,150px))]"]
257
+ }, [((g = i.value) == null ? void 0 : g.folder) && ((Y = i.value) == null ? void 0 : Y.folder) !== ((H = (G = u.data.value) == null ? void 0 : G.meta) == null ? void 0 : H.folder) && e(re, {
258
+ key: `parent-${(K = (J = u.data.value) == null ? void 0 : J.meta) == null ? void 0 : K.folder}`,
227
259
  type: "folder",
228
- name: t("components.uploadManage.parentLevel"),
260
+ name: o("components.uploadManage.parentLevel"),
229
261
  onSelect: () => {
230
- var n, c;
231
- u.value = [], s.value.folder = (c = (n = i.data.value) == null ? void 0 : n.meta) == null ? void 0 : c.folder;
262
+ var r, c;
263
+ n.value = [], i.value.folder = (c = (r = u.data.value) == null ? void 0 : r.meta) == null ? void 0 : c.folder;
232
264
  }
233
- }, null), (D = (B = i.data.value) == null ? void 0 : B.data) == null ? void 0 : D.map((n) => e(be, {
265
+ }, null), (W = (Q = u.data.value) == null ? void 0 : Q.data) == null ? void 0 : W.map((r) => e(we, {
234
266
  placement: "bottom",
235
- key: `${n.url ? "file" : "folder"}-${n.id}`,
236
- trigger: n.url ? "hover" : "manual"
267
+ key: `${r.url ? "file" : "folder"}-${r.id}`,
268
+ trigger: r.url ? "hover" : "manual"
237
269
  }, {
238
- default: () => n.filesize,
270
+ default: () => r.filesize,
239
271
  trigger: () => {
240
- var c, G;
241
- return e(Z, {
242
- onContextmenu: (m) => {
243
- M.value = n, y.value = !1, ue().then(() => {
244
- y.value = !0, T.value = m.clientX, j.value = m.clientY;
245
- }), m.preventDefault();
272
+ var c, Z;
273
+ return e(re, {
274
+ onContextmenu: (p) => {
275
+ M.value = r, y.value = !1, ve().then(() => {
276
+ y.value = !0, T.value = p.clientX, E.value = p.clientY;
277
+ }), p.preventDefault();
246
278
  },
247
- value: o.page ? !!((G = (c = u.value) == null ? void 0 : c.find) != null && G.call(c, (m) => m.id === n.id)) : !1,
248
- type: n.url ? "file" : "folder",
249
- mime: n.filetype,
250
- name: n.filename,
251
- url: n.url,
252
- time: n.created_at,
253
- onSelect: (m) => {
254
- var H, J, K;
255
- if (!n.url) {
256
- u.value = [], s.value.folder = n.id;
279
+ value: t.page ? !1 : !!((Z = (c = n.value) == null ? void 0 : c.find) != null && Z.call(c, (p) => p.id === r.id)),
280
+ type: r.url ? "file" : "folder",
281
+ mime: r.filetype,
282
+ name: r.filename,
283
+ url: r.url,
284
+ time: r.time,
285
+ onSelect: (p) => {
286
+ var ee, ae, le;
287
+ if (!r.url) {
288
+ n.value = [], u.data.value = void 0, i.value.folder = r.id;
257
289
  return;
258
290
  }
259
- o.page && (m ? o.multiple ? (H = u.value) == null || H.push(n) : u.value = [n] : o.multiple ? (K = u.value) == null || K.splice((J = u.value) == null ? void 0 : J.indexOf(n), 1) : u.value = []);
291
+ t.page || (p ? t.multiple ? (ee = n.value) == null || ee.push(r) : n.value = [r] : t.multiple ? (le = n.value) == null || le.splice((ae = n.value) == null ? void 0 : ae.indexOf(r), 1) : n.value = []);
260
292
  }
261
293
  }, null);
262
294
  }
263
- }))]) : e("div", {
264
- class: "w-full h-100 flex flex-justify-center justify-center items-center text-sm text-gray-6"
265
- }, [e("div", {
266
- class: "flex flex-col items-center gap-2"
267
- }, [e("div", {
268
- class: "w-26"
269
- }, [e(Me, null, null)]), e("div", null, [t("components.uploadManage.empty")]), ((A = s.value) == null ? void 0 : A.folder) && ((R = s.value) == null ? void 0 : R.folder) !== ((Y = (X = i.data.value) == null ? void 0 : X.meta) == null ? void 0 : Y.folder) && e("div", {
270
- class: "text-xs text-gray-6"
271
- }, [e(g, {
272
- type: "default",
273
- ghost: !0,
274
- onClick: () => {
275
- var n, c;
276
- u.value = [], s.value.folder = (c = (n = i.data.value) == null ? void 0 : n.meta) == null ? void 0 : c.folder;
277
- }
278
- }, N(d = t("components.uploadManage.back")) ? d : {
279
- default: () => [d]
280
- })])])])];
295
+ }))])];
296
+ }
297
+ }), u.isLoading.value ? e(Se, {
298
+ class: "h-full absolute w-full bg-gray-1/50"
299
+ }, null) : !((z = ($ = u.data.value) == null ? void 0 : $.data) != null && z.length) && e("div", {
300
+ class: "size-full flex justify-center items-center text-sm text-gray-6"
301
+ }, [e("div", {
302
+ class: "flex flex-col items-center"
303
+ }, [e("div", {
304
+ class: "w-26 mb-2"
305
+ }, [e(Ee, null, null)]), e("div", {
306
+ class: "text-base"
307
+ }, [o("components.uploadManage.empty")]), e("div", {
308
+ class: "text-sm text-muted"
309
+ }, [o("components.uploadManage.emptyDesc")]), ((D = i.value) == null ? void 0 : D.folder) && ((_ = i.value) == null ? void 0 : _.folder) !== ((B = (q = u.data.value) == null ? void 0 : q.meta) == null ? void 0 : B.folder) && e("div", {
310
+ class: "text-xs text-gray-6"
311
+ }, [e(h, {
312
+ type: "default",
313
+ ghost: !0,
314
+ onClick: () => {
315
+ var a, l;
316
+ n.value = [], i.value.folder = (l = (a = u.data.value) == null ? void 0 : a.meta) == null ? void 0 : l.folder;
281
317
  }
282
- })]), e(ye, {
318
+ }, N(s = o("components.uploadManage.back")) ? s : {
319
+ default: () => [s]
320
+ })])])])]), e(Ne, {
283
321
  x: T.value,
284
- y: j.value,
322
+ y: E.value,
285
323
  placement: "bottom-start",
286
324
  trigger: "manual",
287
325
  show: y.value,
@@ -292,16 +330,16 @@ const ta = /* @__PURE__ */ ne({
292
330
  a || (M.value = void 0);
293
331
  },
294
332
  onSelect: (a) => {
295
- const l = me(M.value);
333
+ const l = Me(M.value);
296
334
  switch (a) {
297
335
  case "download":
298
- ee.url(l == null ? void 0 : l.url);
336
+ ue.url(l == null ? void 0 : l.url);
299
337
  break;
300
338
  case "rename":
301
339
  x.prompt({
302
- title: t("components.uploadManage.namePlaceholder"),
340
+ title: o("components.uploadManage.namePlaceholder"),
303
341
  formSchema: [{
304
- tag: W,
342
+ tag: ne,
305
343
  attrs: {
306
344
  "v-model:value": "form.name"
307
345
  }
@@ -309,71 +347,71 @@ const ta = /* @__PURE__ */ ne({
309
347
  defaultValue: {
310
348
  name: (l == null ? void 0 : l.filename) || (l == null ? void 0 : l.name)
311
349
  }
312
- }).then((v) => {
313
- oe(l == null ? void 0 : l.type, v == null ? void 0 : v.name, l == null ? void 0 : l.id);
350
+ }).then((g) => {
351
+ me(l == null ? void 0 : l.type, g == null ? void 0 : g.name, l == null ? void 0 : l.id);
314
352
  });
315
353
  break;
316
354
  case "delete":
317
355
  x.confirm({
318
- title: t("components.uploadManage.delTitle"),
319
- content: t("components.uploadManage.delDesc")
356
+ title: o("components.uploadManage.delTitle"),
357
+ content: o("components.uploadManage.delDesc")
320
358
  }).then(() => {
321
- I(l == null ? void 0 : l.type, l == null ? void 0 : l.id);
359
+ j(l == null ? void 0 : l.type, l == null ? void 0 : l.id);
322
360
  });
323
361
  break;
324
362
  }
325
363
  },
326
- options: [((E = M.value) == null ? void 0 : E.url) && {
327
- label: t("components.button.download"),
364
+ options: [((A = M.value) == null ? void 0 : A.url) && {
365
+ label: o("components.button.download"),
328
366
  key: "download",
329
367
  icon: () => e("div", {
330
368
  class: "i-tabler:download"
331
369
  }, null)
332
370
  }, {
333
- label: t("components.button.rename"),
371
+ label: o("components.button.rename"),
334
372
  key: "rename",
335
373
  icon: () => e("div", {
336
374
  class: "i-tabler:cursor-text"
337
375
  }, null)
338
376
  }, {
339
- label: t("components.button.delete"),
377
+ label: o("components.button.delete"),
340
378
  key: "delete",
341
379
  icon: () => e("div", {
342
380
  class: "i-tabler:trash"
343
381
  }, null)
344
382
  }].filter((a) => a)
345
- }, null), o.page && e("div", {
383
+ }, null), !t.page && e("div", {
346
384
  class: "flex justify-end gap-2 border-t border-muted p-3"
347
- }, [e("div", null, [((U = u.value) == null ? void 0 : U.length) > 0 && e(g, {
385
+ }, [e("div", null, [((R = n.value) == null ? void 0 : R.length) > 0 && e(h, {
348
386
  type: "error",
349
387
  secondary: !0,
350
388
  onClick: () => {
351
389
  x.confirm({
352
- title: t("components.uploadManage.delTitle"),
353
- content: t("components.uploadManage.delDesc")
390
+ title: o("components.uploadManage.delTitle"),
391
+ content: o("components.uploadManage.delDesc")
354
392
  }).then(() => {
355
393
  var a;
356
- I("file", (a = u.value) == null ? void 0 : a.map((l) => l.id));
394
+ j("file", (a = n.value) == null ? void 0 : a.map((l) => l.id));
357
395
  });
358
396
  }
359
- }, N(p = t("components.button.delete")) ? p : {
360
- default: () => [p]
361
- })]), e("div", null, [e(g, {
397
+ }, N(v = o("components.button.delete")) ? v : {
398
+ default: () => [v]
399
+ })]), e("div", null, [e(h, {
362
400
  type: "primary",
363
- disabled: !((V = u.value) != null && V.length),
401
+ disabled: !((X = n.value) != null && X.length),
364
402
  onClick: () => {
365
403
  var a;
366
- (a = o.onConfirm) == null || a.call(o, u.value);
404
+ (a = t.onConfirm) == null || a.call(t, n.value);
367
405
  }
368
406
  }, {
369
407
  default: () => {
370
408
  var a;
371
- return [t("components.button.select"), Q("("), ((a = u.value) == null ? void 0 : a.length) || 0, Q(")")];
409
+ return [o("components.button.select"), oe("("), ((a = n.value) == null ? void 0 : a.length) || 0, oe(")")];
372
410
  }
373
411
  })])])]);
374
412
  };
375
413
  }
376
414
  });
377
415
  export {
378
- ta as default
416
+ Ca as default
379
417
  };