WholeProcessPlatform/frontend/src/components/RightDrawer/index.vue

113 lines
2.6 KiB
Vue
Raw Normal View History

2026-03-30 11:05:33 +08:00
<!-- SidePanelItem.vue -->
<template>
<div class="rightContentDrawer">
2026-04-02 08:56:49 +08:00
<div @click="handleToggle" class="drawerController1" v-if="!uiStore.drawerOpen">
<img src="../../assets/components/arrow-left.png" alt="" />
2026-03-30 11:05:33 +08:00
</div>
2026-04-02 08:56:49 +08:00
<!-- 使用 Vue Transition 组件控制动画 -->
<transition name="drawer-slide">
2026-04-02 08:56:49 +08:00
<a-drawer
:get-container="false"
2026-04-02 08:56:49 +08:00
:style="{ position: 'relative' }"
v-model:open="uiStore.drawerOpen"
:mask="false"
placement="right"
width="450"
:closable="false"
2026-04-02 08:56:49 +08:00
:headerStyle="{ color: '#FAFCFE' }"
>
<div @click="handleToggle" class="drawerController">
2026-04-02 08:56:49 +08:00
<img src="../../assets/components/arrow-right.png" alt="" />
</div>
<div style="padding:16px 8px 0;" class="text_she">
<slot />
</div>
</a-drawer>
</transition>
2026-03-30 11:05:33 +08:00
</div>
</template>
2026-03-27 15:52:43 +08:00
2026-03-30 11:05:33 +08:00
<script setup>
2026-04-02 08:56:49 +08:00
import { ref, defineOptions, watch } from "vue";
import { useUiStore } from "@/store/modules/ui";
import { set } from "nprogress";
2026-03-27 15:52:43 +08:00
// 定义组件名 (便于调试和递归)
2026-03-30 11:05:33 +08:00
defineOptions({
2026-04-02 08:56:49 +08:00
name: "rightDrawer",
2026-03-30 11:05:33 +08:00
});
2026-04-02 08:56:49 +08:00
const uiStore = useUiStore();
const handleToggle = () => {
2026-04-02 08:56:49 +08:00
uiStore.toggleDrawer()
};
2026-03-27 15:52:43 +08:00
</script>
2026-03-30 11:05:33 +08:00
<style lang="scss">
2026-03-27 15:52:43 +08:00
.rightContentDrawer {
height: 100%;
2026-03-30 11:05:33 +08:00
position: relative;
box-sizing: border-box;
2026-03-27 15:52:43 +08:00
2026-03-30 11:05:33 +08:00
.drawerController1 {
width: 18px;
position: absolute;
right: -2px;
2026-03-30 11:05:33 +08:00
cursor: pointer;
z-index: 10;
height: 88px;
line-height: 88px;
top: 45%;
vertical-align: middle;
background-image: url(../../assets/components/bg-toggle.e1dabcf3.svg);
background-repeat: no-repeat;
display: flex;
justify-content: center;
align-items: center;
}
}
2026-03-27 15:52:43 +08:00
2026-03-30 11:05:33 +08:00
.ant-drawer {
margin: 5px 0px;
2026-04-02 08:56:49 +08:00
.ant-drawer-content {
overflow: visible;
}
2026-04-02 08:56:49 +08:00
2026-03-30 11:05:33 +08:00
.ant-drawer-content-wrapper {
border: 2px solid #c5d6e2 !important;
box-shadow: 3px 3px 3px 9px #e5edf3 !important;
}
2026-03-27 15:52:43 +08:00
2026-03-30 11:05:33 +08:00
.ant-drawer-body {
padding: 0px !important;
}
}
2026-03-27 15:52:43 +08:00
2026-03-30 11:05:33 +08:00
.drawerController {
width: 18px;
position: absolute;
right: 10px;
cursor: pointer;
z-index: 10;
height: 88px;
line-height: 88px;
top: 45%;
left: -18px;
vertical-align: middle;
background-image: url(../../assets/components/bg-toggle.e1dabcf3.svg);
background-repeat: no-repeat;
display: flex;
2026-04-02 08:56:49 +08:00
justify-content: center;
align-items: center;
2026-03-30 11:05:33 +08:00
}
.text_she{
font-size: 14px;
color:#262626;
font-variant: tabular-nums;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
}
2026-04-02 08:56:49 +08:00
</style>