|
@@ -50,13 +50,18 @@
|
|
|
<Icon class="mr-5px" icon="ep:zoom-in" />
|
|
|
导入
|
|
|
</el-button>
|
|
|
+ <el-button type="primary" @click="generateClick()">
|
|
|
+ <Icon class="mr-5px" icon="ep:zoom-in" />
|
|
|
+ 批量生成
|
|
|
+ </el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</ContentWrap>
|
|
|
|
|
|
<!-- 列表 -->
|
|
|
<ContentWrap>
|
|
|
- <el-table v-loading="loading" :data="list">
|
|
|
+ <el-table v-loading="loading" :data="list" @selection-change="selectionChange">
|
|
|
+ <el-table-column type="selection" width="55" />
|
|
|
<el-table-column align="center" label="数据源">
|
|
|
<template #default="scope">
|
|
|
{{
|
|
@@ -212,7 +217,25 @@ const importRef = ref()
|
|
|
const openImportTable = () => {
|
|
|
importRef.value.open()
|
|
|
}
|
|
|
-
|
|
|
+const selectList = ref([])
|
|
|
+const selectionChange = (val) => {
|
|
|
+ console.log(val, 544545455)
|
|
|
+ selectList.value = val
|
|
|
+}
|
|
|
+const generateClick = async () => {
|
|
|
+ if (selectList.value.length === 0) {
|
|
|
+ ElMessage({
|
|
|
+ message: '请至少选择一条!',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const params = {
|
|
|
+ ids: selectList.value.map((item) => item.id)
|
|
|
+ }
|
|
|
+ const res = await CodegenApi.downloadCodegenNewAll(params)
|
|
|
+ download.zip(res, 'codegen-all.zip')
|
|
|
+}
|
|
|
/** 编辑操作 */
|
|
|
const handleUpdate = (id: number) => {
|
|
|
push('/codegen/edit?id=' + id)
|