Commit 349d1978b154f6e9e74e36de7cc56a2ca261d0b0

Authored by vben
1 parent 66acb21e

fix: fix missing page refresh parameters

src/components/Breadcrumb/Breadcrumb.vue
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 .breadcrumb { 37 .breadcrumb {
38 height: @header-height; 38 height: @header-height;
39 padding-right: 20px; 39 padding-right: 20px;
40 - font-size: 14px; 40 + font-size: 12px;
41 line-height: @header-height; 41 line-height: @header-height;
42 // line-height: 1; 42 // line-height: 1;
43 43
src/components/Form/src/BasicForm.vue
@@ -74,7 +74,7 @@ @@ -74,7 +74,7 @@
74 74
75 const getMergePropsRef = computed( 75 const getMergePropsRef = computed(
76 (): FormProps => { 76 (): FormProps => {
77 - return deepMerge(props, unref(propsRef)); 77 + return deepMerge(cloneDeep(props), unref(propsRef));
78 } 78 }
79 ); 79 );
80 // 获取表单基本配置 80 // 获取表单基本配置
src/components/Menu/src/index.less
@@ -118,7 +118,7 @@ @@ -118,7 +118,7 @@
118 .ant-menu-submenu-open, 118 .ant-menu-submenu-open,
119 .ant-menu-item-selected, 119 .ant-menu-item-selected,
120 .ant-menu-submenu-selected { 120 .ant-menu-submenu-selected {
121 - color: @white !important; 121 + color: @primary-color !important;
122 border-bottom: 3px solid @primary-color; 122 border-bottom: 3px solid @primary-color;
123 } 123 }
124 124
@@ -127,7 +127,7 @@ @@ -127,7 +127,7 @@
127 .ant-menu:not(.ant-menu-inline) .ant-menu-submenu-open, 127 .ant-menu:not(.ant-menu-inline) .ant-menu-submenu-open,
128 .ant-menu-submenu-active, 128 .ant-menu-submenu-active,
129 .ant-menu-submenu-title:hover { 129 .ant-menu-submenu-title:hover {
130 - color: @white !important; 130 + color: @primary-color !important;
131 border-bottom: 3px solid @primary-color; 131 border-bottom: 3px solid @primary-color;
132 } 132 }
133 133
src/design/var/index.less
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 @multiple-height: 36px; 6 @multiple-height: 36px;
7 7
8 // headers 8 // headers
9 -@header-height: 42px; 9 +@header-height: 36px;
10 10
11 // logo width 11 // logo width
12 @logo-width: 40px; 12 @logo-width: 40px;
src/hooks/web/useTabs.ts
@@ -90,15 +90,25 @@ export function useTabs() { @@ -90,15 +90,25 @@ export function useTabs() {
90 closeOther: () => canIUseFn() && closeOther(tabStore.getCurrentTab), 90 closeOther: () => canIUseFn() && closeOther(tabStore.getCurrentTab),
91 closeCurrent: () => canIUseFn() && closeCurrent(tabStore.getCurrentTab), 91 closeCurrent: () => canIUseFn() && closeCurrent(tabStore.getCurrentTab),
92 resetCache: () => canIUseFn() && resetCache(), 92 resetCache: () => canIUseFn() && resetCache(),
93 - addTab: (path: PageEnum, goTo = false, replace = false) => { 93 + addTab: (
  94 + path: PageEnum | string,
  95 + goTo = false,
  96 + opt?: { replace?: boolean; query?: any; params?: any }
  97 + ) => {
94 const to = getTo(path); 98 const to = getTo(path);
95 99
96 if (!to) return; 100 if (!to) return;
97 useTimeout(() => { 101 useTimeout(() => {
98 tabStore.addTabByPathAction(); 102 tabStore.addTabByPathAction();
99 }, 0); 103 }, 0);
  104 + const { replace, query = {}, params = {} } = opt || {};
100 activeKeyRef.value = path; 105 activeKeyRef.value = path;
101 - goTo && replace ? router.replace : router.push(path); 106 + const data = {
  107 + path,
  108 + query,
  109 + params,
  110 + };
  111 + goTo && replace ? router.replace(data) : router.push(data);
102 }, 112 },
103 activeKeyRef, 113 activeKeyRef,
104 }; 114 };
src/layouts/default/LayoutHeader.tsx
@@ -20,7 +20,6 @@ import { GITHUB_URL } from '/@/settings/siteSetting'; @@ -20,7 +20,6 @@ import { GITHUB_URL } from '/@/settings/siteSetting';
20 import LockAction from './actions/LockActionItem'; 20 import LockAction from './actions/LockActionItem';
21 import { useModal } from '/@/components/Modal/index'; 21 import { useModal } from '/@/components/Modal/index';
22 import { errorStore } from '/@/store/modules/error'; 22 import { errorStore } from '/@/store/modules/error';
23 -import { useGo } from '/@/hooks/web/usePage';  
24 import { useWindowSizeFn } from '/@/hooks/event/useWindowSize'; 23 import { useWindowSizeFn } from '/@/hooks/event/useWindowSize';
25 import NoticeAction from './actions/notice/NoticeActionItem.vue'; 24 import NoticeAction from './actions/notice/NoticeActionItem.vue';
26 25
@@ -28,11 +27,10 @@ export default defineComponent({ @@ -28,11 +27,10 @@ export default defineComponent({
28 name: 'DefaultLayoutHeader', 27 name: 'DefaultLayoutHeader',
29 setup() { 28 setup() {
30 const widthRef = ref(200); 29 const widthRef = ref(200);
31 - const { refreshPage } = useTabs(); 30 + const { refreshPage, addTab } = useTabs();
32 const [register, { openModal }] = useModal(); 31 const [register, { openModal }] = useModal();
33 const { toggleFullscreen, isFullscreenRef } = useFullscreen(); 32 const { toggleFullscreen, isFullscreenRef } = useFullscreen();
34 33
35 - const go = useGo();  
36 const getProjectConfigRef = computed(() => { 34 const getProjectConfigRef = computed(() => {
37 return appStore.getProjectConfig; 35 return appStore.getProjectConfig;
38 }); 36 });
@@ -72,7 +70,7 @@ export default defineComponent({ @@ -72,7 +70,7 @@ export default defineComponent({
72 70
73 function handleToErrorList() { 71 function handleToErrorList() {
74 errorStore.commitErrorListCountState(0); 72 errorStore.commitErrorListCountState(0);
75 - go('/exception/error-log'); 73 + addTab('/exception/error-log', true);
76 } 74 }
77 75
78 /** 76 /**
@@ -175,12 +173,8 @@ export default defineComponent({ @@ -175,12 +173,8 @@ export default defineComponent({
175 <div> 173 <div>
176 <Tooltip> 174 <Tooltip>
177 {{ 175 {{
178 - title: () => '消息中心',  
179 - default: () => (  
180 - <div class={`layout-header__action-item`}>  
181 - <NoticeAction />  
182 - </div>  
183 - ), 176 + title: () => '消息通知',
  177 + default: () => <NoticeAction />,
184 }} 178 }}
185 </Tooltip> 179 </Tooltip>
186 </div> 180 </div>
src/layouts/default/actions/notice/NoticeActionItem.vue
1 <template> 1 <template>
2 - <div> 2 + <div class="layout-header__action-item notify-action">
3 <Popover title="" trigger="click"> 3 <Popover title="" trigger="click">
4 <Badge :count="count" :numberStyle="numberStyle"> 4 <Badge :count="count" :numberStyle="numberStyle">
5 <BellOutlined class="layout-header__action-icon" /> 5 <BellOutlined class="layout-header__action-icon" />
@@ -43,22 +43,25 @@ @@ -43,22 +43,25 @@
43 }, 43 },
44 }); 44 });
45 </script> 45 </script>
46 -<style lang="less" scoped>  
47 - /deep/ .ant-tabs-tab {  
48 - padding-top: 8px;  
49 - margin-right: 12px;  
50 - } 46 +<style lang="less">
  47 + .notify-action {
  48 + padding-top: 2px;
51 49
52 - /deep/ .ant-tabs-content {  
53 - width: 300px;  
54 - } 50 + .ant-tabs-content {
  51 + width: 300px;
  52 + }
55 53
56 - /deep/ .ant-badge {  
57 - font-size: 18px; 54 + .ant-badge {
  55 + font-size: 18px;
58 56
59 - .ant-badge-multiple-words {  
60 - padding: 0 4px;  
61 - transform: translate(26%, -48%); 57 + .ant-badge-multiple-words {
  58 + padding: 0 4px;
  59 + transform: translate(26%, -40%);
  60 + }
  61 +
  62 + svg {
  63 + width: 0.9em;
  64 + }
62 } 65 }
63 } 66 }
64 </style> 67 </style>
src/layouts/default/index.less
@@ -194,6 +194,11 @@ @@ -194,6 +194,11 @@
194 } 194 }
195 } 195 }
196 196
  197 +.ant-layout-header {
  198 + height: @header-height;
  199 + line-height: @header-height;
  200 +}
  201 +
197 .layout-header { 202 .layout-header {
198 display: flex; 203 display: flex;
199 height: @header-height; 204 height: @header-height;
@@ -336,12 +341,12 @@ @@ -336,12 +341,12 @@
336 display: flex; 341 display: flex;
337 align-items: center; 342 align-items: center;
338 height: @header-height; 343 height: @header-height;
339 - font-size: 1.3em; 344 + font-size: 1.1em;
340 cursor: pointer; 345 cursor: pointer;
341 } 346 }
342 347
343 &-icon { 348 &-icon {
344 - padding: 0 12px; 349 + padding: 0 8px;
345 } 350 }
346 } 351 }
347 352
@@ -362,13 +367,14 @@ @@ -362,13 +367,14 @@
362 .user-dropdown { 367 .user-dropdown {
363 display: flex; 368 display: flex;
364 height: 100%; 369 height: 100%;
  370 + font-size: 12px;
365 cursor: pointer; 371 cursor: pointer;
366 align-items: center; 372 align-items: center;
367 373
368 img { 374 img {
369 - width: 32px;  
370 - height: 32px;  
371 - margin-right: 24px; 375 + width: 26px;
  376 + height: 26px;
  377 + margin-right: 16px;
372 } 378 }
373 379
374 &__header { 380 &__header {
@@ -404,7 +410,7 @@ @@ -404,7 +410,7 @@
404 } 410 }
405 411
406 &__name { 412 &__name {
407 - font-size: 14px; 413 + font-size: 12px;
408 } 414 }
409 415
410 &__desc { 416 &__desc {
src/layouts/default/multitabs/index.less
@@ -7,6 +7,19 @@ @@ -7,6 +7,19 @@
7 height: @multiple-height; 7 height: @multiple-height;
8 } 8 }
9 9
  10 + // .ant-tabs:not(.ant-tabs-card) {
  11 + // .ant-tabs-nav-container {
  12 + // height: @multiple-height;
  13 + // background: @white;
  14 + // }
  15 +
  16 + // .ant-tabs-tab {
  17 + // font-size: 14px;
  18 + // line-height: 1.5515;
  19 + // background: @white;
  20 + // }
  21 + // }
  22 +
10 .ant-tabs.ant-tabs-card { 23 .ant-tabs.ant-tabs-card {
11 .ant-tabs-card-bar { 24 .ant-tabs-card-bar {
12 height: @multiple-height; 25 height: @multiple-height;
@@ -114,6 +127,10 @@ @@ -114,6 +127,10 @@
114 } 127 }
115 } 128 }
116 129
  130 +.ant-tabs-extra-content {
  131 + line-height: @multiple-height;
  132 +}
  133 +
117 .multiple-tabs-content { 134 .multiple-tabs-content {
118 &__extra { 135 &__extra {
119 display: inline-block; 136 display: inline-block;
src/layouts/default/multitabs/index.tsx
@@ -35,7 +35,11 @@ export default defineComponent({ @@ -35,7 +35,11 @@ export default defineComponent({
35 const { currentRoute } = useRouter(); 35 const { currentRoute } = useRouter();
36 const { addTab, activeKeyRef } = useTabs(); 36 const { addTab, activeKeyRef } = useTabs();
37 onMounted(() => { 37 onMounted(() => {
38 - addTab(unref(currentRoute).path as PageEnum); 38 + const route = unref(currentRoute);
  39 + addTab(unref(currentRoute).path as PageEnum, false, {
  40 + query: route.query,
  41 + params: route.params,
  42 + });
39 }); 43 });
40 44
41 // 当前激活tab 45 // 当前激活tab
@@ -60,6 +64,14 @@ export default defineComponent({ @@ -60,6 +64,14 @@ export default defineComponent({
60 // 监听路由的话虽然可以,但是路由切换的时间会造成卡顿现象? 64 // 监听路由的话虽然可以,但是路由切换的时间会造成卡顿现象?
61 // 使用useTab的addTab的话,当用户手动调转,需要自行调用addTab 65 // 使用useTab的addTab的话,当用户手动调转,需要自行调用addTab
62 // tabStore.commitAddTab((unref(currentRoute) as unknown) as AppRouteRecordRaw); 66 // tabStore.commitAddTab((unref(currentRoute) as unknown) as AppRouteRecordRaw);
  67 + // const { affix } = currentRoute.value.meta || {};
  68 + // if (affix) return;
  69 + // const hasInTab = tabStore.getTabsState.some(
  70 + // (item) => item.fullPath === currentRoute.value.fullPath
  71 + // );
  72 + // if (!hasInTab) {
  73 + // tabStore.commitAddTab((unref(currentRoute) as unknown) as AppRouteRecordRaw);
  74 + // }
63 }, 75 },
64 { 76 {
65 immediate: true, 77 immediate: true,
src/settings/projectSetting.ts
@@ -96,7 +96,7 @@ const setting: ProjectConfig = { @@ -96,7 +96,7 @@ const setting: ProjectConfig = {
96 showBreadCrumb: true, 96 showBreadCrumb: true,
97 97
98 // 使用error-handler-plugin 98 // 使用error-handler-plugin
99 - useErrorHandle: isProdMode(), 99 + useErrorHandle: true,
100 100
101 // 开启页面切换动画 101 // 开启页面切换动画
102 openRouterTransition: true, 102 openRouterTransition: true,