@melt-js/libs-vben 0.0.0-stage → 2026.11.8-2

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 (174) hide show
  1. package/LICENSE +10 -0
  2. package/README.md +86 -2
  3. package/package.json +98 -3
  4. package/src/access/access-control.vue +47 -0
  5. package/src/access/accessible.ts +236 -0
  6. package/src/access/directive.ts +42 -0
  7. package/src/access/index.ts +4 -0
  8. package/src/access/use-access.ts +53 -0
  9. package/src/composables/index.ts +14 -0
  10. package/src/composables/use-is-mobile.ts +7 -0
  11. package/src/composables/use-layout-style.ts +51 -0
  12. package/src/composables/use-layout-viewport-height.ts +71 -0
  13. package/src/composables/use-namespace.ts +106 -0
  14. package/src/composables/use-priority-value.ts +96 -0
  15. package/src/composables/use-scroll-lock.ts +151 -0
  16. package/src/composables/use-simple-locale/README.md +3 -0
  17. package/src/composables/use-simple-locale/index.ts +27 -0
  18. package/src/composables/use-simple-locale/messages.ts +31 -0
  19. package/src/composables/use-sortable.ts +32 -0
  20. package/src/constants/core.ts +76 -0
  21. package/src/constants/index.ts +2 -0
  22. package/src/core-icons/create-icon.ts +14 -0
  23. package/src/core-icons/index.ts +11 -0
  24. package/src/core-icons/lucide.ts +95 -0
  25. package/src/core-preferences/config.ts +172 -0
  26. package/src/core-preferences/constants.ts +116 -0
  27. package/src/core-preferences/index.ts +24 -0
  28. package/src/core-preferences/preferences.ts +503 -0
  29. package/src/core-preferences/types.ts +471 -0
  30. package/src/core-preferences/update-css-variables.ts +129 -0
  31. package/src/core-preferences/use-preferences.ts +282 -0
  32. package/src/design/css/global.css +1 -0
  33. package/src/design/css/nprogress.css +61 -0
  34. package/src/design/css/transition.css +238 -0
  35. package/src/design/css/ui.css +101 -0
  36. package/src/design/design-tokens/dark.css +446 -0
  37. package/src/design/design-tokens/default.css +491 -0
  38. package/src/design/design-tokens/index.ts +2 -0
  39. package/src/design/index.ts +6 -0
  40. package/src/design/scss-bem/bem.scss +34 -0
  41. package/src/design/scss-bem/constants.scss +5 -0
  42. package/src/hooks/index.ts +9 -0
  43. package/src/hooks/use-app-config.ts +39 -0
  44. package/src/hooks/use-content-maximize.ts +24 -0
  45. package/src/hooks/use-design-tokens.ts +421 -0
  46. package/src/hooks/use-hover-toggle.ts +163 -0
  47. package/src/hooks/use-pagination.ts +72 -0
  48. package/src/hooks/use-refresh.ts +16 -0
  49. package/src/hooks/use-tabs.ts +143 -0
  50. package/src/hooks/use-watermark.ts +84 -0
  51. package/src/icons/iconify/index.ts +5 -0
  52. package/src/icons/icons/empty-icon.vue +27 -0
  53. package/src/icons/index.ts +3 -0
  54. package/src/icons/svg/icons/antdv-logo.svg +29 -0
  55. package/src/icons/svg/icons/antdv-next-logo.svg +1 -0
  56. package/src/icons/svg/icons/avatar-1.svg +1 -0
  57. package/src/icons/svg/icons/avatar-2.svg +1 -0
  58. package/src/icons/svg/icons/avatar-3.svg +1 -0
  59. package/src/icons/svg/icons/avatar-4.svg +1 -0
  60. package/src/icons/svg/icons/bell.svg +1 -0
  61. package/src/icons/svg/icons/cake.svg +1 -0
  62. package/src/icons/svg/icons/card.svg +1 -0
  63. package/src/icons/svg/icons/dingding.svg +1 -0
  64. package/src/icons/svg/icons/download.svg +1 -0
  65. package/src/icons/svg/icons/github.svg +1 -0
  66. package/src/icons/svg/icons/google.svg +1 -0
  67. package/src/icons/svg/icons/qqchat.svg +1 -0
  68. package/src/icons/svg/icons/tdesign-logo.svg +39 -0
  69. package/src/icons/svg/icons/wechat.svg +1 -0
  70. package/src/icons/svg/index.ts +39 -0
  71. package/src/icons/svg/load.ts +81 -0
  72. package/src/locales/i18n.ts +147 -0
  73. package/src/locales/index.ts +30 -0
  74. package/src/locales/langs/en-US/authentication.json +65 -0
  75. package/src/locales/langs/en-US/common.json +27 -0
  76. package/src/locales/langs/en-US/preferences.json +245 -0
  77. package/src/locales/langs/en-US/profile.json +4 -0
  78. package/src/locales/langs/en-US/ui.json +165 -0
  79. package/src/locales/langs/zh-CN/authentication.json +65 -0
  80. package/src/locales/langs/zh-CN/common.json +27 -0
  81. package/src/locales/langs/zh-CN/preferences.json +245 -0
  82. package/src/locales/langs/zh-CN/profile.json +4 -0
  83. package/src/locales/langs/zh-CN/ui.json +165 -0
  84. package/src/locales/langs/zh-TW/authentication.json +65 -0
  85. package/src/locales/langs/zh-TW/common.json +27 -0
  86. package/src/locales/langs/zh-TW/preferences.json +245 -0
  87. package/src/locales/langs/zh-TW/profile.json +4 -0
  88. package/src/locales/langs/zh-TW/ui.json +165 -0
  89. package/src/locales/typing.ts +27 -0
  90. package/src/preferences/index.ts +42 -0
  91. package/src/request/index.ts +2 -0
  92. package/src/request/request-client/index.ts +3 -0
  93. package/src/request/request-client/modules/downloader.ts +60 -0
  94. package/src/request/request-client/modules/interceptor.ts +40 -0
  95. package/src/request/request-client/modules/sse.ts +134 -0
  96. package/src/request/request-client/modules/uploader.ts +79 -0
  97. package/src/request/request-client/preset-interceptors.ts +178 -0
  98. package/src/request/request-client/request-client.ts +163 -0
  99. package/src/request/request-client/types.ts +90 -0
  100. package/src/shared/cache/README.md +418 -0
  101. package/src/shared/cache/index.ts +5 -0
  102. package/src/shared/cache/indexeddb-driver.ts +137 -0
  103. package/src/shared/cache/local-storage-driver.ts +70 -0
  104. package/src/shared/cache/memory-storage-driver.ts +32 -0
  105. package/src/shared/cache/storage-manager.ts +146 -0
  106. package/src/shared/cache/types.ts +39 -0
  107. package/src/shared/color/color.ts +9 -0
  108. package/src/shared/color/convert.ts +62 -0
  109. package/src/shared/color/generator.ts +45 -0
  110. package/src/shared/color/index.ts +3 -0
  111. package/src/shared/constants/globals.ts +20 -0
  112. package/src/shared/constants/index.ts +2 -0
  113. package/src/shared/constants/vben.ts +30 -0
  114. package/src/shared/global-state.ts +45 -0
  115. package/src/shared/store.ts +1 -0
  116. package/src/shared/utils/cn.ts +10 -0
  117. package/src/shared/utils/date.ts +80 -0
  118. package/src/shared/utils/diff.ts +114 -0
  119. package/src/shared/utils/dom.ts +126 -0
  120. package/src/shared/utils/download.ts +186 -0
  121. package/src/shared/utils/error.ts +19 -0
  122. package/src/shared/utils/index.ts +22 -0
  123. package/src/shared/utils/inference.ts +164 -0
  124. package/src/shared/utils/letter.ts +47 -0
  125. package/src/shared/utils/merge.ts +11 -0
  126. package/src/shared/utils/nprogress.ts +52 -0
  127. package/src/shared/utils/resources.ts +21 -0
  128. package/src/shared/utils/stack.ts +103 -0
  129. package/src/shared/utils/state-handler.ts +61 -0
  130. package/src/shared/utils/to.ts +21 -0
  131. package/src/shared/utils/tree.ts +159 -0
  132. package/src/shared/utils/unique.ts +15 -0
  133. package/src/shared/utils/update-css-variables.ts +47 -0
  134. package/src/shared/utils/util.ts +50 -0
  135. package/src/shared/utils/window.ts +37 -0
  136. package/src/stores/index.ts +3 -0
  137. package/src/stores/modules/access.ts +130 -0
  138. package/src/stores/modules/dict.ts +244 -0
  139. package/src/stores/modules/index.ts +5 -0
  140. package/src/stores/modules/tabbar.ts +797 -0
  141. package/src/stores/modules/timezone.ts +132 -0
  142. package/src/stores/modules/user.ts +42 -0
  143. package/src/stores/setup.ts +79 -0
  144. package/src/stores/shim-pinia.d.ts +11 -0
  145. package/src/styles/antd/index.css +78 -0
  146. package/src/styles/antdv-next/index.css +90 -0
  147. package/src/styles/ele/index.css +44 -0
  148. package/src/styles/global/index.scss +1 -0
  149. package/src/styles/index.ts +1 -0
  150. package/src/styles/naive/index.css +26 -0
  151. package/src/styles/style-exports.d.ts +3 -0
  152. package/src/theme.css +592 -0
  153. package/src/types/global.d.ts +28 -0
  154. package/src/types/index.ts +2 -0
  155. package/src/types/shims.d.ts +1 -0
  156. package/src/types/user.ts +20 -0
  157. package/src/typings/app.d.ts +128 -0
  158. package/src/typings/basic.d.ts +42 -0
  159. package/src/typings/helper.d.ts +147 -0
  160. package/src/typings/index.ts +16 -0
  161. package/src/typings/languages.ts +28 -0
  162. package/src/typings/menu-record.ts +82 -0
  163. package/src/typings/tabs.ts +8 -0
  164. package/src/typings/vue-router.d.ts +169 -0
  165. package/src/utils/helpers/find-menu-by-path.ts +37 -0
  166. package/src/utils/helpers/generate-menus.ts +89 -0
  167. package/src/utils/helpers/generate-routes-backend.ts +108 -0
  168. package/src/utils/helpers/generate-routes-frontend.ts +58 -0
  169. package/src/utils/helpers/get-popup-container.ts +10 -0
  170. package/src/utils/helpers/index.ts +8 -0
  171. package/src/utils/helpers/merge-route-modules.ts +28 -0
  172. package/src/utils/helpers/reset-routes.ts +30 -0
  173. package/src/utils/helpers/unmount-global-loading.ts +31 -0
  174. package/src/utils/index.ts +4 -0
@@ -0,0 +1,245 @@
1
+ {
2
+ "title": "偏好設定",
3
+ "subtitle": "自定義偏好設定 & 即時預覽",
4
+ "enableStickyPreferencesNavigationBar": "開啟首選項導航欄吸頂效果",
5
+ "disableStickyPreferencesNavigationBar": "關閉首選項導航欄吸頂效果",
6
+ "resetTitle": "重置偏好設定",
7
+ "resetTip": "資料有變化,點選可進行重置",
8
+ "resetSuccess": "重置偏好設定成功",
9
+ "appearance": "外觀",
10
+ "layout": "佈局",
11
+ "content": "內容",
12
+ "other": "其它",
13
+ "wide": "流式",
14
+ "compact": "定寬",
15
+ "followSystem": "跟隨系統",
16
+ "vertical": "垂直",
17
+ "verticalTip": "側邊垂直選單模式",
18
+ "horizontal": "水平",
19
+ "horizontalTip": "水平選單模式,選單全部顯示在頂部",
20
+ "twoColumn": "雙列選單",
21
+ "twoColumnTip": "垂直雙列選單模式",
22
+ "headerSidebarNav": "側邊導航",
23
+ "headerSidebarNavTip": "頂部通欄,側邊導航模式",
24
+ "headerTwoColumn": "混合雙列",
25
+ "headerTwoColumnTip": "雙列、水平選單共存模式",
26
+ "mixedMenu": "混合垂直",
27
+ "mixedMenuTip": "垂直水平選單共存",
28
+ "fullContent": "內容全屏",
29
+ "fullContentTip": "不顯示任何選單,只顯示內容主體",
30
+ "normal": "常規",
31
+ "plain": "樸素",
32
+ "rounded": "圓潤",
33
+ "copyPreferences": "複製偏好設定",
34
+ "enableCopyPreferences": "顯示複製偏好設定按鈕",
35
+ "copyPreferencesSuccessTitle": "複製成功",
36
+ "copyPreferencesSuccess": "複製成功,請在 app 下的 `src/preferences.ts`內進行覆蓋",
37
+ "clearAndLogout": "清空快取 & 退出登入",
38
+ "mode": "模式",
39
+ "general": "通用",
40
+ "language": "語言",
41
+ "timezone": "時區",
42
+ "dynamicTitle": "動態標題",
43
+ "watermark": "水印",
44
+ "watermarkContent": "請輸入水印文案",
45
+ "checkUpdates": "定時檢查更新",
46
+ "position": {
47
+ "title": "偏好設定位置",
48
+ "header": "頂欄",
49
+ "auto": "自動",
50
+ "fixed": "固定",
51
+ "userDropdown": "使用者下拉窗"
52
+ },
53
+ "sidebar": {
54
+ "buttons": "顯示按鈕",
55
+ "buttonFixed": "固定按鈕",
56
+ "buttonCollapsed": "摺疊按鈕",
57
+ "title": "側邊欄",
58
+ "width": "寬度",
59
+ "visible": "顯示側邊欄",
60
+ "draggable": "側邊欄選單拖拽",
61
+ "collapsed": "摺疊選單",
62
+ "collapsedShowTitle": "摺疊顯示選單名",
63
+ "autoActivateChild": "自動啟用子選單",
64
+ "autoActivateChildTip": "點選頂層選單時,自動啟用第一個子選單或者上一次啟用的子選單",
65
+ "expandOnHover": "滑鼠懸停展開",
66
+ "expandOnHoverTip": "滑鼠在摺疊區域懸浮時,`啟用`則展開當前子選單,`停用`則展開整個側邊欄"
67
+ },
68
+ "tabbar": {
69
+ "title": "標籤欄",
70
+ "enable": "啟用標籤欄",
71
+ "icon": "顯示標籤欄圖示",
72
+ "showMore": "顯示更多按鈕",
73
+ "showMaximize": "顯示最大化按鈕",
74
+ "persist": "持久化標籤頁",
75
+ "visitHistory": "訪問歷史記錄",
76
+ "visitHistoryTip": "開啟後,標籤欄會記錄標籤訪問歷史\n關閉當前標籤,會自動選中上一個開啟的標籤",
77
+ "maxCount": "最大標籤數",
78
+ "maxCountTip": "每次開啟新的標籤時如果超過最大標籤數,\n會自動關閉一個最先開啟的標籤\n設定為 0 則不限制",
79
+ "draggable": "啟動拖拽排序",
80
+ "wheelable": "啟用縱向滾輪響應",
81
+ "middleClickClose": "點選滑鼠中鍵關閉標籤頁",
82
+ "wheelableTip": "開啟後,標籤欄區域可以響應滾輪的縱向滾動事件。\n關閉時,只能響應系統的橫向滾動事件(需要按下Shift再滾動滾輪)",
83
+ "styleType": {
84
+ "title": "標籤頁風格",
85
+ "chrome": "谷歌",
86
+ "card": "卡片",
87
+ "plain": "樸素",
88
+ "brisk": "輕快"
89
+ },
90
+ "contextMenu": {
91
+ "reload": "重新載入",
92
+ "close": "關閉",
93
+ "pin": "固定",
94
+ "unpin": "取消固定",
95
+ "closeLeft": "關閉左側標籤頁",
96
+ "closeRight": "關閉右側標籤頁",
97
+ "closeOther": "關閉其它標籤頁",
98
+ "closeAll": "關閉全部標籤頁",
99
+ "openInNewWindow": "在新視窗開啟",
100
+ "maximize": "最大化",
101
+ "restoreMaximize": "還原"
102
+ }
103
+ },
104
+ "navigationMenu": {
105
+ "title": "導航選單",
106
+ "style": "導航選單風格",
107
+ "accordion": "側邊導航選單手風琴模式",
108
+ "split": "導航選單分離",
109
+ "splitTip": "開啟時,側邊欄顯示頂欄對應選單的子選單"
110
+ },
111
+ "breadcrumb": {
112
+ "title": "麵包屑導航",
113
+ "enable": "開啟麵包屑導航",
114
+ "icon": "顯示麵包屑圖示",
115
+ "home": "顯示首頁按鈕",
116
+ "style": "麵包屑風格",
117
+ "hideOnlyOne": "僅有一個時隱藏",
118
+ "background": "背景"
119
+ },
120
+ "animation": {
121
+ "title": "動畫",
122
+ "loading": "頁面切換 Loading",
123
+ "transition": "頁面切換動畫",
124
+ "progress": "頁面切換進度條"
125
+ },
126
+ "theme": {
127
+ "title": "主題",
128
+ "radius": "圓角",
129
+ "fontSize": "字型大小",
130
+ "fontSizeTip": "調整全域性字型大小,即時預覽效果",
131
+ "light": "淺色",
132
+ "dark": "深色",
133
+ "darkSidebar": "深色側邊欄",
134
+ "darkSidebarTip": "當主題為淺色,佈局不為水平選單或不為內容全屏時可開啟",
135
+ "darkSidebarSub": "深色側邊欄子欄",
136
+ "darkSidebarSubTip": "當主題為淺色,開啟深色側邊欄且佈局使用雙列選單模式時可開啟",
137
+ "darkHeader": "深色頂欄",
138
+ "weakMode": "色弱模式",
139
+ "grayMode": "灰色模式",
140
+ "builtin": {
141
+ "title": "內建主題",
142
+ "default": "預設",
143
+ "violet": "紫羅蘭",
144
+ "pink": "櫻花粉",
145
+ "rose": "玫瑰紅",
146
+ "skyBlue": "天藍色",
147
+ "deepBlue": "深藍色",
148
+ "green": "淺綠色",
149
+ "deepGreen": "深綠色",
150
+ "orange": "橙黃色",
151
+ "yellow": "檸檬黃",
152
+ "zinc": "鋅色灰",
153
+ "neutral": "中性色",
154
+ "slate": "石板灰",
155
+ "gray": "中灰色",
156
+ "custom": "自定義"
157
+ }
158
+ },
159
+ "header": {
160
+ "title": "頂欄",
161
+ "modeStatic": "靜止",
162
+ "modeFixed": "固定",
163
+ "modeAuto": "自動隱藏和顯示",
164
+ "modeAutoScroll": "滾動隱藏和顯示",
165
+ "visible": "顯示頂欄",
166
+ "menuAlign": "選單位置",
167
+ "menuAlignStart": "左側",
168
+ "menuAlignEnd": "右側",
169
+ "menuAlignCenter": "居中"
170
+ },
171
+ "footer": {
172
+ "title": "底欄",
173
+ "visible": "顯示底欄",
174
+ "fixed": "固定在底部"
175
+ },
176
+ "copyright": {
177
+ "title": "版權",
178
+ "enable": "啟用版權",
179
+ "companyName": "公司名",
180
+ "companySiteLink": "公司主頁",
181
+ "date": "日期",
182
+ "icp": "ICP 備案號",
183
+ "icpLink": "ICP 網站連結"
184
+ },
185
+ "shortcutKeys": {
186
+ "title": "快捷鍵",
187
+ "global": "全域性",
188
+ "search": "全域性搜尋",
189
+ "logout": "退出登入",
190
+ "escape": "關閉當前視窗",
191
+ "preferences": "偏好設定"
192
+ },
193
+ "widget": {
194
+ "title": "小部件",
195
+ "globalSearch": "全域性搜尋",
196
+ "globalSearchPosition": "全域性搜尋位置",
197
+ "fullscreen": "全屏",
198
+ "fullscreenPosition": "全屏按鈕位置",
199
+ "themeToggle": "主題切換",
200
+ "themeTogglePosition": "主題切換位置",
201
+ "languageToggle": "語言切換",
202
+ "languageTogglePosition": "語言切換位置",
203
+ "notification": "通知",
204
+ "notificationPosition": "通知位置",
205
+ "sidebarToggle": "啟用側邊欄切換",
206
+ "lockScreen": "鎖屏",
207
+ "lockScreenPosition": "鎖屏按鈕位置",
208
+ "logoutButtonPosition": "退出按鈕位置",
209
+ "header": "頂欄",
210
+ "userDropdown": "使用者下拉窗",
211
+ "hidden": "已隱藏",
212
+ "refresh": "重新整理",
213
+ "refreshPosition": "重新整理按鈕位置",
214
+ "timezone": "時區",
215
+ "timezonePosition": "時區按鈕位置"
216
+ },
217
+ "antd": {
218
+ "tabLabel": "Antd 拓展",
219
+ "title": "業務偏好",
220
+ "fields": {
221
+ "enableFormFullscreen": {
222
+ "label": "啟用表單全屏模式",
223
+ "tip": "子專案可在自己的業務場景中讀取這個拓展配置。"
224
+ },
225
+ "tenantMode": {
226
+ "label": "租戶模式",
227
+ "options": {
228
+ "single": {
229
+ "label": "單租戶"
230
+ },
231
+ "multi": {
232
+ "label": "多租戶"
233
+ }
234
+ }
235
+ },
236
+ "defaultTableSize": {
237
+ "label": "預設分頁條數"
238
+ },
239
+ "reportTitle": {
240
+ "label": "報表預設標題",
241
+ "placeholder": "請輸入報表預設標題"
242
+ }
243
+ }
244
+ }
245
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "updatePassword": "更新密碼",
3
+ "updateBasicProfile": "更新基本資訊"
4
+ }
@@ -0,0 +1,165 @@
1
+ {
2
+ "formRules": {
3
+ "required": "請輸入{0}",
4
+ "selectRequired": "請選擇{0}",
5
+ "minLength": "{0}至少{1}個字元",
6
+ "maxLength": "{0}最多{1}個字元",
7
+ "length": "{0}長度必須為{1}個字元",
8
+ "alreadyExists": "{0} `{1}` 已存在",
9
+ "startWith": "{0}必須以 {1} 開頭",
10
+ "invalidURL": "請輸入有效的連結",
11
+ "sizeLimit": "檔案大小不能超過 {0}MB",
12
+ "previewWarning": "無法開啟檔案,沒有可用的URL或預覽地址"
13
+ },
14
+ "actionTitle": {
15
+ "edit": "修改{0}",
16
+ "create": "新增{0}",
17
+ "delete": "刪除{0}",
18
+ "view": "檢視{0}"
19
+ },
20
+ "actionMessage": {
21
+ "deleteConfirm": "確定刪除 {0} 嗎?",
22
+ "deleting": "正在刪除 {0} ...",
23
+ "deleteSuccess": "{0} 刪除成功",
24
+ "operationSuccess": "操作成功",
25
+ "operationFailed": "操作失敗"
26
+ },
27
+ "placeholder": {
28
+ "input": "請輸入",
29
+ "select": "請選擇",
30
+ "upload": "點選上傳"
31
+ },
32
+ "captcha": {
33
+ "title": "請完成安全驗證",
34
+ "sliderSuccessText": "驗證通過",
35
+ "sliderDefaultText": "請按住滑塊拖動",
36
+ "sliderRotateDefaultTip": "點選圖片可重新整理",
37
+ "sliderTranslateDefaultTip": "點選圖片可重新整理",
38
+ "sliderRotateFailTip": "驗證失敗",
39
+ "sliderRotateSuccessTip": "驗證成功,耗時{0}秒",
40
+ "sliderTranslateFailTip": "驗證失敗",
41
+ "sliderTranslateSuccessTip": "驗證成功,耗時{0}秒",
42
+ "alt": "支援img標籤src屬性值",
43
+ "refreshAriaLabel": "重新整理驗證碼",
44
+ "confirmAriaLabel": "確認選擇",
45
+ "confirm": "確認",
46
+ "pointAriaLabel": "點選點",
47
+ "clickInOrder": "請依次點選"
48
+ },
49
+ "iconPicker": {
50
+ "placeholder": "選擇一個圖示",
51
+ "search": "搜尋圖示..."
52
+ },
53
+ "jsonViewer": {
54
+ "copy": "複製",
55
+ "copied": "已複製"
56
+ },
57
+ "crop": {
58
+ "title": "圖片裁剪",
59
+ "titleTip": "裁剪比例 {0}",
60
+ "confirm": "裁剪",
61
+ "cancel": "取消裁剪",
62
+ "errorTip": "裁剪錯誤"
63
+ },
64
+ "tiptap": {
65
+ "placeholder": "請輸入內容...",
66
+ "prompts": {
67
+ "image": "請輸入圖片地址",
68
+ "link": "請輸入連結地址"
69
+ },
70
+ "toolbar": {
71
+ "bold": "加粗",
72
+ "italic": "斜體",
73
+ "underline": "下劃線",
74
+ "strike": "刪除線",
75
+ "code": "行內程式碼",
76
+ "codeBlock": "程式碼塊",
77
+ "heading": "標題",
78
+ "paragraph": "正文",
79
+ "heading1": "標題1",
80
+ "heading2": "標題2",
81
+ "heading3": "標題3",
82
+ "heading4": "標題4",
83
+ "bulletList": "無序列表",
84
+ "orderedList": "有序列表",
85
+ "blockquote": "引用",
86
+ "link": "連結",
87
+ "unlink": "移除連結",
88
+ "image": "圖片",
89
+ "imageUrl": "圖片URL",
90
+ "imageUpload": "從本地上傳",
91
+ "textColor": "文字顏色",
92
+ "highlightColor": "高亮顏色",
93
+ "alignLeft": "左對齊",
94
+ "alignCenter": "居中",
95
+ "alignRight": "右對齊",
96
+ "preview": "預覽",
97
+ "undo": "撤銷",
98
+ "redo": "重做",
99
+ "clear": "清除"
100
+ },
101
+ "upload": {
102
+ "fileTooLarge": "檔案大小超出限制",
103
+ "fileTypeNotAllowed": "不支援的檔案型別",
104
+ "onlySingleImage": "僅支援單張圖片上傳,已選取第一張",
105
+ "uploadFailed": "上傳失敗"
106
+ }
107
+ },
108
+ "fallback": {
109
+ "pageNotFound": "哎呀!未找到頁面",
110
+ "pageNotFoundDesc": "抱歉,我們無法找到您要找的頁面。",
111
+ "forbidden": "哎呀!訪問被拒絕",
112
+ "forbiddenDesc": "抱歉,您沒有許可權訪問此頁面。",
113
+ "internalError": "哎呀!出錯了",
114
+ "internalErrorDesc": "抱歉,伺服器遇到錯誤。",
115
+ "offline": "離線頁面",
116
+ "offlineError": "哎呀!網路錯誤",
117
+ "offlineErrorDesc": "抱歉,無法連線到網際網路,請檢查您的網路連線並重試。",
118
+ "comingSoon": "即將推出",
119
+ "http": {
120
+ "requestTimeout": "請求超時,請稍後再試。",
121
+ "networkError": "網路異常,請檢查您的網路連線後重試。",
122
+ "badRequest": "請求錯誤。請檢查您的輸入並重試。",
123
+ "unauthorized": "登入認證過期,請重新登入後繼續。",
124
+ "forbidden": "禁止訪問, 您沒有許可權訪問此資源。",
125
+ "notFound": "未找到, 請求的資源不存在。",
126
+ "internalServerError": "內部伺服器錯誤,請稍後再試。"
127
+ }
128
+ },
129
+ "widgets": {
130
+ "document": "文件",
131
+ "qa": "問題 & 幫助",
132
+ "setting": "設定",
133
+ "logoutTip": "是否退出登入?",
134
+ "viewAll": "檢視所有訊息",
135
+ "notifications": "通知",
136
+ "markAllAsRead": "全部標記為已讀",
137
+ "clearNotifications": "清空",
138
+ "checkUpdatesTitle": "新版本可用",
139
+ "checkUpdatesDescription": "點選重新整理以獲取最新版本",
140
+ "search": {
141
+ "title": "搜尋",
142
+ "searchNavigate": "搜尋導航選單",
143
+ "select": "選擇",
144
+ "navigate": "導航",
145
+ "close": "關閉",
146
+ "noResults": "未找到搜尋結果",
147
+ "noRecent": "沒有搜尋歷史",
148
+ "recent": "搜尋歷史"
149
+ },
150
+ "lockScreen": {
151
+ "title": "鎖定螢幕",
152
+ "screenButton": "鎖定",
153
+ "password": "密碼",
154
+ "placeholder": "請輸入鎖屏密碼",
155
+ "unlock": "點選解鎖",
156
+ "errorPasswordTip": "密碼錯誤,請重新輸入",
157
+ "backToLogin": "返回登入",
158
+ "entry": "進入系統"
159
+ },
160
+ "timezone": {
161
+ "setTimezone": "設定時區",
162
+ "setSuccess": "時區設定成功"
163
+ }
164
+ }
165
+ }
@@ -0,0 +1,27 @@
1
+ import type { SupportedLanguagesType } from '@melt-js/libs-vben/typings';
2
+
3
+ export type { SupportedLanguagesType };
4
+
5
+ export type ImportLocaleFn = () => Promise<{ default: Record<string, string> }>;
6
+
7
+ export type LoadMessageFn = (
8
+ lang: SupportedLanguagesType,
9
+ ) => Promise<Record<string, string> | undefined>;
10
+
11
+ export interface LocaleSetupOptions {
12
+ /**
13
+ * Default language
14
+ * @default zh-CN
15
+ */
16
+ defaultLocale?: SupportedLanguagesType;
17
+ /**
18
+ * Load message function
19
+ * @param lang
20
+ * @returns
21
+ */
22
+ loadMessages?: LoadMessageFn;
23
+ /**
24
+ * Whether to warn when the key is not found
25
+ */
26
+ missingWarn?: boolean;
27
+ }
@@ -0,0 +1,42 @@
1
+ import type {
2
+ CustomPreferencesRecord,
3
+ Preferences,
4
+ PreferencesExtension,
5
+ } from '@melt-js/libs-vben/core-preferences';
6
+ import type { DeepPartial } from '@melt-js/libs-vben/typings';
7
+
8
+ /**
9
+ * 如果你想所有的app都使用相同的默认偏好设置,你可以在这里定义
10
+ * 而不是去修改 @vben-core/preferences 中的默认偏好设置
11
+ * @param preferences
12
+ * @returns
13
+ */
14
+
15
+ function defineOverridesPreferences(preferences: DeepPartial<Preferences>) {
16
+ return preferences;
17
+ }
18
+
19
+ function definePreferencesExtension<
20
+ TCustomPreferences extends object = CustomPreferencesRecord,
21
+ >(extension: PreferencesExtension<TCustomPreferences>) {
22
+ return extension;
23
+ }
24
+
25
+ /** 应用级版权配置,供各 app 的 preferences 覆盖使用 */
26
+ const appCopyrightPreferences = {
27
+ companyName: 'Vben',
28
+ companySiteLink: 'https://www.vben.pro',
29
+ date: '2024',
30
+ enable: true,
31
+ icp: '闽ICP备19024351号',
32
+ icpLink: 'https://beian.miit.gov.cn/',
33
+ settingShow: true,
34
+ } satisfies DeepPartial<Preferences>['copyright'];
35
+
36
+ export {
37
+ appCopyrightPreferences,
38
+ defineOverridesPreferences,
39
+ definePreferencesExtension,
40
+ };
41
+
42
+ export * from '@melt-js/libs-vben/core-preferences';
@@ -0,0 +1,2 @@
1
+ export * from './request-client';
2
+ export * from 'axios';
@@ -0,0 +1,3 @@
1
+ export * from './preset-interceptors';
2
+ export * from './request-client';
3
+ export type * from './types';
@@ -0,0 +1,60 @@
1
+ import type { RequestClient } from '../request-client';
2
+ import type { RequestClientConfig } from '../types';
3
+
4
+ type DownloadRequestConfig = {
5
+ /**
6
+ * 定义期望获得的数据类型。
7
+ * raw: 原始的AxiosResponse,包括headers、status等。
8
+ * body: 只返回响应数据的BODY部分(Blob)
9
+ */
10
+ responseReturn?: 'body' | 'raw';
11
+ } & Omit<RequestClientConfig, 'responseReturn'>;
12
+
13
+ class FileDownloader {
14
+ private client: RequestClient;
15
+
16
+ constructor(client: RequestClient) {
17
+ this.client = client;
18
+ }
19
+ /**
20
+ * 下载文件
21
+ * @param url 文件的完整链接
22
+ * @param config 配置信息,可选。
23
+ * @returns 如果config.responseReturn为'body',则返回Blob(默认),否则返回RequestResponse<Blob>
24
+ */
25
+ public async download<T = Blob>(
26
+ url: string,
27
+ config?: DownloadRequestConfig,
28
+ ): Promise<T> {
29
+ const finalConfig: DownloadRequestConfig = {
30
+ responseReturn: 'body',
31
+ method: 'GET',
32
+ ...config,
33
+ responseType: 'blob',
34
+ };
35
+
36
+ // Prefer a generic request if available; otherwise, dispatch to method-specific calls.
37
+ const method = (finalConfig.method || 'GET').toUpperCase();
38
+ const clientAny = this.client as any;
39
+
40
+ if (typeof clientAny.request === 'function') {
41
+ return await clientAny.request(url, finalConfig);
42
+ }
43
+ const lower = method.toLowerCase();
44
+
45
+ if (typeof clientAny[lower] === 'function') {
46
+ if (['POST', 'PUT'].includes(method)) {
47
+ const { data, ...rest } = finalConfig as Record<string, any>;
48
+ return await clientAny[lower](url, data, rest);
49
+ }
50
+
51
+ return await clientAny[lower](url, finalConfig);
52
+ }
53
+
54
+ throw new Error(
55
+ `RequestClient does not support method "${method}". Please ensure the method is properly implemented in your RequestClient instance.`,
56
+ );
57
+ }
58
+ }
59
+
60
+ export { FileDownloader };
@@ -0,0 +1,40 @@
1
+ import type { AxiosInstance, AxiosResponse } from 'axios';
2
+
3
+ import type {
4
+ RequestInterceptorConfig,
5
+ ResponseInterceptorConfig,
6
+ } from '../types';
7
+
8
+ const defaultRequestInterceptorConfig: RequestInterceptorConfig = {
9
+ fulfilled: (response) => response,
10
+ rejected: (error) => Promise.reject(error),
11
+ };
12
+
13
+ const defaultResponseInterceptorConfig: ResponseInterceptorConfig = {
14
+ fulfilled: (response: AxiosResponse) => response,
15
+ rejected: (error) => Promise.reject(error),
16
+ };
17
+
18
+ class InterceptorManager {
19
+ private axiosInstance: AxiosInstance;
20
+
21
+ constructor(instance: AxiosInstance) {
22
+ this.axiosInstance = instance;
23
+ }
24
+
25
+ addRequestInterceptor({
26
+ fulfilled,
27
+ rejected,
28
+ }: RequestInterceptorConfig = defaultRequestInterceptorConfig) {
29
+ this.axiosInstance.interceptors.request.use(fulfilled, rejected);
30
+ }
31
+
32
+ addResponseInterceptor<T = any>({
33
+ fulfilled,
34
+ rejected,
35
+ }: ResponseInterceptorConfig<T> = defaultResponseInterceptorConfig) {
36
+ this.axiosInstance.interceptors.response.use(fulfilled, rejected);
37
+ }
38
+ }
39
+
40
+ export { InterceptorManager };