inl-ui 0.1.0-rc.21 → 0.1.0-rc.22

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,12 +9,10 @@ var antDesignVue = require('ant-design-vue');
9
9
  var vueRouter = require('vue-router');
10
10
  var _ = require('lodash');
11
11
  var qiankun = require('qiankun');
12
- var appList = require('@/micro-apps/apps');
13
12
 
14
13
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
14
 
16
15
  var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
17
- var appList__default = /*#__PURE__*/_interopDefaultLegacy(appList);
18
16
 
19
17
  const config = {
20
18
  prefix: "inl",
@@ -235,14 +233,14 @@ const Header = vue.defineComponent({
235
233
  "class": "avatar",
236
234
  "src": "https://joeschmoe.io/api/v1/random"
237
235
  }, null)]
238
- })])]), vue.createVNode("div", {
239
- "class": "logout",
240
- "onClick": () => emit("logout")
241
- }, [vue.createVNode(iconsVue.LogoutOutlined, {
242
- "style": {
243
- fontSize: "20px"
244
- }
245
- }, null)])]);
236
+ })])]), vue.createVNode(antDesignVue.Popconfirm, {
237
+ "title": "\u786E\u5B9A\u9000\u51FA\u5417?",
238
+ "onConfirm": () => emit("logout")
239
+ }, {
240
+ default: () => [vue.createVNode("div", {
241
+ "class": "logout"
242
+ }, [vue.createVNode(iconsVue.LogoutOutlined, null, null)])]
243
+ })]);
246
244
  };
247
245
  }
248
246
  });
@@ -327,7 +325,7 @@ function useActiveApp() {
327
325
  return activeAppName;
328
326
  }
329
327
 
330
- function useMicroApp() {
328
+ function useMicroApp(appList) {
331
329
  const route = vueRouter.useRoute();
332
330
  const activeAppName = useActiveApp();
333
331
  const loadAppList = vue.ref([]);
@@ -335,7 +333,7 @@ function useMicroApp() {
335
333
  const microAppName = activeAppName.value;
336
334
  const loadApp = loadAppList.value.find(item => item.name === microAppName);
337
335
  if (loadApp) return;
338
- const microApp = appList__default["default"].find(item => item.name === microAppName);
336
+ const microApp = appList.find(item => item.name === microAppName);
339
337
  if (!microApp) return;
340
338
  const domId = `microApp_${microAppName}`;
341
339
  const app = qiankun.loadMicroApp({
@@ -496,6 +494,10 @@ const PageContent = vue.defineComponent({
496
494
  extraPages: {
497
495
  type: Array,
498
496
  required: true
497
+ },
498
+ appList: {
499
+ type: Array,
500
+ required: true
499
501
  }
500
502
  },
501
503
  setup(props, {
@@ -506,7 +508,7 @@ const PageContent = vue.defineComponent({
506
508
  const activeKey = vue.ref();
507
509
  const tabList = vue.ref([]);
508
510
  const activeAppName = useActiveApp();
509
- const loadAppList = useMicroApp();
511
+ const loadAppList = useMicroApp(props.appList);
510
512
  const iframeList = vue.ref([]);
511
513
  const extraPageList = vue.ref([]);
512
514
  const handleMenuChange = ___default["default"].throttle(val => {
@@ -621,6 +623,10 @@ const Layout = vue.defineComponent({
621
623
  },
622
624
  logo: {
623
625
  type: String
626
+ },
627
+ appList: {
628
+ type: Array,
629
+ required: true
624
630
  }
625
631
  },
626
632
  setup(props, {
@@ -680,7 +686,8 @@ const Layout = vue.defineComponent({
680
686
  default: () => [vue.createVNode(PageContent, {
681
687
  "currMenu": currMenu.value,
682
688
  "menu": props.userMenu,
683
- "extraPages": props.extraPages
689
+ "extraPages": props.extraPages,
690
+ "appList": props.appList
684
691
  }, null)]
685
692
  })]
686
693
  })]
@@ -53,6 +53,10 @@ declare const _default: vue.DefineComponent<{
53
53
  logo: {
54
54
  type: StringConstructor;
55
55
  };
56
+ appList: {
57
+ type: PropType<any[]>;
58
+ required: true;
59
+ };
56
60
  }, () => JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("globalSearch" | "logout")[], "globalSearch" | "logout", vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
57
61
  userMenu: {
58
62
  type: PropType<MenuList>;
@@ -76,6 +80,10 @@ declare const _default: vue.DefineComponent<{
76
80
  logo: {
77
81
  type: StringConstructor;
78
82
  };
83
+ appList: {
84
+ type: PropType<any[]>;
85
+ required: true;
86
+ };
79
87
  }>> & {
80
88
  onGlobalSearch?: ((...args: any[]) => any) | undefined;
81
89
  onLogout?: ((...args: any[]) => any) | undefined;
@@ -1,11 +1,10 @@
1
1
  import { defineComponent, createVNode, ref, watch, resolveComponent, isVNode, computed, inject, withDirectives, vShow } from 'vue';
2
2
  import { createFromIconfontCN, SearchOutlined, LogoutOutlined, LeftOutlined, CloseOutlined, RightOutlined, MenuUnfoldOutlined, MenuFoldOutlined } from '@ant-design/icons-vue';
3
3
  import { useMounted, useThrottleFn, useVModel, watchArray, useToggle } from '@vueuse/core';
4
- import { Menu, MenuItem, Input, Badge, Avatar, SubMenu, Dropdown, Layout as Layout$1, LayoutHeader, LayoutSider, LayoutContent } from 'ant-design-vue';
4
+ import { Menu, MenuItem, Input, Badge, Avatar, Popconfirm, SubMenu, Dropdown, Layout as Layout$1, LayoutHeader, LayoutSider, LayoutContent } from 'ant-design-vue';
5
5
  import { useRoute, useRouter } from 'vue-router';
6
6
  import _, { differenceBy } from 'lodash';
7
7
  import { loadMicroApp } from 'qiankun';
8
- import appList from '@/micro-apps/apps';
9
8
 
10
9
  const config = {
11
10
  prefix: "inl",
@@ -226,14 +225,14 @@ const Header = defineComponent({
226
225
  "class": "avatar",
227
226
  "src": "https://joeschmoe.io/api/v1/random"
228
227
  }, null)]
229
- })])]), createVNode("div", {
230
- "class": "logout",
231
- "onClick": () => emit("logout")
232
- }, [createVNode(LogoutOutlined, {
233
- "style": {
234
- fontSize: "20px"
235
- }
236
- }, null)])]);
228
+ })])]), createVNode(Popconfirm, {
229
+ "title": "\u786E\u5B9A\u9000\u51FA\u5417?",
230
+ "onConfirm": () => emit("logout")
231
+ }, {
232
+ default: () => [createVNode("div", {
233
+ "class": "logout"
234
+ }, [createVNode(LogoutOutlined, null, null)])]
235
+ })]);
237
236
  };
238
237
  }
239
238
  });
@@ -318,7 +317,7 @@ function useActiveApp() {
318
317
  return activeAppName;
319
318
  }
320
319
 
321
- function useMicroApp() {
320
+ function useMicroApp(appList) {
322
321
  const route = useRoute();
323
322
  const activeAppName = useActiveApp();
324
323
  const loadAppList = ref([]);
@@ -487,6 +486,10 @@ const PageContent = defineComponent({
487
486
  extraPages: {
488
487
  type: Array,
489
488
  required: true
489
+ },
490
+ appList: {
491
+ type: Array,
492
+ required: true
490
493
  }
491
494
  },
492
495
  setup(props, {
@@ -497,7 +500,7 @@ const PageContent = defineComponent({
497
500
  const activeKey = ref();
498
501
  const tabList = ref([]);
499
502
  const activeAppName = useActiveApp();
500
- const loadAppList = useMicroApp();
503
+ const loadAppList = useMicroApp(props.appList);
501
504
  const iframeList = ref([]);
502
505
  const extraPageList = ref([]);
503
506
  const handleMenuChange = _.throttle(val => {
@@ -612,6 +615,10 @@ const Layout = defineComponent({
612
615
  },
613
616
  logo: {
614
617
  type: String
618
+ },
619
+ appList: {
620
+ type: Array,
621
+ required: true
615
622
  }
616
623
  },
617
624
  setup(props, {
@@ -671,7 +678,8 @@ const Layout = defineComponent({
671
678
  default: () => [createVNode(PageContent, {
672
679
  "currMenu": currMenu.value,
673
680
  "menu": props.userMenu,
674
- "extraPages": props.extraPages
681
+ "extraPages": props.extraPages,
682
+ "appList": props.appList
675
683
  }, null)]
676
684
  })]
677
685
  })]
package/dist/index.cjs CHANGED
@@ -13,7 +13,6 @@ var dayjs = require('dayjs');
13
13
  var iconsVue = require('@ant-design/icons-vue');
14
14
  var vueRouter = require('vue-router');
15
15
  var qiankun$1 = require('qiankun');
16
- var appList = require('@/micro-apps/apps');
17
16
 
18
17
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
19
18
 
@@ -22,9 +21,8 @@ var renderWithQiankun__default = /*#__PURE__*/_interopDefaultLegacy(renderWithQi
22
21
  var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
23
22
  var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
24
23
  var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
25
- var appList__default = /*#__PURE__*/_interopDefaultLegacy(appList);
26
24
 
27
- var version = "0.1.0-rc.20";
25
+ var version = "0.1.0-rc.21";
28
26
 
29
27
  const setTheme = theme => {
30
28
  if (theme === "dark") {
@@ -603,14 +601,14 @@ const Header = vue.defineComponent({
603
601
  "class": "avatar",
604
602
  "src": "https://joeschmoe.io/api/v1/random"
605
603
  }, null)]
606
- })])]), vue.createVNode("div", {
607
- "class": "logout",
608
- "onClick": () => emit("logout")
609
- }, [vue.createVNode(iconsVue.LogoutOutlined, {
610
- "style": {
611
- fontSize: "20px"
612
- }
613
- }, null)])]);
604
+ })])]), vue.createVNode(antDesignVue.Popconfirm, {
605
+ "title": "\u786E\u5B9A\u9000\u51FA\u5417?",
606
+ "onConfirm": () => emit("logout")
607
+ }, {
608
+ default: () => [vue.createVNode("div", {
609
+ "class": "logout"
610
+ }, [vue.createVNode(iconsVue.LogoutOutlined, null, null)])]
611
+ })]);
614
612
  };
615
613
  }
616
614
  });
@@ -695,7 +693,7 @@ function useActiveApp() {
695
693
  return activeAppName;
696
694
  }
697
695
 
698
- function useMicroApp() {
696
+ function useMicroApp(appList) {
699
697
  const route = vueRouter.useRoute();
700
698
  const activeAppName = useActiveApp();
701
699
  const loadAppList = vue.ref([]);
@@ -703,7 +701,7 @@ function useMicroApp() {
703
701
  const microAppName = activeAppName.value;
704
702
  const loadApp = loadAppList.value.find(item => item.name === microAppName);
705
703
  if (loadApp) return;
706
- const microApp = appList__default["default"].find(item => item.name === microAppName);
704
+ const microApp = appList.find(item => item.name === microAppName);
707
705
  if (!microApp) return;
708
706
  const domId = `microApp_${microAppName}`;
709
707
  const app = qiankun$1.loadMicroApp({
@@ -864,6 +862,10 @@ const PageContent = vue.defineComponent({
864
862
  extraPages: {
865
863
  type: Array,
866
864
  required: true
865
+ },
866
+ appList: {
867
+ type: Array,
868
+ required: true
867
869
  }
868
870
  },
869
871
  setup(props, {
@@ -874,7 +876,7 @@ const PageContent = vue.defineComponent({
874
876
  const activeKey = vue.ref();
875
877
  const tabList = vue.ref([]);
876
878
  const activeAppName = useActiveApp();
877
- const loadAppList = useMicroApp();
879
+ const loadAppList = useMicroApp(props.appList);
878
880
  const iframeList = vue.ref([]);
879
881
  const extraPageList = vue.ref([]);
880
882
  const handleMenuChange = ___default["default"].throttle(val => {
@@ -989,6 +991,10 @@ const Layout = vue.defineComponent({
989
991
  },
990
992
  logo: {
991
993
  type: String
994
+ },
995
+ appList: {
996
+ type: Array,
997
+ required: true
992
998
  }
993
999
  },
994
1000
  setup(props, {
@@ -1048,7 +1054,8 @@ const Layout = vue.defineComponent({
1048
1054
  default: () => [vue.createVNode(PageContent, {
1049
1055
  "currMenu": currMenu.value,
1050
1056
  "menu": props.userMenu,
1051
- "extraPages": props.extraPages
1057
+ "extraPages": props.extraPages,
1058
+ "appList": props.appList
1052
1059
  }, null)]
1053
1060
  })]
1054
1061
  })]
package/dist/index.d.ts CHANGED
@@ -177,6 +177,10 @@ declare const _default$1: vue.DefineComponent<{
177
177
  logo: {
178
178
  type: StringConstructor;
179
179
  };
180
+ appList: {
181
+ type: PropType<any[]>;
182
+ required: true;
183
+ };
180
184
  }, () => JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("globalSearch" | "logout")[], "globalSearch" | "logout", vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
181
185
  userMenu: {
182
186
  type: PropType<MenuList>;
@@ -200,6 +204,10 @@ declare const _default$1: vue.DefineComponent<{
200
204
  logo: {
201
205
  type: StringConstructor;
202
206
  };
207
+ appList: {
208
+ type: PropType<any[]>;
209
+ required: true;
210
+ };
203
211
  }>> & {
204
212
  onGlobalSearch?: ((...args: any[]) => any) | undefined;
205
213
  onLogout?: ((...args: any[]) => any) | undefined;
package/dist/index.js CHANGED
@@ -2,16 +2,15 @@ import qiankun from 'vite-plugin-qiankun';
2
2
  import renderWithQiankun, { qiankunWindow } from 'vite-plugin-qiankun/dist/helper';
3
3
  import { createApp, ref, watch, reactive, onMounted, onBeforeUnmount, nextTick, defineComponent, createVNode, resolveComponent, isVNode, computed, inject, withDirectives, vShow } from 'vue';
4
4
  import axios from 'axios';
5
- import { message, Menu, MenuItem, Input, Badge, Avatar, SubMenu, Dropdown, Layout as Layout$1, LayoutHeader, LayoutSider, LayoutContent } from 'ant-design-vue';
5
+ import { message, Menu, MenuItem, Input, Badge, Avatar, Popconfirm, SubMenu, Dropdown, Layout as Layout$1, LayoutHeader, LayoutSider, LayoutContent } from 'ant-design-vue';
6
6
  import _, { isEmpty, omit, debounce, differenceBy } from 'lodash';
7
7
  import { useIntervalFn, useMounted, useThrottleFn, useVModel, watchArray, useToggle } from '@vueuse/core';
8
8
  import dayjs from 'dayjs';
9
9
  import { createFromIconfontCN, SearchOutlined, LogoutOutlined, LeftOutlined, CloseOutlined, RightOutlined, MenuUnfoldOutlined, MenuFoldOutlined } from '@ant-design/icons-vue';
10
10
  import { useRoute, useRouter } from 'vue-router';
11
11
  import { loadMicroApp } from 'qiankun';
12
- import appList from '@/micro-apps/apps';
13
12
 
14
- var version = "0.1.0-rc.20";
13
+ var version = "0.1.0-rc.21";
15
14
 
16
15
  const setTheme = theme => {
17
16
  if (theme === "dark") {
@@ -590,14 +589,14 @@ const Header = defineComponent({
590
589
  "class": "avatar",
591
590
  "src": "https://joeschmoe.io/api/v1/random"
592
591
  }, null)]
593
- })])]), createVNode("div", {
594
- "class": "logout",
595
- "onClick": () => emit("logout")
596
- }, [createVNode(LogoutOutlined, {
597
- "style": {
598
- fontSize: "20px"
599
- }
600
- }, null)])]);
592
+ })])]), createVNode(Popconfirm, {
593
+ "title": "\u786E\u5B9A\u9000\u51FA\u5417?",
594
+ "onConfirm": () => emit("logout")
595
+ }, {
596
+ default: () => [createVNode("div", {
597
+ "class": "logout"
598
+ }, [createVNode(LogoutOutlined, null, null)])]
599
+ })]);
601
600
  };
602
601
  }
603
602
  });
@@ -682,7 +681,7 @@ function useActiveApp() {
682
681
  return activeAppName;
683
682
  }
684
683
 
685
- function useMicroApp() {
684
+ function useMicroApp(appList) {
686
685
  const route = useRoute();
687
686
  const activeAppName = useActiveApp();
688
687
  const loadAppList = ref([]);
@@ -851,6 +850,10 @@ const PageContent = defineComponent({
851
850
  extraPages: {
852
851
  type: Array,
853
852
  required: true
853
+ },
854
+ appList: {
855
+ type: Array,
856
+ required: true
854
857
  }
855
858
  },
856
859
  setup(props, {
@@ -861,7 +864,7 @@ const PageContent = defineComponent({
861
864
  const activeKey = ref();
862
865
  const tabList = ref([]);
863
866
  const activeAppName = useActiveApp();
864
- const loadAppList = useMicroApp();
867
+ const loadAppList = useMicroApp(props.appList);
865
868
  const iframeList = ref([]);
866
869
  const extraPageList = ref([]);
867
870
  const handleMenuChange = _.throttle(val => {
@@ -976,6 +979,10 @@ const Layout = defineComponent({
976
979
  },
977
980
  logo: {
978
981
  type: String
982
+ },
983
+ appList: {
984
+ type: Array,
985
+ required: true
979
986
  }
980
987
  },
981
988
  setup(props, {
@@ -1035,7 +1042,8 @@ const Layout = defineComponent({
1035
1042
  default: () => [createVNode(PageContent, {
1036
1043
  "currMenu": currMenu.value,
1037
1044
  "menu": props.userMenu,
1038
- "extraPages": props.extraPages
1045
+ "extraPages": props.extraPages,
1046
+ "appList": props.appList
1039
1047
  }, null)]
1040
1048
  })]
1041
1049
  })]
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .Demo{color:red}.layout .ant-layout{height:100%}.layout .ant-layout .ant-layout-header{background-color:#132041;height:60px;line-height:60px;padding:0}.layout .ant-layout .ant-layout-header .header{align-items:center;display:flex}.layout .ant-layout .ant-layout-header .header .logo{align-items:center;display:flex;justify-content:center;width:200px}.layout .ant-layout .ant-layout-header .header .logo img{width:140px}.layout .ant-layout .ant-layout-header .header .menu{flex:auto}.layout .ant-layout .ant-layout-header .header .search{margin-left:20px;width:200px}.layout .ant-layout .ant-layout-header .header .user-info{align-items:center;display:flex;margin:0 20px}.layout .ant-layout .ant-layout-header .header .user-info .username{color:#fff}.layout .ant-layout .ant-layout-sider{background:#1b2c55}.layout .ant-layout .ant-layout-sider .ant-layout-sider-children{display:flex;flex-direction:column}.layout .ant-layout .ant-layout-sider .folder{color:#fff;font-size:20px;height:38px;line-height:38px;padding:0 16px;text-align:right}.layout .ant-layout .ant-layout-sider .ant-menu{flex:1;overflow-y:auto}.layout .ant-layout .ant-layout-sider .copyright{color:#b9c2d5;font-size:12px;padding:8px;text-align:center}.layout .ant-layout .ant-layout-sider.ant-layout-sider-collapsed .copyright{display:none}.layout .ant-layout .ant-layout-content{display:flex;flex-direction:column;padding:10px}.layout .ant-layout .ant-layout-content .tab-list{align-items:center;display:flex}.layout .ant-layout .ant-layout-content .tab-list .handle{background-color:#fff;border-radius:2px;color:#bbbfce;cursor:pointer;height:20px;text-align:center;width:20px}.layout .ant-layout .ant-layout-content .tab-list .tabs-container{display:flex;flex:1;flex-wrap:nowrap;margin:0 8px;overflow:auto}.layout .ant-layout .ant-layout-content .tab-list .tabs-container::-webkit-scrollbar{height:0}.layout .ant-layout .ant-layout-content .tab-list .tabs-container .tab{align-items:center;border-radius:6px 6px 0 0;color:#5c667d;cursor:pointer;display:flex;padding:6px 16px}.layout .ant-layout .ant-layout-content .tab-list .tabs-container .tab .icon{margin-right:4px}.layout .ant-layout .ant-layout-content .tab-list .tabs-container .tab .tab-name{white-space:nowrap}.layout .ant-layout .ant-layout-content .tab-list .tabs-container .tab .close{margin-left:6px}.layout .ant-layout .ant-layout-content .tab-list .tabs-container .tab.active{background-color:#fff;color:#1d33a2}.layout .ant-layout .ant-layout-content .page-content{display:flex;flex:1;flex-direction:column}.layout .ant-layout .ant-layout-content .page-content .page-container{background-color:#fff;flex:1;overflow:auto;padding:24px}
1
+ .Demo{color:red}.layout .ant-layout{height:100%}.layout .ant-layout .ant-layout-header{background-color:#132041;height:60px;line-height:60px;padding:0}.layout .ant-layout .ant-layout-header .header{align-items:center;display:flex;padding-right:20px}.layout .ant-layout .ant-layout-header .header .logo{align-items:center;display:flex;justify-content:center;width:200px}.layout .ant-layout .ant-layout-header .header .logo img{width:140px}.layout .ant-layout .ant-layout-header .header .menu{flex:auto}.layout .ant-layout .ant-layout-header .header .search{margin-left:20px;width:200px}.layout .ant-layout .ant-layout-header .header .user-info{align-items:center;display:flex;margin:0 20px}.layout .ant-layout .ant-layout-header .header .user-info .username{color:#fff}.layout .ant-layout .ant-layout-header .header .logout{color:#fff;font-size:20px}.layout .ant-layout .ant-layout-header .header .logout .anticon{position:relative;top:2px}.layout .ant-layout .ant-layout-sider{background:#1b2c55}.layout .ant-layout .ant-layout-sider .ant-layout-sider-children{display:flex;flex-direction:column}.layout .ant-layout .ant-layout-sider .folder{color:#fff;font-size:20px;height:38px;line-height:38px;padding:0 16px;text-align:right}.layout .ant-layout .ant-layout-sider .ant-menu{flex:1;overflow-y:auto}.layout .ant-layout .ant-layout-sider .copyright{color:#b9c2d5;font-size:12px;padding:8px;text-align:center}.layout .ant-layout .ant-layout-sider.ant-layout-sider-collapsed .copyright{display:none}.layout .ant-layout .ant-layout-content{display:flex;flex-direction:column;padding:10px}.layout .ant-layout .ant-layout-content .tab-list{align-items:center;display:flex}.layout .ant-layout .ant-layout-content .tab-list .handle{background-color:#fff;border-radius:2px;color:#bbbfce;cursor:pointer;height:20px;text-align:center;width:20px}.layout .ant-layout .ant-layout-content .tab-list .tabs-container{display:flex;flex:1;flex-wrap:nowrap;margin:0 8px;overflow:auto}.layout .ant-layout .ant-layout-content .tab-list .tabs-container::-webkit-scrollbar{height:0}.layout .ant-layout .ant-layout-content .tab-list .tabs-container .tab{align-items:center;border-radius:6px 6px 0 0;color:#5c667d;cursor:pointer;display:flex;padding:6px 16px}.layout .ant-layout .ant-layout-content .tab-list .tabs-container .tab .icon{margin-right:4px}.layout .ant-layout .ant-layout-content .tab-list .tabs-container .tab .tab-name{white-space:nowrap}.layout .ant-layout .ant-layout-content .tab-list .tabs-container .tab .close{margin-left:6px}.layout .ant-layout .ant-layout-content .tab-list .tabs-container .tab.active{background-color:#fff;color:#1d33a2}.layout .ant-layout .ant-layout-content .page-content{display:flex;flex:1;flex-direction:column}.layout .ant-layout .ant-layout-content .page-content .page-container{background-color:#fff;flex:1;overflow:auto;padding:24px}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inl-ui",
3
- "version": "0.1.0-rc.21",
3
+ "version": "0.1.0-rc.22",
4
4
  "description": "工业 pc ui库",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -9,11 +9,12 @@
9
9
  "author": "bhabgs",
10
10
  "license": "MIT",
11
11
  "scripts": {
12
- "dev": "cross-env NODE_ENV=dev rollup -c -w",
12
+ "dev": "run-p \"build:rollup -w\"",
13
13
  "build": "esno conf/build.ts",
14
14
  "clean": "rimraf dist",
15
15
  "cp:theme": "node conf/cp1.js",
16
- "build:rollup": "rollup -c"
16
+ "build:rollup": "rollup -c",
17
+ "check:types": "tsc --noEmit"
17
18
  },
18
19
  "dependencies": {
19
20
  "@vueuse/core": "^9.6.0",
@@ -31,12 +32,14 @@
31
32
  "@vitejs/plugin-vue-jsx": "^1.3.3",
32
33
  "@vue/babel-plugin-jsx": "^1.1.1",
33
34
  "acorn-jsx": "^5.3.2",
35
+ "ant-design-vue": "^3.2.15",
34
36
  "cross-env": "^7.0.3",
35
37
  "cssnano": "^5.0.14",
36
38
  "esbuild-register": "^3.4.1",
37
39
  "esno": "^0.16.3",
38
40
  "fast-glob": "^3.2.12",
39
41
  "less": "^4.1.2",
42
+ "npm-run-all": "^4.1.5",
40
43
  "rimraf": "^3.0.2",
41
44
  "rollup": "^2.62.0",
42
45
  "rollup-plugin-copy": "^3.4.0",
@@ -46,11 +49,11 @@
46
49
  "typescript": "^4.5.4"
47
50
  },
48
51
  "peerDependencies": {
49
- "ant-design-vue": "^3.2.15",
50
- "axios": "^1.1.3",
52
+ "axios": "^1.2.0",
51
53
  "lodash": "^4.17.21",
54
+ "qiankun": "^2.8.4",
52
55
  "vite-plugin-qiankun": "^1.0.15",
53
- "vue": "^3.2.26",
54
- "vue-router": "4"
56
+ "vue": "^3.2.45",
57
+ "vue-router": "^4.1.6"
55
58
  }
56
59
  }
@@ -9,6 +9,8 @@
9
9
  .header {
10
10
  display: flex;
11
11
  align-items: center;
12
+ padding-right: 20px;
13
+
12
14
  .logo {
13
15
  display: flex;
14
16
  align-items: center;
@@ -33,6 +35,14 @@
33
35
  color: #fff;
34
36
  }
35
37
  }
38
+ .logout {
39
+ color: #fff;
40
+ font-size: 20px;
41
+ .anticon {
42
+ position: relative;
43
+ top: 2px;
44
+ }
45
+ }
36
46
  }
37
47
  }
38
48
  .ant-layout-sider {
@@ -2,7 +2,14 @@ import { defineComponent, PropType, ref, watch } from "vue";
2
2
  import { useRouter } from "vue-router";
3
3
  import { useMounted } from "@vueuse/core";
4
4
 
5
- import { Input, Menu, MenuItem, Badge, Avatar } from "ant-design-vue";
5
+ import {
6
+ Input,
7
+ Menu,
8
+ MenuItem,
9
+ Badge,
10
+ Avatar,
11
+ Popconfirm,
12
+ } from "ant-design-vue";
6
13
  import { SearchOutlined, LogoutOutlined } from "@ant-design/icons-vue";
7
14
  import { MenuList } from ".";
8
15
  import { useActiveMenu } from "./hooks/useActiveMenu";
@@ -119,9 +126,11 @@ const Header = defineComponent({
119
126
  </Badge>
120
127
  </div>
121
128
  </div>
122
- <div class="logout" onClick={() => emit("logout")}>
123
- <LogoutOutlined style={{ fontSize: "20px" }} />
124
- </div>
129
+ <Popconfirm title="确定退出吗?" onConfirm={() => emit("logout")}>
130
+ <div class="logout">
131
+ <LogoutOutlined />
132
+ </div>
133
+ </Popconfirm>
125
134
  </div>
126
135
  );
127
136
  },
@@ -1,9 +1,8 @@
1
- import { computed, nextTick, Ref, ref, watch } from 'vue';
2
- import { useRoute } from 'vue-router';
3
- import { useThrottleFn } from '@vueuse/core';
4
- import { useActiveApp } from './useActiveApp';
5
- import { loadMicroApp, MicroApp } from 'qiankun';
6
- import appList from '@/micro-apps/apps';
1
+ import { computed, nextTick, Ref, ref, watch } from "vue";
2
+ import { useRoute } from "vue-router";
3
+ import { useThrottleFn } from "@vueuse/core";
4
+ import { useActiveApp } from "./useActiveApp";
5
+ import { loadMicroApp, MicroApp } from "qiankun";
7
6
 
8
7
  interface ILoadApp {
9
8
  domId: string;
@@ -11,7 +10,7 @@ interface ILoadApp {
11
10
  app: MicroApp;
12
11
  }
13
12
 
14
- export function useMicroApp() {
13
+ export function useMicroApp(appList: any[]) {
15
14
  const route = useRoute();
16
15
  const activeAppName = useActiveApp();
17
16
 
@@ -23,7 +22,7 @@ export function useMicroApp() {
23
22
  const handleRouteChange = useThrottleFn(async () => {
24
23
  const microAppName = activeAppName.value;
25
24
  const loadApp = loadAppList.value.find(
26
- (item) => item.name === microAppName,
25
+ (item) => item.name === microAppName
27
26
  );
28
27
  if (loadApp) return;
29
28
  const microApp = appList.find((item) => item.name === microAppName);
@@ -1,4 +1,4 @@
1
- import { defineComponent, onMounted, PropType, ref, watch } from "vue";
1
+ import { defineComponent, PropType, ref, watch } from "vue";
2
2
  import { useToggle } from "@vueuse/core";
3
3
 
4
4
  import {
@@ -59,6 +59,10 @@ const Layout = defineComponent({
59
59
  logo: {
60
60
  type: String,
61
61
  },
62
+ appList: {
63
+ type: Array as PropType<any[]>,
64
+ required: true,
65
+ },
62
66
  },
63
67
  setup(props, { emit }) {
64
68
  const [isFolder, toggleFolder] = useToggle(false);
@@ -121,6 +125,7 @@ const Layout = defineComponent({
121
125
  currMenu={currMenu.value}
122
126
  menu={props.userMenu}
123
127
  extraPages={props.extraPages}
128
+ appList={props.appList}
124
129
  />
125
130
  </LayoutContent>
126
131
  </AntLayout>
@@ -25,6 +25,10 @@ const PageContent = defineComponent({
25
25
  type: Array as PropType<any>,
26
26
  required: true,
27
27
  },
28
+ appList: {
29
+ type: Array as PropType<any[]>,
30
+ required: true,
31
+ },
28
32
  },
29
33
  setup(props, { emit }) {
30
34
  const router = useRouter();
@@ -35,7 +39,7 @@ const PageContent = defineComponent({
35
39
 
36
40
  const activeAppName = useActiveApp();
37
41
 
38
- const loadAppList = useMicroApp();
42
+ const loadAppList = useMicroApp(props.appList);
39
43
 
40
44
  const iframeList = ref<any[]>([]);
41
45
  const extraPageList = ref<any[]>([]);