@yorha2b-lab/autodev 1.0.27 → 1.0.28
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
|
|
|
@@ -72,7 +72,7 @@ const index = ({ fileName, indexTpl, pageConfig }) => {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
// 渲染模板
|
|
75
|
-
const bodyCode = indexTpl(viewData)
|
|
75
|
+
const bodyCode = indexTpl(viewData).replaceAll('_responseSuccess_', config.responseSuccess)
|
|
76
76
|
// 生成智能导入语句
|
|
77
77
|
const importsStr = generateSmartImports(bodyCode, hasTabs)
|
|
78
78
|
// 清理代码并返回
|
|
@@ -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
|
}
|