index.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import type { AccountEntity, PageConfig } from '@vben/types';
  2. import { parseQueryValues } from '@vben/utils';
  3. import { requestClient } from '#/api/request';
  4. interface AccountPartialEntity
  5. extends Partial<Omit<AccountEntity, 'accountname'>> {
  6. accountname?: string;
  7. }
  8. interface AccountQueryParams extends AccountPartialEntity, PageConfig {}
  9. /**
  10. * 账号信息_列表
  11. */
  12. export async function getAccountListApi(params: AccountQueryParams) {
  13. return requestClient.post<any>('/api/query/list?pagevalue=68', {
  14. ...params,
  15. });
  16. }
  17. /**
  18. * 账号信息_详情
  19. */
  20. export async function getAccountDetailApi(data: { accountid: string }) {
  21. return requestClient.post<any>(
  22. '/api/query/view?pagevalue=69',
  23. {
  24. ...parseQueryValues(data),
  25. },
  26. { formatData: true }, // 格式化返回数据
  27. );
  28. }
  29. /**
  30. * 客户_职员_视图列表
  31. */
  32. export async function getAccountWorkerListApi(params: AccountQueryParams) {
  33. return requestClient.post<any>('/api/query/list?pagevalue=122', {
  34. ...params,
  35. });
  36. }
  37. /**
  38. * 账号信息_新增
  39. */
  40. export async function addAccountApi(data: AccountEntity) {
  41. return requestClient.post<any>('/api/add?pagevalue=70', { ...data });
  42. }
  43. /**
  44. * 账号信息_编辑
  45. */
  46. export async function editAccountApi(data: AccountEntity) {
  47. return requestClient.post<any>('/api/up?pagevalue=71', { ...data });
  48. }
  49. /**
  50. * 账号信息_删除
  51. */
  52. export async function deleteAccountApi(data: { 'accountid.value': string }) {
  53. return requestClient.post<any>('/api/del?pagevalue=72', { ...data });
  54. }