@yorha2b-lab/autodev 7.7.3 → 7.7.4
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
CHANGED
|
@@ -19,9 +19,15 @@ module.exports = bunker => {
|
|
|
19
19
|
}
|
|
20
20
|
})
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
let rebootTimer = null
|
|
23
|
+
const debouncedReboot = file => {
|
|
24
|
+
clearTimeout(rebootTimer)
|
|
25
|
+
rebootTimer = setTimeout(() => {
|
|
26
|
+
if (file.endsWith('config.js')) {
|
|
27
|
+
bunker.reboot()
|
|
28
|
+
}
|
|
29
|
+
}, 300)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
settingObserver.on('change', file => debouncedReboot(file))
|
|
27
33
|
}
|
|
@@ -39,10 +39,14 @@ const flattenFormItems = items => {
|
|
|
39
39
|
* formItems={[{ label: '截止日期', name: 'deadline', type: 'date' }]}
|
|
40
40
|
* />
|
|
41
41
|
*/
|
|
42
|
-
export const MyModalForm = ({ extra, width, title, layout, okText, options, footer, submit, record, visible, setModal, labelCol, modalItems, wrapperCol, cancelText, tableConfig, okButtonProps, onValuesChange, handleModalTableOk }) => {
|
|
42
|
+
export const MyModalForm = ({ extra, width, title, layout, okText, options, footer, submit, record, visible, setModal, labelCol, modalItems, wrapperCol, cancelText, tableConfig, okButtonProps, renderAction, onValuesChange, handleModalTableOk }) => {
|
|
43
43
|
|
|
44
44
|
const rowKey = tableConfig?.rowKey || 'id'
|
|
45
|
-
const formItems = useMemo(() => modalItems.map(item => ({
|
|
45
|
+
const formItems = useMemo(() => modalItems.map(item => ({
|
|
46
|
+
...item,
|
|
47
|
+
...(item.renderAction ? { render: renderAction?.[item.name] } : {}),
|
|
48
|
+
...(['select'].includes(item.type) ? { options: item.options ?? options?.[item.name] ?? [] } : {})
|
|
49
|
+
})), [options, modalItems, renderAction])
|
|
46
50
|
|
|
47
51
|
const [form] = Form.useForm()
|
|
48
52
|
const [pending, setPending] = useState(false)
|
|
@@ -32,11 +32,15 @@ import { SearchOutlined, RedoOutlined } from '@ant-design/icons'
|
|
|
32
32
|
* formItems={[{ label: '状态', name: 'status', type: 'select', options: [...] }]}
|
|
33
33
|
* />
|
|
34
34
|
*/
|
|
35
|
-
export const MySearchForm = ({ form, search, options, loading, labelCol, setSearch, formItems, showLimit = 7, initialValues, initialParams, customReset,
|
|
35
|
+
export const MySearchForm = ({ form, extra, search, options, loading, labelCol, setSearch, formItems, showLimit = 7, initialValues, initialParams, customReset, customFinish, renderAction, onValuesChange, syncUrlParams = true, defaultPageSize = 10 }) => {
|
|
36
36
|
|
|
37
37
|
const [limit, setLimit] = useState(showLimit)
|
|
38
38
|
|
|
39
|
-
const searchItems = useMemo(() => formItems.map(item => ({
|
|
39
|
+
const searchItems = useMemo(() => formItems.map(item => ({
|
|
40
|
+
...item,
|
|
41
|
+
...(item.renderAction ? { render: renderAction?.[item.name] } : {}),
|
|
42
|
+
...(['select'].includes(item.type) ? { options: item.options ?? options?.[item.name] ?? [] } : {})
|
|
43
|
+
})), [options, formItems, renderAction])
|
|
40
44
|
|
|
41
45
|
/**
|
|
42
46
|
* @function handleReset
|