feat: 统一状态字段类型为字符串并重构基础类型

refactor: 重构前后端状态字段类型从布尔值改为字符串
feat: 新增基础类型定义和通用类型接口
refactor: 移除不必要的时间范围字段并统一使用created_time
style: 更新前端组件以匹配新的字段命名
docs: 更新接口文档和类型定义
This commit is contained in:
zhangtao
2025-11-27 23:47:23 +08:00
parent 2c9d66e2a7
commit 0c86069efa
73 changed files with 590 additions and 754 deletions
+10 -10
View File
@@ -217,18 +217,18 @@
min-width="100"
/>
<el-table-column
v-if="tableColumns.find((col) => col.prop === 'created_at')?.show"
key="created_at"
v-if="tableColumns.find((col) => col.prop === 'created_time')?.show"
key="created_time"
label="创建时间"
prop="created_at"
prop="created_time"
min-width="120"
sortable
/>
<el-table-column
v-if="tableColumns.find((col) => col.prop === 'updated_at')?.show"
key="updated_at"
v-if="tableColumns.find((col) => col.prop === 'updated_time')?.show"
key="updated_time"
label="更新时间"
prop="updated_at"
prop="updated_time"
min-width="120"
sortable
/>
@@ -313,10 +313,10 @@
{{ detailFormData.order }}
</el-descriptions-item>
<el-descriptions-item label="创建时间" :span="2">
{{ detailFormData.created_at }}
{{ detailFormData.created_time }}
</el-descriptions-item>
<el-descriptions-item label="更新时间" :span="2">
{{ detailFormData.updated_at }}
{{ detailFormData.updated_time }}
</el-descriptions-item>
<el-descriptions-item label="描述" :span="4">
{{ detailFormData.description }}
@@ -424,8 +424,8 @@ const tableColumns = ref([
{ prop: "order", label: "排序", show: true },
{ prop: "status", label: "状态", show: true },
{ prop: "description", label: "描述", show: true },
{ prop: "created_at", label: "创建时间", show: true },
{ prop: "updated_at", label: "更新时间", show: true },
{ prop: "created_time", label: "创建时间", show: true },
{ prop: "updated_time", label: "更新时间", show: true },
{ prop: "operation", label: "操作", show: true },
]);
@@ -190,11 +190,11 @@
</template>
</el-table-column>
<el-table-column label="描述" prop="description" min-width="100" show-overflow-tooltip />
<el-table-column label="创建时间" prop="created_at" min-width="200" sortable />
<el-table-column label="更新时间" prop="updated_at" min-width="200" sortable />
<el-table-column label="创建时间" prop="created_time" min-width="200" sortable />
<el-table-column label="更新时间" prop="updated_time" min-width="200" sortable />
<el-table-column label="创建人" prop="creator" min-width="100">
<template #default="scope">
{{ scope.row.creator?.name }}
{{ scope.row.created_by?.name }}
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" min-width="200">
@@ -283,13 +283,13 @@
{{ detailFormData.description }}
</el-descriptions-item>
<el-descriptions-item label="创建人" :span="2">
{{ detailFormData.creator?.name }}
{{ detailFormData.created_by?.name }}
</el-descriptions-item>
<el-descriptions-item label="创建时间" :span="2">
{{ detailFormData.created_at }}
{{ detailFormData.created_time }}
</el-descriptions-item>
<el-descriptions-item label="更新时间" :span="2">
{{ detailFormData.updated_at }}
{{ detailFormData.updated_time }}
</el-descriptions-item>
</el-descriptions>
</template>
@@ -708,8 +708,8 @@ const exportColumns = [
{ prop: "is_default", label: "是否默认" },
{ prop: "status", label: "状态" },
{ prop: "description", label: "描述" },
{ prop: "created_at", label: "创建时间" },
{ prop: "updated_at", label: "更新时间" },
{ prop: "created_time", label: "创建时间" },
{ prop: "updated_time", label: "更新时间" },
];
// 导出配置(用于导出弹窗)
+14 -14
View File
@@ -243,18 +243,18 @@
show-overflow-tooltip
/>
<el-table-column
v-if="tableColumns.find((col) => col.prop === 'created_at')?.show"
key="created_at"
v-if="tableColumns.find((col) => col.prop === 'created_time')?.show"
key="created_time"
label="创建时间"
prop="created_at"
prop="created_time"
min-width="200"
sortable
/>
<el-table-column
v-if="tableColumns.find((col) => col.prop === 'updated_at')?.show"
key="updated_at"
v-if="tableColumns.find((col) => col.prop === 'updated_time')?.show"
key="updated_time"
label="更新时间"
prop="updated_at"
prop="updated_time"
min-width="200"
sortable
/>
@@ -265,7 +265,7 @@
min-width="120"
>
<template #default="scope">
{{ scope.row.creator?.name }}
{{ scope.row.created_by?.name }}
</template>
</el-table-column>
<el-table-column
@@ -354,13 +354,13 @@
{{ detailFormData.description }}
</el-descriptions-item>
<el-descriptions-item label="创建人" :span="2">
{{ detailFormData.creator?.name }}
{{ detailFormData.created_by?.name }}
</el-descriptions-item>
<el-descriptions-item label="创建时间" :span="2">
{{ detailFormData.created_at }}
{{ detailFormData.created_time }}
</el-descriptions-item>
<el-descriptions-item label="更新时间" :span="2">
{{ detailFormData.updated_at }}
{{ detailFormData.updated_time }}
</el-descriptions-item>
</el-descriptions>
</template>
@@ -465,8 +465,8 @@ const tableColumns = ref([
{ prop: "status", label: "状态", show: true },
{ prop: "description", label: "描述", show: true },
{ prop: "creator", label: "创建人", show: true },
{ prop: "created_at", label: "创建时间", show: true },
{ prop: "updated_at", label: "更新时间", show: true },
{ prop: "created_time", label: "创建时间", show: true },
{ prop: "updated_time", label: "更新时间", show: true },
{ prop: "operation", label: "操作", show: true },
]);
@@ -724,8 +724,8 @@ const exportColumns = [
{ prop: "dict_type", label: "字典类型" },
{ prop: "status", label: "状态" },
{ prop: "description", label: "描述" },
{ prop: "created_at", label: "创建时间" },
{ prop: "updated_at", label: "更新时间" },
{ prop: "created_time", label: "创建时间" },
{ prop: "updated_time", label: "更新时间" },
];
// 导出配置(用于导出弹窗)
@@ -195,10 +195,10 @@
/>
<el-table-column label="系统" prop="request_os" min-width="100" />
<el-table-column label="描述" prop="description" min-width="120" show-overflow-tooltip />
<el-table-column label="创建时间" prop="created_at" min-width="200" sortable />
<el-table-column label="创建时间" prop="created_time" min-width="200" sortable />
<el-table-column label="创建人" prop="creator" min-width="120">
<template #default="scope">
{{ scope.row.creator?.name }}
{{ scope.row.created_by?.name }}
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" min-width="150">
@@ -287,13 +287,13 @@
{{ formData.login_location }}
</el-descriptions-item>
<el-descriptions-item label="创建人" :span="4">
{{ formData.creator?.name }}
{{ formData.created_by?.name }}
</el-descriptions-item>
<el-descriptions-item label="创建时间" :span="4">
{{ formData.created_at }}
{{ formData.created_time }}
</el-descriptions-item>
<el-descriptions-item label="更新时间" :span="4">
{{ formData.updated_at }}
{{ formData.updated_time }}
</el-descriptions-item>
<el-descriptions-item label="描述" :span="8">
{{ formData.description }}
@@ -540,8 +540,8 @@ const exportColumns = [
{ prop: "request_browser", label: "浏览器" },
{ prop: "request_os", label: "系统" },
{ prop: "description", label: "描述" },
{ prop: "created_at", label: "创建时间" },
{ prop: "updated_at", label: "更新时间" },
{ prop: "created_time", label: "创建时间" },
{ prop: "updated_time", label: "更新时间" },
];
// 导入/导出配置(用于导出弹窗)
@@ -221,8 +221,8 @@
<el-table-column label="组件路径" prop="component_path" min-width="200" />
<el-table-column label="路由参数" prop="params" min-width="100" />
<el-table-column label="描述" prop="description" min-width="200" />
<el-table-column label="创建时间" prop="created_at" min-width="200" sortable />
<el-table-column label="更新时间" prop="updated_at" min-width="200" sortable />
<el-table-column label="创建时间" prop="created_time" min-width="200" sortable />
<el-table-column label="更新时间" prop="updated_time" min-width="200" sortable />
<el-table-column fixed="right" label="操作" align="center" min-width="260">
<template #default="scope">
@@ -365,10 +365,10 @@
{{ detailFormData.order }}
</el-descriptions-item>
<el-descriptions-item label="创建时间" :span="2">
{{ detailFormData.created_at }}
{{ detailFormData.created_time }}
</el-descriptions-item>
<el-descriptions-item label="更新时间" :span="2">
{{ detailFormData.updated_at }}
{{ detailFormData.updated_time }}
</el-descriptions-item>
<el-descriptions-item label="描述" :span="4">
{{ detailFormData.description }}
@@ -264,16 +264,16 @@
show-overflow-tooltip
/>
<el-table-column
v-if="tableColumns.find((col) => col.prop === 'created_at')?.show"
v-if="tableColumns.find((col) => col.prop === 'created_time')?.show"
label="创建时间"
prop="created_at"
prop="created_time"
min-width="180"
sortable
/>
<el-table-column
v-if="tableColumns.find((col) => col.prop === 'updated_at')?.show"
v-if="tableColumns.find((col) => col.prop === 'updated_time')?.show"
label="更新时间"
prop="updated_at"
prop="updated_time"
min-width="180"
sortable
/>
@@ -284,7 +284,7 @@
min-width="100"
>
<template #default="scope">
{{ scope.row.creator?.name }}
{{ scope.row.created_by?.name }}
</template>
</el-table-column>
@@ -375,13 +375,13 @@
<WangEditor v-model="detailFormData.notice_content" :readonly="true" />
</el-descriptions-item>
<el-descriptions-item label="创建人" :span="2">
{{ detailFormData.creator?.name }}
{{ detailFormData.created_by?.name }}
</el-descriptions-item>
<el-descriptions-item label="创建时间" :span="2">
{{ detailFormData.created_at }}
{{ detailFormData.created_time }}
</el-descriptions-item>
<el-descriptions-item label="更新时间" :span="2">
{{ detailFormData.updated_at }}
{{ detailFormData.updated_time }}
</el-descriptions-item>
</el-descriptions>
</template>
@@ -490,8 +490,8 @@ const tableColumns = ref([
{ prop: "notice_content", label: "内容", show: true },
{ prop: "status", label: "状态", show: true },
{ prop: "description", label: "描述", show: true },
{ prop: "created_at", label: "创建时间", show: true },
{ prop: "updated_at", label: "更新时间", show: true },
{ prop: "created_time", label: "创建时间", show: true },
{ prop: "updated_time", label: "更新时间", show: true },
{ prop: "creator", label: "创建人", show: true },
{ prop: "operation", label: "操作", show: true },
]);
@@ -741,8 +741,8 @@ const exportColumns = [
{ prop: "notice_type", label: "类型" },
{ prop: "notice_content", label: "内容" },
{ prop: "description", label: "描述" },
{ prop: "created_at", label: "创建时间" },
{ prop: "updated_at", label: "更新时间" },
{ prop: "created_time", label: "创建时间" },
{ prop: "updated_time", label: "更新时间" },
];
// 导入/导出配置(用于导出弹窗)
@@ -230,18 +230,18 @@
min-width="120"
/>
<el-table-column
v-if="tableColumns.find((col) => col.prop === 'created_at')?.show"
key="created_at"
v-if="tableColumns.find((col) => col.prop === 'created_time')?.show"
key="created_time"
label="创建时间"
prop="created_at"
prop="created_time"
min-width="200"
sortable
/>
<el-table-column
v-if="tableColumns.find((col) => col.prop === 'updated_at')?.show"
key="updated_at"
v-if="tableColumns.find((col) => col.prop === 'updated_time')?.show"
key="updated_time"
label="更新时间"
prop="updated_at"
prop="updated_time"
min-width="200"
sortable
/>
@@ -252,7 +252,7 @@
min-width="120"
>
<template #default="scope">
{{ scope.row.creator?.name }}
{{ scope.row.created_by?.name }}
</template>
</el-table-column>
<el-table-column
@@ -334,13 +334,13 @@
{{ detailFormData.description }}
</el-descriptions-item>
<el-descriptions-item label="创建人" :span="2">
{{ detailFormData.creator?.name }}
{{ detailFormData.created_by?.name }}
</el-descriptions-item>
<el-descriptions-item label="创建时间" :span="2">
{{ detailFormData.created_at }}
{{ detailFormData.created_time }}
</el-descriptions-item>
<el-descriptions-item label="更新时间" :span="2">
{{ detailFormData.updated_at }}
{{ detailFormData.updated_time }}
</el-descriptions-item>
</el-descriptions>
</template>
@@ -451,8 +451,8 @@ const tableColumns = ref([
{ prop: "config_value", label: "配置值", show: true },
{ prop: "config_type", label: "系统内置", show: true },
{ prop: "description", label: "描述", show: true },
{ prop: "created_at", label: "创建时间", show: true },
{ prop: "updated_at", label: "更新时间", show: true },
{ prop: "created_time", label: "创建时间", show: true },
{ prop: "updated_time", label: "更新时间", show: true },
{ prop: "creator", label: "创建人", show: true },
{ prop: "operation", label: "操作", show: true },
]);
@@ -675,8 +675,8 @@ const exportColumns = [
{ prop: "config_value", label: "配置值" },
{ prop: "config_type", label: "系统内置" },
{ prop: "description", label: "描述" },
{ prop: "created_at", label: "创建时间" },
{ prop: "updated_at", label: "更新时间" },
{ prop: "created_time", label: "创建时间" },
{ prop: "updated_time", label: "更新时间" },
];
// 导入/导出配置(用于导出弹窗)
@@ -235,18 +235,18 @@
min-width="120"
/>
<el-table-column
v-if="tableColumns.find((col) => col.prop === 'created_at')?.show"
key="created_at"
v-if="tableColumns.find((col) => col.prop === 'created_time')?.show"
key="created_time"
label="创建时间"
prop="created_at"
prop="created_time"
min-width="200"
sortable
/>
<el-table-column
v-if="tableColumns.find((col) => col.prop === 'updated_at')?.show"
key="updated_at"
v-if="tableColumns.find((col) => col.prop === 'updated_time')?.show"
key="updated_time"
label="更新时间"
prop="updated_at"
prop="updated_time"
min-width="200"
sortable
/>
@@ -257,7 +257,7 @@
min-width="100"
>
<template #default="scope">
{{ scope.row.creator?.name }}
{{ scope.row.created_by?.name }}
</template>
</el-table-column>
@@ -334,13 +334,13 @@
<el-tag v-else type="danger">停用</el-tag>
</el-descriptions-item>
<el-descriptions-item label="创建人" :span="2">
{{ detailFormData.creator?.name }}
{{ detailFormData.created_by?.name }}
</el-descriptions-item>
<el-descriptions-item label="创建时间" :span="2">
{{ detailFormData.created_at }}
{{ detailFormData.created_time }}
</el-descriptions-item>
<el-descriptions-item label="更新时间" :span="2">
{{ detailFormData.updated_at }}
{{ detailFormData.updated_time }}
</el-descriptions-item>
<el-descriptions-item label="描述" :span="4">
{{ detailFormData.description }}
@@ -443,8 +443,8 @@ const tableColumns = ref([
{ prop: "order", label: "岗位排序", show: true },
{ prop: "status", label: "状态", show: true },
{ prop: "description", label: "描述", show: true },
{ prop: "created_at", label: "创建时间", show: true },
{ prop: "updated_at", label: "更新时间", show: true },
{ prop: "created_time", label: "创建时间", show: true },
{ prop: "updated_time", label: "更新时间", show: true },
{ prop: "creator", label: "创建人", show: true },
{ prop: "operation", label: "操作", show: true },
]);
@@ -680,8 +680,8 @@ const exportColumns = [
{ prop: "order", label: "岗位排序" },
{ prop: "status", label: "状态" },
{ prop: "description", label: "描述" },
{ prop: "created_at", label: "创建时间" },
{ prop: "updated_at", label: "更新时间" },
{ prop: "created_time", label: "创建时间" },
{ prop: "updated_time", label: "更新时间" },
];
// 导入/导出配置(用于导出)
@@ -717,7 +717,7 @@ onMounted(() => {
// 导出字段 const exportColumns = [ { prop: 'name', label: '岗位名称' }, { prop: 'order', label:
'岗位排序' }, { prop: 'status', label: '状态' }, { prop: 'description', label: '描述' }, { prop:
'created_at', label: '创建时间' }, { prop: 'updated_at', label: '更新时间' }, ]; //
'created_time', label: '创建时间' }, { prop: 'updated_time', label: '更新时间' }, ]; //
导入/导出配置(仅用于导出) const curdContentConfig = { permPrefix: 'module_system:position', cols:
exportColumns as any, exportsAction: async (params: any) => { const query: any = { ...params }; if
(typeof query.status === 'string') { query.status = query.status === 'true'; } query.page_no = 1;
+14 -14
View File
@@ -258,18 +258,18 @@
min-width="100"
/>
<el-table-column
v-if="tableColumns.find((col) => col.prop === 'created_at')?.show"
key="created_at"
v-if="tableColumns.find((col) => col.prop === 'created_time')?.show"
key="created_time"
label="创建时间"
prop="created_at"
prop="created_time"
min-width="200"
sortable
/>
<el-table-column
v-if="tableColumns.find((col) => col.prop === 'updated_at')?.show"
key="updated_at"
v-if="tableColumns.find((col) => col.prop === 'updated_time')?.show"
key="updated_time"
label="更新时间"
prop="updated_at"
prop="updated_time"
min-width="200"
sortable
/>
@@ -280,7 +280,7 @@
min-width="120"
>
<template #default="scope">
{{ scope.row.creator?.name }}
{{ scope.row.created_by?.name }}
</template>
</el-table-column>
@@ -395,13 +395,13 @@
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="创建人" :span="2">
{{ detailFormData.creator?.name }}
{{ detailFormData.created_by?.name }}
</el-descriptions-item>
<el-descriptions-item label="创建时间" :span="2">
{{ detailFormData.created_at }}
{{ detailFormData.created_time }}
</el-descriptions-item>
<el-descriptions-item label="更新时间" :span="2">
{{ detailFormData.updated_at }}
{{ detailFormData.updated_time }}
</el-descriptions-item>
<el-descriptions-item label="描述" :span="4">
{{ detailFormData.description }}
@@ -521,8 +521,8 @@ const tableColumns = ref([
{ prop: "code", label: "角色编码", show: true },
{ prop: "status", label: "状态", show: true },
{ prop: "description", label: "描述", show: true },
{ prop: "created_at", label: "创建时间", show: true },
{ prop: "updated_at", label: "更新时间", show: true },
{ prop: "created_time", label: "创建时间", show: true },
{ prop: "updated_time", label: "更新时间", show: true },
{ prop: "creator", label: "创建人", show: true },
{ prop: "operation", label: "操作", show: true },
]);
@@ -777,8 +777,8 @@ const exportColumns = [
{ prop: "order", label: "排序" },
{ prop: "status", label: "状态" },
{ prop: "description", label: "描述" },
{ prop: "created_at", label: "创建时间" },
{ prop: "updated_at", label: "更新时间" },
{ prop: "created_time", label: "创建时间" },
{ prop: "updated_time", label: "更新时间" },
];
// 导入/导出配置
@@ -251,20 +251,20 @@
min-width="140"
/>
<el-table-column
v-if="tableColumns.find((col) => col.prop === 'created_at')?.show"
v-if="tableColumns.find((col) => col.prop === 'created_time')?.show"
label="创建时间"
prop="created_at"
prop="created_time"
min-width="180"
/>
<el-table-column
v-if="tableColumns.find((col) => col.prop === 'updated_at')?.show"
v-if="tableColumns.find((col) => col.prop === 'updated_time')?.show"
label="更新时间"
prop="updated_at"
prop="updated_time"
min-width="180"
/>
<!-- <el-table-column v-if="tableColumns.find((col) => col.prop === 'creator')?.show" label="创建人" prop="creator" min-width="120">
<template #default="scope">
<el-tag>{{ scope.row.creator?.name }}</el-tag>
<el-tag>{{ scope.row.created_by?.name }}</el-tag>
</template>
</el-table-column> -->
<el-table-column
@@ -344,13 +344,13 @@
{{ detailFormData.description }}
</el-descriptions-item>
<!-- <el-descriptions-item label="创建人" :span="2">
{{ detailFormData.creator?.name }}
{{ detailFormData.created_by?.name }}
</el-descriptions-item> -->
<el-descriptions-item label="创建时间" :span="2">
{{ detailFormData.created_at }}
{{ detailFormData.created_time }}
</el-descriptions-item>
<el-descriptions-item label="更新时间" :span="2">
{{ detailFormData.updated_at }}
{{ detailFormData.updated_time }}
</el-descriptions-item>
</el-descriptions>
</template>
@@ -457,8 +457,8 @@ const tableColumns = ref([
{ prop: "code", label: "编码", show: true },
{ prop: "status", label: "状态", show: true },
{ prop: "description", label: "描述", show: true },
{ prop: "created_at", label: "创建时间", show: true },
{ prop: "updated_at", label: "更新时间", show: true },
{ prop: "created_time", label: "创建时间", show: true },
{ prop: "updated_time", label: "更新时间", show: true },
{ prop: "creator", label: "创建人", show: true },
{ prop: "operation", label: "操作", show: true },
]);
@@ -469,8 +469,8 @@ const exportColumns = [
{ prop: "code", label: "编码" },
{ prop: "status", label: "状态" },
{ prop: "description", label: "描述" },
{ prop: "created_at", label: "创建时间" },
{ prop: "updated_at", label: "更新时间" },
{ prop: "created_time", label: "创建时间" },
{ prop: "updated_time", label: "更新时间" },
];
// 导入/导出配置
@@ -99,10 +99,10 @@ interface IUser {
gender?: string;
avatar?: string;
email?: string | null;
status?: boolean;
status?: string;
dept_name?: string;
role_names?: string[];
created_at?: string;
created_time?: string;
}
const selectedUser = ref<IUser>();
function handleConfirm(data: IUser[]) {
@@ -244,11 +244,11 @@
<el-table-column label="手机号" prop="mobile" min-width="160" />
<el-table-column label="邮箱" prop="email" min-width="160" />
<el-table-column label="创建时间" prop="created_at" min-width="200" />
<el-table-column label="更新时间" prop="updated_at" min-width="200" />
<el-table-column label="创建时间" prop="created_time" min-width="200" />
<el-table-column label="更新时间" prop="updated_time" min-width="200" />
<el-table-column label="创建人" prop="creator" min-width="120">
<template #default="scope">
{{ scope.row.creator?.name }}
{{ scope.row.created_by?.name }}
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" min-width="280">
@@ -393,13 +393,13 @@
{{ detailFormData.last_login }}
</el-descriptions-item>
<el-descriptions-item label="创建人" :span="2">
{{ detailFormData.creator?.name }}
{{ detailFormData.created_by?.name }}
</el-descriptions-item>
<el-descriptions-item label="创建时间" :span="2">
{{ detailFormData.created_at }}
{{ detailFormData.created_time }}
</el-descriptions-item>
<el-descriptions-item label="更新时间" :span="2">
{{ detailFormData.updated_at }}
{{ detailFormData.updated_time }}
</el-descriptions-item>
<el-descriptions-item label="描述" :span="4">
{{ detailFormData.description }}
@@ -682,8 +682,8 @@ const exportColumns = [
{ prop: "mobile", label: "手机号" },
{ prop: "is_superuser", label: "是否超管" },
{ prop: "description", label: "描述" },
{ prop: "created_at", label: "创建时间" },
{ prop: "updated_at", label: "更新时间" },
{ prop: "created_time", label: "创建时间" },
{ prop: "updated_time", label: "更新时间" },
];
// 导入/导出配置