代码生成支持自定义路径

This commit is contained in:
RuoYi
2020-07-24 15:37:57 +08:00
parent 388e36ed4d
commit 6e7d7aba93
11 changed files with 200 additions and 26 deletions

View File

@ -166,7 +166,7 @@
</template>
<script>
import { listTable, previewTable, delTable } from "@/api/tool/gen";
import { listTable, previewTable, delTable, genCode } from "@/api/tool/gen";
import importTable from "./importTable";
import { downLoadZip } from "@/utils/zipdownload";
export default {
@ -241,7 +241,13 @@ export default {
this.msgError("请选择要生成的数据");
return;
}
downLoadZip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi");
if(row.genType === "1") {
genCode(row.tableName).then(response => {
this.msgSuccess("成功生成到自定义路径:" + row.genPath);
});
} else {
downLoadZip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi");
}
},
/** 打开导入表弹窗 */
openImportTable() {