refactor: 统一项目代码风格并修复多处类型与调用问题

本次提交包含多项优化:
1.  移除大量冗余的文件头注释与过时的from __future__导入
2.  将CRUD的list方法统一重命名为get_list保持接口一致
3.  修复前后端状态字段类型不匹配问题,将string类型status改为number
4.  修正前端文案错别字,将"代办事项"修正为标准写法
5.  更新sqlalchemy版本并调整依赖配置
6.  新增缓存工具类替代fastapi-cache2,重构缓存调用逻辑
7.  新增开源授权函生成相关工具与数据库字段支持
8.  为多个业务模块添加防重复提交loading状态
9.  修复邮件模型的外键关联缺失问题
10. 优化pdf生成工具的导入时机与文档注释
This commit is contained in:
zhangtao
2026-06-21 17:34:11 +08:00
parent 3169ef2355
commit 7d2367e34e
106 changed files with 1968 additions and 966 deletions
@@ -90,6 +90,7 @@
@click="handleSubmit"
v-ripple
:disabled="disabledSubmit"
:loading="loading"
>
{{ t("table.form.submit") }}
</ElButton>
@@ -177,6 +178,7 @@
@click="handleSubmit"
v-ripple
:disabled="disabledSubmit"
:loading="loading"
>
{{ t("table.form.submit") }}
</ElButton>
@@ -296,6 +298,8 @@ interface Props {
showSubmit?: boolean;
/** 是否禁用提交按钮 */
disabledSubmit?: boolean;
/** 提交按钮 loading(防止重复提交) */
loading?: boolean;
/** 提交时是否清洗空值 */
sanitizeOutput?: Partial<SanitizeOutputOptions>;
/** 是否需要内置 ElScrollbar 包裹 */
@@ -329,6 +333,7 @@ const props = withDefaults(defineProps<Props>(), {
showReset: true,
showSubmit: true,
disabledSubmit: false,
loading: false,
sanitizeOutput: () => ({}),
scrollbar: false,
maxHeight: "75vh",
@@ -21,6 +21,7 @@
v-hasPerm="permCreate"
type="primary"
:icon="Plus"
:loading="createLoading"
@click="$emit('add')"
plain
>
@@ -63,7 +64,7 @@
批量删除
</ElButton>
<ElDropdown v-if="permPatch" v-hasPerm="permPatch" trigger="click">
<ElButton type="default" :disabled="removeIds.length === 0 || moreDisabled">
<ElButton type="default" :disabled="removeIds.length === 0 || moreDisabled" :loading="moreLoading">
<template #icon>
<ArrowDown />
</template>
@@ -71,8 +72,8 @@
</ElButton>
<template #dropdown>
<ElDropdownMenu>
<ElDropdownItem icon="Check" @click="$emit('more', '0')">批量启用</ElDropdownItem>
<ElDropdownItem icon="CircleClose" @click="$emit('more', '1')">
<ElDropdownItem icon="Check" @click="$emit('more', 0)">批量启用</ElDropdownItem>
<ElDropdownItem icon="CircleClose" @click="$emit('more', 1)">
批量停用
</ElDropdownItem>
</ElDropdownMenu>
@@ -112,6 +113,10 @@ interface Props {
permPatch?: string | string[];
/** 批量删除中(按钮 loading,并禁用「更多」) */
deleteLoading?: boolean;
/** 新增按钮 loading(防止重复点击触发多次创建) */
createLoading?: boolean;
/** 「更多」下拉项(启用/停用)loading */
moreLoading?: boolean;
}
const props = withDefaults(defineProps<Props>(), {
@@ -119,6 +124,8 @@ const props = withDefaults(defineProps<Props>(), {
deleteLoading: false,
importLoading: false,
exportLoading: false,
createLoading: false,
moreLoading: false,
});
interface Emits {
@@ -128,10 +135,10 @@ interface Emits {
import: [];
export: [];
delete: [];
more: [value: string];
more: [value: number];
}
defineEmits<Emits>();
const moreDisabled = computed(() => props.removeIds.length === 0 || props.deleteLoading);
const moreDisabled = computed(() => props.removeIds.length === 0 || props.deleteLoading || props.moreLoading);
</script>