inl-ui 0.1.74 → 0.1.75

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.
@@ -9,8 +9,8 @@ var core = require('@vueuse/core');
9
9
  var axios$2 = require('axios');
10
10
  var antDesignVue = require('ant-design-vue');
11
11
  var _ = require('lodash');
12
- var dayjs = require('dayjs');
13
12
  var qiankun = require('qiankun');
13
+ var dayjs = require('dayjs');
14
14
  require('vite-plugin-qiankun');
15
15
  var renderWithQiankun = require('vite-plugin-qiankun/dist/helper');
16
16
  var mobile = require('@sszj-temp/mobile');
@@ -280,7 +280,7 @@ function useActiveMenu(menuList, extraPages, isNav = false, watchOnce = false, i
280
280
  return menu;
281
281
  }
282
282
 
283
- function _isSlot$d(s) {
283
+ function _isSlot$e(s) {
284
284
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
285
285
  }
286
286
  const Header$1 = vue.defineComponent({
@@ -375,7 +375,7 @@ const Header$1 = vue.defineComponent({
375
375
  "selectedKeys": acitveMenuKey.value,
376
376
  "onUpdate:selectedKeys": $event => acitveMenuKey.value = $event,
377
377
  "onSelect": handleMenuSelected
378
- }, _isSlot$d(_slot = props.menu.map(item => vue.createVNode(antDesignVue.MenuItem, {
378
+ }, _isSlot$e(_slot = props.menu.map(item => vue.createVNode(antDesignVue.MenuItem, {
379
379
  "key": item.id,
380
380
  "title": item.name
381
381
  }, {
@@ -443,7 +443,7 @@ const Header$1 = vue.defineComponent({
443
443
  }
444
444
  });
445
445
 
446
- function _isSlot$c(s) {
446
+ function _isSlot$d(s) {
447
447
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
448
448
  }
449
449
  const renderMenuItem = item => {
@@ -525,13 +525,91 @@ const SideMenu$1 = vue.defineComponent({
525
525
  "onUpdate:openKeys": $event => expandKeys.value = $event,
526
526
  "selectedKeys": activeMenu.value,
527
527
  "onSelect": handleMenuSelect
528
- }, _isSlot$c(_slot = props.menu.map(item => renderMenuItem(item))) ? _slot : {
528
+ }, _isSlot$d(_slot = props.menu.map(item => renderMenuItem(item))) ? _slot : {
529
529
  default: () => [_slot]
530
530
  });
531
531
  };
532
532
  }
533
533
  });
534
534
 
535
+ function useActiveApp() {
536
+ const route = vueRouter.useRoute();
537
+ const activeAppName = vue.computed(() => {
538
+ return route.path.split("/")[1];
539
+ });
540
+ return activeAppName;
541
+ }
542
+
543
+ const loadedApp = /* @__PURE__ */new Map();
544
+ function useMicroApp(appList) {
545
+ const route = vueRouter.useRoute();
546
+ const activeAppName = useActiveApp();
547
+ const loadAppList = vue.ref(Array.from(loadedApp.values()));
548
+ const appContainerList = vue.ref([]);
549
+ const handleRouteChange = core.useThrottleFn(async () => {
550
+ const microAppName = activeAppName.value;
551
+ let microAppDefine = appList.find(item => item.name === microAppName);
552
+ if (!microAppDefine && !microAppName.startsWith("mtip-")) return;
553
+ const domId = `microApp_${microAppName}`;
554
+ if (!appContainerList.value.some(item => item.id === domId)) {
555
+ appContainerList.value.push({
556
+ name: microAppName,
557
+ id: domId
558
+ });
559
+ }
560
+ setTimeout(async () => {
561
+ const loadApp = loadedApp.get(microAppName);
562
+ if (loadApp) {
563
+ if (!loadApp.mounted) {
564
+ loadApp.app.mount();
565
+ }
566
+ return;
567
+ }
568
+ const app = qiankun.loadMicroApp({
569
+ name: microAppDefine ? microAppDefine.name : microAppName,
570
+ entry: microAppDefine ? microAppDefine.entry : `/${microAppName}/`,
571
+ container: `#${domId}`
572
+ });
573
+ const microApp = {
574
+ name: microAppName,
575
+ domId,
576
+ app,
577
+ mounted: true
578
+ };
579
+ loadAppList.value.push(microApp);
580
+ loadedApp.set(microAppName, microApp);
581
+ await app.mountPromise;
582
+ }, 10);
583
+ }, 100);
584
+ vue.watch(route, handleRouteChange, {
585
+ immediate: true
586
+ });
587
+ vue.onBeforeUnmount(() => {
588
+ loadedApp.forEach(item => item.mounted = false);
589
+ });
590
+ return [loadAppList, appContainerList];
591
+ }
592
+
593
+ function onAddExtraTabs(handler) {
594
+ const route = vueRouter.useRoute();
595
+ const qiankunState = vue.inject("qiankunState");
596
+ vue.watch(() => qiankunState.value.extraTabs, (val = [], prev = []) => {
597
+ if (val.length > prev.length) {
598
+ const added = _.differenceBy(val, prev, item => item.key + item.uniqueKey).map(item => ({
599
+ ...item,
600
+ params: route.query
601
+ }));
602
+ handler(added.map(item => ({
603
+ ...item,
604
+ type: "extraTab"
605
+ })));
606
+ }
607
+ }, {
608
+ deep: true,
609
+ immediate: true
610
+ });
611
+ }
612
+
535
613
  function useQiankunStateValue(key) {
536
614
  const qiankunState = vue.inject("qiankunState");
537
615
  if (___default["default"].isEmpty(qiankunState)) return;
@@ -6439,82 +6517,73 @@ function useRouteActive() {
6439
6517
  return isActive;
6440
6518
  }
6441
6519
 
6442
- function useActiveApp() {
6443
- const route = vueRouter.useRoute();
6444
- const activeAppName = vue.computed(() => {
6445
- return route.path.split("/")[1];
6520
+ function useChildTheme(containerRef, isFullscreen, loadAppList) {
6521
+ const theme = core.useLocalStorage("theme", "default");
6522
+ const globalTheme = useQiankunStateValue("theme");
6523
+ globalTheme.value = theme.value;
6524
+ vue.watch([theme, globalTheme, isFullscreen, loadAppList, containerRef], async () => {
6525
+ if (containerRef.value) {
6526
+ await vue.nextTick();
6527
+ const childContainerList = containerRef.value.querySelectorAll("[id^='__qiankun_microapp_wrapper_for_']");
6528
+ const themeText = globalTheme.value === "dark" ? "dark" : "light";
6529
+ for (const child of Array.from(childContainerList)) {
6530
+ child.setAttribute("data-theme", themeText);
6531
+ child.setAttribute("data-doc-theme", themeText);
6532
+ if (isFullscreen.value) {
6533
+ child.setAttribute("fullscreen", "");
6534
+ } else {
6535
+ child.removeAttribute("fullscreen");
6536
+ }
6537
+ }
6538
+ }
6539
+ }, {
6540
+ immediate: true,
6541
+ deep: true
6446
6542
  });
6447
- return activeAppName;
6448
6543
  }
6449
6544
 
6450
- const loadedApp = /* @__PURE__ */new Map();
6451
- function useMicroApp(appList) {
6452
- const route = vueRouter.useRoute();
6453
- const activeAppName = useActiveApp();
6454
- const loadAppList = vue.ref(Array.from(loadedApp.values()));
6455
- const appContainerList = vue.ref([]);
6456
- const handleRouteChange = core.useThrottleFn(async () => {
6457
- const microAppName = activeAppName.value;
6458
- let microAppDefine = appList.find(item => item.name === microAppName);
6459
- if (!microAppDefine && !microAppName.startsWith("mtip-")) return;
6460
- const domId = `microApp_${microAppName}`;
6461
- if (!appContainerList.value.some(item => item.id === domId)) {
6462
- appContainerList.value.push({
6463
- name: microAppName,
6464
- id: domId
6465
- });
6545
+ function useFullscreenLogic(containerRef, iframeList, activeKey) {
6546
+ const isFullscreenIframe = vue.ref(false);
6547
+ const {
6548
+ isFullscreen,
6549
+ enter
6550
+ } = core.useFullscreen(containerRef);
6551
+ const {
6552
+ elementY
6553
+ } = core.useMouseInElement(containerRef);
6554
+ const isTabsShow = vue.ref(false);
6555
+ vue.watchEffect(() => {
6556
+ if (isFullscreen.value) {
6557
+ isTabsShow.value = false;
6466
6558
  }
6467
- setTimeout(async () => {
6468
- const loadApp = loadedApp.get(microAppName);
6469
- if (loadApp) {
6470
- if (!loadApp.mounted) {
6471
- loadApp.app.mount();
6472
- }
6473
- return;
6474
- }
6475
- const app = qiankun.loadMicroApp({
6476
- name: microAppDefine ? microAppDefine.name : microAppName,
6477
- entry: microAppDefine ? microAppDefine.entry : `/${microAppName}/`,
6478
- container: `#${domId}`
6479
- });
6480
- const microApp = {
6481
- name: microAppName,
6482
- domId,
6483
- app,
6484
- mounted: true
6485
- };
6486
- loadAppList.value.push(microApp);
6487
- loadedApp.set(microAppName, microApp);
6488
- await app.mountPromise;
6489
- }, 10);
6490
- }, 100);
6491
- vue.watch(route, handleRouteChange, {
6492
- immediate: true
6493
6559
  });
6494
- vue.onBeforeUnmount(() => {
6495
- loadedApp.forEach(item => item.mounted = false);
6560
+ vue.watchEffect(() => {
6561
+ if (elementY.value < 10) {
6562
+ isTabsShow.value = true;
6563
+ }
6496
6564
  });
6497
- return [loadAppList, appContainerList];
6498
- }
6499
-
6500
- function onAddExtraTabs(handler) {
6501
- const route = vueRouter.useRoute();
6502
- const qiankunState = vue.inject("qiankunState");
6503
- vue.watch(() => qiankunState.value.extraTabs, (val = [], prev = []) => {
6504
- if (val.length > prev.length) {
6505
- const added = _.differenceBy(val, prev, item => item.key + item.uniqueKey).map(item => ({
6506
- ...item,
6507
- params: route.query
6508
- }));
6509
- handler(added.map(item => ({
6510
- ...item,
6511
- type: "extraTab"
6512
- })));
6565
+ const isPadding = vue.computed(() => {
6566
+ let iframePadding = false;
6567
+ if (activeKey.value) {
6568
+ const currentIframe = iframeList.value.find(item => item.id === activeKey.value);
6569
+ if (currentIframe) {
6570
+ iframePadding = currentIframe.url.includes("hasPadding");
6571
+ if (!iframePadding) return false;
6572
+ }
6513
6573
  }
6514
- }, {
6515
- deep: true,
6516
- immediate: true
6574
+ if (isFullscreen.value) return false;
6575
+ return !isFullscreenIframe.value;
6517
6576
  });
6577
+ const handleFullscreen = tab => {
6578
+ isFullscreenIframe.value = tab.mode === 2;
6579
+ enter();
6580
+ };
6581
+ return {
6582
+ isFullscreen,
6583
+ isTabsShow,
6584
+ isPadding,
6585
+ handleFullscreen
6586
+ };
6518
6587
  }
6519
6588
 
6520
6589
  function setParam(searchParams, obj) {
@@ -6635,7 +6704,7 @@ const TabList = vue.defineComponent({
6635
6704
  }
6636
6705
  });
6637
6706
  vue.onBeforeUnmount(() => tabList.value = []);
6638
- core.watchArray(tabList, async (val, prev, added, removed) => {
6707
+ core.watchArray(tabList, async (_val, _prev, _added, removed) => {
6639
6708
  for (const tab of removed) {
6640
6709
  if (tab.isExtraTab) {
6641
6710
  const idx = qiankunState.value.extraTabs.findIndex(item => item.key === tab.key && item.uniqueKey === tab.uniqueKey);
@@ -6883,32 +6952,33 @@ const TabList = vue.defineComponent({
6883
6952
  }
6884
6953
  });
6885
6954
 
6886
- const PageContent = vue.defineComponent({
6887
- props: {
6888
- currMenu: {
6889
- type: Object
6890
- },
6891
- menu: {
6892
- type: Array,
6893
- default: () => []
6894
- },
6895
- extraPages: {
6896
- type: Array,
6897
- required: true
6898
- },
6899
- appList: {
6900
- type: Array,
6901
- required: true
6902
- },
6903
- showTabList: {
6904
- type: Boolean,
6905
- default: true
6906
- },
6907
- pageContainerRef: {
6908
- type: Object,
6909
- required: true
6910
- }
6955
+ const Props$1 = {
6956
+ currMenu: {
6957
+ type: Object
6911
6958
  },
6959
+ menu: {
6960
+ type: Array,
6961
+ default: () => []
6962
+ },
6963
+ extraPages: {
6964
+ type: Array,
6965
+ required: true
6966
+ },
6967
+ appList: {
6968
+ type: Array,
6969
+ required: true
6970
+ },
6971
+ showTabList: {
6972
+ type: Boolean,
6973
+ default: true
6974
+ },
6975
+ pageContainerRef: {
6976
+ type: Object,
6977
+ required: true
6978
+ }
6979
+ };
6980
+ const PageContent = vue.defineComponent({
6981
+ props: Props$1,
6912
6982
  setup(props, {
6913
6983
  emit
6914
6984
  }) {
@@ -6936,12 +7006,12 @@ const PageContent = vue.defineComponent({
6936
7006
  extraPageList.value.splice(idx, 1);
6937
7007
  }
6938
7008
  };
6939
- const handleMenuChange = val => {
7009
+ const handleMenuChange = (val, isFromMenu = false) => {
6940
7010
  if (!val) return;
6941
7011
  const routeQuery = {
6942
7012
  ...route.query
6943
7013
  };
6944
- const queryCombine = Object.assign(val.params || {}, routeQuery);
7014
+ const queryCombine = Object.assign({}, val.params, routeQuery);
6945
7015
  if (val.isExtra) {
6946
7016
  const exist = extraPageList.value.find(item => item.key === val.key && item.uniqueKey === val.uniqueKey);
6947
7017
  if (!exist) {
@@ -6979,15 +7049,15 @@ const PageContent = vue.defineComponent({
6979
7049
  const tab = ___default["default"].cloneDeep(val);
6980
7050
  switch (mode) {
6981
7051
  case 0:
6982
- if (!isOpened) {
7052
+ if (isOpened) {
7053
+ openedTab.params = isFromMenu ? val.params : queryCombine;
7054
+ val.params = isFromMenu ? val.params : queryCombine;
7055
+ } else {
6983
7056
  tabList.value.push({
6984
7057
  ...tab,
6985
7058
  key: key ?? id,
6986
7059
  type: "menu"
6987
7060
  });
6988
- } else {
6989
- openedTab.params = queryCombine;
6990
- val.params = queryCombine;
6991
7061
  }
6992
7062
  const [path, currSearch = ""] = url.split("?");
6993
7063
  const searchObj = new URLSearchParams(currSearch);
@@ -7071,7 +7141,7 @@ const PageContent = vue.defineComponent({
7071
7141
  }, {
7072
7142
  immediate: true
7073
7143
  });
7074
- vue.watch(() => props.currMenu, handleMenuChange, {
7144
+ vue.watch(() => props.currMenu, val => handleMenuChange(val, true), {
7075
7145
  immediate: true
7076
7146
  });
7077
7147
  core.useEventListener("message", e => {
@@ -7100,85 +7170,38 @@ const PageContent = vue.defineComponent({
7100
7170
  }, {
7101
7171
  immediate: true
7102
7172
  });
7103
- vue.watch(() => qiankunState.value.activeTabKey, val => activeKey.value = val);
7173
+ vue.watch(() => qiankunState.value.activeTabKey, val => {
7174
+ if (activeKey !== val) {
7175
+ requestAnimationFrame(() => {
7176
+ activeKey.value = val;
7177
+ });
7178
+ }
7179
+ });
7104
7180
  onAddExtraTabs(added => {
7105
7181
  tabList.value.push(...added);
7106
7182
  });
7107
- const isFullscreenIframe = vue.ref(false);
7108
7183
  const {
7109
7184
  isFullscreen,
7110
- enter
7111
- } = core.useFullscreen(containerRef);
7112
- const {
7113
- elementY
7114
- } = core.useMouseInElement(containerRef);
7115
- const isTabsShow = vue.ref(false);
7116
- vue.watchEffect(() => {
7117
- if (isFullscreen.value) {
7118
- isTabsShow.value = false;
7119
- }
7120
- });
7121
- vue.watchEffect(() => {
7122
- if (elementY.value < 10) {
7123
- isTabsShow.value = true;
7124
- }
7125
- });
7126
- const isPadding = vue.computed(() => {
7127
- let iframePadding = false;
7128
- if (activeKey.value) {
7129
- const currentIframe = iframeList.value.find(item => item.id === activeKey.value);
7130
- if (currentIframe) {
7131
- iframePadding = currentIframe.url.includes("hasPadding");
7132
- if (!iframePadding) return false;
7133
- }
7134
- }
7135
- if (isFullscreen.value) return false;
7136
- return !isFullscreenIframe.value;
7137
- });
7138
- const handleFullscreen = tab => {
7139
- isFullscreenIframe.value = tab.mode === 2;
7140
- enter();
7141
- };
7185
+ handleFullscreen,
7186
+ isPadding,
7187
+ isTabsShow
7188
+ } = useFullscreenLogic(containerRef, iframeList, activeKey);
7142
7189
  const handleRefreshIframe = async ({
7143
7190
  id
7144
7191
  }) => {
7145
7192
  const iframe = iframeList.value.find(item => item.id === id);
7146
- if (iframe) {
7147
- iframe.refreshKey = Date.now();
7148
- const reqCode = await checkIframeUrl(iframe.url);
7149
- iframe.reqCode = reqCode;
7150
- }
7193
+ if (!iframe) return;
7194
+ iframe.refreshKey = Date.now();
7195
+ const reqCode = await checkIframeUrl(iframe.url);
7196
+ iframe.reqCode = reqCode;
7151
7197
  };
7152
7198
  const handleRefreshExtraPage = ({
7153
7199
  key
7154
7200
  }) => {
7155
7201
  const page = extraPageList.value.find(item => item.key === key);
7156
- if (page) {
7157
- page.refreshKey = Date.now();
7158
- }
7202
+ page && (page.refreshKey = Date.now());
7159
7203
  };
7160
- const theme = core.useLocalStorage("theme", "default");
7161
- const globalTheme = useQiankunStateValue("theme");
7162
- globalTheme.value = theme.value;
7163
- vue.watch([theme, globalTheme, isFullscreen, loadAppList, containerRef], async () => {
7164
- if (containerRef.value) {
7165
- await vue.nextTick();
7166
- const childContainerList = containerRef.value.querySelectorAll("[id^='__qiankun_microapp_wrapper_for_']");
7167
- const themeText = globalTheme.value === "dark" ? "dark" : "light";
7168
- for (const child of Array.from(childContainerList)) {
7169
- child.setAttribute("data-theme", themeText);
7170
- child.setAttribute("data-doc-theme", themeText);
7171
- if (isFullscreen.value) {
7172
- child.setAttribute("fullscreen", "");
7173
- } else {
7174
- child.removeAttribute("fullscreen");
7175
- }
7176
- }
7177
- }
7178
- }, {
7179
- immediate: true,
7180
- deep: true
7181
- });
7204
+ useChildTheme(containerRef, isFullscreen, loadAppList);
7182
7205
  const closeExtraPage = tab => {
7183
7206
  tabListRef.value?.closeTab(tab);
7184
7207
  };
@@ -7187,122 +7210,186 @@ const PageContent = vue.defineComponent({
7187
7210
  app.app.unmount();
7188
7211
  }
7189
7212
  });
7190
- return () => vue.createVNode("div", {
7191
- "class": "page-content",
7192
- "ref": containerRef
7193
- }, [props.showTabList && vue.withDirectives(vue.createVNode(TabList, {
7194
- "ref": tabListRef,
7195
- "activeKey": activeKey.value,
7196
- "onUpdate:activeKey": $event => activeKey.value = $event,
7197
- "list": tabList.value,
7198
- "onUpdate:list": $event => tabList.value = $event,
7199
- "containerRef": containerRef,
7200
- "onTabSelect": onTabSelect,
7201
- "onCloseExtraPage": handleExtraPageClose,
7202
- "onCloseIframePage": handleIframePageClose,
7203
- "onFullscreen": handleFullscreen,
7204
- "onRefreshIframe": handleRefreshIframe,
7205
- "onRefreshExtraPage": handleRefreshExtraPage,
7206
- "onMouseLeave": () => isTabsShow.value = false
7207
- }, null), [[vue.vShow, !isFullscreen.value || isTabsShow.value]]), vue.createVNode("div", {
7208
- "class": ["page-container", {
7213
+ return () => {
7214
+ const tabs = vue.withDirectives(vue.createVNode(TabList, {
7215
+ "ref": tabListRef,
7216
+ "activeKey": activeKey.value,
7217
+ "onUpdate:activeKey": $event => activeKey.value = $event,
7218
+ "list": tabList.value,
7219
+ "onUpdate:list": $event => tabList.value = $event,
7220
+ "containerRef": containerRef,
7221
+ "onTabSelect": onTabSelect,
7222
+ "onCloseExtraPage": handleExtraPageClose,
7223
+ "onCloseIframePage": handleIframePageClose,
7224
+ "onFullscreen": handleFullscreen,
7225
+ "onRefreshIframe": handleRefreshIframe,
7226
+ "onRefreshExtraPage": handleRefreshExtraPage,
7227
+ "onMouseLeave": () => isTabsShow.value = false
7228
+ }, null), [[vue.vShow, !isFullscreen.value || isTabsShow.value]]);
7229
+ const containerCns = {
7209
7230
  padding: isPadding.value,
7210
7231
  fullscreen: isFullscreen.value
7211
- }],
7212
- "ref": props.pageContainerRef
7213
- }, [appDomList.value.map(item => vue.withDirectives(vue.createVNode("div", {
7214
- "key": item.id,
7215
- "id": item.id
7216
- }, null), [[vue.vShow, item.name === activeAppName.value]])), iframeList.value.map(item => {
7217
- const show = item.id === activeKey.value;
7218
- if (item.reqCode === 200 || item.reqCode === void 0) {
7219
- return vue.createVNode("iframe", {
7220
- "class": "menu-iframe",
7221
- "key": item.id + item.refreshKey,
7222
- "id": "iframe" + item.id,
7232
+ };
7233
+ const iframeRender = item => {
7234
+ const show = item.id === activeKey.value;
7235
+ if (item.reqCode === 200 || item.reqCode === void 0) {
7236
+ return vue.createVNode("iframe", {
7237
+ "class": "menu-iframe",
7238
+ "key": item.id + item.refreshKey,
7239
+ "id": "iframe" + item.id,
7240
+ "style": {
7241
+ zIndex: show ? "" : "-100"
7242
+ },
7243
+ "src": item.url,
7244
+ "frameborder": "0"
7245
+ }, null);
7246
+ }
7247
+ let src = "/micro-assets/platform_web/developing.png";
7248
+ if (item.reqCode === 404) {
7249
+ src = "/micro-assets/platform_web/page404.png";
7250
+ }
7251
+ return vue.withDirectives(vue.createVNode("div", {
7252
+ "class": "iframe-fallback"
7253
+ }, [vue.createVNode("img", {
7254
+ "src": src,
7255
+ "alt": ""
7256
+ }, null)]), [[vue.vShow, show]]);
7257
+ };
7258
+ const childTypes = [];
7259
+ childTypes.push(vue.createVNode(vue.Fragment, null, [appDomList.value.map(item => vue.withDirectives(vue.createVNode("div", {
7260
+ "key": item.id,
7261
+ "id": item.id
7262
+ }, null), [[vue.vShow, item.name === activeAppName.value]]))]));
7263
+ childTypes.push(vue.createVNode(vue.Fragment, null, [iframeList.value.map(iframeRender)]));
7264
+ childTypes.push(vue.createVNode(vue.Fragment, null, [extraPageList.value.map(item => {
7265
+ const extraPageShoe = getTabUniqueKey(item) === activeKey.value;
7266
+ return vue.withDirectives(vue.createVNode("div", {
7267
+ "key": item.key + item.refreshKey,
7223
7268
  "style": {
7224
- zIndex: show ? "" : "-100"
7225
- },
7226
- "src": item.url,
7227
- "frameborder": "0"
7228
- }, null);
7229
- }
7230
- let src = "/micro-assets/platform_web/developing.png";
7231
- if (item.reqCode === 404) {
7232
- src = "/micro-assets/platform_web/page404.png";
7233
- }
7234
- return vue.withDirectives(vue.createVNode("div", {
7235
- "class": "iframe-fallback"
7236
- }, [vue.createVNode("img", {
7237
- "src": src,
7238
- "alt": ""
7239
- }, null)]), [[vue.vShow, show]]);
7240
- }), extraPageList.value.map(item => vue.withDirectives(vue.createVNode("div", {
7241
- "key": item.key + item.refreshKey,
7242
- "style": {
7243
- "min-height": "100%"
7244
- }
7245
- }, [vue.createVNode(item.component, {
7246
- "onClose": () => closeExtraPage(item)
7247
- }, null)]), [[vue.vShow, getTabUniqueKey(item) === activeKey.value]]))])]);
7269
+ "min-height": "100%"
7270
+ }
7271
+ }, [vue.createVNode(item.component, {
7272
+ "onClose": () => closeExtraPage(item)
7273
+ }, null)]), [[vue.vShow, extraPageShoe]]);
7274
+ })]));
7275
+ return vue.createVNode("div", {
7276
+ "class": "page-content",
7277
+ "ref": containerRef
7278
+ }, [props.showTabList && tabs, vue.createVNode("div", {
7279
+ "class": ["page-container", containerCns],
7280
+ "ref": props.pageContainerRef
7281
+ }, [childTypes])]);
7282
+ };
7248
7283
  }
7249
7284
  });
7250
7285
 
7251
- const Layout = vue.defineComponent({
7252
- emits: ["globalSearch", "personalCenter", "logout", "extraPage"],
7253
- props: {
7254
- // 用户权限菜单
7255
- userMenu: {
7256
- type: Array,
7257
- required: true
7258
- },
7259
- // 版权信息
7260
- copyRight: {
7261
- type: String
7262
- },
7263
- // 用户
7264
- userInfo: {
7265
- type: Object,
7266
- required: true
7267
- },
7268
- // 额外的页面
7269
- extraPages: {
7270
- type: Array,
7271
- default: () => []
7272
- },
7273
- // 未读消息
7274
- messageCount: {
7275
- type: Number,
7276
- default: 0
7277
- },
7278
- // 网页logo
7279
- logo: {
7280
- type: String
7281
- },
7282
- appList: {
7283
- type: Array,
7284
- required: true
7285
- },
7286
- // 展示菜单
7287
- withMenu: {
7288
- type: Boolean,
7289
- default: true
7290
- },
7291
- // 展示在左侧的菜单(不展示菜单模式)
7292
- sideMenu: {
7293
- type: Array
7294
- },
7295
- // 展示导航栏菜单和搜索框
7296
- showNav: {
7297
- type: Boolean,
7298
- default: true
7299
- },
7300
- // 是否展示我的消息
7301
- showNotice: {
7302
- type: Boolean,
7303
- default: true
7286
+ function useFakeModal(pageContainerRef) {
7287
+ const showMask = vue.ref(false);
7288
+ core.useEventListener("message", e => {
7289
+ const {
7290
+ data: event
7291
+ } = e;
7292
+ const {
7293
+ type,
7294
+ val,
7295
+ delay = 0
7296
+ } = event;
7297
+ if (type === "toggleMask") {
7298
+ setTimeout(() => {
7299
+ showMask.value = val;
7300
+ }, delay);
7304
7301
  }
7302
+ });
7303
+ const pageBounding = core.useElementBounding(pageContainerRef);
7304
+ const modalPath = vue.computed(() => {
7305
+ const {
7306
+ top,
7307
+ bottom,
7308
+ left,
7309
+ right
7310
+ } = pageBounding;
7311
+ const topDis = Math.round(top.value);
7312
+ const rightDis = Math.round(window.innerWidth - right.value);
7313
+ const bottomDis = Math.round(window.innerHeight - bottom.value);
7314
+ const leftDis = Math.round(left.value);
7315
+ return `polygon(
7316
+ 0% 0%,
7317
+ 0% 100%,
7318
+ ${leftDis}px 100%,
7319
+ ${leftDis}px ${topDis}px,
7320
+ calc(100% - ${rightDis}px) ${topDis}px,
7321
+ calc(100% - ${rightDis}px) calc(100% - ${bottomDis}px),
7322
+ ${leftDis}px calc(100% - ${bottomDis}px),
7323
+ ${leftDis}px 100%,
7324
+ 100% 100%,
7325
+ 100% 0%
7326
+ )`;
7327
+ });
7328
+ return {
7329
+ showMask,
7330
+ modalPath
7331
+ };
7332
+ }
7333
+
7334
+ function _isSlot$c(s) {
7335
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
7336
+ }
7337
+ const Props = {
7338
+ // 用户权限菜单
7339
+ userMenu: {
7340
+ type: Array,
7341
+ required: true
7342
+ },
7343
+ // 版权信息
7344
+ copyRight: {
7345
+ type: String
7346
+ },
7347
+ // 用户
7348
+ userInfo: {
7349
+ type: Object,
7350
+ required: true
7305
7351
  },
7352
+ // 额外的页面
7353
+ extraPages: {
7354
+ type: Array,
7355
+ default: () => []
7356
+ },
7357
+ // 未读消息
7358
+ messageCount: {
7359
+ type: Number,
7360
+ default: 0
7361
+ },
7362
+ // 网页logo
7363
+ logo: {
7364
+ type: String
7365
+ },
7366
+ appList: {
7367
+ type: Array,
7368
+ required: true
7369
+ },
7370
+ // 展示菜单
7371
+ withMenu: {
7372
+ type: Boolean,
7373
+ default: true
7374
+ },
7375
+ // 展示在左侧的菜单(不展示菜单模式)
7376
+ sideMenu: {
7377
+ type: Array
7378
+ },
7379
+ // 展示导航栏菜单和搜索框
7380
+ showNav: {
7381
+ type: Boolean,
7382
+ default: true
7383
+ },
7384
+ // 是否展示我的消息
7385
+ showNotice: {
7386
+ type: Boolean,
7387
+ default: true
7388
+ }
7389
+ };
7390
+ const Layout = vue.defineComponent({
7391
+ emits: ["globalSearch", "personalCenter", "logout", "extraPage"],
7392
+ props: Props,
7306
7393
  setup(props, {
7307
7394
  emit
7308
7395
  }) {
@@ -7315,15 +7402,13 @@ const Layout = vue.defineComponent({
7315
7402
  const siderMenu = vue.ref([]);
7316
7403
  const sideMenuShow = vue.computed(() => props.sideMenu || siderMenu.value);
7317
7404
  const showSideMenu = vue.computed(() => props.withMenu || !!props.sideMenu);
7318
- vue.watch(() => props.userMenu, val => {
7319
- if (val.length && menuRef) {
7320
- const refMenu = getMenuByKey(val, menuRef, "remark");
7405
+ vue.watchEffect(() => {
7406
+ if (props.userMenu.length > 0 && menuRef) {
7407
+ const refMenu = getMenuByKey(props.userMenu, menuRef, "remark");
7321
7408
  if (refMenu) {
7322
7409
  siderMenu.value = [refMenu];
7323
7410
  }
7324
7411
  }
7325
- }, {
7326
- immediate: true
7327
7412
  });
7328
7413
  const showHeader = vue.computed(() => props.withMenu && !menuRef && !isOnlyPage);
7329
7414
  const showSide = vue.computed(() => showSideMenu.value && !isOnlyPage);
@@ -7354,52 +7439,19 @@ const Layout = vue.defineComponent({
7354
7439
  refreshTabKey: ""
7355
7440
  };
7356
7441
  });
7357
- const showMask = vue.ref(false);
7358
- core.useEventListener("message", e => {
7359
- const {
7360
- data: event
7361
- } = e;
7362
- const {
7363
- type,
7364
- val,
7365
- delay = 0
7366
- } = event;
7367
- if (type === "toggleMask") {
7368
- setTimeout(() => {
7369
- showMask.value = val;
7370
- }, delay);
7371
- }
7372
- });
7373
7442
  const pageContainerRef = vue.ref();
7374
- const pageBounding = core.useElementBounding(pageContainerRef);
7375
- const modalPath = vue.computed(() => {
7376
- const {
7377
- top,
7378
- bottom,
7379
- left,
7380
- right
7381
- } = pageBounding;
7382
- const topDis = Math.round(top.value);
7383
- const rightDis = Math.round(window.innerWidth - right.value);
7384
- const bottomDis = Math.round(window.innerHeight - bottom.value);
7385
- const leftDis = Math.round(left.value);
7386
- return `polygon(
7387
- 0% 0%,
7388
- 0% 100%,
7389
- ${leftDis}px 100%,
7390
- ${leftDis}px ${topDis}px,
7391
- calc(100% - ${rightDis}px) ${topDis}px,
7392
- calc(100% - ${rightDis}px) calc(100% - ${bottomDis}px),
7393
- ${leftDis}px calc(100% - ${bottomDis}px),
7394
- ${leftDis}px 100%,
7395
- 100% 100%,
7396
- 100% 0%
7397
- )`;
7398
- });
7399
- return () => vue.createVNode("div", {
7400
- "class": `${config.prefix}-layout`
7401
- }, [vue.createVNode(antDesignVue.Layout, null, {
7402
- default: () => [showHeader.value && vue.createVNode(antDesignVue.LayoutHeader, null, {
7443
+ const {
7444
+ showMask,
7445
+ modalPath
7446
+ } = useFakeModal(pageContainerRef);
7447
+ return () => {
7448
+ const modalMask = vue.createVNode("div", {
7449
+ "class": "layout-mask",
7450
+ "style": {
7451
+ clipPath: modalPath.value
7452
+ }
7453
+ }, null);
7454
+ const header = vue.createVNode(antDesignVue.LayoutHeader, null, {
7403
7455
  default: () => [vue.createVNode(Header$1, {
7404
7456
  "menu": props.showNav ? props.userMenu : [],
7405
7457
  "withSearch": props.showNav,
@@ -7414,47 +7466,49 @@ const Layout = vue.defineComponent({
7414
7466
  "onLogout": () => emit("logout"),
7415
7467
  "onExtraPage": e => emit("extraPage", e)
7416
7468
  }, null)]
7417
- }), vue.createVNode(antDesignVue.Layout, null, {
7418
- default: () => [showSide.value && vue.createVNode(antDesignVue.LayoutSider, {
7419
- "class": `${config.prefix}-layout-sider`,
7420
- "width": "10.416vw",
7421
- "collapsedWidth": "3.125vw",
7422
- "collapsed": isFolder.value
7423
- }, {
7424
- default: () => [vue.createVNode("div", {
7425
- "class": ["folder", {
7426
- isFold: isFolder.value
7427
- }],
7428
- "onClick": () => toggleFolder()
7429
- }, [isFolder.value ? vue.createVNode(iconsVue.MenuUnfoldOutlined, null, null) : vue.createVNode(iconsVue.MenuFoldOutlined, null, null)]), vue.createVNode(SideMenu$1, {
7430
- "menu": sideMenuShow.value,
7431
- "onMenuSelect": handleMenuSelect,
7432
- "extraPages": props.extraPages,
7433
- "expandAll": !!menuRef
7434
- }, null), vue.createVNode("div", {
7435
- "class": "copyright"
7436
- }, [props.copyRight])]
7437
- }), vue.createVNode(antDesignVue.LayoutContent, {
7438
- "class": {
7439
- "only-page": isOnlyPage
7440
- }
7441
- }, {
7442
- default: () => [vue.createVNode(PageContent, {
7443
- "pageContainerRef": pageContainerRef,
7444
- "currMenu": currMenu.value,
7445
- "menu": props.userMenu,
7446
- "extraPages": props.extraPages,
7447
- "appList": props.appList,
7448
- "showTabList": (props.withMenu || showSideMenu.value) && !isOnlyPage
7449
- }, null)]
7469
+ });
7470
+ const sider = vue.createVNode(antDesignVue.LayoutSider, {
7471
+ "class": `${config.prefix}-layout-sider`,
7472
+ "width": "10.416vw",
7473
+ "collapsedWidth": "3.125vw",
7474
+ "collapsed": isFolder.value
7475
+ }, {
7476
+ default: () => [vue.createVNode("div", {
7477
+ "class": ["folder", {
7478
+ isFold: isFolder.value
7479
+ }],
7480
+ "onClick": () => toggleFolder()
7481
+ }, [isFolder.value ? vue.createVNode(iconsVue.MenuUnfoldOutlined, null, null) : vue.createVNode(iconsVue.MenuFoldOutlined, null, null)]), vue.createVNode(SideMenu$1, {
7482
+ "menu": sideMenuShow.value,
7483
+ "onMenuSelect": handleMenuSelect,
7484
+ "extraPages": props.extraPages,
7485
+ "expandAll": !!menuRef
7486
+ }, null), vue.createVNode("div", {
7487
+ "class": "copyright"
7488
+ }, [props.copyRight])]
7489
+ });
7490
+ const content = vue.createVNode(PageContent, {
7491
+ "pageContainerRef": pageContainerRef,
7492
+ "currMenu": currMenu.value,
7493
+ "menu": props.userMenu,
7494
+ "extraPages": props.extraPages,
7495
+ "appList": props.appList,
7496
+ "showTabList": (props.withMenu || showSideMenu.value) && !isOnlyPage
7497
+ }, null);
7498
+ return vue.createVNode("div", {
7499
+ "class": `${config.prefix}-layout`
7500
+ }, [vue.createVNode(antDesignVue.Layout, null, {
7501
+ default: () => [showHeader.value && header, vue.createVNode(antDesignVue.Layout, null, {
7502
+ default: () => [showSide.value && sider, vue.createVNode(antDesignVue.LayoutContent, {
7503
+ "class": {
7504
+ "only-page": isOnlyPage
7505
+ }
7506
+ }, _isSlot$c(content) ? content : {
7507
+ default: () => [content]
7508
+ })]
7450
7509
  })]
7451
- })]
7452
- }), showMask.value && vue.createVNode("div", {
7453
- "class": "layout-mask",
7454
- "style": {
7455
- clipPath: modalPath.value
7456
- }
7457
- }, null)]);
7510
+ }), showMask.value && modalMask]);
7511
+ };
7458
7512
  }
7459
7513
  });
7460
7514
  var index$8 = installComponent(Layout, "layout");
@@ -8349,39 +8403,41 @@ const ChildHeader = vue.defineComponent({
8349
8403
 
8350
8404
  const isIndependentApp = query => !!query.token && !!query.onlyPage;
8351
8405
  const loginFun = new Login$1();
8352
- const requestLogo = async () => {
8353
- const res = await fetch("/api/common/v1/sysconfig/searchImage?imgType=4&editImg=1&clientType=web");
8354
- const blob = await res.blob();
8355
- return URL.createObjectURL(blob);
8356
- };
8357
- const requestUserTree = async () => {
8358
- const headers = getCommonHeaders();
8359
- const res = await fetch("/api/common/v1/menu/tree", {
8360
- headers
8361
- });
8362
- const treeData = await res.json();
8363
- return treeData.data;
8364
- };
8365
- const requestCopyright = async () => {
8366
- const res = await fetch("/api/common/v1/sysconfig/getSysConfig?clientType=web");
8367
- const data = await res.json();
8368
- return data.data.homepageCopyright;
8369
- };
8370
- const postLogout = async () => {
8371
- const headers = getCommonHeaders();
8372
- await fetch("/api/common/v1/log/insert", {
8373
- method: "POST",
8374
- headers: {
8375
- ...headers,
8376
- "Content-Type": "application/json;charset=UTF-8"
8377
- },
8378
- body: JSON.stringify({
8379
- softSysId: "1",
8380
- operateId: "111",
8381
- recordId: "11",
8382
- content: "\u767B\u51FA"
8383
- })
8384
- });
8406
+ const httpUtil = {
8407
+ requestLogo: async () => {
8408
+ const res = await fetch("/api/common/v1/sysconfig/searchImage?imgType=4&editImg=1&clientType=web");
8409
+ const blob = await res.blob();
8410
+ return URL.createObjectURL(blob);
8411
+ },
8412
+ requestUserTree: async () => {
8413
+ const headers = getCommonHeaders();
8414
+ const res = await fetch("/api/common/v1/menu/tree", {
8415
+ headers
8416
+ });
8417
+ const treeData = await res.json();
8418
+ return treeData.data;
8419
+ },
8420
+ requestCopyright: async () => {
8421
+ const res = await fetch("/api/common/v1/sysconfig/getSysConfig?clientType=web");
8422
+ const data = await res.json();
8423
+ return data.data.homepageCopyright;
8424
+ },
8425
+ postLogout: async () => {
8426
+ const headers = getCommonHeaders();
8427
+ await fetch("/api/common/v1/log/insert", {
8428
+ method: "POST",
8429
+ headers: {
8430
+ ...headers,
8431
+ "Content-Type": "application/json;charset=UTF-8"
8432
+ },
8433
+ body: JSON.stringify({
8434
+ softSysId: "1",
8435
+ operateId: "111",
8436
+ recordId: "11",
8437
+ content: "\u767B\u51FA"
8438
+ })
8439
+ });
8440
+ }
8385
8441
  };
8386
8442
  const DefaultLayout = vue.defineComponent({
8387
8443
  async beforeRouteEnter(to) {
@@ -8426,12 +8482,12 @@ const DefaultLayout = vue.defineComponent({
8426
8482
  const userInfo = core.useSessionStorage("userinfo", {});
8427
8483
  const logo = vue.ref();
8428
8484
  const getLogo = async () => {
8429
- const str = await requestLogo();
8485
+ const str = await httpUtil.requestLogo();
8430
8486
  logo.value = str;
8431
8487
  };
8432
8488
  const copyright = vue.ref("");
8433
8489
  const getCopyright = async () => {
8434
- const str = await requestCopyright();
8490
+ const str = await httpUtil.requestCopyright();
8435
8491
  copyright.value = str;
8436
8492
  };
8437
8493
  const isIndependent = isIndependentApp(route.query);
@@ -8456,7 +8512,7 @@ const DefaultLayout = vue.defineComponent({
8456
8512
  });
8457
8513
  const permissionMenu = vue.ref([]);
8458
8514
  const getPermissionMenu = async () => {
8459
- const tree = await requestUserTree();
8515
+ const tree = await httpUtil.requestUserTree();
8460
8516
  const appRefName = route.query.menuRef ?? undefined.VITE_APP_NAME;
8461
8517
  let userMenu = getMenuByKey(tree, appRefName, "remark");
8462
8518
  if (!userMenu) {
@@ -8467,9 +8523,8 @@ const DefaultLayout = vue.defineComponent({
8467
8523
  const menuList = vue.computed(() => isDev ? devMenuList.value : permissionMenu.value);
8468
8524
  const isIframe = vue.ref(false);
8469
8525
  const iframeUrl = vue.ref("");
8470
- vue.watch([route, menuList], ([{
8471
- query
8472
- }]) => {
8526
+ vue.watch([route, menuList], () => {
8527
+ const query = route.query;
8473
8528
  if (query.iframeId && menuList.value.length) {
8474
8529
  isIframe.value = true;
8475
8530
  const menuRecord = getMenuByKey(menuList.value, query.iframeId, "id");
@@ -8491,7 +8546,7 @@ const DefaultLayout = vue.defineComponent({
8491
8546
  }
8492
8547
  });
8493
8548
  const handleLogout = async () => {
8494
- await postLogout();
8549
+ await httpUtil.postLogout();
8495
8550
  sessionStorage.clear();
8496
8551
  localStorage.clear();
8497
8552
  antDesignVue.message.info("\u7528\u6237\u9000\u51FA\u767B\u5F55");
@@ -8517,48 +8572,51 @@ const DefaultLayout = vue.defineComponent({
8517
8572
  "class": "independent-container"
8518
8573
  }, [vue.createVNode(vue.resolveComponent("router-view"), null, null)]);
8519
8574
  }
8575
+ const header = vue.createVNode(antDesignVue.LayoutHeader, {
8576
+ "class": "header-container"
8577
+ }, {
8578
+ default: () => [isDev ? vue.createVNode(ChildHeaderDev, {
8579
+ "userInfo": userInfo.value
8580
+ }, null) : vue.createVNode(ChildHeader, {
8581
+ "userInfo": userInfo.value,
8582
+ "logo": logo.value,
8583
+ "onLogout": handleLogout
8584
+ }, null)]
8585
+ });
8586
+ const sider = vue.createVNode(antDesignVue.LayoutSider, {
8587
+ "class": `${config.prefix}-layout-sider`,
8588
+ "width": "10.416vw",
8589
+ "collapsedWidth": "3.125vw",
8590
+ "collapsed": isFold.value
8591
+ }, {
8592
+ default: () => [vue.createVNode("div", {
8593
+ "class": ["folder", {
8594
+ isFold: isFold.value
8595
+ }],
8596
+ "onClick": () => toggleFold()
8597
+ }, [isFold.value ? vue.createVNode(iconsVue.MenuUnfoldOutlined, null, null) : vue.createVNode(iconsVue.MenuFoldOutlined, null, null)]), vue.createVNode(SideMenu, {
8598
+ "menuList": menuList.value
8599
+ }, null), vue.createVNode("div", {
8600
+ "class": "copyright"
8601
+ }, [copyright.value])]
8602
+ });
8603
+ const content = vue.createVNode(antDesignVue.LayoutContent, {
8604
+ "class": "layout-content"
8605
+ }, {
8606
+ default: () => [vue.createVNode("div", {
8607
+ "class": "content-inner"
8608
+ }, [vue.withDirectives(vue.createVNode(vue.resolveComponent("router-view"), null, null), [[vue.vShow, !isIframe.value]]), vue.withDirectives(vue.createVNode("iframe", {
8609
+ "src": iframeUrl.value,
8610
+ "height": "100%",
8611
+ "width": "100%",
8612
+ "frameborder": "0"
8613
+ }, null), [[vue.vShow, isIframe.value]])])]
8614
+ });
8520
8615
  return vue.createVNode(antDesignVue.Layout, {
8521
8616
  "class": `${config.prefix}-child-layout`
8522
8617
  }, {
8523
- default: () => [props.withHeader && vue.createVNode(antDesignVue.LayoutHeader, {
8524
- "class": "header-container"
8525
- }, {
8526
- default: () => [isDev ? vue.createVNode(ChildHeaderDev, {
8527
- "userInfo": userInfo.value
8528
- }, null) : vue.createVNode(ChildHeader, {
8529
- "userInfo": userInfo.value,
8530
- "logo": logo.value,
8531
- "onLogout": handleLogout
8532
- }, null)]
8533
- }), vue.createVNode(antDesignVue.Layout, null, {
8534
- default: () => [vue.createVNode(antDesignVue.LayoutSider, {
8535
- "class": `${config.prefix}-layout-sider`,
8536
- "width": "10.416vw",
8537
- "collapsedWidth": "3.125vw",
8538
- "collapsed": isFold.value
8539
- }, {
8540
- default: () => [vue.createVNode("div", {
8541
- "class": ["folder", {
8542
- isFold: isFold.value
8543
- }],
8544
- "onClick": () => toggleFold()
8545
- }, [isFold.value ? vue.createVNode(iconsVue.MenuUnfoldOutlined, null, null) : vue.createVNode(iconsVue.MenuFoldOutlined, null, null)]), vue.createVNode(SideMenu, {
8546
- "menuList": menuList.value
8547
- }, null), vue.createVNode("div", {
8548
- "class": "copyright"
8549
- }, [copyright.value])]
8550
- }), vue.createVNode(antDesignVue.LayoutContent, {
8551
- "class": "layout-content"
8552
- }, {
8553
- default: () => [vue.createVNode("div", {
8554
- "class": "content-inner"
8555
- }, [vue.withDirectives(vue.createVNode(vue.resolveComponent("router-view"), null, null), [[vue.vShow, !isIframe.value]]), vue.withDirectives(vue.createVNode("iframe", {
8556
- "src": iframeUrl.value,
8557
- "height": "100%",
8558
- "width": "100%",
8559
- "frameborder": "0"
8560
- }, null), [[vue.vShow, isIframe.value]])])]
8561
- })]
8618
+ default: () => [props.withHeader && header, vue.createVNode(antDesignVue.Layout, null, {
8619
+ default: () => [sider, content]
8562
8620
  })]
8563
8621
  });
8564
8622
  };