@wzyjs/cli 0.3.36 → 0.3.38
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/index.js +1 -1
- package/package.json +2 -2
- package/template/web/base/.next/cache/tsconfig.tsbuildinfo +1 -0
- package/template/web/base/package.json +2 -2
- package/template/web/google/package.json +2 -2
- package/template/web/middle/package.json +2 -2
- package/template/web/middle/src/components/base/Layout/Sidebar/index.tsx +43 -28
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@zenstackhq/runtime": "2.22.1",
|
|
30
30
|
"@zenstackhq/trpc": "2.22.1",
|
|
31
31
|
"antd": "^6.3.1",
|
|
32
|
-
"next": "^16.2.
|
|
32
|
+
"next": "^16.2.9",
|
|
33
33
|
"react": "^19.1.0",
|
|
34
34
|
"react-dom": "^19.1.0",
|
|
35
35
|
"server-only": "^0.0.1",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@types/react": "19.1.10",
|
|
44
44
|
"@types/react-dom": "^19",
|
|
45
45
|
"eslint": "^9",
|
|
46
|
-
"eslint-config-next": "^16.2.
|
|
46
|
+
"eslint-config-next": "^16.2.9",
|
|
47
47
|
"postcss": "^8.4.39",
|
|
48
48
|
"prisma": "^6.14.0",
|
|
49
49
|
"prisma-json-types-generator": "^3.3.0",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@zenstackhq/runtime": "2.22.1",
|
|
31
31
|
"@zenstackhq/trpc": "2.22.1",
|
|
32
32
|
"antd": "^6.3.1",
|
|
33
|
-
"next": "^16.2.
|
|
33
|
+
"next": "^16.2.9",
|
|
34
34
|
"next-auth": "^4.24.11",
|
|
35
35
|
"react": "^19.1.0",
|
|
36
36
|
"react-dom": "^19.1.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@types/react": "19.1.10",
|
|
46
46
|
"@types/react-dom": "^19",
|
|
47
47
|
"eslint": "^9",
|
|
48
|
-
"eslint-config-next": "^16.2.
|
|
48
|
+
"eslint-config-next": "^16.2.9",
|
|
49
49
|
"postcss": "^8.4.39",
|
|
50
50
|
"prisma": "^6.14.0",
|
|
51
51
|
"prisma-json-types-generator": "^3.3.0",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@zenstackhq/runtime": "2.22.1",
|
|
31
31
|
"@zenstackhq/trpc": "2.22.1",
|
|
32
32
|
"antd": "^6.3.1",
|
|
33
|
-
"next": "^16.2.
|
|
33
|
+
"next": "^16.2.9",
|
|
34
34
|
"next-auth": "^4.24.11",
|
|
35
35
|
"react": "^19.1.0",
|
|
36
36
|
"react-dom": "^19.1.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@types/react": "19.1.10",
|
|
46
46
|
"@types/react-dom": "^19",
|
|
47
47
|
"eslint": "^9",
|
|
48
|
-
"eslint-config-next": "^16.2.
|
|
48
|
+
"eslint-config-next": "^16.2.9",
|
|
49
49
|
"postcss": "^8.4.39",
|
|
50
50
|
"prisma": "^6.14.0",
|
|
51
51
|
"prisma-json-types-generator": "^3.3.0",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import Link from 'next/link'
|
|
4
4
|
import { useSession } from 'next-auth/react'
|
|
5
5
|
import { usePathname, useSearchParams } from 'next/navigation'
|
|
6
|
-
import {
|
|
6
|
+
import { resolveMiddleMenuGroups, type MiddleResolvedPage } from '@wzyjs/middle-sdk/page'
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
AppstoreOutlined,
|
|
@@ -19,6 +19,11 @@ const menuItemClassName = (isActive: boolean) => [
|
|
|
19
19
|
: 'text-slate-600 hover:bg-slate-100 hover:text-slate-950 dark:text-[#aab4c2] dark:hover:bg-[#202632] dark:hover:text-[#e8edf5]',
|
|
20
20
|
].join(' ')
|
|
21
21
|
|
|
22
|
+
const subMenuItemClassName = (isActive: boolean) => [
|
|
23
|
+
menuItemClassName(isActive),
|
|
24
|
+
'h-9 pl-8 text-[13px]',
|
|
25
|
+
].join(' ')
|
|
26
|
+
|
|
22
27
|
const getPageIcon = (item: MiddleResolvedPage) => (
|
|
23
28
|
getIconNode(item.page.icon) ?? (item.isExternal ? <LinkOutlined /> : <AppstoreOutlined />)
|
|
24
29
|
)
|
|
@@ -39,8 +44,9 @@ export const LayoutSidebar = () => {
|
|
|
39
44
|
const pathname = usePathname()
|
|
40
45
|
const searchParams = useSearchParams()
|
|
41
46
|
|
|
42
|
-
const
|
|
47
|
+
const menuGroups = resolveMiddleMenuGroups({
|
|
43
48
|
iframePagePath: '/middle',
|
|
49
|
+
pages: session?.pages,
|
|
44
50
|
pathname,
|
|
45
51
|
iframeUrl: searchParams.get('url'),
|
|
46
52
|
})
|
|
@@ -48,33 +54,42 @@ export const LayoutSidebar = () => {
|
|
|
48
54
|
return (
|
|
49
55
|
<aside className='hidden w-56 shrink-0 border-r border-slate-200 bg-white/90 transition-colors dark:border-[#303846] dark:bg-[#171c23] md:block'>
|
|
50
56
|
<nav className='p-3' aria-label='主菜单'>
|
|
51
|
-
<div className='flex flex-col gap-
|
|
52
|
-
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
57
|
+
<div className='flex flex-col gap-3'>
|
|
58
|
+
{menuGroups.length ? menuGroups.map(group => (
|
|
59
|
+
<section key={group.groupName} className='flex flex-col gap-1'>
|
|
60
|
+
<div className='px-3 pt-1 text-[11px] font-semibold tracking-[0.08em] text-slate-400 dark:text-[#6f7b8d]'>
|
|
61
|
+
{group.groupName}
|
|
62
|
+
</div>
|
|
63
|
+
<div className='flex flex-col gap-1'>
|
|
64
|
+
{group.items.map(item => {
|
|
65
|
+
if (item.isBlank) {
|
|
66
|
+
return (
|
|
67
|
+
<a
|
|
68
|
+
key={item.page.path}
|
|
69
|
+
href={item.href}
|
|
70
|
+
target={item.target}
|
|
71
|
+
rel={item.rel}
|
|
72
|
+
className={subMenuItemClassName(false)}
|
|
73
|
+
>
|
|
74
|
+
<MenuItemContent item={item} />
|
|
75
|
+
</a>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
66
78
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
return (
|
|
80
|
+
<Link
|
|
81
|
+
key={item.page.path}
|
|
82
|
+
href={item.href}
|
|
83
|
+
aria-current={item.isActive ? 'page' : undefined}
|
|
84
|
+
className={subMenuItemClassName(item.isActive)}
|
|
85
|
+
>
|
|
86
|
+
<MenuItemContent item={item} />
|
|
87
|
+
</Link>
|
|
88
|
+
)
|
|
89
|
+
})}
|
|
90
|
+
</div>
|
|
91
|
+
</section>
|
|
92
|
+
)) : (
|
|
78
93
|
<div className='px-3 py-2 text-sm leading-6'>
|
|
79
94
|
<Typography.Text type='secondary'>
|
|
80
95
|
暂未获取到中台菜单,请重新登录或检查当前账号是否已启用应用访问。
|