refactor(module_system): 重命名配置模块为参数模块

将系统配置模块重命名为参数模块,包括模型、路由、服务层及相关前端代码的修改
更新了数据库表名及字段引用,确保功能一致
This commit is contained in:
zhangtao
2025-09-15 01:05:55 +08:00
parent e159b31e62
commit 693a521c9b
15 changed files with 76 additions and 77 deletions
@@ -47,7 +47,7 @@
<script lang="ts" setup>
import { ref, reactive, onMounted, computed } from 'vue';
import ConfigAPI, { type ConfigTable } from '@/api/system/config';
import ParamsAPI, { type ConfigTable } from '@/api/system/params';
import { useConfigStore } from "@/store";
import { useI18n } from 'vue-i18n';
import { ElMessage, ElMessageBox } from 'element-plus';
@@ -101,7 +101,7 @@ const submitChanges = async () => {
// 并行处理所有修改请求,提高性能
const updatePromises = keysToSubmit.map(key => {
const item = systemConfigs.value[key as keyof typeof systemConfigs.value] || logoConfigs.value[key as keyof typeof logoConfigs.value];
return item && item.id ? ConfigAPI.updateConfig(item.id, { ...item }) : Promise.resolve();
return item && item.id ? ParamsAPI.updateConfig(item.id, { ...item }) : Promise.resolve();
});
await Promise.all(updatePromises);
+7 -7
View File
@@ -190,7 +190,7 @@ defineOptions({
inheritAttrs: false,
});
import ConfigAPI, { ConfigTable, ConfigForm, ConfigPageQuery } from "@/api/system/config";
import ParamsAPI, { ConfigTable, ConfigForm, ConfigPageQuery } from "@/api/system/params";
import { ElMessageBox } from "element-plus";
const queryFormRef = ref();
@@ -284,7 +284,7 @@ async function handleRefresh () {
async function loadingData() {
loading.value = true;
try {
const response = await ConfigAPI.getConfigList(queryFormData);
const response = await ParamsAPI.getConfigList(queryFormData);
pageTableData.value = response.data.data.items;
total.value = response.data.data.total;
}
@@ -344,7 +344,7 @@ async function handleCloseDialog() {
async function handleOpenDialog(type: 'create' | 'update' | 'detail', id?: number) {
dialogVisible.type = type;
if (id) {
const response = await ConfigAPI.getConfigDetail(id);
const response = await ParamsAPI.getConfigDetail(id);
if (type === 'detail') {
dialogVisible.title = "系统配置详情";
Object.assign(detailFormData.value, response.data.data);
@@ -369,7 +369,7 @@ async function handleSubmit() {
const id = formData.id;
if (id) {
try {
await ConfigAPI.updateConfig(id, formData)
await ParamsAPI.updateConfig(id, formData)
dialogVisible.visible = false;
resetForm();
handleResetQuery();
@@ -380,7 +380,7 @@ async function handleSubmit() {
}
} else {
try {
await ConfigAPI.createConfig(formData)
await ParamsAPI.createConfig(formData)
dialogVisible.visible = false;
resetForm();
handleResetQuery();
@@ -403,7 +403,7 @@ async function handleDelete(ids: number[]) {
}).then(async () => {
try {
loading.value = true;
await ConfigAPI.deleteConfig(ids);
await ParamsAPI.deleteConfig(ids);
handleResetQuery();
} catch (error: any) {
console.error(error);
@@ -427,7 +427,7 @@ async function handleExport() {
try {
loading.value = true;
const response = await ConfigAPI.exportConfig(queryFormData);
const response = await ParamsAPI.exportConfig(queryFormData);
const fileData = response.data;
const fileName = decodeURI(response.headers["content-disposition"].split(";")[1].split("=")[1]);
const fileType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8";