| | |
| | | }" |
| | | > |
| | | <template #action> |
| | | <div class="account-card-action" @click="handleEditUserAccount">编辑</div> |
| | | <div class="account-card-action" @click="handleEditUserAccount">删除</div> |
| | | <div class="account-card-action" @click="handleEditUserAccount(item)">编辑</div> |
| | | <div class="account-card-action" @click="handleDeleteUserAccount(item)">删除</div> |
| | | </template> |
| | | </AccountCard> |
| | | </template> |
| | |
| | | useLifeRechargeContext, |
| | | QueryUserAccountListInput, |
| | | LifeRechargeConstants, |
| | | UserAccountListOutput, |
| | | } from '@life-payment/core-vue'; |
| | | import { useInfiniteLoading } from '../../hooks/infiniteLoading'; |
| | | import { OrderInputType } from '../../constants'; |
| | |
| | | name: 'UserAccountListView', |
| | | }); |
| | | |
| | | const emit = defineEmits<{ |
| | | (e: 'goEdit', row: UserAccountListOutput): void; |
| | | }>(); |
| | | |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | const TitleMap = { |
| | |
| | | [LifeRechargeConstants.LifePayOrderTypeEnum.燃气订单]: '燃气户号', |
| | | }; |
| | | |
| | | const { infiniteLoadingProps } = useInfiniteLoading( |
| | | const { infiniteLoadingProps, invalidateQueries } = useInfiniteLoading( |
| | | ({ pageParam }) => { |
| | | let params: QueryUserAccountListInput = { |
| | | pageModel: { |
| | | rows: 20, |
| | | page: pageParam, |
| | | orderInput: [{ property: 'id', order: OrderInputType.Desc }], |
| | | orderInput: [{ property: 'creationTime', order: OrderInputType.Desc }], |
| | | }, |
| | | userId: blLifeRecharge.accountModel.userId, |
| | | }; |
| | |
| | | } |
| | | ); |
| | | |
| | | function handleEditUserAccount() {} |
| | | function handleEditUserAccount(row: UserAccountListOutput) { |
| | | emit('goEdit', row); |
| | | } |
| | | |
| | | async function handleDeleteUserAccount(row: UserAccountListOutput) { |
| | | try { |
| | | const res = await Taro.showModal({ |
| | | title: '提示', |
| | | content: '确定要删除该数据吗?', |
| | | confirmColor: '#3a71ff', |
| | | }); |
| | | if (res.confirm) { |
| | | await blLifeRecharge.services.deleteUserAccount({ |
| | | id: row.id, |
| | | }); |
| | | invalidateQueries(); |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | </script> |