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