Showing
1 changed file
with
33 additions
and
2 deletions
... | ... | @@ -5,12 +5,29 @@ |
5 | 5 | class="w-1/4 xl:w-1/5" |
6 | 6 | @select="handleSelect" |
7 | 7 | ref="organizationIdTreeRef" |
8 | + style="position: relative" | |
9 | + :style="[{ width: !isFold ? '0rem' : '20rem' }]" | |
10 | + :class="[!isFold ? 'w-1/4 xl:w-1/1' : 'w-1/4 xl:w-1/5']" | |
8 | 11 | /> |
12 | + <div | |
13 | + style="position: absolute; top: 1.48rem; left: 6.5rem; cursor: pointer" | |
14 | + :style="[{ left: !isFold ? '0.5rem' : '6.5rem' }, { top: !isFold ? '0.8rem' : '1.48rem' }]" | |
15 | + > | |
16 | + <Tooltip v-if="isFold"> | |
17 | + <template #title>隐藏组织</template> | |
18 | + <MenuFoldOutlined @click="changeWidth(true)" /> | |
19 | + </Tooltip> | |
20 | + <Tooltip v-else> | |
21 | + <template #title>打开组织</template> | |
22 | + <MenuUnfoldOutlined @click="changeWidth(false)" /> | |
23 | + </Tooltip> | |
24 | + </div> | |
9 | 25 | <BasicTable |
10 | 26 | :clickToRowSelect="false" |
11 | 27 | @register="registerTable" |
12 | 28 | :searchInfo="searchInfo" |
13 | 29 | class="w-3/4 xl:w-4/5" |
30 | + :class="[!isFold ? 'w-3/4 xl:w-7/7' : 'w-3/4 xl:w-4/5']" | |
14 | 31 | > |
15 | 32 | <template #toolbar> |
16 | 33 | <Authority value="api:yt:admin:addConfiguration"> |
... | ... | @@ -68,7 +85,7 @@ |
68 | 85 | </template> |
69 | 86 | |
70 | 87 | <script lang="ts"> |
71 | - import { defineComponent, reactive, nextTick } from 'vue'; | |
88 | + import { defineComponent, reactive, nextTick, ref } from 'vue'; | |
72 | 89 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
73 | 90 | import { PageWrapper } from '/@/components/Page'; |
74 | 91 | import { useDrawer } from '/@/components/Drawer'; |
... | ... | @@ -80,9 +97,10 @@ |
80 | 97 | deleteConfigurationCenter, |
81 | 98 | } from '/@/api/configuration/center/configurationCenter'; |
82 | 99 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; |
83 | - | |
84 | 100 | import { getAppEnvConfig, isDevMode } from '/@/utils/env'; |
85 | 101 | import { Authority } from '/@/components/Authority'; |
102 | + import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons-vue'; | |
103 | + import { Tooltip } from 'ant-design-vue'; | |
86 | 104 | |
87 | 105 | export default defineComponent({ |
88 | 106 | components: { |
... | ... | @@ -92,8 +110,12 @@ |
92 | 110 | TableAction, |
93 | 111 | ContactDrawer, |
94 | 112 | Authority, |
113 | + MenuFoldOutlined, | |
114 | + MenuUnfoldOutlined, | |
115 | + Tooltip, | |
95 | 116 | }, |
96 | 117 | setup() { |
118 | + const isFold = ref(true); | |
97 | 119 | const { VITE_GLOB_CONFIGURATION } = getAppEnvConfig(); |
98 | 120 | const isDev = isDevMode(); |
99 | 121 | const searchInfo = reactive<Recordable>({}); |
... | ... | @@ -169,6 +191,13 @@ |
169 | 191 | `${VITE_GLOB_CONFIGURATION}/${isDev ? '?dev=1&' : '?'}configurationId=${record!.id}` |
170 | 192 | ); |
171 | 193 | }; |
194 | + const changeWidth = (e) => { | |
195 | + if (e) { | |
196 | + isFold.value = false; | |
197 | + } else { | |
198 | + isFold.value = true; | |
199 | + } | |
200 | + }; | |
172 | 201 | return { |
173 | 202 | searchInfo, |
174 | 203 | hasBatchDelete, |
... | ... | @@ -181,6 +210,8 @@ |
181 | 210 | registerTable, |
182 | 211 | registerDrawer, |
183 | 212 | organizationIdTreeRef, |
213 | + changeWidth, | |
214 | + isFold, | |
184 | 215 | }; |
185 | 216 | }, |
186 | 217 | }); | ... | ... |