@dt-frames/ui 2.0.1 → 2.0.3

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 (220) hide show
  1. package/es/assets/data/icons/actions.d.ts +1 -0
  2. package/es/assets/data/icons/actions.ts +423 -0
  3. package/es/assets/data/icons/code.d.ts +1 -0
  4. package/es/assets/data/icons/code.ts +10 -0
  5. package/es/assets/data/icons/commuticate.d.ts +1 -0
  6. package/es/assets/data/icons/commuticate.ts +182 -0
  7. package/es/assets/data/icons/currency.d.ts +1 -0
  8. package/es/assets/data/icons/currency.ts +44 -0
  9. package/es/assets/data/icons/devices.d.ts +1 -0
  10. package/es/assets/data/icons/devices.ts +126 -0
  11. package/es/assets/data/icons/edit.d.ts +1 -0
  12. package/es/assets/data/icons/edit.ts +163 -0
  13. package/es/assets/data/icons/file.d.ts +1 -0
  14. package/es/assets/data/icons/file.ts +99 -0
  15. package/es/assets/data/icons/math.d.ts +1 -0
  16. package/es/assets/data/icons/math.ts +53 -0
  17. package/es/assets/data/icons/message.d.ts +1 -0
  18. package/es/assets/data/icons/message.ts +68 -0
  19. package/es/assets/data/icons/navigate.d.ts +1 -0
  20. package/es/assets/data/icons/navigate.ts +181 -0
  21. package/es/assets/data/icons/other.d.ts +1 -0
  22. package/es/assets/data/icons/other.ts +324 -0
  23. package/es/assets/data/index.d.ts +4 -0
  24. package/es/assets/data/index.ts +58 -0
  25. package/es/assets/icons/iconfont.css +7266 -0
  26. package/es/assets/icons/iconfont.eot +0 -0
  27. package/es/assets/icons/iconfont.svg +5445 -0
  28. package/es/assets/icons/iconfont.ttf +0 -0
  29. package/es/assets/icons/iconfont.woff +0 -0
  30. package/es/assets/icons/iconfont.woff2 +0 -0
  31. package/es/assets/imgs/header/avatar.png +0 -0
  32. package/es/assets/imgs/logo/logo.png +0 -0
  33. package/es/assets/imgs/table/empty.png +0 -0
  34. package/es/assets/locales/en.d.ts +101 -0
  35. package/es/assets/locales/en.ts +101 -0
  36. package/es/assets/locales/index.d.ts +2 -0
  37. package/es/assets/locales/index.ts +5 -0
  38. package/es/assets/locales/zh.d.ts +103 -0
  39. package/es/assets/locales/zh.ts +103 -0
  40. package/es/components/container/index.d.ts +94 -0
  41. package/es/components/container/index.js +290 -0
  42. package/es/components/container/index.less +64 -0
  43. package/es/components/container/src/components/bar.d.ts +14 -0
  44. package/es/components/container/src/components/scroll-bar.d.ts +70 -0
  45. package/es/components/container/src/hooks/scroll.d.ts +10 -0
  46. package/es/components/container/src/scroll-container.d.ts +76 -0
  47. package/es/components/container/src/slot-container.d.ts +20 -0
  48. package/es/components/container/src/types/scroll.type.d.ts +22 -0
  49. package/es/components/container/src/utils/scroll.d.ts +5 -0
  50. package/es/components/curd/index.d.ts +2 -0
  51. package/es/components/curd/index.js +3120 -0
  52. package/es/components/curd/src/components/Curd.d.ts +1246 -0
  53. package/es/components/curd/src/hooks/useCurd.d.ts +112 -0
  54. package/es/components/curd/src/props.d.ts +187 -0
  55. package/es/components/curd/src/types/curd.type.d.ts +19 -0
  56. package/es/components/drawer/index.d.ts +8039 -0
  57. package/es/components/drawer/index.js +838 -0
  58. package/es/components/drawer/index.less +10 -0
  59. package/es/components/drawer/src/components/DrawerFooter.d.ts +139 -0
  60. package/es/components/drawer/src/components/DrawerHeader.d.ts +11 -0
  61. package/es/components/drawer/src/hooks/useDrawer.d.ts +3 -0
  62. package/es/components/drawer/src/index.d.ts +8041 -0
  63. package/es/components/drawer/src/props.d.ts +64 -0
  64. package/es/components/drawer/src/types/index.type.d.ts +48 -0
  65. package/es/components/form/index.d.ts +3219 -0
  66. package/es/components/form/index.js +1896 -0
  67. package/es/components/form/index.less +141 -0
  68. package/es/components/form/src/components/FormButtons.d.ts +88 -0
  69. package/es/components/form/src/components/FormItem.d.ts +165 -0
  70. package/es/components/form/src/components/componentMap.d.ts +4 -0
  71. package/es/components/form/src/components/formIcon.d.ts +1231 -0
  72. package/es/components/form/src/components/formInputUseDialog.d.ts +911 -0
  73. package/es/components/form/src/components/index.d.ts +4 -0
  74. package/es/components/form/src/components/radioButton.d.ts +34 -0
  75. package/es/components/form/src/enums/index.d.ts +7 -0
  76. package/es/components/form/src/hooks/helper.d.ts +14 -0
  77. package/es/components/form/src/hooks/useForm.d.ts +6 -0
  78. package/es/components/form/src/hooks/useFormActions.d.ts +12 -0
  79. package/es/components/form/src/hooks/useFormEvent.d.ts +25 -0
  80. package/es/components/form/src/hooks/useFormValue.d.ts +3 -0
  81. package/es/components/form/src/hooks/useFormValues.d.ts +11 -0
  82. package/es/components/form/src/hooks/useLabelWidth.d.ts +22 -0
  83. package/es/components/form/src/index.d.ts +2965 -0
  84. package/es/components/form/src/props.d.ts +133 -0
  85. package/es/components/form/src/types/actions.type.d.ts +15 -0
  86. package/es/components/form/src/types/form.type.d.ts +70 -0
  87. package/es/components/icons/index.d.ts +497 -0
  88. package/es/components/icons/index.js +1969 -0
  89. package/es/components/icons/index.less +42 -0
  90. package/es/components/icons/src/pick-icon.d.ts +455 -0
  91. package/es/components/icons/src/svg-icon.d.ts +44 -0
  92. package/es/components/modal/index.d.ts +3 -0
  93. package/es/components/modal/index.js +1193 -0
  94. package/es/components/modal/index.less +54 -0
  95. package/es/components/modal/src/components/CloseIcon.d.ts +40 -0
  96. package/es/components/modal/src/components/Modal.d.ts +108 -0
  97. package/es/components/modal/src/components/ModalFooter.d.ts +139 -0
  98. package/es/components/modal/src/components/ModalWrap.d.ts +153 -0
  99. package/es/components/modal/src/hooks/useDrag.d.ts +7 -0
  100. package/es/components/modal/src/hooks/useFullScreen.d.ts +6 -0
  101. package/es/components/modal/src/hooks/useModal.d.ts +5 -0
  102. package/es/components/modal/src/index.d.ts +774 -0
  103. package/es/components/modal/src/props.d.ts +100 -0
  104. package/es/components/modal/src/types/modal.type.d.ts +17 -0
  105. package/es/components/source/hooks/useDownload.d.ts +8 -0
  106. package/es/components/source/hooks/useSource.d.ts +40 -0
  107. package/es/components/source/index.d.ts +2 -0
  108. package/es/components/source/index.js +332 -0
  109. package/es/components/source/types/source.type.d.ts +37 -0
  110. package/es/components/source/utils/index.d.ts +8 -0
  111. package/es/components/table/index.d.ts +3 -0
  112. package/es/components/table/index.js +3983 -0
  113. package/es/components/table/index.less +192 -0
  114. package/es/components/table/src/components/TableAction.d.ts +70 -0
  115. package/es/components/table/src/components/TableHeader.d.ts +1136 -0
  116. package/es/components/table/src/components/TableRender.d.ts +17 -0
  117. package/es/components/table/src/components/editTable/CellComponent.d.ts +22 -0
  118. package/es/components/table/src/components/editTable/EditTableCell.d.ts +93 -0
  119. package/es/components/table/src/components/editTable/componentMap.d.ts +4 -0
  120. package/es/components/table/src/components/editTable/index.d.ts +9 -0
  121. package/es/components/table/src/components/editTable/props.d.ts +27 -0
  122. package/es/components/table/src/components/tableSetting/Column.d.ts +69 -0
  123. package/es/components/table/src/components/tableSetting/Download.d.ts +922 -0
  124. package/es/components/table/src/components/tableSetting/DownloadCtrl.d.ts +888 -0
  125. package/es/components/table/src/components/tableSetting/Fullscreen.d.ts +22 -0
  126. package/es/components/table/src/components/tableSetting/index.d.ts +1030 -0
  127. package/es/components/table/src/hooks/useColumns.d.ts +14 -0
  128. package/es/components/table/src/hooks/useCustomRow.d.ts +20 -0
  129. package/es/components/table/src/hooks/useDataSource.d.ts +15 -0
  130. package/es/components/table/src/hooks/useHeader.d.ts +8 -0
  131. package/es/components/table/src/hooks/useHeaderCode.d.ts +3 -0
  132. package/es/components/table/src/hooks/useLoading.d.ts +6 -0
  133. package/es/components/table/src/hooks/usePagination.d.ts +7 -0
  134. package/es/components/table/src/hooks/useRow.d.ts +5 -0
  135. package/es/components/table/src/hooks/useRowSelection.d.ts +12 -0
  136. package/es/components/table/src/hooks/useTable.d.ts +9 -0
  137. package/es/components/table/src/hooks/useTableInstance.d.ts +16 -0
  138. package/es/components/table/src/hooks/useTableScroll.d.ts +13 -0
  139. package/es/components/table/src/index.d.ts +644 -0
  140. package/es/components/table/src/props.d.ts +185 -0
  141. package/es/components/table/src/types/actions.type.d.ts +21 -0
  142. package/es/components/table/src/types/header.type.d.ts +23 -0
  143. package/es/components/table/src/types/table.type.d.ts +98 -0
  144. package/es/directives/icon.d.ts +2 -0
  145. package/es/directives/index.d.ts +7 -0
  146. package/es/directives/index.js +2015 -0
  147. package/es/directives/permission.d.ts +2 -0
  148. package/es/global.d.ts +7 -0
  149. package/es/index.d.ts +1 -0
  150. package/es/index.js +4 -0
  151. package/es/theme/index.d.ts +10 -0
  152. package/es/theme/index.js +3255 -0
  153. package/es/theme/index.less +603 -0
  154. package/es/theme/src/components/content/index.d.ts +27 -0
  155. package/es/theme/src/components/feature/back-top.d.ts +5 -0
  156. package/es/theme/src/components/feature/index.d.ts +7 -0
  157. package/es/theme/src/components/footer/index.d.ts +31 -0
  158. package/es/theme/src/components/header/components/bread-crumb.d.ts +6 -0
  159. package/es/theme/src/components/header/components/fullscreen.d.ts +5 -0
  160. package/es/theme/src/components/header/components/index.d.ts +11 -0
  161. package/es/theme/src/components/header/components/lang-picker.d.ts +23 -0
  162. package/es/theme/src/components/header/components/logo.d.ts +35 -0
  163. package/es/theme/src/components/header/components/menu-filter.d.ts +22 -0
  164. package/es/theme/src/components/header/components/notify.d.ts +24 -0
  165. package/es/theme/src/components/header/components/setting-theme.d.ts +223 -0
  166. package/es/theme/src/components/header/components/size.d.ts +282 -0
  167. package/es/theme/src/components/header/components/theme-drawer/feature.d.ts +138 -0
  168. package/es/theme/src/components/header/components/theme-drawer/index.d.ts +3 -0
  169. package/es/theme/src/components/header/components/theme-drawer/menu-type.d.ts +16 -0
  170. package/es/theme/src/components/header/components/theme-drawer/select.d.ts +58 -0
  171. package/es/theme/src/components/header/components/theme-drawer/switch.d.ts +49 -0
  172. package/es/theme/src/components/header/components/trigger.d.ts +10 -0
  173. package/es/theme/src/components/header/components/user-info.d.ts +37 -0
  174. package/es/theme/src/components/header/helper/change-theme.d.ts +13 -0
  175. package/es/theme/src/components/header/helper/menu-tree.d.ts +3 -0
  176. package/es/theme/src/components/header/index.d.ts +699 -0
  177. package/es/theme/src/components/header/multiple-header.d.ts +785 -0
  178. package/es/theme/src/components/sider/components/basic-menu/basic-menu-item.d.ts +62 -0
  179. package/es/theme/src/components/sider/components/basic-menu/basic-menu.d.ts +207 -0
  180. package/es/theme/src/components/sider/components/basic-menu/basic-sub-menu-item.d.ts +127 -0
  181. package/es/theme/src/components/sider/components/basic-menu/menu-item-content.d.ts +26 -0
  182. package/es/theme/src/components/sider/components/drag-bar.d.ts +14 -0
  183. package/es/theme/src/components/sider/components/layout-menu.d.ts +22 -0
  184. package/es/theme/src/components/sider/components/props.d.ts +69 -0
  185. package/es/theme/src/components/sider/components/sider-trigger.d.ts +18 -0
  186. package/es/theme/src/components/sider/helper/sider.d.ts +12 -0
  187. package/es/theme/src/components/sider/helper/split-menu.d.ts +10 -0
  188. package/es/theme/src/components/sider/index.d.ts +70 -0
  189. package/es/theme/src/components/tabs/components/TabContent.d.ts +6 -0
  190. package/es/theme/src/components/tabs/components/TabRedo.d.ts +21 -0
  191. package/es/theme/src/components/tabs/components/index.d.ts +3 -0
  192. package/es/theme/src/components/tabs/hooks/useMultifyTabs.d.ts +7 -0
  193. package/es/theme/src/components/tabs/hooks/useTabDropdown.d.ts +6 -0
  194. package/es/theme/src/components/tabs/index.d.ts +63 -0
  195. package/es/theme/src/components/tabs/types/tabs.type.d.ts +7 -0
  196. package/es/theme/src/enums/index.d.ts +1 -0
  197. package/es/theme/src/enums/theme.enum.d.ts +33 -0
  198. package/es/theme/src/hooks/index.d.ts +6 -0
  199. package/es/theme/src/hooks/useDragLine.d.ts +2 -0
  200. package/es/theme/src/hooks/useHeader.d.ts +25 -0
  201. package/es/theme/src/hooks/useMenu.d.ts +27 -0
  202. package/es/theme/src/hooks/useMultifyTab.d.ts +7 -0
  203. package/es/theme/src/hooks/useOpenKeys.d.ts +7 -0
  204. package/es/theme/src/hooks/useTheme.d.ts +9 -0
  205. package/es/theme/src/index.d.ts +1643 -0
  206. package/es/theme/src/setting/theme.setting.d.ts +2 -0
  207. package/es/theme/src/stores/index.d.ts +3 -0
  208. package/es/theme/src/stores/routeReuse.store.d.ts +23 -0
  209. package/es/theme/src/stores/theme.store.d.ts +15 -0
  210. package/es/theme/src/types/index.d.ts +3 -0
  211. package/es/theme/src/types/menu.type.d.ts +15 -0
  212. package/es/theme/src/types/theme.type.d.ts +60 -0
  213. package/es/utils/withInstall.d.ts +4 -0
  214. package/index.d.ts +10 -0
  215. package/index.js +34 -0
  216. package/package.json +3 -6
  217. package/tailwind.config.cjs +11 -0
  218. package/tsconfig.json +41 -0
  219. package/tsconfig.node.json +9 -0
  220. package/vite.config.ts +51 -0
@@ -0,0 +1,3255 @@
1
+ import { BackTop, Breadcrumb, Empty, InputSearch, Popover, Avatar, Tooltip, Select, Switch, Divider, Button, Drawer, MenuItem, SubMenu, Menu, LayoutHeader, LayoutSider, MenuDivider, Dropdown, TabPane, Tabs, LayoutContent, Layout, ConfigProvider } from "ant-design-vue/es";
2
+ import "ant-design-vue/es/config-provider/style";
3
+ import "ant-design-vue/es/layout/style";
4
+ import { toRaw, unref, computed, onMounted, nextTick, defineComponent, openBlock, createBlock, createCommentVNode, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, withDirectives, toDisplayString, vShow, ref, watchEffect, createVNode, withCtx, Fragment, renderList, resolveDirective, getCurrentInstance, inject, onUnmounted, h, provide, onBeforeUnmount, resolveDynamicComponent, renderSlot, mergeProps, createTextVNode, watch, normalizeProps, guardReactiveProps, resolveComponent, reactive, toRef, withModifiers, createSlots, Transition, KeepAlive } from "vue";
5
+ import { useRouter, RouterView } from "vue-router";
6
+ import { DtCache, CacheKey, deepMerge, Pages, useGo, useRedo, Language, isObject, useTimeoutFn, useI18n, isBoolean, localeList, changeLocale, off, on, getParentSlots, isFunction, copyText, isUrl, openWindow, isNullAndUnDef, menuList2Map, useApp, withInstall as withInstall$1 } from "@dt-frames/core";
7
+ import { defineStore } from "pinia";
8
+ import { trim } from "lodash-es";
9
+ import { useDebounceFn, useFullscreen, useThrottleFn } from "@vueuse/core";
10
+ import "ant-design-vue/es/back-top/style";
11
+ import "ant-design-vue/es/breadcrumb/style";
12
+ import "ant-design-vue/es/popover/style";
13
+ import "ant-design-vue/es/input/style";
14
+ import "ant-design-vue/es/empty/style";
15
+ import { Popover as Popover$1, Modal, LayoutFooter } from "ant-design-vue";
16
+ import "ant-design-vue/es/avatar/style";
17
+ import "ant-design-vue/es/drawer/style";
18
+ import "ant-design-vue/es/button/style";
19
+ import "ant-design-vue/es/divider/style";
20
+ import "ant-design-vue/es/tooltip/style";
21
+ import "ant-design-vue/es/select/style";
22
+ import "ant-design-vue/es/switch/style";
23
+ import "ant-design-vue/es/menu/style";
24
+ import "ant-design-vue/es/tabs/style";
25
+ import "ant-design-vue/es/dropdown/style";
26
+ import zhCN from "ant-design-vue/es/locale/zh_CN";
27
+ import en from "ant-design-vue/es/locale/en_US";
28
+ import require$$0 from "dayjs";
29
+ var Theme = /* @__PURE__ */ ((Theme2) => {
30
+ Theme2["DARK"] = "dark";
31
+ Theme2["LIGHT"] = "light";
32
+ return Theme2;
33
+ })(Theme || {});
34
+ var MenuType = /* @__PURE__ */ ((MenuType2) => {
35
+ MenuType2["SIDE"] = "sidebar";
36
+ MenuType2["TOP_MENU"] = "top-menu";
37
+ MenuType2["MIX"] = "mix";
38
+ return MenuType2;
39
+ })(MenuType || {});
40
+ var MenuMode = /* @__PURE__ */ ((MenuMode2) => {
41
+ MenuMode2["INLINE"] = "inline";
42
+ MenuMode2["HORIZONTAL"] = "horizontal";
43
+ MenuMode2["VERTICAL"] = "vertical";
44
+ return MenuMode2;
45
+ })(MenuMode || {});
46
+ var ContentMode = /* @__PURE__ */ ((ContentMode2) => {
47
+ ContentMode2["FULL"] = "full";
48
+ ContentMode2["FIXED"] = "fixed";
49
+ return ContentMode2;
50
+ })(ContentMode || {});
51
+ var MenuSplitTye = /* @__PURE__ */ ((MenuSplitTye2) => {
52
+ MenuSplitTye2[MenuSplitTye2["NONE"] = 0] = "NONE";
53
+ MenuSplitTye2[MenuSplitTye2["TOP"] = 1] = "TOP";
54
+ MenuSplitTye2[MenuSplitTye2["LEFT"] = 2] = "LEFT";
55
+ return MenuSplitTye2;
56
+ })(MenuSplitTye || {});
57
+ var UiSize = /* @__PURE__ */ ((UiSize2) => {
58
+ UiSize2["LARGE"] = "large";
59
+ UiSize2["MIDDLE"] = "middle";
60
+ UiSize2["SMALL"] = "small";
61
+ return UiSize2;
62
+ })(UiSize || {});
63
+ const defaultThemeConf = {
64
+ content: {
65
+ contentMode: ContentMode.FULL
66
+ },
67
+ headOptions: {
68
+ fixed: true,
69
+ theme: Theme.LIGHT,
70
+ showLogo: true,
71
+ showBackToTop: true,
72
+ useLockPage: true,
73
+ size: UiSize.SMALL,
74
+ showSize: true,
75
+ showBreadCrumb: true,
76
+ showFullScreen: true,
77
+ showSearch: true,
78
+ showNotice: true,
79
+ showLocaleSwitch: true,
80
+ showSettingTheme: true,
81
+ showLoginOut: true
82
+ },
83
+ menuOptions: {
84
+ fixed: true,
85
+ theme: Theme.DARK,
86
+ collapsed: false,
87
+ collapsedShowTitle: false,
88
+ canDrag: true,
89
+ show: true,
90
+ hidden: false,
91
+ split: false,
92
+ menuWidth: 240,
93
+ trigger: true,
94
+ type: MenuType.SIDE,
95
+ mode: MenuMode.INLINE
96
+ },
97
+ footerOptions: {
98
+ show: false,
99
+ height: 48,
100
+ title: "Copyright(C) 2021 by www.ithinkdt.com. All rights reserved.",
101
+ subTitle: "Privacy Statement"
102
+ },
103
+ routeReuse: {
104
+ show: true,
105
+ cache: true,
106
+ canDrag: true,
107
+ showQuick: true,
108
+ showRedo: true,
109
+ showFold: true
110
+ }
111
+ };
112
+ const useThemeStore = defineStore({
113
+ id: "dt-theme",
114
+ state: () => ({
115
+ themeConf: DtCache.getLocal(CacheKey.THEME) ?? defaultThemeConf,
116
+ pageLoading: false
117
+ }),
118
+ getters: {
119
+ getThemeConf() {
120
+ return this.themeConf;
121
+ },
122
+ getHeaderConf() {
123
+ return this.themeConf.headOptions;
124
+ },
125
+ getMenuConf() {
126
+ return this.themeConf.menuOptions;
127
+ },
128
+ getFooterConf() {
129
+ return this.themeConf.footerOptions;
130
+ },
131
+ getRouteReuseConf() {
132
+ return this.themeConf.routeReuse;
133
+ },
134
+ getPageLoading() {
135
+ return this.pageLoading;
136
+ }
137
+ },
138
+ actions: {
139
+ setThemeConf(options = {}) {
140
+ let newThemeConf = deepMerge(this.themeConf, options);
141
+ this.themeConf = deepMerge(defaultThemeConf, newThemeConf);
142
+ DtCache.setLocal(CacheKey.THEME, this.themeConf);
143
+ }
144
+ }
145
+ });
146
+ const useRouteReuseStore = defineStore({
147
+ id: "route-reuse",
148
+ state: () => ({
149
+ cacheTabList: /* @__PURE__ */ new Set(),
150
+ tabList: DtCache.getLocal(CacheKey.THEME)?.routeReuse?.cache ? DtCache.getLocal(CacheKey.ROUTE_REUSE) || [] : [],
151
+ lastDragEndIndex: 0
152
+ }),
153
+ getters: {
154
+ getTabList() {
155
+ return this.tabList;
156
+ },
157
+ getCachedTabList() {
158
+ return Array.from(this.cacheTabList);
159
+ },
160
+ getLastDragEndIndex() {
161
+ return this.lastDragEndIndex;
162
+ }
163
+ },
164
+ actions: {
165
+ async addTab(route) {
166
+ const { path, name, fullPath, params, query, meta } = route;
167
+ if (path === Pages.NOT_FOUND || path === Pages.LOGIN || path === Pages.BASE_PAGE) {
168
+ return;
169
+ }
170
+ let updateIndex = -1;
171
+ const tabHasExits = this.tabList.some((tab, index) => {
172
+ updateIndex = index;
173
+ return (tab.fullPath || tab.path) === (fullPath || path);
174
+ });
175
+ if (tabHasExits) {
176
+ const curTab = toRaw(this.tabList)[updateIndex];
177
+ curTab.params = params || curTab.params;
178
+ curTab.query = query || curTab.query;
179
+ curTab.fullPath = fullPath || curTab.fullPath;
180
+ this.tabList.splice(updateIndex, 1, curTab);
181
+ } else {
182
+ this.tabList.push(JSON.parse(JSON.stringify(route)));
183
+ }
184
+ this.updateCacheTab();
185
+ },
186
+ closeTab(path, router) {
187
+ const go = useGo(router);
188
+ const index = this.tabList.findIndex((item) => item.path === path);
189
+ let page;
190
+ if (index === 0) {
191
+ if (this.tabList.length !== 1) {
192
+ page = this.tabList[index + 1];
193
+ }
194
+ } else {
195
+ page = this.tabList[index - 1];
196
+ }
197
+ this.bulkCloseTabs([path]);
198
+ this.updateCacheTab();
199
+ path === router.currentRoute.value.path && go(page.path);
200
+ },
201
+ closeAllTab(currentRoute, router) {
202
+ const go = useGo(router);
203
+ let filterTabList = this.tabList.filter((item) => item?.meta?.affix ?? false);
204
+ const route = filterTabList.length > 0 ? filterTabList[filterTabList.length - 1] : unref(currentRoute);
205
+ this.tabList = [route];
206
+ this.updateCacheTab();
207
+ go(route.path);
208
+ },
209
+ closeLeftTabs(path) {
210
+ const index = this.tabList.findIndex((item) => item.path === path);
211
+ if (index > 0) {
212
+ const leftTabs = this.tabList.slice(0, index);
213
+ const pathList = [];
214
+ for (const item of leftTabs) {
215
+ const affix = item?.meta?.affix ?? false;
216
+ if (!affix) {
217
+ pathList.push(item.fullPath);
218
+ }
219
+ }
220
+ this.bulkCloseTabs(pathList);
221
+ }
222
+ this.updateCacheTab();
223
+ },
224
+ closeRightTabs(path) {
225
+ const index = this.tabList.findIndex((item) => item.path === path);
226
+ if (index >= 0 && index < this.tabList.length - 1) {
227
+ const rightTabs = this.tabList.slice(index + 1, this.tabList.length);
228
+ const pathList = [];
229
+ for (const item of rightTabs) {
230
+ const affix = item?.meta?.affix ?? false;
231
+ if (!affix) {
232
+ pathList.push(item.fullPath);
233
+ }
234
+ }
235
+ this.bulkCloseTabs(pathList);
236
+ }
237
+ this.updateCacheTab();
238
+ },
239
+ closeOtherTabs(path) {
240
+ const pathList = [];
241
+ for (let item of this.tabList) {
242
+ const affix = item?.meta?.affix ?? false;
243
+ if (item.path !== path && !affix) {
244
+ pathList.push(item.path);
245
+ }
246
+ }
247
+ this.bulkCloseTabs(pathList);
248
+ this.updateCacheTab();
249
+ },
250
+ bulkCloseTabs(pathList) {
251
+ this.tabList = this.tabList.filter((item) => !pathList.includes(item.fullPath));
252
+ },
253
+ updateCacheTab() {
254
+ const cacheTab = DtCache.getLocal(CacheKey.THEME)?.routeReuse?.cache;
255
+ cacheTab && DtCache.setLocal(CacheKey.ROUTE_REUSE, this.tabList);
256
+ const cacheMap = /* @__PURE__ */ new Set();
257
+ for (const tab of this.tabList) {
258
+ if (tab.meta?.hideTab) {
259
+ continue;
260
+ }
261
+ const name = tab.name;
262
+ cacheMap.add(name);
263
+ }
264
+ this.cacheTabList = cacheMap;
265
+ },
266
+ async refreshPage(router) {
267
+ const findTab = this.getCachedTabList.find((item) => item === unref(router.currentRoute).name);
268
+ if (findTab) {
269
+ this.cacheTabList.delete(findTab.toString());
270
+ }
271
+ const redo = useRedo(router);
272
+ await redo();
273
+ },
274
+ sortTabs(oldIndex, newIndex) {
275
+ const currentTab = this.tabList[oldIndex];
276
+ this.tabList.splice(oldIndex, 1);
277
+ this.tabList.splice(newIndex, 0, currentTab);
278
+ this.lastDragEndIndex = this.lastDragEndIndex + 1;
279
+ }
280
+ }
281
+ });
282
+ function useMenu() {
283
+ const { getMenuConf, setThemeConf } = useThemeStore();
284
+ const getCollapsedShowTitle = computed(() => getMenuConf.collapsedShowTitle);
285
+ const getIsSidebarType = computed(() => getMenuConf.type === MenuType.SIDE);
286
+ const getMenuFixed = computed(() => getMenuConf.fixed);
287
+ const getShowMenu = computed(() => getMenuConf.show);
288
+ const getShowSidebar = computed(() => {
289
+ return unref(getSplit) || unref(getShowMenu) && unref(getMenuMode) !== MenuMode.HORIZONTAL;
290
+ });
291
+ const getMenuHidden = computed(() => getMenuConf.hidden);
292
+ const getMenuTheme = computed(() => getMenuConf.theme);
293
+ const getTrigger = computed(() => getMenuConf.trigger);
294
+ const getCanDrag = computed(() => getMenuConf.canDrag);
295
+ const getIsMixMode = computed(() => {
296
+ return unref(getMenuMode) === MenuMode.INLINE && unref(getMenuType) === MenuType.MIX;
297
+ });
298
+ const getMenuWidth = computed(() => unref(getIsMixMode) ? Number(getMenuConf.menuWidth) - 40 : getMenuConf.menuWidth);
299
+ const getLogoWidth = computed(() => getMenuConf.menuWidth);
300
+ const getMenuType = computed(() => getMenuConf.type);
301
+ const getIsTopMenu = computed(() => unref(getMenuType) === MenuType.TOP_MENU);
302
+ const getMenuMode = computed(() => getMenuConf.mode);
303
+ const getSplit = computed(() => getMenuConf.split);
304
+ const getCollapsed = computed(() => getMenuConf.collapsed);
305
+ const getIsHorizontal = computed(() => unref(getMenuMode) === MenuMode.HORIZONTAL);
306
+ const setThemeStore = (conf = {}) => setThemeConf(conf);
307
+ const toggleCollapsed = () => setThemeStore({
308
+ menuOptions: {
309
+ collapsed: !unref(getCollapsed)
310
+ }
311
+ });
312
+ const getMiniWidthNumber = computed(() => getMenuConf.collapsedShowTitle ? 80 : 48);
313
+ const getRealWidth = computed(() => {
314
+ return unref(getCollapsed) ? unref(getMiniWidthNumber) : unref(getMenuWidth);
315
+ });
316
+ const getCalcContentWidth = computed(() => {
317
+ const width = unref(getIsTopMenu) || !unref(getShowMenu) || unref(getSplit) && unref(getMenuHidden) ? 0 : unref(getRealWidth);
318
+ return `calc(100% - ${unref(width)}px)`;
319
+ });
320
+ return {
321
+ getCollapsedShowTitle,
322
+ getIsSidebarType,
323
+ getMenuFixed,
324
+ getShowMenu,
325
+ getShowSidebar,
326
+ getMenuHidden,
327
+ getMenuTheme,
328
+ getTrigger,
329
+ getMenuWidth,
330
+ getLogoWidth,
331
+ getMenuType,
332
+ getIsTopMenu,
333
+ getMenuMode,
334
+ getSplit,
335
+ getCollapsed,
336
+ getIsHorizontal,
337
+ getMiniWidthNumber,
338
+ getRealWidth,
339
+ getCalcContentWidth,
340
+ getIsMixMode,
341
+ getCanDrag,
342
+ toggleCollapsed,
343
+ setThemeStore
344
+ };
345
+ }
346
+ function useMultipleTab() {
347
+ const { getRouteReuseConf } = useThemeStore();
348
+ const getShowMultipleTab = computed(() => getRouteReuseConf.show);
349
+ const getShowQuick = computed(() => getRouteReuseConf.showQuick);
350
+ const getShowRedo = computed(() => getRouteReuseConf.showRedo);
351
+ const getCanCache = computed(() => getRouteReuseConf.cache);
352
+ const getCanDrag = computed(() => getRouteReuseConf.canDrag);
353
+ return {
354
+ getShowMultipleTab,
355
+ getShowQuick,
356
+ getShowRedo,
357
+ getCanCache,
358
+ getCanDrag
359
+ };
360
+ }
361
+ function useHeader() {
362
+ const HEADER_HEIGHT = 48;
363
+ const TABS_HEIGHT = 33;
364
+ const { getHeaderConf = {} } = useThemeStore();
365
+ const {
366
+ getIsSidebarType,
367
+ getMenuType,
368
+ getShowMenu,
369
+ getMenuHidden,
370
+ getTrigger,
371
+ getMenuMode,
372
+ getSplit,
373
+ getIsTopMenu,
374
+ getIsMixMode
375
+ } = useMenu();
376
+ const { getShowMultipleTab } = useMultipleTab();
377
+ const getHeaderTheme = computed(() => getHeaderConf.theme);
378
+ const getFixed = computed(() => getHeaderConf.fixed);
379
+ const getShowHeaderLogo = computed(() => unref(getShowLogo) && !unref(getIsSidebarType));
380
+ const getShowSearch = computed(() => getHeaderConf.showSearch);
381
+ const getShowHeaderTrigger = computed(() => {
382
+ if (unref(getMenuType) === MenuType.TOP_MENU || !unref(getShowMenu) || unref(getMenuHidden)) {
383
+ return false;
384
+ }
385
+ return unref(getTrigger);
386
+ });
387
+ const getShowBreadCrumb = computed(() => getHeaderConf.showBreadCrumb);
388
+ const getShowBread = computed(
389
+ () => unref(getMenuMode) !== MenuMode.HORIZONTAL && !unref(getSplit) && unref(getShowBreadCrumb)
390
+ );
391
+ const getShowTopMenu = computed(() => unref(getMenuMode) === MenuMode.HORIZONTAL || unref(getSplit));
392
+ const getShowNotice = computed(() => getHeaderConf.showNotice);
393
+ const getShowFullScreen = computed(() => getHeaderConf.showFullScreen);
394
+ const getShowLocale = computed(() => getHeaderConf.showLocaleSwitch);
395
+ const getShowSettingTheme = computed(() => getHeaderConf.showSettingTheme);
396
+ const getShowFullHeaderRef = computed(() => {
397
+ return !unref(getIsSidebarType) && !unref(getIsTopMenu);
398
+ });
399
+ const getHeaderHeight = computed(() => {
400
+ let height = 0;
401
+ height += HEADER_HEIGHT;
402
+ if (unref(getShowMultipleTab) && !unref(getSplit)) {
403
+ height += TABS_HEIGHT;
404
+ }
405
+ return height;
406
+ });
407
+ const getTabsHeight = computed(() => TABS_HEIGHT);
408
+ const getShowInsetHeaderRef = computed(() => {
409
+ return unref(getIsSidebarType) || unref(getIsTopMenu);
410
+ });
411
+ const getShowBackToTop = computed(() => getHeaderConf.showBackToTop);
412
+ const getIsZH = computed(() => {
413
+ let local = DtCache.getLocal(CacheKey.LOCALE);
414
+ if (!local)
415
+ return true;
416
+ return local === Language.ZH;
417
+ });
418
+ const getUiSize = computed(() => getHeaderConf?.size ?? UiSize.SMALL);
419
+ const getShowUiSize = computed(() => getHeaderConf?.showSize);
420
+ const getShowLogo = computed(() => getHeaderConf.showLogo);
421
+ const getShowLoginOut = computed(() => getHeaderConf.showLoginOut);
422
+ const loginOutClick = getHeaderConf.logoutClick;
423
+ return {
424
+ getHeaderTheme,
425
+ getFixed,
426
+ getShowSearch,
427
+ getShowHeaderLogo,
428
+ getShowHeaderTrigger,
429
+ getShowBread,
430
+ getShowTopMenu,
431
+ getShowFullScreen,
432
+ getShowLocale,
433
+ getShowSettingTheme,
434
+ getShowNotice,
435
+ getShowFullHeaderRef,
436
+ getHeaderHeight,
437
+ getTabsHeight,
438
+ getShowInsetHeaderRef,
439
+ getShowBackToTop,
440
+ getIsZH,
441
+ getUiSize,
442
+ getShowLogo,
443
+ getShowLoginOut,
444
+ getShowUiSize,
445
+ loginOutClick
446
+ };
447
+ }
448
+ function useTheme() {
449
+ const { getThemeConf, getPageLoading } = useThemeStore();
450
+ const getLayoutContentMode = computed(() => getThemeConf.content.contentMode);
451
+ const getFooter = computed(() => getThemeConf.footerOptions || {});
452
+ const getShowFooter = computed(() => isObject(getThemeConf.footerOptions) ? getThemeConf.footerOptions.show : true);
453
+ const getContentMode = computed(() => getThemeConf.content.contentMode);
454
+ const getOpenPageLoading = computed(() => getPageLoading);
455
+ return {
456
+ getLayoutContentMode,
457
+ getPageLoading,
458
+ getFooter,
459
+ getShowFooter,
460
+ getContentMode,
461
+ getOpenPageLoading
462
+ };
463
+ }
464
+ function deleteChildrenProp(menu) {
465
+ let obj = { ...menu };
466
+ delete obj.children;
467
+ return obj;
468
+ }
469
+ function getBreadCrumb(path, menus) {
470
+ const _menus = menus || DtCache.getLocal(CacheKey.MENUS)?.children || [];
471
+ let routes = [];
472
+ let getParentByPath = (menu, path2 = "") => {
473
+ if (menu.children && menu.children.length) {
474
+ menu.children.forEach((subMenu) => {
475
+ subMenu.parentMenus = [...menu.parentMenus].concat([deleteChildrenProp(subMenu)]);
476
+ getParentByPath(subMenu, path2);
477
+ });
478
+ }
479
+ if (menu.url === path2) {
480
+ routes = menu.parentMenus;
481
+ }
482
+ };
483
+ _menus.forEach((menu) => {
484
+ menu.parentMenus = [deleteChildrenProp(menu)];
485
+ getParentByPath(menu, path);
486
+ });
487
+ return routes;
488
+ }
489
+ function getFilterMenu(filter = "", flag = false) {
490
+ let _menus = [];
491
+ if (!trim(filter) && !flag)
492
+ return _menus;
493
+ let getTargetMenus = (menusArr) => {
494
+ menusArr.forEach((menu) => {
495
+ if (menu.children && menu.children.length) {
496
+ getTargetMenus(menu.children);
497
+ } else if (menu.label.indexOf(filter) !== -1 || flag && !trim(filter)) {
498
+ _menus.push(menu);
499
+ }
500
+ });
501
+ };
502
+ getTargetMenus(DtCache.getLocal(CacheKey.MENUS)?.children);
503
+ return _menus;
504
+ }
505
+ function useOpenKeys(menuState, menus, type) {
506
+ async function setOpenKeys(path) {
507
+ if (type === MenuType.TOP_MENU)
508
+ return;
509
+ useTimeoutFn(
510
+ () => {
511
+ if (menus?.length === 0) {
512
+ menuState.openKeys = [];
513
+ return;
514
+ }
515
+ const parentNodes = getBreadCrumb(path, menus);
516
+ menuState.openKeys = parentNodes.map((it) => it.id);
517
+ },
518
+ 20,
519
+ true
520
+ );
521
+ }
522
+ const getOpenKeys = computed(() => menuState.openKeys);
523
+ function resetKeys() {
524
+ menuState.selectedKeys = [];
525
+ menuState.openKeys = [];
526
+ }
527
+ function handleOpenChange(openKeys) {
528
+ menuState.openKeys = openKeys;
529
+ }
530
+ return {
531
+ getOpenKeys,
532
+ setOpenKeys,
533
+ resetKeys,
534
+ handleOpenChange
535
+ };
536
+ }
537
+ function useDragLine(siderRef, dragBarRef) {
538
+ const { getMiniWidthNumber, getCollapsed, setThemeStore } = useMenu();
539
+ onMounted(() => {
540
+ nextTick(() => {
541
+ const exec = useDebounceFn(changeWrapWidth, 80);
542
+ exec();
543
+ });
544
+ });
545
+ function getEl(elRef) {
546
+ const el = unref(elRef);
547
+ if (!el)
548
+ return null;
549
+ if (Reflect.has(el, "$el")) {
550
+ return unref(elRef)?.$el;
551
+ }
552
+ return unref(elRef);
553
+ }
554
+ function handleMouseMove(ele, wrap, clientX) {
555
+ document.onmousemove = function(innerE) {
556
+ innerE = innerE || window.event;
557
+ let iT = ele.left + (innerE.clientX - clientX);
558
+ const maxT = 800;
559
+ const minT = unref(getMiniWidthNumber);
560
+ iT < 0 && (iT = 0);
561
+ iT > maxT && (iT = maxT);
562
+ iT < minT && (iT = minT);
563
+ ele.style.left = wrap.style.width = iT + "px";
564
+ return false;
565
+ };
566
+ }
567
+ function removeMouseup(ele) {
568
+ const wrap = getEl(siderRef);
569
+ document.onmouseup = function() {
570
+ document.onmousemove = null;
571
+ document.onmouseup = null;
572
+ wrap.style.transition = "width 0.2s";
573
+ const width = parseInt(wrap.style.width);
574
+ setThemeStore({
575
+ menuOptions: {
576
+ menuWidth: width
577
+ }
578
+ });
579
+ ele.releaseCapture?.();
580
+ };
581
+ }
582
+ function changeWrapWidth() {
583
+ const ele = getEl(dragBarRef);
584
+ if (!ele)
585
+ return;
586
+ const wrap = getEl(siderRef);
587
+ if (!wrap)
588
+ return;
589
+ ele.onmousedown = (e) => {
590
+ wrap.style.transition = "unset";
591
+ const clientX = e?.clientX;
592
+ ele.left = ele.offsetLeft;
593
+ handleMouseMove(ele, wrap, clientX);
594
+ removeMouseup(ele);
595
+ ele.setCapture?.();
596
+ return false;
597
+ };
598
+ }
599
+ }
600
+ const _sfc_main$y = /* @__PURE__ */ defineComponent({
601
+ __name: "back-top",
602
+ setup(__props) {
603
+ const getTarget = () => document.getElementById("dt-layout-content");
604
+ const { getShowBackToTop } = useHeader();
605
+ return (_ctx, _cache) => {
606
+ const _component_ABackTop = BackTop;
607
+ return unref(getShowBackToTop) ? (openBlock(), createBlock(_component_ABackTop, {
608
+ key: 0,
609
+ target: getTarget,
610
+ visibilityHeight: 300
611
+ })) : createCommentVNode("", true);
612
+ };
613
+ }
614
+ });
615
+ const _sfc_main$x = /* @__PURE__ */ defineComponent({
616
+ __name: "index",
617
+ setup(__props) {
618
+ return (_ctx, _cache) => {
619
+ return openBlock(), createBlock(_sfc_main$y);
620
+ };
621
+ }
622
+ });
623
+ const _sfc_main$w = /* @__PURE__ */ defineComponent({
624
+ __name: "fullscreen",
625
+ setup(__props) {
626
+ const { toggle, isFullscreen } = useFullscreen();
627
+ return (_ctx, _cache) => {
628
+ return openBlock(), createElementBlock("span", {
629
+ class: "dt_header_icon text-lg text-gray-800 cursor-pointer px-3 hover:bg-gray-500 hover:bg-opacity-50 transition-all duration-300",
630
+ onClick: _cache[0] || (_cache[0] = (...args) => unref(toggle) && unref(toggle)(...args))
631
+ }, [
632
+ createElementVNode("i", {
633
+ class: normalizeClass(["i block", !unref(isFullscreen) ? "ic:baseline-fullscreen" : "ic:baseline-fullscreen-exit"])
634
+ }, null, 2)
635
+ ]);
636
+ };
637
+ }
638
+ });
639
+ const _hoisted_1$i = ["src"];
640
+ const _sfc_main$v = /* @__PURE__ */ defineComponent({
641
+ __name: "logo",
642
+ props: {
643
+ theme: { type: String, validator: (v) => ["light", "dark"].includes(v) },
644
+ showTitle: { type: Boolean, default: true }
645
+ },
646
+ setup(__props) {
647
+ const props = __props;
648
+ const { t } = useI18n("UI");
649
+ const title = t("COMPANY_NAME");
650
+ const { getLogoWidth } = useMenu();
651
+ const getLogoClass = computed(() => {
652
+ return `${props.theme} dt-logo px-2.5 text-sm flex items-center pl-2.5 cursor-pointer text-center transition-all duration-200 ease-in-out `;
653
+ });
654
+ return (_ctx, _cache) => {
655
+ return openBlock(), createElementBlock("div", {
656
+ class: normalizeClass(unref(getLogoClass)),
657
+ style: normalizeStyle({
658
+ minWidth: `${unref(getLogoWidth)}px`
659
+ })
660
+ }, [
661
+ createElementVNode("img", { src: "/node_modules/@dt-frames/ui/es/assets/imgs/logo/logo.png" }, null, 8, _hoisted_1$i),
662
+ withDirectives(createElementVNode("div", { class: "dt-logo__title text-base font-bold transition-all duration-500 pl-3" }, toDisplayString(unref(title)), 513), [
663
+ [vShow, __props.showTitle]
664
+ ])
665
+ ], 6);
666
+ };
667
+ }
668
+ });
669
+ const _sfc_main$u = /* @__PURE__ */ defineComponent({
670
+ __name: "trigger",
671
+ props: { theme: String },
672
+ setup(__props) {
673
+ const props = __props;
674
+ const { getCollapsed, toggleCollapsed } = useMenu();
675
+ return (_ctx, _cache) => {
676
+ return openBlock(), createElementBlock("div", {
677
+ class: normalizeClass(["flex w-12 h-full cursor-pointer items-center justify-center", props.theme]),
678
+ onClick: _cache[0] || (_cache[0] = (...args) => unref(toggleCollapsed) && unref(toggleCollapsed)(...args))
679
+ }, [
680
+ createElementVNode("i", {
681
+ class: normalizeClass(["i leading-none", unref(getCollapsed) ? "ic:baseline-format-indent-increase" : "ic:baseline-format-indent-decrease"])
682
+ }, null, 2)
683
+ ], 2);
684
+ };
685
+ }
686
+ });
687
+ const _hoisted_1$h = { class: "dt-breadcrumb" };
688
+ const _sfc_main$t = /* @__PURE__ */ defineComponent({
689
+ __name: "bread-crumb",
690
+ setup(__props) {
691
+ const { getIsZH } = useHeader();
692
+ let routes = ref([]);
693
+ const { currentRoute = null } = useRouter();
694
+ watchEffect(() => {
695
+ if (!currentRoute || currentRoute.value.path === "/")
696
+ return;
697
+ routes.value = getBreadCrumb(currentRoute.value.path);
698
+ });
699
+ return (_ctx, _cache) => {
700
+ const _component_ABreadcrumb = Breadcrumb;
701
+ return openBlock(), createElementBlock("div", _hoisted_1$h, [
702
+ createVNode(_component_ABreadcrumb, { routes: unref(routes) }, {
703
+ itemRender: withCtx(({ route }) => [
704
+ createElementVNode("span", null, toDisplayString((unref(getIsZH) ? route.label : route.enLabel) || route.meta?.title), 1)
705
+ ]),
706
+ _: 1
707
+ }, 8, ["routes"])
708
+ ]);
709
+ };
710
+ }
711
+ });
712
+ const _hoisted_1$g = {
713
+ key: 0,
714
+ class: "dt-menu-filter h-7 pr-2"
715
+ };
716
+ const _hoisted_2$8 = ["onClick"];
717
+ const _hoisted_3$5 = {
718
+ key: 0,
719
+ class: "flex items-center justify-center h-full overflow-hidden"
720
+ };
721
+ const _sfc_main$s = /* @__PURE__ */ defineComponent({
722
+ __name: "menu-filter",
723
+ setup(__props) {
724
+ const { t } = useI18n("UI");
725
+ const menuList = ref([]);
726
+ const router = useRouter();
727
+ const filter = ref("");
728
+ const { getShowSearch, getIsZH } = useHeader();
729
+ const isUseDef = computed(() => {
730
+ return isBoolean(getShowSearch.value);
731
+ });
732
+ function visibleChange(e) {
733
+ if (e) {
734
+ filterMenu();
735
+ } else {
736
+ filter.value = null;
737
+ }
738
+ }
739
+ function filterMenu() {
740
+ menuList.value = getFilterMenu(filter.value, true);
741
+ }
742
+ function navigation(url) {
743
+ router.push(url);
744
+ setTimeout(() => {
745
+ filter.value = "";
746
+ menuList.value = [];
747
+ });
748
+ }
749
+ return (_ctx, _cache) => {
750
+ const _component_AEmpty = Empty;
751
+ const _component_AInputSearch = InputSearch;
752
+ const _component_APopover = Popover;
753
+ return unref(isUseDef) ? (openBlock(), createElementBlock("div", _hoisted_1$g, [
754
+ createVNode(_component_APopover, {
755
+ placement: "bottom",
756
+ overlayClassName: "dt-menu-filter__popover",
757
+ trigger: "focus",
758
+ onVisibleChange: visibleChange
759
+ }, {
760
+ content: withCtx(() => [
761
+ (openBlock(true), createElementBlock(Fragment, null, renderList(menuList.value, (menu) => {
762
+ return openBlock(), createElementBlock("p", {
763
+ onClick: ($event) => navigation(menu.url),
764
+ class: "px-5 leading-9 border-gray-200 border-dashed border-b m-0 cursor-pointer transition-all duration-300 text-13"
765
+ }, toDisplayString(unref(getIsZH) ? menu.label : menu.enLabel), 9, _hoisted_2$8);
766
+ }), 256)),
767
+ !menuList.value.length ? (openBlock(), createElementBlock("div", _hoisted_3$5, [
768
+ createVNode(_component_AEmpty, {
769
+ description: "\u6682\u65E0\u6570\u636E",
770
+ imageStyle: { width: "100%" }
771
+ })
772
+ ])) : createCommentVNode("", true)
773
+ ]),
774
+ default: withCtx(() => [
775
+ createVNode(_component_AInputSearch, {
776
+ value: filter.value,
777
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => filter.value = $event),
778
+ placeholder: unref(t)("FILTER_MORE"),
779
+ onInput: filterMenu,
780
+ size: unref(UiSize).SMALL
781
+ }, null, 8, ["value", "placeholder", "size"])
782
+ ]),
783
+ _: 1
784
+ })
785
+ ])) : createCommentVNode("", true);
786
+ };
787
+ }
788
+ });
789
+ const _hoisted_1$f = { class: "lang m-0" };
790
+ const _hoisted_2$7 = ["onClick"];
791
+ const _hoisted_3$4 = {
792
+ class: "pr-2",
793
+ size: 16
794
+ };
795
+ const _hoisted_4$2 = /* @__PURE__ */ createElementVNode("span", { class: "dt_header_icon text-lg text-gray-800 cursor-pointer px-3 hover:bg-gray-500 hover:bg-opacity-50 transition-all duration-300" }, [
796
+ /* @__PURE__ */ createElementVNode("i", { class: "block i ic:baseline-language" })
797
+ ], -1);
798
+ const _sfc_main$r = /* @__PURE__ */ defineComponent({
799
+ __name: "lang-picker",
800
+ props: {
801
+ reload: { type: Boolean }
802
+ },
803
+ setup(__props) {
804
+ const props = __props;
805
+ const visible = ref(false);
806
+ let currentLang = DtCache.getLocal(CacheKey.LOCALE);
807
+ async function toggleLang(lang) {
808
+ visible.value = false;
809
+ if (lang !== currentLang) {
810
+ currentLang = lang;
811
+ await changeLocale(lang);
812
+ props.reload && location.reload();
813
+ }
814
+ }
815
+ return (_ctx, _cache) => {
816
+ const _component_APopover = Popover;
817
+ const _directive_icon = resolveDirective("icon");
818
+ return openBlock(), createBlock(_component_APopover, {
819
+ placement: "bottom",
820
+ visible: visible.value,
821
+ "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
822
+ overlayClassName: "dt-lang-picker__popover",
823
+ trigger: "click"
824
+ }, {
825
+ content: withCtx(() => [
826
+ createElementVNode("ul", _hoisted_1$f, [
827
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(localeList), (it) => {
828
+ return openBlock(), createElementBlock("li", {
829
+ onClick: ($event) => toggleLang(it.event),
830
+ class: normalizeClass(["px-4 my-1 leading-9 flex border-gray-200 cursor-pointer hover:bg-gray-100 transition-all duration-300 text-13", it.event === unref(currentLang) ? "active bg-gray-100" : ""])
831
+ }, [
832
+ withDirectives(createElementVNode("span", _hoisted_3$4, null, 512), [
833
+ [_directive_icon, it.icon]
834
+ ]),
835
+ createElementVNode("span", null, toDisplayString(it.text), 1)
836
+ ], 10, _hoisted_2$7);
837
+ }), 256))
838
+ ])
839
+ ]),
840
+ default: withCtx(() => [
841
+ _hoisted_4$2
842
+ ]),
843
+ _: 1
844
+ }, 8, ["visible"]);
845
+ };
846
+ }
847
+ });
848
+ const isServer = typeof window === "undefined";
849
+ const BAR_MAP = {
850
+ vertical: {
851
+ offset: "offsetHeight",
852
+ scroll: "scrollTop",
853
+ scrollSize: "scrollHeight",
854
+ size: "height",
855
+ key: "vertical",
856
+ axis: "Y",
857
+ client: "clientY",
858
+ direction: "top"
859
+ },
860
+ horizontal: {
861
+ offset: "offsetWidth",
862
+ scroll: "scrollLeft",
863
+ scrollSize: "scrollWidth",
864
+ size: "width",
865
+ key: "horizontal",
866
+ axis: "X",
867
+ client: "clientX",
868
+ direction: "left"
869
+ }
870
+ };
871
+ function renderThumbStyle({ move, size, bar }) {
872
+ const style = {};
873
+ const translate = `translate${bar.axis}(${move}%)`;
874
+ style[bar.size] = size;
875
+ style.transform = translate;
876
+ style.msTransform = translate;
877
+ style.webkitTransform = translate;
878
+ return style;
879
+ }
880
+ function resizeHandler(entries) {
881
+ for (const entry of entries) {
882
+ const listeners = entry.target.__resizeListeners__ || [];
883
+ if (listeners.length) {
884
+ listeners.forEach((fn) => {
885
+ fn();
886
+ });
887
+ }
888
+ }
889
+ }
890
+ function addResizeListener(element, fn) {
891
+ if (isServer)
892
+ return;
893
+ if (!element.__resizeListeners__) {
894
+ element.__resizeListeners__ = [];
895
+ element.__ro__ = new ResizeObserver(resizeHandler);
896
+ element.__ro__.observe(element);
897
+ }
898
+ element.__resizeListeners__.push(fn);
899
+ }
900
+ function removeResizeListener(element, fn) {
901
+ if (!element || !element.__resizeListeners__)
902
+ return;
903
+ element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);
904
+ if (!element.__resizeListeners__.length) {
905
+ element.__ro__.disconnect();
906
+ }
907
+ }
908
+ const Bar = defineComponent({
909
+ name: "Bar",
910
+ props: {
911
+ vertical: Boolean,
912
+ size: String,
913
+ move: Number
914
+ },
915
+ setup(props) {
916
+ const instance = getCurrentInstance();
917
+ const thumb = ref();
918
+ const wrap = inject("scroll-bar-wrap", {});
919
+ const bar = computed(() => {
920
+ return BAR_MAP[props.vertical ? "vertical" : "horizontal"];
921
+ });
922
+ const barStore = ref({});
923
+ const cursorDown = ref();
924
+ const clickThumbHandler = (e) => {
925
+ if (e.ctrlKey || e.button === 2) {
926
+ return;
927
+ }
928
+ window.getSelection()?.removeAllRanges();
929
+ startDrag(e);
930
+ barStore.value[bar.value.axis] = e.currentTarget[bar.value.offset] - (e[bar.value.client] - e.currentTarget.getBoundingClientRect()[bar.value.direction]);
931
+ };
932
+ const clickTrackHandler = (e) => {
933
+ const offset = Math.abs(
934
+ e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]
935
+ );
936
+ const thumbHalf = thumb.value[bar.value.offset] / 2;
937
+ const thumbPositionPercentage = (offset - thumbHalf) * 100 / instance?.vnode.el?.[bar.value.offset];
938
+ wrap.value[bar.value.scroll] = thumbPositionPercentage * wrap.value[bar.value.scrollSize] / 100;
939
+ };
940
+ const startDrag = (e) => {
941
+ e.stopImmediatePropagation();
942
+ cursorDown.value = true;
943
+ on(document, "mousemove", mouseMoveDocumentHandler);
944
+ on(document, "mouseup", mouseUpDocumentHandler);
945
+ document.onselectstart = () => false;
946
+ };
947
+ const mouseMoveDocumentHandler = (e) => {
948
+ if (cursorDown.value === false)
949
+ return;
950
+ const prevPage = barStore.value[bar.value.axis];
951
+ if (!prevPage)
952
+ return;
953
+ const offset = (instance?.vnode.el?.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1;
954
+ const thumbClickPosition = thumb.value[bar.value.offset] - prevPage;
955
+ const thumbPositionPercentage = (offset - thumbClickPosition) * 100 / instance?.vnode.el?.[bar.value.offset];
956
+ wrap.value[bar.value.scroll] = thumbPositionPercentage * wrap.value[bar.value.scrollSize] / 100;
957
+ };
958
+ function mouseUpDocumentHandler() {
959
+ cursorDown.value = false;
960
+ barStore.value[bar.value.axis] = 0;
961
+ off(document, "mousemove", mouseMoveDocumentHandler);
962
+ document.onselectstart = null;
963
+ }
964
+ onUnmounted(() => {
965
+ off(document, "mouseup", mouseUpDocumentHandler);
966
+ });
967
+ return () => h(
968
+ "div",
969
+ {
970
+ class: ["scrollbar__bar", "is-" + bar.value.key],
971
+ onMousedown: clickTrackHandler
972
+ },
973
+ h("div", {
974
+ ref: thumb,
975
+ class: "scrollbar__thumb",
976
+ onMousedown: clickThumbHandler,
977
+ style: renderThumbStyle({
978
+ size: props.size,
979
+ move: props.move,
980
+ bar: bar.value
981
+ })
982
+ })
983
+ );
984
+ }
985
+ });
986
+ const _hoisted_1$e = { class: "scrollbar relative h-full overflow-hidden" };
987
+ const _sfc_main$q = /* @__PURE__ */ defineComponent({
988
+ __name: "scroll-bar",
989
+ props: {
990
+ wrapClass: {
991
+ type: [String, Array],
992
+ default: ""
993
+ },
994
+ wrapStyle: Array,
995
+ viewClass: {
996
+ type: [String, Array],
997
+ default: ""
998
+ },
999
+ viewStyle: {
1000
+ type: [String, Array],
1001
+ default: ""
1002
+ },
1003
+ noresize: Boolean,
1004
+ tag: {
1005
+ type: String,
1006
+ default: "div"
1007
+ }
1008
+ },
1009
+ setup(__props) {
1010
+ const props = __props;
1011
+ const sizeWidth = ref("0");
1012
+ const sizeHeight = ref("0");
1013
+ const moveX = ref(0);
1014
+ const moveY = ref(0);
1015
+ const wrap = ref();
1016
+ const resize = ref();
1017
+ provide("scroll-bar-wrap", wrap);
1018
+ const style = computed(() => {
1019
+ let rsStyle = {};
1020
+ if (Array.isArray(props.wrapStyle)) {
1021
+ props.wrapStyle.forEach((it) => {
1022
+ if (it)
1023
+ rsStyle = Object.assign({}, rsStyle, it);
1024
+ });
1025
+ }
1026
+ return rsStyle;
1027
+ });
1028
+ const handleScroll = () => {
1029
+ moveY.value = unref(wrap).scrollTop * 100 / unref(wrap).clientHeight;
1030
+ moveX.value = unref(wrap).scrollLeft * 100 / unref(wrap).clientWidth;
1031
+ };
1032
+ const update = () => {
1033
+ if (!unref(wrap))
1034
+ return;
1035
+ const heightPercentage = unref(wrap).clientHeight * 100 / unref(wrap).scrollHeight;
1036
+ const widthPercentage = unref(wrap).clientWidth * 100 / unref(wrap).scrollWidth;
1037
+ sizeHeight.value = heightPercentage < 100 ? heightPercentage + "%" : "";
1038
+ sizeWidth.value = widthPercentage < 100 ? widthPercentage + "%" : "";
1039
+ };
1040
+ onMounted(() => {
1041
+ nextTick(update);
1042
+ if (!props.noresize) {
1043
+ addResizeListener(unref(resize), update);
1044
+ addResizeListener(unref(wrap), update);
1045
+ addEventListener("resize", update);
1046
+ }
1047
+ });
1048
+ onBeforeUnmount(() => {
1049
+ if (!props.noresize) {
1050
+ removeResizeListener(unref(resize), update);
1051
+ removeResizeListener(unref(wrap), update);
1052
+ removeEventListener("resize", update);
1053
+ }
1054
+ });
1055
+ return (_ctx, _cache) => {
1056
+ return openBlock(), createElementBlock("div", _hoisted_1$e, [
1057
+ createElementVNode("div", {
1058
+ ref_key: "wrap",
1059
+ ref: wrap,
1060
+ class: normalizeClass([[__props.wrapClass, "scrollbar__wrap--hidden-default"], "h-full overflow-auto"]),
1061
+ style: normalizeStyle(unref(style)),
1062
+ onScroll: handleScroll
1063
+ }, [
1064
+ (openBlock(), createBlock(resolveDynamicComponent(__props.tag), {
1065
+ class: normalizeClass(["box-border", __props.viewClass]),
1066
+ ref_key: "resize",
1067
+ ref: resize,
1068
+ style: normalizeStyle(__props.viewStyle)
1069
+ }, {
1070
+ default: withCtx(() => [
1071
+ renderSlot(_ctx.$slots, "default")
1072
+ ]),
1073
+ _: 3
1074
+ }, 8, ["class", "style"]))
1075
+ ], 38),
1076
+ createVNode(unref(Bar), {
1077
+ move: moveX.value,
1078
+ size: sizeWidth.value
1079
+ }, null, 8, ["move", "size"]),
1080
+ createVNode(unref(Bar), {
1081
+ vertical: "",
1082
+ move: moveY.value,
1083
+ size: sizeHeight.value
1084
+ }, null, 8, ["move", "size"])
1085
+ ]);
1086
+ };
1087
+ }
1088
+ });
1089
+ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1090
+ __name: "scroll-container",
1091
+ setup(__props) {
1092
+ const scrollbarRef = ref(null);
1093
+ return (_ctx, _cache) => {
1094
+ return openBlock(), createBlock(_sfc_main$q, mergeProps({
1095
+ ref_key: "scrollbarRef",
1096
+ ref: scrollbarRef
1097
+ }, _ctx.$attrs, { class: "w-full h-full" }), {
1098
+ default: withCtx(() => [
1099
+ renderSlot(_ctx.$slots, "default")
1100
+ ]),
1101
+ _: 3
1102
+ }, 16);
1103
+ };
1104
+ }
1105
+ });
1106
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
1107
+ __name: "slot-container",
1108
+ props: {
1109
+ template: {
1110
+ type: Function
1111
+ },
1112
+ data: {
1113
+ type: Object
1114
+ }
1115
+ },
1116
+ setup(__props) {
1117
+ const props = __props;
1118
+ const Container = h("div", [props.template(props.data)]);
1119
+ return (_ctx, _cache) => {
1120
+ return openBlock(), createBlock(unref(Container));
1121
+ };
1122
+ }
1123
+ });
1124
+ const withInstall = (comp) => {
1125
+ comp.install = (app) => {
1126
+ app.component(comp.name, comp);
1127
+ };
1128
+ return comp;
1129
+ };
1130
+ const DtScrollContainer = withInstall(_sfc_main$p);
1131
+ const DtSlotContainer = withInstall(_sfc_main$o);
1132
+ const _hoisted_1$d = { class: "dt_header_icon text-lg text-gray-800 cursor-pointer px-3 hover:bg-gray-500 hover:bg-opacity-50 transition-all duration-300 relative" };
1133
+ const _sfc_main$n = /* @__PURE__ */ defineComponent({
1134
+ __name: "notify",
1135
+ setup(__props) {
1136
+ const slots = getParentSlots(null, "dt-theme");
1137
+ return (_ctx, _cache) => {
1138
+ const _component_APopover = Popover;
1139
+ const _directive_icon = resolveDirective("icon");
1140
+ return openBlock(), createBlock(_component_APopover, {
1141
+ trigger: "click",
1142
+ overlayClassName: "dt-notify__popover"
1143
+ }, {
1144
+ content: withCtx(() => [
1145
+ unref(slots).notify ? (openBlock(), createBlock(unref(DtSlotContainer), {
1146
+ key: 0,
1147
+ template: unref(slots).notify
1148
+ }, null, 8, ["template"])) : createCommentVNode("", true)
1149
+ ]),
1150
+ default: withCtx(() => [
1151
+ createElementVNode("span", _hoisted_1$d, [
1152
+ withDirectives(createElementVNode("span", null, null, 512), [
1153
+ [_directive_icon, "ant-design:bell-outlined"]
1154
+ ]),
1155
+ unref(slots).notifyBadge ? (openBlock(), createBlock(unref(DtSlotContainer), {
1156
+ key: 0,
1157
+ template: unref(slots).notifyBadge
1158
+ }, null, 8, ["template"])) : createCommentVNode("", true)
1159
+ ])
1160
+ ]),
1161
+ _: 1
1162
+ });
1163
+ };
1164
+ }
1165
+ });
1166
+ const _hoisted_1$c = { class: "lang m-0" };
1167
+ const _hoisted_2$6 = ["onClick"];
1168
+ const _hoisted_3$3 = /* @__PURE__ */ createElementVNode("span", { class: "dt_header_icon text-lg text-gray-800 cursor-pointer px-3 hover:bg-gray-500 hover:bg-opacity-50 transition-all duration-300" }, [
1169
+ /* @__PURE__ */ createElementVNode("i", { class: "block i ic:baseline-format-size" })
1170
+ ], -1);
1171
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
1172
+ __name: "size",
1173
+ setup(__props) {
1174
+ const { t } = useI18n("UI");
1175
+ const { setThemeConf } = useThemeStore();
1176
+ const { getUiSize } = useHeader();
1177
+ const sizeList = [
1178
+ {
1179
+ text: t("LARGE_SIZE"),
1180
+ event: UiSize.LARGE
1181
+ },
1182
+ {
1183
+ text: t("MIDDLE_SIZE"),
1184
+ event: UiSize.MIDDLE
1185
+ },
1186
+ {
1187
+ text: t("SMALL_SIZE"),
1188
+ event: UiSize.SMALL
1189
+ }
1190
+ ];
1191
+ const visible = ref(false);
1192
+ async function toggleLang(size) {
1193
+ visible.value = false;
1194
+ setThemeConf({
1195
+ headOptions: {
1196
+ size
1197
+ }
1198
+ });
1199
+ }
1200
+ return (_ctx, _cache) => {
1201
+ return openBlock(), createBlock(unref(Popover$1), {
1202
+ placement: "bottom",
1203
+ visible: visible.value,
1204
+ "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
1205
+ overlayClassName: "dt-size__popover",
1206
+ trigger: "click"
1207
+ }, {
1208
+ content: withCtx(() => [
1209
+ createElementVNode("ul", _hoisted_1$c, [
1210
+ (openBlock(), createElementBlock(Fragment, null, renderList(sizeList, (it) => {
1211
+ return createElementVNode("li", {
1212
+ onClick: ($event) => toggleLang(it.event),
1213
+ class: normalizeClass(["px-4 my-1 leading-9 flex border-gray-200 cursor-pointer hover:bg-gray-100 transition-all duration-300 text-13", it.event === unref(getUiSize) ? "active bg-gray-100" : ""])
1214
+ }, [
1215
+ createElementVNode("span", null, toDisplayString(it.text), 1)
1216
+ ], 10, _hoisted_2$6);
1217
+ }), 64))
1218
+ ])
1219
+ ]),
1220
+ default: withCtx(() => [
1221
+ _hoisted_3$3
1222
+ ]),
1223
+ _: 1
1224
+ }, 8, ["visible"]);
1225
+ };
1226
+ }
1227
+ });
1228
+ const _hoisted_1$b = { class: "m-0" };
1229
+ const _hoisted_2$5 = {
1230
+ class: "pr-2",
1231
+ size: 16
1232
+ };
1233
+ const _hoisted_3$2 = { class: "dt_header_icon h-12 text-lg text-gray-800 cursor-pointer px-3 hover:bg-gray-500 hover:bg-opacity-50 transition-all duration-300 flex items-center" };
1234
+ const _hoisted_4$1 = ["src"];
1235
+ const _hoisted_5 = { class: "pl-2 text-13" };
1236
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1237
+ __name: "user-info",
1238
+ setup(__props) {
1239
+ const { t } = useI18n("UI");
1240
+ const go = useGo();
1241
+ const { getShowLoginOut, loginOutClick } = useHeader();
1242
+ const slots = getParentSlots(null, "dt-theme");
1243
+ const getUserInfo = DtCache.getLocal(CacheKey.USER_INFO);
1244
+ function signOut() {
1245
+ if (loginOutClick && isFunction(loginOutClick)) {
1246
+ loginOutClick();
1247
+ } else {
1248
+ go(Pages.LOGIN);
1249
+ }
1250
+ }
1251
+ return (_ctx, _cache) => {
1252
+ const _component_AAvatar = Avatar;
1253
+ const _component_APopover = Popover;
1254
+ const _directive_icon = resolveDirective("icon");
1255
+ return openBlock(), createBlock(_component_APopover, {
1256
+ placement: "bottom",
1257
+ overlayClassName: "dt-user-info__popover",
1258
+ trigger: "click"
1259
+ }, {
1260
+ content: withCtx(() => [
1261
+ createElementVNode("div", _hoisted_1$b, [
1262
+ unref(slots).userInfo ? (openBlock(), createBlock(unref(DtSlotContainer), {
1263
+ key: 0,
1264
+ template: unref(slots).userInfo
1265
+ }, null, 8, ["template"])) : createCommentVNode("", true),
1266
+ unref(getShowLoginOut) ? (openBlock(), createElementBlock("div", {
1267
+ key: 1,
1268
+ onClick: _cache[0] || (_cache[0] = ($event) => signOut()),
1269
+ class: "px-4 my-1 leading-9 flex border-gray-200 cursor-pointer hover:bg-gray-100 transition-all duration-300 text-13"
1270
+ }, [
1271
+ withDirectives(createElementVNode("span", _hoisted_2$5, null, 512), [
1272
+ [_directive_icon, "ant-design:logout-outlined"]
1273
+ ]),
1274
+ createElementVNode("span", null, toDisplayString(unref(t)("LOGIN_OUT")), 1)
1275
+ ])) : createCommentVNode("", true)
1276
+ ])
1277
+ ]),
1278
+ default: withCtx(() => [
1279
+ createElementVNode("div", _hoisted_3$2, [
1280
+ createVNode(_component_AAvatar, { size: 28 }, {
1281
+ icon: withCtx(() => [
1282
+ createElementVNode("img", { src: "/node_modules/@dt-frames/ui/es/assets/imgs/header/avatar.png" }, null, 8, _hoisted_4$1)
1283
+ ]),
1284
+ _: 1
1285
+ }),
1286
+ createElementVNode("span", _hoisted_5, toDisplayString(unref(getUserInfo)?.userNo), 1)
1287
+ ])
1288
+ ]),
1289
+ _: 1
1290
+ });
1291
+ };
1292
+ }
1293
+ });
1294
+ var HandlerEnum = /* @__PURE__ */ ((HandlerEnum2) => {
1295
+ HandlerEnum2[HandlerEnum2["CHANGE_LAYOUT"] = 0] = "CHANGE_LAYOUT";
1296
+ HandlerEnum2[HandlerEnum2["SHOW_BREADCRUMB"] = 1] = "SHOW_BREADCRUMB";
1297
+ HandlerEnum2[HandlerEnum2["SHOW_SEARCH"] = 2] = "SHOW_SEARCH";
1298
+ HandlerEnum2[HandlerEnum2["SHOW_SIZE"] = 3] = "SHOW_SIZE";
1299
+ HandlerEnum2[HandlerEnum2["SHOW_NOTICY"] = 4] = "SHOW_NOTICY";
1300
+ HandlerEnum2[HandlerEnum2["SHOW_FULL_SCREEN"] = 5] = "SHOW_FULL_SCREEN";
1301
+ HandlerEnum2[HandlerEnum2["SHOW_LOCAL"] = 6] = "SHOW_LOCAL";
1302
+ HandlerEnum2[HandlerEnum2["SHOW_ROUTE_REUSE"] = 7] = "SHOW_ROUTE_REUSE";
1303
+ HandlerEnum2[HandlerEnum2["SHOW_FOOTER"] = 8] = "SHOW_FOOTER";
1304
+ HandlerEnum2[HandlerEnum2["CONTENT_MODE"] = 9] = "CONTENT_MODE";
1305
+ return HandlerEnum2;
1306
+ })(HandlerEnum || {});
1307
+ function changeTheme(event, value = {}) {
1308
+ let conf = {};
1309
+ switch (event) {
1310
+ case 0:
1311
+ const { mode, type, split, headTheme, menuTheme } = value;
1312
+ conf = {
1313
+ headOptions: {
1314
+ theme: headTheme
1315
+ },
1316
+ menuOptions: {
1317
+ mode,
1318
+ type,
1319
+ split,
1320
+ theme: menuTheme,
1321
+ show: true
1322
+ }
1323
+ };
1324
+ break;
1325
+ case 1:
1326
+ conf = {
1327
+ headOptions: {
1328
+ showBreadCrumb: value
1329
+ }
1330
+ };
1331
+ break;
1332
+ case 2:
1333
+ conf = {
1334
+ headOptions: {
1335
+ showSearch: value
1336
+ }
1337
+ };
1338
+ break;
1339
+ case 4:
1340
+ conf = {
1341
+ headOptions: {
1342
+ showNotice: value
1343
+ }
1344
+ };
1345
+ break;
1346
+ case 3:
1347
+ conf = {
1348
+ headOptions: {
1349
+ showSize: value
1350
+ }
1351
+ };
1352
+ break;
1353
+ case 5:
1354
+ conf = {
1355
+ headOptions: {
1356
+ showFullScreen: value
1357
+ }
1358
+ };
1359
+ break;
1360
+ case 6:
1361
+ conf = {
1362
+ headOptions: {
1363
+ showLocaleSwitch: value
1364
+ }
1365
+ };
1366
+ break;
1367
+ case 7:
1368
+ conf = {
1369
+ routeReuse: {
1370
+ show: value
1371
+ }
1372
+ };
1373
+ break;
1374
+ case 8:
1375
+ conf = {
1376
+ footerOptions: {
1377
+ show: value
1378
+ }
1379
+ };
1380
+ break;
1381
+ case 9:
1382
+ conf = {
1383
+ content: {
1384
+ contentMode: value
1385
+ }
1386
+ };
1387
+ break;
1388
+ }
1389
+ useThemeStore().setThemeConf(conf);
1390
+ }
1391
+ const _hoisted_1$a = { class: "flex flex-row justify-center dt-menu-type" };
1392
+ const _hoisted_2$4 = ["onClick"];
1393
+ const _hoisted_3$1 = /* @__PURE__ */ createElementVNode("div", { class: "dt-menu-type__item" }, null, -1);
1394
+ const _hoisted_4 = [
1395
+ _hoisted_3$1
1396
+ ];
1397
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
1398
+ __name: "menu-type",
1399
+ setup(__props) {
1400
+ const { getMenuType, getMenuMode } = useMenu();
1401
+ const menuTypeList = [
1402
+ {
1403
+ title: "\u5DE6\u4FA7\u83DC\u5355\u6A21\u5F0F",
1404
+ headTheme: Theme.LIGHT,
1405
+ menuTheme: Theme.DARK,
1406
+ mode: MenuMode.INLINE,
1407
+ type: MenuType.SIDE,
1408
+ split: false
1409
+ },
1410
+ {
1411
+ title: "\u83DC\u5355\u6DF7\u5408\u6A21\u5F0F",
1412
+ headTheme: Theme.DARK,
1413
+ menuTheme: Theme.LIGHT,
1414
+ mode: MenuMode.INLINE,
1415
+ type: MenuType.MIX,
1416
+ split: true
1417
+ },
1418
+ {
1419
+ title: "\u9876\u90E8\u83DC\u5355\u6A21\u5F0F",
1420
+ headTheme: Theme.DARK,
1421
+ menuTheme: Theme.LIGHT,
1422
+ mode: MenuMode.HORIZONTAL,
1423
+ type: MenuType.TOP_MENU,
1424
+ split: false
1425
+ }
1426
+ ];
1427
+ function changeMenuType(item) {
1428
+ changeTheme(HandlerEnum.CHANGE_LAYOUT, item);
1429
+ }
1430
+ return (_ctx, _cache) => {
1431
+ const _component_ATooltip = Tooltip;
1432
+ return openBlock(), createElementBlock("div", _hoisted_1$a, [
1433
+ (openBlock(), createElementBlock(Fragment, null, renderList(menuTypeList, (item) => {
1434
+ return createVNode(_component_ATooltip, {
1435
+ key: item.title,
1436
+ title: item.title,
1437
+ placement: "bottom"
1438
+ }, {
1439
+ default: withCtx(() => [
1440
+ createElementVNode("div", {
1441
+ onClick: ($event) => changeMenuType(item),
1442
+ class: normalizeClass([
1443
+ `dt-menu-type__list p-3 relative w-14 h-12 mr-4 overflow-hidden cursor-pointer bg-slate-100 rounded shadow-sm
1444
+ shadow-gray-200`,
1445
+ `dt-menu-type__item--${item.type}`,
1446
+ {
1447
+ [`dt-menu-type__item--active`]: unref(getMenuType) === item.type && unref(getMenuMode) === item.mode
1448
+ }
1449
+ ])
1450
+ }, _hoisted_4, 10, _hoisted_2$4)
1451
+ ]),
1452
+ _: 2
1453
+ }, 1032, ["title"]);
1454
+ }), 64))
1455
+ ]);
1456
+ };
1457
+ }
1458
+ });
1459
+ const _hoisted_1$9 = { class: "flex justify-between mb-5" };
1460
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
1461
+ __name: "select",
1462
+ props: {
1463
+ event: { type: Number },
1464
+ disabled: { type: Boolean },
1465
+ title: { type: String },
1466
+ def: { type: [String, Number] },
1467
+ initValue: { type: [String, Number] },
1468
+ options: {
1469
+ type: Array,
1470
+ default: () => []
1471
+ }
1472
+ },
1473
+ setup(__props) {
1474
+ const props = __props;
1475
+ const getBindValue = computed(() => {
1476
+ return props.def ? { value: props.def, defaultValue: props.initValue || props.def } : {};
1477
+ });
1478
+ function handleChange(val) {
1479
+ props.event && changeTheme(props.event, val);
1480
+ }
1481
+ return (_ctx, _cache) => {
1482
+ const _component_ASelect = Select;
1483
+ return openBlock(), createElementBlock("div", _hoisted_1$9, [
1484
+ createElementVNode("span", null, toDisplayString(__props.title), 1),
1485
+ createVNode(_component_ASelect, mergeProps(unref(getBindValue), {
1486
+ disabled: __props.disabled,
1487
+ size: "small",
1488
+ class: "w-32",
1489
+ options: __props.options,
1490
+ onChange: handleChange
1491
+ }), null, 16, ["disabled", "options"])
1492
+ ]);
1493
+ };
1494
+ }
1495
+ });
1496
+ const _hoisted_1$8 = { class: "flex justify-between mb-5" };
1497
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
1498
+ __name: "switch",
1499
+ props: {
1500
+ event: {
1501
+ type: Number
1502
+ },
1503
+ disabled: { type: Boolean },
1504
+ title: { type: String },
1505
+ def: {
1506
+ type: Boolean
1507
+ }
1508
+ },
1509
+ setup(__props) {
1510
+ const props = __props;
1511
+ const { t } = useI18n("UI");
1512
+ const getBindValue = computed(() => {
1513
+ return props.def ? { checked: props.def } : {};
1514
+ });
1515
+ function handleChange(e) {
1516
+ props.event && changeTheme(props.event, e);
1517
+ }
1518
+ return (_ctx, _cache) => {
1519
+ const _component_ASwitch = Switch;
1520
+ return openBlock(), createElementBlock("div", _hoisted_1$8, [
1521
+ createElementVNode("span", null, toDisplayString(__props.title), 1),
1522
+ createVNode(_component_ASwitch, mergeProps(unref(getBindValue), {
1523
+ disabled: __props.disabled,
1524
+ checkedChildren: unref(t)("ON"),
1525
+ unCheckedChildren: unref(t)("OFF"),
1526
+ onChange: handleChange
1527
+ }), null, 16, ["disabled", "checkedChildren", "unCheckedChildren"])
1528
+ ]);
1529
+ };
1530
+ }
1531
+ });
1532
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
1533
+ __name: "feature",
1534
+ setup(__props) {
1535
+ const { t } = useI18n("UI");
1536
+ const {
1537
+ getShowBread,
1538
+ getShowSearch,
1539
+ getShowUiSize,
1540
+ getShowNotice,
1541
+ getShowFullScreen,
1542
+ getShowLocale
1543
+ } = useHeader();
1544
+ const { getShowMultipleTab } = useMultipleTab();
1545
+ const { getShowFooter, getContentMode } = useTheme();
1546
+ const switchItems = [
1547
+ {
1548
+ title: t("BREAD_CURB"),
1549
+ event: HandlerEnum.SHOW_BREADCRUMB,
1550
+ def: getShowBread
1551
+ },
1552
+ {
1553
+ title: t("MENU_FILTER"),
1554
+ event: HandlerEnum.SHOW_SEARCH,
1555
+ def: getShowSearch
1556
+ },
1557
+ {
1558
+ title: t("NOTICE"),
1559
+ event: HandlerEnum.SHOW_NOTICY,
1560
+ def: getShowNotice
1561
+ },
1562
+ {
1563
+ title: t("SIZE"),
1564
+ event: HandlerEnum.SHOW_SIZE,
1565
+ def: getShowUiSize
1566
+ },
1567
+ {
1568
+ title: t("SHOW_FULLE"),
1569
+ event: HandlerEnum.SHOW_FULL_SCREEN,
1570
+ def: getShowFullScreen
1571
+ },
1572
+ {
1573
+ title: t("LOCAL"),
1574
+ event: HandlerEnum.SHOW_LOCAL,
1575
+ def: getShowLocale
1576
+ },
1577
+ {
1578
+ title: t("ROUTE_REUSE"),
1579
+ event: HandlerEnum.SHOW_ROUTE_REUSE,
1580
+ def: getShowMultipleTab
1581
+ },
1582
+ {
1583
+ title: t("SHOW_FOOTER"),
1584
+ event: HandlerEnum.SHOW_FOOTER,
1585
+ def: getShowFooter
1586
+ }
1587
+ ];
1588
+ const selectItems = [
1589
+ {
1590
+ title: t("CONTENT_FIXED_WIDTH"),
1591
+ event: HandlerEnum.CONTENT_MODE,
1592
+ def: getContentMode,
1593
+ options: [
1594
+ {
1595
+ value: ContentMode.FULL,
1596
+ label: t("FULL")
1597
+ },
1598
+ {
1599
+ value: ContentMode.FIXED,
1600
+ label: t("FIXED")
1601
+ }
1602
+ ]
1603
+ }
1604
+ ];
1605
+ return (_ctx, _cache) => {
1606
+ return openBlock(), createElementBlock(Fragment, null, [
1607
+ (openBlock(), createElementBlock(Fragment, null, renderList(switchItems, (item) => {
1608
+ return createVNode(_sfc_main$i, {
1609
+ key: item.title,
1610
+ title: item.title,
1611
+ event: item.event,
1612
+ def: unref(item.def)
1613
+ }, null, 8, ["title", "event", "def"]);
1614
+ }), 64)),
1615
+ (openBlock(), createElementBlock(Fragment, null, renderList(selectItems, (item) => {
1616
+ return createVNode(_sfc_main$j, {
1617
+ key: item.title,
1618
+ title: item.title,
1619
+ event: item.event,
1620
+ def: unref(item.def),
1621
+ options: item.options
1622
+ }, null, 8, ["title", "event", "def", "options"]);
1623
+ }), 64))
1624
+ ], 64);
1625
+ };
1626
+ }
1627
+ });
1628
+ const _hoisted_1$7 = { class: "mt-5" };
1629
+ const _hoisted_2$3 = { class: "dt-setting-theme__tips p-3 text-12 bg-gray-100 rounded" };
1630
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
1631
+ __name: "setting-theme",
1632
+ setup(__props) {
1633
+ const { t } = useI18n("UI");
1634
+ const visible = ref(false);
1635
+ const {
1636
+ getShowBread,
1637
+ getShowSearch,
1638
+ getShowUiSize,
1639
+ getShowNotice,
1640
+ getShowFullScreen,
1641
+ getShowLocale
1642
+ } = useHeader();
1643
+ const { getShowMultipleTab } = useMultipleTab();
1644
+ const { getShowFooter, getContentMode } = useTheme();
1645
+ const { getMenuType, getMenuMode } = useMenu();
1646
+ const defaultConf = getConfig();
1647
+ function getConfig() {
1648
+ return {
1649
+ contentMode: unref(getContentMode),
1650
+ menuOptions: {
1651
+ mode: unref(getMenuMode),
1652
+ type: unref(getMenuType),
1653
+ split: unref(getMenuType) === MenuType.MIX ? true : false
1654
+ },
1655
+ headOptions: {
1656
+ showBreadCrumb: unref(getShowBread),
1657
+ showSearch: unref(getShowSearch),
1658
+ notice: unref(getShowNotice),
1659
+ showFullScreen: unref(getShowFullScreen),
1660
+ showLocaleSwitch: unref(getShowLocale)
1661
+ },
1662
+ mulTabsOptions: {
1663
+ show: unref(getShowMultipleTab)
1664
+ },
1665
+ footerOptions: {
1666
+ show: unref(getShowFooter)
1667
+ }
1668
+ };
1669
+ }
1670
+ function copy() {
1671
+ const afterUpdateConfig = getConfig();
1672
+ let copyObj = {};
1673
+ const isDiff = (newVal, oldVal) => newVal !== oldVal ? newVal : null;
1674
+ const isSameObj = (val1, val2) => JSON.stringify(val1) === JSON.stringify(val2);
1675
+ const getDiff = (target, orgTarget) => {
1676
+ let obj = {};
1677
+ for (let it in target) {
1678
+ if (isDiff(target[it], orgTarget[it]) !== null) {
1679
+ obj[it] = target[it];
1680
+ }
1681
+ }
1682
+ return obj;
1683
+ };
1684
+ for (let it in afterUpdateConfig) {
1685
+ if (!isSameObj(afterUpdateConfig[it], defaultConf[it])) {
1686
+ copyObj[it] = getDiff(afterUpdateConfig[it], defaultConf[it]);
1687
+ }
1688
+ }
1689
+ if (Object.keys(copyObj).length) {
1690
+ if (copyText(JSON.stringify(copyObj).replaceAll('"', ""))) {
1691
+ Modal.success({
1692
+ centered: true,
1693
+ okText: "\u786E\u5B9A",
1694
+ title: "\u64CD\u4F5C\u6210\u529F",
1695
+ content: "\u590D\u5236\u6210\u529F,\u8BF7\u5230 src/core/settings/theme.ts \u4E2D\u4FEE\u6539\u914D\u7F6E\uFF01"
1696
+ });
1697
+ }
1698
+ } else {
1699
+ Modal.info({
1700
+ centered: true,
1701
+ okText: "\u786E\u5B9A",
1702
+ title: "\u62F7\u8D1D\u63D0\u793A",
1703
+ content: "\u672A\u68C0\u6D4B\u5230\u4FEE\u6539\u4EFB\u4F55\u914D\u7F6E\u4FE1\u606F!"
1704
+ });
1705
+ }
1706
+ }
1707
+ function reset() {
1708
+ useThemeStore().setThemeConf(defaultConf);
1709
+ }
1710
+ return (_ctx, _cache) => {
1711
+ const _component_ADivider = Divider;
1712
+ const _component_AButton = Button;
1713
+ const _component_ADrawer = Drawer;
1714
+ const _directive_icon = resolveDirective("icon");
1715
+ return openBlock(), createElementBlock(Fragment, null, [
1716
+ createElementVNode("span", {
1717
+ onClick: _cache[0] || (_cache[0] = ($event) => visible.value = true),
1718
+ class: "dt_header_icon text-lg text-gray-800 cursor-pointer px-3 hover:bg-gray-500 hover:bg-opacity-50 transition-all duration-300 relative"
1719
+ }, [
1720
+ withDirectives(createElementVNode("span", null, null, 512), [
1721
+ [_directive_icon, "ant-design:setting-outlined"]
1722
+ ])
1723
+ ]),
1724
+ createVNode(_component_ADrawer, {
1725
+ visible: visible.value,
1726
+ "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => visible.value = $event),
1727
+ title: unref(t)("PROJECT_SETTING"),
1728
+ placement: "right",
1729
+ width: "320"
1730
+ }, {
1731
+ default: withCtx(() => [
1732
+ createVNode(_component_ADivider, null, {
1733
+ default: withCtx(() => [
1734
+ createTextVNode(toDisplayString(unref(t)("NAV_MODE")), 1)
1735
+ ]),
1736
+ _: 1
1737
+ }),
1738
+ createVNode(unref(_sfc_main$k)),
1739
+ createVNode(_component_ADivider, null, {
1740
+ default: withCtx(() => [
1741
+ createTextVNode(toDisplayString(unref(t)("PAGE_SHOW")), 1)
1742
+ ]),
1743
+ _: 1
1744
+ }),
1745
+ createVNode(unref(_sfc_main$h)),
1746
+ createVNode(_component_ADivider),
1747
+ createElementVNode("div", _hoisted_1$7, [
1748
+ createVNode(_component_AButton, {
1749
+ onClick: copy,
1750
+ class: "mb-3",
1751
+ type: "primary",
1752
+ block: ""
1753
+ }, {
1754
+ default: withCtx(() => [
1755
+ createTextVNode(toDisplayString(unref(t)("COPY")), 1)
1756
+ ]),
1757
+ _: 1
1758
+ }),
1759
+ createVNode(_component_AButton, {
1760
+ onClick: reset,
1761
+ class: "mb-3",
1762
+ block: ""
1763
+ }, {
1764
+ default: withCtx(() => [
1765
+ createTextVNode(toDisplayString(unref(t)("RESET")), 1)
1766
+ ]),
1767
+ _: 1
1768
+ })
1769
+ ]),
1770
+ createElementVNode("div", _hoisted_2$3, toDisplayString(unref(t)("DRAWER_TIPS")), 1)
1771
+ ]),
1772
+ _: 1
1773
+ }, 8, ["visible", "title"])
1774
+ ], 64);
1775
+ };
1776
+ }
1777
+ });
1778
+ function useSplitMenu(splitType) {
1779
+ const menusRef = ref([]);
1780
+ const { currentRoute } = useRouter();
1781
+ const { menusMap } = getMenusMap();
1782
+ const { getIsHorizontal, getSplit } = useMenu();
1783
+ const throttleHandleSplitLeftMenu = useThrottleFn(handleSplitLeftMenu, 50);
1784
+ const splitNotLeft = computed(
1785
+ () => unref(splitType) !== MenuSplitTye.LEFT && !unref(getIsHorizontal)
1786
+ );
1787
+ const getSplitLeft = computed(
1788
+ () => !unref(getSplit) || unref(splitType) !== MenuSplitTye.LEFT
1789
+ );
1790
+ const getSplitTop = computed(
1791
+ () => unref(splitType) === MenuSplitTye.TOP
1792
+ );
1793
+ const normalType = computed(
1794
+ () => !unref(getSplit) || unref(splitType) === MenuSplitTye.NONE
1795
+ );
1796
+ watch(
1797
+ [() => unref(currentRoute)?.path, () => unref(splitType)],
1798
+ ([path]) => {
1799
+ if (unref(splitNotLeft))
1800
+ return;
1801
+ throttleHandleSplitLeftMenu(path);
1802
+ },
1803
+ {
1804
+ immediate: true
1805
+ }
1806
+ );
1807
+ watch(
1808
+ () => getSplit.value,
1809
+ () => {
1810
+ if (unref(splitNotLeft))
1811
+ return;
1812
+ getMenus2();
1813
+ }
1814
+ );
1815
+ function handleSplitLeftMenu(path) {
1816
+ if (unref(getSplitLeft))
1817
+ return;
1818
+ menusRef.value = menusMap.filter((it) => it.includesPath.includes(path))[0]?.children;
1819
+ }
1820
+ async function getMenus2() {
1821
+ if (unref(normalType)) {
1822
+ menusRef.value = DtCache.getLocal(CacheKey.MENUS)?.children;
1823
+ return;
1824
+ }
1825
+ if (unref(getSplitTop)) {
1826
+ menusRef.value = await getShallowMenus();
1827
+ }
1828
+ }
1829
+ getMenus2();
1830
+ return { menusRef };
1831
+ }
1832
+ function getMenus() {
1833
+ return DtCache.getLocal(CacheKey.MENUS)?.children;
1834
+ }
1835
+ function getFirstMenuPath(item) {
1836
+ let isFind = false, path = "";
1837
+ const getPath = (menu) => {
1838
+ if (isFind)
1839
+ return;
1840
+ if (menu.children && menu.children.length) {
1841
+ menu.children.forEach((node) => getPath(node));
1842
+ } else {
1843
+ path = menu.url;
1844
+ isFind = true;
1845
+ }
1846
+ };
1847
+ getPath(item);
1848
+ return path;
1849
+ }
1850
+ function getMenusMap() {
1851
+ const menus = getMenus();
1852
+ const menusMap = [];
1853
+ const getPaths = (menu, path) => {
1854
+ if (menu.children && menu.children.length) {
1855
+ menu.children.forEach((node) => getPaths(node, path));
1856
+ } else {
1857
+ path.push(menu.url);
1858
+ }
1859
+ return path;
1860
+ };
1861
+ menus.map((item) => {
1862
+ item.url = getFirstMenuPath(item);
1863
+ menusMap.push({
1864
+ parentPath: item.url,
1865
+ children: item.children || [],
1866
+ includesPath: getPaths(item, [])
1867
+ });
1868
+ });
1869
+ return { menusMap };
1870
+ }
1871
+ function getShallowMenus() {
1872
+ const menus = getMenus();
1873
+ const shallowMenuList = menus.map((item) => {
1874
+ item.url = getFirstMenuPath(item);
1875
+ return { ...item, children: void 0 };
1876
+ });
1877
+ return shallowMenuList;
1878
+ }
1879
+ const BasicMenu = {
1880
+ items: {
1881
+ type: Array
1882
+ },
1883
+ collapsedShowTitle: Boolean,
1884
+ inlineIndent: {
1885
+ default: 20
1886
+ },
1887
+ mode: {
1888
+ type: String,
1889
+ default: MenuMode.INLINE
1890
+ },
1891
+ type: {
1892
+ type: String,
1893
+ default: MenuType.SIDE
1894
+ },
1895
+ theme: {
1896
+ default: Theme.DARK
1897
+ },
1898
+ inlineCollapsed: Boolean,
1899
+ isHorizontal: Boolean,
1900
+ beforeClickFn: {
1901
+ type: Function
1902
+ },
1903
+ mixSider: Boolean
1904
+ };
1905
+ const ItemProp = {
1906
+ item: {
1907
+ type: Object,
1908
+ default: {}
1909
+ },
1910
+ theme: {
1911
+ type: String,
1912
+ default: Theme.DARK
1913
+ },
1914
+ isHorizontal: Boolean,
1915
+ showTitle: Boolean,
1916
+ beforeClickFn: {
1917
+ type: Function
1918
+ }
1919
+ };
1920
+ const contentProps = {
1921
+ item: {
1922
+ type: Object,
1923
+ default: {}
1924
+ },
1925
+ showTitle: Boolean,
1926
+ level: Number,
1927
+ isHorizontal: Boolean
1928
+ };
1929
+ ({
1930
+ items: {
1931
+ type: Array,
1932
+ default: () => []
1933
+ },
1934
+ collapse: Boolean,
1935
+ mixSider: Boolean,
1936
+ theme: {
1937
+ default: Theme.DARK
1938
+ },
1939
+ collapsedShowTitle: Boolean,
1940
+ beforeClickFn: {
1941
+ type: Function
1942
+ },
1943
+ isSplitMenu: Boolean
1944
+ });
1945
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
1946
+ __name: "menu-item-content",
1947
+ props: contentProps,
1948
+ setup(__props) {
1949
+ const { getIsZH, getUiSize } = useHeader();
1950
+ return (_ctx, _cache) => {
1951
+ return openBlock(), createElementBlock("span", {
1952
+ class: normalizeClass(["dt-basic-menu-item-content-flex items-center dt-menu-item h-full", unref(getUiSize)])
1953
+ }, [
1954
+ createElementVNode("i", {
1955
+ class: normalizeClass(["menu-icon i", _ctx.item.icon])
1956
+ }, null, 2),
1957
+ createElementVNode("span", null, toDisplayString(unref(getIsZH) ? _ctx.item.label : _ctx.item.enLabel), 1)
1958
+ ], 2);
1959
+ };
1960
+ }
1961
+ });
1962
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
1963
+ __name: "basic-menu-item",
1964
+ props: ItemProp,
1965
+ setup(__props) {
1966
+ const props = __props;
1967
+ return (_ctx, _cache) => {
1968
+ const _component_AMenuItem = MenuItem;
1969
+ return openBlock(), createBlock(_component_AMenuItem, {
1970
+ key: _ctx.item.url
1971
+ }, {
1972
+ default: withCtx(() => [
1973
+ createVNode(_sfc_main$f, normalizeProps(guardReactiveProps(props)), null, 16)
1974
+ ]),
1975
+ _: 1
1976
+ });
1977
+ };
1978
+ }
1979
+ });
1980
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
1981
+ __name: "basic-sub-menu-item",
1982
+ props: ItemProp,
1983
+ setup(__props) {
1984
+ const props = __props;
1985
+ const { getShowMenu } = useMenu();
1986
+ const {
1987
+ theme,
1988
+ item
1989
+ } = props;
1990
+ const menuHasChildren = (menu) => {
1991
+ return !!menu.children && menu.children.length > 0;
1992
+ };
1993
+ return (_ctx, _cache) => {
1994
+ const _component_BasicSubMenuItem = resolveComponent("BasicSubMenuItem", true);
1995
+ const _component_ASubMenu = SubMenu;
1996
+ return openBlock(), createElementBlock(Fragment, null, [
1997
+ !menuHasChildren(unref(item)) && unref(getShowMenu) ? (openBlock(), createBlock(_sfc_main$e, normalizeProps(mergeProps({ key: 0 }, props)), null, 16)) : createCommentVNode("", true),
1998
+ menuHasChildren(unref(item)) && unref(getShowMenu) ? (openBlock(), createBlock(_component_ASubMenu, {
1999
+ class: normalizeClass([unref(theme)]),
2000
+ key: unref(item).id,
2001
+ popupClassName: "app-top-menu-popup"
2002
+ }, {
2003
+ title: withCtx(() => [
2004
+ createVNode(_sfc_main$f, mergeProps(props, { item: unref(item) }), null, 16, ["item"])
2005
+ ]),
2006
+ default: withCtx(() => [
2007
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(item).children, (childrenItem) => {
2008
+ return openBlock(), createBlock(_component_BasicSubMenuItem, mergeProps({
2009
+ key: childrenItem.id
2010
+ }, props, { item: childrenItem }), null, 16, ["item"]);
2011
+ }), 128))
2012
+ ]),
2013
+ _: 1
2014
+ }, 8, ["class"])) : createCommentVNode("", true)
2015
+ ], 64);
2016
+ };
2017
+ }
2018
+ });
2019
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2020
+ __name: "basic-menu",
2021
+ props: BasicMenu,
2022
+ emits: ["menuClick"],
2023
+ setup(__props, { emit: emits }) {
2024
+ const {
2025
+ theme,
2026
+ items,
2027
+ mode,
2028
+ type,
2029
+ isHorizontal,
2030
+ inlineIndent,
2031
+ mixSider,
2032
+ beforeClickFn
2033
+ } = __props;
2034
+ const { getSplit } = useMenu();
2035
+ const { currentRoute } = useRouter();
2036
+ const menuState = reactive({
2037
+ defaultSelectedKeys: [],
2038
+ openKeys: [],
2039
+ selectedKeys: [],
2040
+ collapsedOpenKeys: []
2041
+ });
2042
+ const { handleOpenChange, setOpenKeys, getOpenKeys } = useOpenKeys(
2043
+ menuState,
2044
+ items,
2045
+ type
2046
+ );
2047
+ watch(
2048
+ () => currentRoute.value.path,
2049
+ (val) => {
2050
+ if (val === "/")
2051
+ return;
2052
+ handleMenuChange(val);
2053
+ },
2054
+ {
2055
+ immediate: true
2056
+ }
2057
+ );
2058
+ async function handleMenuChange(path) {
2059
+ setOpenKeys(path);
2060
+ if (isHorizontal && unref(getSplit)) {
2061
+ const parentPath = getBreadCrumb(path, items);
2062
+ menuState.selectedKeys = [parentPath?.[0]?.url];
2063
+ } else {
2064
+ const parentPaths = await getBreadCrumb(path);
2065
+ menuState.selectedKeys = parentPaths.reduce((keys, it) => {
2066
+ it.url && keys.push(it.url);
2067
+ return keys;
2068
+ }, []);
2069
+ }
2070
+ }
2071
+ const { getCollapsed } = useMenu();
2072
+ const getInlineCollapsed = computed(() => {
2073
+ const isInline = unref(mode) === MenuMode.INLINE;
2074
+ if (isInline) {
2075
+ return mixSider ? false : unref(getCollapsed);
2076
+ }
2077
+ return false;
2078
+ });
2079
+ async function handleMenuClick(item) {
2080
+ if (beforeClickFn && isFunction(beforeClickFn)) {
2081
+ const flag = await beforeClickFn(item.key);
2082
+ if (!flag)
2083
+ return;
2084
+ }
2085
+ emits("menuClick", item.key);
2086
+ menuState.selectedKeys = [item.key];
2087
+ }
2088
+ return (_ctx, _cache) => {
2089
+ const _component_AMenu = Menu;
2090
+ return openBlock(), createBlock(_component_AMenu, {
2091
+ theme: _ctx.theme,
2092
+ selectedKeys: menuState.selectedKeys,
2093
+ defaultSelectedKeys: menuState.defaultSelectedKeys,
2094
+ openKeys: menuState.openKeys,
2095
+ inlineIndent: _ctx.inlineIndent,
2096
+ subMenuOpenDelay: 0.2,
2097
+ mode: _ctx.mode,
2098
+ collapsible: "",
2099
+ onClick: handleMenuClick,
2100
+ onOpenChange: unref(handleOpenChange),
2101
+ collapsed: unref(getInlineCollapsed),
2102
+ class: normalizeClass(unref(getSplit) ? "dt-split-menu" : "")
2103
+ }, {
2104
+ default: withCtx(() => [
2105
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.items, (item) => {
2106
+ return openBlock(), createBlock(_sfc_main$d, {
2107
+ key: item.id,
2108
+ item,
2109
+ theme: _ctx.theme,
2110
+ isHorizontal: _ctx.isHorizontal
2111
+ }, null, 8, ["item", "theme", "isHorizontal"]);
2112
+ }), 128))
2113
+ ]),
2114
+ _: 1
2115
+ }, 8, ["theme", "selectedKeys", "defaultSelectedKeys", "openKeys", "inlineIndent", "subMenuOpenDelay", "mode", "onOpenChange", "collapsed", "class"]);
2116
+ };
2117
+ }
2118
+ });
2119
+ const _sfc_main$b = defineComponent({
2120
+ name: "LayoutMenu",
2121
+ props: {
2122
+ theme: String,
2123
+ splitType: {
2124
+ type: Number,
2125
+ default: MenuSplitTye.NONE
2126
+ },
2127
+ isHorizontal: Boolean,
2128
+ menuMode: String
2129
+ },
2130
+ setup(props) {
2131
+ const {
2132
+ getMenuType,
2133
+ getMenuMode,
2134
+ getMenuTheme,
2135
+ getCollapsed,
2136
+ getCollapsedShowTitle,
2137
+ getIsHorizontal,
2138
+ getIsSidebarType,
2139
+ getSplit
2140
+ } = useMenu();
2141
+ const {
2142
+ getShowLogo
2143
+ } = useHeader();
2144
+ const {
2145
+ menusRef
2146
+ } = useSplitMenu(toRef(props, "splitType"));
2147
+ const slots = getParentSlots(null, "dt-theme");
2148
+ const getComputedTheme = computed(() => props.theme || unref(getMenuTheme));
2149
+ const getComputedMenuMode = computed(() => props.menuMode || unref(getMenuMode));
2150
+ const getIsShowLogo = computed(() => unref(getShowLogo) && unref(getIsSidebarType));
2151
+ const getUseScroll = computed(() => {
2152
+ return !unref(getIsHorizontal) && (unref(getIsSidebarType) || props.splitType === MenuSplitTye.LEFT || props.splitType === MenuSplitTye.NONE);
2153
+ });
2154
+ const getLogoClass = computed(() => [`dt-menu-logo`, unref(getComputedTheme)]);
2155
+ const getMenuProps = computed(() => {
2156
+ const menus = unref(menusRef);
2157
+ return {
2158
+ menus,
2159
+ beforeClickFn: beforeMenuClickFn,
2160
+ items: menus,
2161
+ theme: unref(getComputedTheme),
2162
+ collapse: unref(getCollapsed),
2163
+ collapsedShowTitle: unref(getCollapsedShowTitle),
2164
+ onMenuClick: handleMenuClick
2165
+ };
2166
+ });
2167
+ const go = useGo();
2168
+ function beforeMenuClickFn(path) {
2169
+ if (!isUrl(path)) {
2170
+ return true;
2171
+ }
2172
+ openWindow(path);
2173
+ return false;
2174
+ }
2175
+ function handleMenuClick(path) {
2176
+ go(path);
2177
+ }
2178
+ function renderHeader() {
2179
+ if (slots.logo) {
2180
+ return createVNode(DtSlotContainer, {
2181
+ "template": slots.logo,
2182
+ "data": {
2183
+ theme: unref(getComputedTheme),
2184
+ collapsed: unref(getCollapsed)
2185
+ }
2186
+ }, null);
2187
+ }
2188
+ if (!unref(getIsShowLogo))
2189
+ return null;
2190
+ return createVNode(_sfc_main$v, {
2191
+ "showTitle": !unref(getCollapsed),
2192
+ "class": unref(getLogoClass),
2193
+ "theme": unref(getComputedTheme)
2194
+ }, null);
2195
+ }
2196
+ function renderFooter() {
2197
+ if (unref(getMenuType) === MenuType.SIDE || unref(getMenuType) === MenuType.MIX && props.splitType === 2) {
2198
+ return slots.menuFooter ? createVNode(DtSlotContainer, {
2199
+ "template": slots.menuFooter,
2200
+ "data": {
2201
+ theme: unref(getComputedTheme),
2202
+ collapsed: unref(getCollapsed)
2203
+ }
2204
+ }, null) : null;
2205
+ }
2206
+ return null;
2207
+ }
2208
+ function renderMenu() {
2209
+ const {
2210
+ menus,
2211
+ ...menuProps
2212
+ } = unref(getMenuProps);
2213
+ if (!menus || !menus.length)
2214
+ return null;
2215
+ return createVNode(_sfc_main$c, mergeProps(menuProps, {
2216
+ "isHorizontal": props.isHorizontal,
2217
+ "type": unref(getMenuType),
2218
+ "showLogo": unref(getIsShowLogo),
2219
+ "mode": unref(getComputedMenuMode),
2220
+ "items": menus
2221
+ }), null);
2222
+ }
2223
+ return () => {
2224
+ return createVNode(Fragment, null, [renderHeader(), unref(getUseScroll) ? createVNode(DtScrollContainer, null, {
2225
+ default: () => renderMenu()
2226
+ }) : renderMenu(), renderFooter()]);
2227
+ };
2228
+ }
2229
+ });
2230
+ const _hoisted_1$6 = { class: "dt-header-left flex h-full items-center" };
2231
+ const _hoisted_2$2 = {
2232
+ key: 0,
2233
+ class: "flex-1 h-full min-w-0 items-center"
2234
+ };
2235
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
2236
+ __name: "index",
2237
+ props: {
2238
+ fixed: Boolean
2239
+ },
2240
+ setup(__props) {
2241
+ const props = __props;
2242
+ const { getSplit } = useMenu();
2243
+ const {
2244
+ getHeaderTheme,
2245
+ getShowHeaderLogo,
2246
+ getShowHeaderTrigger,
2247
+ getShowBread,
2248
+ getShowLocale,
2249
+ getShowFullScreen,
2250
+ getShowSettingTheme,
2251
+ getShowNotice,
2252
+ getShowTopMenu,
2253
+ getShowSearch,
2254
+ getShowUiSize
2255
+ } = useHeader();
2256
+ const getSplitType = computed(() => {
2257
+ return unref(getSplit) ? MenuSplitTye.TOP : MenuSplitTye.NONE;
2258
+ });
2259
+ const getMenuMode = computed(() => {
2260
+ return unref(getSplit) ? MenuMode.HORIZONTAL : null;
2261
+ });
2262
+ const getHeaderCls = computed(() => {
2263
+ let theme = unref(getHeaderTheme);
2264
+ let cls = "dt-header flex p-0 items-center justify-between ";
2265
+ if (props.fixed) {
2266
+ cls += "fixed top-0 left-0 w-full z-10 ";
2267
+ }
2268
+ cls += `dt-header--${theme}`;
2269
+ return cls;
2270
+ });
2271
+ return (_ctx, _cache) => {
2272
+ const _component_ALayoutHeader = LayoutHeader;
2273
+ return openBlock(), createBlock(_component_ALayoutHeader, {
2274
+ class: normalizeClass([unref(getHeaderCls), "flex items-center justify-between"])
2275
+ }, {
2276
+ default: withCtx(() => [
2277
+ createElementVNode("div", _hoisted_1$6, [
2278
+ unref(getShowHeaderLogo) ? (openBlock(), createBlock(unref(_sfc_main$v), {
2279
+ key: 0,
2280
+ theme: unref(getHeaderTheme),
2281
+ class: "dt-header-logo"
2282
+ }, null, 8, ["theme"])) : createCommentVNode("", true),
2283
+ unref(getShowHeaderTrigger) && !unref(getSplit) ? (openBlock(), createBlock(unref(_sfc_main$u), {
2284
+ key: 1,
2285
+ theme: unref(getHeaderTheme)
2286
+ }, null, 8, ["theme"])) : createCommentVNode("", true),
2287
+ unref(getShowBread) ? (openBlock(), createBlock(unref(_sfc_main$t), { key: 2 })) : createCommentVNode("", true)
2288
+ ]),
2289
+ unref(getShowTopMenu) ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
2290
+ createVNode(_sfc_main$b, {
2291
+ isHorizontal: true,
2292
+ theme: unref(getHeaderTheme),
2293
+ splitType: unref(getSplitType),
2294
+ menuMode: unref(getMenuMode)
2295
+ }, null, 8, ["theme", "splitType", "menuMode"])
2296
+ ])) : createCommentVNode("", true),
2297
+ createElementVNode("div", {
2298
+ class: "dt-header-action flex items-center",
2299
+ style: normalizeStyle({
2300
+ "padding-right": unref(getShowSettingTheme) ? "" : "20px"
2301
+ })
2302
+ }, [
2303
+ unref(getShowSearch) ? (openBlock(), createBlock(unref(_sfc_main$s), { key: 0 })) : createCommentVNode("", true),
2304
+ unref(getShowNotice) ? (openBlock(), createBlock(unref(_sfc_main$n), { key: 1 })) : createCommentVNode("", true),
2305
+ unref(getShowUiSize) ? (openBlock(), createBlock(unref(_sfc_main$m), { key: 2 })) : createCommentVNode("", true),
2306
+ unref(getShowFullScreen) ? (openBlock(), createBlock(unref(_sfc_main$w), { key: 3 })) : createCommentVNode("", true),
2307
+ unref(getShowLocale) ? (openBlock(), createBlock(unref(_sfc_main$r), {
2308
+ key: 4,
2309
+ reload: true
2310
+ })) : createCommentVNode("", true),
2311
+ createVNode(unref(_sfc_main$l)),
2312
+ unref(getShowSettingTheme) ? (openBlock(), createBlock(unref(_sfc_main$g), { key: 5 })) : createCommentVNode("", true)
2313
+ ], 4)
2314
+ ]),
2315
+ _: 1
2316
+ }, 8, ["class"]);
2317
+ };
2318
+ }
2319
+ });
2320
+ function useMenuSwitch() {
2321
+ const brokenRef = ref(false);
2322
+ const { getMiniWidthNumber } = useMenu();
2323
+ const getCollapsedWidth = computed(() => {
2324
+ return unref(brokenRef) ? 0 : unref(getMiniWidthNumber);
2325
+ });
2326
+ function onBreakPointChange(broken) {
2327
+ brokenRef.value = broken;
2328
+ }
2329
+ return { getCollapsedWidth, onBreakPointChange };
2330
+ }
2331
+ function useTrigger() {
2332
+ const { getTrigger, getSplit } = useMenu();
2333
+ const getShowTrigger = computed(() => {
2334
+ const trigger = unref(getTrigger);
2335
+ return trigger && unref(getSplit);
2336
+ });
2337
+ const getTriggerAttr = computed(() => {
2338
+ if (unref(getShowTrigger)) {
2339
+ return {};
2340
+ }
2341
+ return {
2342
+ trigger: null
2343
+ };
2344
+ });
2345
+ return { getTriggerAttr, getShowTrigger };
2346
+ }
2347
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
2348
+ __name: "sider-trigger",
2349
+ props: {
2350
+ type: {
2351
+ type: String,
2352
+ default: null
2353
+ }
2354
+ },
2355
+ setup(__props) {
2356
+ const { getCollapsed, toggleCollapsed } = useMenu();
2357
+ return (_ctx, _cache) => {
2358
+ return openBlock(), createElementBlock("div", {
2359
+ onClick: _cache[0] || (_cache[0] = withModifiers(
2360
+ (...args) => unref(toggleCollapsed) && unref(toggleCollapsed)(...args),
2361
+ ["stop"]
2362
+ ))
2363
+ }, [
2364
+ createElementVNode("i", {
2365
+ class: normalizeClass(["i", unref(getCollapsed) ? "ant-design:double-right-outlined" : "ant-design:double-left-outlined"])
2366
+ }, null, 2)
2367
+ ]);
2368
+ };
2369
+ }
2370
+ });
2371
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2372
+ __name: "drag-bar",
2373
+ setup(__props) {
2374
+ const { getCollapsed, getCanDrag, getMenuWidth } = useMenu();
2375
+ const getDragBarStyle = computed(() => {
2376
+ if (!unref(getCollapsed)) {
2377
+ return { left: `${unref(getMenuWidth)}px` };
2378
+ }
2379
+ return {};
2380
+ });
2381
+ const getClass = computed(() => {
2382
+ return [
2383
+ "dt-darg-bar",
2384
+ {
2385
+ "dt-darg-bar--hide": !unref(getCanDrag)
2386
+ }
2387
+ ];
2388
+ });
2389
+ return (_ctx, _cache) => {
2390
+ return openBlock(), createElementBlock("div", {
2391
+ class: normalizeClass(unref(getClass)),
2392
+ style: normalizeStyle(unref(getDragBarStyle))
2393
+ }, null, 6);
2394
+ };
2395
+ }
2396
+ });
2397
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
2398
+ __name: "index",
2399
+ setup(__props) {
2400
+ const {
2401
+ getMenuFixed,
2402
+ getSplit,
2403
+ getMenuHidden,
2404
+ getMenuWidth,
2405
+ getCollapsed,
2406
+ getMenuTheme,
2407
+ getRealWidth,
2408
+ getIsMixMode
2409
+ } = useMenu();
2410
+ const {
2411
+ getCollapsedWidth,
2412
+ onBreakPointChange
2413
+ } = useMenuSwitch();
2414
+ const {
2415
+ getTriggerAttr,
2416
+ getShowTrigger
2417
+ } = useTrigger();
2418
+ const dragBarRef = ref(null);
2419
+ const sideRef = ref(null);
2420
+ const hiddenDomStyle = computed(() => {
2421
+ const width = `${unref(getRealWidth)}px`;
2422
+ return {
2423
+ width,
2424
+ overflow: "hidden",
2425
+ flex: `0 0 ${width}`,
2426
+ maxWidth: width,
2427
+ minWidth: width,
2428
+ transition: "all 0.2s"
2429
+ };
2430
+ });
2431
+ const showClassSideBarRef = computed(() => {
2432
+ const {
2433
+ menusRef
2434
+ } = useSplitMenu(getSplitType);
2435
+ if (!unref(menusRef)?.length)
2436
+ return false;
2437
+ return unref(getSplit) ? !unref(getMenuHidden) : true;
2438
+ });
2439
+ useDragLine(sideRef, dragBarRef);
2440
+ const getSiderClass = computed(() => {
2441
+ let cls = `dt-sideBar overflow-hidden z-10 `;
2442
+ if (unref(getMenuFixed)) {
2443
+ cls += `dt-sideBar--fixed t-0 l-0 h-full `;
2444
+ }
2445
+ if (unref(getIsMixMode)) {
2446
+ cls += "dt-sideBar--mix ";
2447
+ }
2448
+ return cls;
2449
+ });
2450
+ const getSplitType = computed(() => {
2451
+ return unref(getSplit) ? MenuSplitTye.LEFT : MenuSplitTye.NONE;
2452
+ });
2453
+ const getMode = computed(() => {
2454
+ return unref(getSplit) ? MenuMode.INLINE : null;
2455
+ });
2456
+ const renderTrigger = h(_sfc_main$9);
2457
+ return (_ctx, _cache) => {
2458
+ const _component_ALayoutSider = LayoutSider;
2459
+ return openBlock(), createElementBlock(Fragment, null, [unref(getMenuFixed) ? withDirectives((openBlock(), createElementBlock("div", {
2460
+ key: 0,
2461
+ style: normalizeStyle(unref(hiddenDomStyle))
2462
+ }, null, 4)), [[vShow, unref(showClassSideBarRef)]]) : createCommentVNode("", true), withDirectives(createVNode(_component_ALayoutSider, mergeProps({
2463
+ ref_key: "sideRef",
2464
+ ref: sideRef,
2465
+ collapsible: "",
2466
+ breakpoint: "lg",
2467
+ class: unref(getSiderClass),
2468
+ width: unref(getMenuWidth),
2469
+ collapsed: unref(getCollapsed),
2470
+ collapsedWidth: unref(getCollapsedWidth),
2471
+ onBreakpoint: unref(onBreakPointChange),
2472
+ theme: unref(getMenuTheme),
2473
+ trigger: unref(renderTrigger)
2474
+ }, unref(getTriggerAttr)), {
2475
+ default: withCtx(() => [createVNode(_sfc_main$b, {
2476
+ theme: unref(getMenuTheme),
2477
+ menuMode: unref(getMode),
2478
+ splitType: unref(getSplitType)
2479
+ }, null, 8, ["theme", "menuMode", "splitType"]), createVNode(_sfc_main$8, {
2480
+ ref_key: "dragBarRef",
2481
+ ref: dragBarRef
2482
+ }, null, 512)]),
2483
+ _: 1
2484
+ }, 16, ["class", "width", "collapsed", "collapsedWidth", "onBreakpoint", "theme", "trigger"]), [[vShow, unref(showClassSideBarRef)]])], 64);
2485
+ };
2486
+ }
2487
+ });
2488
+ const _hoisted_1$5 = /* @__PURE__ */ createElementVNode("i", { class: "block i ic:baseline-autorenew" }, null, -1);
2489
+ const _hoisted_2$1 = [
2490
+ _hoisted_1$5
2491
+ ];
2492
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2493
+ __name: "TabRedo",
2494
+ setup(__props) {
2495
+ const tabStore = useRouteReuseStore();
2496
+ const router = useRouter();
2497
+ function handleRedo() {
2498
+ tabStore.refreshPage(router);
2499
+ }
2500
+ return (_ctx, _cache) => {
2501
+ return openBlock(), createElementBlock("span", {
2502
+ onClick: handleRedo,
2503
+ class: "inline-block w-9 h-9 leading-9 -mt-0.5 text-zinc-600 text-center cursor-pointer border-l border-zinc-300 hover:text-zinc-900"
2504
+ }, _hoisted_2$1);
2505
+ };
2506
+ }
2507
+ });
2508
+ function useTabDropdown() {
2509
+ const router = useRouter();
2510
+ const { currentRoute } = router;
2511
+ const tabStore = useRouteReuseStore();
2512
+ const state = reactive({
2513
+ current: null,
2514
+ currentIndex: 0
2515
+ });
2516
+ const getDropMenuList = computed(() => {
2517
+ const { t } = useI18n("UI");
2518
+ const { path, meta } = unref(currentRoute);
2519
+ const curItem = state.current;
2520
+ const isCurItem = curItem ? curItem.path === path : false;
2521
+ const index = state.currentIndex;
2522
+ const closeLeftDisabled = index === 0 || !isCurItem;
2523
+ const disabled = tabStore.getTabList.length === 1;
2524
+ const closeRightDisabled = !isCurItem || index === tabStore.getTabList.length - 1 && tabStore.getLastDragEndIndex >= 0;
2525
+ const dropMenuList = [
2526
+ {
2527
+ icon: "ic:baseline-close",
2528
+ text: t("CLOSE_CURRENT_TAG"),
2529
+ onClick: () => tabStore.closeTab(path, router),
2530
+ disabled: !!meta?.affix || disabled,
2531
+ divider: true
2532
+ },
2533
+ {
2534
+ icon: "mdi:arrow-collapse-left",
2535
+ text: t("CLOSE_LEFT_TAGS"),
2536
+ onClick: () => tabStore.closeLeftTabs(path),
2537
+ disabled: closeLeftDisabled,
2538
+ divider: false
2539
+ },
2540
+ {
2541
+ icon: "mdi:arrow-collapse-right",
2542
+ text: t("CLOSE_RIGHT_TAGS"),
2543
+ onClick: () => tabStore.closeRightTabs(path),
2544
+ disabled: closeRightDisabled,
2545
+ divider: true
2546
+ },
2547
+ {
2548
+ icon: "ic:baseline-sync-alt",
2549
+ text: t("CLOSE_OTHER_TAGS"),
2550
+ onClick: () => tabStore.closeOtherTabs(path),
2551
+ disabled: disabled || !isCurItem
2552
+ },
2553
+ {
2554
+ icon: "ic:baseline-horizontal-rule",
2555
+ text: t("CLOSE_ALL_TAGE"),
2556
+ onClick: () => tabStore.closeAllTab(currentRoute, router),
2557
+ disabled
2558
+ }
2559
+ ];
2560
+ return dropMenuList;
2561
+ });
2562
+ function handleContext(e) {
2563
+ e?.preventDefault();
2564
+ const { path } = unref(currentRoute);
2565
+ const index = tabStore.getTabList.findIndex((tab) => tab.path === path);
2566
+ state.current = unref(currentRoute);
2567
+ state.currentIndex = index;
2568
+ }
2569
+ function handleMenuEvent(item) {
2570
+ item.onClick?.();
2571
+ }
2572
+ return {
2573
+ getDropMenuList,
2574
+ handleContext,
2575
+ handleMenuEvent
2576
+ };
2577
+ }
2578
+ const _hoisted_1$4 = /* @__PURE__ */ createElementVNode("i", { class: "block i ic:baseline-keyboard-arrow-down" }, null, -1);
2579
+ const _hoisted_2 = [
2580
+ _hoisted_1$4
2581
+ ];
2582
+ const _hoisted_3 = { class: "text-13" };
2583
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2584
+ __name: "TabContent",
2585
+ setup(__props) {
2586
+ const { getDropMenuList, handleContext, handleMenuEvent } = useTabDropdown();
2587
+ return (_ctx, _cache) => {
2588
+ const _component_AMenuItem = MenuItem;
2589
+ const _component_AMenuDivider = MenuDivider;
2590
+ const _component_AMenu = Menu;
2591
+ const _component_ADropdown = Dropdown;
2592
+ return openBlock(), createBlock(_component_ADropdown, {
2593
+ placement: "bottomRight",
2594
+ trigger: ["click"],
2595
+ overlayClassName: "dt-reuse-tabs__dropdown"
2596
+ }, {
2597
+ overlay: withCtx(() => [
2598
+ createVNode(_component_AMenu, null, {
2599
+ default: withCtx(() => [
2600
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(getDropMenuList), (item, index) => {
2601
+ return openBlock(), createElementBlock(Fragment, { key: index }, [
2602
+ createVNode(_component_AMenuItem, {
2603
+ onClick: ($event) => unref(handleMenuEvent)(item),
2604
+ disabled: item.disabled
2605
+ }, {
2606
+ default: withCtx(() => [
2607
+ createElementVNode("i", {
2608
+ class: normalizeClass(["i pr-4", item.icon])
2609
+ }, null, 2),
2610
+ createElementVNode("span", _hoisted_3, toDisplayString(item.text), 1)
2611
+ ]),
2612
+ _: 2
2613
+ }, 1032, ["onClick", "disabled"]),
2614
+ item.divider ? (openBlock(), createBlock(_component_AMenuDivider, {
2615
+ key: `d-${index}`
2616
+ })) : createCommentVNode("", true)
2617
+ ], 64);
2618
+ }), 128))
2619
+ ]),
2620
+ _: 1
2621
+ })
2622
+ ]),
2623
+ default: withCtx(() => [
2624
+ createElementVNode("span", {
2625
+ onClick: _cache[0] || (_cache[0] = (...args) => unref(handleContext) && unref(handleContext)(...args)),
2626
+ class: "inline-block w-9 h-9 leading-9 -mt-0.5 text-zinc-600 text-center cursor-pointer border-l border-zinc-300 hover:text-zinc-900"
2627
+ }, _hoisted_2)
2628
+ ]),
2629
+ _: 1
2630
+ });
2631
+ };
2632
+ }
2633
+ });
2634
+ function initAffixTabs() {
2635
+ const affixList = ref([]);
2636
+ const tabStore = useRouteReuseStore();
2637
+ const router = useRouter();
2638
+ const filterAffixTabs = (routes = []) => {
2639
+ return routes && routes.reduce((tabs, route) => {
2640
+ if (route.meta && route.meta.affix) {
2641
+ tabs.push(toRaw(route));
2642
+ }
2643
+ return tabs;
2644
+ }, []);
2645
+ };
2646
+ const addAffixTabs = () => {
2647
+ const affixTabs = filterAffixTabs(router.getRoutes());
2648
+ affixList.value = affixTabs;
2649
+ for (const tab of affixTabs) {
2650
+ tabStore.addTab({
2651
+ meta: tab.meta,
2652
+ name: tab.name,
2653
+ path: tab.path
2654
+ });
2655
+ }
2656
+ };
2657
+ let isAddAffix = false;
2658
+ if (!isAddAffix) {
2659
+ addAffixTabs();
2660
+ isAddAffix = true;
2661
+ }
2662
+ return affixList.value.map((item) => item.meta?.title).filter(Boolean);
2663
+ }
2664
+ function useSortable(el, options) {
2665
+ function initSortable() {
2666
+ nextTick(async () => {
2667
+ if (!el)
2668
+ return;
2669
+ const Sortable = (await import("sortablejs")).default;
2670
+ Sortable.create(unref(el), {
2671
+ animation: 500,
2672
+ delay: 400,
2673
+ delayOnTouchOnly: true,
2674
+ ...options
2675
+ });
2676
+ });
2677
+ }
2678
+ return { initSortable };
2679
+ }
2680
+ function useTabsDrag(affixList) {
2681
+ const tabStore = useRouteReuseStore();
2682
+ const { getCanDrag } = useMultipleTab();
2683
+ nextTick(() => {
2684
+ if (!unref(getCanDrag))
2685
+ return;
2686
+ const el = document.querySelectorAll(`.dt-reuse-tabs .ant-tabs-nav-list`)?.[0];
2687
+ const { initSortable } = useSortable(el, {
2688
+ filter: (e) => {
2689
+ const text = e?.target?.innerText;
2690
+ if (!text)
2691
+ return false;
2692
+ return affixList.includes(text);
2693
+ },
2694
+ onEnd: (evt) => {
2695
+ const { oldIndex, newIndex } = evt;
2696
+ if (isNullAndUnDef(oldIndex) || isNullAndUnDef(newIndex) || oldIndex === newIndex)
2697
+ return;
2698
+ tabStore.sortTabs(oldIndex, newIndex);
2699
+ }
2700
+ });
2701
+ initSortable();
2702
+ });
2703
+ }
2704
+ const _hoisted_1$3 = { class: "dt-reuse-tabs leading-8 border-b border-solid border-gray-200" };
2705
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2706
+ __name: "index",
2707
+ setup(__props) {
2708
+ const { t } = useI18n("UI");
2709
+ const router = useRouter();
2710
+ const go = useGo(router);
2711
+ const tabStore = useRouteReuseStore();
2712
+ const { getShowQuick, getShowRedo } = useMultipleTab();
2713
+ const menuLabelMap = menuList2Map();
2714
+ const activeKeyRef = ref(null);
2715
+ const getTabsState = computed(() => {
2716
+ return tabStore.getTabList.filter((item) => !item.meta?.hideTab);
2717
+ });
2718
+ const unClose = computed(() => unref(getTabsState).length === 1);
2719
+ function handleChange(activeKey) {
2720
+ activeKeyRef.value = activeKey;
2721
+ go(activeKey);
2722
+ }
2723
+ function handleEdit(targetKey) {
2724
+ if (unref(unClose))
2725
+ return;
2726
+ tabStore.closeTab(targetKey, router);
2727
+ }
2728
+ const affixTextList = initAffixTabs();
2729
+ useTabsDrag(affixTextList);
2730
+ watch(
2731
+ () => router.currentRoute.value.path,
2732
+ (v) => {
2733
+ if (v === "/" || v === "/login")
2734
+ return;
2735
+ const { meta = {} } = unref(router.currentRoute);
2736
+ const { hideTab = false } = meta;
2737
+ if (activeKeyRef.value !== v) {
2738
+ activeKeyRef.value = v;
2739
+ }
2740
+ if (!hideTab) {
2741
+ tabStore.addTab(unref(router.currentRoute));
2742
+ }
2743
+ },
2744
+ {
2745
+ immediate: true
2746
+ }
2747
+ );
2748
+ return (_ctx, _cache) => {
2749
+ const _component_ATabPane = TabPane;
2750
+ const _component_ATabs = Tabs;
2751
+ return openBlock(), createElementBlock("div", _hoisted_1$3, [
2752
+ createVNode(_component_ATabs, {
2753
+ type: "editable-card",
2754
+ size: "small",
2755
+ animated: false,
2756
+ hideAdd: true,
2757
+ tabBarGutter: 3,
2758
+ activeKey: activeKeyRef.value,
2759
+ onChange: handleChange,
2760
+ onEdit: handleEdit,
2761
+ class: "h-8"
2762
+ }, createSlots({
2763
+ default: withCtx(() => [
2764
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(getTabsState), (item) => {
2765
+ return openBlock(), createBlock(_component_ATabPane, {
2766
+ key: item.query ? item.fullPath : item.path,
2767
+ closable: !(item && item.meta && item.meta.affix)
2768
+ }, {
2769
+ tab: withCtx(() => [
2770
+ createElementVNode("span", null, toDisplayString(unref(menuLabelMap).get(item.path) || unref(t)("UNKNOWN_ROUTE")), 1)
2771
+ ]),
2772
+ _: 2
2773
+ }, 1032, ["closable"]);
2774
+ }), 128))
2775
+ ]),
2776
+ _: 2
2777
+ }, [
2778
+ unref(getShowRedo) || unref(getShowQuick) ? {
2779
+ name: "rightExtra",
2780
+ fn: withCtx(() => [
2781
+ unref(getShowRedo) ? (openBlock(), createBlock(unref(_sfc_main$6), { key: 0 })) : createCommentVNode("", true),
2782
+ unref(getShowQuick) ? (openBlock(), createBlock(unref(_sfc_main$5), { key: 1 })) : createCommentVNode("", true)
2783
+ ]),
2784
+ key: "0"
2785
+ } : void 0
2786
+ ]), 1032, ["activeKey"])
2787
+ ]);
2788
+ };
2789
+ }
2790
+ });
2791
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2792
+ __name: "multiple-header",
2793
+ setup(__props) {
2794
+ const {
2795
+ getHeaderHeight,
2796
+ getFixed,
2797
+ getShowFullHeaderRef,
2798
+ getHeaderTheme,
2799
+ getShowInsetHeaderRef,
2800
+ getTabsHeight
2801
+ } = useHeader();
2802
+ const { getCalcContentWidth, getIsMixMode, getIsTopMenu, getSplit } = useMenu();
2803
+ const { getShowMultipleTab } = useMultipleTab();
2804
+ const getPlaceholderDomStyle = computed(() => {
2805
+ let height = unref(getHeaderHeight);
2806
+ if (unref(getIsMixMode)) {
2807
+ height = unref(getShowMultipleTab) ? unref(getTabsHeight) : 0;
2808
+ }
2809
+ return {
2810
+ height: `${height}px`
2811
+ };
2812
+ });
2813
+ const getSplitType = computed(() => {
2814
+ return unref(getSplit) ? MenuSplitTye.LEFT : MenuSplitTye.NONE;
2815
+ });
2816
+ const { menusRef } = useSplitMenu(getSplitType);
2817
+ const getWrapStyle = computed(() => {
2818
+ const style = {};
2819
+ if (unref(getSplit) && !unref(menusRef)?.length) {
2820
+ style.width = "100%";
2821
+ } else if (unref(getFixed)) {
2822
+ style.width = unref(getCalcContentWidth);
2823
+ }
2824
+ if (unref(getShowFullHeaderRef))
2825
+ style.top = "48px";
2826
+ return style;
2827
+ });
2828
+ const getClass = computed(() => {
2829
+ let cls = "transition-width duration-200 flex-auto";
2830
+ if (unref(getFixed)) {
2831
+ cls += " fixed top-0 right-0 w-full";
2832
+ }
2833
+ return cls;
2834
+ });
2835
+ return (_ctx, _cache) => {
2836
+ return openBlock(), createElementBlock("div", null, [
2837
+ unref(getFixed) ? (openBlock(), createElementBlock("div", {
2838
+ key: 0,
2839
+ style: normalizeStyle(unref(getPlaceholderDomStyle))
2840
+ }, null, 4)) : createCommentVNode("", true),
2841
+ createElementVNode("div", {
2842
+ style: normalizeStyle(unref(getWrapStyle)),
2843
+ class: normalizeClass(unref(getClass))
2844
+ }, [
2845
+ unref(getShowInsetHeaderRef) ? (openBlock(), createBlock(_sfc_main$a, { key: 0 })) : createCommentVNode("", true),
2846
+ unref(getShowMultipleTab) ? (openBlock(), createBlock(_sfc_main$4, { key: 1 })) : createCommentVNode("", true)
2847
+ ], 6)
2848
+ ]);
2849
+ };
2850
+ }
2851
+ });
2852
+ const _hoisted_1$2 = { class: "pr-2.5" };
2853
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2854
+ __name: "index",
2855
+ setup(__props) {
2856
+ const { getFooter } = useTheme();
2857
+ const { title, subTitle, height } = unref(getFooter);
2858
+ const footerOptions = computed(() => {
2859
+ return {
2860
+ lineHeight: `${height - 1}px`,
2861
+ height: `${height}px`,
2862
+ padding: "0",
2863
+ width: `100%`,
2864
+ color: "rgb(156,163,175)"
2865
+ };
2866
+ });
2867
+ return (_ctx, _cache) => {
2868
+ return openBlock(), createBlock(unref(LayoutFooter), {
2869
+ class: "text-center p-0 w-full block border-t border-gray-200",
2870
+ style: normalizeStyle(unref(footerOptions))
2871
+ }, {
2872
+ default: withCtx(() => [
2873
+ createElementVNode("span", _hoisted_1$2, toDisplayString(unref(title)), 1),
2874
+ createElementVNode("span", null, toDisplayString(unref(subTitle)), 1)
2875
+ ]),
2876
+ _: 1
2877
+ }, 8, ["style"]);
2878
+ };
2879
+ }
2880
+ });
2881
+ const _hoisted_1$1 = ["loading"];
2882
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2883
+ __name: "index",
2884
+ setup(__props) {
2885
+ const { getTransitionMode } = useApp();
2886
+ const { getLayoutContentMode, getPageLoading, getOpenPageLoading } = useTheme();
2887
+ const { getCanCache } = useMultipleTab();
2888
+ const tabStore = useRouteReuseStore();
2889
+ function getTransitionName(route) {
2890
+ return route.meta.transitionName || unref(getTransitionMode);
2891
+ }
2892
+ const getCaches = computed(() => {
2893
+ return tabStore.getCachedTabList;
2894
+ });
2895
+ return (_ctx, _cache) => {
2896
+ const _component_router_view = resolveComponent("router-view");
2897
+ const _component_ALayoutContent = LayoutContent;
2898
+ return openBlock(), createElementBlock("div", {
2899
+ id: "dt-layout-content",
2900
+ class: normalizeClass([["dt-layout-content", unref(getLayoutContentMode)], "relative flex-auto overflow-x-hidden min-h-0 flex"]),
2901
+ loading: unref(getPageLoading) && unref(getOpenPageLoading)
2902
+ }, [
2903
+ createVNode(_component_ALayoutContent, null, {
2904
+ default: withCtx(() => [
2905
+ createVNode(_component_router_view, null, {
2906
+ default: withCtx(({ Component, route }) => [
2907
+ createVNode(Transition, {
2908
+ name: getTransitionName(route)
2909
+ }, {
2910
+ default: withCtx(() => [
2911
+ !route.meta.hideTab && unref(getCanCache) ? (openBlock(), createBlock(KeepAlive, {
2912
+ key: 0,
2913
+ include: unref(getCaches)
2914
+ }, [
2915
+ (openBlock(), createBlock(resolveDynamicComponent(Component), {
2916
+ key: route.path
2917
+ }))
2918
+ ], 1032, ["include"])) : (openBlock(), createBlock(resolveDynamicComponent(Component), { key: 1 }))
2919
+ ]),
2920
+ _: 2
2921
+ }, 1032, ["name"])
2922
+ ]),
2923
+ _: 1
2924
+ })
2925
+ ]),
2926
+ _: 1
2927
+ })
2928
+ ], 10, _hoisted_1$1);
2929
+ };
2930
+ }
2931
+ });
2932
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
2933
+ var zhCn = { exports: {} };
2934
+ (function(module, exports) {
2935
+ !function(e, _) {
2936
+ module.exports = _(require$$0);
2937
+ }(commonjsGlobal, function(e) {
2938
+ function _(e2) {
2939
+ return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
2940
+ }
2941
+ var t = _(e), d = { name: "zh-cn", weekdays: "\u661F\u671F\u65E5_\u661F\u671F\u4E00_\u661F\u671F\u4E8C_\u661F\u671F\u4E09_\u661F\u671F\u56DB_\u661F\u671F\u4E94_\u661F\u671F\u516D".split("_"), weekdaysShort: "\u5468\u65E5_\u5468\u4E00_\u5468\u4E8C_\u5468\u4E09_\u5468\u56DB_\u5468\u4E94_\u5468\u516D".split("_"), weekdaysMin: "\u65E5_\u4E00_\u4E8C_\u4E09_\u56DB_\u4E94_\u516D".split("_"), months: "\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u56DB\u6708_\u4E94\u6708_\u516D\u6708_\u4E03\u6708_\u516B\u6708_\u4E5D\u6708_\u5341\u6708_\u5341\u4E00\u6708_\u5341\u4E8C\u6708".split("_"), monthsShort: "1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"), ordinal: function(e2, _2) {
2942
+ return "W" === _2 ? e2 + "\u5468" : e2 + "\u65E5";
2943
+ }, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY\u5E74M\u6708D\u65E5", LLL: "YYYY\u5E74M\u6708D\u65E5Ah\u70B9mm\u5206", LLLL: "YYYY\u5E74M\u6708D\u65E5ddddAh\u70B9mm\u5206", l: "YYYY/M/D", ll: "YYYY\u5E74M\u6708D\u65E5", lll: "YYYY\u5E74M\u6708D\u65E5 HH:mm", llll: "YYYY\u5E74M\u6708D\u65E5dddd HH:mm" }, relativeTime: { future: "%s\u5185", past: "%s\u524D", s: "\u51E0\u79D2", m: "1 \u5206\u949F", mm: "%d \u5206\u949F", h: "1 \u5C0F\u65F6", hh: "%d \u5C0F\u65F6", d: "1 \u5929", dd: "%d \u5929", M: "1 \u4E2A\u6708", MM: "%d \u4E2A\u6708", y: "1 \u5E74", yy: "%d \u5E74" }, meridiem: function(e2, _2) {
2944
+ var t2 = 100 * e2 + _2;
2945
+ return t2 < 600 ? "\u51CC\u6668" : t2 < 900 ? "\u65E9\u4E0A" : t2 < 1100 ? "\u4E0A\u5348" : t2 < 1300 ? "\u4E2D\u5348" : t2 < 1800 ? "\u4E0B\u5348" : "\u665A\u4E0A";
2946
+ } };
2947
+ return t.default.locale(d, null, true), d;
2948
+ });
2949
+ })(zhCn);
2950
+ var esUs = { exports: {} };
2951
+ (function(module, exports) {
2952
+ !function(e, s) {
2953
+ module.exports = s(require$$0);
2954
+ }(commonjsGlobal, function(e) {
2955
+ function s(e2) {
2956
+ return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
2957
+ }
2958
+ var o = s(e), d = { name: "es-us", weekdays: "domingo_lunes_martes_mi\xE9rcoles_jueves_viernes_s\xE1bado".split("_"), weekdaysShort: "dom._lun._mar._mi\xE9._jue._vie._s\xE1b.".split("_"), weekdaysMin: "do_lu_ma_mi_ju_vi_s\xE1".split("_"), months: "enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"), monthsShort: "ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"), relativeTime: { future: "en %s", past: "hace %s", s: "unos segundos", m: "un minuto", mm: "%d minutos", h: "una hora", hh: "%d horas", d: "un d\xEDa", dd: "%d d\xEDas", M: "un mes", MM: "%d meses", y: "un a\xF1o", yy: "%d a\xF1os" }, ordinal: function(e2) {
2959
+ return e2 + "\xBA";
2960
+ }, formats: { LT: "h:mm A", LTS: "h:mm:ss A", L: "MM/DD/YYYY", LL: "D [de] MMMM [de] YYYY", LLL: "D [de] MMMM [de] YYYY h:mm A", LLLL: "dddd, D [de] MMMM [de] YYYY h:mm A" } };
2961
+ return o.default.locale(d, null, true), d;
2962
+ });
2963
+ })(esUs);
2964
+ const _hoisted_1 = { class: "dt-theme w-full h-full" };
2965
+ const _sfc_main = /* @__PURE__ */ defineComponent({
2966
+ __name: "index",
2967
+ setup(__props) {
2968
+ const { currentRoute } = useRouter();
2969
+ const { getShowFullHeaderRef, getIsZH, getHeaderHeight, getUiSize } = useHeader();
2970
+ const { getSplit, getShowMenu, getShowSidebar } = useMenu();
2971
+ const { getFooter, getShowFooter } = useTheme();
2972
+ const { height } = unref(getFooter);
2973
+ require$$0.locale(unref(getIsZH) ? "zh-cn" : "en");
2974
+ const layoutClass = computed(() => {
2975
+ let cls = "ant-layout";
2976
+ if (unref(getShowMenu)) {
2977
+ cls += " flex flex-auto min-h-0 flex-row";
2978
+ }
2979
+ return cls;
2980
+ });
2981
+ const layoutOption = computed(() => {
2982
+ if (unref(getSplit)) {
2983
+ return {
2984
+ paddingTop: unref(getHeaderHeight) + "px",
2985
+ background: "#f0f2f5"
2986
+ };
2987
+ }
2988
+ });
2989
+ const getContentStyle = computed(() => {
2990
+ return {
2991
+ flex: unref(getSplit) ? `0 0 calc(100% - ${unref(getShowFooter) || 0}px)` : `0 0 calc(100% - ${unref(getShowFooter) ? height : 0}px - ${unref(getHeaderHeight)}px)`,
2992
+ overflowY: "auto"
2993
+ };
2994
+ });
2995
+ return (_ctx, _cache) => {
2996
+ const _component_ALayout = Layout;
2997
+ const _component_AConfigProvider = ConfigProvider;
2998
+ return openBlock(), createElementBlock("div", _hoisted_1, [
2999
+ createVNode(_component_AConfigProvider, {
3000
+ locale: unref(getIsZH) ? unref(zhCN) : unref(en),
3001
+ "component-size": unref(getUiSize)
3002
+ }, {
3003
+ default: withCtx(() => [
3004
+ unref(currentRoute)?.name && unref(currentRoute).meta?.requiresAuth !== false ? (openBlock(), createBlock(_component_ALayout, {
3005
+ key: 0,
3006
+ class: "w-full h-full flex"
3007
+ }, {
3008
+ default: withCtx(() => [
3009
+ createVNode(_sfc_main$x),
3010
+ unref(getShowFullHeaderRef) ? (openBlock(), createBlock(_sfc_main$a, {
3011
+ key: 0,
3012
+ fixed: ""
3013
+ })) : createCommentVNode("", true),
3014
+ createVNode(_component_ALayout, {
3015
+ class: normalizeClass(unref(layoutClass)),
3016
+ style: normalizeStyle(unref(layoutOption))
3017
+ }, {
3018
+ default: withCtx(() => [
3019
+ unref(getShowSidebar) ? (openBlock(), createBlock(_sfc_main$7, { key: 0 })) : createCommentVNode("", true),
3020
+ createVNode(_component_ALayout, { class: "dt-theme-main flex w-full h-ful" }, {
3021
+ default: withCtx(() => [
3022
+ createVNode(_sfc_main$3),
3023
+ createVNode(_sfc_main$1, {
3024
+ style: normalizeStyle(unref(getContentStyle))
3025
+ }, null, 8, ["style"]),
3026
+ unref(getFooter) && unref(getFooter)["show"] ? (openBlock(), createBlock(_sfc_main$2, { key: 0 })) : createCommentVNode("", true)
3027
+ ]),
3028
+ _: 1
3029
+ })
3030
+ ]),
3031
+ _: 1
3032
+ }, 8, ["class", "style"])
3033
+ ]),
3034
+ _: 1
3035
+ })) : (openBlock(), createBlock(unref(RouterView), { key: 1 }))
3036
+ ]),
3037
+ _: 1
3038
+ }, 8, ["locale", "component-size"])
3039
+ ]);
3040
+ };
3041
+ }
3042
+ });
3043
+ const EN = {
3044
+ "UI": {
3045
+ "ADD": "Add ",
3046
+ "DELETE_CONFIRM": "Delete Confirm",
3047
+ "CONFIRM_DELETE": "Confirm that you want to delete the selected data\uFF1F",
3048
+ "NEED_CURD": "Missing curd function configuration, pass the curd parameter returned by useSource to the useCurd configuration option!",
3049
+ "EDIT": "Edit ",
3050
+ "EMPTY": "No Selected Data Yet!",
3051
+ "EMPTY_URL": "Request Url Can Not Empty!",
3052
+ "MULTIFY_DELETE_CONFIRM": "Batch Deletion Confirmation",
3053
+ "CONFIRM_MULTIFY_DELETE": "Confirm that you want to delete the selected data in batches?",
3054
+ "ADVANCED": "Retract",
3055
+ "EXPAND": "Expand",
3056
+ "SELECT_ICON": "Select Icon",
3057
+ "MUSE_FUNCTION": "openDialog must be a fouction",
3058
+ "NEED_RENDER": "Configure the render function",
3059
+ "SEARCH": "Search",
3060
+ "RESET": "Reset",
3061
+ "PLEASE_INPUT": "Please Input",
3062
+ "PLEASE_SELECT": "Please Select",
3063
+ "PLEASE_SET_ICON": "Please Set The Icon",
3064
+ "INPUT_FILTER": "Enter Filter Criteria",
3065
+ "EXIT_FULLSCREEN": "Exit Full Screen",
3066
+ "FULLSCREEN": "Full Screen",
3067
+ "SAVE": "Save",
3068
+ "CLOSE": "Close",
3069
+ "ADD_SUCCESS": "Add Success!",
3070
+ "UPDATE_SUCCESS": "Update data successfully!",
3071
+ "MULTIFY": "Batch",
3072
+ "DELETE_SUCCESS": "Successfully delete!",
3073
+ "COLUMN_CONTROL": "Column Control",
3074
+ "COLUMN_SHOW": "Column Show",
3075
+ "INDEX": "Serial Number",
3076
+ "CHECKBOX": "Checkbox",
3077
+ "FIXED_TO_LEFT": "Fixed to the left",
3078
+ "FIXED_TO_RIGHT": "Fixed to the right",
3079
+ "EXPORT": "Export",
3080
+ "EXPORT_CURRENT_PAGE": "Export the current page",
3081
+ "EXPORT_SELECT_COLUMN": "Export Selected columns",
3082
+ "EXPORT_ALL": "Export all columns",
3083
+ "SELECT_ALL": "Select All",
3084
+ "SETTING_EXPORT_COLUMN": "Setting the export column",
3085
+ "NO_EXPORT_COLUMN": "There are no exported columns!",
3086
+ "NUMBER": "Number",
3087
+ "ACTIONS": "Actions",
3088
+ "TOTAL_PAGE": "Total {total}",
3089
+ "FILTER": "Filter",
3090
+ "EXPAND_ALL": "Expand All",
3091
+ "COLLAPSE_ALL": "Collapse All",
3092
+ "SELECT_ALL1": "Select All",
3093
+ "CANCEL_SELECT_ALL": "Cancel Select All",
3094
+ "LEVEL_CONNECTION": "Level Connection",
3095
+ "LEVEL_SOLATE": "Independent Hierarchy",
3096
+ "LOADING": "Loading...",
3097
+ "SUPPORT_FILES": "Support {message} format",
3098
+ "MAX_SIZE": "Not exceeding {maxSize}M",
3099
+ "MAX_NUMBER": "A maximum of {maxNumber} files can be selected",
3100
+ "SUPPORT_TYPES": "Upload Types: pptx\u3001doc\u3001jpg\u3001jpeg\u3001png\u3001bmp\u3001gif\u3001xls\u3001xlsx\u3001txt\u3001rar\u3001zip\u30017z\u3001tar\u3001gz",
3101
+ "FILE_UPLOAD": "Files Upload",
3102
+ "FILE_NAME": "File Name",
3103
+ "FILE_STATUS": "Upload Status",
3104
+ "PREVIEW": "Preview",
3105
+ "DELETE": "Delete",
3106
+ "HISTORY_UPLOAD": "History Upload",
3107
+ "MAX_MB": "Only files up to {maxSize}MB can be uploaded!",
3108
+ "PRE_UPLOAD": "To Upload",
3109
+ "COMPANY_NAME": "Longi Co overseas tax system",
3110
+ "FILTER_MORE": "Menu Search...",
3111
+ "LARGE_SIZE": "Large Size",
3112
+ "MIDDLE_SIZE": "Middle Size",
3113
+ "SMALL_SIZE": "Small Size",
3114
+ "MODIFY_PASSWORD": "Modify Password",
3115
+ "LOGIN_OUT": "Log out",
3116
+ "CLOSE_CURRENT_TAG": "Close the current tab",
3117
+ "CLOSE_LEFT_TAGS": "Close the left tab",
3118
+ "CLOSE_RIGHT_TAGS": "Close the right tab",
3119
+ "CLOSE_OTHER_TAGS": "Close other tabs",
3120
+ "CLOSE_ALL_TAGE": "Close All",
3121
+ "SETTING_THEME": "Style Settings",
3122
+ "PROJECT_SETTING": "Project Configuration",
3123
+ "NAV_MODE": "Navigation bar mode",
3124
+ "PAGE_SHOW": "Interface Display",
3125
+ "COPY": "Copy",
3126
+ "DRAWER_TIPS": "The function mainly real-time preview layout effect, more complete configuration in the SRC/core/Settings/theme.ts. The layout preview function will be turned off in production.",
3127
+ "FULL": "Flow-based",
3128
+ "FIXED": "Fixed width",
3129
+ "BREAD_CURB": "Bread crumbs",
3130
+ "MENU_FILTER": "Menu search",
3131
+ "NOTICE": "Notification",
3132
+ "SIZE": "Size",
3133
+ "SHOW_FULLE": "Page full screen",
3134
+ "LOCAL": "Internationalization",
3135
+ "ROUTE_REUSE": "Routing reuse",
3136
+ "SHOW_FOOTER": "Show Footer",
3137
+ "CONTENT_FIXED_WIDTH": "Content area width",
3138
+ "ON": "On",
3139
+ "OFF": "Off",
3140
+ "UNKNOWN_ROUTE": "Unknown route",
3141
+ "COPY_SUCCESS": "Copy Success\uFF01"
3142
+ }
3143
+ };
3144
+ const ZH = {
3145
+ "UI": {
3146
+ "ADD": "\u65B0\u589E",
3147
+ "DELETE_CONFIRM": "\u5220\u9664\u786E\u8BA4",
3148
+ "CONFIRM_DELETE": "\u786E\u8BA4\u8981\u5220\u9664\u9009\u4E2D\u7684\u6570\u636E\uFF1F",
3149
+ "NEED_CURD": "\u7F3A\u5C11curd\u51FD\u6570\u914D\u7F6E, \u8BF7\u5C06useSource\u4E2D\u8FD4\u56DE\u7684curd\u53C2\u6570\u4F20\u5165useCurd\u914D\u7F6E\u9879\u4E2D!",
3150
+ "EDIT": "\u7F16\u8F91",
3151
+ "EMPTY": "\u6682\u65E0\u9009\u4E2D\u7684\u6570\u636E!",
3152
+ "EMPTY_URL": "\u8BF7\u6C42url\u4E0D\u80FD\u4E3A\u7A7A!",
3153
+ "MULTIFY_DELETE_CONFIRM": "\u6279\u91CF\u5220\u9664\u786E\u8BA4",
3154
+ "CONFIRM_MULTIFY_DELETE": "\u786E\u8BA4\u8981\u6279\u91CF\u5220\u9664\u9009\u4E2D\u7684\u6570\u636E\uFF1F",
3155
+ "ADVANCED": "\u6536\u8D77",
3156
+ "EXPAND": "\u5C55\u5F00",
3157
+ "SELECT_ICON": "\u9009\u62E9\u5B57\u4F53\u56FE\u6807",
3158
+ "MUSE_FUNCTION": "openDialog\u5FC5\u987B\u662F\u51FD\u6570",
3159
+ "NEED_RENDER": "\u8BF7\u914D\u7F6Erender\u51FD\u6570",
3160
+ "SEARCH": "\u67E5\u8BE2",
3161
+ "RESET": "\u91CD\u7F6E",
3162
+ "PLEASE_INPUT": "\u8BF7\u8F93\u5165",
3163
+ "PLEASE_SELECT": "\u8BF7\u9009\u62E9",
3164
+ "PLEASE_SET_ICON": "\u8BF7\u8BBE\u7F6E\u56FE\u6807",
3165
+ "INPUT_FILTER": "\u8BF7\u8F93\u5165\u8FC7\u6EE4\u6761\u4EF6",
3166
+ "EXIT_FULLSCREEN": "\u9000\u51FA\u5168\u5C4F",
3167
+ "FULLSCREEN": "\u5168\u5C4F",
3168
+ "SAVE": "\u4FDD\u5B58",
3169
+ "CLOSE": "\u5173\u95ED",
3170
+ "ADD_SUCCESS": "\u65B0\u589E\u6210\u529F\uFF01",
3171
+ "UPDATE_SUCCESS": "\u66F4\u65B0\u6570\u636E\u6210\u529F\uFF01",
3172
+ "MULTIFY": "\u6279\u91CF",
3173
+ "DELETE_SUCCESS": "\u5220\u9664\u6210\u529F\uFF01",
3174
+ "COLUMN_CONTROL": "\u5217\u63A7\u5236",
3175
+ "COLUMN_SHOW": "\u5217\u5C55\u793A",
3176
+ "INDEX": "\u5E8F\u5217\u53F7",
3177
+ "CHECKBOX": "\u590D\u9009\u6846",
3178
+ "FIXED_TO_LEFT": "\u56FA\u5B9A\u5230\u5DE6\u4FA7",
3179
+ "FIXED_TO_RIGHT": "\u56FA\u5B9A\u5230\u53F3\u4FA7",
3180
+ "EXPORT": "\u5BFC\u51FA",
3181
+ "DOWNLOAD_TEMPLATE": "\u6A21\u677F\u4E0B\u8F7D",
3182
+ "EXPORT_CURRENT_PAGE": "\u5BFC\u51FA\u5F53\u524D\u9875",
3183
+ "EXPORT_SELECT_COLUMN": "\u5BFC\u51FA\u9009\u4E2D\u5217",
3184
+ "EXPORT_ALL": "\u5BFC\u51FA\u6240\u6709\u5217",
3185
+ "SELECT_ALL": "\u5168\u9009",
3186
+ "SETTING_EXPORT_COLUMN": "\u8BBE\u7F6E\u5BFC\u51FA\u5217",
3187
+ "NO_EXPORT_COLUMN": "\u6682\u65E0\u53EF\u5BFC\u51FA\u7684\u5217\uFF01",
3188
+ "NUMBER": "\u5E8F\u53F7",
3189
+ "ACTIONS": "\u64CD\u4F5C",
3190
+ "TOTAL_PAGE": "\u603B\u5171{total}\u6761",
3191
+ "FILTER": "\u8FC7\u6EE4",
3192
+ "EXPAND_ALL": "\u5C55\u5F00\u5168\u90E8",
3193
+ "COLLAPSE_ALL": "\u6298\u53E0\u5168\u90E8",
3194
+ "SELECT_ALL1": "\u9009\u62E9\u5168\u90E8",
3195
+ "CANCEL_SELECT_ALL": "\u53D6\u6D88\u9009\u62E9",
3196
+ "LEVEL_CONNECTION": "\u5C42\u7EA7\u5173\u8054",
3197
+ "LEVEL_SOLATE": "\u5C42\u7EA7\u72EC\u7ACB",
3198
+ "LOADING": "\u52A0\u8F7D\u4E2D...",
3199
+ "SUPPORT_FILES": "\u652F\u6301{message}\u683C\u5F0F",
3200
+ "MAX_SIZE": "\u4E0D\u8D85\u8FC7{maxSize}M",
3201
+ "MAX_NUMBER": "\u6700\u591A\u53EF\u9009\u62E9{maxNumber}\u4E2A\u6587\u4EF6",
3202
+ "SUPPORT_TYPES": "\u8BF7\u4E0A\u4F20pptx\u3001doc\u3001jpg\u3001jpeg\u3001png\u3001bmp\u3001gif\u3001xls\u3001xlsx\u3001txt\u3001rar\u3001zip\u30017z\u3001tar\u3001gz\u683C\u5F0F\u6587\u4EF6",
3203
+ "FILE_UPLOAD": "\u6587\u4EF6\u4E0A\u4F20",
3204
+ "FILE_NAME": "\u6587\u4EF6\u540D\u79F0",
3205
+ "FILE_STATUS": "\u4E0A\u4F20\u72B6\u6001",
3206
+ "PREVIEW": "\u9884\u89C8",
3207
+ "DELETE": "\u5220\u9664",
3208
+ "HISTORY_UPLOAD": "\u5386\u53F2\u4E0A\u4F20",
3209
+ "MAX_MB": "\u53EA\u80FD\u4E0A\u4F20\u4E0D\u8D85\u8FC7{maxSize}MB\u7684\u6587\u4EF6!",
3210
+ "PRE_UPLOAD": "\u5F85\u4E0A\u4F20",
3211
+ "COMPANY_NAME": "\u5B89\u5FBD\u6DF1\u8FEA\u4E2D\u53F0\u7CFB\u7EDF\u6A21\u677F",
3212
+ "FILTER_MORE": "\u83DC\u5355\u68C0\u7D22...",
3213
+ "LARGE_SIZE": "\u5927\u5C3A\u5BF8",
3214
+ "MIDDLE_SIZE": "\u4E2D\u5C3A\u5BF8",
3215
+ "SMALL_SIZE": "\u5C0F\u5C3A\u5BF8",
3216
+ "MODIFY_PASSWORD": "\u4FEE\u6539\u5BC6\u7801",
3217
+ "LOGIN_OUT": "\u9000\u51FA\u7CFB\u7EDF",
3218
+ "CLOSE_CURRENT_TAG": "\u5173\u95ED\u5F53\u524D\u6807\u7B7E\u9875",
3219
+ "CLOSE_LEFT_TAGS": "\u5173\u95ED\u5DE6\u4FA7\u6807\u7B7E\u9875",
3220
+ "CLOSE_RIGHT_TAGS": "\u5173\u95ED\u53F3\u4FA7\u6807\u7B7E\u9875",
3221
+ "CLOSE_OTHER_TAGS": "\u5173\u95ED\u5176\u4ED6\u6807\u7B7E\u9875",
3222
+ "CLOSE_ALL_TAGE": "\u5173\u95ED\u5168\u90E8\u6807\u7B7E\u9875",
3223
+ "SETTING_THEME": "\u98CE\u683C\u8BBE\u7F6E",
3224
+ "PROJECT_SETTING": "\u9879\u76EE\u914D\u7F6E",
3225
+ "NAV_MODE": "\u5BFC\u822A\u680F\u6A21\u5F0F",
3226
+ "PAGE_SHOW": "\u754C\u9762\u663E\u793A",
3227
+ "COPY": "\u62F7\u8D1D",
3228
+ "DRAWER_TIPS": "\u8BE5\u529F\u80FD\u4E3B\u8981\u5B9E\u65F6\u9884\u89C8\u5404\u79CD\u5E03\u5C40\u6548\u679C\uFF0C\u66F4\u591A\u5B8C\u6574\u914D\u7F6E\u5728 src/core/settings/theme.ts \u4E2D\u8BBE\u7F6E\uFF0C\u5728\u751F\u4EA7\u73AF\u5883\u8BE5\u5E03\u5C40\u9884\u89C8\u529F\u80FD\u5C06\u88AB\u5173\u95ED\u3002",
3229
+ "FULL": "\u6D41\u5F0F",
3230
+ "FIXED": "\u5B9A\u5BBD",
3231
+ "BREAD_CURB": "\u9762\u5305\u5C51",
3232
+ "MENU_FILTER": "\u83DC\u5355\u68C0\u7D22",
3233
+ "NOTICE": "\u901A\u77E5\u516C\u544A",
3234
+ "SIZE": "\u5143\u7D20\u5C3A\u5BF8",
3235
+ "SHOW_FULLE": "\u9875\u9762\u5168\u5C4F",
3236
+ "LOCAL": "\u56FD\u9645\u5316",
3237
+ "ROUTE_REUSE": "\u8DEF\u7531\u590D\u7528",
3238
+ "SHOW_FOOTER": "\u663E\u793A\u5E95\u90E8",
3239
+ "CONTENT_FIXED_WIDTH": "\u5185\u5BB9\u533A\u57DF\u5BBD\u5EA6",
3240
+ "ON": "\u5F00",
3241
+ "OFF": "\u5173",
3242
+ "DOWNLOAD": "\u4E0B\u8F7D",
3243
+ "UNKNOWN_ROUTE": "\u672A\u77E5\u8DEF\u7531",
3244
+ "COPY_SUCCESS": "\u62F7\u8D1D\u6210\u529F\uFF01"
3245
+ }
3246
+ };
3247
+ const uiLang = (lang) => lang === Language.ZH ? ZH : EN;
3248
+ const DtTheme = withInstall$1(_sfc_main);
3249
+ export {
3250
+ DtTheme,
3251
+ defaultThemeConf,
3252
+ uiLang,
3253
+ useRouteReuseStore,
3254
+ useThemeStore
3255
+ };