| | |
| | | <template #query> |
| | | <QueryFilterItem> |
| | | <SearchInput |
| | | v-model="extraParamState.keyword" |
| | | v-model="extraParamState.queryCondition" |
| | | style="width: 200px" |
| | | placeholder="账号/姓名/手机号" |
| | | @on-click-search="getList" |
| | |
| | | </ProTableV2> |
| | | </AppContainer> |
| | | <AddOrEditAccountDialog v-bind="dialogProps" /> |
| | | <ResetPasswordDialog v-bind="resetPasswordDialogProps"></ResetPasswordDialog> |
| | | </LoadingLayout> |
| | | </template> |
| | | |
| | |
| | | useFormDialog, |
| | | defineOperationBtns, |
| | | } from '@bole-core/components'; |
| | | import * as accountServices from '@/services/api/Account'; |
| | | import * as userRoleServices from '@/services/api/UserRole'; |
| | | import { Message, OrderInputType } from '@bole-core/core'; |
| | | import AddOrEditAccountDialog from './components/AddOrEditAccountDialog.vue'; |
| | | import ResetPasswordDialog from './components/ResetPasswordDialog.vue'; |
| | | import { formatRoleName } from '@/utils'; |
| | | |
| | | defineOptions({ |
| | |
| | | name: '重置密码', |
| | | }, |
| | | emits: { |
| | | onClick: (role) => handleResetPassword(), |
| | | onClick: (role) => handleResetPasswordAdd(), |
| | | }, |
| | | }, |
| | | ]); |
| | |
| | | reset, |
| | | } = useTable( |
| | | async ({ pageIndex, pageSize }, extraParamState) => { |
| | | // try { |
| | | // let params: API.QueryUserPageInput = { |
| | | // pageModel: { |
| | | // rows: pageSize, |
| | | // page: pageIndex, |
| | | // orderInput: extraParamState.orderInput, |
| | | // }, |
| | | // searchKey: extraParamState.keyword, |
| | | // }; |
| | | // let res = await userServices.getUserPage(params, { |
| | | // showLoading: !state.loading, |
| | | // }); |
| | | // return res; |
| | | // } catch (error) {} |
| | | try { |
| | | let params: API.GetBackClientUsersInput = { |
| | | pageModel: { |
| | | rows: pageSize, |
| | | page: pageIndex, |
| | | orderInput: extraParamState.orderInput, |
| | | }, |
| | | queryCondition: extraParamState.queryCondition, |
| | | }; |
| | | let res = await userRoleServices.getGovermentClientUsers(params, { |
| | | showLoading: !state.loading, |
| | | }); |
| | | return res; |
| | | } catch (error) {} |
| | | }, |
| | | { |
| | | defaultExtraParams: { |
| | | orderInput: [{ property: 'id', order: OrderInputType.Desc }], |
| | | keyword: '', |
| | | queryCondition: '', |
| | | }, |
| | | columnsRenderProps: {}, |
| | | } |
| | | ); |
| | | |
| | | function openDialog(row?: any) { |
| | | function openDialog(row?: API.UserDto) { |
| | | if (row) { |
| | | handleEdit({ |
| | | id: row.id, |
| | | userName: row.userName, |
| | | name: row.name, |
| | | phoneNumber: row.phoneNumber, |
| | | channel: row.channel, |
| | | password: '', |
| | | roleName: row.roleNames?.[0] ?? '', |
| | | remark: row.remark, |
| | | |
| | | isSendMessage: row?.isSendMessage ?? false, |
| | | sendClaimMessage: row?.sendClaimMessage ?? false, |
| | | sendBillExpireMessage: row?.sendBillExpireMessage ?? false, |
| | | }); |
| | | } else { |
| | | handleAdd(); |
| | |
| | | userName: '', |
| | | name: '', |
| | | phoneNumber: '', |
| | | channel: '', |
| | | password: '', |
| | | roleName: '', |
| | | remark: '', |
| | | |
| | | isSendMessage: false, |
| | | sendClaimMessage: false, |
| | | sendBillExpireMessage: false, |
| | | }, |
| | | }); |
| | | |
| | |
| | | // } catch (error) {} |
| | | } |
| | | |
| | | function handleResetPassword() {} |
| | | const { |
| | | dialogProps: resetPasswordDialogProps, |
| | | handleAdd: handleResetPasswordAdd, |
| | | editForm: resetPasswordEditForm, |
| | | } = useFormDialog({ |
| | | onConfirm: handleAddOrEdit, |
| | | defaultFormParams: { |
| | | id: '', |
| | | password: '', |
| | | }, |
| | | }); |
| | | </script> |