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
4 changes: 0 additions & 4 deletions .gitattributes

This file was deleted.

2 changes: 1 addition & 1 deletion backend/app/scripts/data/system_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"id": 3,
"config_name": "网页图标",
"config_key": "sys_web_favicon",
"config_value": "http://service.fastapiadmin.com/api/v1/static/image/favicon.ico",
"config_value": "http://service.fastapiadmin.com/api/v1/static/image/favicon.png",
"config_type": true,
"description": "网页图标",
"creator_id": 1
Expand Down
4 changes: 2 additions & 2 deletions backend/app/scripts/data/system_users.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"mobile": "15382112222",
"email": "admin@qq.com",
"gender": "0",
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
"avatar": "http://service.fastapiadmin.com/api/v1/static/image/avatar.png",
"status": true,
"is_superuser": true,
"last_login": null,
Expand All @@ -23,7 +23,7 @@
"mobile": "15382112121",
"email": "demo@qq.com",
"gender": "1",
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
"avatar": "http://service.fastapiadmin.com/api/v1/static/image/avatar.png",
"status": true,
"is_superuser": false,
"last_login": null,
Expand Down
Binary file removed backend/dev_sql.db
Binary file not shown.
2 changes: 1 addition & 1 deletion backend/env/.env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ROOT_PATH = "/api/v1" # API路由前缀
DEMO_ENABLE = False # 是否启用演示模式

# 数据库配置
DB_DRIVER = "sqlite" # sqlite、mysql
DB_DRIVER = "mysql" # sqlite、mysql

# SQLite配置
SQLITE_DB_NAME = "dev_sql.db"
Expand Down
289 changes: 289 additions & 0 deletions backend/sql/fastapi_vue3_admin.json

Large diffs are not rendered by default.

376 changes: 192 additions & 184 deletions backend/sql/fastapi_vue_admin.sql

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<link rel="icon" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Vue3 + Vite + TypeScript + Element-Plus 的后台管理模板 " />
<meta
Expand Down
14 changes: 13 additions & 1 deletion frontend/src/components/Upload/SingleImageUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ const modelValue = defineModel("modelValue", {
default: () => "",
});

/**
* 定义组件触发的事件
*/
const emit = defineEmits<{
(e: 'success', fileInfo: FileInfo): void;
(e: 'error', error: any): void;
(e: 'input', value: string): void;
(e: 'onSuccess', fileInfo: FileInfo): void;
(e: 'onError', error: any): void;
}>();

/**
* 限制用户上传文件的格式和大小
*/
Expand Down Expand Up @@ -177,7 +188,7 @@ function handlePreview(imagePath: string) {
*/
const onSuccess = (fileInfo: FileInfo) => {
ElMessage.success("上传成功");
modelValue.value = fileInfo.url;
emit('onSuccess', fileInfo); // 触发 onSuccess 事件
};

/**
Expand All @@ -186,6 +197,7 @@ const onSuccess = (fileInfo: FileInfo) => {
const onError = (error: any) => {
console.log("onError");
ElMessage.error("上传失败: " + error.message);
emit('onError', error); // 触发 onError 事件
};

</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ const drawerVisible = ref(false);
* 打开配置中心页面
*/
function handleConfigClick() {
// router.push({ name: "Configinfo" });
drawerVisible.value = true;
}

Expand Down
21 changes: 18 additions & 3 deletions frontend/src/views/dashboard/analysis.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,23 @@
<!-- 右侧图标区域 - PC端 -->
<div class="hidden sm:block">
<div class="flex items-end space-x-6">
<!-- 文档 -->
<div class="flex flex-col items-center">
<div class="font-bold color-#4080ff text-sm flex items-center">
<el-icon class="mr-2px"><Document /></el-icon>
文档
</div>
<div class="mt-3 whitespace-nowrap">
<el-link
href="https://blog.csdn.net/weixin_46768253/article/details/149569141?spm=1001.2014.3001.5502"
>
>
<div class="i-svg:csdn text-lg" />
</el-link>
</div>
</div>
<!-- 仓库 -->
<div>
<div class="flex flex-col items-center">
<div class="font-bold color-#ff9a2e text-sm flex items-center">
<el-icon class="mr-2px">
<Folder />
Expand All @@ -41,7 +56,6 @@
</el-link>
</div>
</div>

</div>
</div>

Expand All @@ -52,13 +66,14 @@
<el-link href="https://gitee.com/tao__tao/fastapi_vue3_admin">
<div class="i-svg:gitee text-lg color-#F76560" />
</el-link>
<el-divider direction="vertical" />
<el-link href="https://github.com/1014TaoTao/fastapi_vue3_admin">
<div class="i-svg:github text-lg color-#4080FF" />
</el-link>
<el-divider direction="vertical" />
<el-link href="https://gitcode.com/qq_36002987/fastapi_vue3_admin">
<div class="i-svg:gitcode text-lg color-#FF9A2E" />
</el-link>

</div>
</div>
</div>
Expand Down
96 changes: 45 additions & 51 deletions frontend/src/views/monitor/job/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -175,50 +175,44 @@

<el-table-column fixed="right" label="操作" min-width="240">
<template #default="scope">
<el-button
type="info"
size="small"
link
icon="document"
@click="handleOpenDialog('detail', scope.row.id)"
>详情</el-button
>
<el-button
type="primary"
size="small"
link
icon="edit"
@click="handleOpenDialog('update', scope.row.id)"
>编辑</el-button
>
<el-button
type="danger"
size="small"
link
icon="delete"
@click="handleDelete([scope.row.id])"
>删除</el-button
>
<el-dropdown trigger="click">
<el-button type="default" size="small" link icon="ArrowDown"
>更多</el-button
<div class="flex">
<el-button
type="info"
size="small"
link
icon="document"
@click="handleOpenDialog('detail', scope.row.id)"
>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item
icon="Check"
@click="handleOption(scope.row, 1)"
>暂停</el-dropdown-item
>
<el-dropdown-item
icon="CircleClose"
@click="handleOption(scope.row, 2)"
>恢复</el-dropdown-item
>
<!-- <el-dropdown-item icon="CircleClose" @click="handleOption(scope.row, 3)">重启</el-dropdown-item> -->
</el-dropdown-menu>
</template>
</el-dropdown>
详情
</el-button>
<el-button
type="primary"
size="small"
link
icon="edit"
@click="handleOpenDialog('update', scope.row.id)"
>
编辑
</el-button>
<el-button
type="danger"
size="small"
link
icon="delete"
@click="handleDelete([scope.row.id])"
>
删除
</el-button>
<el-dropdown trigger="click">
<el-button type="warning" size="small" link icon="ArrowDown">更多</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item icon="Check" @click="handleOption(scope.row, 1)">暂停</el-dropdown-item>
<el-dropdown-item icon="CircleClose" @click="handleOption(scope.row, 2)">恢复</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
Expand Down Expand Up @@ -506,7 +500,6 @@ defineOptions({

import JobAPI, { JobTable, JobForm, JobPageQuery } from "@/api/monitor/job";
import { ElMessage, ElMessageBox } from "element-plus";
import { useDebounceFn } from "@vueuse/core";

import IntervalTab from "@/components/IntervalTab/index.vue";
import "vue3-cron-plus-picker/style.css";
Expand Down Expand Up @@ -598,11 +591,10 @@ const rules = reactive({
executor: [{ required: true, message: "请选择执行器", trigger: "blur" }],
});

// 刷新数据(防抖)
const handleRefresh = useDebounceFn(() => {
loadingData();
ElMessage.success("刷新成功");
}, 1000);
// 列表刷新
async function handleRefresh () {
await loadingData();
};

// 加载表格数据
async function loadingData() {
Expand Down Expand Up @@ -633,8 +625,10 @@ async function handleResetQuery() {

// 重置表单
async function resetForm() {
dataFormRef.value.resetFields();
dataFormRef.value.clearValidate();
if (dataFormRef.value) {
dataFormRef.value.resetFields();
dataFormRef.value.clearValidate();
}
formData.id = undefined;
}

Expand Down
18 changes: 10 additions & 8 deletions frontend/src/views/monitor/online/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<!-- 功能区域 -->
<div class="data-table__toolbar">
<div class="data-table__toolbar--actions">
<el-button type="danger" icon="delete" @click="handleClear()">强退所有</el-button>
<el-button type="danger" icon="delete" @click="handleClear">强退所有</el-button>
</div>
<div class="data-table__toolbar--tools">
<el-tooltip content="刷新">
Expand Down Expand Up @@ -104,7 +104,6 @@ defineOptions({

import OnlineAPI, { type OnlineUserPageQuery, type OnlineUserTable } from "@/api/monitor/online";
import { ElMessage, ElMessageBox } from "element-plus";
import { useDebounceFn } from "@vueuse/core";

const queryFormRef = ref();
const total = ref(0);
Expand Down Expand Up @@ -138,11 +137,10 @@ const queryFormData = reactive<OnlineUserPageQuery>({
ipaddr: undefined
});

// 刷新数据(防抖)
const handleRefresh = useDebounceFn(() => {
loadingData();
ElMessage.success("刷新成功");
}, 1000);
// 列表刷新
async function handleRefresh () {
await loadingData();
};

// 加载表格数据
async function loadingData() {
Expand Down Expand Up @@ -212,8 +210,12 @@ async function handleClear() {
handleResetQuery();
} catch (error: any) {
ElMessage.error(error.message);
} finally {
loading.value = false;
}
})
}).catch(() => {
ElMessage.info('已取消强退');
});
}
onMounted(() => {
loadingData();
Expand Down
16 changes: 8 additions & 8 deletions frontend/src/views/system/config/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ defineOptions({

import ConfigAPI, { ConfigTable, ConfigForm, ConfigPageQuery } from "@/api/system/config";
import { ElMessage, ElMessageBox } from "element-plus";
import { useDebounceFn } from "@vueuse/core";

const queryFormRef = ref();
const dataFormRef = ref();
Expand Down Expand Up @@ -258,11 +257,10 @@ const rules = reactive({
config_type: [{ required: true, message: "请选择系统配置类型", trigger: "blur" }],
});

// 刷新数据(防抖)
const handleRefresh = useDebounceFn(() => {
loadingData();
ElMessage.success("刷新成功");
}, 1000);
// 列表刷新
async function handleRefresh () {
await loadingData();
};

// 加载表格数据
async function loadingData() {
Expand Down Expand Up @@ -295,8 +293,10 @@ async function handleResetQuery() {

// 重置表单
async function resetForm() {
dataFormRef.value.resetFields();
dataFormRef.value.clearValidate();
if (dataFormRef.value) {
dataFormRef.value.resetFields();
dataFormRef.value.clearValidate();
}
formData.id = undefined;
}

Expand Down
16 changes: 8 additions & 8 deletions frontend/src/views/system/dict/components/DataDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ const props = defineProps({

import DictAPI, { DictDataTable, DictDataForm, DictDataPageQuery } from "@/api/system/dict";
import { ElMessage, ElMessageBox } from "element-plus";
import { useDebounceFn } from "@vueuse/core";
import { Check, Close } from '@element-plus/icons-vue'
import { useAppStore } from "@/store/modules/app.store";
import { DeviceEnum } from "@/enums/settings/device.enum";
Expand Down Expand Up @@ -332,11 +331,10 @@ const rules = reactive({
is_default: [{ required: true, message: "请选择是否默认", trigger: "blur" }],
});

// 刷新数据(防抖)
const handleRefresh = useDebounceFn(() => {
loadingData();
ElMessage.success("刷新成功");
}, 1000);
// 列表刷新
async function handleRefresh () {
await loadingData();
};

// 加载表格数据
async function loadingData() {
Expand Down Expand Up @@ -371,8 +369,10 @@ async function handleResetQuery() {

// 重置表单
async function resetForm() {
dataFormRef.value.resetFields();
dataFormRef.value.clearValidate();
if (dataFormRef.value) {
dataFormRef.value.resetFields();
dataFormRef.value.clearValidate();
}
formData.id = undefined;
}

Expand Down
Loading