kn-cli 1.0.60 → 1.0.62

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 (64) hide show
  1. package/build/build.sh +1 -1
  2. package/build/dev.sh +1 -1
  3. package/package.json +1 -1
  4. package/readme.md +9 -0
  5. package/src/build.js +28 -9
  6. package/templates/template_admin/build.sh +7 -1
  7. package/templates/template_admin/readme.md +8 -0
  8. package/templates/template_app/build.sh +7 -1
  9. package/templates/template_app/readme.md +8 -0
  10. package/templates/template_oa/build.sh +7 -1
  11. package/templates/template_oa/frontend_build.sh +1 -2
  12. package/templates/template_oa/package.json +2 -1
  13. package/templates/template_oa/public/favicon.ico +0 -0
  14. package/templates/template_oa/public/index.html +1 -1
  15. package/templates/template_oa/public/src/_antd.less +0 -21
  16. package/templates/template_oa/public/src/_reset.less +3 -0
  17. package/templates/template_oa/public/src/_variable.less +1 -1
  18. package/templates/template_oa/public/src/assets/images/NY-pop-bg.png +0 -0
  19. package/templates/template_oa/public/src/components/Auth/index.jsx +1 -1
  20. package/templates/template_oa/public/src/components/Dialog/index.jsx +150 -0
  21. package/templates/template_oa/public/src/components/Dialog/index.less +123 -0
  22. package/templates/template_oa/public/src/components/Empty/index.jsx +23 -0
  23. package/templates/template_oa/public/src/components/Empty/index.less +6 -0
  24. package/templates/template_oa/public/src/components/FormRow/index.jsx +39 -0
  25. package/templates/template_oa/public/src/components/FormRow/index.less +67 -0
  26. package/templates/template_oa/public/src/components/FormTable/index.jsx +136 -0
  27. package/templates/template_oa/public/src/components/IFrame/index.less +1 -1
  28. package/templates/template_oa/public/src/components/Layout/Basic/index.jsx +18 -12
  29. package/templates/template_oa/public/src/components/Layout/Basic/index.less +21 -11
  30. package/templates/template_oa/public/src/components/Layout/index.jsx +2 -1
  31. package/templates/template_oa/public/src/components/Nav/index.jsx +163 -100
  32. package/templates/template_oa/public/src/components/Select/DepSelect/index.jsx +47 -0
  33. package/templates/template_oa/public/src/components/Select/StaffSelect/index.jsx +97 -0
  34. package/templates/template_oa/public/src/components/Select/StaffSelect/index.less +24 -0
  35. package/templates/template_oa/public/src/components/Toast/index.less +1 -1
  36. package/templates/template_oa/public/src/components/Upload/index.jsx +358 -0
  37. package/templates/template_oa/public/src/components/title/index.jsx +12 -0
  38. package/templates/template_oa/public/src/components/title/index.less +21 -0
  39. package/templates/template_oa/public/src/mock/cases.js +52 -0
  40. package/templates/template_oa/public/src/mock/index.js +2 -0
  41. package/templates/template_oa/public/src/pages/components/totalRecord/index.jsx +21 -0
  42. package/templates/template_oa/public/src/pages/components/totalRecord/index.less +16 -0
  43. package/templates/template_oa/public/src/pages/login/index.jsx +7 -9
  44. package/templates/template_oa/public/src/pages/my/index.jsx +14 -0
  45. package/templates/template_oa/public/src/pages/video/detail/index.jsx +14 -0
  46. package/templates/template_oa/public/src/pages/video/index.jsx +325 -23
  47. package/templates/template_oa/public/src/pages/video/index.less +3 -0
  48. package/templates/template_oa/public/src/provider/app.jsx +14 -81
  49. package/templates/template_oa/public/src/route.jsx +8 -2
  50. package/templates/template_oa/public/src/services/cases.js +7 -0
  51. package/templates/template_oa/public/src/services/common.js +132 -0
  52. package/templates/template_oa/public/src/services/index.js +42 -8
  53. package/templates/template_oa/public/src/services/video.js +1 -0
  54. package/templates/template_oa/public/src/utils/index.js +61 -1
  55. package/templates/template_oa/readme.md +8 -0
  56. package/templates/template_oa/webpack.api.js +10 -22
  57. package/templates/template_offcial/build.sh +7 -1
  58. package/templates/template_offcial/readme.md +8 -0
  59. package/templates/template_oa/public/favicon.png +0 -0
  60. package/templates/template_oa/public/src/components/mask/index.jsx +0 -47
  61. package/templates/template_oa/public/src/components/mask/index.less +0 -32
  62. package/templates/template_oa/public/src/dictionary/index.js +0 -39
  63. package/templates/template_oa/public/src/provider/menu.jsx +0 -20
  64. package/templates/template_oa/public/src/services/user.js +0 -26
package/build/build.sh CHANGED
@@ -11,4 +11,4 @@ then
11
11
  fi
12
12
  export mock=0
13
13
  export build_type=build
14
- sh start.sh
14
+ sh ./start.sh
package/build/dev.sh CHANGED
@@ -1,3 +1,3 @@
1
1
  export build_type=dev
2
2
  # 如果 export dev_mode=watch 则启动webpack -w模式而非webpack-dev-server
3
- sh start.sh
3
+ sh ./start.sh
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kn-cli",
3
- "version": "1.0.60",
3
+ "version": "1.0.62",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -13,6 +13,12 @@
13
13
 
14
14
  > 项目创建后,记得执行sh init.sh 以激活git分支提交日志
15
15
 
16
+ # Windows环境
17
+ 推荐windows下使用gitbash终端
18
+ 在使用`kn-cli --create`时,请改为接住winpty来执行,如`winpty kn-cli.cmd --create`
19
+ 这是由于minTTY使用的gitbash无法处理我们创建项目时选择列表的问题,导致用户无法用上下来选择项目
20
+
21
+
16
22
  # cli 其它常用方法
17
23
  1. 查看版本号: `kn-cli -v`
18
24
 
@@ -74,6 +80,9 @@ module.exports = {
74
80
  ```
75
81
 
76
82
  # 更新日志
83
+ * 1.0.61
84
+ 兼容windows下终端的编译
85
+
77
86
  * 1.0.57
78
87
  增加cli.config.js内devServer配置
79
88
 
package/src/build.js CHANGED
@@ -9,7 +9,15 @@ const {copyDir,TaskNodeVersion,replaceFileData,cleanDir}= require( './utils');
9
9
  const inquirer = require('inquirer');
10
10
  const ROOT=path.resolve(__dirname,"../");
11
11
 
12
-
12
+ const IS_WINDOWS=()=>{
13
+ return process.platform === 'win32';
14
+ }
15
+ const TransformWindowsPath=(path)=>{
16
+ if (IS_WINDOWS()) {
17
+ path = path.replace(/\\/ig,'\\\\');
18
+ }
19
+ return path;
20
+ }
13
21
 
14
22
  /**
15
23
  * 项目编译流程
@@ -241,12 +249,12 @@ module.exports= async (options={})=> {
241
249
  task.output = '项目目录:'+sourceFolder;
242
250
  try{
243
251
  await replaceFileData(tempWebpackConfigPath,function(data){
244
- data = data.replace(/__dirname/ig,`"${sourceFolder}"`);
245
- data = data.replace(/__webpackPath/ig,`"${tempWebpackDir}"`);
252
+ data = data.replace(/__dirname/ig,`"${TransformWindowsPath(sourceFolder)}"`);
253
+ data = data.replace(/__webpackPath/ig,`"${TransformWindowsPath(tempWebpackDir)}"`);
246
254
  return data;
247
255
  });
248
256
  await replaceFileData(tempStartShell,function(data){
249
- data = data.replace(/__dirname/ig,`${sourceFolder}`);
257
+ data = data.replace(/__dirname/ig,`${TransformWindowsPath(sourceFolder)}`);
250
258
  return data;
251
259
  })
252
260
  resolve();
@@ -265,11 +273,15 @@ module.exports= async (options={})=> {
265
273
  title:"执行build",
266
274
  task:(ctx,task)=>{
267
275
  return new Promise(resolve=>{
268
- let cmd='sh build.sh';
269
276
  shelljs.cd(tempWebpackDir);
270
277
  let cmdParams = [];
278
+ const shellFile={
279
+ dev:'sh ./dev.sh',
280
+ report:'sh ./report.sh',
281
+ build:'sh ./build.sh'
282
+ }
283
+ let cmd=shellFile[type]||shellFile.build;
271
284
  if(type=='dev'){
272
- cmd='sh dev.sh';
273
285
  let build_env='';
274
286
  let mock='';
275
287
  let noSkipNpmInstall='';
@@ -295,15 +307,22 @@ module.exports= async (options={})=> {
295
307
  if(noSkipNpmInstall){
296
308
  cmdParams.push(`noSkipNpmInstall=${noSkipNpmInstall}`)
297
309
  }
298
- }else if( type =='report'){
299
- cmd='sh report.sh';
300
310
  }
311
+
301
312
  if(cliConfig?.registryType){
302
313
  cmdParams.push(`registryType=${cliConfig.registryType}`)
303
314
  }
315
+
316
+ shelljs.exec(`echo echo "run env.sh">env.sh`);
317
+ if (IS_WINDOWS()) {
318
+ shelljs.exec(`echo echo "set windows config">>env.sh`);
319
+ shelljs.exec(`echo alias sh='source'>>env.sh`);
320
+ }
304
321
  if(cmdParams.length>0){
305
- cmd = `export ${cmdParams.join(' ')}\n ${cmd}`;
322
+ shelljs.exec(`echo export ${cmdParams.join(' ')}>>env.sh`);
306
323
  }
324
+ shelljs.exec(`echo ${cmd}>>env.sh`);
325
+ cmd='sh ./env.sh'
307
326
  task.title=`执行:${cmd}`;
308
327
  let req = shelljs.exec(cmd)
309
328
  if(req.code==0){
@@ -1,2 +1,8 @@
1
+ if [[ "$OSTYPE" =~ ^cygwin|msys$ ]]
2
+ then
3
+ echo 'windows alias sh=source'
4
+ alias sh='source'
5
+ fi
6
+
1
7
  export build_env=dev
2
- sh frontend_build.sh
8
+ sh ./frontend_build.sh
@@ -21,6 +21,14 @@ kn-cli --dev
21
21
  构建方式:执行仓库下 sh frontend_build.sh
22
22
  部署方式:将构建完成的文件夹下的 `release` 内的内容部署到目标服务器
23
23
  参考应用:oa-app
24
+ 其它要求:nginx添加对index.html的缓存策略,配置如下:
25
+ expires 0;
26
+ add_header Cache-Control "max-age=0";
27
+ add_header Cache-Control "private";
28
+ add_header Cache-Control "no-store";
29
+ add_header Cache-Control "no-cache";
30
+ add_header Cache-Control "must-revalidate";
31
+ add_header Cache-Control "proxy-revalidate";
24
32
 
25
33
  ```
26
34
  2. 进入CICD,构建相应环境
@@ -1,2 +1,8 @@
1
+ if [[ "$OSTYPE" =~ ^cygwin|msys$ ]]
2
+ then
3
+ echo 'windows alias sh=source'
4
+ alias sh='source'
5
+ fi
6
+
1
7
  export build_env=dev
2
- sh frontend_build.sh
8
+ sh ./frontend_build.sh
@@ -30,6 +30,14 @@ sh report.sh
30
30
  构建方式:执行仓库下 sh frontend_build.sh
31
31
  部署方式:将构建完成的文件夹下的 `release` 内的内容部署到目标服务器
32
32
  参考应用:oa-app
33
+ 其它要求:nginx添加对index.html的缓存策略,配置如下:
34
+ expires 0;
35
+ add_header Cache-Control "max-age=0";
36
+ add_header Cache-Control "private";
37
+ add_header Cache-Control "no-store";
38
+ add_header Cache-Control "no-cache";
39
+ add_header Cache-Control "must-revalidate";
40
+ add_header Cache-Control "proxy-revalidate";
33
41
 
34
42
  ```
35
43
  2. 进入CICD,构建相应环境
@@ -1,2 +1,8 @@
1
+ if [[ "$OSTYPE" =~ ^cygwin|msys$ ]]
2
+ then
3
+ echo 'windows alias sh=source'
4
+ alias sh='source'
5
+ fi
6
+
1
7
  export build_env=dev
2
- sh frontend_build.sh
8
+ sh ./frontend_build.sh
@@ -73,8 +73,7 @@ build(){
73
73
 
74
74
  cp public/favicon.png release/favicon.png
75
75
  cp public/favicon.ico release/favicon.ico
76
- checkResult "复制favicon"
77
-
76
+ checkResult "cp favicon"
78
77
  }
79
78
 
80
79
  checkNode
@@ -9,8 +9,9 @@
9
9
  "dependencies": {
10
10
  "antd": "~4.24.8",
11
11
  "axios": "~1.1.3",
12
+ "js-uuid": "^0.0.6",
13
+ "kn-hooks": "~0.0.26",
12
14
  "moment": "~2.29.4",
13
- "kn-hooks": "~0.0.16",
14
15
  "react": "~17.0.2",
15
16
  "react-dom": "~17.0.2",
16
17
  "react-router": "~6.3.0",
@@ -12,7 +12,7 @@
12
12
 
13
13
  <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
14
14
  <link rel="icon" href="favicon.png" type="image/png">
15
- <title>网站标题</title>
15
+ <title>案件管理系统</title>
16
16
  </head>
17
17
 
18
18
  <body>
@@ -111,27 +111,6 @@
111
111
  }
112
112
 
113
113
 
114
- //Radio
115
- .ant-radio {
116
-
117
- .ant-radio-inner{
118
- width:20px;
119
- height:20px;
120
- border-color:#d9d9d9;
121
- &:after{
122
- width:.10px;
123
- height:10px;
124
- top:4px;
125
- left:4px;
126
- background-color:#108ee9;
127
- }
128
- }
129
- & .ant-radio-checked{
130
- .ant-radio-checked{
131
- border-color: #108ee9;
132
- }
133
- }
134
- }
135
114
 
136
115
 
137
116
  //Checkbox
@@ -127,5 +127,8 @@ a,div,p,span,section,hgroup{
127
127
  padding:var(--padding-small)
128
128
  }
129
129
 
130
+ .mr-16 {
131
+ margin-right: 16px;
132
+ }
130
133
  }
131
134
 
@@ -51,7 +51,7 @@
51
51
  --margin-larger:24px;
52
52
  --margin-small:8px;
53
53
 
54
- --padding-default:26px;
54
+ --padding-default:24px;
55
55
  --padding-larger:32px;
56
56
  --padding-small:16px;
57
57
 
@@ -29,7 +29,7 @@ export const AuthLogin=(props)=>{
29
29
  }else{
30
30
  console.log(`[Auth]检查用户登录态失败`)
31
31
  setPass(false);
32
- navigate('/superAdminLogin');
32
+ navigate('/login');
33
33
  }
34
34
  }
35
35
  useEffect(check,[]);
@@ -0,0 +1,150 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom';
3
+
4
+ import IconFont from '@/components/IconFont';
5
+
6
+ import Popup from '@/components/Popup';
7
+
8
+ import styles from './index.less';
9
+ import { Button } from 'antd';
10
+
11
+ const Dialog = (props) => {
12
+ async function onClose() {
13
+ if (props.onClose) {
14
+ let ret = await props.onClose();
15
+ if (ret) {
16
+ props.destory();
17
+ }
18
+ } else {
19
+ props.destory();
20
+ }
21
+ }
22
+ async function onOk() {
23
+ if (props.onOk) {
24
+ let ret = await props.onOk();
25
+ if (ret) {
26
+ props.destory();
27
+ }
28
+ } else {
29
+ props.destory();
30
+ }
31
+ }
32
+ return (
33
+ <section className={styles.body}>
34
+ <div className={styles.mask} />
35
+ <section className={styles.wrap}>
36
+ <div className={styles.header}>
37
+ <span>{props.title}</span>
38
+ <IconFont icon='close' className={styles.close} onClick={onClose} />
39
+ </div>
40
+
41
+ {props.children}
42
+
43
+ <div className={styles.footer}>
44
+ <Button type='primary' onClick={onOk}>
45
+ {props.okText || '确认'}
46
+ </Button>
47
+ {props.noCancel ? (
48
+ ''
49
+ ) : (
50
+ <Button onClick={onClose} style={{ marginLeft: '10px' }}>
51
+ {props.cancelText || '取消'}
52
+ </Button>
53
+ )}
54
+ </div>
55
+ </section>
56
+ </section>
57
+ );
58
+ };
59
+
60
+ export const ShowDialog = (props) => {
61
+ return new Promise((reslove) => {
62
+ let popup = Popup(reslove);
63
+ ReactDOM.render(
64
+ <Dialog
65
+ title={props.title}
66
+ destory={popup.destory}
67
+ onOk={props.onOk}
68
+ okText={props.okText}
69
+ cancelText={props.cancelText}
70
+ noCancel={props.noCancel}
71
+ onClose={props.onClose}
72
+ >
73
+ {props.component}
74
+ </Dialog>,
75
+ popup.dom
76
+ );
77
+ });
78
+ };
79
+
80
+ export const ShowConfirm = async (props) => {
81
+ if (typeof props === 'string') {
82
+ props = { content: props };
83
+ }
84
+
85
+ let result = false;
86
+ await ShowDialog({
87
+ title: props.title || '注意',
88
+ okText: props.okText || '确认',
89
+ cancelText: props.cancelText || '取消',
90
+ noCancel: typeof props.noCancel !== 'undefined' ? props.noCancel : false,
91
+ onClose: async () => {
92
+ result = false;
93
+ return Promise.resolve(true);
94
+ },
95
+ onOk: async () => {
96
+ result = true;
97
+ return Promise.resolve(true);
98
+ },
99
+ component: (
100
+ <div className={styles.confirmWrap}>
101
+ {props.content}
102
+ </div>
103
+ ),
104
+ });
105
+ return result;
106
+ };
107
+
108
+ const Alert = (props) => {
109
+ function onOk() {
110
+ if (props.onOk) props.onOk();
111
+ props.destory();
112
+ }
113
+ return (
114
+ <section className={styles.body }>
115
+ <div className={styles.mask} />
116
+ <section className={styles.wrapAlert}>
117
+ <div className={styles.alertContent}>
118
+ <div className={props.type === 'success' ? styles.iconSuccess : styles.iconError} />
119
+ <span>{props.content}</span>
120
+ </div>
121
+ <div className={styles.alertFooter}>
122
+ <span onClick={onOk}>{props.okText || '确认'}</span>
123
+ </div>
124
+ </section>
125
+ </section>
126
+ );
127
+ };
128
+
129
+ export const ShowAlert = (props) => {
130
+ if (props.constructor === String) {
131
+ props = { content: props };
132
+ }
133
+ return new Promise((reslove) => {
134
+ let popup = Popup(reslove);
135
+
136
+ ReactDOM.render(
137
+ <Alert destory={popup.destory} type={props.type || 'success'} onOk={props.onOk} content={props.content} />,
138
+ popup.dom
139
+ );
140
+ });
141
+ };
142
+
143
+ export const ShowErrorAlert = (props) => {
144
+ if (props.constructor === String) {
145
+ props = { content: props };
146
+ }
147
+ return ShowAlert({ ...props, type: 'fail' });
148
+ };
149
+
150
+ export default Dialog;
@@ -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,6 @@
1
+ .tableEmpty{
2
+ display: flex;
3
+ flex-direction: column;
4
+ justify-content: center;
5
+ align-items: center;
6
+ }
@@ -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;