Skip to content

Commit fcf72bc

Browse files
committed
feat:gen code to path
1 parent 8bf0901 commit fcf72bc

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/api/tools/gen.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,11 @@ export function delTable(tableId) {
5757
})
5858
}
5959

60+
// 生成代码到项目
61+
export function toProjectTable(tableId) {
62+
return request({
63+
url: '/api/v1/gen/toproject/' + tableId,
64+
method: 'get'
65+
})
66+
}
67+

src/views/tools/gen/index.vue

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@
108108
icon="el-icon-view"
109109
@click="handlePreview(scope.row)"
110110
>预览</el-button>
111+
<el-button
112+
113+
type="text"
114+
size="small"
115+
icon="el-icon-view"
116+
@click="handleToProject(scope.row)"
117+
>生成到项目</el-button>
111118
<el-button
112119

113120
type="text"
@@ -150,7 +157,7 @@
150157
</template>
151158

152159
<script>
153-
import { listTable, previewTable, delTable } from '@/api/tools/gen'
160+
import { listTable, previewTable, delTable, toProjectTable } from '@/api/tools/gen'
154161
import importTable from './importTable'
155162
import { downLoadFile } from '@/utils/zipdownload'
156163
export default {
@@ -244,6 +251,11 @@ export default {
244251
this.preview.open = true
245252
})
246253
},
254+
handleToProject(row) {
255+
toProjectTable(row.tableId).then(response => {
256+
this.msgSuccess(response.msg)
257+
})
258+
},
247259
// 多选框选中数据
248260
handleSelectionChange(selection) {
249261
this.ids = selection.map(item => item.tableId)

0 commit comments

Comments
 (0)