@fmdeui/fmui 1.0.28 → 1.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/es/component.mjs +3 -1
  2. package/es/components/fm-layout/index.d.ts +32 -0
  3. package/es/components/fm-layout/src/component/aside.vue.d.ts +5 -0
  4. package/es/components/fm-layout/src/component/columnsAside.vue.d.ts +5 -0
  5. package/es/components/fm-layout/src/component/header.vue.d.ts +16 -0
  6. package/es/components/fm-layout/src/component/main.vue.d.ts +7 -0
  7. package/es/components/fm-layout/src/footer/index.vue.d.ts +3 -0
  8. package/es/components/fm-layout/src/index.vue.d.ts +22 -0
  9. package/es/components/fm-layout/src/logo/index.vue.d.ts +3 -0
  10. package/es/components/fm-layout/src/main/classic.vue.d.ts +18 -0
  11. package/es/components/fm-layout/src/main/columns.vue.d.ts +19 -0
  12. package/es/components/fm-layout/src/main/defaults.vue.d.ts +48 -0
  13. package/es/components/fm-layout/src/main/transverse.vue.d.ts +18 -0
  14. package/es/components/fm-layout/src/navBars/index.vue.d.ts +16 -0
  15. package/es/components/fm-layout/src/navBars/tagsView/contextmenu.vue.d.ts +28 -0
  16. package/es/components/fm-layout/src/navBars/tagsView/tagsView.vue.d.ts +45 -0
  17. package/es/components/fm-layout/src/navBars/topBar/breadcrumb.vue.d.ts +3 -0
  18. package/es/components/fm-layout/src/navBars/topBar/index.vue.d.ts +16 -0
  19. package/es/components/fm-layout/src/navBars/topBar/search.vue.d.ts +7 -0
  20. package/es/components/fm-layout/src/navBars/topBar/upgradeInfo.vue.d.ts +5 -0
  21. package/es/components/fm-layout/src/navBars/topBar/user.vue.d.ts +75 -0
  22. package/es/components/fm-layout/src/navBars/topBar/userNews.vue.d.ts +9 -0
  23. package/es/components/fm-layout/src/navMenu/horizontal.vue.d.ts +42 -0
  24. package/es/components/fm-layout/src/navMenu/subItem.vue.d.ts +42 -0
  25. package/es/components/fm-layout/src/navMenu/vertical.vue.d.ts +42 -0
  26. package/es/components/fm-layout/src/routerView/iframes.vue.d.ts +35 -0
  27. package/es/components/fm-layout/src/routerView/parent.vue.d.ts +3 -0
  28. package/es/components/fm-layout/src/type.d.ts +2 -0
  29. package/es/components/fm-layout/style/css.d.ts +0 -0
  30. package/es/components/fm-layout/style/index.d.ts +0 -0
  31. package/es/components/index.d.ts +1 -0
  32. package/es/packages/components/fm-layout/index.mjs +7 -0
  33. package/es/packages/components/fm-layout/src/component/aside.vue.mjs +5 -0
  34. package/es/packages/components/fm-layout/src/component/aside.vue2.mjs +175 -0
  35. package/es/packages/components/fm-layout/src/component/columnsAside.vue.mjs +5 -0
  36. package/es/packages/components/fm-layout/src/component/columnsAside.vue2.mjs +273 -0
  37. package/es/packages/components/fm-layout/src/component/header.vue.mjs +5 -0
  38. package/es/packages/components/fm-layout/src/component/header.vue2.mjs +50 -0
  39. package/es/packages/components/fm-layout/src/component/main.vue.mjs +5 -0
  40. package/es/packages/components/fm-layout/src/component/main.vue2.mjs +81 -0
  41. package/es/packages/components/fm-layout/src/footer/index.vue.mjs +5 -0
  42. package/es/packages/components/fm-layout/src/footer/index.vue2.mjs +29 -0
  43. package/es/packages/components/fm-layout/src/index.vue.mjs +5 -0
  44. package/es/packages/components/fm-layout/src/index.vue2.mjs +91 -0
  45. package/es/packages/components/fm-layout/src/logo/index.vue.mjs +5 -0
  46. package/es/packages/components/fm-layout/src/logo/index.vue2.mjs +57 -0
  47. package/es/packages/components/fm-layout/src/main/classic.vue.mjs +5 -0
  48. package/es/packages/components/fm-layout/src/main/classic.vue2.mjs +87 -0
  49. package/es/packages/components/fm-layout/src/main/columns.vue.mjs +5 -0
  50. package/es/packages/components/fm-layout/src/main/columns.vue2.mjs +100 -0
  51. package/es/packages/components/fm-layout/src/main/defaults.vue.mjs +5 -0
  52. package/es/packages/components/fm-layout/src/main/defaults.vue2.mjs +153 -0
  53. package/es/packages/components/fm-layout/src/main/transverse.vue.mjs +5 -0
  54. package/es/packages/components/fm-layout/src/main/transverse.vue2.mjs +70 -0
  55. package/es/packages/components/fm-layout/src/navBars/index.vue.mjs +5 -0
  56. package/es/packages/components/fm-layout/src/navBars/index.vue2.mjs +44 -0
  57. package/es/packages/components/fm-layout/src/navBars/tagsView/contextmenu.vue.mjs +5 -0
  58. package/es/packages/components/fm-layout/src/navBars/tagsView/contextmenu.vue2.mjs +156 -0
  59. package/es/packages/components/fm-layout/src/navBars/tagsView/tagsView.vue.mjs +5 -0
  60. package/es/packages/components/fm-layout/src/navBars/tagsView/tagsView.vue2.mjs +576 -0
  61. package/es/packages/components/fm-layout/src/navBars/topBar/breadcrumb.vue.mjs +5 -0
  62. package/es/packages/components/fm-layout/src/navBars/topBar/breadcrumb.vue2.mjs +169 -0
  63. package/es/packages/components/fm-layout/src/navBars/topBar/index.vue.mjs +5 -0
  64. package/es/packages/components/fm-layout/src/navBars/topBar/index.vue2.mjs +113 -0
  65. package/es/packages/components/fm-layout/src/navBars/topBar/search.vue.mjs +5 -0
  66. package/es/packages/components/fm-layout/src/navBars/topBar/search.vue2.mjs +120 -0
  67. package/es/packages/components/fm-layout/src/navBars/topBar/upgradeInfo.vue.mjs +5 -0
  68. package/es/packages/components/fm-layout/src/navBars/topBar/upgradeInfo.vue2.mjs +72 -0
  69. package/es/packages/components/fm-layout/src/navBars/topBar/user.vue.mjs +5 -0
  70. package/es/packages/components/fm-layout/src/navBars/topBar/user.vue2.mjs +699 -0
  71. package/es/packages/components/fm-layout/src/navBars/topBar/userNews.vue.mjs +5 -0
  72. package/es/packages/components/fm-layout/src/navBars/topBar/userNews.vue2.mjs +255 -0
  73. package/es/packages/components/fm-layout/src/navMenu/horizontal.vue.mjs +5 -0
  74. package/es/packages/components/fm-layout/src/navMenu/horizontal.vue2.mjs +182 -0
  75. package/es/packages/components/fm-layout/src/navMenu/subItem.vue.mjs +5 -0
  76. package/es/packages/components/fm-layout/src/navMenu/subItem.vue2.mjs +113 -0
  77. package/es/packages/components/fm-layout/src/navMenu/vertical.vue.mjs +5 -0
  78. package/es/packages/components/fm-layout/src/navMenu/vertical.vue2.mjs +159 -0
  79. package/es/packages/components/fm-layout/src/routerView/iframes.vue.mjs +5 -0
  80. package/es/packages/components/fm-layout/src/routerView/iframes.vue2.mjs +128 -0
  81. package/es/packages/components/fm-layout/src/routerView/parent.vue.mjs +5 -0
  82. package/es/packages/components/fm-layout/src/routerView/parent.vue2.mjs +141 -0
  83. package/es/packages/components/fm-layout/src/type.mjs +1 -0
  84. package/es/packages/components/index.mjs +1 -0
  85. package/index.js +4071 -73
  86. package/index.min.js +5 -5
  87. package/index.min.mjs +5 -5
  88. package/index.mjs +4082 -81
  89. package/lib/component.js +3 -1
  90. package/lib/components/fm-layout/index.d.ts +32 -0
  91. package/lib/components/fm-layout/src/component/aside.vue.d.ts +5 -0
  92. package/lib/components/fm-layout/src/component/columnsAside.vue.d.ts +5 -0
  93. package/lib/components/fm-layout/src/component/header.vue.d.ts +16 -0
  94. package/lib/components/fm-layout/src/component/main.vue.d.ts +7 -0
  95. package/lib/components/fm-layout/src/footer/index.vue.d.ts +3 -0
  96. package/lib/components/fm-layout/src/index.vue.d.ts +22 -0
  97. package/lib/components/fm-layout/src/logo/index.vue.d.ts +3 -0
  98. package/lib/components/fm-layout/src/main/classic.vue.d.ts +18 -0
  99. package/lib/components/fm-layout/src/main/columns.vue.d.ts +19 -0
  100. package/lib/components/fm-layout/src/main/defaults.vue.d.ts +48 -0
  101. package/lib/components/fm-layout/src/main/transverse.vue.d.ts +18 -0
  102. package/lib/components/fm-layout/src/navBars/index.vue.d.ts +16 -0
  103. package/lib/components/fm-layout/src/navBars/tagsView/contextmenu.vue.d.ts +28 -0
  104. package/lib/components/fm-layout/src/navBars/tagsView/tagsView.vue.d.ts +45 -0
  105. package/lib/components/fm-layout/src/navBars/topBar/breadcrumb.vue.d.ts +3 -0
  106. package/lib/components/fm-layout/src/navBars/topBar/index.vue.d.ts +16 -0
  107. package/lib/components/fm-layout/src/navBars/topBar/search.vue.d.ts +7 -0
  108. package/lib/components/fm-layout/src/navBars/topBar/upgradeInfo.vue.d.ts +5 -0
  109. package/lib/components/fm-layout/src/navBars/topBar/user.vue.d.ts +75 -0
  110. package/lib/components/fm-layout/src/navBars/topBar/userNews.vue.d.ts +9 -0
  111. package/lib/components/fm-layout/src/navMenu/horizontal.vue.d.ts +42 -0
  112. package/lib/components/fm-layout/src/navMenu/subItem.vue.d.ts +42 -0
  113. package/lib/components/fm-layout/src/navMenu/vertical.vue.d.ts +42 -0
  114. package/lib/components/fm-layout/src/routerView/iframes.vue.d.ts +35 -0
  115. package/lib/components/fm-layout/src/routerView/parent.vue.d.ts +3 -0
  116. package/lib/components/fm-layout/src/type.d.ts +2 -0
  117. package/lib/components/fm-layout/style/css.d.ts +0 -0
  118. package/lib/components/fm-layout/style/index.d.ts +0 -0
  119. package/lib/components/index.d.ts +1 -0
  120. package/lib/{index.css → defaults.css} +2 -2
  121. package/lib/packages/components/fm-layout/index.js +9 -0
  122. package/lib/packages/components/fm-layout/src/component/aside.vue.js +9 -0
  123. package/lib/packages/components/fm-layout/src/component/aside.vue2.js +179 -0
  124. package/lib/packages/components/fm-layout/src/component/columnsAside.vue.js +9 -0
  125. package/lib/packages/components/fm-layout/src/component/columnsAside.vue2.js +277 -0
  126. package/lib/packages/components/fm-layout/src/component/header.vue.js +9 -0
  127. package/lib/packages/components/fm-layout/src/component/header.vue2.js +54 -0
  128. package/lib/packages/components/fm-layout/src/component/main.vue.js +9 -0
  129. package/lib/packages/components/fm-layout/src/component/main.vue2.js +85 -0
  130. package/lib/packages/components/fm-layout/src/footer/index.vue.js +9 -0
  131. package/lib/packages/components/fm-layout/src/footer/index.vue2.js +33 -0
  132. package/lib/packages/components/fm-layout/src/index.vue.js +9 -0
  133. package/lib/packages/components/fm-layout/src/index.vue2.js +95 -0
  134. package/lib/packages/components/fm-layout/src/logo/index.vue.js +9 -0
  135. package/lib/packages/components/fm-layout/src/logo/index.vue2.js +61 -0
  136. package/lib/packages/components/fm-layout/src/main/classic.vue.js +9 -0
  137. package/lib/packages/components/fm-layout/src/main/classic.vue2.js +91 -0
  138. package/lib/packages/components/fm-layout/src/main/columns.vue.js +9 -0
  139. package/lib/packages/components/fm-layout/src/main/columns.vue2.js +104 -0
  140. package/lib/packages/components/fm-layout/src/main/defaults.vue.js +9 -0
  141. package/lib/packages/components/fm-layout/src/main/defaults.vue2.js +157 -0
  142. package/lib/packages/components/fm-layout/src/main/transverse.vue.js +9 -0
  143. package/lib/packages/components/fm-layout/src/main/transverse.vue2.js +74 -0
  144. package/lib/packages/components/fm-layout/src/navBars/index.vue.js +9 -0
  145. package/lib/packages/components/fm-layout/src/navBars/index.vue2.js +48 -0
  146. package/lib/packages/components/fm-layout/src/navBars/tagsView/contextmenu.vue.js +9 -0
  147. package/lib/packages/components/fm-layout/src/navBars/tagsView/contextmenu.vue2.js +160 -0
  148. package/lib/packages/components/fm-layout/src/navBars/tagsView/tagsView.vue.js +9 -0
  149. package/lib/packages/components/fm-layout/src/navBars/tagsView/tagsView.vue2.js +580 -0
  150. package/lib/packages/components/fm-layout/src/navBars/topBar/breadcrumb.vue.js +9 -0
  151. package/lib/packages/components/fm-layout/src/navBars/topBar/breadcrumb.vue2.js +173 -0
  152. package/lib/packages/components/fm-layout/src/navBars/topBar/index.vue.js +9 -0
  153. package/lib/packages/components/fm-layout/src/navBars/topBar/index.vue2.js +117 -0
  154. package/lib/packages/components/fm-layout/src/navBars/topBar/search.vue.js +9 -0
  155. package/lib/packages/components/fm-layout/src/navBars/topBar/search.vue2.js +124 -0
  156. package/lib/packages/components/fm-layout/src/navBars/topBar/upgradeInfo.vue.js +9 -0
  157. package/lib/packages/components/fm-layout/src/navBars/topBar/upgradeInfo.vue2.js +76 -0
  158. package/lib/packages/components/fm-layout/src/navBars/topBar/user.vue.js +9 -0
  159. package/lib/packages/components/fm-layout/src/navBars/topBar/user.vue2.js +703 -0
  160. package/lib/packages/components/fm-layout/src/navBars/topBar/userNews.vue.js +9 -0
  161. package/lib/packages/components/fm-layout/src/navBars/topBar/userNews.vue2.js +259 -0
  162. package/lib/packages/components/fm-layout/src/navMenu/horizontal.vue.js +9 -0
  163. package/lib/packages/components/fm-layout/src/navMenu/horizontal.vue2.js +186 -0
  164. package/lib/packages/components/fm-layout/src/navMenu/subItem.vue.js +9 -0
  165. package/lib/packages/components/fm-layout/src/navMenu/subItem.vue2.js +117 -0
  166. package/lib/packages/components/fm-layout/src/navMenu/vertical.vue.js +9 -0
  167. package/lib/packages/components/fm-layout/src/navMenu/vertical.vue2.js +163 -0
  168. package/lib/packages/components/fm-layout/src/routerView/iframes.vue.js +9 -0
  169. package/lib/packages/components/fm-layout/src/routerView/iframes.vue2.js +132 -0
  170. package/lib/packages/components/fm-layout/src/routerView/parent.vue.js +9 -0
  171. package/lib/packages/components/fm-layout/src/routerView/parent.vue2.js +145 -0
  172. package/lib/packages/components/fm-layout/src/type.js +2 -0
  173. package/lib/packages/components/index.js +14 -12
  174. package/locale/en.js +1 -1
  175. package/locale/en.min.js +1 -1
  176. package/locale/en.min.mjs +1 -1
  177. package/locale/en.mjs +1 -1
  178. package/locale/zh-cn.js +1 -1
  179. package/locale/zh-cn.min.js +1 -1
  180. package/locale/zh-cn.min.mjs +1 -1
  181. package/locale/zh-cn.mjs +1 -1
  182. package/package.json +1 -1
  183. package/theme-chalk/f-layout.css +1 -0
  184. package/theme-chalk/index.css +1 -1
  185. package/theme-chalk/src/index.scss +1 -0
  186. package/theme-chalk/src/layout.scss +655 -0
@@ -0,0 +1,580 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+ var vueRouter = require('vue-router');
7
+ var Sortable = require('sortablejs');
8
+ var elementPlus = require('element-plus');
9
+ var pinia = require('pinia');
10
+ require('../../../../../stores/index.js');
11
+ require('../../../../../utils/index.js');
12
+ var mitt = require('../../../../../utils/mitt.js');
13
+ var other = require('../../../../../hooks/other.js');
14
+ var tagsViewRoutes = require('../../../../../stores/tagsViewRoutes.js');
15
+ var themeConfig = require('../../../../../stores/themeConfig.js');
16
+ var routesList = require('../../../../../stores/routesList.js');
17
+ var keepAliveNames = require('../../../../../stores/keepAliveNames.js');
18
+ var storage = require('../../../../../utils/storage.js');
19
+ var arrayOperation = require('../../../../../utils/arrayOperation.js');
20
+
21
+ const _hoisted_1 = ["data-url", "onContextmenu", "onMousedown", "onClick"];
22
+ const _hoisted_2 = {
23
+ key: 0,
24
+ class: "iconfont icon-webicon318 layout-navbars-tagsview-ul-li-iconfont"
25
+ };
26
+ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
27
+ __name: "tagsView",
28
+ setup(__props) {
29
+ const Contextmenu = vue.defineAsyncComponent(() => Promise.resolve().then(function () { return require('./contextmenu.vue.js'); }));
30
+ const tagsRefs = vue.ref([]);
31
+ const scrollbarRef = vue.ref();
32
+ const contextmenuRef = vue.ref();
33
+ const tagsUlRef = vue.ref();
34
+ const stores = tagsViewRoutes.useTagsViewRoutes();
35
+ const storesThemeConfig = themeConfig.useThemeConfig();
36
+ const storesTagsViewRoutes = tagsViewRoutes.useTagsViewRoutes();
37
+ const storesRoutesList = routesList.useRoutesList();
38
+ const { themeConfig: themeConfig$1 } = pinia.storeToRefs(storesThemeConfig);
39
+ const { tagsViewRoutes: tagsViewRoutes$1 } = pinia.storeToRefs(storesTagsViewRoutes);
40
+ const { routesList: routesList$1 } = pinia.storeToRefs(storesRoutesList);
41
+ const storesKeepALiveNames = keepAliveNames.useKeepALiveNames();
42
+ const route = vueRouter.useRoute();
43
+ const router = vueRouter.useRouter();
44
+ const state = vue.reactive({
45
+ routeActive: "",
46
+ routePath: route.path,
47
+ dropdown: { x: "", y: "" },
48
+ sortable: "",
49
+ tagsRefsIndex: 0,
50
+ tagsViewList: [],
51
+ tagsViewRoutesList: []
52
+ });
53
+ const setTagsStyle = vue.computed(() => {
54
+ return themeConfig$1.value.tagsStyle;
55
+ });
56
+ const getThemeConfig = vue.computed(() => {
57
+ return themeConfig$1.value;
58
+ });
59
+ const setTagsViewNameI18n = vue.computed(() => {
60
+ return (v) => {
61
+ return other.default.setTagsViewNameI18n(v);
62
+ };
63
+ });
64
+ const isActive = (v) => {
65
+ if (getThemeConfig.value.isShareTagsView) {
66
+ return v.path === state.routePath;
67
+ } else {
68
+ if (v.query && Object.keys(v.query).length || v.params && Object.keys(v.params).length) {
69
+ return v.url ? v.url === state.routeActive : v.path === state.routeActive;
70
+ } else {
71
+ return v.path === state.routePath;
72
+ }
73
+ }
74
+ };
75
+ const addBrowserSetSession = (tagsViewList) => {
76
+ storage.Session.set("tagsViewList", tagsViewList);
77
+ };
78
+ const getTagsViewRoutes = async () => {
79
+ state.routeActive = await setTagsViewHighlight(route);
80
+ state.routePath = await route.meta.isDynamic ? route.meta.isDynamicPath : route.path;
81
+ state.tagsViewList = [];
82
+ state.tagsViewRoutesList = tagsViewRoutes$1.value;
83
+ initTagsView();
84
+ };
85
+ const initTagsView = async () => {
86
+ if (storage.Session.get("tagsViewList") && getThemeConfig.value.isCacheTagsView) {
87
+ state.tagsViewList = await storage.Session.get("tagsViewList");
88
+ } else {
89
+ await state.tagsViewRoutesList.map((v) => {
90
+ var _a;
91
+ if (((_a = v.meta) == null ? void 0 : _a.isAffix) && !v.meta.isHide) {
92
+ v.url = setTagsViewHighlight(v);
93
+ state.tagsViewList.push({ ...v });
94
+ storesKeepALiveNames.addCachedView(v);
95
+ }
96
+ });
97
+ await addTagsView(route.path, route);
98
+ }
99
+ getTagsRefsIndex(getThemeConfig.value.isShareTagsView ? state.routePath : state.routeActive);
100
+ };
101
+ const solveAddTagsView = async (path, to) => {
102
+ var _a, _b;
103
+ let isDynamicPath = ((_a = to == null ? void 0 : to.meta) == null ? void 0 : _a.isDynamic) ? to.meta.isDynamicPath : path;
104
+ let current = state.tagsViewList.filter(
105
+ (v) => {
106
+ var _a2, _b2;
107
+ return v.path === isDynamicPath && arrayOperation.isObjectValueEqual(((_a2 = to == null ? void 0 : to.meta) == null ? void 0 : _a2.isDynamic) ? v.params ? v.params : null : v.query ? v.query : null, ((_b2 = to == null ? void 0 : to.meta) == null ? void 0 : _b2.isDynamic) ? (to == null ? void 0 : to.params) ? to == null ? void 0 : to.params : null : (to == null ? void 0 : to.query) ? to == null ? void 0 : to.query : null);
108
+ }
109
+ );
110
+ if (current.length <= 0) {
111
+ let findItem = state.tagsViewRoutesList.find((v) => v.path === isDynamicPath);
112
+ if (!findItem) return false;
113
+ if (findItem.meta.isAffix) return false;
114
+ if (findItem.meta.isLink && !findItem.meta.isIframe) return false;
115
+ ((_b = to == null ? void 0 : to.meta) == null ? void 0 : _b.isDynamic) ? findItem.params = to.params : findItem.query = to == null ? void 0 : to.query;
116
+ findItem.url = setTagsViewHighlight(findItem);
117
+ state.tagsViewList.push({ ...findItem });
118
+ await storesKeepALiveNames.addCachedView(findItem);
119
+ addBrowserSetSession(state.tagsViewList);
120
+ }
121
+ };
122
+ const singleAddTagsView = (path, to) => {
123
+ var _a;
124
+ let isDynamicPath = ((_a = to == null ? void 0 : to.meta) == null ? void 0 : _a.isDynamic) ? to.meta.isDynamicPath : path;
125
+ state.tagsViewList.forEach((v) => {
126
+ var _a2, _b, _c;
127
+ if (v.path === isDynamicPath && !arrayOperation.isObjectValueEqual(((_a2 = to == null ? void 0 : to.meta) == null ? void 0 : _a2.isDynamic) ? v.params ? v.params : null : v.query ? v.query : null, ((_b = to == null ? void 0 : to.meta) == null ? void 0 : _b.isDynamic) ? (to == null ? void 0 : to.params) ? to == null ? void 0 : to.params : null : (to == null ? void 0 : to.query) ? to == null ? void 0 : to.query : null)) {
128
+ ((_c = to == null ? void 0 : to.meta) == null ? void 0 : _c.isDynamic) ? v.params = to.params : v.query = to == null ? void 0 : to.query;
129
+ v.url = setTagsViewHighlight(v);
130
+ addBrowserSetSession(state.tagsViewList);
131
+ }
132
+ });
133
+ };
134
+ const addTagsView = (path, to) => {
135
+ vue.nextTick(async () => {
136
+ var _a, _b, _c;
137
+ let item;
138
+ if ((_a = to == null ? void 0 : to.meta) == null ? void 0 : _a.isDynamic) {
139
+ if (!getThemeConfig.value.isShareTagsView) await solveAddTagsView(path, to);
140
+ else await singleAddTagsView(path, to);
141
+ if (state.tagsViewList.some((v) => {
142
+ var _a2;
143
+ return v.path === ((_a2 = to == null ? void 0 : to.meta) == null ? void 0 : _a2.isDynamicPath);
144
+ })) {
145
+ addBrowserSetSession(state.tagsViewList);
146
+ return false;
147
+ }
148
+ item = state.tagsViewRoutesList.find((v) => {
149
+ var _a2;
150
+ return v.path === ((_a2 = to == null ? void 0 : to.meta) == null ? void 0 : _a2.isDynamicPath);
151
+ });
152
+ } else {
153
+ if (!getThemeConfig.value.isShareTagsView) await solveAddTagsView(path, to);
154
+ else await singleAddTagsView(path, to);
155
+ if (state.tagsViewList.some((v) => v.path === path)) {
156
+ addBrowserSetSession(state.tagsViewList);
157
+ return false;
158
+ }
159
+ item = state.tagsViewRoutesList.find((v) => v.path === path);
160
+ }
161
+ if (!item) return false;
162
+ if (((_b = item == null ? void 0 : item.meta) == null ? void 0 : _b.isLink) && !item.meta.isIframe) return false;
163
+ if ((_c = to == null ? void 0 : to.meta) == null ? void 0 : _c.isDynamic) item.params = (to == null ? void 0 : to.params) ? to == null ? void 0 : to.params : route.params;
164
+ else item.query = (to == null ? void 0 : to.query) ? to == null ? void 0 : to.query : route.query;
165
+ item.url = setTagsViewHighlight(item);
166
+ await storesKeepALiveNames.addCachedView(item);
167
+ await state.tagsViewList.push({ ...item });
168
+ await addBrowserSetSession(state.tagsViewList);
169
+ });
170
+ };
171
+ const refreshCurrentTagsView = async (fullPath) => {
172
+ var _a;
173
+ const decodeURIPath = decodeURI(fullPath);
174
+ let item = {};
175
+ state.tagsViewList.forEach((v) => {
176
+ v.transUrl = transUrlParams(v);
177
+ if (v.transUrl) {
178
+ if (v.transUrl === transUrlParams(v)) item = v;
179
+ } else {
180
+ if (v.path === decodeURIPath) item = v;
181
+ }
182
+ });
183
+ if (!item) return false;
184
+ await storesKeepALiveNames.delCachedView(item);
185
+ mitt.default.emit("onTagsViewRefreshRouterView", fullPath);
186
+ if ((_a = item.meta) == null ? void 0 : _a.isKeepAlive) storesKeepALiveNames.addCachedView(item);
187
+ };
188
+ const closeCurrentTagsView = (path) => {
189
+ state.tagsViewList.map((v, k, arr) => {
190
+ var _a;
191
+ if (!((_a = v.meta) == null ? void 0 : _a.isAffix)) {
192
+ if (getThemeConfig.value.isShareTagsView ? v.path === path : v.url === path) {
193
+ storesKeepALiveNames.delCachedView(v);
194
+ state.tagsViewList.splice(k, 1);
195
+ setTimeout(() => {
196
+ if (state.tagsViewList.length === k && getThemeConfig.value.isShareTagsView ? state.routePath === path : state.routeActive === path) {
197
+ if (arr[arr.length - 1].meta.isDynamic) {
198
+ if (k !== arr.length) router.push({ name: arr[k].name, params: arr[k].params });
199
+ else router.push({ name: arr[arr.length - 1].name, params: arr[arr.length - 1].params });
200
+ } else {
201
+ if (k !== arr.length) router.push({ path: arr[k].path, query: arr[k].query });
202
+ else router.push({ path: arr[arr.length - 1].path, query: arr[arr.length - 1].query });
203
+ }
204
+ } else {
205
+ if (state.tagsViewList.length !== k && getThemeConfig.value.isShareTagsView ? state.routePath === path : state.routeActive === path) {
206
+ if (arr[k].meta.isDynamic) {
207
+ router.push({ name: arr[k].name, params: arr[k].params });
208
+ } else {
209
+ router.push({ path: arr[k].path, query: arr[k].query });
210
+ }
211
+ }
212
+ }
213
+ }, 0);
214
+ }
215
+ }
216
+ });
217
+ addBrowserSetSession(state.tagsViewList);
218
+ };
219
+ const closeOtherTagsView = (path) => {
220
+ if (storage.Session.get("tagsViewList")) {
221
+ state.tagsViewList = [];
222
+ storage.Session.get("tagsViewList").map((v) => {
223
+ var _a;
224
+ if (((_a = v.meta) == null ? void 0 : _a.isAffix) && !v.meta.isHide) {
225
+ v.url = setTagsViewHighlight(v);
226
+ storesKeepALiveNames.delOthersCachedViews(v);
227
+ state.tagsViewList.push({ ...v });
228
+ }
229
+ });
230
+ addTagsView(path, route);
231
+ addBrowserSetSession(state.tagsViewList);
232
+ }
233
+ };
234
+ const closeAllTagsView = () => {
235
+ if (storage.Session.get("tagsViewList")) {
236
+ storesKeepALiveNames.delAllCachedViews();
237
+ state.tagsViewList = [];
238
+ storage.Session.get("tagsViewList").map((v) => {
239
+ var _a;
240
+ if (((_a = v.meta) == null ? void 0 : _a.isAffix) && !v.meta.isHide) {
241
+ v.url = setTagsViewHighlight(v);
242
+ state.tagsViewList.push({ ...v });
243
+ router.push({ path: state.tagsViewList[state.tagsViewList.length - 1].path });
244
+ }
245
+ });
246
+ addBrowserSetSession(state.tagsViewList);
247
+ }
248
+ };
249
+ const openCurrenFullscreen = async (path) => {
250
+ const item = state.tagsViewList.find((v) => getThemeConfig.value.isShareTagsView ? v.path === path : v.url === path);
251
+ if (item.meta.isDynamic) await router.push({ name: item.name, params: item.params });
252
+ else await router.push({ name: item.name, query: item.query });
253
+ stores.setCurrenFullscreen(true);
254
+ };
255
+ const getCurrentRouteItem = (item) => {
256
+ let resItem = {};
257
+ state.tagsViewList.forEach((v) => {
258
+ v.transUrl = transUrlParams(v);
259
+ if (v.transUrl) {
260
+ if (v.transUrl === transUrlParams(v) && v.transUrl === item.commonUrl) resItem = v;
261
+ } else {
262
+ if (v.path === decodeURI(item.path)) resItem = v;
263
+ }
264
+ });
265
+ if (!resItem) return null;
266
+ else return resItem;
267
+ };
268
+ const onCurrentContextmenuClick = async (item) => {
269
+ item.commonUrl = transUrlParams(item);
270
+ if (!getCurrentRouteItem(item)) return elementPlus.ElMessage({ type: "warning", message: "\u8BF7\u6B63\u786E\u8F93\u5165\u8DEF\u5F84\u53CA\u5B8C\u6574\u53C2\u6570\uFF08query\u3001params\uFF09" });
271
+ const { path, name, params, query, meta, url } = getCurrentRouteItem(item);
272
+ switch (item.contextMenuClickId) {
273
+ case 0:
274
+ if (meta.isDynamic) await router.push({ name, params });
275
+ else await router.push({ path, query });
276
+ await refreshCurrentTagsView(route.fullPath);
277
+ break;
278
+ case 1:
279
+ closeCurrentTagsView(getThemeConfig.value.isShareTagsView ? path : url);
280
+ break;
281
+ case 2:
282
+ if (meta.isDynamic) await router.push({ name, params });
283
+ else await router.push({ path, query });
284
+ closeOtherTagsView(path);
285
+ break;
286
+ case 3:
287
+ closeAllTagsView();
288
+ break;
289
+ case 4:
290
+ await openCurrenFullscreen(getThemeConfig.value.isShareTagsView ? path : url);
291
+ break;
292
+ }
293
+ };
294
+ const onContextmenu = (v, e) => {
295
+ const { clientX, clientY } = e;
296
+ state.dropdown.x = clientX;
297
+ state.dropdown.y = clientY;
298
+ contextmenuRef.value.openContextmenu(v);
299
+ };
300
+ const onMousedownMenu = (v, e) => {
301
+ var _a;
302
+ if (!((_a = v.meta) == null ? void 0 : _a.isAffix) && e.button === 1) {
303
+ const item = Object.assign({}, { contextMenuClickId: 1, ...v });
304
+ onCurrentContextmenuClick(item);
305
+ }
306
+ };
307
+ const onTagsClick = (v, k) => {
308
+ state.tagsRefsIndex = k;
309
+ router.push(v);
310
+ if (getThemeConfig.value.layout === "columns") {
311
+ const item = routesList$1.value.find((r) => r.path.indexOf(`/${v.path.split("/")[1]}`) > -1);
312
+ !item.children ? getThemeConfig.value.isCollapse = true : getThemeConfig.value.isCollapse = false;
313
+ }
314
+ };
315
+ const transUrlParams = (v) => {
316
+ var _a, _b;
317
+ let params = v.query && Object.keys(v.query).length > 0 ? v.query : v.params;
318
+ if (!params) return "";
319
+ let path = "";
320
+ for (let [key, value] of Object.entries(params)) {
321
+ if ((_a = v.meta) == null ? void 0 : _a.isDynamic) path += `/${value}`;
322
+ else path += `&${key}=${value}`;
323
+ }
324
+ if ((_b = v.meta) == null ? void 0 : _b.isDynamic) {
325
+ return v.isFnClick ? decodeURI(v.path) : `${v.path.split(":")[0]}${path.replace(/^\//, "")}`;
326
+ } else {
327
+ return `${v.path}${path.replace(/^&/, "?")}`;
328
+ }
329
+ };
330
+ const setTagsViewHighlight = (v) => {
331
+ var _a;
332
+ let params = v.query && Object.keys(v.query).length > 0 ? v.query : v.params;
333
+ if (!params || Object.keys(params).length <= 0) return v.path;
334
+ let path = "";
335
+ for (let i in params) {
336
+ path += params[i];
337
+ }
338
+ return `${((_a = v.meta) == null ? void 0 : _a.isDynamic) ? v.meta.isDynamicPath : v.path}-${path}`;
339
+ };
340
+ const onHandleScroll = (e) => {
341
+ scrollbarRef.value.$refs.wrapRef.scrollLeft += e.wheelDelta / 4;
342
+ };
343
+ const tagsViewmoveToCurrentTag = () => {
344
+ vue.nextTick(() => {
345
+ if (tagsRefs.value.length <= 0) return false;
346
+ let liDom = tagsRefs.value[state.tagsRefsIndex];
347
+ let liIndex = state.tagsRefsIndex;
348
+ let liLength = tagsRefs.value.length;
349
+ let liFirst = tagsRefs.value[0];
350
+ let liLast = tagsRefs.value[tagsRefs.value.length - 1];
351
+ let scrollRefs = scrollbarRef.value.$refs.wrapRef;
352
+ let scrollS = scrollRefs.scrollWidth;
353
+ let offsetW = scrollRefs.offsetWidth;
354
+ let scrollL = scrollRefs.scrollLeft;
355
+ let liPrevTag = tagsRefs.value[state.tagsRefsIndex - 1];
356
+ let liNextTag = tagsRefs.value[state.tagsRefsIndex + 1];
357
+ let beforePrevL = 0;
358
+ let afterNextL = 0;
359
+ if (liDom === liFirst) {
360
+ scrollRefs.scrollLeft = 0;
361
+ } else if (liDom === liLast) {
362
+ scrollRefs.scrollLeft = scrollS - offsetW;
363
+ } else {
364
+ if (liIndex === 0) beforePrevL = liFirst.offsetLeft - 5;
365
+ else beforePrevL = (liPrevTag == null ? void 0 : liPrevTag.offsetLeft) - 5;
366
+ if (liIndex === liLength) afterNextL = liLast.offsetLeft + liLast.offsetWidth + 5;
367
+ else afterNextL = liNextTag.offsetLeft + liNextTag.offsetWidth + 5;
368
+ if (afterNextL > scrollL + offsetW) {
369
+ scrollRefs.scrollLeft = afterNextL - offsetW;
370
+ } else if (beforePrevL < scrollL) {
371
+ scrollRefs.scrollLeft = beforePrevL;
372
+ }
373
+ }
374
+ scrollbarRef.value.update();
375
+ });
376
+ };
377
+ const getTagsRefsIndex = (path) => {
378
+ vue.nextTick(async () => {
379
+ let tagsViewList = await state.tagsViewList;
380
+ state.tagsRefsIndex = tagsViewList.findIndex((v) => {
381
+ if (getThemeConfig.value.isShareTagsView) {
382
+ return v.path === path;
383
+ } else {
384
+ return v.url === path;
385
+ }
386
+ });
387
+ tagsViewmoveToCurrentTag();
388
+ });
389
+ };
390
+ const initSortable = async () => {
391
+ const el = document.querySelector(".layout-navbars-tagsview-ul");
392
+ if (!el) return false;
393
+ state.sortable.el && state.sortable.destroy();
394
+ state.sortable = Sortable.create(el, {
395
+ animation: 300,
396
+ dataIdAttr: "data-url",
397
+ disabled: getThemeConfig.value.isSortableTagsView ? false : true,
398
+ onEnd: () => {
399
+ const sortEndList = [];
400
+ state.sortable.toArray().map((val) => {
401
+ state.tagsViewList.map((v) => {
402
+ if (v.url === val) sortEndList.push({ ...v });
403
+ });
404
+ });
405
+ addBrowserSetSession(sortEndList);
406
+ }
407
+ });
408
+ };
409
+ const onSortableResize = async () => {
410
+ await initSortable();
411
+ if (other.default.isMobile()) state.sortable.el && state.sortable.destroy();
412
+ };
413
+ vue.onBeforeMount(() => {
414
+ onSortableResize();
415
+ window.addEventListener("resize", onSortableResize);
416
+ mitt.default.on("onCurrentContextmenuClick", (data) => {
417
+ data.isFnClick = true;
418
+ onCurrentContextmenuClick(data);
419
+ });
420
+ mitt.default.on("openOrCloseSortable", () => {
421
+ initSortable();
422
+ });
423
+ mitt.default.on("openShareTagsView", () => {
424
+ if (getThemeConfig.value.isShareTagsView) {
425
+ router.push("/home");
426
+ state.tagsViewList = [];
427
+ state.tagsViewRoutesList.map((v) => {
428
+ var _a;
429
+ if (((_a = v.meta) == null ? void 0 : _a.isAffix) && !v.meta.isHide) {
430
+ v.url = setTagsViewHighlight(v);
431
+ state.tagsViewList.push({ ...v });
432
+ }
433
+ });
434
+ }
435
+ });
436
+ });
437
+ vue.onUnmounted(() => {
438
+ mitt.default.off("onCurrentContextmenuClick", () => {
439
+ });
440
+ mitt.default.off("openOrCloseSortable", () => {
441
+ });
442
+ mitt.default.off("openShareTagsView", () => {
443
+ });
444
+ window.removeEventListener("resize", onSortableResize);
445
+ });
446
+ vue.onBeforeUpdate(() => {
447
+ tagsRefs.value = [];
448
+ });
449
+ vue.onMounted(() => {
450
+ getTagsViewRoutes();
451
+ initSortable();
452
+ });
453
+ vueRouter.onBeforeRouteUpdate(async (to) => {
454
+ state.routeActive = setTagsViewHighlight(to);
455
+ state.routePath = to.meta.isDynamic ? to.meta.isDynamicPath : to.path;
456
+ await addTagsView(to.path, to);
457
+ getTagsRefsIndex(getThemeConfig.value.isShareTagsView ? state.routePath : state.routeActive);
458
+ });
459
+ vue.watch(
460
+ () => tagsViewRoutes$1.value,
461
+ (val) => {
462
+ if (val.length === state.tagsViewRoutesList.length) return false;
463
+ getTagsViewRoutes();
464
+ },
465
+ {
466
+ deep: true
467
+ }
468
+ );
469
+ return (_ctx, _cache) => {
470
+ const _component_SvgIcon = vue.resolveComponent("SvgIcon");
471
+ const _component_el_scrollbar = vue.resolveComponent("el-scrollbar");
472
+ return vue.openBlock(), vue.createElementBlock(
473
+ "div",
474
+ {
475
+ class: vue.normalizeClass(["layout-navbars-tagsview", { "layout-navbars-tagsview-shadow": getThemeConfig.value.layout === "classic" }])
476
+ },
477
+ [
478
+ vue.createVNode(
479
+ _component_el_scrollbar,
480
+ {
481
+ ref_key: "scrollbarRef",
482
+ ref: scrollbarRef,
483
+ onWheel: vue.withModifiers(onHandleScroll, ["prevent"])
484
+ },
485
+ {
486
+ default: vue.withCtx(() => [
487
+ vue.createElementVNode(
488
+ "ul",
489
+ {
490
+ class: vue.normalizeClass(["layout-navbars-tagsview-ul", setTagsStyle.value]),
491
+ ref_key: "tagsUlRef",
492
+ ref: tagsUlRef
493
+ },
494
+ [
495
+ (vue.openBlock(true), vue.createElementBlock(
496
+ vue.Fragment,
497
+ null,
498
+ vue.renderList(state.tagsViewList, (v, k) => {
499
+ return vue.openBlock(), vue.createElementBlock("li", {
500
+ key: k,
501
+ class: vue.normalizeClass(["layout-navbars-tagsview-ul-li", { "is-active": isActive(v) }]),
502
+ "data-url": v.url,
503
+ onContextmenu: vue.withModifiers(($event) => onContextmenu(v, $event), ["prevent"]),
504
+ onMousedown: ($event) => onMousedownMenu(v, $event),
505
+ onClick: ($event) => onTagsClick(v, k),
506
+ ref_for: true,
507
+ ref: (el) => {
508
+ if (el) tagsRefs.value[k] = el;
509
+ }
510
+ }, [
511
+ isActive(v) ? (vue.openBlock(), vue.createElementBlock("i", _hoisted_2)) : vue.createCommentVNode("v-if", true),
512
+ getThemeConfig.value.isTagsviewIcon ? (vue.openBlock(), vue.createBlock(_component_SvgIcon, {
513
+ key: 1,
514
+ name: v.meta.icon,
515
+ class: "pr5",
516
+ size: 18
517
+ }, null, 8, ["name"])) : vue.createCommentVNode("v-if", true),
518
+ vue.createElementVNode(
519
+ "span",
520
+ null,
521
+ vue.toDisplayString(setTagsViewNameI18n.value(v)),
522
+ 1
523
+ /* TEXT */
524
+ ),
525
+ isActive(v) ? (vue.openBlock(), vue.createElementBlock(
526
+ vue.Fragment,
527
+ { key: 2 },
528
+ [
529
+ vue.createVNode(_component_SvgIcon, {
530
+ name: "ele-RefreshRight",
531
+ class: "ml5 layout-navbars-tagsview-ul-li-refresh",
532
+ onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => refreshCurrentTagsView(_ctx.$route.fullPath), ["stop"]))
533
+ }),
534
+ !v.meta.isAffix ? (vue.openBlock(), vue.createBlock(_component_SvgIcon, {
535
+ key: 0,
536
+ name: "ele-Close",
537
+ class: "layout-navbars-tagsview-ul-li-icon layout-icon-active",
538
+ onClick: vue.withModifiers(($event) => closeCurrentTagsView(getThemeConfig.value.isShareTagsView ? v.path : v.url), ["stop"])
539
+ }, null, 8, ["onClick"])) : vue.createCommentVNode("v-if", true)
540
+ ],
541
+ 64
542
+ /* STABLE_FRAGMENT */
543
+ )) : vue.createCommentVNode("v-if", true),
544
+ !v.meta.isAffix ? (vue.openBlock(), vue.createBlock(_component_SvgIcon, {
545
+ key: 3,
546
+ name: "ele-Close",
547
+ class: "layout-navbars-tagsview-ul-li-icon layout-icon-three",
548
+ onClick: vue.withModifiers(($event) => closeCurrentTagsView(getThemeConfig.value.isShareTagsView ? v.path : v.url), ["stop"])
549
+ }, null, 8, ["onClick"])) : vue.createCommentVNode("v-if", true)
550
+ ], 42, _hoisted_1);
551
+ }),
552
+ 128
553
+ /* KEYED_FRAGMENT */
554
+ ))
555
+ ],
556
+ 2
557
+ /* CLASS */
558
+ )
559
+ ]),
560
+ _: 1
561
+ /* STABLE */
562
+ },
563
+ 512
564
+ /* NEED_PATCH */
565
+ ),
566
+ vue.createVNode(vue.unref(Contextmenu), {
567
+ dropdown: state.dropdown,
568
+ ref_key: "contextmenuRef",
569
+ ref: contextmenuRef,
570
+ onCurrentContextmenuClick
571
+ }, null, 8, ["dropdown"])
572
+ ],
573
+ 2
574
+ /* CLASS */
575
+ );
576
+ };
577
+ }
578
+ });
579
+
580
+ exports.default = _sfc_main;
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var breadcrumb_vue_vue_type_script_setup_true_name_layoutBreadcrumb_lang = require('./breadcrumb.vue2.js');
6
+
7
+
8
+
9
+ exports.default = breadcrumb_vue_vue_type_script_setup_true_name_layoutBreadcrumb_lang.default;