Commit 9651eaf68744aae97e994d05a2044e01ff0795c0

Authored by fengtao
1 parent e477159f

fix:pc端 修改视频管理左侧组织显示隐藏

@@ -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:video:post"> 33 <Authority value="api:yt:video:post">
@@ -75,7 +92,7 @@ @@ -75,7 +92,7 @@
75 </template> 92 </template>
76 93
77 <script lang="ts"> 94 <script lang="ts">
78 - import { defineComponent, reactive, nextTick } from 'vue'; 95 + import { defineComponent, reactive, nextTick, ref } from 'vue';
79 import { BasicTable, useTable, TableAction, TableImg } from '/@/components/Table'; 96 import { BasicTable, useTable, TableAction, TableImg } from '/@/components/Table';
80 import { PageWrapper } from '/@/components/Page'; 97 import { PageWrapper } from '/@/components/Page';
81 import { useDrawer } from '/@/components/Drawer'; 98 import { useDrawer } from '/@/components/Drawer';
@@ -87,6 +104,8 @@ @@ -87,6 +104,8 @@
87 import { useModal } from '/@/components/Modal'; 104 import { useModal } from '/@/components/Modal';
88 import { Authority } from '/@/components/Authority'; 105 import { Authority } from '/@/components/Authority';
89 import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; 106 import { useBatchDelete } from '/@/hooks/web/useBatchDelete';
  107 + import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons-vue';
  108 + import { Tooltip } from 'ant-design-vue';
90 109
91 export default defineComponent({ 110 export default defineComponent({
92 components: { 111 components: {
@@ -98,8 +117,12 @@ @@ -98,8 +117,12 @@
98 VideoPreviewModal, 117 VideoPreviewModal,
99 TableImg, 118 TableImg,
100 Authority, 119 Authority,
  120 + MenuFoldOutlined,
  121 + MenuUnfoldOutlined,
  122 + Tooltip,
101 }, 123 },
102 setup() { 124 setup() {
  125 + const isFold = ref(true);
103 const searchInfo = reactive<Recordable>({}); 126 const searchInfo = reactive<Recordable>({});
104 const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); 127 const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo);
105 const [registerModal, { openModal }] = useModal(); 128 const [registerModal, { openModal }] = useModal();
@@ -168,6 +191,13 @@ @@ -168,6 +191,13 @@
168 record, 191 record,
169 }); 192 });
170 }; 193 };
  194 + const changeWidth = (e) => {
  195 + if (e) {
  196 + isFold.value = false;
  197 + } else {
  198 + isFold.value = true;
  199 + }
  200 + };
171 return { 201 return {
172 searchInfo, 202 searchInfo,
173 hasBatchDelete, 203 hasBatchDelete,
@@ -180,6 +210,8 @@ @@ -180,6 +210,8 @@
180 organizationIdTreeRef, 210 organizationIdTreeRef,
181 handleViewVideo, 211 handleViewVideo,
182 registerModal, 212 registerModal,
  213 + changeWidth,
  214 + isFold,
183 }; 215 };
184 }, 216 },
185 }); 217 });