mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-28 15:09:57 +00:00
feat: 统一编码声明为utf-8格式并优化模板生成逻辑
fix(notice): 修正公告状态查询条件为字符串类型 fix(job): 将日志状态显示从布尔值改为字符串类型 fix(dict): 修复字典状态显示与表单提交问题 refactor: 重构模板生成代码结构,移除冗余文件 refactor(schema): 优化字段类型定义和查询参数处理 style: 调整前端样式和布局问题 style: 清理重复注释和未使用代码 docs: 更新示例SQL模板和注释 docs: 完善代码生成模板文档 chore: 移除已废弃的gen_demo视图文件
This commit is contained in:
@@ -158,7 +158,7 @@
|
||||
<el-table-column label="状态" prop="status" min-width="100" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.status === '0' ? 'success' : 'danger'">
|
||||
{{ scope.row.status ? "启用" : "停用" }}
|
||||
{{ scope.row.status === '0' ? "启用" : "停用" }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -349,8 +349,8 @@
|
||||
<el-switch
|
||||
v-model="formData.status"
|
||||
inline-prompt
|
||||
:active-value="true"
|
||||
:inactive-value="false"
|
||||
:active-value="'0'"
|
||||
:inactive-value="'1'"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
@@ -399,6 +399,10 @@ const props = defineProps({
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
dictTypeId: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const drawerVisible = defineModel<boolean>();
|
||||
@@ -454,6 +458,7 @@ const formData = reactive<DictDataForm>({
|
||||
is_default: false,
|
||||
status: '0',
|
||||
description: "",
|
||||
dict_type_id: undefined,
|
||||
});
|
||||
|
||||
// 弹窗状态
|
||||
@@ -536,6 +541,7 @@ const initialFormData: DictDataForm = {
|
||||
is_default: false,
|
||||
status: '0',
|
||||
description: "",
|
||||
dict_type_id: props.dictTypeId,
|
||||
};
|
||||
|
||||
// 重置表单
|
||||
@@ -692,8 +698,6 @@ const curdContentConfig = {
|
||||
cols: exportColumns as any,
|
||||
exportsAction: async (params: any) => {
|
||||
const query: any = { ...params };
|
||||
if (typeof query.status === "string") query.status = query.status === "true";
|
||||
// dict_type 已在查询表单中设置为 props.dictType
|
||||
query.page_no = 1;
|
||||
query.page_size = 1000;
|
||||
const all: any[] = [];
|
||||
|
||||
@@ -265,7 +265,7 @@
|
||||
size="small"
|
||||
link
|
||||
icon="document"
|
||||
@click="handleDictDataDrawer(scope.row.dict_type, scope.row.dict_name)"
|
||||
@click="handleDictDataDrawer(scope.row)"
|
||||
>
|
||||
字典
|
||||
</el-button>
|
||||
@@ -396,6 +396,7 @@
|
||||
v-model="drawerVisible"
|
||||
:dict-type="currentDictType"
|
||||
:dict-label="currentDictLabel"
|
||||
:dict-type-id="currentDictTypeId"
|
||||
/>
|
||||
<ExportModal
|
||||
v-model="exportsDialogVisible"
|
||||
@@ -512,6 +513,10 @@ const currentDictType = ref("");
|
||||
// 添加字典名称变量
|
||||
const currentDictLabel = ref("");
|
||||
|
||||
// 添加字典类型ID变量
|
||||
const currentDictTypeId = ref(1);
|
||||
|
||||
|
||||
// 加载表格数据
|
||||
async function loadingData() {
|
||||
loading.value = true;
|
||||
@@ -680,9 +685,10 @@ async function handleMoreClick(status: string) {
|
||||
}
|
||||
}
|
||||
|
||||
function handleDictDataDrawer(dictType: string, dictLabel: string) {
|
||||
currentDictType.value = dictType;
|
||||
currentDictLabel.value = dictLabel;
|
||||
function handleDictDataDrawer(dictType: DictTable) {
|
||||
currentDictType.value = dictType.dict_type || "";
|
||||
currentDictLabel.value = dictType.dict_name || "";
|
||||
currentDictTypeId.value = dictType.id || 0;
|
||||
drawerVisible.value = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -291,6 +291,9 @@
|
||||
<el-descriptions-item label="登录地点" :span="4">
|
||||
{{ formData.login_location }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="描述" :span="8">
|
||||
{{ formData.description }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="创建人" :span="4">
|
||||
{{ formData.created_by?.name }}
|
||||
</el-descriptions-item>
|
||||
@@ -303,9 +306,6 @@
|
||||
<el-descriptions-item label="更新时间" :span="4">
|
||||
{{ formData.updated_time }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="描述" :span="8">
|
||||
{{ formData.description }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
@clear-click="handleClearSelection"
|
||||
>
|
||||
<template #status="scope">
|
||||
<el-tag :type="scope.row[scope.prop] === true ? 'success' : 'danger'">
|
||||
{{ scope.row[scope.prop] === true ? "启用" : "停用" }}
|
||||
<el-tag :type="scope.row[scope.prop] === '0' ? 'success' : 'danger'">
|
||||
{{ scope.row[scope.prop] === '0' ? "启用" : "停用" }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</table-select>
|
||||
@@ -39,7 +39,7 @@ const selectConfig: ISelectConfig = {
|
||||
type: "select",
|
||||
label: "状态",
|
||||
prop: "status",
|
||||
initialValue: true,
|
||||
initialValue: '0',
|
||||
attrs: {
|
||||
placeholder: "全部",
|
||||
clearable: true,
|
||||
|
||||
Reference in New Issue
Block a user