refactor: ♻️ 抽屉适配移动端自适应调整宽度

This commit is contained in:
Ray.Hao
2025-03-24 23:19:35 +08:00
parent 0d51da3819
commit 2f2c3d6b84
3 changed files with 33 additions and 7 deletions

View File

@@ -162,6 +162,7 @@
v-model="dialog.visible"
:title="dialog.title"
append-to-body
:size="drawerSize"
@close="handleCloseDialog"
>
<el-form ref="userFormRef" :model="formData" :rules="rules" label-width="80px">
@@ -237,8 +238,10 @@
</template>
<script setup lang="ts">
import UserAPI, { UserForm, UserPageQuery, UserPageVO } from "@/api/system/user.api";
import { useAppStore } from "@/store/modules/app.store";
import { DeviceEnum } from "@/enums/settings/device.enum";
import UserAPI, { UserForm, UserPageQuery, UserPageVO } from "@/api/system/user.api";
import DeptAPI from "@/api/system/dept.api";
import RoleAPI from "@/api/system/role.api";
@@ -249,6 +252,9 @@ defineOptions({
name: "User",
inheritAttrs: false,
});
const appStore = useAppStore();
const queryFormRef = ref();
const userFormRef = ref();
@@ -265,6 +271,7 @@ const dialog = reactive({
visible: false,
title: "新增用户",
});
const drawerSize = computed(() => (appStore.device === DeviceEnum.DESKTOP ? "600px" : "90%"));
const formData = reactive<UserForm>({
status: 1,