mirror of
https://gitee.com/JavaLionLi/plus-ui.git
synced 2026-05-13 10:52:35 +00:00
Compare commits
9 Commits
dev
...
v5.6.1-v2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9fd2b6f137 | ||
|
|
6bc3c618fe | ||
|
|
5c9c940588 | ||
|
|
dfd1dc29d1 | ||
|
|
b411505b19 | ||
|
|
52ea8895d6 | ||
|
|
1b46739799 | ||
|
|
b000788785 | ||
|
|
2dc094c1db |
@@ -61,6 +61,14 @@ export const delTable = (tableId: string | number | Array<string | number>) => {
|
||||
});
|
||||
};
|
||||
|
||||
// 生成代码(自定义路径)
|
||||
export const genCode = (tableId: string | number) => {
|
||||
return request({
|
||||
url: '/tool/gen/genCode/' + tableId,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 同步数据库
|
||||
export const synchDb = (tableId: string | number) => {
|
||||
return request({
|
||||
|
||||
@@ -13,6 +13,8 @@ export interface TableVO extends BaseEntity {
|
||||
businessName: string;
|
||||
functionName: string;
|
||||
functionAuthor: string;
|
||||
genType: string;
|
||||
genPath: string;
|
||||
pkColumn?: any;
|
||||
columns?: any;
|
||||
options?: any;
|
||||
@@ -79,6 +81,8 @@ export interface DbTableVO {
|
||||
businessName?: any;
|
||||
functionName?: any;
|
||||
functionAuthor?: any;
|
||||
genType?: any;
|
||||
genPath?: any;
|
||||
pkColumn?: any;
|
||||
columns: DbColumnVO[];
|
||||
options?: any;
|
||||
@@ -158,6 +162,8 @@ export interface DbTableForm extends BaseEntity {
|
||||
businessName: string;
|
||||
functionName: string;
|
||||
functionAuthor: string;
|
||||
genType: string;
|
||||
genPath: string;
|
||||
pkColumn?: any;
|
||||
columns: DbColumnForm[];
|
||||
options: string;
|
||||
|
||||
@@ -7,6 +7,7 @@ import { NavTypeEnum } from '@/enums/NavTypeEnum';
|
||||
|
||||
export const useSettingsStore = defineStore('setting', () => {
|
||||
const storageSetting = useStorage<LayoutSetting>('layout-setting', {
|
||||
topNav: defaultSettings.topNav,
|
||||
tagsView: defaultSettings.tagsView,
|
||||
tagsIcon: defaultSettings.tagsIcon,
|
||||
fixedHeader: defaultSettings.fixedHeader,
|
||||
|
||||
@@ -82,6 +82,44 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="genType">
|
||||
<template #label>
|
||||
生成代码方式
|
||||
<el-tooltip content="默认为zip压缩包下载,也可以自定义生成路径" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<el-radio v-model="infoForm.genType" value="0">zip压缩包</el-radio>
|
||||
<el-radio v-model="infoForm.genType" value="1">自定义路径</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col v-if="infoForm.genType == '1'" :span="24">
|
||||
<el-form-item prop="genPath">
|
||||
<template #label>
|
||||
自定义路径
|
||||
<el-tooltip content="填写磁盘绝对路径,若不填写,则生成到当前Web项目下" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<el-input v-model="infoForm.genPath">
|
||||
<template #append>
|
||||
<el-dropdown>
|
||||
<el-button type="primary">
|
||||
最近路径快速选择
|
||||
<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item @click="infoForm.genPath = '/'">恢复默认的生成基础路径</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<template v-if="info.tplCategory == 'tree'">
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Gen" lang="ts">
|
||||
import { delTable, getDataNames, listTable, previewTable, synchDb } from '@/api/tool/gen';
|
||||
import { delTable, genCode, getDataNames, listTable, previewTable, synchDb } from '@/api/tool/gen';
|
||||
import { TableQuery, TableVO } from '@/api/tool/gen/types';
|
||||
import router from '@/router';
|
||||
import ImportTable from './importTable.vue';
|
||||
@@ -181,7 +181,12 @@ const handleGenTable = async (row?: TableVO) => {
|
||||
proxy?.$modal.msgError('请选择要生成的数据');
|
||||
return;
|
||||
}
|
||||
proxy?.$download.zip('/tool/gen/batchGenCode?tableIdStr=' + tbIds, 'ruoyi.zip');
|
||||
if (row?.genType === '1') {
|
||||
await genCode(row.tableId);
|
||||
proxy?.$modal.msgSuccess('成功生成到自定义路径:' + row.genPath);
|
||||
} else {
|
||||
proxy?.$download.zip('/tool/gen/batchGenCode?tableIdStr=' + tbIds, 'ruoyi.zip');
|
||||
}
|
||||
};
|
||||
/** 同步数据库操作 */
|
||||
const handleSynchDb = async (row: TableVO) => {
|
||||
|
||||
Reference in New Issue
Block a user