@@ -4,7 +4,10 @@ import { fetchRoles } from '@tap/api/src/core/roles'
44import {
55 batchUpdateUserListtags ,
66 countUsers ,
7+ createUser ,
8+ deleteUser ,
79 fetchUsers ,
10+ updateUser ,
811 updateUserInfo ,
912} from ' @tap/api/src/core/users'
1013import PageContainer from ' @tap/business/src/components/PageContainer.vue'
@@ -507,9 +510,9 @@ export default {
507510 }))
508511 params .listtags = listtags
509512
510- const data = await usersApi[ this .createForm .id ? ' patch ' : ' post ' ](
511- params,
512- ).finally (() => {
513+ const method = this .createForm .id ? updateUser : createUser
514+
515+ const data = await method (params ).finally (() => {
513516 this .createDialogVisible = false
514517 })
515518
@@ -532,8 +535,7 @@ export default {
532535 beforeClose : (action , instance , done ) => {
533536 if (action === ' confirm' ) {
534537 instance .confirmButtonLoading = true
535- usersApi
536- .delete (item .id )
538+ deleteUser (item .id )
537539 .then (() => {
538540 this .$message .success (this .$t (' public_message_delete_ok' ))
539541 this .table .fetch ()
@@ -611,8 +613,7 @@ export default {
611613 beforeClose : (action , instance , done ) => {
612614 if (action === ' confirm' ) {
613615 instance .confirmButtonLoading = true
614- usersApi
615- .patch (data)
616+ updateUser (data)
616617 .then (() => {
617618 this .$message .success (successMsg)
618619 this .table .fetch ()
@@ -1107,7 +1108,6 @@ export default {
11071108
11081109 < el- form- item
11091110 : label= " $t('packages_component_classification_userTitle')"
1110- required
11111111 >
11121112 < el- tree- select
11131113 ref= " userGroupTree"
0 commit comments