Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 28 additions & 29 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,38 +59,37 @@
}

.loading-container .loading-container-item {
position: relative;
display: inline-block;
width: 60px;
height: 60px;
vertical-align: middle;
border-radius: 50%;
}
position: relative;
display: inline-block;
width: 60px;
height: 60px;
vertical-align: middle;
border-radius: 50%;
}
.loading-container .loading-container-outter {
position: absolute;
width: 100%;
height: 100%;
border: 4px solid #2d8cf0;
border-bottom: 0;
border-left-color: transparent;
border-radius: 50%;
animation: loader-outter 1s cubic-bezier(0.42, 0.61, 0.58, 0.41) infinite;
}
position: absolute;
width: 100%;
height: 100%;
border: 4px solid #2d8cf0;
border-bottom: 0;
border-left-color: transparent;
border-radius: 50%;
animation: loader-outter 1s cubic-bezier(0.42, 0.61, 0.58, 0.41) infinite;
}

.loading-container .loading-container-inner {
position: absolute;
top: calc(50% - 20px);
left: calc(50% - 20px);
width: 40px;
height: 40px;
border: 4px solid #87bdff;
border-right: 0;
border-top-color: transparent;
border-radius: 50%;
animation: loader-inner 1s cubic-bezier(0.42, 0.61, 0.58, 0.41) infinite;
}
position: absolute;
top: calc(50% - 20px);
left: calc(50% - 20px);
width: 40px;
height: 40px;
border: 4px solid #87bdff;
border-right: 0;
border-top-color: transparent;
border-radius: 50%;
animation: loader-inner 1s cubic-bezier(0.42, 0.61, 0.58, 0.41) infinite;
}


@-webkit-keyframes loader-outter {
0% {
-webkit-transform: rotate(0deg);
Expand Down
1 change: 0 additions & 1 deletion frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ const showWatermark = computed(() => settingsStore.showWatermark);
const fontColor = computed(() => {
return settingsStore.theme === ThemeMode.DARK ? "rgba(255, 255, 255, .15)" : "rgba(0, 0, 0, .15)";
});
</script>
1 change: 0 additions & 1 deletion frontend/src/api/module_application/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ const JobAPI = {
responseType: "blob",
});
},

};

export default JobAPI;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/api/module_generator/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const ExampleAPI = {
},

getExampleDetail(query: number) {
return request<ApiResponse<ExampleTable>>({
return request<ApiResponse<ExampleTable>>({
url: `${API_PATH}/detail/${query}`,
method: "get",
});
Expand Down
61 changes: 30 additions & 31 deletions frontend/src/api/module_generator/gencode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,97 +7,97 @@ const GencodeAPI = {
listTable(query: GenTablePageQuery) {
return request<ApiResponse<PageResult<GenTableSchema[]>>>({
url: `${API_PATH}/list`,
method: 'get',
params: query
})
method: "get",
params: query,
});
},

// 查询db数据库列表
listDbTable(query: DBTablePageQuery) {
return request<ApiResponse<PageResult<DBTableSchema[]>>>({
url: `${API_PATH}/db/list`,
method: 'get',
params: query
})
method: "get",
params: query,
});
},

// 导入表
importTable(table_names: string[]) {
return request<ApiResponse>({
url: `${API_PATH}/import`,
method: 'post',
data: table_names
})
method: "post",
data: table_names,
});
},

// 查询表详细信息
getGenTableDetail(table_id: number) {
return request<ApiResponse<GenTableSchema>>({
url: `${API_PATH}/detail/${table_id}`,
method: 'get'
})
method: "get",
});
},

// 创建表
createTable(sql: string) {
return request<ApiResponse>({
url: `${API_PATH}/create`,
method: 'post',
data: sql
})
method: "post",
data: sql,
});
},

// 更新表信息
updateTable(data: GenTableSchema, table_id: number) {
return request<ApiResponse>({
url: `${API_PATH}/update/${table_id}`,
method: 'put',
data
})
method: "put",
data,
});
},

// 删除表数据
deleteTable(table_ids: number[]) {
return request<ApiResponse>({
url: `${API_PATH}/delete`,
method: 'delete',
data: table_ids
})
method: "delete",
data: table_ids,
});
},

// 批量生成代码
batchGenCode(table_names: string[]) {
return request<Blob>({
url: `${API_PATH}/batch/output`,
method: 'patch',
method: "patch",
data: table_names,
responseType: 'blob'
})
responseType: "blob",
});
},

// 生成代码到指定路径
genCodeToPath(table_name: string) {
return request<ApiResponse>({
url: `${API_PATH}/output/${table_name}`,
method: 'post'
})
method: "post",
});
},

// 预览生成代码
previewTable(id: number) {
return request<ApiResponse<Record<string, string>>>({
url: `${API_PATH}/preview/${id}`,
method: 'get'
})
method: "get",
});
},

// 同步数据库
syncDb(table_name: string) {
return request<ApiResponse>({
url: `${API_PATH}/sync_db/${table_name}`,
method: 'post'
})
}
method: "post",
});
},
};

export default GencodeAPI;
Expand Down Expand Up @@ -219,4 +219,3 @@ export interface GenTableColumnSchema {
/** 功能描述 */
description?: string;
}

3 changes: 0 additions & 3 deletions frontend/src/api/module_monitor/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export const ResourceAPI = {
});
},


/**
* 上传文件
* @param formData 文件数据
Expand Down Expand Up @@ -118,8 +117,6 @@ export const ResourceAPI = {

export default ResourceAPI;



/**
* 资源列表查询参数
*/
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/api/module_system/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export interface MenuTable {
hidden?: boolean;
always_show?: boolean;
title?: string;
params?: { key: string; value: string; }[];
params?: { key: string; value: string }[];
affix?: boolean;
status?: boolean;
description?: string;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/api/module_system/tenant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const TenantAPI = {
},

detail(query: number) {
return request<ApiResponse<ObjTable>>({
return request<ApiResponse<ObjTable>>({
url: `${API_PATH}/detail/${query}`,
method: "get",
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/api/module_system/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export interface UserForm {
id?: number;
username?: string;
name?: string;
dept_id?: number;
dept_id?: number;
dept_name?: string;
role_ids?: number[];
role_names?: string[];
Expand Down
44 changes: 25 additions & 19 deletions frontend/src/components/CURD/ExportModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
</el-form-item>
<el-form-item label="数据源" prop="origin">
<el-select v-model="exportsFormData.origin">
<el-option label="当前数据 (当前页的数据)" :value="ExportsOriginEnum.CURRENT" :disabled="!pageData?.length" />
<el-option
label="当前数据 (当前页的数据)"
:value="ExportsOriginEnum.CURRENT"
:disabled="!pageData?.length"
/>
<el-option
label="选中数据 (所有选中的数据)"
:value="ExportsOriginEnum.SELECTED"
Expand Down Expand Up @@ -113,9 +117,8 @@ const exportsFormRules: FormRules = {
origin: [{ required: true, message: "请选择数据源" }],
};


// 表格列
const cols = computed(() =>
const cols = computed(() =>
props.contentConfig.cols.map((col) => {
if (col.initFn) {
col.initFn(col);
Expand Down Expand Up @@ -177,25 +180,28 @@ function handleExports() {
}
});
worksheet.columns = columns;

if (exportsFormData.origin === ExportsOriginEnum.REMOTE) {
if (props.contentConfig.exportsAction) {
const lastFormData = props.queryParams ?? {};
props.contentConfig.exportsAction(lastFormData).then((res) => {
worksheet.addRows(res);
workbook.xlsx
.writeBuffer()
.then((buffer) => {
saveXlsx(buffer, filename as string);
})
.catch((error) => {
console.error("导出远程数据失败:", error);
ElMessage.error("导出远程数据失败");
});
}).catch((error) => {
console.error("获取远程数据失败:", error);
ElMessage.error("获取远程数据失败");
});
props.contentConfig
.exportsAction(lastFormData)
.then((res) => {
worksheet.addRows(res);
workbook.xlsx
.writeBuffer()
.then((buffer) => {
saveXlsx(buffer, filename as string);
})
.catch((error) => {
console.error("导出远程数据失败:", error);
ElMessage.error("导出远程数据失败");
});
})
.catch((error) => {
console.error("获取远程数据失败:", error);
ElMessage.error("获取远程数据失败");
});
} else {
ElMessage.error("未配置exportsAction");
}
Expand Down
Loading