import type { AccountEntity, PageConfig } from '@vben/types'; import { parseQueryValues } from '@vben/utils'; import { requestClient } from '#/api/request'; interface AccountPartialEntity extends Partial> { accountname?: string; } interface AccountQueryParams extends AccountPartialEntity, PageConfig {} /** * 账号信息_列表 */ export async function getAccountListApi(params: AccountQueryParams) { return requestClient.post('/api/query/list?pagevalue=68', { ...params, }); } /** * 账号信息_详情 */ export async function getAccountDetailApi(data: { accountid: string }) { return requestClient.post( '/api/query/view?pagevalue=69', { ...parseQueryValues(data), }, { formatData: true }, // 格式化返回数据 ); } /** * 客户_职员_视图列表 */ export async function getAccountWorkerListApi(params: AccountQueryParams) { return requestClient.post('/api/query/list?pagevalue=122', { ...params, }); } /** * 账号信息_新增 */ export async function addAccountApi(data: AccountEntity) { return requestClient.post('/api/add?pagevalue=70', { ...data }); } /** * 账号信息_编辑 */ export async function editAccountApi(data: AccountEntity) { return requestClient.post('/api/up?pagevalue=71', { ...data }); } /** * 账号信息_删除 */ export async function deleteAccountApi(data: { 'accountid.value': string }) { return requestClient.post('/api/del?pagevalue=72', { ...data }); }