kn-cli 1.0.133 → 1.0.135
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/build/shellUtil.sh +2 -2
- package/build/start.sh +3 -2
- package/build/vite.config.js +1 -0
- package/package.json +1 -1
- package/templates/template_admin_antd5/package.json +3 -3
- package/templates/template_admin_antd5/public/src/_antd.less +4 -4
- package/templates/template_admin_antd5/public/src/_reset.module.less +1 -1
- package/templates/template_admin_antd5/public/src/_variable.module.less +5 -5
- package/templates/template_admin_antd5/public/src/assets/images/expand-hover.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/expand.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/icon-add.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/icon-full-size.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/icon-resize.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/icon-user.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/login/bg.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/login/logo.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/nav/slogan.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/unexpand-hover.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/unexpand.png +0 -0
- package/templates/template_admin_antd5/public/src/components/antd/antProvider.jsx +16 -4
- package/templates/template_admin_antd5/public/src/components/antd/drawer/README.md +336 -0
- package/templates/template_admin_antd5/public/src/components/antd/drawer/index.jsx +264 -0
- package/templates/template_admin_antd5/public/src/components/antd/index.jsx +19 -7
- package/templates/template_admin_antd5/public/src/components/antd/index.module.less +26 -0
- package/templates/template_admin_antd5/public/src/components/antd/modal/README.md +324 -0
- package/templates/template_admin_antd5/public/src/components/antd/modal/index.jsx +185 -0
- package/templates/template_admin_antd5/public/src/components/antd/select/index.jsx +1 -1
- package/templates/template_admin_antd5/public/src/components/antd/spin/index.jsx +92 -0
- package/templates/template_admin_antd5/public/src/components/antd/spin/index.module.less +58 -0
- package/templates/template_admin_antd5/public/src/components/antd/theme.js +19 -8
- package/templates/template_admin_antd5/public/src/components/antd/tooltip/detail/index.jsx +19 -56
- package/templates/template_admin_antd5/public/src/components/debug/index.jsx +7 -2
- package/templates/template_admin_antd5/public/src/components/error/index.jsx +0 -5
- package/templates/template_admin_antd5/public/src/components/icon/expand/index.jsx +17 -0
- package/templates/template_admin_antd5/public/src/components/icon/expand/index.module.less +22 -0
- package/templates/template_admin_antd5/public/src/components/icon/fullSize/index.jsx +13 -0
- package/templates/template_admin_antd5/public/src/components/icon/fullSize/index.module.less +28 -0
- package/templates/template_admin_antd5/public/src/components/icon/index.jsx +7 -1
- package/templates/template_admin_antd5/public/src/components/image/preview.jsx +7 -10
- package/templates/template_admin_antd5/public/src/components/layout/basic/index.module.less +1 -1
- package/templates/template_admin_antd5/public/src/components/leftMenu/index.jsx +1 -2
- package/templates/template_admin_antd5/public/src/components/link/index.module.less +2 -2
- package/templates/template_admin_antd5/public/src/components/menuIcon/index.module.less +3 -3
- package/templates/template_admin_antd5/public/src/components/popup/index.jsx +91 -50
- package/templates/template_admin_antd5/public/src/components/popup/index.module.less +22 -15
- package/templates/template_admin_antd5/public/src/components/react/index.jsx +23 -9
- package/templates/template_admin_antd5/public/src/components/resizeBox/index.jsx +3 -3
- package/templates/template_admin_antd5/public/src/components/select/defaultServicesSelect/index.jsx +151 -40
- package/templates/template_admin_antd5/public/src/components/select/dictSelect/index.jsx +19 -3
- package/templates/template_admin_antd5/public/src/components/select/useSelectList.jsx +65 -65
- package/templates/template_admin_antd5/public/src/components/table/index.jsx +48 -327
- package/templates/template_admin_antd5/public/src/components/table/index.module.less +0 -110
- package/templates/template_admin_antd5/public/src/components/table/table/index.jsx +242 -0
- package/templates/template_admin_antd5/public/src/components/table/table/index.module.less +85 -0
- package/templates/template_admin_antd5/public/src/components/table/withPage.jsx +53 -0
- package/templates/template_admin_antd5/public/src/components/topMenu/index.jsx +46 -11
- package/templates/template_admin_antd5/public/src/components/topMenu/index.module.less +10 -7
- package/templates/template_admin_antd5/public/src/components/topMenu/popmenu/index.jsx +89 -0
- package/templates/template_admin_antd5/public/src/components/topMenu/popmenu/index.module.less +76 -0
- package/templates/template_admin_antd5/public/src/components/topMenu/topBar/index.module.less +4 -3
- package/templates/template_admin_antd5/public/src/components/video/index.jsx +1 -1
- package/templates/template_admin_antd5/public/src/components/video/preview.jsx +7 -10
- package/templates/template_admin_antd5/public/src/config.js +3 -0
- package/templates/template_admin_antd5/public/src/hooks/useLoading.jsx +2 -2
- package/templates/template_admin_antd5/public/src/index.jsx +2 -4
- package/templates/template_admin_antd5/public/src/mock/demo.js +3 -3
- package/templates/template_admin_antd5/public/src/pages/antdComponents/button/index.jsx +22 -0
- package/templates/template_admin_antd5/public/src/pages/antdComponents/check/index.jsx +12 -0
- package/templates/template_admin_antd5/public/src/pages/antdComponents/index.jsx +57 -114
- package/templates/template_admin_antd5/public/src/pages/antdComponents/index.module.less +5 -0
- package/templates/template_admin_antd5/public/src/pages/antdComponents/input/index.jsx +14 -0
- package/templates/template_admin_antd5/public/src/pages/antdComponents/loading/index.jsx +31 -0
- package/templates/template_admin_antd5/public/src/pages/antdComponents/message/index.jsx +102 -0
- package/templates/template_admin_antd5/public/src/pages/antdComponents/message/index.module.less +17 -0
- package/templates/template_admin_antd5/public/src/pages/antdComponents/radio/index.jsx +26 -0
- package/templates/template_admin_antd5/public/src/pages/antdComponents/select/index.jsx +13 -0
- package/templates/template_admin_antd5/public/src/pages/antdComponents/switch/index.jsx +12 -0
- package/templates/template_admin_antd5/public/src/pages/antdComponents/tableWithPage/index.jsx +70 -0
- package/templates/template_admin_antd5/public/src/pages/antdComponents/text/index.jsx +21 -0
- package/templates/template_admin_antd5/public/src/pages/auth/user/dialog/index.jsx +48 -75
- package/templates/template_admin_antd5/public/src/pages/auth/user/index.jsx +17 -23
- package/templates/template_admin_antd5/public/src/pages/lazyLoad/index.jsx +11 -0
- package/templates/template_admin_antd5/public/src/pages/login/index.jsx +8 -3
- package/templates/template_admin_antd5/public/src/pages/login/index.module.less +18 -10
- package/templates/template_admin_antd5/public/src/route.jsx +14 -9
- package/templates/template_admin_antd5/public/src/services/demo.js +38 -2
- package/templates/template_admin_antd5/public/src/services/interceptor/index.js +30 -3
- package/templates/template_admin_antd5/public/src/types/global.d.js +306 -0
- package/templates/template_admin_antd5/public/src/utils/format.js +1 -1
- package/templates/template_admin_antd5/public/src/utils/index.js +3 -3
- package/templates/template_admin_antd5/public/src/utils/moment.js +15 -0
- package/templates/template_admin_antd5/public/src/components/_table/column.jsx +0 -47
- package/templates/template_admin_antd5/public/src/components/_table/column.module.less +0 -12
- package/templates/template_admin_antd5/public/src/components/_table/index.jsx +0 -71
- package/templates/template_admin_antd5/public/src/components/_table/index.module.less +0 -15
- package/templates/template_admin_antd5/public/src/components/badge/index.jsx +0 -47
- package/templates/template_admin_antd5/public/src/components/badge/index.module.less +0 -44
- package/templates/template_admin_antd5/public/src/components/page/pageLoading/index.jsx +0 -51
- package/templates/template_admin_antd5/public/src/components/page/pageLoading/index.module.less +0 -29
- package/templates/template_admin_antd5/public/src/components/table/aliTable/index.jsx +0 -250
- package/templates/template_admin_antd5/public/src/components/table/aliTable/index.module.less +0 -105
- package/templates/template_admin_antd5/public/src/components/toast/index.jsx +0 -79
- package/templates/template_admin_antd5/public/src/components/toast/index.module.less +0 -43
- package/templates/template_admin_antd5/public/src/type.js +0 -67
- package/templates/template_admin_antd5/renamejstojsx.js +0 -45
- package/templates/template_admin_antd5/renameless.js +0 -53
- /package/templates/template_admin_antd5/public/src/components/{button → antd/button}/index.jsx +0 -0
- /package/templates/template_admin_antd5/public/src/components/resizeBox/{index.module.css → index.module.less} +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
import styles from './index.module.less';
|
|
7
|
+
import { useRef } from 'react';
|
|
8
|
+
import { forwardRef } from 'react';
|
|
9
|
+
import { useImperativeHandle } from 'react';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
const Popmenu=(props,ref)=>{
|
|
13
|
+
const {
|
|
14
|
+
activeKeys=[]
|
|
15
|
+
} = props;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @type {[object[],React.Dispatch<object[]>]}
|
|
19
|
+
*/
|
|
20
|
+
const [menu,setMenu] = useState();
|
|
21
|
+
const [position,setPosition] = useState({x:0,y:0});
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @type {React.MutableRefObject<object>}
|
|
25
|
+
*/
|
|
26
|
+
const refSelf = useRef({timer:null});
|
|
27
|
+
|
|
28
|
+
refSelf.current.setMenu=setMenu;
|
|
29
|
+
const onMouseEnter=(_menu,_position)=>{
|
|
30
|
+
// console.log('mouse enter');
|
|
31
|
+
if(_menu){
|
|
32
|
+
setMenu(_menu);
|
|
33
|
+
setPosition(_position)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if(refSelf.current.timer){
|
|
37
|
+
// console.log('mouse enter clear timer');
|
|
38
|
+
window.clearTimeout(refSelf.current.timer);
|
|
39
|
+
refSelf.current.timer=null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
const onMouseLeave=()=>{
|
|
44
|
+
// console.log('mouse leave');
|
|
45
|
+
if(refSelf.current.timer){
|
|
46
|
+
window.clearTimeout(refSelf.current.timer)
|
|
47
|
+
}
|
|
48
|
+
refSelf.current.timer = setTimeout(()=>{
|
|
49
|
+
// console.log('mouse leave complete');
|
|
50
|
+
refSelf.current.setMenu(null)
|
|
51
|
+
},400)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
useImperativeHandle(ref, () => ({
|
|
55
|
+
onMouseLeave,
|
|
56
|
+
onMouseEnter
|
|
57
|
+
}));
|
|
58
|
+
|
|
59
|
+
if(!menu)return <></>
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<section className={styles.wrap} style={{left:`${position.x}px`,top:`${position.y}px`}} onMouseEnter={onMouseEnter.bind(this,null,null)} onMouseLeave={onMouseLeave}>
|
|
63
|
+
{
|
|
64
|
+
menu.map((group,idx)=>{
|
|
65
|
+
const hasChild = group.children?.length>0;
|
|
66
|
+
return (
|
|
67
|
+
<div className={styles.groupWrap} key={idx}>
|
|
68
|
+
<div className={styles.parent}>
|
|
69
|
+
<a href={hasChild?'javascript:void(0);':'/#'+group.url} className={styles.menu} data-no-child={!hasChild} data-checked={activeKeys.includes(group.key)}>{group.name}</a>
|
|
70
|
+
</div>
|
|
71
|
+
{
|
|
72
|
+
hasChild&&(
|
|
73
|
+
<div className={styles.childs}>
|
|
74
|
+
{group.children?.map((child,idx2)=>{
|
|
75
|
+
return <a key={`${idx}-${idx2}`} href={'/#'+child.url} data-no-child='true' className={styles.menu} data-checked={activeKeys.includes(child.key)}>{child.name}</a>
|
|
76
|
+
})}
|
|
77
|
+
</div>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
</div>
|
|
82
|
+
)
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
</section>
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
}
|
|
89
|
+
export default forwardRef(Popmenu);
|
package/templates/template_admin_antd5/public/src/components/topMenu/popmenu/index.module.less
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
@import '~@/_variable.module.less';
|
|
2
|
+
@import '~@/_mixin.module.less';
|
|
3
|
+
|
|
4
|
+
.wrap{
|
|
5
|
+
position: fixed;
|
|
6
|
+
z-index: var(--z-top-menu-pop);
|
|
7
|
+
background: #FFFFFF;
|
|
8
|
+
box-shadow: 1px 2px 6px 0px rgba(31,35,41,0.1);
|
|
9
|
+
border: 1px solid rgba(0,0,0,0.08);
|
|
10
|
+
|
|
11
|
+
border-radius: 8px;
|
|
12
|
+
padding:12px;
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
row-gap: 4px;
|
|
16
|
+
max-height: 85%;
|
|
17
|
+
overflow-y: auto;
|
|
18
|
+
padding-left: 10px;
|
|
19
|
+
.no-select;
|
|
20
|
+
|
|
21
|
+
.groupWrap{
|
|
22
|
+
max-width: 652px;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
column-gap: 8px;
|
|
26
|
+
row-gap: 8px;
|
|
27
|
+
.parent{
|
|
28
|
+
.menu{
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
.childs{
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-wrap: wrap;
|
|
35
|
+
grid-gap: 8px;
|
|
36
|
+
padding-bottom: 8px;
|
|
37
|
+
}
|
|
38
|
+
&:not(:last-child){
|
|
39
|
+
.childs{
|
|
40
|
+
border-bottom: 1px dashed #DEE0E3;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
&:not(:first-child){
|
|
44
|
+
padding-top: 8px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
.menu{
|
|
50
|
+
width: 124px;
|
|
51
|
+
height: 32px;
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
padding:8px;
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
color: #373C43;
|
|
57
|
+
font-weight: 400;
|
|
58
|
+
}
|
|
59
|
+
.menu[data-no-child='true'][data-checked='true']{
|
|
60
|
+
color:#0974F2;
|
|
61
|
+
background: #E8F3FF;
|
|
62
|
+
border-radius:4px;
|
|
63
|
+
font-weight: 500;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.menu[data-no-child='true']:hover{
|
|
67
|
+
color: #0974F2;
|
|
68
|
+
}
|
|
69
|
+
.menu[data-no-child='false']{
|
|
70
|
+
font-weight: 400;
|
|
71
|
+
font-size: 12px;
|
|
72
|
+
height: 16px;
|
|
73
|
+
color: #8F959E;
|
|
74
|
+
cursor: default;
|
|
75
|
+
}
|
|
76
|
+
}
|
package/templates/template_admin_antd5/public/src/components/topMenu/topBar/index.module.less
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
height: 100%;
|
|
18
18
|
width:100%;
|
|
19
19
|
z-index:var(--z-top-menu);
|
|
20
|
-
padding:0 10px;
|
|
20
|
+
padding:0 0 0 10px;
|
|
21
21
|
|
|
22
22
|
column-gap: 16px;
|
|
23
23
|
|
|
@@ -35,8 +35,9 @@
|
|
|
35
35
|
.notice,
|
|
36
36
|
.avatar{
|
|
37
37
|
cursor: pointer;
|
|
38
|
-
width:
|
|
39
|
-
height:
|
|
38
|
+
width: 32px;
|
|
39
|
+
height: 32px;
|
|
40
|
+
border-radius: 50%;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
.menu:global(.ant-menu){
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CloseOutlined } from '@ant-design/icons';
|
|
3
|
-
import
|
|
3
|
+
import showPopup from '@/components/popup';
|
|
4
4
|
// @ts-ignore
|
|
5
5
|
import styles from './index.module.less';
|
|
6
|
-
import { ReactRender } from '@/components/react';
|
|
7
6
|
|
|
8
7
|
const ModalPreview = (props) => {
|
|
9
|
-
const {
|
|
8
|
+
const { close, src } = props;
|
|
10
9
|
|
|
11
10
|
const onCancel = () => {
|
|
12
|
-
|
|
11
|
+
close && close();
|
|
13
12
|
};
|
|
14
13
|
|
|
15
14
|
return (
|
|
@@ -27,12 +26,10 @@ const ModalPreview = (props) => {
|
|
|
27
26
|
};
|
|
28
27
|
|
|
29
28
|
const ShowPreview = (props = {}) => {
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
popup.dom
|
|
35
|
-
);
|
|
29
|
+
return showPopup({
|
|
30
|
+
content: <ModalPreview {...props} />,
|
|
31
|
+
showMask: false,
|
|
32
|
+
closeOnClick: false,
|
|
36
33
|
});
|
|
37
34
|
};
|
|
38
35
|
export default ShowPreview;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
2
|
import { useRef,useState, useEffect } from 'react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {showLoading} from '@/components/antd';
|
|
5
5
|
|
|
6
6
|
const useLoading=(props={})=>{
|
|
7
7
|
const {canTouch=false} = props;
|
|
@@ -23,7 +23,7 @@ const useLoading=(props={})=>{
|
|
|
23
23
|
if(count > 0 ){
|
|
24
24
|
if(!refPageLoading.current){
|
|
25
25
|
// @ts-ignore
|
|
26
|
-
refPageLoading.current =
|
|
26
|
+
refPageLoading.current = showLoading({canTouch:canTouch});
|
|
27
27
|
}
|
|
28
28
|
}else{
|
|
29
29
|
if(refPageLoading.current){
|
|
@@ -3,12 +3,10 @@ import React from 'react';
|
|
|
3
3
|
import './_antd.less';
|
|
4
4
|
import './_reset.module.less';
|
|
5
5
|
import RouteList from './route';
|
|
6
|
-
// @ts-ignore
|
|
7
|
-
import moment from 'moment';
|
|
8
6
|
import { ReactRender } from './components/react';
|
|
9
7
|
import {DEBUG_VCONSOLE} from '@/config';
|
|
10
|
-
moment
|
|
11
|
-
|
|
8
|
+
import moment from '@/utils/moment';
|
|
9
|
+
moment;
|
|
12
10
|
|
|
13
11
|
let _error=window.console.error;
|
|
14
12
|
window.console.error=(...args)=>{
|
|
@@ -2,7 +2,7 @@ import qs from 'qs';
|
|
|
2
2
|
import {GET_REQUEST,waitTime} from './utils';
|
|
3
3
|
import {RESPONSE_STRUCT} from '@/services';
|
|
4
4
|
// @ts-ignore
|
|
5
|
-
import
|
|
5
|
+
import dayjs from 'dayjs';
|
|
6
6
|
|
|
7
7
|
const MAX_TOTAL=98;
|
|
8
8
|
let UPDATE_COUNT=0;
|
|
@@ -19,8 +19,8 @@ function updateListData(){
|
|
|
19
19
|
updateCount:UPDATE_COUNT,
|
|
20
20
|
name: `名称`+ `${id}`.padStart(2,'0'),
|
|
21
21
|
phone: `1370000`+ `${id}`.padStart(4,'0'),
|
|
22
|
-
date:
|
|
23
|
-
dateRange: [
|
|
22
|
+
date: dayjs().add(id,'minute').unix()*1000,//format('YYYY-MM-DD HH:mm:ss'),
|
|
23
|
+
dateRange: [dayjs().add(id,'minute').unix()*1000,dayjs().add(id,'day').unix()*1000],
|
|
24
24
|
select: selectValue[id%selectValue.length],
|
|
25
25
|
longName: `这是一个很长的名称`+ `${id}`.padStart(2,'0'),
|
|
26
26
|
imgName: 'https://nebula-api.oss-cn-shanghai.aliyuncs.com/20240329/24163932-85ea-4372-9ff7-ee7c71748bcb/1711691401353-95387929.jpeg',
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button, Space } from '@/components/antd';
|
|
3
|
+
|
|
4
|
+
const ButtonDemo = () => {
|
|
5
|
+
const onButton = () => {
|
|
6
|
+
return new Promise(resolve => {
|
|
7
|
+
setTimeout(resolve, 3000);
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<Space direction='horizontal' wrap>
|
|
13
|
+
<Button type="primary" onClick={onButton}>Primary Button</Button>
|
|
14
|
+
<Button onClick={onButton}>Default Button</Button>
|
|
15
|
+
<Button type="dashed" onClick={onButton}>Dashed Button</Button>
|
|
16
|
+
<Button type="text" onClick={onButton}>Text Button</Button>
|
|
17
|
+
<Button type="link" onClick={onButton}>Link Button</Button>
|
|
18
|
+
</Space>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default ButtonDemo;
|
|
@@ -1,142 +1,85 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {Layout,SearchBar,TitleBar,Content
|
|
4
|
-
|
|
3
|
+
import { Layout, SearchBar, TitleBar, Content } from '@/pages/components/layout';
|
|
5
4
|
import ResizeBox from '@/components/resizeBox';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import
|
|
5
|
+
import { Alert, Space } from '@/components/antd';
|
|
6
|
+
|
|
7
|
+
import ButtonDemo from './button';
|
|
8
|
+
import InputDemo from './input';
|
|
9
|
+
import SelectDemo from './select';
|
|
10
|
+
import SwitchDemo from './switch';
|
|
11
|
+
import CheckDemo from './check';
|
|
12
|
+
import RadioDemo from './radio';
|
|
13
|
+
import MessageDemo from './message';
|
|
14
|
+
import TableWithPageDemo from './tableWithPage';
|
|
15
|
+
import TextDemo from './text';
|
|
16
|
+
import LoadingDemo from './loading';
|
|
9
17
|
|
|
10
|
-
import SelectUser from '@/pages/components/select/user';
|
|
11
|
-
import { FormatGetRequest, FormatTableService } from '@/services';
|
|
12
|
-
import { GET_LIST } from '@/services/demo';
|
|
13
|
-
import form from 'antd/es/form';
|
|
14
18
|
|
|
15
19
|
const PageTemplate = (props) => {
|
|
16
|
-
const {name} = props;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const page = usePaginationWithForm({
|
|
20
|
-
afterService: [(req)=>{
|
|
21
|
-
debugger;
|
|
22
|
-
return req;
|
|
23
|
-
},FormatTableService],
|
|
24
|
-
beforeService:[FormatGetRequest],
|
|
25
|
-
service: GET_LIST,
|
|
26
|
-
pagination: DefaultPagination(),
|
|
27
|
-
form
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
const onSearch=()=>{
|
|
31
|
-
page.update({ pagination: { current: 1 }, clear: true });
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const onButton= ()=>{
|
|
35
|
-
return new Promise(resolve=>{
|
|
36
|
-
setTimeout(resolve,3000);
|
|
37
|
-
})
|
|
38
|
-
}
|
|
20
|
+
const { name } = props;
|
|
21
|
+
|
|
39
22
|
return (
|
|
40
23
|
<Layout>
|
|
41
24
|
<SearchBar>
|
|
42
|
-
<TitleBar label={`page1-${name}`}/>
|
|
43
|
-
<Alert message='antd5组件封装后效果预览'/>
|
|
25
|
+
<TitleBar label={`page1-${name}`} />
|
|
26
|
+
<Alert message='antd5组件封装后效果预览' />
|
|
44
27
|
</SearchBar>
|
|
45
28
|
<Content>
|
|
29
|
+
|
|
30
|
+
|
|
46
31
|
<Space direction='horizontal' wrap>
|
|
47
|
-
<ResizeBox title="Button">
|
|
48
|
-
<
|
|
49
|
-
<Button type="primary" onClick={onButton}>Primary Button</Button>
|
|
50
|
-
<Button onClick={onButton}>Default Button</Button>
|
|
51
|
-
<Button type="dashed" onClick={onButton}>Dashed Button</Button>
|
|
52
|
-
<Button type="text" onClick={onButton}>Text Button</Button>
|
|
53
|
-
<Button type="link" onClick={onButton}>Link Button</Button>
|
|
54
|
-
</Space>
|
|
32
|
+
<ResizeBox title="Button" autoSize>
|
|
33
|
+
<ButtonDemo />
|
|
55
34
|
</ResizeBox>
|
|
56
35
|
|
|
57
|
-
<ResizeBox title="Input">
|
|
58
|
-
<
|
|
59
|
-
<Input placeholder='input'/>
|
|
60
|
-
<InputNumber placeholder='number'/>
|
|
61
|
-
<Input.TextArea placeholder='textarea'/>
|
|
62
|
-
</Space>
|
|
36
|
+
<ResizeBox title="Input" autoSize>
|
|
37
|
+
<InputDemo />
|
|
63
38
|
</ResizeBox>
|
|
64
39
|
|
|
65
|
-
<ResizeBox title="Select">
|
|
66
|
-
<
|
|
67
|
-
<SelectUser mode={'multiple'} style={{width:'200px'}} allowClear/>
|
|
68
|
-
</Space>
|
|
40
|
+
<ResizeBox title="Select" autoSize>
|
|
41
|
+
<SelectDemo />
|
|
69
42
|
</ResizeBox>
|
|
70
43
|
|
|
71
|
-
<ResizeBox title="Switch">
|
|
72
|
-
<
|
|
73
|
-
<Switch checkedChildren="开启" unCheckedChildren="关闭" />
|
|
74
|
-
</Space>
|
|
44
|
+
<ResizeBox title="Switch" autoSize>
|
|
45
|
+
<SwitchDemo />
|
|
75
46
|
</ResizeBox>
|
|
76
47
|
|
|
77
|
-
<ResizeBox title="Check">
|
|
78
|
-
<
|
|
79
|
-
<Checkbox>选中</Checkbox>
|
|
80
|
-
</Space>
|
|
48
|
+
<ResizeBox title="Check" autoSize>
|
|
49
|
+
<CheckDemo />
|
|
81
50
|
</ResizeBox>
|
|
82
51
|
|
|
83
|
-
<ResizeBox title="Radio">
|
|
84
|
-
<
|
|
85
|
-
<Radio.Group
|
|
86
|
-
options={[
|
|
87
|
-
{
|
|
88
|
-
label: 'Apple',
|
|
89
|
-
value: 'Apple',
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
label: 'Pear',
|
|
93
|
-
value: 'Pear',
|
|
94
|
-
},
|
|
95
|
-
]}
|
|
96
|
-
optionType="button"
|
|
97
|
-
buttonStyle="solid"
|
|
98
|
-
/>
|
|
99
|
-
|
|
100
|
-
<Radio.Group
|
|
101
|
-
options={[
|
|
102
|
-
{
|
|
103
|
-
label: 'Apple',
|
|
104
|
-
value: 'Apple',
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
label: 'Pear',
|
|
108
|
-
value: 'Pear',
|
|
109
|
-
},
|
|
110
|
-
]}
|
|
111
|
-
buttonStyle="solid"
|
|
112
|
-
/>
|
|
113
|
-
</Space>
|
|
52
|
+
<ResizeBox title="Radio" autoSize>
|
|
53
|
+
<RadioDemo />
|
|
114
54
|
</ResizeBox>
|
|
115
|
-
|
|
116
|
-
<ResizeBox title="
|
|
117
|
-
<
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
dataIndex:'id'
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
title:'name',
|
|
130
|
-
dataIndex:'name'
|
|
131
|
-
}
|
|
132
|
-
]}
|
|
133
|
-
/>
|
|
55
|
+
|
|
56
|
+
<ResizeBox title="message" autoSize>
|
|
57
|
+
<MessageDemo />
|
|
58
|
+
</ResizeBox>
|
|
59
|
+
|
|
60
|
+
<ResizeBox title="Text" autoSize>
|
|
61
|
+
<TextDemo />
|
|
62
|
+
</ResizeBox>
|
|
63
|
+
|
|
64
|
+
<ResizeBox title="Loading" autoSize>
|
|
65
|
+
<LoadingDemo />
|
|
134
66
|
</ResizeBox>
|
|
67
|
+
|
|
68
|
+
<ResizeBox title="TableWithPage" autoSize>
|
|
69
|
+
<TableWithPageDemo />
|
|
70
|
+
</ResizeBox>
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
135
79
|
</Space>
|
|
136
80
|
</Content>
|
|
137
|
-
|
|
138
81
|
</Layout>
|
|
139
|
-
)
|
|
140
|
-
}
|
|
82
|
+
);
|
|
83
|
+
};
|
|
141
84
|
|
|
142
|
-
export default PageTemplate;
|
|
85
|
+
export default PageTemplate;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Input, InputNumber, Space } from '@/components/antd';
|
|
3
|
+
|
|
4
|
+
const InputDemo = () => {
|
|
5
|
+
return (
|
|
6
|
+
<Space direction='horizontal' wrap>
|
|
7
|
+
<Input placeholder='input' />
|
|
8
|
+
<InputNumber placeholder='number' />
|
|
9
|
+
<Input.TextArea placeholder='textarea' />
|
|
10
|
+
</Space>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default InputDemo;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Button, message, Space } from '@/components/antd';
|
|
3
|
+
|
|
4
|
+
import Spin,{showLoading} from '@/components/antd/spin';
|
|
5
|
+
|
|
6
|
+
const Demo = () => {
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<Space direction='horizontal' wrap>
|
|
10
|
+
<Button onClick={()=>{
|
|
11
|
+
let destory= showLoading({showMask:true,tip:'疯狂加载'});
|
|
12
|
+
setTimeout(()=>{
|
|
13
|
+
destory();
|
|
14
|
+
},5000)
|
|
15
|
+
}}>弹出loading</Button>
|
|
16
|
+
|
|
17
|
+
<Spin tip='疯狂加载'>
|
|
18
|
+
<div style={{
|
|
19
|
+
position:'relative',
|
|
20
|
+
width:'200px',
|
|
21
|
+
height:'80px',
|
|
22
|
+
border:'1px solid red'
|
|
23
|
+
}}>
|
|
24
|
+
<span onClick={()=>{message.info('点击文案')}}>局部loading</span>
|
|
25
|
+
</div>
|
|
26
|
+
</Spin>
|
|
27
|
+
</Space>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default Demo;
|