Commit 5e2c81994603ba51e00dac29f87c8cced433bd4b

Authored by fengtao
1 parent 4365929b

fix:移除之前写的组织列表显示隐藏

@@ -6,8 +6,6 @@ @@ -6,8 +6,6 @@
6 @select="handleSelect" 6 @select="handleSelect"
7 style="position: relative" 7 style="position: relative"
8 ref="organizationIdTreeRef" 8 ref="organizationIdTreeRef"
9 - :style="[{ width: !isFold ? '0rem' : '20rem' }]"  
10 - :class="[!isFold ? 'w-1/4 xl:w-1/1' : 'w-1/4 xl:w-1/5']"  
11 /> 9 />
12 <BasicTable 10 <BasicTable
13 style="flex: auto" 11 style="flex: auto"
@@ -15,7 +13,6 @@ @@ -15,7 +13,6 @@
15 :searchInfo="searchInfo" 13 :searchInfo="searchInfo"
16 class="w-3/4 xl:w-4/5" 14 class="w-3/4 xl:w-4/5"
17 :clickToRowSelect="false" 15 :clickToRowSelect="false"
18 - :class="[!isFold ? 'w-3/4 xl:w-7/7' : 'w-3/4 xl:w-4/5']"  
19 > 16 >
20 <template #toolbar> 17 <template #toolbar>
21 <Authority value="api:yt:alarm:profile:post"> 18 <Authority value="api:yt:alarm:profile:post">
@@ -86,7 +83,7 @@ @@ -86,7 +83,7 @@
86 </template> 83 </template>
87 84
88 <script lang="ts"> 85 <script lang="ts">
89 - import { defineComponent, reactive, h, nextTick, ref } from 'vue'; 86 + import { defineComponent, reactive, h, nextTick } from 'vue';
90 import { BasicTable, useTable, TableAction } from '/@/components/Table'; 87 import { BasicTable, useTable, TableAction } from '/@/components/Table';
91 import { PageWrapper } from '/@/components/Page'; 88 import { PageWrapper } from '/@/components/Page';
92 import { useDrawer } from '/@/components/Drawer'; 89 import { useDrawer } from '/@/components/Drawer';
@@ -115,8 +112,6 @@ @@ -115,8 +112,6 @@
115 Authority, 112 Authority,
116 }, 113 },
117 setup() { 114 setup() {
118 - const isFold = ref(true);  
119 -  
120 const searchInfo = reactive<Recordable>({}); 115 const searchInfo = reactive<Recordable>({});
121 const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); 116 const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo);
122 // 刷新 117 // 刷新
@@ -244,13 +239,6 @@ @@ -244,13 +239,6 @@
244 reload(); 239 reload();
245 } 240 }
246 }; 241 };
247 - const changeWidth = (e) => {  
248 - if (e) {  
249 - isFold.value = false;  
250 - } else {  
251 - isFold.value = true;  
252 - }  
253 - };  
254 return { 242 return {
255 searchInfo, 243 searchInfo,
256 hasBatchDelete, 244 hasBatchDelete,
@@ -264,8 +252,6 @@ @@ -264,8 +252,6 @@
264 showAlarmContact, 252 showAlarmContact,
265 showMessageMode, 253 showMessageMode,
266 statusChange, 254 statusChange,
267 - changeWidth,  
268 - isFold,  
269 }; 255 };
270 }, 256 },
271 }); 257 });
@@ -2,10 +2,7 @@ @@ -2,10 +2,7 @@
2 <div> 2 <div>
3 <PageWrapper dense contentFullHeight contentClass="flex"> 3 <PageWrapper dense contentFullHeight contentClass="flex">
4 <OrganizationIdTree 4 <OrganizationIdTree
5 - style="position: relative"  
6 class="w-1/4 xl:w-1/5" 5 class="w-1/4 xl:w-1/5"
7 - :style="[{ width: !isFold ? '0rem' : '20rem' }]"  
8 - :class="[!isFold ? 'w-1/4 xl:w-1/1' : 'w-1/4 xl:w-1/5']"  
9 @select="handleSelect" 6 @select="handleSelect"
10 ref="organizationIdTreeRef" 7 ref="organizationIdTreeRef"
11 /> 8 />
@@ -14,7 +11,6 @@ @@ -14,7 +11,6 @@
14 @register="registerTable" 11 @register="registerTable"
15 :searchInfo="searchInfo" 12 :searchInfo="searchInfo"
16 class="w-3/4 xl:w-4/5" 13 class="w-3/4 xl:w-4/5"
17 - :class="[!isFold ? 'w-3/4 xl:w-7/7' : 'w-3/4 xl:w-4/5']"  
18 > 14 >
19 <template #toolbar> 15 <template #toolbar>
20 <Authority value="api:yt:alarmContact:post"> 16 <Authority value="api:yt:alarmContact:post">
@@ -81,7 +77,6 @@ @@ -81,7 +77,6 @@
81 Authority, 77 Authority,
82 }, 78 },
83 setup() { 79 setup() {
84 - const isFold = ref(true);  
85 const searchInfo = reactive<Recordable>({}); 80 const searchInfo = reactive<Recordable>({});
86 const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); 81 const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo);
87 // 表格hooks 82 // 表格hooks
@@ -140,13 +135,6 @@ @@ -140,13 +135,6 @@
140 searchInfo.organizationId = organizationId; 135 searchInfo.organizationId = organizationId;
141 handleSuccess(); 136 handleSuccess();
142 }; 137 };
143 - const changeWidth = (e) => {  
144 - if (e) {  
145 - isFold.value = false;  
146 - } else {  
147 - isFold.value = true;  
148 - }  
149 - };  
150 return { 138 return {
151 searchInfo, 139 searchInfo,
152 hasBatchDelete, 140 hasBatchDelete,
@@ -157,8 +145,6 @@ @@ -157,8 +145,6 @@
157 registerTable, 145 registerTable,
158 registerDrawer, 146 registerDrawer,
159 organizationIdTreeRef, 147 organizationIdTreeRef,
160 - changeWidth,  
161 - isFold,  
162 }; 148 };
163 }, 149 },
164 }); 150 });
@@ -6,8 +6,6 @@ @@ -6,8 +6,6 @@
6 @select="handleSelect" 6 @select="handleSelect"
7 ref="organizationIdTreeRef" 7 ref="organizationIdTreeRef"
8 style="position: relative" 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']"  
11 /> 9 />
12 <BasicTable 10 <BasicTable
13 style="flex: auto" 11 style="flex: auto"
@@ -15,7 +13,6 @@ @@ -15,7 +13,6 @@
15 @register="registerTable" 13 @register="registerTable"
16 :searchInfo="searchInfo" 14 :searchInfo="searchInfo"
17 class="w-3/4 xl:w-4/5" 15 class="w-3/4 xl:w-4/5"
18 - :class="[!isFold ? 'w-3/4 xl:w-7/7' : 'w-3/4 xl:w-4/5']"  
19 > 16 >
20 <template #toolbar> 17 <template #toolbar>
21 <Authority value="api:yt:video:post"> 18 <Authority value="api:yt:video:post">
@@ -80,7 +77,7 @@ @@ -80,7 +77,7 @@
80 </template> 77 </template>
81 78
82 <script lang="ts"> 79 <script lang="ts">
83 - import { defineComponent, reactive, nextTick, ref } from 'vue'; 80 + import { defineComponent, reactive, nextTick } from 'vue';
84 import { BasicTable, useTable, TableAction, TableImg } from '/@/components/Table'; 81 import { BasicTable, useTable, TableAction, TableImg } from '/@/components/Table';
85 import { PageWrapper } from '/@/components/Page'; 82 import { PageWrapper } from '/@/components/Page';
86 import { useDrawer } from '/@/components/Drawer'; 83 import { useDrawer } from '/@/components/Drawer';
@@ -105,7 +102,6 @@ @@ -105,7 +102,6 @@
105 Authority, 102 Authority,
106 }, 103 },
107 setup() { 104 setup() {
108 - const isFold = ref(true);  
109 const searchInfo = reactive<Recordable>({}); 105 const searchInfo = reactive<Recordable>({});
110 const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); 106 const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo);
111 const [registerModal, { openModal }] = useModal(); 107 const [registerModal, { openModal }] = useModal();
@@ -174,13 +170,6 @@ @@ -174,13 +170,6 @@
174 record, 170 record,
175 }); 171 });
176 }; 172 };
177 - const changeWidth = (e) => {  
178 - if (e) {  
179 - isFold.value = false;  
180 - } else {  
181 - isFold.value = true;  
182 - }  
183 - };  
184 return { 173 return {
185 searchInfo, 174 searchInfo,
186 hasBatchDelete, 175 hasBatchDelete,
@@ -193,8 +182,6 @@ @@ -193,8 +182,6 @@
193 organizationIdTreeRef, 182 organizationIdTreeRef,
194 handleViewVideo, 183 handleViewVideo,
195 registerModal, 184 registerModal,
196 - changeWidth,  
197 - isFold,  
198 }; 185 };
199 }, 186 },
200 }); 187 });
1 <template> 1 <template>
2 - <div :style="foldIconStyle">  
3 - <Tooltip v-if="isFold">  
4 - <template #title>隐藏组织</template>  
5 - <MenuFoldOutlined @click="changeWidth(true)" />  
6 - </Tooltip>  
7 - <Tooltip v-else>  
8 - <template #title>打开组织</template>  
9 - <MenuUnfoldOutlined @click="changeWidth(false)" />  
10 - </Tooltip>  
11 - </div>  
12 - <div v-show="isFold" class="bg-white m-4 mr-0 overflow-hidden"> 2 + <div style="position: absolute"> </div>
  3 + <div class="bg-white m-4 mr-0 overflow-hidden">
13 <BasicTree 4 <BasicTree
14 title="组织列表" 5 title="组织列表"
15 toolbar 6 toolbar
@@ -24,39 +15,13 @@ @@ -24,39 +15,13 @@
24 </div> 15 </div>
25 </template> 16 </template>
26 <script lang="ts" setup name="OrganizationIdTree"> 17 <script lang="ts" setup name="OrganizationIdTree">
27 - import { onMounted, ref, unref } from 'vue'; 18 + import { onMounted, ref } from 'vue';
28 import { BasicTree, TreeItem } from '/@/components/Tree'; 19 import { BasicTree, TreeItem } from '/@/components/Tree';
29 import { getOrganizationList } from '/@/api/system/system'; 20 import { getOrganizationList } from '/@/api/system/system';
30 - import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons-vue';  
31 - import { computed } from '@vue/reactivity';  
32 const emit = defineEmits(['select']); 21 const emit = defineEmits(['select']);
33 const treeData = ref<TreeItem[]>([]); 22 const treeData = ref<TreeItem[]>([]);
34 const selectedKeys = ref<string[]>(); 23 const selectedKeys = ref<string[]>();
35 const treeExpandData = ref([]); 24 const treeExpandData = ref([]);
36 -  
37 - const isFold = ref(false);  
38 -  
39 - const changeWidth = (e) => {  
40 - if (e) {  
41 - isFold.value = false;  
42 - } else {  
43 - isFold.value = true;  
44 - }  
45 - };  
46 -  
47 - const foldIconStyle = computed(() => {  
48 - return unref(isFold)  
49 - ? {  
50 - padding: '22px 0 0 16px',  
51 - position: 'absolute',  
52 - left: '85px',  
53 - lineHeight: '24px',  
54 - }  
55 - : {  
56 - padding: '22px 0 0 16px',  
57 - };  
58 - });  
59 -  
60 //获取所有父级id 25 //获取所有父级id
61 function findForAllId(data = [], arr = []) { 26 function findForAllId(data = [], arr = []) {
62 for (const item of data) { 27 for (const item of data) {
@@ -6,8 +6,6 @@ @@ -6,8 +6,6 @@
6 @select="handleSelect" 6 @select="handleSelect"
7 ref="organizationIdTreeRef" 7 ref="organizationIdTreeRef"
8 style="position: relative" 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']"  
11 /> 9 />
12 <BasicTable 10 <BasicTable
13 style="flex: auto" 11 style="flex: auto"
@@ -15,7 +13,6 @@ @@ -15,7 +13,6 @@
15 @register="registerTable" 13 @register="registerTable"
16 :searchInfo="searchInfo" 14 :searchInfo="searchInfo"
17 class="w-3/4 xl:w-4/5" 15 class="w-3/4 xl:w-4/5"
18 - :class="[!isFold ? 'w-3/4 xl:w-7/7' : 'w-3/4 xl:w-4/5']"  
19 > 16 >
20 <template #toolbar> 17 <template #toolbar>
21 <Authority value="api:yt:admin:addConfiguration"> 18 <Authority value="api:yt:admin:addConfiguration">
@@ -73,7 +70,7 @@ @@ -73,7 +70,7 @@
73 </template> 70 </template>
74 71
75 <script lang="ts"> 72 <script lang="ts">
76 - import { defineComponent, reactive, nextTick, ref } from 'vue'; 73 + import { defineComponent, reactive, nextTick } from 'vue';
77 import { BasicTable, useTable, TableAction } from '/@/components/Table'; 74 import { BasicTable, useTable, TableAction } from '/@/components/Table';
78 import { PageWrapper } from '/@/components/Page'; 75 import { PageWrapper } from '/@/components/Page';
79 import { useDrawer } from '/@/components/Drawer'; 76 import { useDrawer } from '/@/components/Drawer';
@@ -98,7 +95,6 @@ @@ -98,7 +95,6 @@
98 Authority, 95 Authority,
99 }, 96 },
100 setup() { 97 setup() {
101 - const isFold = ref(true);  
102 const { VITE_GLOB_CONFIGURATION } = getAppEnvConfig(); 98 const { VITE_GLOB_CONFIGURATION } = getAppEnvConfig();
103 const isDev = isDevMode(); 99 const isDev = isDevMode();
104 const searchInfo = reactive<Recordable>({}); 100 const searchInfo = reactive<Recordable>({});
@@ -174,13 +170,7 @@ @@ -174,13 +170,7 @@
174 `${VITE_GLOB_CONFIGURATION}/${isDev ? '?dev=1&' : '?'}configurationId=${record!.id}` 170 `${VITE_GLOB_CONFIGURATION}/${isDev ? '?dev=1&' : '?'}configurationId=${record!.id}`
175 ); 171 );
176 }; 172 };
177 - const changeWidth = (e) => {  
178 - if (e) {  
179 - isFold.value = false;  
180 - } else {  
181 - isFold.value = true;  
182 - }  
183 - }; 173 +
184 return { 174 return {
185 searchInfo, 175 searchInfo,
186 hasBatchDelete, 176 hasBatchDelete,
@@ -193,8 +183,6 @@ @@ -193,8 +183,6 @@
193 registerTable, 183 registerTable,
194 registerDrawer, 184 registerDrawer,
195 organizationIdTreeRef, 185 organizationIdTreeRef,
196 - changeWidth,  
197 - isFold,  
198 }; 186 };
199 }, 187 },
200 }); 188 });
@@ -4,16 +4,9 @@ @@ -4,16 +4,9 @@
4 <OrganizationIdTree 4 <OrganizationIdTree
5 class="w-1/6 xl:w-1/5" 5 class="w-1/6 xl:w-1/5"
6 @select="handleSelect" 6 @select="handleSelect"
7 - :style="[{ width: !isFold ? '0rem' : '20rem' }]"  
8 - :class="[!isFold ? 'w-1/4 xl:w-1/1' : 'w-1/4 xl:w-1/5']"  
9 ref="organizationIdTreeRef" 7 ref="organizationIdTreeRef"
10 /> 8 />
11 - <BasicTable  
12 - style="flex: auto"  
13 - @register="registerTable"  
14 - class="w-5/6 xl:w-4/5"  
15 - :class="[!isFold ? 'w-423 xl:w-423' : 'w-5/6 xl:w-4/5']"  
16 - > 9 + <BasicTable style="flex: auto" @register="registerTable" class="w-5/6 xl:w-4/5">
17 <template #toolbar> 10 <template #toolbar>
18 <Authority value="api:yt:device:post"> 11 <Authority value="api:yt:device:post">
19 <a-button type="primary" @click="handleCreate" v-if="authBtn(role)"> 12 <a-button type="primary" @click="handleCreate" v-if="authBtn(role)">
@@ -210,8 +203,6 @@ @@ -210,8 +203,6 @@
210 Authority, 203 Authority,
211 }, 204 },
212 setup(_) { 205 setup(_) {
213 - const isFold = ref(true);  
214 -  
215 const { createMessage } = useMessage(); 206 const { createMessage } = useMessage();
216 const go = useGo(); 207 const go = useGo();
217 const searchInfo = reactive<Recordable>({}); 208 const searchInfo = reactive<Recordable>({});
@@ -323,13 +314,6 @@ @@ -323,13 +314,6 @@
323 createMessage.success('复制成功~'); 314 createMessage.success('复制成功~');
324 } 315 }
325 }; 316 };
326 - const changeWidth = (e) => {  
327 - if (e) {  
328 - isFold.value = false;  
329 - } else {  
330 - isFold.value = true;  
331 - }  
332 - };  
333 317
334 return { 318 return {
335 registerTable, 319 registerTable,
@@ -354,8 +338,6 @@ @@ -354,8 +338,6 @@
354 hasBatchDelete, 338 hasBatchDelete,
355 handleDeleteOrBatchDelete, 339 handleDeleteOrBatchDelete,
356 handleReload, 340 handleReload,
357 - changeWidth,  
358 - isFold,  
359 }; 341 };
360 }, 342 },
361 }); 343 });
@@ -5,16 +5,12 @@ @@ -5,16 +5,12 @@
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']"  
11 /> 8 />
12 <BasicTable 9 <BasicTable
13 style="flex: auto" 10 style="flex: auto"
14 :clickToRowSelect="false" 11 :clickToRowSelect="false"
15 @register="registerTable" 12 @register="registerTable"
16 class="w-3/4 xl:w-4/5" 13 class="w-3/4 xl:w-4/5"
17 - :class="[!isFold ? 'w-3/4 xl:w-7/7' : 'w-3/4 xl:w-4/5']"  
18 > 14 >
19 <template #toolbar> 15 <template #toolbar>
20 <Authority value="api:yt:user:post"> 16 <Authority value="api:yt:user:post">
@@ -89,7 +85,7 @@ @@ -89,7 +85,7 @@
89 </div> 85 </div>
90 </template> 86 </template>
91 <script lang="ts"> 87 <script lang="ts">
92 - import { defineComponent, reactive, nextTick, ref } from 'vue'; 88 + import { defineComponent, reactive, nextTick } from 'vue';
93 import { BasicTable, useTable, TableAction } from '/@/components/Table'; 89 import { BasicTable, useTable, TableAction } from '/@/components/Table';
94 import { deleteUser, getAccountList } from '/@/api/system/system'; 90 import { deleteUser, getAccountList } from '/@/api/system/system';
95 import { PageWrapper } from '/@/components/Page'; 91 import { PageWrapper } from '/@/components/Page';
@@ -114,7 +110,6 @@ @@ -114,7 +110,6 @@
114 Authority, 110 Authority,
115 }, 111 },
116 setup() { 112 setup() {
117 - const isFold = ref(true);  
118 const go = useGo(); 113 const go = useGo();
119 const [registerModal, { openModal }] = useModal(); 114 const [registerModal, { openModal }] = useModal();
120 let searchInfo = reactive<Recordable>({}); 115 let searchInfo = reactive<Recordable>({});
@@ -173,13 +168,6 @@ @@ -173,13 +168,6 @@
173 function handleView(record: Recordable) { 168 function handleView(record: Recordable) {
174 go('/system/account_detail/' + record.id); 169 go('/system/account_detail/' + record.id);
175 } 170 }
176 - const changeWidth = (e) => {  
177 - if (e) {  
178 - isFold.value = false;  
179 - } else {  
180 - isFold.value = true;  
181 - }  
182 - };  
183 171
184 return { 172 return {
185 registerTable, 173 registerTable,
@@ -192,8 +180,6 @@ @@ -192,8 +180,6 @@
192 organizationIdTreeRef, 180 organizationIdTreeRef,
193 hasBatchDelete, 181 hasBatchDelete,
194 handleDeleteOrBatchDelete, 182 handleDeleteOrBatchDelete,
195 - changeWidth,  
196 - isFold,  
197 }; 183 };
198 }, 184 },
199 }); 185 });