refactor: ♻️ 代码规范优化

This commit is contained in:
ray
2025-02-12 13:40:27 +08:00
parent e865b33bd9
commit cd72290d06
31 changed files with 113 additions and 120 deletions

View File

@@ -137,8 +137,8 @@ defineOptions({
import ConfigAPI, { ConfigPageVO, ConfigForm, ConfigPageQuery } from "@/api/system/config";
const queryFormRef = ref(ElForm);
const dataFormRef = ref(ElForm);
const queryFormRef = ref();
const dataFormRef = ref();
const loading = ref(false);
const selectIds = ref<number[]>([]);

View File

@@ -160,8 +160,8 @@ defineOptions({
import DeptAPI, { DeptVO, DeptForm, DeptQuery } from "@/api/system/dept";
const queryFormRef = ref(ElForm);
const deptFormRef = ref(ElForm);
const queryFormRef = ref();
const deptFormRef = ref();
const loading = ref(false);
const selectIds = ref<number[]>([]);

View File

@@ -144,8 +144,8 @@ const route = useRoute();
const dictCode = ref(route.query.dictCode as string);
const queryFormRef = ref(ElForm);
const dataFormRef = ref(ElForm);
const queryFormRef = ref();
const dataFormRef = ref();
const loading = ref(false);
const ids = ref<number[]>([]);

View File

@@ -57,7 +57,7 @@
link
size="small"
icon="edit"
@click.stop="handleEditClick(scope.row.id, scope.row.name)"
@click.stop="handleEditClick(scope.row.id)"
>
编辑
</el-button>
@@ -133,8 +133,8 @@ import DictAPI, { DictPageQuery, DictPageVO, DictForm } from "@/api/system/dict"
import router from "@/router";
const queryFormRef = ref(ElForm);
const dataFormRef = ref(ElForm);
const queryFormRef = ref();
const dataFormRef = ref();
const loading = ref(false);
const ids = ref<number[]>([]);
@@ -198,7 +198,7 @@ function handleAddClick() {
*
* @param id 字典ID
*/
function handleEditClick(id: number, name: string) {
function handleEditClick(id: number) {
dialog.visible = true;
dialog.title = "修改字典";
DictAPI.getFormData(id).then((data) => {

View File

@@ -62,7 +62,7 @@ defineOptions({
import LogAPI, { LogPageVO, LogPageQuery } from "@/api/system/log";
const queryFormRef = ref(ElForm);
const queryFormRef = ref();
const loading = ref(false);
const total = ref(0);

View File

@@ -338,8 +338,8 @@ defineOptions({
import MenuAPI, { MenuQuery, MenuForm, MenuVO } from "@/api/system/menu";
import { MenuTypeEnum } from "@/enums/MenuTypeEnum";
const queryFormRef = ref(ElForm);
const menuFormRef = ref(ElForm);
const queryFormRef = ref();
const menuFormRef = ref();
const loading = ref(false);
const dialog = reactive({

View File

@@ -87,7 +87,7 @@ defineOptions({
import NoticeAPI, { NoticePageVO, NoticePageQuery } from "@/api/system/notice";
const queryFormRef = ref(ElForm);
const queryFormRef = ref();
const noticeDetailRef = ref();
const pageData = ref<NoticePageVO[]>([]);

View File

@@ -223,8 +223,8 @@ defineOptions({
import NoticeAPI, { NoticePageVO, NoticeForm, NoticePageQuery } from "@/api/system/notice";
import UserAPI from "@/api/system/user";
const queryFormRef = ref(ElForm);
const dataFormRef = ref(ElForm);
const queryFormRef = ref();
const dataFormRef = ref();
const noticeDetailRef = ref();
const loading = ref(false);

View File

@@ -211,9 +211,9 @@ defineOptions({
import RoleAPI, { RolePageVO, RoleForm, RolePageQuery } from "@/api/system/role";
import MenuAPI from "@/api/system/menu";
const queryFormRef = ref(ElForm);
const roleFormRef = ref(ElForm);
const permTreeRef = ref<InstanceType<typeof ElTree>>();
const queryFormRef = ref();
const roleFormRef = ref();
const permTreeRef = ref();
const loading = ref(false);
const ids = ref<number[]>([]);

View File

@@ -30,7 +30,7 @@ const props = defineProps({
});
const deptList = ref<OptionType[]>(); // 部门列表
const deptTreeRef = ref(ElTree); // 部门树
const deptTreeRef = ref(); // 部门树
const deptName = ref(); // 部门名称
const emits = defineEmits(["node-click"]);

View File

@@ -175,8 +175,9 @@ const handleUpload = async () => {
invalidCount.value = result.invalidCount;
validCount.value = result.validCount;
}
} catch (error) {
ElMessage.error("上传失败");
} catch (error: any) {
console.error(error);
ElMessage.error("上传失败:" + error);
}
};

View File

@@ -249,9 +249,8 @@ defineOptions({
name: "User",
inheritAttrs: false,
});
const queryFormRef = ref(ElForm);
const userFormRef = ref(ElForm);
const queryFormRef = ref();
const userFormRef = ref();
const queryParams = reactive<UserPageQuery>({
pageNum: 1,