@yorha2b-lab/autodev 1.0.45 → 1.0.46

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": "1.0.45",
3
+ "version": "1.0.46",
4
4
  "description": "基于视觉大模型的前端(react+Antd)全自动 CRUD 代码生成器",
5
5
  "bin": {
6
6
  "autodev": "bin/autodev.js"
@@ -22,5 +22,6 @@ module.exports = `
22
22
  ⚠️⚠️⚠️注意:
23
23
  type:text/date/daterange/radio/checkbox/select/auto/textarea,如果是text可以省略
24
24
  如果type是auto/radio/select/checkbox,请加入options:_CODE_对应的英文名词Options_CODE_
25
+ 如果表单项末尾有文字描述,请将文字描述放在unit属性中
25
26
  ** 只输出modalItems就可以,不需要对应的formItems和columns **
26
27
  `
@@ -1,10 +1,10 @@
1
- import { Modal } from 'antd'
2
1
  import { MyTable } from './MyTable'
2
+ import { Modal, Button } from 'antd'
3
3
  import { MySearchForm } from './MySearchForm'
4
4
  import { useTableQuery } from '../hooks/useTableQuery'
5
5
 
6
6
 
7
- export const MyModalTable = ({ api, onOk, title, width, footer, visible, columns, setModal, formItems, rowSelection, formatResponse, extraParams = {} }) => {
7
+ export const MyModalTable = ({ api, onOk, title, width, footer, visible, columns, setModal, formItems, rowSelection, formatResponse, functionButtons, extraParams = {} }) => {
8
8
 
9
9
  const { total, loading, dataSource, search, setSearch } = useTableQuery(api, formatResponse, extraParams)
10
10
 
@@ -22,6 +22,7 @@ export const MyModalTable = ({ api, onOk, title, width, footer, visible, columns
22
22
  return (
23
23
  <Modal centered destroyOnClose title={title} width={width} open={visible} onOk={handleOk} footer={footer} onCancel={() => setModal({ visible: false })}>
24
24
  {formItems?.length > 0 && <MySearchForm search={search} formItems={formItems} setSearch={handleSearch} syncUrlParams={false} />}
25
+ {functionButtons?.length > 0 && functionButtons.map(item => <Button key={item.name} type={item.type} onClick={item.onClick}>{item.name}</Button>)}
25
26
  <MyTable
26
27
  loading={loading}
27
28
  columns={columns}