feat();代码生成器更改
parent
6910315d47
commit
22e534b67d
|
@ -1,7 +1,7 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询菜单列表
|
||||
export function listMenu(query) {
|
||||
export function listMenu(query={}) {
|
||||
return request({
|
||||
url: '/system/menu/list',
|
||||
method: 'POST',
|
||||
|
|
|
@ -3,15 +3,15 @@ import request from '@/utils/request'
|
|||
// 查询生成表数据
|
||||
export function listTable(query) {
|
||||
return request({
|
||||
url: '/tool/gen/list',
|
||||
url: '/code/gen/list',
|
||||
method: 'POST',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
// 查询db数据库列表
|
||||
export function listDbTable(query) {
|
||||
export function listDbTable(query={}) {
|
||||
return request({
|
||||
url: '/tool/gen/db/list',
|
||||
url: '/code/gen/db/list',
|
||||
method: 'POST',
|
||||
data: query
|
||||
})
|
||||
|
@ -20,7 +20,7 @@ export function listDbTable(query) {
|
|||
// 查询表详细信息
|
||||
export function getGenTable(tableId) {
|
||||
return request({
|
||||
url: '/tool/gen/' + tableId,
|
||||
url: '/code/gen/' + tableId,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ export function getGenTable(tableId) {
|
|||
// 修改代码生成信息
|
||||
export function updateGenTable(data) {
|
||||
return request({
|
||||
url: '/tool/gen',
|
||||
url: '/code/gen',
|
||||
method: 'PUT',
|
||||
data: data
|
||||
})
|
||||
|
@ -37,7 +37,7 @@ export function updateGenTable(data) {
|
|||
// 导入表
|
||||
export function importTable(data) {
|
||||
return request({
|
||||
url: '/tool/gen/importTable',
|
||||
url: '/code/gen/importTable',
|
||||
method: 'POST',
|
||||
params: data
|
||||
})
|
||||
|
@ -46,7 +46,7 @@ export function importTable(data) {
|
|||
// 创建表
|
||||
export function createTable(data) {
|
||||
return request({
|
||||
url: '/tool/gen/createTable',
|
||||
url: '/code/gen/createTable',
|
||||
method: 'POST',
|
||||
params: data
|
||||
})
|
||||
|
@ -55,7 +55,7 @@ export function createTable(data) {
|
|||
// 预览生成代码
|
||||
export function previewTable(tableId) {
|
||||
return request({
|
||||
url: '/tool/gen/preview/' + tableId,
|
||||
url: '/code/gen/preview/' + tableId,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ export function previewTable(tableId) {
|
|||
// 删除表数据
|
||||
export function delTable(tableId) {
|
||||
return request({
|
||||
url: '/tool/gen/' + tableId,
|
||||
url: '/code/gen/' + tableId,
|
||||
method: 'DELETE'
|
||||
})
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ export function delTable(tableId) {
|
|||
// 生成代码(自定义路径)
|
||||
export function genCode(tableName) {
|
||||
return request({
|
||||
url: '/tool/gen/genCode/' + tableName,
|
||||
url: '/code/gen/genCode/' + tableName,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ export function genCode(tableName) {
|
|||
// 同步数据库
|
||||
export function synchDb(tableName) {
|
||||
return request({
|
||||
url: '/tool/gen/synchDb/' + tableName,
|
||||
url: '/code/gen/synchDb/' + tableName,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ function handleBeforeUpload(file) {
|
|||
// 上传成功处理
|
||||
function handleUploadSuccess(res, file) {
|
||||
// 如果上传成功
|
||||
if (res.data.code == 200) {
|
||||
if (res.code == 200) {
|
||||
// 获取富文本实例
|
||||
let quill = toRaw(quillEditorRef.value).getQuill();
|
||||
// 获取光标位置
|
||||
|
|
|
@ -138,13 +138,13 @@ function handleUploadError(err) {
|
|||
|
||||
// 上传成功回调
|
||||
function handleUploadSuccess(res, file) {
|
||||
if (res.data.code === 200) {
|
||||
if (res.code === 200) {
|
||||
uploadList.value.push({ name: res.data.fileName, url: res.data.fileName });
|
||||
uploadedSuccessfully();
|
||||
} else {
|
||||
number.value--;
|
||||
proxy.$modal.closeLoading();
|
||||
proxy.$modal.msgError(res.data.msg);
|
||||
proxy.$modal.msgError(res.msg);
|
||||
proxy.$refs.fileUpload.handleRemove(file);
|
||||
uploadedSuccessfully();
|
||||
}
|
||||
|
|
|
@ -150,13 +150,13 @@ function handleExceed() {
|
|||
|
||||
// 上传成功回调
|
||||
function handleUploadSuccess(res, file) {
|
||||
if (res.data.code === 200) {
|
||||
if (res.code === 200) {
|
||||
uploadList.value.push({ name: res.data.fileName, url: res.data.fileName });
|
||||
uploadedSuccessfully();
|
||||
} else {
|
||||
number.value--;
|
||||
proxy.$modal.closeLoading();
|
||||
proxy.$modal.msgError(res.data.msg);
|
||||
proxy.$modal.msgError(res.msg);
|
||||
proxy.$refs.imageUpload.handleRemove(file);
|
||||
uploadedSuccessfully();
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ function handleSelectUser() {
|
|||
return;
|
||||
}
|
||||
authUserSelectAll({ roleId: roleId, userIds: uIds }).then(res => {
|
||||
proxy.$modal.msgSuccess(res.data.msg);
|
||||
proxy.$modal.msgSuccess(res.msg);
|
||||
visible.value = false;
|
||||
emit("ok");
|
||||
});
|
||||
|
|
|
@ -77,7 +77,7 @@ const state = reactive({
|
|||
|
||||
function getUser() {
|
||||
getUserProfile().then(response => {
|
||||
state.user = response.data;
|
||||
state.user = response.data.sysUser;
|
||||
state.roleGroup = response.data.roleGroup;
|
||||
state.postGroup = response.data.postGroup;
|
||||
});
|
||||
|
|
|
@ -133,7 +133,7 @@ function uploadImg() {
|
|||
formData.append("avatarfile", data, options.filename);
|
||||
uploadAvatar(formData).then(response => {
|
||||
open.value = false;
|
||||
options.img = import.meta.env.VITE_APP_BASE_API + response.data.imgUrl;
|
||||
options.img = response.data;
|
||||
userStore.avatar = options.img;
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
visible.value = false;
|
||||
|
|
|
@ -32,8 +32,8 @@ function handleImportTable() {
|
|||
return;
|
||||
}
|
||||
createTable({ sql: content.value }).then(res => {
|
||||
proxy.$modal.msgSuccess(res.data.msg);
|
||||
if (res.data.code === 200) {
|
||||
proxy.$modal.msgSuccess(res.msg);
|
||||
if (res.code === 200) {
|
||||
visible.value = false;
|
||||
emit("ok");
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ function submitForm() {
|
|||
const basicForm = proxy.$refs.basicInfo.$refs.basicInfoForm;
|
||||
const genForm = proxy.$refs.genInfo.$refs.genInfoForm;
|
||||
Promise.all([basicForm, genForm].map(getFormPromise)).then(res => {
|
||||
const validateResult = res.data.every(item => !!item);
|
||||
const validateResult = res.every(item => !!item);
|
||||
if (validateResult) {
|
||||
const genTable = Object.assign({}, info.value);
|
||||
genTable.columns = columns.value;
|
||||
|
@ -158,8 +158,8 @@ function submitForm() {
|
|||
parentMenuId: info.value.parentMenuId
|
||||
};
|
||||
updateGenTable(genTable).then(res => {
|
||||
proxy.$modal.msgSuccess(res.data.msg);
|
||||
if (res.data.code === 200) {
|
||||
proxy.$modal.msgSuccess(res.msg);
|
||||
if (res.code === 200) {
|
||||
close();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -112,8 +112,8 @@ function handleImportTable() {
|
|||
return;
|
||||
}
|
||||
importTable({ tables: tableNames }).then(res => {
|
||||
proxy.$modal.msgSuccess(res.data.msg);
|
||||
if (res.data.code === 200) {
|
||||
proxy.$modal.msgSuccess(res.msg);
|
||||
if (res.code === 200) {
|
||||
visible.value = false;
|
||||
emit("ok");
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
v-hasPermi="['tool:gen:code']"
|
||||
>生成</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-col :span="1.5" v-if="false">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
|
@ -236,7 +236,7 @@ function handleGenTable(row) {
|
|||
proxy.$modal.msgSuccess("成功生成到自定义路径:" + row.genPath);
|
||||
});
|
||||
} else {
|
||||
proxy.$download.zip("/tool/gen/batchGenCode?tables=" + tbNames, "cloud.zip");
|
||||
proxy.$download.zip("/code/gen/batchGenCode?tables=" + tbNames, "cloud.zip");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue