@yorha2b-lab/autodev 1.0.19 → 1.0.21
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/bin/autodev.js
CHANGED
|
@@ -3,8 +3,8 @@ const fs = require('fs')
|
|
|
3
3
|
const path = require('path')
|
|
4
4
|
const chalk = require('chalk')
|
|
5
5
|
const figlet = require('figlet')
|
|
6
|
-
const pkg = require('../package.json')
|
|
7
6
|
const { program } = require('commander')
|
|
7
|
+
const pkg = require(path.join(__dirname, '../package.json'))
|
|
8
8
|
|
|
9
9
|
console.log(chalk.cyan(figlet.textSync('AutoDev', { horizontalLayout: 'full' })))
|
|
10
10
|
console.log(chalk.gray('Booting System...'))
|
package/package.json
CHANGED
|
@@ -2,32 +2,39 @@ import { formNode } from './index'
|
|
|
2
2
|
import { Form, Space, Button } from 'antd'
|
|
3
3
|
import { PlusOutlined, PlusCircleOutlined, MinusCircleOutlined } from '@ant-design/icons'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const getValueFromEvent = e => {
|
|
6
|
+
if (Array.isArray(e)) {
|
|
7
|
+
return e
|
|
8
|
+
}
|
|
9
|
+
return e?.fileList
|
|
10
|
+
}
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
const renderFormContent = ({ item }) => {
|
|
8
13
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
if (!item.name) {
|
|
15
|
+
return item.value
|
|
16
|
+
}
|
|
12
17
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
const inputNode = (
|
|
19
|
+
<Form.Item noStyle name={item.name} rules={item.rules} initialValue={item.value} {...(item.type === 'upload' ? { getValueFromEvent, valuePropName: 'fileList' } : { valuePropName: item.valuePropName })}>
|
|
20
|
+
{formNode({ item })}
|
|
21
|
+
</Form.Item>
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
if (item.unit) {
|
|
25
|
+
return (
|
|
26
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
|
|
27
|
+
<div style={{ flex: 1, minWidth: 0 }}>{inputNode}</div>
|
|
28
|
+
<span style={{ color: '#888', whiteSpace: 'nowrap' }}>{item.unit}</span>
|
|
29
|
+
</div>
|
|
17
30
|
)
|
|
31
|
+
}
|
|
18
32
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
|
|
22
|
-
<div style={{ flex: 1, minWidth: 0 }}>{inputNode}</div>
|
|
23
|
-
<span style={{ color: '#888', whiteSpace: 'nowrap' }}>{item.unit}</span>
|
|
24
|
-
</div>
|
|
25
|
-
)
|
|
26
|
-
}
|
|
33
|
+
return inputNode
|
|
34
|
+
}
|
|
27
35
|
|
|
28
|
-
return inputNode
|
|
29
|
-
}
|
|
30
36
|
|
|
37
|
+
export const MyBaseForm = ({ item, form }) => {
|
|
31
38
|
return (
|
|
32
39
|
item.isList ?
|
|
33
40
|
<Form.List name={item.name} initialValue={item.value}>
|