kn-cli 1.0.64 → 1.0.65
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/package.json +2 -1
- package/readme.md +3 -0
- package/src/create.js +2 -0
- package/templates/template_oa/public/src/components/IFrame/index.jsx +3 -0
- package/templates/template_oa/webpack.api.js +7 -3
- package/templates/template_oa_jwt/.gitignore +6 -0
- package/templates/template_oa_jwt/build.sh +7 -0
- package/templates/template_oa_jwt/cli.config.js +30 -0
- package/templates/template_oa_jwt/dev.sh +89 -0
- package/templates/template_oa_jwt/frontend_build.sh +88 -0
- package/templates/template_oa_jwt/init/prepare-commit-msg +5 -0
- package/templates/template_oa_jwt/init.sh +33 -0
- package/templates/template_oa_jwt/jsconfig.json +10 -0
- package/templates/template_oa_jwt/package.json +25 -0
- package/templates/template_oa_jwt/public/404.html +26 -0
- package/templates/template_oa_jwt/public/favicon.ico +0 -0
- package/templates/template_oa_jwt/public/index.html +44 -0
- package/templates/template_oa_jwt/public/src/_antd.less +216 -0
- package/templates/template_oa_jwt/public/src/_reset.less +134 -0
- package/templates/template_oa_jwt/public/src/_variable.less +84 -0
- package/templates/template_oa_jwt/public/src/assets/iconfont/iconfont.eot +0 -0
- package/templates/template_oa_jwt/public/src/assets/iconfont/iconfont.less +57 -0
- package/templates/template_oa_jwt/public/src/assets/iconfont/iconfont.svg +36 -0
- package/templates/template_oa_jwt/public/src/assets/iconfont/iconfont.ttf +0 -0
- package/templates/template_oa_jwt/public/src/assets/iconfont/iconfont.woff +0 -0
- package/templates/template_oa_jwt/public/src/assets/iconfont/iconfont.woff2 +0 -0
- package/templates/template_oa_jwt/public/src/assets/images/NY-pop-bg.png +0 -0
- package/templates/template_oa_jwt/public/src/assets/images/avatar.png +0 -0
- package/templates/template_oa_jwt/public/src/assets/images/loading.svg +40 -0
- package/templates/template_oa_jwt/public/src/components/Alert/index.jsx +0 -0
- package/templates/template_oa_jwt/public/src/components/Alert/index.less +0 -0
- package/templates/template_oa_jwt/public/src/components/Auth/index.jsx +44 -0
- package/templates/template_oa_jwt/public/src/components/Dialog/index.jsx +150 -0
- package/templates/template_oa_jwt/public/src/components/Dialog/index.less +123 -0
- package/templates/template_oa_jwt/public/src/components/Empty/index.jsx +23 -0
- package/templates/template_oa_jwt/public/src/components/Empty/index.less +6 -0
- package/templates/template_oa_jwt/public/src/components/Footer/index.jsx +17 -0
- package/templates/template_oa_jwt/public/src/components/Footer/index.less +28 -0
- package/templates/template_oa_jwt/public/src/components/FormRow/index.jsx +39 -0
- package/templates/template_oa_jwt/public/src/components/FormRow/index.less +67 -0
- package/templates/template_oa_jwt/public/src/components/FormTable/index.jsx +137 -0
- package/templates/template_oa_jwt/public/src/components/FormTable/index.less +18 -0
- package/templates/template_oa_jwt/public/src/components/IFrame/index.jsx +44 -0
- package/templates/template_oa_jwt/public/src/components/IFrame/index.less +4 -0
- package/templates/template_oa_jwt/public/src/components/IconFont/index.jsx +10 -0
- package/templates/template_oa_jwt/public/src/components/IconFont/index.less +5 -0
- package/templates/template_oa_jwt/public/src/components/Layout/Basic/index.jsx +52 -0
- package/templates/template_oa_jwt/public/src/components/Layout/Basic/index.less +82 -0
- package/templates/template_oa_jwt/public/src/components/Layout/CenterBody/index.jsx +15 -0
- package/templates/template_oa_jwt/public/src/components/Layout/CenterBody/index.less +36 -0
- package/templates/template_oa_jwt/public/src/components/Layout/FormBlock/index.jsx +23 -0
- package/templates/template_oa_jwt/public/src/components/Layout/FormBlock/index.less +37 -0
- package/templates/template_oa_jwt/public/src/components/Layout/Provider/index.jsx +12 -0
- package/templates/template_oa_jwt/public/src/components/Layout/index.jsx +27 -0
- package/templates/template_oa_jwt/public/src/components/Layout/index.less +8 -0
- package/templates/template_oa_jwt/public/src/components/Link/index.jsx +24 -0
- package/templates/template_oa_jwt/public/src/components/Link/index.less +11 -0
- package/templates/template_oa_jwt/public/src/components/Loading/index.jsx +16 -0
- package/templates/template_oa_jwt/public/src/components/Loading/index.less +96 -0
- package/templates/template_oa_jwt/public/src/components/Nav/index.jsx +184 -0
- package/templates/template_oa_jwt/public/src/components/Nav/index.less +38 -0
- package/templates/template_oa_jwt/public/src/components/Page/PageLoading/index.jsx +30 -0
- package/templates/template_oa_jwt/public/src/components/Page/PageLoading/index.less +29 -0
- package/templates/template_oa_jwt/public/src/components/Popup/index.jsx +22 -0
- package/templates/template_oa_jwt/public/src/components/Popup/index.less +18 -0
- package/templates/template_oa_jwt/public/src/components/Select/DepSelect/index.jsx +47 -0
- package/templates/template_oa_jwt/public/src/components/Select/StaffSelect/index.jsx +97 -0
- package/templates/template_oa_jwt/public/src/components/Select/StaffSelect/index.less +24 -0
- package/templates/template_oa_jwt/public/src/components/Toast/index.jsx +60 -0
- package/templates/template_oa_jwt/public/src/components/Toast/index.less +43 -0
- package/templates/template_oa_jwt/public/src/components/Upload/index.jsx +358 -0
- package/templates/template_oa_jwt/public/src/components/title/index.jsx +12 -0
- package/templates/template_oa_jwt/public/src/components/title/index.less +21 -0
- package/templates/template_oa_jwt/public/src/dictionary/index.js +20 -0
- package/templates/template_oa_jwt/public/src/hooks/index.jsx +21 -0
- package/templates/template_oa_jwt/public/src/hooks/useDelay.jsx +29 -0
- package/templates/template_oa_jwt/public/src/hooks/useImageLoader.jsx +27 -0
- package/templates/template_oa_jwt/public/src/hooks/useLoading.jsx +42 -0
- package/templates/template_oa_jwt/public/src/hooks/useLogin.jsx +33 -0
- package/templates/template_oa_jwt/public/src/hooks/usePreload.jsx +66 -0
- package/templates/template_oa_jwt/public/src/hooks/useScrollTop.jsx +32 -0
- package/templates/template_oa_jwt/public/src/hooks/useSearch.jsx +137 -0
- package/templates/template_oa_jwt/public/src/hooks/useUpdate.jsx +11 -0
- package/templates/template_oa_jwt/public/src/index.jsx +50 -0
- package/templates/template_oa_jwt/public/src/mock/common.js +484 -0
- package/templates/template_oa_jwt/public/src/mock/index.js +63 -0
- package/templates/template_oa_jwt/public/src/mock/user.js +70 -0
- package/templates/template_oa_jwt/public/src/mock/utils.js +33 -0
- package/templates/template_oa_jwt/public/src/pages/components/pageTitle/index.jsx +13 -0
- package/templates/template_oa_jwt/public/src/pages/components/pageTitle/index.less +20 -0
- package/templates/template_oa_jwt/public/src/pages/components/totalRecord/index.jsx +21 -0
- package/templates/template_oa_jwt/public/src/pages/components/totalRecord/index.less +16 -0
- package/templates/template_oa_jwt/public/src/pages/demo/detail/index.jsx +14 -0
- package/templates/template_oa_jwt/public/src/pages/demo/index.jsx +399 -0
- package/templates/template_oa_jwt/public/src/pages/demo/index.less +15 -0
- package/templates/template_oa_jwt/public/src/pages/login/index.jsx +29 -0
- package/templates/template_oa_jwt/public/src/pages/login/index.less +44 -0
- package/templates/template_oa_jwt/public/src/pages/redirect/index.jsx +31 -0
- package/templates/template_oa_jwt/public/src/provider/app.jsx +66 -0
- package/templates/template_oa_jwt/public/src/route.jsx +45 -0
- package/templates/template_oa_jwt/public/src/services/common.js +133 -0
- package/templates/template_oa_jwt/public/src/services/demo.js +41 -0
- package/templates/template_oa_jwt/public/src/services/index.js +266 -0
- package/templates/template_oa_jwt/public/src/services/token.js +132 -0
- package/templates/template_oa_jwt/public/src/utils/index.js +115 -0
- package/templates/template_oa_jwt/public/static/about.html +1 -0
- package/templates/template_oa_jwt/public/static/kssoLogin.html +22 -0
- package/templates/template_oa_jwt/public/static/noAuth.html +217 -0
- package/templates/template_oa_jwt/public/static/noAuth.png +0 -0
- package/templates/template_oa_jwt/readme.md +71 -0
- package/templates/template_oa_jwt/report.sh +68 -0
- package/templates/template_oa_jwt/tools/iconfont/gulpfile.js +70 -0
- package/templates/template_oa_jwt/tools/iconfont/package.json +20 -0
- package/templates/template_oa_jwt/tools/iconfont/run.sh +39 -0
- package/templates/template_oa_jwt/tools/iconfont/svg/arrowBack.svg +1 -0
- package/templates/template_oa_jwt/tools/iconfont/svg/check.svg +1 -0
- package/templates/template_oa_jwt/tools/iconfont/svg/close.svg +1 -0
- package/templates/template_oa_jwt/tools/iconfont/svg/down.svg +1 -0
- package/templates/template_oa_jwt/tools/iconfont/svg/image.svg +1 -0
- package/templates/template_oa_jwt/tools/iconfont/svg/play.svg +1 -0
- package/templates/template_oa_jwt/tools/iconfont/svg/refresh.svg +1 -0
- package/templates/template_oa_jwt/tools/iconfont/svg/warn.svg +1 -0
- package/templates/template_oa_jwt/tools/iconfont/templates/_icons.css +26 -0
- package/templates/template_oa_jwt/tools/iconfont/templates/_icons.less +29 -0
- package/templates/template_oa_jwt/tools/iconfont/templates/index.html +56 -0
- package/templates/template_oa_jwt/tools/tinypng/package.json +11 -0
- package/templates/template_oa_jwt/tools/tinypng/run.sh +15 -0
- package/templates/template_oa_jwt/versionPublish.sh +27 -0
- package/templates/template_oa_jwt/webpack.api.js +61 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
.body {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
min-height: 400px;
|
|
5
|
+
position: fixed;
|
|
6
|
+
z-index: 999;
|
|
7
|
+
left: 0;
|
|
8
|
+
top: 0;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
.mask {
|
|
16
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
position: fixed;
|
|
20
|
+
left: 0;
|
|
21
|
+
top: 0;
|
|
22
|
+
}
|
|
23
|
+
.wrap {
|
|
24
|
+
position: relative;
|
|
25
|
+
min-width: 385px;
|
|
26
|
+
min-height: 2px;
|
|
27
|
+
background-color: white;
|
|
28
|
+
border-radius: 5px;
|
|
29
|
+
box-shadow: 0 1px 3px rgba(34, 25, 25, 0.4);
|
|
30
|
+
}
|
|
31
|
+
.close {
|
|
32
|
+
color: white;
|
|
33
|
+
font-size: 12px;
|
|
34
|
+
font-weight: bold;
|
|
35
|
+
&:hover {
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
.header {
|
|
40
|
+
display: flex;
|
|
41
|
+
justify-content: space-between;
|
|
42
|
+
align-items: center;
|
|
43
|
+
padding: 0 20px;
|
|
44
|
+
span {
|
|
45
|
+
font-size: 14px;
|
|
46
|
+
color: white;
|
|
47
|
+
font-weight: 700;
|
|
48
|
+
}
|
|
49
|
+
background-color: #3e9cfc;
|
|
50
|
+
height: 45px;
|
|
51
|
+
padding: 0 20px;
|
|
52
|
+
border-radius: 5px 5px 0 0;
|
|
53
|
+
border-bottom: 1px solid #e5e5e5;
|
|
54
|
+
}
|
|
55
|
+
.footer {
|
|
56
|
+
display: flex;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
height: 62px;
|
|
59
|
+
width: 100%;
|
|
60
|
+
background-color: #f6f6f6;
|
|
61
|
+
border-radius: 0 0 5px 5px;
|
|
62
|
+
border-top: 1px solid #dcdcdc;
|
|
63
|
+
padding-top: 13px;
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.iconError {
|
|
68
|
+
background: url('~@/assets/images/NY-pop-bg.png') -63px -44px no-repeat;
|
|
69
|
+
width: 46px;
|
|
70
|
+
height: 46px;
|
|
71
|
+
margin-bottom: 18px;
|
|
72
|
+
}
|
|
73
|
+
.iconSuccess {
|
|
74
|
+
background: url('~@/assets/images/NY-pop-bg.png') -5px -97px no-repeat;
|
|
75
|
+
width: 46px;
|
|
76
|
+
height: 46px;
|
|
77
|
+
margin-bottom: 18px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.wrapAlert {
|
|
81
|
+
position: relative;
|
|
82
|
+
min-width: 308px;
|
|
83
|
+
background-color: #f8f8f8;
|
|
84
|
+
border-radius: 5px;
|
|
85
|
+
box-shadow: 0 1px 3px rgba(34, 25, 25, 0.4);
|
|
86
|
+
}
|
|
87
|
+
.alertContent {
|
|
88
|
+
padding: 20px;
|
|
89
|
+
width: 100%;
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
align-items: center;
|
|
93
|
+
span {
|
|
94
|
+
color: #666;
|
|
95
|
+
font-size: 18px;
|
|
96
|
+
font-weight: 400;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.alertFooter {
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
height: 44px;
|
|
105
|
+
width: 100%;
|
|
106
|
+
background-color: #fff;
|
|
107
|
+
border-radius: 0 0 5px 5px;
|
|
108
|
+
// border-top:1px solid #dcdcdc;
|
|
109
|
+
// padding-top:.13rem;
|
|
110
|
+
span {
|
|
111
|
+
color: #5fc0f9;
|
|
112
|
+
font-weight: 400;
|
|
113
|
+
font-size: 18px;
|
|
114
|
+
cursor: pointer;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.confirmWrap{
|
|
119
|
+
display: flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
justify-content: center;
|
|
122
|
+
padding:30px;
|
|
123
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Empty, Button } from 'antd';
|
|
3
|
+
import styles from './index.less';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 当table数据为空时下方有“添加数据”按钮
|
|
7
|
+
*/
|
|
8
|
+
function TableEmpty(props) {
|
|
9
|
+
return (
|
|
10
|
+
<section className={styles.tableEmpty}>
|
|
11
|
+
<Empty />
|
|
12
|
+
{props.editmode ? (
|
|
13
|
+
<Button style={{ marginTop: '.1rem' }} onClick={props.onClick} type='primary'>
|
|
14
|
+
添加数据
|
|
15
|
+
</Button>
|
|
16
|
+
) : (
|
|
17
|
+
''
|
|
18
|
+
)}
|
|
19
|
+
</section>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default TableEmpty;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styles from './index.less';
|
|
3
|
+
|
|
4
|
+
const Footer = (props) => {
|
|
5
|
+
return (
|
|
6
|
+
<section className={styles.footer}>
|
|
7
|
+
<hgroup>
|
|
8
|
+
<p>Copyright@2017 版权所有 kingnet.com,All Rights Reserved 沪ICP备10215773号-1</p>
|
|
9
|
+
<p>本系统现仅支持Chrome和Safari浏览器,其他浏览器可能会出现兼容性问题。</p>
|
|
10
|
+
<a href='http://oa.test.com/versionlog/view' target='_blank' style={{ marginTop: '10px' }}>
|
|
11
|
+
版本日志
|
|
12
|
+
</a>
|
|
13
|
+
</hgroup>
|
|
14
|
+
</section>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
export default Footer;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@import '~@/_variable.less';
|
|
2
|
+
|
|
3
|
+
.footer {
|
|
4
|
+
position: absolute;
|
|
5
|
+
bottom: 0;
|
|
6
|
+
|
|
7
|
+
box-shadow: 0px -2px 3px #dde3e7;
|
|
8
|
+
min-height: var(--height-footer);
|
|
9
|
+
width: 100%;
|
|
10
|
+
background-color: white;
|
|
11
|
+
hgroup {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
width: 100%;
|
|
17
|
+
min-height: var(--height-footer);
|
|
18
|
+
}
|
|
19
|
+
p {
|
|
20
|
+
color: #9bb5c9;
|
|
21
|
+
font-size: 12px;
|
|
22
|
+
margin-bottom: 0;
|
|
23
|
+
}
|
|
24
|
+
a {
|
|
25
|
+
color: rgb(119, 119, 119);
|
|
26
|
+
font-size: 14px;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import styles from './index.less';
|
|
3
|
+
|
|
4
|
+
const FormRow = (props) => {
|
|
5
|
+
function createCol(item, idx) {
|
|
6
|
+
if (!item) return '';
|
|
7
|
+
const editmode = item.props.editmode === undefined ? true : item.props.editmode;
|
|
8
|
+
return (
|
|
9
|
+
<div key={idx} className={styles.formRow}>
|
|
10
|
+
<hgroup className={styles.row}>
|
|
11
|
+
<div className={styles.title}>
|
|
12
|
+
<div required={editmode && item.props.required}>{item.props.label}</div>
|
|
13
|
+
</div>
|
|
14
|
+
<div className={styles.data}>{item}</div>
|
|
15
|
+
</hgroup>
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
return (
|
|
20
|
+
<section className={styles.formRowBody}>
|
|
21
|
+
{props.children.length > 0 ? props.children.map(createCol) : createCol(props.children)}
|
|
22
|
+
</section>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
function HocEditControl(props) {
|
|
27
|
+
const { editmode = true, txtdata ,textarea} = props;
|
|
28
|
+
if (editmode) {
|
|
29
|
+
return props.children;
|
|
30
|
+
}
|
|
31
|
+
if(textarea){
|
|
32
|
+
return <span style={{whiteSpace:'pre-wrap'}}>{txtdata||'-'}</span>
|
|
33
|
+
}
|
|
34
|
+
return <span>{txtdata || '-'}</span>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
FormRow.Col = HocEditControl;
|
|
38
|
+
|
|
39
|
+
export default FormRow;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// @import '@/_reset.scss';
|
|
2
|
+
|
|
3
|
+
.formRow {
|
|
4
|
+
border: 1px solid #eaeaea;
|
|
5
|
+
& > hgroup {
|
|
6
|
+
max-width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
}
|
|
9
|
+
//防止超长不换行
|
|
10
|
+
.ant-checkbox-group,
|
|
11
|
+
.ant-radio-group {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-wrap: wrap;
|
|
14
|
+
}
|
|
15
|
+
.row{
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.formRowBody{
|
|
22
|
+
display: flex;
|
|
23
|
+
}
|
|
24
|
+
.formRowBody:not(:first-child) {
|
|
25
|
+
.formRow {
|
|
26
|
+
border-top: 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
.formRow:not(:first-child) {
|
|
30
|
+
width: 50%;
|
|
31
|
+
border-left: 0;
|
|
32
|
+
& > hgroup {
|
|
33
|
+
width: 2000px;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
.formRow:first-child {
|
|
37
|
+
flex-grow:1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.title {
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
|
|
44
|
+
background-color: #f8f8f8;
|
|
45
|
+
color: #666;
|
|
46
|
+
padding: 7px 30px;
|
|
47
|
+
height: 100%;
|
|
48
|
+
font-size: 14px;
|
|
49
|
+
& > div {
|
|
50
|
+
position: relative;
|
|
51
|
+
font-size: inherit;
|
|
52
|
+
width: 130px;
|
|
53
|
+
font-weight: 400;
|
|
54
|
+
&[required]:before {
|
|
55
|
+
font-size: 12px;
|
|
56
|
+
content: '*';
|
|
57
|
+
color: #f04134;
|
|
58
|
+
position: absolute;
|
|
59
|
+
left: -10px;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
.data {
|
|
64
|
+
padding: 3px 9px;
|
|
65
|
+
flex:1;
|
|
66
|
+
flex-wrap: wrap;
|
|
67
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import React ,{useImperativeHandle,useState,forwardRef} from 'react';
|
|
2
|
+
import uuid from 'js-uuid';
|
|
3
|
+
import styles from './index.less';
|
|
4
|
+
|
|
5
|
+
const TableFormItem =(props,ref)=> {
|
|
6
|
+
const {Table,form,formItemName,saveLast} = props;
|
|
7
|
+
const getNewId=()=>{
|
|
8
|
+
let ret = uuid.v4();
|
|
9
|
+
return ret;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const getInitalValue=(initialValue)=>{
|
|
13
|
+
let tempInitValue=[];
|
|
14
|
+
if(initialValue){
|
|
15
|
+
tempInitValue=initialValue.map((item,idx)=>{
|
|
16
|
+
item._rowKey=getNewId();
|
|
17
|
+
return item;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return tempInitValue
|
|
21
|
+
}
|
|
22
|
+
const [value,setValue] = useState(()=>(getInitalValue(props.initialValue)));
|
|
23
|
+
|
|
24
|
+
const onChange = (value) => {
|
|
25
|
+
if (props.onChange) {
|
|
26
|
+
props.onChange(value);
|
|
27
|
+
}
|
|
28
|
+
if (props.onRefresh) {
|
|
29
|
+
props.onRefresh(value);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
const onCopy=async (record, index, event)=> {
|
|
35
|
+
if (event) event.preventDefault();
|
|
36
|
+
const { getFieldValue } = form;
|
|
37
|
+
const formData = (getFieldValue(formItemName) || []);
|
|
38
|
+
|
|
39
|
+
let newdata = null;
|
|
40
|
+
if(props.onCopy){
|
|
41
|
+
newdata = props.onCopy(record,index);
|
|
42
|
+
if(!newdata)return;
|
|
43
|
+
}else{
|
|
44
|
+
newdata = { ...props.newdata };
|
|
45
|
+
}
|
|
46
|
+
newdata = {...formData[index]};
|
|
47
|
+
newdata._rowKey=getNewId();
|
|
48
|
+
|
|
49
|
+
let newFormData = onInsert(newdata,index);
|
|
50
|
+
onChange(newFormData);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
const onDel = (record,index,event) => {
|
|
55
|
+
if (event) event.preventDefault();
|
|
56
|
+
const { getFieldValue, setFieldsValue } = form;
|
|
57
|
+
|
|
58
|
+
const formData = [...(getFieldValue(formItemName) || [])];
|
|
59
|
+
let isLast = formData.length === 1;
|
|
60
|
+
formData.splice(index,1);
|
|
61
|
+
setValue([]);
|
|
62
|
+
setFieldsValue({[formItemName]:[]});
|
|
63
|
+
|
|
64
|
+
setValue(formData);
|
|
65
|
+
setFieldsValue({[formItemName]:formData});
|
|
66
|
+
|
|
67
|
+
if (saveLast && isLast) {
|
|
68
|
+
onAdd(record, index, event)
|
|
69
|
+
} else {
|
|
70
|
+
onChange(formData);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const onReset=(initValue,event)=>{
|
|
75
|
+
if (event) event.preventDefault();
|
|
76
|
+
const {setFieldsValue } = form;
|
|
77
|
+
const {initialValue} = props;
|
|
78
|
+
|
|
79
|
+
initValue = initValue||initialValue;
|
|
80
|
+
initValue = getInitalValue(initValue);
|
|
81
|
+
|
|
82
|
+
setValue([]);
|
|
83
|
+
setFieldsValue({[formItemName]:[]})
|
|
84
|
+
setValue(initValue);
|
|
85
|
+
setFieldsValue({[formItemName]:[...initValue]});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const onInsert= (newdata,index)=>{
|
|
89
|
+
const { getFieldValue, setFieldsValue } = form;
|
|
90
|
+
const oldData = (getFieldValue(formItemName) || []);
|
|
91
|
+
let formData = [...oldData];
|
|
92
|
+
if(index>=0){
|
|
93
|
+
formData.splice(index+1,0,newdata);
|
|
94
|
+
}else{
|
|
95
|
+
formData.push(newdata);
|
|
96
|
+
}
|
|
97
|
+
setValue([]);
|
|
98
|
+
setFieldsValue({[formItemName]:[]})
|
|
99
|
+
setValue(formData);
|
|
100
|
+
setFieldsValue({[formItemName]:formData})
|
|
101
|
+
return formData;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const onAdd = (record, index , event) => {
|
|
105
|
+
if (event) event.preventDefault();
|
|
106
|
+
|
|
107
|
+
let newdata=null;
|
|
108
|
+
if(props.onAdd){
|
|
109
|
+
newdata = props.onAdd(record,index);
|
|
110
|
+
if(!newdata)return;
|
|
111
|
+
}else{
|
|
112
|
+
newdata = { ...props.newdata };
|
|
113
|
+
}
|
|
114
|
+
newdata._rowKey = getNewId();
|
|
115
|
+
let formData = onInsert(newdata,index);
|
|
116
|
+
onChange(formData);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
useImperativeHandle(ref, () => ({
|
|
120
|
+
onReset,
|
|
121
|
+
}));
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
|
|
125
|
+
<Table
|
|
126
|
+
className={styles.table}
|
|
127
|
+
{...{rowKey: '_rowKey',...props.antTableOptions}}
|
|
128
|
+
dataSource={value}
|
|
129
|
+
columns={props.columns({formItemName,onDel, onAdd,onReset,onCopy})}
|
|
130
|
+
/>
|
|
131
|
+
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
export default forwardRef(TableFormItem);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.table {
|
|
2
|
+
tr {
|
|
3
|
+
th, th>div {
|
|
4
|
+
text-align: center;
|
|
5
|
+
&[required]:before {
|
|
6
|
+
font-size: 0.12rem;
|
|
7
|
+
content: '*';
|
|
8
|
+
color: #f04134;
|
|
9
|
+
margin-right: 10px;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
:global {
|
|
14
|
+
.ant-form-item-explain-error {
|
|
15
|
+
text-align: left;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React, { useEffect,useState,useRef } from 'react';
|
|
2
|
+
import { setRefreshToken } from '@/services/token'
|
|
3
|
+
import { setJwt } from '@/services';
|
|
4
|
+
import styles from './index.less';
|
|
5
|
+
|
|
6
|
+
const Iframe=(props)=>{
|
|
7
|
+
const {className=''}=props;
|
|
8
|
+
const ref = useRef();
|
|
9
|
+
const [height,setHeight] = useState('0px');
|
|
10
|
+
|
|
11
|
+
useEffect(()=>{
|
|
12
|
+
window.addEventListener('message',(e)=>{
|
|
13
|
+
if(e?.data?.msg==='resize'){
|
|
14
|
+
if(e.data.id===props.name){
|
|
15
|
+
setHeight(e.data.height+2+'px');
|
|
16
|
+
}
|
|
17
|
+
}else if(e?.data?.msg==='link'){
|
|
18
|
+
location.href=e.data.url;
|
|
19
|
+
}else if(e?.data?.msg==='server'){
|
|
20
|
+
setRefreshToken('');
|
|
21
|
+
setJwt('');
|
|
22
|
+
const url = `${OA_KSSO_HOST}?target=${encodeURIComponent(location.href)}`;
|
|
23
|
+
location.href=url;
|
|
24
|
+
}else{
|
|
25
|
+
// console.log(e?.data);
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
},[])
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<iframe
|
|
32
|
+
className={`${styles.iframeWrap} ${className}`}
|
|
33
|
+
sandbox='allow-same-origin allow-scripts'
|
|
34
|
+
name={props.name}
|
|
35
|
+
ref={ref}
|
|
36
|
+
src={props.url}
|
|
37
|
+
style={{width:'100%',height:height,verticalAlign:'bottom'}}
|
|
38
|
+
scrolling="none"
|
|
39
|
+
frameBorder="0"
|
|
40
|
+
/>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default React.memo(Iframe);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import styles from'./index.less';
|
|
3
|
+
|
|
4
|
+
const IconFont=(props)=>{
|
|
5
|
+
const {icon,className,...others} = props;
|
|
6
|
+
return (
|
|
7
|
+
<span {...others} className={`iconfont icon-${icon} ${styles.iconBox} ${className||''}`} ></span>
|
|
8
|
+
)
|
|
9
|
+
}
|
|
10
|
+
export default IconFont;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { Outlet } from 'react-router-dom';
|
|
3
|
+
import Iframe from '@/components/IFrame';
|
|
4
|
+
import PageLoading from '@/components/Page/PageLoading';
|
|
5
|
+
import ProviderApp from '@/provider/app';
|
|
6
|
+
import { toHref, isNoAuth } from '@/utils';
|
|
7
|
+
import styles from './index.less';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const LayoutBasic = (props) => {
|
|
11
|
+
const providerApp = ProviderApp.useContainer();
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
const onClick = () => {
|
|
15
|
+
toHref('/#/cases');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const { nav = "" } = props;
|
|
19
|
+
return (
|
|
20
|
+
<section className={styles.htmlWrap}>
|
|
21
|
+
{
|
|
22
|
+
window?.knFeishu?.IS_FEISHU()
|
|
23
|
+
? null
|
|
24
|
+
: <>
|
|
25
|
+
|
|
26
|
+
<Iframe name='header' url={OA_MENU_HOST} className={styles.iframeHeader} />
|
|
27
|
+
<section className={styles.headerSpace}></section>
|
|
28
|
+
</>
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
<section className={styles.bodyWrap}>
|
|
32
|
+
<section className={styles.centerWrap}>
|
|
33
|
+
<div className={styles.crumbs}>
|
|
34
|
+
<b>当前位置:</b>
|
|
35
|
+
<span>部门</span>
|
|
36
|
+
<span style={{ margin: '0 4px' }}>{'>'}</span>
|
|
37
|
+
<a onClick={onClick}>{document.title}</a>
|
|
38
|
+
</div>
|
|
39
|
+
<section className={styles.content}>
|
|
40
|
+
{nav}
|
|
41
|
+
<section className={styles.body}>
|
|
42
|
+
<Outlet />
|
|
43
|
+
</section>
|
|
44
|
+
</section>
|
|
45
|
+
</section>
|
|
46
|
+
</section>
|
|
47
|
+
|
|
48
|
+
</section>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export default LayoutBasic;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
@import '~@/_variable.less';
|
|
2
|
+
|
|
3
|
+
.htmlWrap{
|
|
4
|
+
width:100%;
|
|
5
|
+
height:100%;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
display: block;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
}
|
|
11
|
+
.bodyWrap{
|
|
12
|
+
flex:1;
|
|
13
|
+
width: 100%;
|
|
14
|
+
overflow: auto;
|
|
15
|
+
overflow: scroll;
|
|
16
|
+
-webkit-overflow-scrolling: touch;
|
|
17
|
+
}
|
|
18
|
+
.centerWrap {
|
|
19
|
+
min-width: 1200px;
|
|
20
|
+
max-width: 1600px;
|
|
21
|
+
position: relative;
|
|
22
|
+
margin: 0 auto;
|
|
23
|
+
padding: 0 20px;
|
|
24
|
+
z-index:0;
|
|
25
|
+
// padding-bottom: var(--height-footer);
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.iframeHeader{
|
|
30
|
+
min-width: 100%;
|
|
31
|
+
width: 1200px;
|
|
32
|
+
height: var(--height-header);
|
|
33
|
+
min-height: var(--height-header);
|
|
34
|
+
position: fixed;
|
|
35
|
+
left:0;
|
|
36
|
+
top:0;
|
|
37
|
+
z-index: 2;
|
|
38
|
+
font-size: 60px;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
}
|
|
41
|
+
.headerSpace{
|
|
42
|
+
width: 100%;
|
|
43
|
+
height: var(--height-header);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.crumbs{
|
|
47
|
+
height: 36px;
|
|
48
|
+
width: 100%;
|
|
49
|
+
max-width: 1600px;
|
|
50
|
+
font-size: 14px;
|
|
51
|
+
color: #666;
|
|
52
|
+
margin-bottom: 2px;
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
p,
|
|
56
|
+
span {
|
|
57
|
+
font-size: inherit;
|
|
58
|
+
color: inherit;
|
|
59
|
+
}
|
|
60
|
+
span {
|
|
61
|
+
color: rgba(0, 0, 0, 0.65);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.content{
|
|
66
|
+
display: flex;
|
|
67
|
+
box-shadow: 0 0 5px 0 rgba(0,0,0,.15);
|
|
68
|
+
.body {
|
|
69
|
+
overflow: auto;
|
|
70
|
+
flex:1;
|
|
71
|
+
height:100%;
|
|
72
|
+
position: relative;
|
|
73
|
+
&::-webkit-scrollbar {
|
|
74
|
+
display: none;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import styles from './index.less';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const LayoutCenterBody=(props)=>{
|
|
7
|
+
const {className,layout='normal'} = props;
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<section data-layout={layout} className={ className?`${styles.contentBody} ${className}`:styles.contentBody }>
|
|
11
|
+
{props.children}
|
|
12
|
+
</section>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
15
|
+
export default LayoutCenterBody;
|