Commit 71245d2c76fd89736d7945b8d81b27d119c209f2
Merge branch 'f-dev' into 'main'
fix:修改左侧组织显隐 See merge request huang/yun-teng-iot-front!238
Showing
6 changed files
with
215 additions
and
13 deletions
| ... | ... | @@ -4,13 +4,30 @@ |
| 4 | 4 | <OrganizationIdTree |
| 5 | 5 | class="w-1/4 xl:w-1/5" |
| 6 | 6 | @select="handleSelect" |
| 7 | + style="position: relative" | |
| 7 | 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 | 25 | <BasicTable |
| 10 | 26 | @register="registerTable" |
| 11 | 27 | :searchInfo="searchInfo" |
| 12 | 28 | class="w-3/4 xl:w-4/5" |
| 13 | 29 | :clickToRowSelect="false" |
| 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:alarm:profile:post"> |
| ... | ... | @@ -81,7 +98,7 @@ |
| 81 | 98 | </template> |
| 82 | 99 | |
| 83 | 100 | <script lang="ts"> |
| 84 | - import { defineComponent, reactive, h, nextTick } from 'vue'; | |
| 101 | + import { defineComponent, reactive, h, nextTick, ref } from 'vue'; | |
| 85 | 102 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| 86 | 103 | import { PageWrapper } from '/@/components/Page'; |
| 87 | 104 | import { useDrawer } from '/@/components/Drawer'; |
| ... | ... | @@ -89,7 +106,7 @@ |
| 89 | 106 | import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/organizationIdTree'; |
| 90 | 107 | import { deleteAlarmConfig, queryAlarmConfig } from '/@/api/alarm/config/alarmConfig'; |
| 91 | 108 | import { searchFormSchema, columns } from './config.data'; |
| 92 | - import { Modal } from 'ant-design-vue'; | |
| 109 | + import { Modal, Tooltip } from 'ant-design-vue'; | |
| 93 | 110 | import { JsonPreview } from '/@/components/CodeEditor'; |
| 94 | 111 | import { findDictItemByCode } from '/@/api/system/dict'; |
| 95 | 112 | import { alarmContactGetPage } from '/@/api/device/deviceConfigApi'; |
| ... | ... | @@ -98,6 +115,7 @@ |
| 98 | 115 | import { putAlarmConfigStatus } from '/@/api/alarm/config/alarmConfig'; |
| 99 | 116 | import { useMessage } from '/@/hooks/web/useMessage'; |
| 100 | 117 | import { Authority } from '/@/components/Authority'; |
| 118 | + import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons-vue'; | |
| 101 | 119 | |
| 102 | 120 | export default defineComponent({ |
| 103 | 121 | components: { |
| ... | ... | @@ -108,8 +126,13 @@ |
| 108 | 126 | ContactDrawer, |
| 109 | 127 | Switch, |
| 110 | 128 | Authority, |
| 129 | + MenuFoldOutlined, | |
| 130 | + MenuUnfoldOutlined, | |
| 131 | + Tooltip, | |
| 111 | 132 | }, |
| 112 | 133 | setup() { |
| 134 | + const isFold = ref(true); | |
| 135 | + | |
| 113 | 136 | const searchInfo = reactive<Recordable>({}); |
| 114 | 137 | const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); |
| 115 | 138 | // 刷新 |
| ... | ... | @@ -237,6 +260,13 @@ |
| 237 | 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 | 270 | return { |
| 241 | 271 | searchInfo, |
| 242 | 272 | hasBatchDelete, |
| ... | ... | @@ -250,6 +280,8 @@ |
| 250 | 280 | showAlarmContact, |
| 251 | 281 | showMessageMode, |
| 252 | 282 | statusChange, |
| 283 | + changeWidth, | |
| 284 | + isFold, | |
| 253 | 285 | }; |
| 254 | 286 | }, |
| 255 | 287 | }); | ... | ... |
| ... | ... | @@ -2,11 +2,32 @@ |
| 2 | 2 | <div> |
| 3 | 3 | <PageWrapper dense contentFullHeight contentClass="flex"> |
| 4 | 4 | <OrganizationIdTree |
| 5 | + style="position: relative" | |
| 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 | 9 | @select="handleSelect" |
| 7 | 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 | 31 | <template #toolbar> |
| 11 | 32 | <Authority value="api:yt:alarmContact:post"> |
| 12 | 33 | <a-button type="primary" @click="handleCreateOrEdit(null)"> 新增告警联系人 </a-button> |
| ... | ... | @@ -51,17 +72,18 @@ |
| 51 | 72 | </template> |
| 52 | 73 | |
| 53 | 74 | <script lang="ts"> |
| 54 | - import { defineComponent, reactive, nextTick } from 'vue'; | |
| 75 | + import { defineComponent, reactive, nextTick, ref } from 'vue'; | |
| 55 | 76 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| 56 | 77 | import { PageWrapper } from '/@/components/Page'; |
| 57 | 78 | import { useDrawer } from '/@/components/Drawer'; |
| 58 | 79 | import ContactDrawer from './ContactDrawer.vue'; |
| 59 | 80 | import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/organizationIdTree'; |
| 60 | 81 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; |
| 61 | - | |
| 62 | 82 | import { getAlarmContact, deleteAlarmContact } from '/@/api/alarm/contact/alarmContact'; |
| 63 | 83 | import { searchFormSchema, columns } from './config.data'; |
| 64 | 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 | 88 | export default defineComponent({ |
| 67 | 89 | components: { |
| ... | ... | @@ -71,8 +93,12 @@ |
| 71 | 93 | TableAction, |
| 72 | 94 | ContactDrawer, |
| 73 | 95 | Authority, |
| 96 | + MenuFoldOutlined, | |
| 97 | + MenuUnfoldOutlined, | |
| 98 | + Tooltip, | |
| 74 | 99 | }, |
| 75 | 100 | setup() { |
| 101 | + const isFold = ref(true); | |
| 76 | 102 | const searchInfo = reactive<Recordable>({}); |
| 77 | 103 | const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); |
| 78 | 104 | // 表格hooks |
| ... | ... | @@ -131,6 +157,13 @@ |
| 131 | 157 | searchInfo.organizationId = organizationId; |
| 132 | 158 | handleSuccess(); |
| 133 | 159 | }; |
| 160 | + const changeWidth = (e) => { | |
| 161 | + if (e) { | |
| 162 | + isFold.value = false; | |
| 163 | + } else { | |
| 164 | + isFold.value = true; | |
| 165 | + } | |
| 166 | + }; | |
| 134 | 167 | return { |
| 135 | 168 | searchInfo, |
| 136 | 169 | hasBatchDelete, |
| ... | ... | @@ -141,6 +174,8 @@ |
| 141 | 174 | registerTable, |
| 142 | 175 | registerDrawer, |
| 143 | 176 | organizationIdTreeRef, |
| 177 | + changeWidth, | |
| 178 | + isFold, | |
| 144 | 179 | }; |
| 145 | 180 | }, |
| 146 | 181 | }); | ... | ... |
| ... | ... | @@ -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:video:post"> |
| ... | ... | @@ -75,7 +92,7 @@ |
| 75 | 92 | </template> |
| 76 | 93 | |
| 77 | 94 | <script lang="ts"> |
| 78 | - import { defineComponent, reactive, nextTick } from 'vue'; | |
| 95 | + import { defineComponent, reactive, nextTick, ref } from 'vue'; | |
| 79 | 96 | import { BasicTable, useTable, TableAction, TableImg } from '/@/components/Table'; |
| 80 | 97 | import { PageWrapper } from '/@/components/Page'; |
| 81 | 98 | import { useDrawer } from '/@/components/Drawer'; |
| ... | ... | @@ -87,6 +104,8 @@ |
| 87 | 104 | import { useModal } from '/@/components/Modal'; |
| 88 | 105 | import { Authority } from '/@/components/Authority'; |
| 89 | 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 | 110 | export default defineComponent({ |
| 92 | 111 | components: { |
| ... | ... | @@ -98,8 +117,12 @@ |
| 98 | 117 | VideoPreviewModal, |
| 99 | 118 | TableImg, |
| 100 | 119 | Authority, |
| 120 | + MenuFoldOutlined, | |
| 121 | + MenuUnfoldOutlined, | |
| 122 | + Tooltip, | |
| 101 | 123 | }, |
| 102 | 124 | setup() { |
| 125 | + const isFold = ref(true); | |
| 103 | 126 | const searchInfo = reactive<Recordable>({}); |
| 104 | 127 | const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); |
| 105 | 128 | const [registerModal, { openModal }] = useModal(); |
| ... | ... | @@ -168,6 +191,13 @@ |
| 168 | 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 | 201 | return { |
| 172 | 202 | searchInfo, |
| 173 | 203 | hasBatchDelete, |
| ... | ... | @@ -180,6 +210,8 @@ |
| 180 | 210 | organizationIdTreeRef, |
| 181 | 211 | handleViewVideo, |
| 182 | 212 | registerModal, |
| 213 | + changeWidth, | |
| 214 | + isFold, | |
| 183 | 215 | }; |
| 184 | 216 | }, |
| 185 | 217 | }); | ... | ... |
| ... | ... | @@ -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 | }); | ... | ... |
| ... | ... | @@ -4,9 +4,28 @@ |
| 4 | 4 | <OrganizationIdTree |
| 5 | 5 | class="w-1/6 xl:w-1/5" |
| 6 | 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 | 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 | 29 | <template #toolbar> |
| 11 | 30 | <Authority value="api:yt:device:post"> |
| 12 | 31 | <a-button type="primary" @click="handleCreate" v-if="authBtn(role)"> |
| ... | ... | @@ -155,7 +174,7 @@ |
| 155 | 174 | </div> |
| 156 | 175 | </template> |
| 157 | 176 | <script lang="ts"> |
| 158 | - import { defineComponent, reactive, unref, nextTick } from 'vue'; | |
| 177 | + import { defineComponent, reactive, unref, nextTick, ref } from 'vue'; | |
| 159 | 178 | import { DeviceState, DeviceTypeEnum } from '/@/api/device/model/deviceModel'; |
| 160 | 179 | import { BasicTable, useTable, TableAction, TableImg } from '/@/components/Table'; |
| 161 | 180 | import { columns, searchFormSchema } from './config/device.data'; |
| ... | ... | @@ -182,7 +201,11 @@ |
| 182 | 201 | import { authBtn } from '/@/enums/roleEnum'; |
| 183 | 202 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; |
| 184 | 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 | 209 | import { Authority } from '/@/components/Authority'; |
| 187 | 210 | |
| 188 | 211 | export default defineComponent({ |
| ... | ... | @@ -201,8 +224,12 @@ |
| 201 | 224 | QuestionCircleOutlined, |
| 202 | 225 | Popover, |
| 203 | 226 | Authority, |
| 227 | + MenuFoldOutlined, | |
| 228 | + MenuUnfoldOutlined, | |
| 204 | 229 | }, |
| 205 | 230 | setup(_) { |
| 231 | + const isFold = ref(true); | |
| 232 | + | |
| 206 | 233 | const { createMessage } = useMessage(); |
| 207 | 234 | const go = useGo(); |
| 208 | 235 | const searchInfo = reactive<Recordable>({}); |
| ... | ... | @@ -314,6 +341,13 @@ |
| 314 | 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 | 352 | return { |
| 319 | 353 | registerTable, |
| ... | ... | @@ -338,6 +372,8 @@ |
| 338 | 372 | hasBatchDelete, |
| 339 | 373 | handleDeleteOrBatchDelete, |
| 340 | 374 | handleReload, |
| 375 | + changeWidth, | |
| 376 | + isFold, | |
| 341 | 377 | }; |
| 342 | 378 | }, |
| 343 | 379 | }); | ... | ... |
| ... | ... | @@ -5,8 +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 | /> |
| 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 | 31 | <template #toolbar> |
| 11 | 32 | <Authority value="api:yt:user:post"> |
| 12 | 33 | <a-button type="primary" @click="handleCreate">新增账号</a-button> |
| ... | ... | @@ -80,7 +101,7 @@ |
| 80 | 101 | </div> |
| 81 | 102 | </template> |
| 82 | 103 | <script lang="ts"> |
| 83 | - import { defineComponent, reactive, nextTick } from 'vue'; | |
| 104 | + import { defineComponent, reactive, nextTick, ref } from 'vue'; | |
| 84 | 105 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| 85 | 106 | import { deleteUser, getAccountList } from '/@/api/system/system'; |
| 86 | 107 | import { PageWrapper } from '/@/components/Page'; |
| ... | ... | @@ -92,6 +113,8 @@ |
| 92 | 113 | import { useGo } from '/@/hooks/web/usePage'; |
| 93 | 114 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; |
| 94 | 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 | 119 | export default defineComponent({ |
| 97 | 120 | name: 'AccountManagement', |
| ... | ... | @@ -103,8 +126,12 @@ |
| 103 | 126 | TableAction, |
| 104 | 127 | Tag, |
| 105 | 128 | Authority, |
| 129 | + MenuFoldOutlined, | |
| 130 | + MenuUnfoldOutlined, | |
| 131 | + Tooltip, | |
| 106 | 132 | }, |
| 107 | 133 | setup() { |
| 134 | + const isFold = ref(true); | |
| 108 | 135 | const go = useGo(); |
| 109 | 136 | const [registerModal, { openModal }] = useModal(); |
| 110 | 137 | let searchInfo = reactive<Recordable>({}); |
| ... | ... | @@ -163,6 +190,13 @@ |
| 163 | 190 | function handleView(record: Recordable) { |
| 164 | 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 | 201 | return { |
| 168 | 202 | registerTable, |
| ... | ... | @@ -175,6 +209,8 @@ |
| 175 | 209 | organizationIdTreeRef, |
| 176 | 210 | hasBatchDelete, |
| 177 | 211 | handleDeleteOrBatchDelete, |
| 212 | + changeWidth, | |
| 213 | + isFold, | |
| 178 | 214 | }; |
| 179 | 215 | }, |
| 180 | 216 | }); | ... | ... |