@fmdeui/fmui 1.0.28 → 1.0.30

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 (187) 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/{index.css → component.css} +2 -2
  90. package/lib/component.js +3 -1
  91. package/lib/components/fm-layout/index.d.ts +32 -0
  92. package/lib/components/fm-layout/src/component/aside.vue.d.ts +5 -0
  93. package/lib/components/fm-layout/src/component/columnsAside.vue.d.ts +5 -0
  94. package/lib/components/fm-layout/src/component/header.vue.d.ts +16 -0
  95. package/lib/components/fm-layout/src/component/main.vue.d.ts +7 -0
  96. package/lib/components/fm-layout/src/footer/index.vue.d.ts +3 -0
  97. package/lib/components/fm-layout/src/index.vue.d.ts +22 -0
  98. package/lib/components/fm-layout/src/logo/index.vue.d.ts +3 -0
  99. package/lib/components/fm-layout/src/main/classic.vue.d.ts +18 -0
  100. package/lib/components/fm-layout/src/main/columns.vue.d.ts +19 -0
  101. package/lib/components/fm-layout/src/main/defaults.vue.d.ts +48 -0
  102. package/lib/components/fm-layout/src/main/transverse.vue.d.ts +18 -0
  103. package/lib/components/fm-layout/src/navBars/index.vue.d.ts +16 -0
  104. package/lib/components/fm-layout/src/navBars/tagsView/contextmenu.vue.d.ts +28 -0
  105. package/lib/components/fm-layout/src/navBars/tagsView/tagsView.vue.d.ts +45 -0
  106. package/lib/components/fm-layout/src/navBars/topBar/breadcrumb.vue.d.ts +3 -0
  107. package/lib/components/fm-layout/src/navBars/topBar/index.vue.d.ts +16 -0
  108. package/lib/components/fm-layout/src/navBars/topBar/search.vue.d.ts +7 -0
  109. package/lib/components/fm-layout/src/navBars/topBar/upgradeInfo.vue.d.ts +5 -0
  110. package/lib/components/fm-layout/src/navBars/topBar/user.vue.d.ts +75 -0
  111. package/lib/components/fm-layout/src/navBars/topBar/userNews.vue.d.ts +9 -0
  112. package/lib/components/fm-layout/src/navMenu/horizontal.vue.d.ts +42 -0
  113. package/lib/components/fm-layout/src/navMenu/subItem.vue.d.ts +42 -0
  114. package/lib/components/fm-layout/src/navMenu/vertical.vue.d.ts +42 -0
  115. package/lib/components/fm-layout/src/routerView/iframes.vue.d.ts +35 -0
  116. package/lib/components/fm-layout/src/routerView/parent.vue.d.ts +3 -0
  117. package/lib/components/fm-layout/src/type.d.ts +2 -0
  118. package/lib/components/fm-layout/style/css.d.ts +0 -0
  119. package/lib/components/fm-layout/style/index.d.ts +0 -0
  120. package/lib/components/index.d.ts +1 -0
  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 +657 -0
  187. /package/es/{version.css → defaults.css} +0 -0
@@ -0,0 +1,159 @@
1
+ import { defineComponent, defineAsyncComponent, reactive, computed, onMounted, watch, resolveComponent, openBlock, createBlock, withCtx, createElementBlock, Fragment, renderList, createVNode, unref, createCommentVNode, createElementVNode, toDisplayString, createSlots, withModifiers } from 'vue';
2
+ import { useRoute, onBeforeRouteUpdate } from 'vue-router';
3
+ import { storeToRefs } from 'pinia';
4
+ import '../../../../stores/index.mjs';
5
+ import other from '../../../../hooks/other.mjs';
6
+ import { useThemeConfig } from '../../../../stores/themeConfig.mjs';
7
+
8
+ const _hoisted_1 = ["onClick"];
9
+ var _sfc_main = /* @__PURE__ */ defineComponent({
10
+ __name: "vertical",
11
+ props: {
12
+ // 菜单列表
13
+ menuList: {
14
+ type: Array,
15
+ default: () => []
16
+ }
17
+ },
18
+ setup(__props) {
19
+ const SubItem = defineAsyncComponent(() => import('./subItem.vue.mjs'));
20
+ const props = __props;
21
+ const storesThemeConfig = useThemeConfig();
22
+ const { themeConfig } = storeToRefs(storesThemeConfig);
23
+ const route = useRoute();
24
+ const state = reactive({
25
+ // 修复:
26
+ defaultActive: route.meta.isDynamic ? route.meta.isDynamicPath : route.path,
27
+ isCollapse: false
28
+ });
29
+ const menuLists = computed(() => {
30
+ return props.menuList;
31
+ });
32
+ const getThemeConfig = computed(() => {
33
+ return themeConfig.value;
34
+ });
35
+ const setParentHighlight = (currentRoute) => {
36
+ const { path, meta } = currentRoute;
37
+ const pathSplit = (meta == null ? void 0 : meta.isDynamic) ? meta.isDynamicPath.split("/") : path.split("/");
38
+ if (pathSplit.length >= 4 && (meta == null ? void 0 : meta.isHide)) return pathSplit.splice(0, 3).join("/");
39
+ else return path;
40
+ };
41
+ const onALinkClick = (val) => {
42
+ other.handleOpenLink(val);
43
+ };
44
+ onMounted(() => {
45
+ state.defaultActive = setParentHighlight(route);
46
+ });
47
+ onBeforeRouteUpdate((to) => {
48
+ state.defaultActive = setParentHighlight(to);
49
+ const clientWidth = document.body.clientWidth;
50
+ if (clientWidth < 1e3) themeConfig.value.isCollapse = false;
51
+ });
52
+ watch(
53
+ () => themeConfig.value.isCollapse,
54
+ (isCollapse) => {
55
+ document.body.clientWidth <= 1e3 ? state.isCollapse = false : state.isCollapse = isCollapse;
56
+ },
57
+ {
58
+ immediate: true
59
+ }
60
+ );
61
+ return (_ctx, _cache) => {
62
+ const _component_SvgIcon = resolveComponent("SvgIcon");
63
+ const _component_el_sub_menu = resolveComponent("el-sub-menu");
64
+ const _component_el_menu_item = resolveComponent("el-menu-item");
65
+ const _component_el_menu = resolveComponent("el-menu");
66
+ return openBlock(), createBlock(_component_el_menu, {
67
+ router: "",
68
+ "default-active": state.defaultActive,
69
+ "background-color": "transparent",
70
+ collapse: state.isCollapse,
71
+ "unique-opened": getThemeConfig.value.isUniqueOpened,
72
+ "collapse-transition": false
73
+ }, {
74
+ default: withCtx(() => [
75
+ (openBlock(true), createElementBlock(
76
+ Fragment,
77
+ null,
78
+ renderList(menuLists.value, (val) => {
79
+ return openBlock(), createElementBlock(
80
+ Fragment,
81
+ null,
82
+ [
83
+ val.children && val.children.length > 0 ? (openBlock(), createBlock(_component_el_sub_menu, {
84
+ index: val.path,
85
+ key: val.path
86
+ }, {
87
+ title: withCtx(() => [
88
+ createVNode(_component_SvgIcon, {
89
+ name: val.meta.icon
90
+ }, null, 8, ["name"]),
91
+ createCommentVNode(" <span>{{ $t(val.meta.title) }}</span> "),
92
+ createElementVNode(
93
+ "span",
94
+ null,
95
+ toDisplayString(_ctx.$t(`message.menu.${val.meta.title}`)),
96
+ 1
97
+ /* TEXT */
98
+ )
99
+ ]),
100
+ default: withCtx(() => [
101
+ createVNode(unref(SubItem), {
102
+ chil: val.children
103
+ }, null, 8, ["chil"])
104
+ ]),
105
+ _: 2
106
+ /* DYNAMIC */
107
+ }, 1032, ["index"])) : (openBlock(), createBlock(_component_el_menu_item, {
108
+ index: val.path,
109
+ key: val.path
110
+ }, createSlots({
111
+ default: withCtx(() => [
112
+ createVNode(_component_SvgIcon, {
113
+ name: val.meta.icon
114
+ }, null, 8, ["name"])
115
+ ]),
116
+ _: 2
117
+ /* DYNAMIC */
118
+ }, [
119
+ !val.meta.isLink || val.meta.isLink && val.meta.isIframe ? {
120
+ name: "title",
121
+ fn: withCtx(() => [
122
+ createCommentVNode(" <span>{{ $t(val.meta.title) }}</span> "),
123
+ createElementVNode(
124
+ "span",
125
+ null,
126
+ toDisplayString(_ctx.$t(`message.menu.${val.meta.title}`)),
127
+ 1
128
+ /* TEXT */
129
+ )
130
+ ]),
131
+ key: "0"
132
+ } : {
133
+ name: "title",
134
+ fn: withCtx(() => [
135
+ createElementVNode("a", {
136
+ class: "w100",
137
+ onClick: withModifiers(($event) => onALinkClick(val), ["prevent"])
138
+ }, toDisplayString(_ctx.$t(`message.menu.${val.meta.title}`)), 9, _hoisted_1)
139
+ ]),
140
+ key: "1"
141
+ }
142
+ ]), 1032, ["index"]))
143
+ ],
144
+ 64
145
+ /* STABLE_FRAGMENT */
146
+ );
147
+ }),
148
+ 256
149
+ /* UNKEYED_FRAGMENT */
150
+ ))
151
+ ]),
152
+ _: 1
153
+ /* STABLE */
154
+ }, 8, ["default-active", "collapse", "unique-opened"]);
155
+ };
156
+ }
157
+ });
158
+
159
+ export { _sfc_main as default };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from './iframes.vue2.mjs';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
@@ -0,0 +1,128 @@
1
+ import { defineComponent, ref, computed, watch, resolveDirective, openBlock, createElementBlock, createElementVNode, Fragment, renderList, withDirectives, createVNode, TransitionGroup, withCtx, unref, vShow, nextTick } from 'vue';
2
+ import { useRoute } from 'vue-router';
3
+ import '../../../../utils/index.mjs';
4
+ import { getToken } from '../../../../utils/request.mjs';
5
+
6
+ const _hoisted_1 = { class: "layout-padding layout-padding-unset layout-iframe" };
7
+ const _hoisted_2 = { class: "layout-padding-auto layout-padding-view" };
8
+ const _hoisted_3 = ["src", "data-url"];
9
+ var _sfc_main = /* @__PURE__ */ defineComponent({
10
+ __name: "iframes",
11
+ props: {
12
+ // 刷新 iframe
13
+ refreshKey: {
14
+ type: String,
15
+ default: () => ""
16
+ },
17
+ // 过渡动画 name
18
+ name: {
19
+ type: String,
20
+ default: () => "slide-right"
21
+ },
22
+ // iframe 列表
23
+ list: {
24
+ type: Array,
25
+ default: () => []
26
+ }
27
+ },
28
+ setup(__props) {
29
+ const props = __props;
30
+ const iframeRef = ref();
31
+ const route = useRoute();
32
+ const setIframeList = computed(() => {
33
+ return props.list.filter((v) => {
34
+ var _a;
35
+ return (_a = v.meta) == null ? void 0 : _a.isIframeOpen;
36
+ });
37
+ });
38
+ const getRoutePath = computed(() => {
39
+ return route.path;
40
+ });
41
+ const closeIframeLoading = (val, item) => {
42
+ nextTick(() => {
43
+ if (!iframeRef.value) return false;
44
+ iframeRef.value.forEach((v) => {
45
+ if (v.dataset.url === val) {
46
+ v.onload = () => {
47
+ var _a;
48
+ if (((_a = item.meta) == null ? void 0 : _a.isIframeOpen) && item.meta.loading) item.meta.loading = false;
49
+ };
50
+ }
51
+ });
52
+ });
53
+ };
54
+ watch(
55
+ () => route.fullPath,
56
+ (val) => {
57
+ const item = props.list.find((v) => v.path === val);
58
+ if (!item) return false;
59
+ if (!item.meta.isIframeOpen) item.meta.isIframeOpen = true;
60
+ closeIframeLoading(val, item);
61
+ },
62
+ {
63
+ immediate: true
64
+ }
65
+ );
66
+ watch(
67
+ () => props.refreshKey,
68
+ () => {
69
+ const item = props.list.find((v) => v.path === route.path);
70
+ if (!item) return false;
71
+ if (item.meta.isIframeOpen) item.meta.isIframeOpen = false;
72
+ setTimeout(() => {
73
+ item.meta.isIframeOpen = true;
74
+ item.meta.loading = true;
75
+ closeIframeLoading(route.fullPath, item);
76
+ });
77
+ },
78
+ {
79
+ deep: true
80
+ }
81
+ );
82
+ return (_ctx, _cache) => {
83
+ const _directive_loading = resolveDirective("loading");
84
+ return openBlock(), createElementBlock("div", _hoisted_1, [
85
+ createElementVNode("div", _hoisted_2, [
86
+ (openBlock(true), createElementBlock(
87
+ Fragment,
88
+ null,
89
+ renderList(setIframeList.value, (v) => {
90
+ return withDirectives((openBlock(), createElementBlock("div", {
91
+ class: "w100",
92
+ key: v.path,
93
+ "element-loading-background": "white"
94
+ }, [
95
+ createVNode(TransitionGroup, { name: __props.name }, {
96
+ default: withCtx(() => [
97
+ withDirectives((openBlock(), createElementBlock("iframe", {
98
+ src: `${v.meta.isLink}${v.meta.isLink.indexOf("?") > 0 ? "&" : "?"}token=${unref(getToken)()}`,
99
+ key: v.path,
100
+ frameborder: "0",
101
+ height: "100%",
102
+ width: "100%",
103
+ style: { "position": "absolute" },
104
+ "data-url": v.path,
105
+ ref_for: true,
106
+ ref_key: "iframeRef",
107
+ ref: iframeRef
108
+ }, null, 8, _hoisted_3)), [
109
+ [vShow, getRoutePath.value === v.path]
110
+ ])
111
+ ]),
112
+ _: 2
113
+ /* DYNAMIC */
114
+ }, 1032, ["name"])
115
+ ])), [
116
+ [_directive_loading, v.meta.loading]
117
+ ]);
118
+ }),
119
+ 128
120
+ /* KEYED_FRAGMENT */
121
+ ))
122
+ ])
123
+ ]);
124
+ };
125
+ }
126
+ });
127
+
128
+ export { _sfc_main as default };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from './parent.vue2.mjs';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
@@ -0,0 +1,141 @@
1
+ import { defineComponent, defineAsyncComponent, reactive, computed, onBeforeMount, nextTick, onMounted, onUnmounted, watch, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, Transition, createBlock, KeepAlive, withDirectives, resolveDynamicComponent, vShow, unref } from 'vue';
2
+ import { useRoute, useRouter } from 'vue-router';
3
+ import { storeToRefs } from 'pinia';
4
+ import '../../../../stores/index.mjs';
5
+ import '../../../../utils/index.mjs';
6
+ import emitter from '../../../../utils/mitt.mjs';
7
+ import { useKeepALiveNames } from '../../../../stores/keepAliveNames.mjs';
8
+ import { useThemeConfig } from '../../../../stores/themeConfig.mjs';
9
+ import { Session } from '../../../../utils/storage.mjs';
10
+
11
+ const _hoisted_1 = { class: "layout-parent" };
12
+ var _sfc_main = /* @__PURE__ */ defineComponent({
13
+ __name: "parent",
14
+ setup(__props) {
15
+ const Iframes = defineAsyncComponent(() => import('./iframes.vue.mjs'));
16
+ const route = useRoute();
17
+ const router = useRouter();
18
+ const storesKeepAliveNames = useKeepALiveNames();
19
+ const storesThemeConfig = useThemeConfig();
20
+ const { keepAliveNames, cachedViews } = storeToRefs(storesKeepAliveNames);
21
+ const { themeConfig } = storeToRefs(storesThemeConfig);
22
+ const state = reactive({
23
+ refreshRouterViewKey: "",
24
+ // 非 iframe tagsview 右键菜单刷新时
25
+ iframeRefreshKey: "",
26
+ // iframe tagsview 右键菜单刷新时
27
+ keepAliveNameList: [],
28
+ iframeList: []
29
+ });
30
+ const setTransitionName = computed(() => {
31
+ return themeConfig.value.animation;
32
+ });
33
+ const getKeepAliveNames = computed(() => {
34
+ return themeConfig.value.isTagsview ? cachedViews.value : state.keepAliveNameList;
35
+ });
36
+ const isIframePage = computed(() => {
37
+ return route.meta.isIframe;
38
+ });
39
+ const getIframeListRoutes = async () => {
40
+ router.getRoutes().forEach((v) => {
41
+ if (v.meta.isIframe) {
42
+ v.meta.isIframeOpen = false;
43
+ v.meta.loading = true;
44
+ state.iframeList.push({ ...v });
45
+ }
46
+ });
47
+ };
48
+ onBeforeMount(() => {
49
+ state.keepAliveNameList = keepAliveNames.value;
50
+ emitter.on("onTagsViewRefreshRouterView", (fullPath) => {
51
+ var _a;
52
+ const cacheList = cachedViews.value;
53
+ if (route.meta.isKeepAlive) cachedViews.value = (_a = cachedViews.value) == null ? void 0 : _a.filter((name) => route.name !== name);
54
+ state.keepAliveNameList = keepAliveNames.value.filter((name) => route.name !== name);
55
+ state.refreshRouterViewKey = "";
56
+ state.iframeRefreshKey = "";
57
+ nextTick(() => {
58
+ if (route.meta.isKeepAlive) cachedViews.value = cacheList;
59
+ state.keepAliveNameList = keepAliveNames.value;
60
+ state.refreshRouterViewKey = fullPath;
61
+ state.iframeRefreshKey = fullPath;
62
+ });
63
+ });
64
+ });
65
+ onMounted(() => {
66
+ getIframeListRoutes();
67
+ nextTick(() => {
68
+ setTimeout(() => {
69
+ if (themeConfig.value.isCacheTagsView) {
70
+ let tagsViewArr = Session.get("tagsViewList") || [];
71
+ cachedViews.value = tagsViewArr.filter((item) => {
72
+ var _a;
73
+ return (_a = item.meta) == null ? void 0 : _a.isKeepAlive;
74
+ }).map((item) => item.name);
75
+ }
76
+ }, 0);
77
+ });
78
+ });
79
+ onUnmounted(() => {
80
+ emitter.off("onTagsViewRefreshRouterView", () => {
81
+ });
82
+ });
83
+ watch(
84
+ () => route.fullPath,
85
+ () => {
86
+ state.refreshRouterViewKey = decodeURI(route.fullPath);
87
+ },
88
+ {
89
+ immediate: true
90
+ }
91
+ );
92
+ return (_ctx, _cache) => {
93
+ const _component_router_view = resolveComponent("router-view");
94
+ return openBlock(), createElementBlock("div", _hoisted_1, [
95
+ createVNode(_component_router_view, null, {
96
+ default: withCtx(({ Component }) => [
97
+ createVNode(Transition, {
98
+ name: setTransitionName.value,
99
+ mode: "out-in"
100
+ }, {
101
+ default: withCtx(() => [
102
+ (openBlock(), createBlock(KeepAlive, { include: getKeepAliveNames.value }, [
103
+ withDirectives((openBlock(), createBlock(resolveDynamicComponent(Component), {
104
+ key: state.refreshRouterViewKey,
105
+ class: "w100"
106
+ })), [
107
+ [vShow, !isIframePage.value]
108
+ ])
109
+ ], 1032, ["include"]))
110
+ ]),
111
+ _: 2
112
+ /* DYNAMIC */
113
+ }, 1032, ["name"])
114
+ ]),
115
+ _: 1
116
+ /* STABLE */
117
+ }),
118
+ createVNode(Transition, {
119
+ name: setTransitionName.value,
120
+ mode: "out-in",
121
+ persisted: ""
122
+ }, {
123
+ default: withCtx(() => [
124
+ withDirectives(createVNode(unref(Iframes), {
125
+ class: "w100",
126
+ refreshKey: state.iframeRefreshKey,
127
+ name: setTransitionName.value,
128
+ list: state.iframeList
129
+ }, null, 8, ["refreshKey", "name", "list"]), [
130
+ [vShow, isIframePage.value]
131
+ ])
132
+ ]),
133
+ _: 1
134
+ /* STABLE */
135
+ }, 8, ["name"])
136
+ ]);
137
+ };
138
+ }
139
+ });
140
+
141
+ export { _sfc_main as default };
@@ -8,3 +8,4 @@ export { FSelectTable } from './select-table/index.mjs';
8
8
  export { FQueryCondition } from './query-condition/index.mjs';
9
9
  export { FForm } from './form/index.mjs';
10
10
  export { elSvg } from './svgIcon/index.mjs';
11
+ export { FLayout } from './fm-layout/index.mjs';