右侧抽屉组件添加
This commit is contained in:
parent
11ccb66ff7
commit
4531d76f21
BIN
frontend/src/assets/components/arrow-down.png
Normal file
BIN
frontend/src/assets/components/arrow-down.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 238 B |
BIN
frontend/src/assets/components/arrow-left.png
Normal file
BIN
frontend/src/assets/components/arrow-left.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 205 B |
BIN
frontend/src/assets/components/arrow-right.png
Normal file
BIN
frontend/src/assets/components/arrow-right.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 215 B |
BIN
frontend/src/assets/components/arrow-up.png
Normal file
BIN
frontend/src/assets/components/arrow-up.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 231 B |
1
frontend/src/assets/components/bg-toggle.e1dabcf3.svg
Normal file
1
frontend/src/assets/components/bg-toggle.e1dabcf3.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg width="16" height="88" xmlns="http://www.w3.org/2000/svg"><path d="M16 0a22.397 22.397 0 0 1-8.71 12.793l-2.265 1.618A12 12 0 0 0 0 24.175v39.65a12 12 0 0 0 5.025 9.764l2.265 1.618c4.2 3 7.23 7.356 8.588 12.325L16 88V0Z" fill="#E5EDF3" fill-rule="evenodd"/></svg>
|
||||||
|
After Width: | Height: | Size: 268 B |
1
frontend/src/assets/components/fgx.svg
Normal file
1
frontend/src/assets/components/fgx.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 24 KiB |
@ -1,48 +1,83 @@
|
|||||||
<script setup lang="ts">
|
<!-- SidePanelItem.vue -->
|
||||||
import { ref } from "vue";
|
<template>
|
||||||
import { RightOutlined, LeftOutlined } from "@ant-design/icons-vue";
|
<div class="rightContentDrawer">
|
||||||
|
<div @click="drawerOpen = !drawerOpen" class="drawerController1"
|
||||||
|
>
|
||||||
|
<img src="../../assets/components/arrow-left.png" alt="">
|
||||||
|
</div>
|
||||||
|
<a-drawer :get-container="false"
|
||||||
|
:style="{ position: 'absolute' }" v-model:open="drawerOpen" :mask="false" placement="right" width="450" :closable="false"
|
||||||
|
@after-open-change="afterOpenChange" :headerStyle="{ color: '#FAFCFE' }">
|
||||||
|
<div @click="drawerOpen = !drawerOpen" class="drawerController">
|
||||||
|
<img src="../../assets/components/arrow-right.png" alt="">
|
||||||
|
</div>
|
||||||
|
<div style="padding:16px 16px 0">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
</a-drawer>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
const open = ref(true);
|
<script setup>
|
||||||
|
import { ref, defineOptions, watch } from 'vue';
|
||||||
|
|
||||||
// 切换抽屉状态
|
// 定义组件名(便于调试和递归)
|
||||||
const toggleDrawer = () => {
|
defineOptions({
|
||||||
open.value = !open.value;
|
name: 'rightDrawer'
|
||||||
};
|
});
|
||||||
|
const drawerOpen = ref(true);
|
||||||
|
const shujv = ref('123456789');
|
||||||
|
// const afterOpenChange = (open) => {
|
||||||
|
// if (!open) {
|
||||||
|
// drawerOpen.value = false;
|
||||||
|
// }
|
||||||
|
// };
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<style lang="scss">
|
||||||
<!-- <div class="rightContentDrawer"> -->
|
|
||||||
<!-- 保持原有的 drawer 参数不变 -->
|
|
||||||
<a-drawer
|
|
||||||
:mask="false"
|
|
||||||
placement="right"
|
|
||||||
:open="true"
|
|
||||||
width="450"
|
|
||||||
:closable="false"
|
|
||||||
:headerStyle="{ color: '#FAFCFE' }"
|
|
||||||
:rootClassName="{ 'drawer-collapsed': !open }"
|
|
||||||
:getContainer="false"
|
|
||||||
:destroyOnClose="false"
|
|
||||||
>
|
|
||||||
<!-- 箭头按钮 - 始终显示在左侧中间位置 -->
|
|
||||||
<div class="toggle-button" :class="{ collapsed: !open }" @click="toggleDrawer">
|
|
||||||
<span class="arrow-icon" v-if="!open">
|
|
||||||
<LeftOutlined />
|
|
||||||
</span>
|
|
||||||
<span class="arrow-icon" v-else>
|
|
||||||
<RightOutlined />
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<slot />
|
|
||||||
</a-drawer>
|
|
||||||
<!-- </div> -->
|
|
||||||
</template>
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.rightContentDrawer {
|
.rightContentDrawer {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
// 修复收起时布局塌陷问题
|
||||||
|
flex-shrink: 0;
|
||||||
|
|
||||||
|
.drawerController1 {
|
||||||
|
width: 18px;
|
||||||
|
position: absolute;
|
||||||
|
right: 0px;
|
||||||
|
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;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toggle-button {
|
}
|
||||||
|
|
||||||
|
.ant-drawer {
|
||||||
|
margin: 5px 0px;
|
||||||
|
.ant-drawer-content{
|
||||||
|
overflow:visible;
|
||||||
|
}
|
||||||
|
.ant-drawer-content-wrapper {
|
||||||
|
border: 2px solid #c5d6e2 !important;
|
||||||
|
box-shadow: 3px 3px 3px 9px #e5edf3 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-drawer-body {
|
||||||
|
padding: 0px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawerController {
|
||||||
width: 18px;
|
width: 18px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 10px;
|
right: 10px;
|
||||||
@ -53,31 +88,10 @@ const toggleDrawer = () => {
|
|||||||
top: 45%;
|
top: 45%;
|
||||||
left: -18px;
|
left: -18px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
background-image: url('@/assets/bg-toggle.svg');
|
background-image: url(../../assets/components/bg-toggle.e1dabcf3.svg);
|
||||||
background-size: 100% 100%;
|
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
|
|
||||||
&.collapsed {
|
|
||||||
left: -20px;
|
|
||||||
border-radius: 0 4px 4px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.arrow-icon {
|
|
||||||
color: rgb(81, 131, 169);
|
|
||||||
font-size: 18px;
|
|
||||||
transition: transform 0.3s ease;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.ant-drawer) {
|
|
||||||
|
|
||||||
.ant-drawer-content-wrapper {
|
|
||||||
right: 0;
|
|
||||||
bottom: 0px;
|
|
||||||
border: 2px solid #c5d6e2 !important;
|
|
||||||
box-shadow: 3px 3px 3px 9px #e5edf3 !important;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
justify-content: center;
|
||||||
}
|
align-items: center;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
88
frontend/src/modules/rightDrawer/index.vue
Normal file
88
frontend/src/modules/rightDrawer/index.vue
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
<!-- SidePanelItem.vue -->
|
||||||
|
<template>
|
||||||
|
<div class="rightContentDrawer">
|
||||||
|
<div @click="drawerOpen = !drawerOpen" class="drawerController1"
|
||||||
|
:style="drawerOpen ? 'display:none' : 'display:block'">
|
||||||
|
<img src="../../assets/components/arrow-left.png" alt="">
|
||||||
|
</div>
|
||||||
|
<a-drawer v-model:open="drawerOpen" :mask="false" placement="right" width="450" :closable="false"
|
||||||
|
@after-open-change="afterOpenChange" :headerStyle="{ color: '#FAFCFE' }">
|
||||||
|
<div @click="drawerOpen = !drawerOpen" class="drawerController">
|
||||||
|
<img src="../../assets/components/arrow-right.png" alt="">
|
||||||
|
</div>
|
||||||
|
<div style="padding:16px 16px 0">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
</a-drawer>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, defineOptions, watch } from 'vue';
|
||||||
|
|
||||||
|
// 定义组件名(便于调试和递归)
|
||||||
|
defineOptions({
|
||||||
|
name: 'rightDrawer'
|
||||||
|
});
|
||||||
|
const drawerOpen = ref(true);
|
||||||
|
const shujv = ref('123456789');
|
||||||
|
// const afterOpenChange = (open) => {
|
||||||
|
// if (!open) {
|
||||||
|
// drawerOpen.value = false;
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
.rightContentDrawer {
|
||||||
|
height: 100%;
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
// 修复收起时布局塌陷问题
|
||||||
|
flex-shrink: 0;
|
||||||
|
|
||||||
|
.drawerController1 {
|
||||||
|
width: 18px;
|
||||||
|
position: absolute;
|
||||||
|
right: 0px;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-drawer {
|
||||||
|
margin: 5px 0px;
|
||||||
|
|
||||||
|
.ant-drawer-content-wrapper {
|
||||||
|
border: 2px solid #c5d6e2 !important;
|
||||||
|
box-shadow: 3px 3px 3px 9px #e5edf3 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-drawer-body {
|
||||||
|
padding: 0px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.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;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -11,7 +11,7 @@ import RightDrawer from "@/components/RightDrawer/index.vue";
|
|||||||
</div>
|
</div>
|
||||||
<div class="rightContent">
|
<div class="rightContent">
|
||||||
<RightDrawer>
|
<RightDrawer>
|
||||||
789231
|
<!-- 789231 -->
|
||||||
<!-- <SidePanel title={currentItem ? currentItem.basename : ""}>
|
<!-- <SidePanel title={currentItem ? currentItem.basename : ""}>
|
||||||
<JidiInfoMod />
|
<JidiInfoMod />
|
||||||
<ShuidianhuangjingjieruMod />
|
<ShuidianhuangjingjieruMod />
|
||||||
@ -21,3 +21,12 @@ import RightDrawer from "@/components/RightDrawer/index.vue";
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<style lang="scss">
|
||||||
|
.moduleContent{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
.rightContent{
|
||||||
|
height: 85vh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user