inl-ui 0.1.74 → 0.1.76
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.
- package/dist/components/index.cjs +505 -447
- package/dist/components/index.d.ts +6 -6
- package/dist/components/index.js +508 -450
- package/dist/index.cjs +439 -439
- package/dist/index.d.ts +7 -7
- package/dist/index.js +441 -441
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent, createVNode, ref, watch, resolveComponent, isVNode,
|
|
1
|
+
import { defineComponent, createVNode, ref, watch, resolveComponent, isVNode, computed, onBeforeUnmount, inject, onActivated, onDeactivated, nextTick, watchEffect, Fragment, withDirectives, vShow, toRaw, reactive, provide, createTextVNode, onMounted, KeepAlive, shallowRef, onBeforeMount, mergeProps, onBeforeUpdate, Teleport } from 'vue';
|
|
2
2
|
import { createFromIconfontCN, SearchOutlined, DownOutlined, PoweroffOutlined, MenuUnfoldOutlined, MenuFoldOutlined, SkinFilled, FullscreenOutlined, CaretUpOutlined, CaretRightOutlined, CaretDownOutlined, FileExcelTwoTone, InboxOutlined, MessageOutlined } from '@ant-design/icons-vue';
|
|
3
3
|
import { useRoute, useRouter } from 'vue-router';
|
|
4
|
-
import { useMounted, resolveRef, useThrottleFn, useMouseInElement, useVModel, useMagicKeys, whenever, watchArray, useEventListener, useSessionStorage,
|
|
4
|
+
import { useMounted, resolveRef, useThrottleFn, useLocalStorage, useFullscreen, useMouseInElement, useVModel, useMagicKeys, whenever, watchArray, useEventListener, useSessionStorage, useElementBounding, useToggle, useMemory, useWindowSize, useClipboard, useBreakpoints, breakpointsAntDesign } from '@vueuse/core';
|
|
5
5
|
import axios$2 from 'axios';
|
|
6
|
-
import { message, Menu, MenuItem, Input as Input$1, Badge, Avatar as Avatar$1, MenuDivider, Modal, SubMenu, Dropdown, Tooltip, Select, Layout as Layout$1,
|
|
6
|
+
import { message, Menu, MenuItem, Input as Input$1, Badge, Avatar as Avatar$1, MenuDivider, Modal, SubMenu, Dropdown, Tooltip, Select, LayoutHeader, LayoutSider, Layout as Layout$1, LayoutContent, Form, Row, Col, FormItem, SelectOption, Switch, InputNumber } from 'ant-design-vue';
|
|
7
7
|
import _, { isPlainObject as isPlainObject$1, omit, differenceBy, cloneDeep, isObject as isObject$2, concat } from 'lodash';
|
|
8
|
-
import dayjs from 'dayjs';
|
|
9
8
|
import { loadMicroApp } from 'qiankun';
|
|
9
|
+
import dayjs from 'dayjs';
|
|
10
10
|
import 'vite-plugin-qiankun';
|
|
11
11
|
import { qiankunWindow } from 'vite-plugin-qiankun/dist/helper';
|
|
12
12
|
import { XPopup, CommentBlock, setAxiosOption } from '@sszj-temp/mobile';
|
|
@@ -252,7 +252,7 @@ function useActiveMenu(menuList, extraPages, isNav = false, watchOnce = false, i
|
|
|
252
252
|
return menu;
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
function _isSlot$
|
|
255
|
+
function _isSlot$e(s) {
|
|
256
256
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
257
257
|
}
|
|
258
258
|
const Header$1 = defineComponent({
|
|
@@ -347,7 +347,7 @@ const Header$1 = defineComponent({
|
|
|
347
347
|
"selectedKeys": acitveMenuKey.value,
|
|
348
348
|
"onUpdate:selectedKeys": $event => acitveMenuKey.value = $event,
|
|
349
349
|
"onSelect": handleMenuSelected
|
|
350
|
-
}, _isSlot$
|
|
350
|
+
}, _isSlot$e(_slot = props.menu.map(item => createVNode(MenuItem, {
|
|
351
351
|
"key": item.id,
|
|
352
352
|
"title": item.name
|
|
353
353
|
}, {
|
|
@@ -415,7 +415,7 @@ const Header$1 = defineComponent({
|
|
|
415
415
|
}
|
|
416
416
|
});
|
|
417
417
|
|
|
418
|
-
function _isSlot$
|
|
418
|
+
function _isSlot$d(s) {
|
|
419
419
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
420
420
|
}
|
|
421
421
|
const renderMenuItem = item => {
|
|
@@ -497,13 +497,91 @@ const SideMenu$1 = defineComponent({
|
|
|
497
497
|
"onUpdate:openKeys": $event => expandKeys.value = $event,
|
|
498
498
|
"selectedKeys": activeMenu.value,
|
|
499
499
|
"onSelect": handleMenuSelect
|
|
500
|
-
}, _isSlot$
|
|
500
|
+
}, _isSlot$d(_slot = props.menu.map(item => renderMenuItem(item))) ? _slot : {
|
|
501
501
|
default: () => [_slot]
|
|
502
502
|
});
|
|
503
503
|
};
|
|
504
504
|
}
|
|
505
505
|
});
|
|
506
506
|
|
|
507
|
+
function useActiveApp() {
|
|
508
|
+
const route = useRoute();
|
|
509
|
+
const activeAppName = computed(() => {
|
|
510
|
+
return route.path.split("/")[1];
|
|
511
|
+
});
|
|
512
|
+
return activeAppName;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
const loadedApp = /* @__PURE__ */new Map();
|
|
516
|
+
function useMicroApp(appList) {
|
|
517
|
+
const route = useRoute();
|
|
518
|
+
const activeAppName = useActiveApp();
|
|
519
|
+
const loadAppList = ref(Array.from(loadedApp.values()));
|
|
520
|
+
const appContainerList = ref([]);
|
|
521
|
+
const handleRouteChange = useThrottleFn(async () => {
|
|
522
|
+
const microAppName = activeAppName.value;
|
|
523
|
+
let microAppDefine = appList.find(item => item.name === microAppName);
|
|
524
|
+
if (!microAppDefine && !microAppName.startsWith("mtip-")) return;
|
|
525
|
+
const domId = `microApp_${microAppName}`;
|
|
526
|
+
if (!appContainerList.value.some(item => item.id === domId)) {
|
|
527
|
+
appContainerList.value.push({
|
|
528
|
+
name: microAppName,
|
|
529
|
+
id: domId
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
setTimeout(async () => {
|
|
533
|
+
const loadApp = loadedApp.get(microAppName);
|
|
534
|
+
if (loadApp) {
|
|
535
|
+
if (!loadApp.mounted) {
|
|
536
|
+
loadApp.app.mount();
|
|
537
|
+
}
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
const app = loadMicroApp({
|
|
541
|
+
name: microAppDefine ? microAppDefine.name : microAppName,
|
|
542
|
+
entry: microAppDefine ? microAppDefine.entry : `/${microAppName}/`,
|
|
543
|
+
container: `#${domId}`
|
|
544
|
+
});
|
|
545
|
+
const microApp = {
|
|
546
|
+
name: microAppName,
|
|
547
|
+
domId,
|
|
548
|
+
app,
|
|
549
|
+
mounted: true
|
|
550
|
+
};
|
|
551
|
+
loadAppList.value.push(microApp);
|
|
552
|
+
loadedApp.set(microAppName, microApp);
|
|
553
|
+
await app.mountPromise;
|
|
554
|
+
}, 10);
|
|
555
|
+
}, 100);
|
|
556
|
+
watch(route, handleRouteChange, {
|
|
557
|
+
immediate: true
|
|
558
|
+
});
|
|
559
|
+
onBeforeUnmount(() => {
|
|
560
|
+
loadedApp.forEach(item => item.mounted = false);
|
|
561
|
+
});
|
|
562
|
+
return [loadAppList, appContainerList];
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
function onAddExtraTabs(handler) {
|
|
566
|
+
const route = useRoute();
|
|
567
|
+
const qiankunState = inject("qiankunState");
|
|
568
|
+
watch(() => qiankunState.value.extraTabs, (val = [], prev = []) => {
|
|
569
|
+
if (val.length > prev.length) {
|
|
570
|
+
const added = differenceBy(val, prev, item => item.key + item.uniqueKey).map(item => ({
|
|
571
|
+
...item,
|
|
572
|
+
params: route.query
|
|
573
|
+
}));
|
|
574
|
+
handler(added.map(item => ({
|
|
575
|
+
...item,
|
|
576
|
+
type: "extraTab"
|
|
577
|
+
})));
|
|
578
|
+
}
|
|
579
|
+
}, {
|
|
580
|
+
deep: true,
|
|
581
|
+
immediate: true
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
|
|
507
585
|
function useQiankunStateValue(key) {
|
|
508
586
|
const qiankunState = inject("qiankunState");
|
|
509
587
|
if (_.isEmpty(qiankunState)) return;
|
|
@@ -6411,82 +6489,73 @@ function useRouteActive() {
|
|
|
6411
6489
|
return isActive;
|
|
6412
6490
|
}
|
|
6413
6491
|
|
|
6414
|
-
function
|
|
6415
|
-
const
|
|
6416
|
-
const
|
|
6417
|
-
|
|
6492
|
+
function useChildTheme(containerRef, isFullscreen, loadAppList) {
|
|
6493
|
+
const theme = useLocalStorage("theme", "default");
|
|
6494
|
+
const globalTheme = useQiankunStateValue("theme");
|
|
6495
|
+
globalTheme.value = theme.value;
|
|
6496
|
+
watch([theme, globalTheme, isFullscreen, loadAppList, containerRef], async () => {
|
|
6497
|
+
if (containerRef.value) {
|
|
6498
|
+
await nextTick();
|
|
6499
|
+
const childContainerList = containerRef.value.querySelectorAll("[id^='__qiankun_microapp_wrapper_for_']");
|
|
6500
|
+
const themeText = globalTheme.value === "dark" ? "dark" : "light";
|
|
6501
|
+
for (const child of Array.from(childContainerList)) {
|
|
6502
|
+
child.setAttribute("data-theme", themeText);
|
|
6503
|
+
child.setAttribute("data-doc-theme", themeText);
|
|
6504
|
+
if (isFullscreen.value) {
|
|
6505
|
+
child.setAttribute("fullscreen", "");
|
|
6506
|
+
} else {
|
|
6507
|
+
child.removeAttribute("fullscreen");
|
|
6508
|
+
}
|
|
6509
|
+
}
|
|
6510
|
+
}
|
|
6511
|
+
}, {
|
|
6512
|
+
immediate: true,
|
|
6513
|
+
deep: true
|
|
6418
6514
|
});
|
|
6419
|
-
return activeAppName;
|
|
6420
6515
|
}
|
|
6421
6516
|
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
const
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
const
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
if (
|
|
6434
|
-
|
|
6435
|
-
name: microAppName,
|
|
6436
|
-
id: domId
|
|
6437
|
-
});
|
|
6517
|
+
function useFullscreenLogic(containerRef, iframeList, activeKey) {
|
|
6518
|
+
const isFullscreenIframe = ref(false);
|
|
6519
|
+
const {
|
|
6520
|
+
isFullscreen,
|
|
6521
|
+
enter
|
|
6522
|
+
} = useFullscreen(containerRef);
|
|
6523
|
+
const {
|
|
6524
|
+
elementY
|
|
6525
|
+
} = useMouseInElement(containerRef);
|
|
6526
|
+
const isTabsShow = ref(false);
|
|
6527
|
+
watchEffect(() => {
|
|
6528
|
+
if (isFullscreen.value) {
|
|
6529
|
+
isTabsShow.value = false;
|
|
6438
6530
|
}
|
|
6439
|
-
setTimeout(async () => {
|
|
6440
|
-
const loadApp = loadedApp.get(microAppName);
|
|
6441
|
-
if (loadApp) {
|
|
6442
|
-
if (!loadApp.mounted) {
|
|
6443
|
-
loadApp.app.mount();
|
|
6444
|
-
}
|
|
6445
|
-
return;
|
|
6446
|
-
}
|
|
6447
|
-
const app = loadMicroApp({
|
|
6448
|
-
name: microAppDefine ? microAppDefine.name : microAppName,
|
|
6449
|
-
entry: microAppDefine ? microAppDefine.entry : `/${microAppName}/`,
|
|
6450
|
-
container: `#${domId}`
|
|
6451
|
-
});
|
|
6452
|
-
const microApp = {
|
|
6453
|
-
name: microAppName,
|
|
6454
|
-
domId,
|
|
6455
|
-
app,
|
|
6456
|
-
mounted: true
|
|
6457
|
-
};
|
|
6458
|
-
loadAppList.value.push(microApp);
|
|
6459
|
-
loadedApp.set(microAppName, microApp);
|
|
6460
|
-
await app.mountPromise;
|
|
6461
|
-
}, 10);
|
|
6462
|
-
}, 100);
|
|
6463
|
-
watch(route, handleRouteChange, {
|
|
6464
|
-
immediate: true
|
|
6465
6531
|
});
|
|
6466
|
-
|
|
6467
|
-
|
|
6532
|
+
watchEffect(() => {
|
|
6533
|
+
if (elementY.value < 10) {
|
|
6534
|
+
isTabsShow.value = true;
|
|
6535
|
+
}
|
|
6468
6536
|
});
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
const added = differenceBy(val, prev, item => item.key + item.uniqueKey).map(item => ({
|
|
6478
|
-
...item,
|
|
6479
|
-
params: route.query
|
|
6480
|
-
}));
|
|
6481
|
-
handler(added.map(item => ({
|
|
6482
|
-
...item,
|
|
6483
|
-
type: "extraTab"
|
|
6484
|
-
})));
|
|
6537
|
+
const isPadding = computed(() => {
|
|
6538
|
+
let iframePadding = false;
|
|
6539
|
+
if (activeKey.value) {
|
|
6540
|
+
const currentIframe = iframeList.value.find(item => item.id === activeKey.value);
|
|
6541
|
+
if (currentIframe) {
|
|
6542
|
+
iframePadding = currentIframe.url.includes("hasPadding");
|
|
6543
|
+
if (!iframePadding) return false;
|
|
6544
|
+
}
|
|
6485
6545
|
}
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
immediate: true
|
|
6546
|
+
if (isFullscreen.value) return false;
|
|
6547
|
+
return !isFullscreenIframe.value;
|
|
6489
6548
|
});
|
|
6549
|
+
const handleFullscreen = tab => {
|
|
6550
|
+
isFullscreenIframe.value = tab.mode === 2;
|
|
6551
|
+
enter();
|
|
6552
|
+
};
|
|
6553
|
+
return {
|
|
6554
|
+
isFullscreen,
|
|
6555
|
+
isTabsShow,
|
|
6556
|
+
isPadding,
|
|
6557
|
+
handleFullscreen
|
|
6558
|
+
};
|
|
6490
6559
|
}
|
|
6491
6560
|
|
|
6492
6561
|
function setParam(searchParams, obj) {
|
|
@@ -6607,7 +6676,7 @@ const TabList = defineComponent({
|
|
|
6607
6676
|
}
|
|
6608
6677
|
});
|
|
6609
6678
|
onBeforeUnmount(() => tabList.value = []);
|
|
6610
|
-
watchArray(tabList, async (
|
|
6679
|
+
watchArray(tabList, async (_val, _prev, _added, removed) => {
|
|
6611
6680
|
for (const tab of removed) {
|
|
6612
6681
|
if (tab.isExtraTab) {
|
|
6613
6682
|
const idx = qiankunState.value.extraTabs.findIndex(item => item.key === tab.key && item.uniqueKey === tab.uniqueKey);
|
|
@@ -6855,32 +6924,33 @@ const TabList = defineComponent({
|
|
|
6855
6924
|
}
|
|
6856
6925
|
});
|
|
6857
6926
|
|
|
6858
|
-
const
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
type: Object
|
|
6862
|
-
},
|
|
6863
|
-
menu: {
|
|
6864
|
-
type: Array,
|
|
6865
|
-
default: () => []
|
|
6866
|
-
},
|
|
6867
|
-
extraPages: {
|
|
6868
|
-
type: Array,
|
|
6869
|
-
required: true
|
|
6870
|
-
},
|
|
6871
|
-
appList: {
|
|
6872
|
-
type: Array,
|
|
6873
|
-
required: true
|
|
6874
|
-
},
|
|
6875
|
-
showTabList: {
|
|
6876
|
-
type: Boolean,
|
|
6877
|
-
default: true
|
|
6878
|
-
},
|
|
6879
|
-
pageContainerRef: {
|
|
6880
|
-
type: Object,
|
|
6881
|
-
required: true
|
|
6882
|
-
}
|
|
6927
|
+
const Props$1 = {
|
|
6928
|
+
currMenu: {
|
|
6929
|
+
type: Object
|
|
6883
6930
|
},
|
|
6931
|
+
menu: {
|
|
6932
|
+
type: Array,
|
|
6933
|
+
default: () => []
|
|
6934
|
+
},
|
|
6935
|
+
extraPages: {
|
|
6936
|
+
type: Array,
|
|
6937
|
+
required: true
|
|
6938
|
+
},
|
|
6939
|
+
appList: {
|
|
6940
|
+
type: Array,
|
|
6941
|
+
required: true
|
|
6942
|
+
},
|
|
6943
|
+
showTabList: {
|
|
6944
|
+
type: Boolean,
|
|
6945
|
+
default: true
|
|
6946
|
+
},
|
|
6947
|
+
pageContainerRef: {
|
|
6948
|
+
type: Object,
|
|
6949
|
+
required: true
|
|
6950
|
+
}
|
|
6951
|
+
};
|
|
6952
|
+
const PageContent = defineComponent({
|
|
6953
|
+
props: Props$1,
|
|
6884
6954
|
setup(props, {
|
|
6885
6955
|
emit
|
|
6886
6956
|
}) {
|
|
@@ -6908,12 +6978,12 @@ const PageContent = defineComponent({
|
|
|
6908
6978
|
extraPageList.value.splice(idx, 1);
|
|
6909
6979
|
}
|
|
6910
6980
|
};
|
|
6911
|
-
const handleMenuChange = val => {
|
|
6981
|
+
const handleMenuChange = (val, isFromMenu = false) => {
|
|
6912
6982
|
if (!val) return;
|
|
6913
6983
|
const routeQuery = {
|
|
6914
6984
|
...route.query
|
|
6915
6985
|
};
|
|
6916
|
-
const queryCombine = Object.assign(val.params
|
|
6986
|
+
const queryCombine = Object.assign({}, val.params, routeQuery);
|
|
6917
6987
|
if (val.isExtra) {
|
|
6918
6988
|
const exist = extraPageList.value.find(item => item.key === val.key && item.uniqueKey === val.uniqueKey);
|
|
6919
6989
|
if (!exist) {
|
|
@@ -6951,15 +7021,15 @@ const PageContent = defineComponent({
|
|
|
6951
7021
|
const tab = _.cloneDeep(val);
|
|
6952
7022
|
switch (mode) {
|
|
6953
7023
|
case 0:
|
|
6954
|
-
if (
|
|
7024
|
+
if (isOpened) {
|
|
7025
|
+
openedTab.params = isFromMenu ? val.params : queryCombine;
|
|
7026
|
+
val.params = isFromMenu ? val.params : queryCombine;
|
|
7027
|
+
} else {
|
|
6955
7028
|
tabList.value.push({
|
|
6956
7029
|
...tab,
|
|
6957
7030
|
key: key ?? id,
|
|
6958
7031
|
type: "menu"
|
|
6959
7032
|
});
|
|
6960
|
-
} else {
|
|
6961
|
-
openedTab.params = queryCombine;
|
|
6962
|
-
val.params = queryCombine;
|
|
6963
7033
|
}
|
|
6964
7034
|
const [path, currSearch = ""] = url.split("?");
|
|
6965
7035
|
const searchObj = new URLSearchParams(currSearch);
|
|
@@ -7043,7 +7113,7 @@ const PageContent = defineComponent({
|
|
|
7043
7113
|
}, {
|
|
7044
7114
|
immediate: true
|
|
7045
7115
|
});
|
|
7046
|
-
watch(() => props.currMenu, handleMenuChange, {
|
|
7116
|
+
watch(() => props.currMenu, val => handleMenuChange(val, true), {
|
|
7047
7117
|
immediate: true
|
|
7048
7118
|
});
|
|
7049
7119
|
useEventListener("message", e => {
|
|
@@ -7072,85 +7142,38 @@ const PageContent = defineComponent({
|
|
|
7072
7142
|
}, {
|
|
7073
7143
|
immediate: true
|
|
7074
7144
|
});
|
|
7075
|
-
watch(() => qiankunState.value.activeTabKey, val =>
|
|
7145
|
+
watch(() => qiankunState.value.activeTabKey, val => {
|
|
7146
|
+
if (activeKey !== val) {
|
|
7147
|
+
requestAnimationFrame(() => {
|
|
7148
|
+
activeKey.value = val;
|
|
7149
|
+
});
|
|
7150
|
+
}
|
|
7151
|
+
});
|
|
7076
7152
|
onAddExtraTabs(added => {
|
|
7077
7153
|
tabList.value.push(...added);
|
|
7078
7154
|
});
|
|
7079
|
-
const isFullscreenIframe = ref(false);
|
|
7080
7155
|
const {
|
|
7081
7156
|
isFullscreen,
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
} = useMouseInElement(containerRef);
|
|
7087
|
-
const isTabsShow = ref(false);
|
|
7088
|
-
watchEffect(() => {
|
|
7089
|
-
if (isFullscreen.value) {
|
|
7090
|
-
isTabsShow.value = false;
|
|
7091
|
-
}
|
|
7092
|
-
});
|
|
7093
|
-
watchEffect(() => {
|
|
7094
|
-
if (elementY.value < 10) {
|
|
7095
|
-
isTabsShow.value = true;
|
|
7096
|
-
}
|
|
7097
|
-
});
|
|
7098
|
-
const isPadding = computed(() => {
|
|
7099
|
-
let iframePadding = false;
|
|
7100
|
-
if (activeKey.value) {
|
|
7101
|
-
const currentIframe = iframeList.value.find(item => item.id === activeKey.value);
|
|
7102
|
-
if (currentIframe) {
|
|
7103
|
-
iframePadding = currentIframe.url.includes("hasPadding");
|
|
7104
|
-
if (!iframePadding) return false;
|
|
7105
|
-
}
|
|
7106
|
-
}
|
|
7107
|
-
if (isFullscreen.value) return false;
|
|
7108
|
-
return !isFullscreenIframe.value;
|
|
7109
|
-
});
|
|
7110
|
-
const handleFullscreen = tab => {
|
|
7111
|
-
isFullscreenIframe.value = tab.mode === 2;
|
|
7112
|
-
enter();
|
|
7113
|
-
};
|
|
7157
|
+
handleFullscreen,
|
|
7158
|
+
isPadding,
|
|
7159
|
+
isTabsShow
|
|
7160
|
+
} = useFullscreenLogic(containerRef, iframeList, activeKey);
|
|
7114
7161
|
const handleRefreshIframe = async ({
|
|
7115
7162
|
id
|
|
7116
7163
|
}) => {
|
|
7117
7164
|
const iframe = iframeList.value.find(item => item.id === id);
|
|
7118
|
-
if (iframe)
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
}
|
|
7165
|
+
if (!iframe) return;
|
|
7166
|
+
iframe.refreshKey = Date.now();
|
|
7167
|
+
const reqCode = await checkIframeUrl(iframe.url);
|
|
7168
|
+
iframe.reqCode = reqCode;
|
|
7123
7169
|
};
|
|
7124
7170
|
const handleRefreshExtraPage = ({
|
|
7125
7171
|
key
|
|
7126
7172
|
}) => {
|
|
7127
7173
|
const page = extraPageList.value.find(item => item.key === key);
|
|
7128
|
-
|
|
7129
|
-
page.refreshKey = Date.now();
|
|
7130
|
-
}
|
|
7174
|
+
page && (page.refreshKey = Date.now());
|
|
7131
7175
|
};
|
|
7132
|
-
|
|
7133
|
-
const globalTheme = useQiankunStateValue("theme");
|
|
7134
|
-
globalTheme.value = theme.value;
|
|
7135
|
-
watch([theme, globalTheme, isFullscreen, loadAppList, containerRef], async () => {
|
|
7136
|
-
if (containerRef.value) {
|
|
7137
|
-
await nextTick();
|
|
7138
|
-
const childContainerList = containerRef.value.querySelectorAll("[id^='__qiankun_microapp_wrapper_for_']");
|
|
7139
|
-
const themeText = globalTheme.value === "dark" ? "dark" : "light";
|
|
7140
|
-
for (const child of Array.from(childContainerList)) {
|
|
7141
|
-
child.setAttribute("data-theme", themeText);
|
|
7142
|
-
child.setAttribute("data-doc-theme", themeText);
|
|
7143
|
-
if (isFullscreen.value) {
|
|
7144
|
-
child.setAttribute("fullscreen", "");
|
|
7145
|
-
} else {
|
|
7146
|
-
child.removeAttribute("fullscreen");
|
|
7147
|
-
}
|
|
7148
|
-
}
|
|
7149
|
-
}
|
|
7150
|
-
}, {
|
|
7151
|
-
immediate: true,
|
|
7152
|
-
deep: true
|
|
7153
|
-
});
|
|
7176
|
+
useChildTheme(containerRef, isFullscreen, loadAppList);
|
|
7154
7177
|
const closeExtraPage = tab => {
|
|
7155
7178
|
tabListRef.value?.closeTab(tab);
|
|
7156
7179
|
};
|
|
@@ -7159,122 +7182,186 @@ const PageContent = defineComponent({
|
|
|
7159
7182
|
app.app.unmount();
|
|
7160
7183
|
}
|
|
7161
7184
|
});
|
|
7162
|
-
return () =>
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
7171
|
-
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
}, null), [[vShow, !isFullscreen.value || isTabsShow.value]]), createVNode("div", {
|
|
7180
|
-
"class": ["page-container", {
|
|
7185
|
+
return () => {
|
|
7186
|
+
const tabs = withDirectives(createVNode(TabList, {
|
|
7187
|
+
"ref": tabListRef,
|
|
7188
|
+
"activeKey": activeKey.value,
|
|
7189
|
+
"onUpdate:activeKey": $event => activeKey.value = $event,
|
|
7190
|
+
"list": tabList.value,
|
|
7191
|
+
"onUpdate:list": $event => tabList.value = $event,
|
|
7192
|
+
"containerRef": containerRef,
|
|
7193
|
+
"onTabSelect": onTabSelect,
|
|
7194
|
+
"onCloseExtraPage": handleExtraPageClose,
|
|
7195
|
+
"onCloseIframePage": handleIframePageClose,
|
|
7196
|
+
"onFullscreen": handleFullscreen,
|
|
7197
|
+
"onRefreshIframe": handleRefreshIframe,
|
|
7198
|
+
"onRefreshExtraPage": handleRefreshExtraPage,
|
|
7199
|
+
"onMouseLeave": () => isTabsShow.value = false
|
|
7200
|
+
}, null), [[vShow, !isFullscreen.value || isTabsShow.value]]);
|
|
7201
|
+
const containerCns = {
|
|
7181
7202
|
padding: isPadding.value,
|
|
7182
7203
|
fullscreen: isFullscreen.value
|
|
7183
|
-
}
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7204
|
+
};
|
|
7205
|
+
const iframeRender = item => {
|
|
7206
|
+
const show = item.id === activeKey.value;
|
|
7207
|
+
if (item.reqCode === 200 || item.reqCode === void 0) {
|
|
7208
|
+
return createVNode("iframe", {
|
|
7209
|
+
"class": "menu-iframe",
|
|
7210
|
+
"key": item.id + item.refreshKey,
|
|
7211
|
+
"id": "iframe" + item.id,
|
|
7212
|
+
"style": {
|
|
7213
|
+
zIndex: show ? "" : "-100"
|
|
7214
|
+
},
|
|
7215
|
+
"src": item.url,
|
|
7216
|
+
"frameborder": "0"
|
|
7217
|
+
}, null);
|
|
7218
|
+
}
|
|
7219
|
+
let src = "/micro-assets/platform_web/developing.png";
|
|
7220
|
+
if (item.reqCode === 404) {
|
|
7221
|
+
src = "/micro-assets/platform_web/page404.png";
|
|
7222
|
+
}
|
|
7223
|
+
return withDirectives(createVNode("div", {
|
|
7224
|
+
"class": "iframe-fallback"
|
|
7225
|
+
}, [createVNode("img", {
|
|
7226
|
+
"src": src,
|
|
7227
|
+
"alt": ""
|
|
7228
|
+
}, null)]), [[vShow, show]]);
|
|
7229
|
+
};
|
|
7230
|
+
const childTypes = [];
|
|
7231
|
+
childTypes.push(createVNode(Fragment, null, [appDomList.value.map(item => withDirectives(createVNode("div", {
|
|
7232
|
+
"key": item.id,
|
|
7233
|
+
"id": item.id
|
|
7234
|
+
}, null), [[vShow, item.name === activeAppName.value]]))]));
|
|
7235
|
+
childTypes.push(createVNode(Fragment, null, [iframeList.value.map(iframeRender)]));
|
|
7236
|
+
childTypes.push(createVNode(Fragment, null, [extraPageList.value.map(item => {
|
|
7237
|
+
const extraPageShoe = getTabUniqueKey(item) === activeKey.value;
|
|
7238
|
+
return withDirectives(createVNode("div", {
|
|
7239
|
+
"key": item.key + item.refreshKey,
|
|
7195
7240
|
"style": {
|
|
7196
|
-
|
|
7197
|
-
}
|
|
7198
|
-
|
|
7199
|
-
"
|
|
7200
|
-
}, null);
|
|
7201
|
-
}
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
}
|
|
7206
|
-
|
|
7207
|
-
"
|
|
7208
|
-
}, [
|
|
7209
|
-
|
|
7210
|
-
"alt": ""
|
|
7211
|
-
}, null)]), [[vShow, show]]);
|
|
7212
|
-
}), extraPageList.value.map(item => withDirectives(createVNode("div", {
|
|
7213
|
-
"key": item.key + item.refreshKey,
|
|
7214
|
-
"style": {
|
|
7215
|
-
"min-height": "100%"
|
|
7216
|
-
}
|
|
7217
|
-
}, [createVNode(item.component, {
|
|
7218
|
-
"onClose": () => closeExtraPage(item)
|
|
7219
|
-
}, null)]), [[vShow, getTabUniqueKey(item) === activeKey.value]]))])]);
|
|
7241
|
+
"min-height": "100%"
|
|
7242
|
+
}
|
|
7243
|
+
}, [createVNode(item.component, {
|
|
7244
|
+
"onClose": () => closeExtraPage(item)
|
|
7245
|
+
}, null)]), [[vShow, extraPageShoe]]);
|
|
7246
|
+
})]));
|
|
7247
|
+
return createVNode("div", {
|
|
7248
|
+
"class": "page-content",
|
|
7249
|
+
"ref": containerRef
|
|
7250
|
+
}, [props.showTabList && tabs, createVNode("div", {
|
|
7251
|
+
"class": ["page-container", containerCns],
|
|
7252
|
+
"ref": props.pageContainerRef
|
|
7253
|
+
}, [childTypes])]);
|
|
7254
|
+
};
|
|
7220
7255
|
}
|
|
7221
7256
|
});
|
|
7222
7257
|
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
required: true
|
|
7239
|
-
},
|
|
7240
|
-
// 额外的页面
|
|
7241
|
-
extraPages: {
|
|
7242
|
-
type: Array,
|
|
7243
|
-
default: () => []
|
|
7244
|
-
},
|
|
7245
|
-
// 未读消息
|
|
7246
|
-
messageCount: {
|
|
7247
|
-
type: Number,
|
|
7248
|
-
default: 0
|
|
7249
|
-
},
|
|
7250
|
-
// 网页logo
|
|
7251
|
-
logo: {
|
|
7252
|
-
type: String
|
|
7253
|
-
},
|
|
7254
|
-
appList: {
|
|
7255
|
-
type: Array,
|
|
7256
|
-
required: true
|
|
7257
|
-
},
|
|
7258
|
-
// 展示菜单
|
|
7259
|
-
withMenu: {
|
|
7260
|
-
type: Boolean,
|
|
7261
|
-
default: true
|
|
7262
|
-
},
|
|
7263
|
-
// 展示在左侧的菜单(不展示菜单模式)
|
|
7264
|
-
sideMenu: {
|
|
7265
|
-
type: Array
|
|
7266
|
-
},
|
|
7267
|
-
// 展示导航栏菜单和搜索框
|
|
7268
|
-
showNav: {
|
|
7269
|
-
type: Boolean,
|
|
7270
|
-
default: true
|
|
7271
|
-
},
|
|
7272
|
-
// 是否展示我的消息
|
|
7273
|
-
showNotice: {
|
|
7274
|
-
type: Boolean,
|
|
7275
|
-
default: true
|
|
7258
|
+
function useFakeModal(pageContainerRef) {
|
|
7259
|
+
const showMask = ref(false);
|
|
7260
|
+
useEventListener("message", e => {
|
|
7261
|
+
const {
|
|
7262
|
+
data: event
|
|
7263
|
+
} = e;
|
|
7264
|
+
const {
|
|
7265
|
+
type,
|
|
7266
|
+
val,
|
|
7267
|
+
delay = 0
|
|
7268
|
+
} = event;
|
|
7269
|
+
if (type === "toggleMask") {
|
|
7270
|
+
setTimeout(() => {
|
|
7271
|
+
showMask.value = val;
|
|
7272
|
+
}, delay);
|
|
7276
7273
|
}
|
|
7274
|
+
});
|
|
7275
|
+
const pageBounding = useElementBounding(pageContainerRef);
|
|
7276
|
+
const modalPath = computed(() => {
|
|
7277
|
+
const {
|
|
7278
|
+
top,
|
|
7279
|
+
bottom,
|
|
7280
|
+
left,
|
|
7281
|
+
right
|
|
7282
|
+
} = pageBounding;
|
|
7283
|
+
const topDis = Math.round(top.value);
|
|
7284
|
+
const rightDis = Math.round(window.innerWidth - right.value);
|
|
7285
|
+
const bottomDis = Math.round(window.innerHeight - bottom.value);
|
|
7286
|
+
const leftDis = Math.round(left.value);
|
|
7287
|
+
return `polygon(
|
|
7288
|
+
0% 0%,
|
|
7289
|
+
0% 100%,
|
|
7290
|
+
${leftDis}px 100%,
|
|
7291
|
+
${leftDis}px ${topDis}px,
|
|
7292
|
+
calc(100% - ${rightDis}px) ${topDis}px,
|
|
7293
|
+
calc(100% - ${rightDis}px) calc(100% - ${bottomDis}px),
|
|
7294
|
+
${leftDis}px calc(100% - ${bottomDis}px),
|
|
7295
|
+
${leftDis}px 100%,
|
|
7296
|
+
100% 100%,
|
|
7297
|
+
100% 0%
|
|
7298
|
+
)`;
|
|
7299
|
+
});
|
|
7300
|
+
return {
|
|
7301
|
+
showMask,
|
|
7302
|
+
modalPath
|
|
7303
|
+
};
|
|
7304
|
+
}
|
|
7305
|
+
|
|
7306
|
+
function _isSlot$c(s) {
|
|
7307
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
7308
|
+
}
|
|
7309
|
+
const Props = {
|
|
7310
|
+
// 用户权限菜单
|
|
7311
|
+
userMenu: {
|
|
7312
|
+
type: Array,
|
|
7313
|
+
required: true
|
|
7314
|
+
},
|
|
7315
|
+
// 版权信息
|
|
7316
|
+
copyRight: {
|
|
7317
|
+
type: String
|
|
7318
|
+
},
|
|
7319
|
+
// 用户
|
|
7320
|
+
userInfo: {
|
|
7321
|
+
type: Object,
|
|
7322
|
+
required: true
|
|
7277
7323
|
},
|
|
7324
|
+
// 额外的页面
|
|
7325
|
+
extraPages: {
|
|
7326
|
+
type: Array,
|
|
7327
|
+
default: () => []
|
|
7328
|
+
},
|
|
7329
|
+
// 未读消息
|
|
7330
|
+
messageCount: {
|
|
7331
|
+
type: Number,
|
|
7332
|
+
default: 0
|
|
7333
|
+
},
|
|
7334
|
+
// 网页logo
|
|
7335
|
+
logo: {
|
|
7336
|
+
type: String
|
|
7337
|
+
},
|
|
7338
|
+
appList: {
|
|
7339
|
+
type: Array,
|
|
7340
|
+
required: true
|
|
7341
|
+
},
|
|
7342
|
+
// 展示菜单
|
|
7343
|
+
withMenu: {
|
|
7344
|
+
type: Boolean,
|
|
7345
|
+
default: true
|
|
7346
|
+
},
|
|
7347
|
+
// 展示在左侧的菜单(不展示菜单模式)
|
|
7348
|
+
sideMenu: {
|
|
7349
|
+
type: Array
|
|
7350
|
+
},
|
|
7351
|
+
// 展示导航栏菜单和搜索框
|
|
7352
|
+
showNav: {
|
|
7353
|
+
type: Boolean,
|
|
7354
|
+
default: true
|
|
7355
|
+
},
|
|
7356
|
+
// 是否展示我的消息
|
|
7357
|
+
showNotice: {
|
|
7358
|
+
type: Boolean,
|
|
7359
|
+
default: true
|
|
7360
|
+
}
|
|
7361
|
+
};
|
|
7362
|
+
const Layout = defineComponent({
|
|
7363
|
+
emits: ["globalSearch", "personalCenter", "logout", "extraPage"],
|
|
7364
|
+
props: Props,
|
|
7278
7365
|
setup(props, {
|
|
7279
7366
|
emit
|
|
7280
7367
|
}) {
|
|
@@ -7287,15 +7374,13 @@ const Layout = defineComponent({
|
|
|
7287
7374
|
const siderMenu = ref([]);
|
|
7288
7375
|
const sideMenuShow = computed(() => props.sideMenu || siderMenu.value);
|
|
7289
7376
|
const showSideMenu = computed(() => props.withMenu || !!props.sideMenu);
|
|
7290
|
-
|
|
7291
|
-
if (
|
|
7292
|
-
const refMenu = getMenuByKey(
|
|
7377
|
+
watchEffect(() => {
|
|
7378
|
+
if (props.userMenu.length > 0 && menuRef) {
|
|
7379
|
+
const refMenu = getMenuByKey(props.userMenu, menuRef, "remark");
|
|
7293
7380
|
if (refMenu) {
|
|
7294
7381
|
siderMenu.value = [refMenu];
|
|
7295
7382
|
}
|
|
7296
7383
|
}
|
|
7297
|
-
}, {
|
|
7298
|
-
immediate: true
|
|
7299
7384
|
});
|
|
7300
7385
|
const showHeader = computed(() => props.withMenu && !menuRef && !isOnlyPage);
|
|
7301
7386
|
const showSide = computed(() => showSideMenu.value && !isOnlyPage);
|
|
@@ -7326,52 +7411,19 @@ const Layout = defineComponent({
|
|
|
7326
7411
|
refreshTabKey: ""
|
|
7327
7412
|
};
|
|
7328
7413
|
});
|
|
7329
|
-
const showMask = ref(false);
|
|
7330
|
-
useEventListener("message", e => {
|
|
7331
|
-
const {
|
|
7332
|
-
data: event
|
|
7333
|
-
} = e;
|
|
7334
|
-
const {
|
|
7335
|
-
type,
|
|
7336
|
-
val,
|
|
7337
|
-
delay = 0
|
|
7338
|
-
} = event;
|
|
7339
|
-
if (type === "toggleMask") {
|
|
7340
|
-
setTimeout(() => {
|
|
7341
|
-
showMask.value = val;
|
|
7342
|
-
}, delay);
|
|
7343
|
-
}
|
|
7344
|
-
});
|
|
7345
7414
|
const pageContainerRef = ref();
|
|
7346
|
-
const
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
const
|
|
7358
|
-
return `polygon(
|
|
7359
|
-
0% 0%,
|
|
7360
|
-
0% 100%,
|
|
7361
|
-
${leftDis}px 100%,
|
|
7362
|
-
${leftDis}px ${topDis}px,
|
|
7363
|
-
calc(100% - ${rightDis}px) ${topDis}px,
|
|
7364
|
-
calc(100% - ${rightDis}px) calc(100% - ${bottomDis}px),
|
|
7365
|
-
${leftDis}px calc(100% - ${bottomDis}px),
|
|
7366
|
-
${leftDis}px 100%,
|
|
7367
|
-
100% 100%,
|
|
7368
|
-
100% 0%
|
|
7369
|
-
)`;
|
|
7370
|
-
});
|
|
7371
|
-
return () => createVNode("div", {
|
|
7372
|
-
"class": `${config.prefix}-layout`
|
|
7373
|
-
}, [createVNode(Layout$1, null, {
|
|
7374
|
-
default: () => [showHeader.value && createVNode(LayoutHeader, null, {
|
|
7415
|
+
const {
|
|
7416
|
+
showMask,
|
|
7417
|
+
modalPath
|
|
7418
|
+
} = useFakeModal(pageContainerRef);
|
|
7419
|
+
return () => {
|
|
7420
|
+
const modalMask = createVNode("div", {
|
|
7421
|
+
"class": "layout-mask",
|
|
7422
|
+
"style": {
|
|
7423
|
+
clipPath: modalPath.value
|
|
7424
|
+
}
|
|
7425
|
+
}, null);
|
|
7426
|
+
const header = createVNode(LayoutHeader, null, {
|
|
7375
7427
|
default: () => [createVNode(Header$1, {
|
|
7376
7428
|
"menu": props.showNav ? props.userMenu : [],
|
|
7377
7429
|
"withSearch": props.showNav,
|
|
@@ -7386,47 +7438,49 @@ const Layout = defineComponent({
|
|
|
7386
7438
|
"onLogout": () => emit("logout"),
|
|
7387
7439
|
"onExtraPage": e => emit("extraPage", e)
|
|
7388
7440
|
}, null)]
|
|
7389
|
-
})
|
|
7390
|
-
|
|
7391
|
-
|
|
7392
|
-
|
|
7393
|
-
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7441
|
+
});
|
|
7442
|
+
const sider = createVNode(LayoutSider, {
|
|
7443
|
+
"class": `${config.prefix}-layout-sider`,
|
|
7444
|
+
"width": "10.416vw",
|
|
7445
|
+
"collapsedWidth": "3.125vw",
|
|
7446
|
+
"collapsed": isFolder.value
|
|
7447
|
+
}, {
|
|
7448
|
+
default: () => [createVNode("div", {
|
|
7449
|
+
"class": ["folder", {
|
|
7450
|
+
isFold: isFolder.value
|
|
7451
|
+
}],
|
|
7452
|
+
"onClick": () => toggleFolder()
|
|
7453
|
+
}, [isFolder.value ? createVNode(MenuUnfoldOutlined, null, null) : createVNode(MenuFoldOutlined, null, null)]), createVNode(SideMenu$1, {
|
|
7454
|
+
"menu": sideMenuShow.value,
|
|
7455
|
+
"onMenuSelect": handleMenuSelect,
|
|
7456
|
+
"extraPages": props.extraPages,
|
|
7457
|
+
"expandAll": !!menuRef
|
|
7458
|
+
}, null), createVNode("div", {
|
|
7459
|
+
"class": "copyright"
|
|
7460
|
+
}, [props.copyRight])]
|
|
7461
|
+
});
|
|
7462
|
+
const content = createVNode(PageContent, {
|
|
7463
|
+
"pageContainerRef": pageContainerRef,
|
|
7464
|
+
"currMenu": currMenu.value,
|
|
7465
|
+
"menu": props.userMenu,
|
|
7466
|
+
"extraPages": props.extraPages,
|
|
7467
|
+
"appList": props.appList,
|
|
7468
|
+
"showTabList": (props.withMenu || showSideMenu.value) && !isOnlyPage
|
|
7469
|
+
}, null);
|
|
7470
|
+
return createVNode("div", {
|
|
7471
|
+
"class": `${config.prefix}-layout`
|
|
7472
|
+
}, [createVNode(Layout$1, null, {
|
|
7473
|
+
default: () => [showHeader.value && header, createVNode(Layout$1, null, {
|
|
7474
|
+
default: () => [showSide.value && sider, createVNode(LayoutContent, {
|
|
7475
|
+
"class": {
|
|
7476
|
+
"only-page": isOnlyPage
|
|
7477
|
+
}
|
|
7478
|
+
}, _isSlot$c(content) ? content : {
|
|
7479
|
+
default: () => [content]
|
|
7480
|
+
})]
|
|
7422
7481
|
})]
|
|
7423
|
-
})]
|
|
7424
|
-
}
|
|
7425
|
-
"class": "layout-mask",
|
|
7426
|
-
"style": {
|
|
7427
|
-
clipPath: modalPath.value
|
|
7428
|
-
}
|
|
7429
|
-
}, null)]);
|
|
7482
|
+
}), showMask.value && modalMask]);
|
|
7483
|
+
};
|
|
7430
7484
|
}
|
|
7431
7485
|
});
|
|
7432
7486
|
var index$8 = installComponent(Layout, "layout");
|
|
@@ -8321,39 +8375,41 @@ const ChildHeader = defineComponent({
|
|
|
8321
8375
|
|
|
8322
8376
|
const isIndependentApp = query => !!query.token && !!query.onlyPage;
|
|
8323
8377
|
const loginFun = new Login$1();
|
|
8324
|
-
const
|
|
8325
|
-
|
|
8326
|
-
|
|
8327
|
-
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
|
|
8339
|
-
|
|
8340
|
-
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
8344
|
-
|
|
8345
|
-
|
|
8346
|
-
|
|
8347
|
-
|
|
8348
|
-
|
|
8349
|
-
|
|
8350
|
-
|
|
8351
|
-
|
|
8352
|
-
|
|
8353
|
-
|
|
8354
|
-
|
|
8355
|
-
|
|
8356
|
-
|
|
8378
|
+
const httpUtil = {
|
|
8379
|
+
requestLogo: async () => {
|
|
8380
|
+
const res = await fetch("/api/common/v1/sysconfig/searchImage?imgType=4&editImg=1&clientType=web");
|
|
8381
|
+
const blob = await res.blob();
|
|
8382
|
+
return URL.createObjectURL(blob);
|
|
8383
|
+
},
|
|
8384
|
+
requestUserTree: async () => {
|
|
8385
|
+
const headers = getCommonHeaders();
|
|
8386
|
+
const res = await fetch("/api/common/v1/menu/tree", {
|
|
8387
|
+
headers
|
|
8388
|
+
});
|
|
8389
|
+
const treeData = await res.json();
|
|
8390
|
+
return treeData.data;
|
|
8391
|
+
},
|
|
8392
|
+
requestCopyright: async () => {
|
|
8393
|
+
const res = await fetch("/api/common/v1/sysconfig/getSysConfig?clientType=web");
|
|
8394
|
+
const data = await res.json();
|
|
8395
|
+
return data.data.homepageCopyright;
|
|
8396
|
+
},
|
|
8397
|
+
postLogout: async () => {
|
|
8398
|
+
const headers = getCommonHeaders();
|
|
8399
|
+
await fetch("/api/common/v1/log/insert", {
|
|
8400
|
+
method: "POST",
|
|
8401
|
+
headers: {
|
|
8402
|
+
...headers,
|
|
8403
|
+
"Content-Type": "application/json;charset=UTF-8"
|
|
8404
|
+
},
|
|
8405
|
+
body: JSON.stringify({
|
|
8406
|
+
softSysId: "1",
|
|
8407
|
+
operateId: "111",
|
|
8408
|
+
recordId: "11",
|
|
8409
|
+
content: "\u767B\u51FA"
|
|
8410
|
+
})
|
|
8411
|
+
});
|
|
8412
|
+
}
|
|
8357
8413
|
};
|
|
8358
8414
|
const DefaultLayout = defineComponent({
|
|
8359
8415
|
async beforeRouteEnter(to) {
|
|
@@ -8398,12 +8454,12 @@ const DefaultLayout = defineComponent({
|
|
|
8398
8454
|
const userInfo = useSessionStorage("userinfo", {});
|
|
8399
8455
|
const logo = ref();
|
|
8400
8456
|
const getLogo = async () => {
|
|
8401
|
-
const str = await requestLogo();
|
|
8457
|
+
const str = await httpUtil.requestLogo();
|
|
8402
8458
|
logo.value = str;
|
|
8403
8459
|
};
|
|
8404
8460
|
const copyright = ref("");
|
|
8405
8461
|
const getCopyright = async () => {
|
|
8406
|
-
const str = await requestCopyright();
|
|
8462
|
+
const str = await httpUtil.requestCopyright();
|
|
8407
8463
|
copyright.value = str;
|
|
8408
8464
|
};
|
|
8409
8465
|
const isIndependent = isIndependentApp(route.query);
|
|
@@ -8428,7 +8484,7 @@ const DefaultLayout = defineComponent({
|
|
|
8428
8484
|
});
|
|
8429
8485
|
const permissionMenu = ref([]);
|
|
8430
8486
|
const getPermissionMenu = async () => {
|
|
8431
|
-
const tree = await requestUserTree();
|
|
8487
|
+
const tree = await httpUtil.requestUserTree();
|
|
8432
8488
|
const appRefName = route.query.menuRef ?? import.meta.env.VITE_APP_NAME;
|
|
8433
8489
|
let userMenu = getMenuByKey(tree, appRefName, "remark");
|
|
8434
8490
|
if (!userMenu) {
|
|
@@ -8439,9 +8495,8 @@ const DefaultLayout = defineComponent({
|
|
|
8439
8495
|
const menuList = computed(() => isDev ? devMenuList.value : permissionMenu.value);
|
|
8440
8496
|
const isIframe = ref(false);
|
|
8441
8497
|
const iframeUrl = ref("");
|
|
8442
|
-
watch([route, menuList], (
|
|
8443
|
-
query
|
|
8444
|
-
}]) => {
|
|
8498
|
+
watch([route, menuList], () => {
|
|
8499
|
+
const query = route.query;
|
|
8445
8500
|
if (query.iframeId && menuList.value.length) {
|
|
8446
8501
|
isIframe.value = true;
|
|
8447
8502
|
const menuRecord = getMenuByKey(menuList.value, query.iframeId, "id");
|
|
@@ -8463,7 +8518,7 @@ const DefaultLayout = defineComponent({
|
|
|
8463
8518
|
}
|
|
8464
8519
|
});
|
|
8465
8520
|
const handleLogout = async () => {
|
|
8466
|
-
await postLogout();
|
|
8521
|
+
await httpUtil.postLogout();
|
|
8467
8522
|
sessionStorage.clear();
|
|
8468
8523
|
localStorage.clear();
|
|
8469
8524
|
message.info("\u7528\u6237\u9000\u51FA\u767B\u5F55");
|
|
@@ -8489,48 +8544,51 @@ const DefaultLayout = defineComponent({
|
|
|
8489
8544
|
"class": "independent-container"
|
|
8490
8545
|
}, [createVNode(resolveComponent("router-view"), null, null)]);
|
|
8491
8546
|
}
|
|
8547
|
+
const header = createVNode(LayoutHeader, {
|
|
8548
|
+
"class": "header-container"
|
|
8549
|
+
}, {
|
|
8550
|
+
default: () => [isDev ? createVNode(ChildHeaderDev, {
|
|
8551
|
+
"userInfo": userInfo.value
|
|
8552
|
+
}, null) : createVNode(ChildHeader, {
|
|
8553
|
+
"userInfo": userInfo.value,
|
|
8554
|
+
"logo": logo.value,
|
|
8555
|
+
"onLogout": handleLogout
|
|
8556
|
+
}, null)]
|
|
8557
|
+
});
|
|
8558
|
+
const sider = createVNode(LayoutSider, {
|
|
8559
|
+
"class": `${config.prefix}-layout-sider`,
|
|
8560
|
+
"width": "10.416vw",
|
|
8561
|
+
"collapsedWidth": "3.125vw",
|
|
8562
|
+
"collapsed": isFold.value
|
|
8563
|
+
}, {
|
|
8564
|
+
default: () => [createVNode("div", {
|
|
8565
|
+
"class": ["folder", {
|
|
8566
|
+
isFold: isFold.value
|
|
8567
|
+
}],
|
|
8568
|
+
"onClick": () => toggleFold()
|
|
8569
|
+
}, [isFold.value ? createVNode(MenuUnfoldOutlined, null, null) : createVNode(MenuFoldOutlined, null, null)]), createVNode(SideMenu, {
|
|
8570
|
+
"menuList": menuList.value
|
|
8571
|
+
}, null), createVNode("div", {
|
|
8572
|
+
"class": "copyright"
|
|
8573
|
+
}, [copyright.value])]
|
|
8574
|
+
});
|
|
8575
|
+
const content = createVNode(LayoutContent, {
|
|
8576
|
+
"class": "layout-content"
|
|
8577
|
+
}, {
|
|
8578
|
+
default: () => [createVNode("div", {
|
|
8579
|
+
"class": "content-inner"
|
|
8580
|
+
}, [withDirectives(createVNode(resolveComponent("router-view"), null, null), [[vShow, !isIframe.value]]), withDirectives(createVNode("iframe", {
|
|
8581
|
+
"src": iframeUrl.value,
|
|
8582
|
+
"height": "100%",
|
|
8583
|
+
"width": "100%",
|
|
8584
|
+
"frameborder": "0"
|
|
8585
|
+
}, null), [[vShow, isIframe.value]])])]
|
|
8586
|
+
});
|
|
8492
8587
|
return createVNode(Layout$1, {
|
|
8493
8588
|
"class": `${config.prefix}-child-layout`
|
|
8494
8589
|
}, {
|
|
8495
|
-
default: () => [props.withHeader && createVNode(
|
|
8496
|
-
|
|
8497
|
-
}, {
|
|
8498
|
-
default: () => [isDev ? createVNode(ChildHeaderDev, {
|
|
8499
|
-
"userInfo": userInfo.value
|
|
8500
|
-
}, null) : createVNode(ChildHeader, {
|
|
8501
|
-
"userInfo": userInfo.value,
|
|
8502
|
-
"logo": logo.value,
|
|
8503
|
-
"onLogout": handleLogout
|
|
8504
|
-
}, null)]
|
|
8505
|
-
}), createVNode(Layout$1, null, {
|
|
8506
|
-
default: () => [createVNode(LayoutSider, {
|
|
8507
|
-
"class": `${config.prefix}-layout-sider`,
|
|
8508
|
-
"width": "10.416vw",
|
|
8509
|
-
"collapsedWidth": "3.125vw",
|
|
8510
|
-
"collapsed": isFold.value
|
|
8511
|
-
}, {
|
|
8512
|
-
default: () => [createVNode("div", {
|
|
8513
|
-
"class": ["folder", {
|
|
8514
|
-
isFold: isFold.value
|
|
8515
|
-
}],
|
|
8516
|
-
"onClick": () => toggleFold()
|
|
8517
|
-
}, [isFold.value ? createVNode(MenuUnfoldOutlined, null, null) : createVNode(MenuFoldOutlined, null, null)]), createVNode(SideMenu, {
|
|
8518
|
-
"menuList": menuList.value
|
|
8519
|
-
}, null), createVNode("div", {
|
|
8520
|
-
"class": "copyright"
|
|
8521
|
-
}, [copyright.value])]
|
|
8522
|
-
}), createVNode(LayoutContent, {
|
|
8523
|
-
"class": "layout-content"
|
|
8524
|
-
}, {
|
|
8525
|
-
default: () => [createVNode("div", {
|
|
8526
|
-
"class": "content-inner"
|
|
8527
|
-
}, [withDirectives(createVNode(resolveComponent("router-view"), null, null), [[vShow, !isIframe.value]]), withDirectives(createVNode("iframe", {
|
|
8528
|
-
"src": iframeUrl.value,
|
|
8529
|
-
"height": "100%",
|
|
8530
|
-
"width": "100%",
|
|
8531
|
-
"frameborder": "0"
|
|
8532
|
-
}, null), [[vShow, isIframe.value]])])]
|
|
8533
|
-
})]
|
|
8590
|
+
default: () => [props.withHeader && header, createVNode(Layout$1, null, {
|
|
8591
|
+
default: () => [sider, content]
|
|
8534
8592
|
})]
|
|
8535
8593
|
});
|
|
8536
8594
|
};
|