kn-cli 1.0.107 → 1.0.109

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.
Files changed (68) hide show
  1. package/build/package.json +2 -1
  2. package/package.json +1 -1
  3. package/templates/template_admin/cli.config.js +1 -0
  4. package/templates/template_admin/public/src/_mixin.less +38 -0
  5. package/templates/template_admin/public/src/_reset.less +0 -7
  6. package/templates/template_admin/public/src/assets/images/permission/403.png +0 -0
  7. package/templates/template_admin/public/src/assets/images/permission/404.png +0 -0
  8. package/templates/template_admin/public/src/assets/images/permission/503.png +0 -0
  9. package/templates/template_admin/public/src/components/antd/index.jsx +145 -0
  10. package/templates/template_admin/public/src/components/antd/tooltip/detail/index.jsx +70 -0
  11. package/templates/template_admin/public/src/components/antd/tooltip/detail/index.less +12 -0
  12. package/templates/template_admin/public/src/components/antd/tooltip/index.jsx +69 -0
  13. package/templates/template_admin/public/src/components/antd/tooltip/index.less +28 -0
  14. package/templates/template_admin/public/src/components/auth/index.jsx +60 -3
  15. package/templates/template_admin/public/src/components/auth/navCheck.jsx +27 -0
  16. package/templates/template_admin/public/src/components/button/index.jsx +17 -0
  17. package/templates/template_admin/public/src/components/debug/index.jsx +1 -1
  18. package/templates/template_admin/public/src/components/error/index.jsx +39 -0
  19. package/templates/template_admin/public/src/components/image/index.jsx +1 -1
  20. package/templates/template_admin/public/src/components/image/preview.jsx +1 -1
  21. package/templates/template_admin/public/src/components/layout/provider/index.jsx +2 -2
  22. package/templates/template_admin/public/src/components/leftMenu/index.jsx +31 -6
  23. package/templates/template_admin/public/src/components/menuIcon/index.jsx +33 -0
  24. package/templates/template_admin/public/src/components/menuIcon/index.less +49 -0
  25. package/templates/template_admin/public/src/components/react/index.jsx +7 -0
  26. package/templates/template_admin/public/src/components/select/defaultServicesSelect/index.jsx +182 -0
  27. package/templates/template_admin/public/src/components/select/dictSelect/index.jsx +84 -0
  28. package/templates/template_admin/public/src/components/select/index.jsx +7 -0
  29. package/templates/template_admin/public/src/components/select/useSelectList.jsx +217 -0
  30. package/templates/template_admin/public/src/components/table/index.jsx +1 -1
  31. package/templates/template_admin/public/src/components/text/index.jsx +1 -1
  32. package/templates/template_admin/public/src/components/topMenu/index.jsx +6 -1
  33. package/templates/template_admin/public/src/components/topMenu/index.less +10 -1
  34. package/templates/template_admin/public/src/components/topMenu/topBar/index.jsx +6 -1
  35. package/templates/template_admin/public/src/components/topMenu/topBar/index.less +9 -0
  36. package/templates/template_admin/public/src/config.js +28 -0
  37. package/templates/template_admin/public/src/dictionary/dictionary.js +289 -0
  38. package/templates/template_admin/public/src/dictionary/index.js +22 -126
  39. package/templates/template_admin/public/src/hooks/useRouteMenu.jsx +25 -3
  40. package/templates/template_admin/public/src/hooks/useThrottole.jsx +68 -0
  41. package/templates/template_admin/public/src/index.jsx +33 -15
  42. package/templates/template_admin/public/src/menuConfig.jsx +152 -0
  43. package/templates/template_admin/public/src/pages/auth/user/create/index.jsx +1 -9
  44. package/templates/template_admin/public/src/pages/auth/user/dialog/index.jsx +1 -1
  45. package/templates/template_admin/public/src/pages/auth/user/index.jsx +3 -60
  46. package/templates/template_admin/public/src/pages/components/select/user.jsx +18 -0
  47. package/templates/template_admin/public/src/pages/demo/page1.jsx +21 -0
  48. package/templates/template_admin/public/src/pages/demo/page2.jsx +21 -0
  49. package/templates/template_admin/public/src/pages/demo/page3.jsx +21 -0
  50. package/templates/template_admin/public/src/pages/error/403.jsx +15 -0
  51. package/templates/template_admin/public/src/pages/error/404.jsx +15 -0
  52. package/templates/template_admin/public/src/pages/error/503.jsx +15 -0
  53. package/templates/template_admin/public/src/pages/error/permission.jsx +40 -0
  54. package/templates/template_admin/public/src/pages/error/permission.less +16 -0
  55. package/templates/template_admin/public/src/pages/home.jsx +15 -4
  56. package/templates/template_admin/public/src/pages/login/index.jsx +3 -2
  57. package/templates/template_admin/public/src/pages/pageTemplate.jsx +28 -0
  58. package/templates/template_admin/public/src/provider/app.jsx +86 -55
  59. package/templates/template_admin/public/src/provider/menu.jsx +75 -108
  60. package/templates/template_admin/public/src/route.jsx +55 -35
  61. package/templates/template_admin/public/src/services/index.js +28 -4
  62. package/templates/template_admin/public/src/services/socket/index.jsx +1 -1
  63. package/templates/template_admin/public/src/utils/storage.js +30 -0
  64. package/templates/template_admin/webpack.api.js +24 -0
  65. package/templates/template_admin/public/src/pages/components/select/account/index.jsx +0 -114
  66. package/templates/template_admin/public/src/pages/components/select/device/index.jsx +0 -83
  67. package/templates/template_admin/public/src/pages/components/select/groupUser/index.jsx +0 -172
  68. package/templates/template_admin/public/src/pages/components/select/user/index.jsx +0 -119
@@ -0,0 +1,68 @@
1
+ import React,{useRef} from 'react';
2
+ import { useState } from 'react';
3
+
4
+ /**
5
+ * @typedef useThrottole
6
+ * @property {boolean} throttleing - 是否在节流中
7
+ * @property {(fn:function)=>function} makeThrottole - 制作节流方法
8
+ * @property {()=>boolean} isThrottole - 判断是否节流中
9
+ */
10
+
11
+ const OUTPUT_LOG=false;
12
+ /**
13
+ * 节流函数
14
+ * @param {object} props
15
+ * @param {number} props.throttle - 节流时间
16
+ *
17
+ * @returns {useThrottole}
18
+ */
19
+ const useThrottole = ({throttle})=>{
20
+
21
+ const refThrottle= useRef(0)
22
+ const [throttleing,setThrottle] = useState(false);
23
+
24
+ const isThrottole=()=>{
25
+ return refThrottle.current > 0;
26
+ }
27
+
28
+ const startThrottole=()=>{
29
+ if(OUTPUT_LOG)console.log('节流-开始')
30
+ setThrottle(true);
31
+ refThrottle.current=throttle;
32
+ }
33
+
34
+ const releaseThrottle=()=>{
35
+
36
+ setTimeout(()=>{
37
+ if(OUTPUT_LOG)console.log('节流-释放')
38
+ setThrottle(false);
39
+ refThrottle.current=0;
40
+ },refThrottle.current)
41
+ }
42
+
43
+ const makeThrottole=(fn)=>{
44
+ if(OUTPUT_LOG)console.log('节流-创建方法')
45
+ return async (...args)=>{
46
+ if(isThrottole()){return;}
47
+ if(fn){
48
+ startThrottole();
49
+ try{
50
+ if(OUTPUT_LOG)console.log('节流-执行')
51
+ return await fn(...args);
52
+ }catch(ex){
53
+ if(OUTPUT_LOG)console.error('useThrottole:',ex);
54
+ }finally{
55
+ releaseThrottle();
56
+ }
57
+ }
58
+ }
59
+ }
60
+ if(OUTPUT_LOG)console.log('当前节流状态:',throttleing)
61
+ return {
62
+ throttleing,
63
+ makeThrottole,
64
+ isThrottole,
65
+ }
66
+ }
67
+
68
+ export default useThrottole;
@@ -1,18 +1,30 @@
1
1
  // @ts-ignore
2
2
  import React from 'react';
3
- // @ts-ignore
4
- import ReactDOM from 'react-dom';
5
- // @ts-ignore
6
- import {HashRouter} from 'react-router-dom';
7
- // import {createRoot} from 'react-dom/client';
8
- // import { createHashRouter,RouterProvider } from 'react-router-dom';
9
3
  import './_antd.less';
10
4
  import './_reset.less';
11
- import {RouteList} from './route';
5
+ import RouteList from './route';
12
6
  // @ts-ignore
13
7
  import moment from 'moment';
8
+ import { ReactRender } from './components/react';
14
9
  moment.locale('zh-cn');
15
10
 
11
+
12
+ let _error=window.console.error;
13
+ window.console.error=(...args)=>{
14
+ let filter=false;
15
+ for (const arg of args) {
16
+ console.log(arg);
17
+ if(typeof arg == 'string'){
18
+ if( /Form.*already.*set.*'initialValues'/.test(arg)){
19
+ filter=true;
20
+ break;
21
+ }
22
+ }
23
+ }
24
+ if(filter)return;
25
+ _error(...args)
26
+ }
27
+
16
28
  // @ts-ignore
17
29
  if(MOCK){
18
30
  // @ts-ignore
@@ -54,14 +66,20 @@ window.appLog(`${location.href}`);
54
66
  window.appLog(`ua:${navigator.userAgent}`);
55
67
  /* eslint-enable */
56
68
 
57
- const BasicRoute = () => {
58
- return (
59
- <HashRouter>
60
- {RouteList}
61
- </HashRouter>
62
- );
69
+
70
+ ReactRender(<RouteList />, document.getElementById('main-view'));
71
+
72
+
73
+ // 只需在入口文件中启用 HMR
74
+ // @ts-ignore
75
+ if (module.hot) {
76
+ console.warn('热更刷新监听')
77
+ // @ts-ignore
78
+ module.hot.accept('./route', () => {
79
+ console.warn('热更刷新')
80
+ const NextApp = require('./route').default;
81
+ ReactRender(<NextApp />, document.getElementById('main-view'));
82
+ });
63
83
  }
64
84
 
65
- ReactDOM.render(<BasicRoute />, document.getElementById('main-view'));
66
85
 
67
- // createRoot(document.getElementById('main-view')).render(<RouterProvider router={createHashRouter(router)} />);
@@ -0,0 +1,152 @@
1
+
2
+ import React from 'react';
3
+ // @ts-ignore
4
+ import MenuIcon from '@/components/menuIcon';
5
+ import PageTemplate from './pages/pageTemplate';
6
+
7
+
8
+ const Page1 = React.lazy(() => import('@/pages/demo/page1'));
9
+ const Page2 = React.lazy(() => import('@/pages/demo/page2'));
10
+ const Page3 = React.lazy(() => import('@/pages/demo/page3'));
11
+
12
+ const AuthUser = React.lazy(() => import('@/pages/auth/user'));
13
+ const AuthUserCreate = React.lazy(() => import('@/pages/auth/user/create'));
14
+
15
+
16
+ import Home from '@/pages/home';
17
+
18
+
19
+ const DASHBOARD={
20
+ name:'仪表盘',
21
+ url:'/',
22
+ component:<Home />,
23
+ children:[
24
+ ],
25
+ }
26
+ const DNA={
27
+ name:'基因库',
28
+ url:'/dna',
29
+ auth:true,
30
+ children:[
31
+ {
32
+ name: '父菜单1',
33
+ icon:<MenuIcon name='icon-dep'/>,
34
+ url: '/dna/parent',
35
+ auth:true,
36
+ children:[
37
+ {
38
+ component:<Page1 name='父菜单1-子菜单1'/>,
39
+ name:'子菜单1-1',
40
+ auth:true,
41
+ url:'/dna/parent/child1'
42
+ }
43
+ ]
44
+ },
45
+ {
46
+ name: '父菜单2',
47
+ icon:<MenuIcon name='icon-dep'/>,
48
+ url: '/dna/parent2',
49
+ auth:true,
50
+ children:[
51
+ {
52
+ component:<Page2 name='父菜单2-子菜单1'/>,
53
+ name:'子菜单2-1',
54
+ auth:true,
55
+ url:'/dna/parent2/child1'
56
+ }
57
+ ]
58
+ },
59
+ {
60
+ name: '父菜单3',
61
+ icon:<MenuIcon name='icon-dep'/>,
62
+ url: '/dna/parent3',
63
+ auth:true,
64
+ children:[
65
+ {
66
+ name:'子菜单3-1',
67
+ auth:true,
68
+ url:'/dna/parent3/child1',
69
+ children:[
70
+ {
71
+ component:<Page2 name='父菜单3-子菜单1-子子菜单1'/>,
72
+ name:'子菜单3-1-1',
73
+ auth:true,
74
+ url:'/dna/parent3/child1/child1'
75
+ }
76
+ ]
77
+ }
78
+ ]
79
+ },
80
+ ],
81
+ }
82
+ const AUTH={
83
+ name:'控制室',
84
+ url:'/auth',
85
+ msgCount:12,
86
+ primaryId:'auth',
87
+ children:[
88
+ {
89
+ name: '用户',
90
+ component:<AuthUser />,
91
+ icon:<MenuIcon name='icon-user'/>,
92
+ url: '/auth/user',
93
+ auth:true,
94
+ primaryId:'authUser',
95
+ msgCount:0,
96
+ children:[
97
+ {
98
+ component:<AuthUserCreate />,
99
+ name:'新建用户',
100
+ url:'/auth/user/create',
101
+ hideMenu:true
102
+ }
103
+ ]
104
+ },
105
+ {
106
+ name: '部门',
107
+ icon:<MenuIcon name='icon-dep'/>,
108
+ url: '/auth/dep',
109
+ auth:true,
110
+ children:[
111
+ {
112
+ component:<PageTemplate name='部门列表' />,
113
+ name:'部门列表',
114
+ url:'/auth/dep/list',
115
+ auth:true,
116
+ children:[
117
+ {
118
+ component:<PageTemplate name='部门详情' />,
119
+ name:'部门详情',
120
+ routeTemplate:'/auth/dep/detail/:id',
121
+ hideMenu:true,
122
+ auth:true,
123
+ }
124
+ ]
125
+ },
126
+
127
+ ]
128
+ },
129
+ {
130
+ name: '角色',
131
+ component:<PageTemplate name='角色' />,
132
+ icon:<MenuIcon name='icon-role'/>,
133
+ url: '/auth/role',
134
+ },
135
+ {
136
+ name: '操作记录',
137
+ component:<PageTemplate name='操作记录' />,
138
+ icon:<MenuIcon name='icon-log'/>,
139
+ url: '/auth/log',
140
+ msgCount:12,
141
+ },
142
+ {
143
+ name: '登录日志',
144
+ component:<PageTemplate name='登录日志' />,
145
+ icon:<MenuIcon name='icon-loginlog'/>,
146
+ url: '/auth/loginLog',
147
+ },
148
+ ],
149
+ }
150
+
151
+
152
+ export default [DASHBOARD,DNA,AUTH];
@@ -1,16 +1,8 @@
1
1
  import React from 'react';
2
2
  import {
3
- Space,
4
- Form,
5
3
  Button,
6
- Input,
7
- Select,
8
- Tabs,
9
- Badge
10
4
  // @ts-ignore
11
- } from 'antd';
12
- // @ts-ignore
13
- import {PlusOutlined} from '@ant-design/icons';
5
+ } from '@/components/antd';
14
6
 
15
7
  import ruler from '@/utils/rule';
16
8
  import {px2rem} from '@/utils';
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import ReactDom from 'react-dom';
3
3
  // @ts-ignore
4
- import { Modal, Form, Input, message,Spin } from 'antd';
4
+ import { Modal, Form, Input, message,Spin } from '@/components/antd';
5
5
  import Popup from '@/components/popup';
6
6
  import { UPDATE,GET_DETAIL } from '@/services/demo';
7
7
  import rule from '@/utils/rule';
@@ -8,7 +8,7 @@ import {
8
8
  Tabs,
9
9
  Badge
10
10
  // @ts-ignore
11
- } from 'antd';
11
+ } from '@/components/antd';
12
12
  // @ts-ignore
13
13
  import {useNavigate,} from 'react-router-dom';
14
14
  // @ts-ignore
@@ -17,7 +17,6 @@ import {PlusOutlined} from '@ant-design/icons';
17
17
  import ruler from '@/utils/rule';
18
18
  import {px2rem} from '@/utils';
19
19
  import {Layout,SearchBar,TitleBar,Content,Panel} from '@/pages/components/layout'
20
- import {emUserState} from '@/dictionary';
21
20
  import Table from '@/components/table';
22
21
  import { usePaginationWithForm } from '@/hooks';
23
22
  import Link from '@/components/link';
@@ -95,25 +94,7 @@ const AuthUser = () => {
95
94
  dataIndex: 'longName',
96
95
  render:(text,record)=>(<Table.Column minWidth={129} maxWidth={211}>{text}</Table.Column>)
97
96
  },
98
- {
99
- title: '状态',
100
- dataIndex: 'select',
101
- width:70,
102
- fixed:'right',
103
- render:(state)=>{
104
- const stateLabel = emUserState.getLabel(`${state}`);
105
- if(!stateLabel)return '-'
106
- const colors={
107
- '1':'green',
108
- '0':'red',
109
- '2':'#FAAD14',
110
- }
111
- return <Badge
112
- color={colors[`${state}`]}
113
- text={stateLabel}
114
- />
115
- }
116
- },
97
+
117
98
  {
118
99
  title: '操作',
119
100
  key: 'option',
@@ -159,25 +140,7 @@ const AuthUser = () => {
159
140
  dataIndex: 'longName',
160
141
  render:(text,record)=>(<Table.Column minWidth={129} maxWidth={211}>{text}</Table.Column>)
161
142
  },
162
- {
163
- title: '状态',
164
- dataIndex: 'select',
165
- width:70,
166
- fixed:'right',
167
- render:(state)=>{
168
- const stateLabel = emUserState.getLabel(`${state}`);
169
- if(!stateLabel)return '-'
170
- const colors={
171
- '1':'green',
172
- '0':'red',
173
- '2':'#FAAD14',
174
- }
175
- return <Badge
176
- color={colors[`${state}`]}
177
- text={stateLabel}
178
- />
179
- }
180
- },
143
+
181
144
  {
182
145
  title: '操作',
183
146
  key: 'option',
@@ -222,26 +185,6 @@ const AuthUser = () => {
222
185
  <Form.Item label="关键字" name={'keyword'} rules={ruler.KEYWORDS}>
223
186
  <Input placeholder="请输入用户名/姓名" onPressEnter={onSearch} />
224
187
  </Form.Item>
225
- <Form.Item label="状态" name={'status'} style={{width:px2rem(150)}}>
226
- <Select>
227
- <Select.Option value=''>全部</Select.Option>
228
- {emUserState.selectOptions}
229
- </Select>
230
- </Form.Item>
231
-
232
- <Form.Item label="部门" name={'dep'} style={{width:px2rem(150)}}>
233
- <Select>
234
- <Select.Option value=''>全部</Select.Option>
235
- {emUserState.selectOptions}
236
- </Select>
237
- </Form.Item>
238
-
239
- <Form.Item label="角色" name={'role'} style={{width:px2rem(150)}}>
240
- <Select>
241
- <Select.Option value=''>全部</Select.Option>
242
- {emUserState.selectOptions}
243
- </Select>
244
- </Form.Item>
245
188
 
246
189
  <Space size='middle'>
247
190
  <Button onClick={onSearch} type="primary">
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+
3
+ import {DictSelect} from "@/components/select";
4
+ // import { emAppState } from "@/dictionary";
5
+
6
+
7
+ /**
8
+ * APP状态
9
+ * @param {import("@/components/select/useSelectList").SelectListProps} props
10
+ * @returns {JSX.Element}
11
+ */
12
+ const SelectUser = (props) => {
13
+ const emDict = [];
14
+ return <DictSelect {...props} emDict={emDict} />;
15
+ };
16
+
17
+
18
+ export default SelectUser;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+
3
+ import {Layout,SearchBar,TitleBar,Content,Panel} from '@/pages/components/layout'
4
+
5
+ const PageTemplate = (props) => {
6
+ const {name} = props;
7
+ return (
8
+ <Layout>
9
+ <SearchBar>
10
+ <TitleBar label={`page1-${name}`}/>
11
+ </SearchBar>
12
+ <Content>
13
+ <Panel>
14
+ </Panel>
15
+ </Content>
16
+
17
+ </Layout>
18
+ )
19
+ }
20
+
21
+ export default PageTemplate;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+
3
+ import {Layout,SearchBar,TitleBar,Content,Panel} from '@/pages/components/layout'
4
+
5
+ const PageTemplate = (props) => {
6
+ const {name} = props;
7
+ return (
8
+ <Layout>
9
+ <SearchBar>
10
+ <TitleBar label={`page2-${name}`}/>
11
+ </SearchBar>
12
+ <Content>
13
+ <Panel>
14
+ </Panel>
15
+ </Content>
16
+
17
+ </Layout>
18
+ )
19
+ }
20
+
21
+ export default PageTemplate;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+
3
+ import {Layout,SearchBar,TitleBar,Content,Panel} from '@/pages/components/layout'
4
+
5
+ const PageTemplate = (props) => {
6
+ const {name} = props;
7
+ return (
8
+ <Layout>
9
+ <SearchBar>
10
+ <TitleBar label={`page3-${name}`}/>
11
+ </SearchBar>
12
+ <Content>
13
+ <Panel>
14
+ </Panel>
15
+ </Content>
16
+
17
+ </Layout>
18
+ )
19
+ }
20
+
21
+ export default PageTemplate;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ // @ts-ignore
3
+ import image403 from '@/assets/images/permission/403.png';
4
+ import Permission from './permission';
5
+
6
+ /**
7
+ * 403页面
8
+ * @returns {JSX.Element}
9
+ */
10
+ const Page403 = () => {
11
+
12
+ return <Permission title='没有访问权限!' backButton img={image403} />
13
+ }
14
+
15
+ export default Page403;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ // @ts-ignore
3
+ import image404 from '@/assets/images/permission/404.png';
4
+ import Permission from './permission';
5
+
6
+ /**
7
+ * 404页面
8
+ * @returns {JSX.Element}
9
+ */
10
+ const Page404 = () => {
11
+
12
+ return <Permission title='您访问的页面不存在!' backButton img={image404} />
13
+ }
14
+
15
+ export default Page404;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ // @ts-ignore
3
+ import image503 from '@/assets/images/permission/503.png';
4
+ import Permission from './permission';
5
+
6
+ /**
7
+ * 503页面
8
+ * @returns {JSX.Element}
9
+ */
10
+ const Page503 = () => {
11
+
12
+ return <Permission title='系统维护中,请稍后...' img={image503} />
13
+ }
14
+
15
+ export default Page503;
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ // @ts-ignore
3
+ import { useNavigate, } from 'react-router-dom';
4
+ import { Layout } from '@/pages/components/layout';
5
+ // @ts-ignore
6
+ import { Button } from "@/components/antd";
7
+ // @ts-ignore
8
+ import { px2rem } from '@/utils';
9
+ // @ts-ignore
10
+ import styles from './permission.less';
11
+
12
+ /**
13
+ * permission页面
14
+ * @param {object} props
15
+ * @param {string} props.img - 图片
16
+ * @param {string} props.title - 标题头
17
+ * @param {boolean} [props.backButton] - 返回按钮
18
+ * @returns {JSX.Element}
19
+ */
20
+
21
+ const Permission = (props) => {
22
+ const { img, backButton = false, title } = props;
23
+ const navigator = useNavigate();
24
+
25
+ const onBack = () => navigator('/')
26
+
27
+ return (
28
+ <Layout>
29
+ <div className={styles.content}>
30
+ <img src={img} width={480} height={480} />
31
+ <div className={styles.info}>
32
+ <div className={styles.title} style={{ marginBottom: backButton ? px2rem(36) : '' }}>{title}</div>
33
+ {backButton && <Button type='primary' onClick={onBack}>返回首页</Button>}
34
+ </div>
35
+ </div>
36
+ </Layout>
37
+ )
38
+ }
39
+
40
+ export default Permission;
@@ -0,0 +1,16 @@
1
+ .content {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ height: 100%;
6
+ width: 100%;
7
+ background-color: #fff;
8
+ }
9
+ .info {
10
+ margin-left: 80px;
11
+ }
12
+ .title {
13
+ font-weight: 600;
14
+ font-size: 32px;
15
+ color: #1F2329;
16
+ }
@@ -1,15 +1,18 @@
1
1
  import React, { useRef } from 'react';
2
2
 
3
3
  import {
4
- Button
4
+ Button,
5
+ Select
5
6
  // @ts-ignore
6
- } from 'antd';
7
+ } from '@/components/antd';
7
8
 
8
9
  import {Layout,SearchBar,TitleBar,Content,Panel} from './components/layout'
9
10
 
10
11
  import AppProvider from '@/provider/app';
11
12
  import MenuProvider from '@/provider/menu';
12
13
  import { AuthShow } from '@/components/auth';
14
+
15
+ import {useMessageStatus} from '@/dictionary';
13
16
  // @ts-ignore
14
17
  import styles from './home.less';
15
18
 
@@ -18,6 +21,8 @@ const Home = () => {
18
21
  const app = AppProvider.useContainer();
19
22
  const menu = MenuProvider.useContainer();
20
23
 
24
+ const emMessageStatus = useMessageStatus();
25
+
21
26
  /**
22
27
  * @type {React.MutableRefObject<number>}
23
28
  */
@@ -58,13 +63,19 @@ const Home = () => {
58
63
 
59
64
  <Content>
60
65
  <Panel>
66
+ <TitleBar label='权限' />
67
+
61
68
  <section className={styles.row}>
62
69
  <Button onClick={onMenuMessage}>增加菜单未读消息数</Button>
63
-
64
70
  <Button onClick={onAuthAdd}>增加权限A</Button>
65
71
  <AuthShow name='authA'><Button onClick={onAuthRemove}>去除权限A(有authA时才能看见)</Button></AuthShow>
66
-
72
+ </section>
67
73
 
74
+ <TitleBar label='字典' />
75
+ <section className={styles.row}>
76
+ <Select style={{width:'300px'}}>
77
+ {emMessageStatus.render()}
78
+ </Select>
68
79
  </section>
69
80
 
70
81
 
@@ -5,7 +5,7 @@ import { useSearchParams } from 'react-router-dom';
5
5
 
6
6
  import ruler from '@/utils/rule';
7
7
  // @ts-ignore
8
- import {Button,Tabs,Form,Input} from 'antd';
8
+ import {Button,Tabs,Form,Input} from '@/components/antd';
9
9
  // @ts-ignore
10
10
  import styles from './index.less';
11
11
 
@@ -32,7 +32,8 @@ const Page = () => {
32
32
  }
33
33
  }
34
34
  const onLogin= async ()=>{
35
- jumpUrl(`${location.protocol}//${location.host}/static/kssoLogin.html`,{replace:true})
35
+ let nextURL = new URL(`${location.protocol}//${location.host}/static/kssoLogin.html`);
36
+ jumpUrl(nextURL.toString(),{replace:true})
36
37
  }
37
38
 
38
39
  const tabs=[