Commit cc94a694afdb9fac6281996b9081b9c26898bd21
Merge branch 'fix/DEFECT-1980' into 'main_dev'
fix: 账号管理创建账号时添加新增组织按钮 See merge request yunteng/thingskit-front!1286
Showing
1 changed file
with
25 additions
and
0 deletions
| ... | ... | @@ -9,6 +9,9 @@ |
| 9 | 9 | <div style="height: 50vh"> |
| 10 | 10 | <BasicForm @register="registerForm"> |
| 11 | 11 | <template #organizationId="{ model, field }"> |
| 12 | + <Button type="link" @click="handleOpenCreate" style="padding: 0; z-index: 9999" | |
| 13 | + >新增组织 | |
| 14 | + </Button> | |
| 12 | 15 | <BasicTree |
| 13 | 16 | v-if="organizationTreeData.length" |
| 14 | 17 | v-model:value="model[field]" |
| ... | ... | @@ -44,6 +47,8 @@ |
| 44 | 47 | </a-select> |
| 45 | 48 | </template> |
| 46 | 49 | </BasicForm> |
| 50 | + | |
| 51 | + <OrganizationDrawer @register="registerDrawer" @success="handleReload" /> | |
| 47 | 52 | </div> |
| 48 | 53 | </BasicModal> |
| 49 | 54 | <RoleDrawer @register="registerRoleDrawer" @success="handleSuccess" /> |
| ... | ... | @@ -53,6 +58,7 @@ |
| 53 | 58 | import { BasicModal, useModalInner } from '/@/components/Modal'; |
| 54 | 59 | import { BasicForm, useForm } from '/@/components/Form/index'; |
| 55 | 60 | import { accountFormSchema } from './account.data'; |
| 61 | + import { Button } from 'ant-design-vue'; | |
| 56 | 62 | import { |
| 57 | 63 | findCurrentUserRelation, |
| 58 | 64 | SaveOrUpdateUserInfo, |
| ... | ... | @@ -67,13 +73,16 @@ |
| 67 | 73 | import { PlusOutlined } from '@ant-design/icons-vue'; |
| 68 | 74 | import { useDrawer } from '/@/components/Drawer'; |
| 69 | 75 | import RoleDrawer from '../role/RoleDrawer.vue'; |
| 76 | + import OrganizationDrawer from '/@/views/system/organization/OrganizationDrawer.vue'; | |
| 70 | 77 | |
| 71 | 78 | export default defineComponent({ |
| 72 | 79 | name: 'AccountModal', |
| 73 | 80 | components: { |
| 74 | 81 | BasicModal, |
| 75 | 82 | BasicForm, |
| 83 | + Button, | |
| 76 | 84 | BasicTree, |
| 85 | + OrganizationDrawer, | |
| 77 | 86 | PlusOutlined, |
| 78 | 87 | RoleDrawer, |
| 79 | 88 | VNodes: (_, { attrs }) => { |
| ... | ... | @@ -273,6 +282,17 @@ |
| 273 | 282 | ]; |
| 274 | 283 | }; |
| 275 | 284 | |
| 285 | + const [registerDrawer, { openDrawer: addOpenDrawer }] = useDrawer(); | |
| 286 | + | |
| 287 | + const handleOpenCreate = () => { | |
| 288 | + addOpenDrawer(true, { isUpdate: false }); | |
| 289 | + }; | |
| 290 | + const handleReload = async () => { | |
| 291 | + const groupListModel = await findCurrentUserGroups(); | |
| 292 | + copyTransTreeFun(groupListModel); | |
| 293 | + organizationTreeData.value = groupListModel; | |
| 294 | + }; | |
| 295 | + | |
| 276 | 296 | return { |
| 277 | 297 | registerModal, |
| 278 | 298 | registerForm, |
| ... | ... | @@ -291,6 +311,9 @@ |
| 291 | 311 | handleCheckClick, |
| 292 | 312 | handleUnSelectAll, |
| 293 | 313 | handleStrictlyStatus, |
| 314 | + handleOpenCreate, | |
| 315 | + registerDrawer, | |
| 316 | + handleReload, | |
| 294 | 317 | }; |
| 295 | 318 | }, |
| 296 | 319 | }); |
| ... | ... | @@ -298,6 +321,8 @@ |
| 298 | 321 | <style scoped lang="less"> |
| 299 | 322 | :deep(.vben-basic-tree) { |
| 300 | 323 | width: 100% !important; |
| 324 | + margin-top: -28px !important; | |
| 325 | + padding: 0; | |
| 301 | 326 | } |
| 302 | 327 | |
| 303 | 328 | :deep(.is-unflod) { | ... | ... |