kn-cli 1.0.97 → 1.0.99

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 (127) hide show
  1. package/package.json +1 -1
  2. package/templates/template_admin/cli.config.js +4 -1
  3. package/templates/template_admin/package.json +7 -1
  4. package/templates/template_admin/public/favicon.png +0 -0
  5. package/templates/template_admin/public/index.html +6 -4
  6. package/templates/template_admin/public/src/_antd.less +30 -3
  7. package/templates/template_admin/public/src/_mixin.less +41 -0
  8. package/templates/template_admin/public/src/_reset.less +28 -20
  9. package/templates/template_admin/public/src/_variable.less +11 -6
  10. package/templates/template_admin/public/src/assets/iconfont/iconfont.eot +0 -0
  11. package/templates/template_admin/public/src/assets/iconfont/iconfont.less +60 -8
  12. package/templates/template_admin/public/src/assets/iconfont/iconfont.svg +57 -18
  13. package/templates/template_admin/public/src/assets/iconfont/iconfont.ttf +0 -0
  14. package/templates/template_admin/public/src/assets/iconfont/iconfont.woff +0 -0
  15. package/templates/template_admin/public/src/assets/iconfont/iconfont.woff2 +0 -0
  16. package/templates/template_admin/public/src/assets/images/arrow.png +0 -0
  17. package/templates/template_admin/public/src/assets/images/icon-notice.png +0 -0
  18. package/templates/template_admin/public/src/assets/images/icon-user.png +0 -0
  19. package/templates/template_admin/public/src/assets/images/loadFail.png +0 -0
  20. package/templates/template_admin/public/src/assets/images/login/bg.png +0 -0
  21. package/templates/template_admin/public/src/assets/images/login/logo.png +0 -0
  22. package/templates/template_admin/public/src/assets/images/login/slogan.png +0 -0
  23. package/templates/template_admin/public/src/assets/images/nav/icon-dep-active.png +0 -0
  24. package/templates/template_admin/public/src/assets/images/nav/icon-dep.png +0 -0
  25. package/templates/template_admin/public/src/assets/images/nav/icon-log-active.png +0 -0
  26. package/templates/template_admin/public/src/assets/images/nav/icon-log.png +0 -0
  27. package/templates/template_admin/public/src/assets/images/nav/icon-loginlog-active.png +0 -0
  28. package/templates/template_admin/public/src/assets/images/nav/icon-loginlog.png +0 -0
  29. package/templates/template_admin/public/src/assets/images/nav/icon-role-active.png +0 -0
  30. package/templates/template_admin/public/src/assets/images/nav/icon-role.png +0 -0
  31. package/templates/template_admin/public/src/assets/images/nav/icon-user-active.png +0 -0
  32. package/templates/template_admin/public/src/assets/images/nav/icon-user.png +0 -0
  33. package/templates/template_admin/public/src/assets/images/nav/nav-toggle.png +0 -0
  34. package/templates/template_admin/public/src/assets/images/nav/slogan.png +0 -0
  35. package/templates/template_admin/public/src/assets/images/noData.png +0 -0
  36. package/templates/template_admin/public/src/assets/images/noSelect.png +0 -0
  37. package/templates/template_admin/public/src/components/auth/index.jsx +7 -3
  38. package/templates/template_admin/public/src/components/auth/index.less +7 -0
  39. package/templates/template_admin/public/src/components/badge/index.jsx +47 -0
  40. package/templates/template_admin/public/src/components/badge/index.less +44 -0
  41. package/templates/template_admin/public/src/components/debug/index.jsx +27 -0
  42. package/templates/template_admin/public/src/components/debug/index.less +9 -0
  43. package/templates/template_admin/public/src/components/empty/index.jsx +28 -0
  44. package/templates/template_admin/public/src/components/empty/index.less +20 -0
  45. package/templates/template_admin/public/src/components/image/index.jsx +73 -0
  46. package/templates/template_admin/public/src/components/image/index.less +117 -0
  47. package/templates/template_admin/public/src/components/image/preview.jsx +85 -0
  48. package/templates/template_admin/public/src/components/layout/basic/index.jsx +24 -11
  49. package/templates/template_admin/public/src/components/layout/basic/index.less +58 -19
  50. package/templates/template_admin/public/src/components/layout/index.jsx +20 -17
  51. package/templates/template_admin/public/src/components/layout/index.less +4 -4
  52. package/templates/template_admin/public/src/components/layout/provider/index.jsx +19 -6
  53. package/templates/template_admin/public/src/components/{menu → leftMenu}/index.jsx +20 -28
  54. package/templates/template_admin/public/src/components/leftMenu/index.less +42 -0
  55. package/templates/template_admin/public/src/components/popup/index.jsx +25 -0
  56. package/templates/template_admin/public/src/components/table/column.jsx +47 -0
  57. package/templates/template_admin/public/src/components/table/column.less +12 -0
  58. package/templates/template_admin/public/src/components/table/index.jsx +22 -13
  59. package/templates/template_admin/public/src/components/table/index.less +15 -0
  60. package/templates/template_admin/public/src/components/text/index.jsx +98 -0
  61. package/templates/template_admin/public/src/components/text/index.less +13 -0
  62. package/templates/template_admin/public/src/components/topMenu/index.jsx +97 -0
  63. package/templates/template_admin/public/src/components/topMenu/index.less +80 -0
  64. package/templates/template_admin/public/src/components/topMenu/topBar/index.jsx +76 -0
  65. package/templates/template_admin/public/src/components/topMenu/topBar/index.less +88 -0
  66. package/templates/template_admin/public/src/components/video/index.jsx +96 -0
  67. package/templates/template_admin/public/src/components/video/index.less +132 -0
  68. package/templates/template_admin/public/src/components/video/preview.jsx +38 -0
  69. package/templates/template_admin/public/src/dictionary/index.js +108 -39
  70. package/templates/template_admin/public/src/enum.js +41 -0
  71. package/templates/template_admin/public/src/hooks/index.jsx +8 -6
  72. package/templates/template_admin/public/src/hooks/useDebounceFn.jsx +33 -0
  73. package/templates/template_admin/public/src/hooks/useInToView.jsx +58 -0
  74. package/templates/template_admin/public/src/hooks/useRouteMenu.jsx +37 -28
  75. package/templates/template_admin/public/src/hooks/useTimer.jsx +42 -0
  76. package/templates/template_admin/public/src/index.jsx +10 -7
  77. package/templates/template_admin/public/src/mock/auth.js +33 -0
  78. package/templates/template_admin/public/src/mock/demo.js +12 -74
  79. package/templates/template_admin/public/src/mock/index.js +1 -0
  80. package/templates/template_admin/public/src/pages/auth/user/create/index.jsx +55 -0
  81. package/templates/template_admin/public/src/pages/auth/user/create/index.less +6 -0
  82. package/templates/template_admin/public/src/pages/auth/user/dialog/index.jsx +96 -0
  83. package/templates/template_admin/public/src/pages/auth/user/index.jsx +271 -0
  84. package/templates/template_admin/public/src/pages/components/layout/index.jsx +75 -0
  85. package/templates/template_admin/public/src/pages/components/layout/index.less +78 -0
  86. package/templates/template_admin/public/src/pages/components/layout/titleBar/index.jsx +28 -0
  87. package/templates/template_admin/public/src/pages/components/layout/titleBar/index.less +44 -0
  88. package/templates/template_admin/public/src/pages/components/select/account/index.jsx +114 -0
  89. package/templates/template_admin/public/src/pages/components/select/device/index.jsx +83 -0
  90. package/templates/template_admin/public/src/pages/components/select/groupUser/index.jsx +172 -0
  91. package/templates/template_admin/public/src/pages/components/select/user/index.jsx +119 -0
  92. package/templates/template_admin/public/src/pages/home.jsx +79 -0
  93. package/templates/template_admin/public/src/pages/home.less +6 -0
  94. package/templates/template_admin/public/src/pages/login/index.jsx +90 -6
  95. package/templates/template_admin/public/src/pages/login/index.less +133 -24
  96. package/templates/template_admin/public/src/provider/app.jsx +72 -66
  97. package/templates/template_admin/public/src/provider/loading.jsx +47 -0
  98. package/templates/template_admin/public/src/provider/menu.jsx +117 -83
  99. package/templates/template_admin/public/src/provider/menu.less +35 -0
  100. package/templates/template_admin/public/src/route.jsx +39 -41
  101. package/templates/template_admin/public/src/services/auth.js +39 -0
  102. package/templates/template_admin/public/src/services/demo.js +3 -37
  103. package/templates/template_admin/public/src/services/index.js +139 -13
  104. package/templates/template_admin/public/src/services/login.js +37 -0
  105. package/templates/template_admin/public/src/services/socket/index.jsx +100 -0
  106. package/templates/template_admin/public/src/type.js +36 -19
  107. package/templates/template_admin/public/src/utils/event.js +58 -0
  108. package/templates/template_admin/public/src/utils/format.js +84 -0
  109. package/templates/template_admin/public/src/utils/index.js +214 -2
  110. package/templates/template_admin/public/src/utils/rule.js +3 -0
  111. package/templates/template_admin/public/static/kssoLogin.html +1 -1
  112. package/templates/template_admin/webpack.api.js +11 -3
  113. package/templates/template_admin/public/favicon.ico +0 -0
  114. package/templates/template_admin/public/src/assets/images/avatars/1.png +0 -0
  115. package/templates/template_admin/public/src/assets/images/avatars/2.png +0 -0
  116. package/templates/template_admin/public/src/assets/images/avatars/3.png +0 -0
  117. package/templates/template_admin/public/src/components/layout/centerBody/index.jsx +0 -25
  118. package/templates/template_admin/public/src/components/layout/centerBody/index.less +0 -30
  119. package/templates/template_admin/public/src/components/menu/index.less +0 -19
  120. package/templates/template_admin/public/src/components/menu/topMenu/index.jsx +0 -132
  121. package/templates/template_admin/public/src/components/menu/topMenu/index.less +0 -105
  122. package/templates/template_admin/public/src/pages/demo/detail/index.jsx +0 -27
  123. package/templates/template_admin/public/src/pages/demo/edit/index.jsx +0 -109
  124. package/templates/template_admin/public/src/pages/demo/index.less +0 -9
  125. package/templates/template_admin/public/src/pages/demo/page1.jsx +0 -161
  126. package/templates/template_admin/public/src/pages/superAdminLogin/index.jsx +0 -64
  127. package/templates/template_admin/public/src/pages/superAdminLogin/index.less +0 -44
@@ -0,0 +1,172 @@
1
+
2
+ import React, { useEffect, useState } from 'react';
3
+ // @ts-ignore
4
+ import { Select } from 'antd';
5
+
6
+ import {USERGROUP_ENUM} from '@/services/authAdmin/userGroup';
7
+ import {USER_ENUM} from '@/services/authAdmin/user';
8
+ import {formatUserName} from '@/utils/format';
9
+
10
+ const GROUP_PRE_NAME='group-';
11
+
12
+ /**
13
+ * 将组ID和用户ID,转义为 SelectGroupUser 能识别的id
14
+ * @param {number[]|number|string|string[]} groupId - 组ID列表
15
+ * @param {number[]|number|string|string[]} groupId - 用户ID列表
16
+ * @returns {string[]}
17
+ */
18
+ const encodeValue=(groupId=[],userId=[])=>{
19
+ let req=[];
20
+ if(Array.isArray(groupId)){
21
+ req = groupId.map(id=>`${GROUP_PRE_NAME}${id}`);
22
+ }else{
23
+ if(groupId){
24
+ req.push(`${GROUP_PRE_NAME}${groupId}`)
25
+ }
26
+ }
27
+ if(Array.isArray(userId)){
28
+ let temp= userId.map(id=>`${id}`);
29
+ req=[...req,...temp]
30
+ }else{
31
+ if(userId){
32
+ req.push(`${userId}`)
33
+ }
34
+ }
35
+ return req;
36
+ }
37
+
38
+ /***
39
+ * 将 SelectGroupUser 组件的值转义回需要提交给接口的 groupId和userId
40
+ * @param {string[]|string} value - 当前选中的值
41
+ *
42
+ * @returns {{groupId:string[],userId:string[]}}
43
+ */
44
+ const decodeValue=(value)=>{
45
+ let groupId=[];
46
+ let userId=[];
47
+
48
+ if(Array.isArray(value)){
49
+ value.forEach(v=>{
50
+ if(`${v}`.indexOf(GROUP_PRE_NAME)>=0){
51
+ groupId.push(`${v}`.split(GROUP_PRE_NAME)[1]);
52
+ }else{
53
+ userId.push(`${v}`);
54
+ }
55
+ })
56
+ }else{
57
+ if(`${value}`.indexOf(GROUP_PRE_NAME)>=0){
58
+ groupId.push( `${value}`.split(GROUP_PRE_NAME)[1] );
59
+ }
60
+ }
61
+ return {groupId,userId}
62
+ }
63
+
64
+ export const convert = {setValue:encodeValue,getValue:decodeValue};
65
+
66
+ /**
67
+ * 选择用户组和用户的下拉选择框组件
68
+ * @param {object} props
69
+ * @param {string|string[]} [props.value] - 值,值为组ID和用户ID混合的,组ID由group-前缀打头:['group-组id','用户id'],所以需要进行转义
70
+ * @param {(newValue:string[])=>void} [props.onChange] - 值
71
+ *
72
+ * @returns {JSX.Element}
73
+ */
74
+ const SelectGroupUser=(props)=>{
75
+ const {value:_value,onChange=null}= props;
76
+
77
+ const [groupList,setGroupList] = useState([]);
78
+
79
+ const [value,setValue]=useState(_value||[]);
80
+
81
+ const init=async ()=>{
82
+ let req1 = USERGROUP_ENUM();
83
+ let req2 = USER_ENUM({status:1});
84
+
85
+ /**
86
+ * @type {ServicesResponse}
87
+ */
88
+ let reqUserGroup = await req1;
89
+ /**
90
+ * @type {ServicesResponse}
91
+ */
92
+ let reqUsers = await req2;
93
+ let list=[];
94
+ if(reqUserGroup?.code==0){
95
+ const groupList = reqUserGroup.data.map(group=>{
96
+ const {id,name:label}=group;
97
+ let groupId = `${GROUP_PRE_NAME}${id}`;
98
+ const groupInfo = {
99
+ label,
100
+ value:groupId,
101
+ }
102
+ return groupInfo;
103
+ });
104
+ list.push({
105
+ label:'用户组',
106
+ title:'group',
107
+ options:groupList
108
+ });
109
+ }
110
+ if(reqUsers?.code==0){
111
+ const userList = reqUsers.data.map(user=>{
112
+ const {id:value,name:label}=user;
113
+ let userName = formatUserName(user);
114
+ const userInfo = {
115
+ label:userName,
116
+ value:`${value}`,
117
+ data:user
118
+ }
119
+ return userInfo;
120
+ });
121
+
122
+ list.push({
123
+ label:'用户',
124
+ title:'users',
125
+ options:userList
126
+ });
127
+ }
128
+ setGroupList(list);
129
+ }
130
+
131
+ const onGroupUserChange = (newValue) => {
132
+ console.log('onChange ', newValue);
133
+ if(onChange)onChange(newValue);
134
+ };
135
+
136
+ const onFilter=(input,option)=>{
137
+ if(option.options)return false;
138
+ const {label,value,data}= option;
139
+ if( `${label}`.indexOf(input) >=0 ||
140
+ `${value}`.indexOf(input) >=0
141
+ ){
142
+ return true;
143
+ }
144
+ if(data && data.account.indexOf(input) >=0 ){
145
+ return true;
146
+ }
147
+ return false;
148
+ }
149
+
150
+ useEffect(()=>{
151
+ if(!_value){setValue([]);return;}
152
+ setValue(_value)
153
+ },[_value]);
154
+
155
+ useEffect(()=>{
156
+ init();
157
+ },[])
158
+
159
+ return (
160
+ <Select
161
+ mode="multiple"
162
+ showSearch
163
+ value={value}
164
+ options={groupList}
165
+ onChange={onGroupUserChange}
166
+ filterOption={onFilter}
167
+ placeholder='请选择组名或用户名'
168
+ />
169
+ )
170
+ }
171
+
172
+ export default SelectGroupUser;
@@ -0,0 +1,119 @@
1
+
2
+ import React, { useEffect, useState } from 'react';
3
+ // @ts-ignore
4
+ import { Select } from 'antd';
5
+ import {USER_ENUM} from '@/services/authAdmin/user';
6
+
7
+ /**
8
+ * @typedef userEnumPrams
9
+ * @property {1|0|''} status - 1启用中的 0禁用中的 空为所有
10
+ */
11
+
12
+ /**
13
+ * 用户选择框
14
+ * 数据来源:用户管理-所有枚举
15
+ * @param {object} props
16
+ * @param {'single'|'multiple'} [props.mode='single'] - 单选/多选模式
17
+ * @param {(value:string|string[],items:object[])=>void} [props.onChange] - 选择发生变化时的回调
18
+ * @param {string|string[]} [props.value] - 选择发生变化时的回调
19
+ * @param {userEnumPrams} [props.userType={status:1}] - 选择发生变化时的回调
20
+ * @param {boolean} [props.withData=false] - 返回的数据是否包含原始用户数据
21
+ * @param {object} [props.style={}] - 样式
22
+ * @param {string} [props.placeholder] - 提示
23
+ * @param {boolean} [props.allowClear=falsse] - 一键删除按钮
24
+ *
25
+ *
26
+ *
27
+ * @returns {JSX.Element}
28
+ */
29
+ const SelectUser=(props)=>{
30
+ const {mode='single',value:_value,userType={status:1},onChange,withData=false,style:_style={},placeholder='',allowClear=false} = props;
31
+ const [list,setList]= useState([]);
32
+
33
+ const [value,setValue]=useState(mode=='single'?'':[]);
34
+
35
+ const init = async ()=>{
36
+ const req = await USER_ENUM(userType);
37
+ if(req?.code==0){
38
+ let users= req.data.map(user=>{
39
+ const {id,name,account,status} = user;
40
+
41
+ // return <Select.Option value={`${id}`} data={user}>{`${name}(${account})`}</Select.Option>
42
+ return {
43
+ label:status==0?`${name}(${account})[已禁用]`:`${name}(${account})`,
44
+ value:`${id}`,
45
+ data:user
46
+ }
47
+ })
48
+ setList(users);
49
+ }else{setList([])}
50
+ }
51
+
52
+
53
+ const onUserChange=(newValue,options)=>{
54
+ if(onChange)onChange(newValue,options);
55
+ }
56
+
57
+ const onFilter=(input,option)=>{
58
+ const {label,value}= option;
59
+ if( `${label}`.indexOf(input) >=0 ){
60
+ return true;
61
+ }
62
+ return false;
63
+ }
64
+
65
+ // useEffect(()=>{
66
+ // if(list&&list.length>0){
67
+ // if(mode=='single'){
68
+ // let find = list.filter(user=>user.value == value);
69
+ // if(!find || !find[0]){
70
+ // if(onChange)onChange(undefined);
71
+ // }
72
+ // }else{
73
+ // let newValue=[];
74
+ // value.forEach(id=>{
75
+ // let find = list.filter(user=>user.value == id);
76
+ // if(find && find[0]){
77
+ // newValue.push(id);
78
+ // }
79
+ // })
80
+ // if(onChange)onChange(newValue);
81
+
82
+ // }
83
+ // }
84
+ // },[list])
85
+
86
+ useEffect(()=>{
87
+ init();
88
+ },[])
89
+ useEffect(()=>{
90
+ if(!_value){
91
+ setValue(undefined);
92
+ return;
93
+ }
94
+ let req;
95
+ if(mode=='multiple' && Array.isArray(_value)){
96
+ req= _value.map(id=>`${id}`)
97
+ }else{
98
+ req = `${_value}`
99
+ }
100
+ setValue(req)
101
+ },[_value]);
102
+
103
+ return (
104
+ <Select
105
+ style={{..._style}}
106
+ placeholder={placeholder}
107
+ allowClear={allowClear?true:false}
108
+ // @ts-ignore
109
+ mode={mode}
110
+ showSearch
111
+ value={value}
112
+ options={list}
113
+ onChange={onUserChange}
114
+ filterOption={onFilter}
115
+ />
116
+ );
117
+ }
118
+
119
+ export default SelectUser;
@@ -0,0 +1,79 @@
1
+ import React, { useRef } from 'react';
2
+
3
+ import {
4
+ Button
5
+ // @ts-ignore
6
+ } from 'antd';
7
+
8
+ import {Layout,SearchBar,TitleBar,Content,Panel} from './components/layout'
9
+
10
+ import AppProvider from '@/provider/app';
11
+ import MenuProvider from '@/provider/menu';
12
+ import { AuthShow } from '@/components/auth';
13
+ // @ts-ignore
14
+ import styles from './home.less';
15
+
16
+ const Home = () => {
17
+
18
+ const app = AppProvider.useContainer();
19
+ const menu = MenuProvider.useContainer();
20
+
21
+ /**
22
+ * @type {React.MutableRefObject<number>}
23
+ */
24
+ const refMenuCount= useRef(1);
25
+
26
+ const onMenuMessage=()=>{
27
+ /**
28
+ * @type {MenuConfig[]}
29
+ */
30
+ let config=[
31
+ {
32
+ primaryId:'authUser',
33
+ key:'msgCount',
34
+ value:refMenuCount.current++
35
+ },
36
+ ];
37
+ menu.setMenuConfig(config);
38
+ }
39
+
40
+ const onAuthAdd=()=>{
41
+ let newAuth = [...app.auths];
42
+ if(newAuth.includes('authA'))return;
43
+ newAuth.push('authA');
44
+ app.setAuths(newAuth)
45
+ }
46
+ const onAuthRemove=()=>{
47
+ let newAuth = [...app.auths];
48
+ if(!newAuth.includes('authA'))return;
49
+ let idx = newAuth.indexOf('authA');
50
+ newAuth.splice(idx,1);
51
+ app.setAuths([...newAuth])
52
+ }
53
+ return (
54
+ <Layout>
55
+ <SearchBar>
56
+ <TitleBar label='首页'/>
57
+ </SearchBar>
58
+
59
+ <Content>
60
+ <Panel>
61
+ <section className={styles.row}>
62
+ <Button onClick={onMenuMessage}>增加菜单未读消息数</Button>
63
+
64
+ <Button onClick={onAuthAdd}>增加权限A</Button>
65
+ <AuthShow name='authA'><Button onClick={onAuthRemove}>去除权限A(有authA时才能看见)</Button></AuthShow>
66
+
67
+
68
+ </section>
69
+
70
+
71
+
72
+ </Panel>
73
+ </Content>
74
+
75
+ </Layout>
76
+ )
77
+ }
78
+
79
+ export default Home;
@@ -0,0 +1,6 @@
1
+
2
+ .row{
3
+ display: flex;
4
+ column-gap: 12px;
5
+ align-items: center;
6
+ }
@@ -1,26 +1,110 @@
1
- import React, { useEffect, useState, useRef } from 'react';
2
- // @ts-ignore
3
- import { useSearchParams } from 'react-router-dom';
1
+ import React, { useState, useEffect } from 'react';
4
2
  import ProviderApp from '@/provider/app';
3
+ // @ts-ignore
4
+ import { useSearchParams } from 'react-router-dom';
5
5
 
6
+ import ruler from '@/utils/rule';
7
+ // @ts-ignore
8
+ import {Button,Tabs,Form,Input} from 'antd';
6
9
  // @ts-ignore
7
10
  import styles from './index.less';
8
11
 
12
+ import {jumpUrl} from '@/utils';
13
+ // @ts-ignore
14
+ import imgSlogan from '@/assets/images/login/slogan.png';
15
+ // @ts-ignore
16
+ import imgLogo2 from '@/assets/images/login/logo.png';
17
+
18
+
9
19
  const Page = () => {
10
- const [search] = useSearchParams();
11
20
  const providerApp = ProviderApp.useContainer();
21
+ const [search] = useSearchParams();
22
+
23
+ const [state,setState]=useState('')
12
24
 
25
+ const [form] = Form.useForm();
26
+
13
27
  const kssoLogin=async ()=>{
14
28
  const req= await providerApp.kssoLogin();
15
29
  if(!req){
30
+ setState('login');
16
31
  return;
17
32
  }
18
33
  }
19
- useEffect(()=>{kssoLogin()},[])
34
+ const onLogin= async ()=>{
35
+ jumpUrl(`${location.protocol}//${location.host}/static/kssoLogin.html`,{replace:true})
36
+ }
37
+
38
+ const tabs=[
39
+ {
40
+ key: '1',
41
+ label: '内部账号',
42
+ children: <section className={styles.kssoLogin}>
43
+ <Button type='primary' block onClick={onLogin} size='large'>一键登录</Button>
44
+ </section>,
45
+ },
46
+ {
47
+ key: '2',
48
+ label: '外部账号',
49
+ children: (
50
+ <section className={styles.phoneLogin}>
51
+ <Form form={form} layout="vertical" initialValues={{status:'',keyword:'',dep:'',role:''}}>
52
+
53
+ <label className={styles.inputLabel}>手机号码<span className={styles.required}>*</span></label>
54
+
55
+ <Form.Item name={'phone'} rules={ruler.PHONE}>
56
+ <Input size='large' placeholder="请输入"/>
57
+ </Form.Item>
58
+
59
+ <hgroup className={styles.codeGroup}>
60
+ <label className={styles.inputLabel}>
61
+ 验证码<span className={styles.required}>*</span>
62
+ </label>
63
+ <label className={styles.sendCode}>发送验证码</label>
64
+ </hgroup>
65
+ <Form.Item name={'code'} rules={ruler.INPUT}>
66
+ <Input size='large' placeholder="请输入验证码"/>
67
+ </Form.Item>
68
+ <Button type='primary' block onClick={onLogin} size='large'>登录</Button>
69
+ </Form>
70
+ </section>
71
+ ),
72
+
73
+ },
74
+ ];
75
+ const onTab=()=>{}
76
+
77
+ useEffect(()=>{
78
+ let code = search.get('code');
79
+ if(code){
80
+ kssoLogin();
81
+ }else{
82
+ providerApp.clearLoginInfo();
83
+ setState('login')
84
+ }
85
+ },[])
20
86
 
21
87
  return (
22
88
  <section className={styles.body}>
23
- ksso登录跳转中...
89
+ {/* 左上角slogan */}
90
+ <section className={styles.sloganWrap}>
91
+ <img src={imgSlogan} className={styles.slogan} />
92
+ </section>
93
+
94
+ <section className={styles.loginWrap}>
95
+
96
+ <div className={styles.centerWrap}>
97
+ <img src={imgLogo2} className={styles.logo} data-run={state!='login'} />
98
+ <p className={styles.title}>欢迎登录<b>宙斯系统</b></p>
99
+ {
100
+ state=='login'?<Tabs defaultActiveKey='1' items={tabs} onChange={onTab} />
101
+ :<p className={styles.logining}>登录中...</p>
102
+ }
103
+
104
+
105
+ </div>
106
+ </section>
107
+
24
108
  </section>
25
109
  )
26
110
  }
@@ -1,8 +1,17 @@
1
+ @import '~@/_mixin.less';
2
+
3
+ @keyframes rotate {
4
+ from {
5
+ transform: rotate(0deg);
6
+ }
7
+ to {
8
+ transform: rotate(360deg);
9
+ }
10
+ }
1
11
 
2
12
  .link{
3
13
  display: block;
4
14
  }
5
-
6
15
  .body{
7
16
  width: 100%;
8
17
  height:100%;
@@ -10,35 +19,135 @@
10
19
  justify-content: center;
11
20
  align-items: center;
12
21
  flex-direction: column;
22
+ background-image: url('~@/assets/images/login/bg.png');
23
+ background-size: cover;
13
24
 
14
25
  }
15
- .wrap{
16
- padding:26px 32px;
17
- background-color: #ccc;
26
+ .bg2{
27
+ width: 100%;
28
+ height:100%;
29
+ display: flex;
30
+ justify-content: center;
31
+ align-items: center;
32
+ flex-direction: column;
33
+ background-image: url('~@/assets/images/login/bg.png');
34
+ background-size: auto 100%;
35
+ background-repeat: no-repeat;
36
+ }
37
+
38
+
39
+
40
+ .loginWrap{
41
+ position: fixed;
42
+ right:0;
43
+ top:0;
44
+ height: 100%;
45
+ max-width: 560px;
46
+ min-width: 384px;
47
+ width:29%;
48
+ background-size: cover;
49
+ background-repeat: no-repeat;
50
+ background-position-x: right;
51
+ background-position-y: top;
52
+ display: flex;
53
+ flex-direction: column;
54
+ align-items: center;
55
+ justify-content: center;
56
+ row-gap: 14px;
57
+ background-color: white;
58
+ padding:24px;
59
+
60
+ .centerWrap{
61
+ margin-top:-124px;
62
+ width: 336px;
63
+ display: flex;
64
+ flex-direction: column;
65
+
66
+ .phoneLogin,
67
+ .kssoLogin{
68
+ width: 100%;
69
+ margin-top: 24px;
70
+ min-height: 240px;
71
+
72
+ .codeGroup{
73
+ display: flex;
74
+ align-items: center;
75
+ justify-content: space-between;
76
+ width: 100%;
77
+ .sendCode{
78
+ font-size: 14px;
79
+ color:#0974F2;
80
+ cursor: pointer;
81
+ .no-select;
82
+ }
83
+ }
84
+ .inputLabel{
85
+ font-weight: bold;
86
+ color:#000;
87
+ font-size: 14px;
88
+ .no-select;
89
+ .required{
90
+ color:#FF1111;
91
+ font-size: 14px;
92
+ margin-left:6px;
93
+ }
94
+ }
95
+ }
96
+ }
97
+
98
+ .logining{
99
+ font-size: 18px;
100
+ font-weight: bold;
101
+ display: flex;
102
+ align-items: center;
103
+ }
18
104
  .title{
105
+ color:#1F2329;
19
106
  font-size: 24px;
20
- font-weight: var(--weight-Medium);
21
- margin-bottom: 24px;
22
- }
23
-
24
- hgroup{
25
- margin-bottom: 16px;
26
- display: block;
27
- .inputLabel{
28
- display: block;
29
- font-size: 13px;
30
- font-weight: var(--weight-Medium);
31
- color: #86909C;
32
- line-height: 22px;
33
- }
107
+ margin-bottom:12px;
108
+ margin-top:32px;
109
+ .no-select;
34
110
  }
35
- .input{
36
- width: 336px;
37
- border-radius: 4px;
38
- border: 1px solid #E5E6EB;
111
+ .logo{
112
+ width: 64px;
113
+
114
+ &[data-run='true']{
115
+ animation: rotate 2s linear infinite;
116
+ }
39
117
  }
40
118
  .btn{
41
- width: 336px;
42
- margin-top: 18px;
119
+ width: 208px;
120
+ height: 56px;
121
+ span{
122
+ font-size: 20px;
123
+ }
124
+ }
125
+ .errorText{
126
+ color:#FF1111;
127
+ font-size: 14px;
128
+ }
129
+ .footer{
130
+ position: absolute;
131
+ bottom: 24px;
132
+ width: 100%;
133
+ display: flex;
134
+ flex-direction: column;
135
+ justify-content: center;
136
+ align-items: center;
137
+ row-gap: 4px;
138
+ p{
139
+ margin-bottom: 0;
140
+ color:#0974F2;
141
+ font-size: 14px;
142
+ }
43
143
  }
144
+ }
145
+
146
+ .sloganWrap{
147
+ position: fixed;
148
+ left:24px;
149
+ top:24px;
150
+ display: flex;
151
+ align-items: center;
152
+ .slogan{width:73px;}
44
153
  }