Showing
1 changed file
with
33 additions
and
2 deletions
@@ -5,12 +5,29 @@ | @@ -5,12 +5,29 @@ | ||
5 | class="w-1/4 xl:w-1/5" | 5 | class="w-1/4 xl:w-1/5" |
6 | @select="handleSelect" | 6 | @select="handleSelect" |
7 | ref="organizationIdTreeRef" | 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 | <BasicTable | 25 | <BasicTable |
10 | :clickToRowSelect="false" | 26 | :clickToRowSelect="false" |
11 | @register="registerTable" | 27 | @register="registerTable" |
12 | :searchInfo="searchInfo" | 28 | :searchInfo="searchInfo" |
13 | class="w-3/4 xl:w-4/5" | 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 | <template #toolbar> | 32 | <template #toolbar> |
16 | <Authority value="api:yt:admin:addConfiguration"> | 33 | <Authority value="api:yt:admin:addConfiguration"> |
@@ -68,7 +85,7 @@ | @@ -68,7 +85,7 @@ | ||
68 | </template> | 85 | </template> |
69 | 86 | ||
70 | <script lang="ts"> | 87 | <script lang="ts"> |
71 | - import { defineComponent, reactive, nextTick } from 'vue'; | 88 | + import { defineComponent, reactive, nextTick, ref } from 'vue'; |
72 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 89 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
73 | import { PageWrapper } from '/@/components/Page'; | 90 | import { PageWrapper } from '/@/components/Page'; |
74 | import { useDrawer } from '/@/components/Drawer'; | 91 | import { useDrawer } from '/@/components/Drawer'; |
@@ -80,9 +97,10 @@ | @@ -80,9 +97,10 @@ | ||
80 | deleteConfigurationCenter, | 97 | deleteConfigurationCenter, |
81 | } from '/@/api/configuration/center/configurationCenter'; | 98 | } from '/@/api/configuration/center/configurationCenter'; |
82 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; | 99 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; |
83 | - | ||
84 | import { getAppEnvConfig, isDevMode } from '/@/utils/env'; | 100 | import { getAppEnvConfig, isDevMode } from '/@/utils/env'; |
85 | import { Authority } from '/@/components/Authority'; | 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 | export default defineComponent({ | 105 | export default defineComponent({ |
88 | components: { | 106 | components: { |
@@ -92,8 +110,12 @@ | @@ -92,8 +110,12 @@ | ||
92 | TableAction, | 110 | TableAction, |
93 | ContactDrawer, | 111 | ContactDrawer, |
94 | Authority, | 112 | Authority, |
113 | + MenuFoldOutlined, | ||
114 | + MenuUnfoldOutlined, | ||
115 | + Tooltip, | ||
95 | }, | 116 | }, |
96 | setup() { | 117 | setup() { |
118 | + const isFold = ref(true); | ||
97 | const { VITE_GLOB_CONFIGURATION } = getAppEnvConfig(); | 119 | const { VITE_GLOB_CONFIGURATION } = getAppEnvConfig(); |
98 | const isDev = isDevMode(); | 120 | const isDev = isDevMode(); |
99 | const searchInfo = reactive<Recordable>({}); | 121 | const searchInfo = reactive<Recordable>({}); |
@@ -169,6 +191,13 @@ | @@ -169,6 +191,13 @@ | ||
169 | `${VITE_GLOB_CONFIGURATION}/${isDev ? '?dev=1&' : '?'}configurationId=${record!.id}` | 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 | return { | 201 | return { |
173 | searchInfo, | 202 | searchInfo, |
174 | hasBatchDelete, | 203 | hasBatchDelete, |
@@ -181,6 +210,8 @@ | @@ -181,6 +210,8 @@ | ||
181 | registerTable, | 210 | registerTable, |
182 | registerDrawer, | 211 | registerDrawer, |
183 | organizationIdTreeRef, | 212 | organizationIdTreeRef, |
213 | + changeWidth, | ||
214 | + isFold, | ||
184 | }; | 215 | }; |
185 | }, | 216 | }, |
186 | }); | 217 | }); |