@yorha2b-lab/autodev 1.0.28 → 1.0.29

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.28",
3
+ "version": "1.0.29",
4
4
  "description": "基于视觉大模型的前端(Umi+Antd)全自动 CRUD 代码生成器",
5
5
  "bin": {
6
6
  "autodev": "bin/autodev.js"
@@ -62,6 +62,7 @@ const index = ({ config, fileName, indexTpl, pageConfig }) => {
62
62
  hasOperate, // 是否有操作列
63
63
  columnsValue, // columns 引用表达式
64
64
  tabs: pageConfig.tabs, // 标签页配置
65
+ responseSuccess: config.responseSuccess, // 成功回调函数
65
66
  hasExpandable: pageConfig.table.expandable, // 是否有展开行
66
67
  hasPagination: pageConfig.table.pagination, // 是否有分页
67
68
  operations: pageConfig.table.operation || [], // 操作列配置
@@ -72,7 +73,7 @@ const index = ({ config, fileName, indexTpl, pageConfig }) => {
72
73
  }
73
74
 
74
75
  // 渲染模板
75
- const bodyCode = indexTpl(viewData).replaceAll('_responseSuccess_', config.responseSuccess)
76
+ const bodyCode = indexTpl(viewData)
76
77
  // 生成智能导入语句
77
78
  const importsStr = generateSmartImports(bodyCode, hasTabs)
78
79
  // 清理代码并返回
@@ -25,7 +25,7 @@ export default props => {
25
25
  {{#each operations}}
26
26
  const {{this.action}} = async record => {
27
27
  const response = await request('/api')
28
- if(_responseSuccess_){
28
+ if({{{../responseSuccess}}}){
29
29
  refresh()
30
30
  }
31
31
  }
@@ -40,7 +40,7 @@ export default props => {
40
40
  content: '确认{{this.btn}}吗?',
41
41
  onOk: async () => {
42
42
  const response = await request('/api')
43
- if(_responseSuccess_){
43
+ if({{{../responseSuccess}}}){
44
44
  refresh()
45
45
  }
46
46
  }