Commit 71245d2c76fd89736d7945b8d81b27d119c209f2

Authored by xp.Huang
2 parents 07334e5e 2894acd4

Merge branch 'f-dev' into 'main'

fix:修改左侧组织显隐

See merge request huang/yun-teng-iot-front!238
@@ -4,13 +4,30 @@ @@ -4,13 +4,30 @@
4 <OrganizationIdTree 4 <OrganizationIdTree
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 + style="position: relative"
7 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']"
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 @register="registerTable" 26 @register="registerTable"
11 :searchInfo="searchInfo" 27 :searchInfo="searchInfo"
12 class="w-3/4 xl:w-4/5" 28 class="w-3/4 xl:w-4/5"
13 :clickToRowSelect="false" 29 :clickToRowSelect="false"
  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:alarm:profile:post"> 33 <Authority value="api:yt:alarm:profile:post">
@@ -81,7 +98,7 @@ @@ -81,7 +98,7 @@
81 </template> 98 </template>
82 99
83 <script lang="ts"> 100 <script lang="ts">
84 - import { defineComponent, reactive, h, nextTick } from 'vue'; 101 + import { defineComponent, reactive, h, nextTick, ref } from 'vue';
85 import { BasicTable, useTable, TableAction } from '/@/components/Table'; 102 import { BasicTable, useTable, TableAction } from '/@/components/Table';
86 import { PageWrapper } from '/@/components/Page'; 103 import { PageWrapper } from '/@/components/Page';
87 import { useDrawer } from '/@/components/Drawer'; 104 import { useDrawer } from '/@/components/Drawer';
@@ -89,7 +106,7 @@ @@ -89,7 +106,7 @@
89 import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/organizationIdTree'; 106 import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/organizationIdTree';
90 import { deleteAlarmConfig, queryAlarmConfig } from '/@/api/alarm/config/alarmConfig'; 107 import { deleteAlarmConfig, queryAlarmConfig } from '/@/api/alarm/config/alarmConfig';
91 import { searchFormSchema, columns } from './config.data'; 108 import { searchFormSchema, columns } from './config.data';
92 - import { Modal } from 'ant-design-vue'; 109 + import { Modal, Tooltip } from 'ant-design-vue';
93 import { JsonPreview } from '/@/components/CodeEditor'; 110 import { JsonPreview } from '/@/components/CodeEditor';
94 import { findDictItemByCode } from '/@/api/system/dict'; 111 import { findDictItemByCode } from '/@/api/system/dict';
95 import { alarmContactGetPage } from '/@/api/device/deviceConfigApi'; 112 import { alarmContactGetPage } from '/@/api/device/deviceConfigApi';
@@ -98,6 +115,7 @@ @@ -98,6 +115,7 @@
98 import { putAlarmConfigStatus } from '/@/api/alarm/config/alarmConfig'; 115 import { putAlarmConfigStatus } from '/@/api/alarm/config/alarmConfig';
99 import { useMessage } from '/@/hooks/web/useMessage'; 116 import { useMessage } from '/@/hooks/web/useMessage';
100 import { Authority } from '/@/components/Authority'; 117 import { Authority } from '/@/components/Authority';
  118 + import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons-vue';
101 119
102 export default defineComponent({ 120 export default defineComponent({
103 components: { 121 components: {
@@ -108,8 +126,13 @@ @@ -108,8 +126,13 @@
108 ContactDrawer, 126 ContactDrawer,
109 Switch, 127 Switch,
110 Authority, 128 Authority,
  129 + MenuFoldOutlined,
  130 + MenuUnfoldOutlined,
  131 + Tooltip,
111 }, 132 },
112 setup() { 133 setup() {
  134 + const isFold = ref(true);
  135 +
113 const searchInfo = reactive<Recordable>({}); 136 const searchInfo = reactive<Recordable>({});
114 const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); 137 const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo);
115 // 刷新 138 // 刷新
@@ -237,6 +260,13 @@ @@ -237,6 +260,13 @@
237 reload(); 260 reload();
238 } 261 }
239 }; 262 };
  263 + const changeWidth = (e) => {
  264 + if (e) {
  265 + isFold.value = false;
  266 + } else {
  267 + isFold.value = true;
  268 + }
  269 + };
240 return { 270 return {
241 searchInfo, 271 searchInfo,
242 hasBatchDelete, 272 hasBatchDelete,
@@ -250,6 +280,8 @@ @@ -250,6 +280,8 @@
250 showAlarmContact, 280 showAlarmContact,
251 showMessageMode, 281 showMessageMode,
252 statusChange, 282 statusChange,
  283 + changeWidth,
  284 + isFold,
253 }; 285 };
254 }, 286 },
255 }); 287 });
@@ -2,11 +2,32 @@ @@ -2,11 +2,32 @@
2 <div> 2 <div>
3 <PageWrapper dense contentFullHeight contentClass="flex"> 3 <PageWrapper dense contentFullHeight contentClass="flex">
4 <OrganizationIdTree 4 <OrganizationIdTree
  5 + style="position: relative"
5 class="w-1/4 xl:w-1/5" 6 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']"
6 @select="handleSelect" 9 @select="handleSelect"
7 ref="organizationIdTreeRef" 10 ref="organizationIdTreeRef"
8 /> 11 />
9 - <BasicTable @register="registerTable" :searchInfo="searchInfo" class="w-3/4 xl:w-4/5"> 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>
  25 + <BasicTable
  26 + @register="registerTable"
  27 + :searchInfo="searchInfo"
  28 + class="w-3/4 xl:w-4/5"
  29 + :class="[!isFold ? 'w-3/4 xl:w-7/7' : 'w-3/4 xl:w-4/5']"
  30 + >
10 <template #toolbar> 31 <template #toolbar>
11 <Authority value="api:yt:alarmContact:post"> 32 <Authority value="api:yt:alarmContact:post">
12 <a-button type="primary" @click="handleCreateOrEdit(null)"> 新增告警联系人 </a-button> 33 <a-button type="primary" @click="handleCreateOrEdit(null)"> 新增告警联系人 </a-button>
@@ -51,17 +72,18 @@ @@ -51,17 +72,18 @@
51 </template> 72 </template>
52 73
53 <script lang="ts"> 74 <script lang="ts">
54 - import { defineComponent, reactive, nextTick } from 'vue'; 75 + import { defineComponent, reactive, nextTick, ref } from 'vue';
55 import { BasicTable, useTable, TableAction } from '/@/components/Table'; 76 import { BasicTable, useTable, TableAction } from '/@/components/Table';
56 import { PageWrapper } from '/@/components/Page'; 77 import { PageWrapper } from '/@/components/Page';
57 import { useDrawer } from '/@/components/Drawer'; 78 import { useDrawer } from '/@/components/Drawer';
58 import ContactDrawer from './ContactDrawer.vue'; 79 import ContactDrawer from './ContactDrawer.vue';
59 import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/organizationIdTree'; 80 import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/organizationIdTree';
60 import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; 81 import { useBatchDelete } from '/@/hooks/web/useBatchDelete';
61 -  
62 import { getAlarmContact, deleteAlarmContact } from '/@/api/alarm/contact/alarmContact'; 82 import { getAlarmContact, deleteAlarmContact } from '/@/api/alarm/contact/alarmContact';
63 import { searchFormSchema, columns } from './config.data'; 83 import { searchFormSchema, columns } from './config.data';
64 import { Authority } from '/@/components/Authority'; 84 import { Authority } from '/@/components/Authority';
  85 + import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons-vue';
  86 + import { Tooltip } from 'ant-design-vue';
65 87
66 export default defineComponent({ 88 export default defineComponent({
67 components: { 89 components: {
@@ -71,8 +93,12 @@ @@ -71,8 +93,12 @@
71 TableAction, 93 TableAction,
72 ContactDrawer, 94 ContactDrawer,
73 Authority, 95 Authority,
  96 + MenuFoldOutlined,
  97 + MenuUnfoldOutlined,
  98 + Tooltip,
74 }, 99 },
75 setup() { 100 setup() {
  101 + const isFold = ref(true);
76 const searchInfo = reactive<Recordable>({}); 102 const searchInfo = reactive<Recordable>({});
77 const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); 103 const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo);
78 // 表格hooks 104 // 表格hooks
@@ -131,6 +157,13 @@ @@ -131,6 +157,13 @@
131 searchInfo.organizationId = organizationId; 157 searchInfo.organizationId = organizationId;
132 handleSuccess(); 158 handleSuccess();
133 }; 159 };
  160 + const changeWidth = (e) => {
  161 + if (e) {
  162 + isFold.value = false;
  163 + } else {
  164 + isFold.value = true;
  165 + }
  166 + };
134 return { 167 return {
135 searchInfo, 168 searchInfo,
136 hasBatchDelete, 169 hasBatchDelete,
@@ -141,6 +174,8 @@ @@ -141,6 +174,8 @@
141 registerTable, 174 registerTable,
142 registerDrawer, 175 registerDrawer,
143 organizationIdTreeRef, 176 organizationIdTreeRef,
  177 + changeWidth,
  178 + isFold,
144 }; 179 };
145 }, 180 },
146 }); 181 });
@@ -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 });
@@ -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 });
@@ -4,9 +4,28 @@ @@ -4,9 +4,28 @@
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']"
7 ref="organizationIdTreeRef" 9 ref="organizationIdTreeRef"
8 /> 10 />
9 - <BasicTable @register="registerTable" class="w-5/6 xl:w-4/5"> 11 + <div
  12 + style="position: absolute; top: 1.48rem; left: 6.5rem; cursor: pointer"
  13 + :style="[{ left: !isFold ? '0.5rem' : '6.5rem' }, { top: !isFold ? '0.8rem' : '1.48rem' }]"
  14 + >
  15 + <Tooltip v-if="isFold">
  16 + <template #title>隐藏组织</template>
  17 + <MenuFoldOutlined @click="changeWidth(true)" />
  18 + </Tooltip>
  19 + <Tooltip v-else>
  20 + <template #title>打开组织</template>
  21 + <MenuUnfoldOutlined @click="changeWidth(false)" />
  22 + </Tooltip>
  23 + </div>
  24 + <BasicTable
  25 + @register="registerTable"
  26 + class="w-5/6 xl:w-4/5"
  27 + :class="[!isFold ? 'w-423 xl:w-423' : 'w-5/6 xl:w-4/5']"
  28 + >
10 <template #toolbar> 29 <template #toolbar>
11 <Authority value="api:yt:device:post"> 30 <Authority value="api:yt:device:post">
12 <a-button type="primary" @click="handleCreate" v-if="authBtn(role)"> 31 <a-button type="primary" @click="handleCreate" v-if="authBtn(role)">
@@ -155,7 +174,7 @@ @@ -155,7 +174,7 @@
155 </div> 174 </div>
156 </template> 175 </template>
157 <script lang="ts"> 176 <script lang="ts">
158 - import { defineComponent, reactive, unref, nextTick } from 'vue'; 177 + import { defineComponent, reactive, unref, nextTick, ref } from 'vue';
159 import { DeviceState, DeviceTypeEnum } from '/@/api/device/model/deviceModel'; 178 import { DeviceState, DeviceTypeEnum } from '/@/api/device/model/deviceModel';
160 import { BasicTable, useTable, TableAction, TableImg } from '/@/components/Table'; 179 import { BasicTable, useTable, TableAction, TableImg } from '/@/components/Table';
161 import { columns, searchFormSchema } from './config/device.data'; 180 import { columns, searchFormSchema } from './config/device.data';
@@ -182,7 +201,11 @@ @@ -182,7 +201,11 @@
182 import { authBtn } from '/@/enums/roleEnum'; 201 import { authBtn } from '/@/enums/roleEnum';
183 import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; 202 import { useBatchDelete } from '/@/hooks/web/useBatchDelete';
184 import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard'; 203 import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
185 - import { QuestionCircleOutlined } from '@ant-design/icons-vue'; 204 + import {
  205 + QuestionCircleOutlined,
  206 + MenuFoldOutlined,
  207 + MenuUnfoldOutlined,
  208 + } from '@ant-design/icons-vue';
186 import { Authority } from '/@/components/Authority'; 209 import { Authority } from '/@/components/Authority';
187 210
188 export default defineComponent({ 211 export default defineComponent({
@@ -201,8 +224,12 @@ @@ -201,8 +224,12 @@
201 QuestionCircleOutlined, 224 QuestionCircleOutlined,
202 Popover, 225 Popover,
203 Authority, 226 Authority,
  227 + MenuFoldOutlined,
  228 + MenuUnfoldOutlined,
204 }, 229 },
205 setup(_) { 230 setup(_) {
  231 + const isFold = ref(true);
  232 +
206 const { createMessage } = useMessage(); 233 const { createMessage } = useMessage();
207 const go = useGo(); 234 const go = useGo();
208 const searchInfo = reactive<Recordable>({}); 235 const searchInfo = reactive<Recordable>({});
@@ -314,6 +341,13 @@ @@ -314,6 +341,13 @@
314 createMessage.success('复制成功~'); 341 createMessage.success('复制成功~');
315 } 342 }
316 }; 343 };
  344 + const changeWidth = (e) => {
  345 + if (e) {
  346 + isFold.value = false;
  347 + } else {
  348 + isFold.value = true;
  349 + }
  350 + };
317 351
318 return { 352 return {
319 registerTable, 353 registerTable,
@@ -338,6 +372,8 @@ @@ -338,6 +372,8 @@
338 hasBatchDelete, 372 hasBatchDelete,
339 handleDeleteOrBatchDelete, 373 handleDeleteOrBatchDelete,
340 handleReload, 374 handleReload,
  375 + changeWidth,
  376 + isFold,
341 }; 377 };
342 }, 378 },
343 }); 379 });
@@ -5,8 +5,29 @@ @@ -5,8 +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 />
9 - <BasicTable :clickToRowSelect="false" @register="registerTable" class="w-3/4 xl:w-4/5"> 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>
  25 + <BasicTable
  26 + :clickToRowSelect="false"
  27 + @register="registerTable"
  28 + class="w-3/4 xl:w-4/5"
  29 + :class="[!isFold ? 'w-3/4 xl:w-7/7' : 'w-3/4 xl:w-4/5']"
  30 + >
10 <template #toolbar> 31 <template #toolbar>
11 <Authority value="api:yt:user:post"> 32 <Authority value="api:yt:user:post">
12 <a-button type="primary" @click="handleCreate">新增账号</a-button> 33 <a-button type="primary" @click="handleCreate">新增账号</a-button>
@@ -80,7 +101,7 @@ @@ -80,7 +101,7 @@
80 </div> 101 </div>
81 </template> 102 </template>
82 <script lang="ts"> 103 <script lang="ts">
83 - import { defineComponent, reactive, nextTick } from 'vue'; 104 + import { defineComponent, reactive, nextTick, ref } from 'vue';
84 import { BasicTable, useTable, TableAction } from '/@/components/Table'; 105 import { BasicTable, useTable, TableAction } from '/@/components/Table';
85 import { deleteUser, getAccountList } from '/@/api/system/system'; 106 import { deleteUser, getAccountList } from '/@/api/system/system';
86 import { PageWrapper } from '/@/components/Page'; 107 import { PageWrapper } from '/@/components/Page';
@@ -92,6 +113,8 @@ @@ -92,6 +113,8 @@
92 import { useGo } from '/@/hooks/web/usePage'; 113 import { useGo } from '/@/hooks/web/usePage';
93 import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; 114 import { useBatchDelete } from '/@/hooks/web/useBatchDelete';
94 import { Authority } from '/@/components/Authority'; 115 import { Authority } from '/@/components/Authority';
  116 + import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons-vue';
  117 + import { Tooltip } from 'ant-design-vue';
95 118
96 export default defineComponent({ 119 export default defineComponent({
97 name: 'AccountManagement', 120 name: 'AccountManagement',
@@ -103,8 +126,12 @@ @@ -103,8 +126,12 @@
103 TableAction, 126 TableAction,
104 Tag, 127 Tag,
105 Authority, 128 Authority,
  129 + MenuFoldOutlined,
  130 + MenuUnfoldOutlined,
  131 + Tooltip,
106 }, 132 },
107 setup() { 133 setup() {
  134 + const isFold = ref(true);
108 const go = useGo(); 135 const go = useGo();
109 const [registerModal, { openModal }] = useModal(); 136 const [registerModal, { openModal }] = useModal();
110 let searchInfo = reactive<Recordable>({}); 137 let searchInfo = reactive<Recordable>({});
@@ -163,6 +190,13 @@ @@ -163,6 +190,13 @@
163 function handleView(record: Recordable) { 190 function handleView(record: Recordable) {
164 go('/system/account_detail/' + record.id); 191 go('/system/account_detail/' + record.id);
165 } 192 }
  193 + const changeWidth = (e) => {
  194 + if (e) {
  195 + isFold.value = false;
  196 + } else {
  197 + isFold.value = true;
  198 + }
  199 + };
166 200
167 return { 201 return {
168 registerTable, 202 registerTable,
@@ -175,6 +209,8 @@ @@ -175,6 +209,8 @@
175 organizationIdTreeRef, 209 organizationIdTreeRef,
176 hasBatchDelete, 210 hasBatchDelete,
177 handleDeleteOrBatchDelete, 211 handleDeleteOrBatchDelete,
  212 + changeWidth,
  213 + isFold,
178 }; 214 };
179 }, 215 },
180 }); 216 });