@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yorha2b-lab/autodev",
3
- "version": "7.7.3",
3
+ "version": "7.7.4",
4
4
  "description": "基于 AI 视觉与语义协议的前端 (React+Antd) 代码构筑与旧系统重构引擎",
5
5
  "bin": {
6
6
  "bunker": "bin/bunker.js"
@@ -19,9 +19,15 @@ module.exports = bunker => {
19
19
  }
20
20
  })
21
21
 
22
- settingObserver.on('change', file => {
23
- if (file.endsWith('config.js')) {
24
- bunker.reboot()
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
  }
@@ -25,6 +25,7 @@ const {{this.action}} = () => {
25
25
  }
26
26
  fetching = true
27
27
  const response = await {{{this.request}}}
28
+ fetching = false
28
29
  if({{{../responseSuccess}}}){
29
30
  refresh()
30
31
  }
@@ -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 => ({ ...item, ...(['select'].includes(item.type) ? { options: item.options ?? options?.[item.name] ?? [] } : {}) })), [modalItems, options])
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, extra, customFinish, onValuesChange, syncUrlParams = true, defaultPageSize = 10 }) => {
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 => ({ ...item, ...(['select'].includes(item.type) ? { options: item.options ?? options?.[item.name] ?? [] } : {}) })), [formItems, options])
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