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,6 +9,9 @@ | ||
9 | <div style="height: 50vh"> | 9 | <div style="height: 50vh"> |
10 | <BasicForm @register="registerForm"> | 10 | <BasicForm @register="registerForm"> |
11 | <template #organizationId="{ model, field }"> | 11 | <template #organizationId="{ model, field }"> |
12 | + <Button type="link" @click="handleOpenCreate" style="padding: 0; z-index: 9999" | ||
13 | + >新增组织 | ||
14 | + </Button> | ||
12 | <BasicTree | 15 | <BasicTree |
13 | v-if="organizationTreeData.length" | 16 | v-if="organizationTreeData.length" |
14 | v-model:value="model[field]" | 17 | v-model:value="model[field]" |
@@ -44,6 +47,8 @@ | @@ -44,6 +47,8 @@ | ||
44 | </a-select> | 47 | </a-select> |
45 | </template> | 48 | </template> |
46 | </BasicForm> | 49 | </BasicForm> |
50 | + | ||
51 | + <OrganizationDrawer @register="registerDrawer" @success="handleReload" /> | ||
47 | </div> | 52 | </div> |
48 | </BasicModal> | 53 | </BasicModal> |
49 | <RoleDrawer @register="registerRoleDrawer" @success="handleSuccess" /> | 54 | <RoleDrawer @register="registerRoleDrawer" @success="handleSuccess" /> |
@@ -53,6 +58,7 @@ | @@ -53,6 +58,7 @@ | ||
53 | import { BasicModal, useModalInner } from '/@/components/Modal'; | 58 | import { BasicModal, useModalInner } from '/@/components/Modal'; |
54 | import { BasicForm, useForm } from '/@/components/Form/index'; | 59 | import { BasicForm, useForm } from '/@/components/Form/index'; |
55 | import { accountFormSchema } from './account.data'; | 60 | import { accountFormSchema } from './account.data'; |
61 | + import { Button } from 'ant-design-vue'; | ||
56 | import { | 62 | import { |
57 | findCurrentUserRelation, | 63 | findCurrentUserRelation, |
58 | SaveOrUpdateUserInfo, | 64 | SaveOrUpdateUserInfo, |
@@ -67,13 +73,16 @@ | @@ -67,13 +73,16 @@ | ||
67 | import { PlusOutlined } from '@ant-design/icons-vue'; | 73 | import { PlusOutlined } from '@ant-design/icons-vue'; |
68 | import { useDrawer } from '/@/components/Drawer'; | 74 | import { useDrawer } from '/@/components/Drawer'; |
69 | import RoleDrawer from '../role/RoleDrawer.vue'; | 75 | import RoleDrawer from '../role/RoleDrawer.vue'; |
76 | + import OrganizationDrawer from '/@/views/system/organization/OrganizationDrawer.vue'; | ||
70 | 77 | ||
71 | export default defineComponent({ | 78 | export default defineComponent({ |
72 | name: 'AccountModal', | 79 | name: 'AccountModal', |
73 | components: { | 80 | components: { |
74 | BasicModal, | 81 | BasicModal, |
75 | BasicForm, | 82 | BasicForm, |
83 | + Button, | ||
76 | BasicTree, | 84 | BasicTree, |
85 | + OrganizationDrawer, | ||
77 | PlusOutlined, | 86 | PlusOutlined, |
78 | RoleDrawer, | 87 | RoleDrawer, |
79 | VNodes: (_, { attrs }) => { | 88 | VNodes: (_, { attrs }) => { |
@@ -273,6 +282,17 @@ | @@ -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 | return { | 296 | return { |
277 | registerModal, | 297 | registerModal, |
278 | registerForm, | 298 | registerForm, |
@@ -291,6 +311,9 @@ | @@ -291,6 +311,9 @@ | ||
291 | handleCheckClick, | 311 | handleCheckClick, |
292 | handleUnSelectAll, | 312 | handleUnSelectAll, |
293 | handleStrictlyStatus, | 313 | handleStrictlyStatus, |
314 | + handleOpenCreate, | ||
315 | + registerDrawer, | ||
316 | + handleReload, | ||
294 | }; | 317 | }; |
295 | }, | 318 | }, |
296 | }); | 319 | }); |
@@ -298,6 +321,8 @@ | @@ -298,6 +321,8 @@ | ||
298 | <style scoped lang="less"> | 321 | <style scoped lang="less"> |
299 | :deep(.vben-basic-tree) { | 322 | :deep(.vben-basic-tree) { |
300 | width: 100% !important; | 323 | width: 100% !important; |
324 | + margin-top: -28px !important; | ||
325 | + padding: 0; | ||
301 | } | 326 | } |
302 | 327 | ||
303 | :deep(.is-unflod) { | 328 | :deep(.is-unflod) { |