@yorha2b-lab/autodev 1.0.27 → 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/config.js
CHANGED
package/package.json
CHANGED
|
@@ -97,7 +97,7 @@ const watchPage = options => {
|
|
|
97
97
|
|
|
98
98
|
const pageConfig = await recognizePage(pagePrompt, filePath)
|
|
99
99
|
fs.writeFileSync(path.join(targetDir, 'resource.js'), resource({ pageConfig, resourceTpl }))
|
|
100
|
-
fs.writeFileSync(path.join(targetDir, 'index.js'), index({ fileName, indexTpl, pageConfig }))
|
|
100
|
+
fs.writeFileSync(path.join(targetDir, 'index.js'), index({ config, fileName, indexTpl, pageConfig }))
|
|
101
101
|
|
|
102
102
|
if (!menus.find(m => m.key === fileName)) {
|
|
103
103
|
menus.push({ label: fileName, key: fileName })
|
|
@@ -44,7 +44,7 @@ const resource = ({ pageConfig, resourceTpl }) => {
|
|
|
44
44
|
* @param {Object} param0.pageConfig - 页面配置对象
|
|
45
45
|
* @returns {string} 生成的 index.js 代码
|
|
46
46
|
*/
|
|
47
|
-
const index = ({ fileName, indexTpl, pageConfig }) => {
|
|
47
|
+
const index = ({ config, fileName, indexTpl, pageConfig }) => {
|
|
48
48
|
const hasTabs = pageConfig.tabs?.length > 0
|
|
49
49
|
const hasOperate = pageConfig.table.operation?.length > 0
|
|
50
50
|
|
|
@@ -62,6 +62,7 @@ const index = ({ 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 || [], // 操作列配置
|
|
@@ -25,7 +25,9 @@ export default props => {
|
|
|
25
25
|
{{#each operations}}
|
|
26
26
|
const {{this.action}} = async record => {
|
|
27
27
|
const response = await request('/api')
|
|
28
|
-
|
|
28
|
+
if({{{../responseSuccess}}}){
|
|
29
|
+
refresh()
|
|
30
|
+
}
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
{{/each}}
|
|
@@ -38,7 +40,9 @@ export default props => {
|
|
|
38
40
|
content: '确认{{this.btn}}吗?',
|
|
39
41
|
onOk: async () => {
|
|
40
42
|
const response = await request('/api')
|
|
41
|
-
|
|
43
|
+
if({{{../responseSuccess}}}){
|
|
44
|
+
refresh()
|
|
45
|
+
}
|
|
42
46
|
}
|
|
43
47
|
})
|
|
44
48
|
}
|