@yorha2b-lab/autodev 2.1.12 → 2.1.14

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": "2.1.12",
3
+ "version": "2.1.14",
4
4
  "description": "基于视觉大模型的前端(react+Antd)全自动 CRUD 代码生成器",
5
5
  "bin": {
6
6
  "autodev": "bin/autodev.js"
@@ -9,9 +9,7 @@ const components = {
9
9
  }
10
10
  }
11
11
 
12
- export const MyTable = ({ size, query, onSave, autoScroll, onChange, pagination, rowClassName, columns = [], rowSelection, rowKey = 'id', loading = false, dataSource = [], scroll = { x: 'max-content' }, ...restProps }) => {
13
-
14
- const { total, search, customSave, setDataSource } = restProps
12
+ export const MyTable = ({ size, query, total, search, autoScroll, onChange, pagination, rowClassName, customSave, setDataSource, columns = [], rowSelection, rowKey = 'id', loading = false, dataSource = [], scroll = { x: 'max-content' }, ...restProps }) => {
15
13
 
16
14
  const tableRef = useRef(null)
17
15
  const hasScrolledRef = useRef(false)
@@ -1,9 +1,12 @@
1
1
  <MyTable
2
2
  rowKey='id'
3
3
  query={query}
4
+ total={total}
5
+ search={search}
4
6
  loading={loading}
5
7
  dataSource={dataSource}
6
8
  columns={ {{columnsValue}} }
9
+ setDataSource={setDataSource}
7
10
  {{#if hasExpandable}}
8
11
  {{{{raw}}}}
9
12
  expandable={{ onExpand, expandedRowKeys, expandedRowRender, columnWidth: 24 }}
@@ -2,7 +2,7 @@ const initParams = {{#if hasTabs}}{ type: tabs[0].key }{{else}}{}{{/if}}
2
2
 
3
3
  const query = formatQuery(Object.fromEntries(new URLSearchParams(location.search).entries()), {{formItems}})
4
4
 
5
- const { total, loading, dataSource, search, setSearch, refresh } = useTableQuery(
5
+ const { total, loading, dataSource, search, setSearch, setDataSource, refresh } = useTableQuery(
6
6
  async params => await request('/api/{{fileName}}', { method: 'POST', body: params }),
7
7
  response => ({ data: response?.data ?? [], total: response?.total ?? 0 }),
8
8
  {...initParams, ...query},
@@ -37,5 +37,5 @@ export const useTableQuery = (api, formatResponse, initialParams = {}) => {
37
37
  fetchData()
38
38
  }, [fetchData])
39
39
 
40
- return { total, loading, dataSource, search, setSearch, refresh: fetchData }
40
+ return { total, loading, dataSource, search, setSearch, setDataSource, refresh: fetchData }
41
41
  }