|
|
@ -3,36 +3,35 @@ |
|
|
|
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. |
|
|
|
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. |
|
|
|
* author entfrm开发团队-王翔 |
|
|
|
* author entfrm开发团队-王翔 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
import {AddressParams,AddressItem} from '/@/api/platform/system/entity/addressModel'; |
|
|
|
import {AddressParams, AddressItem, AddressItemListResult} from '/@/api/platform/system/entity/addressModel'; |
|
|
|
import { defHttp } from '/@/utils/http/axios'; |
|
|
|
import { defHttp } from '/@/utils/http/axios'; |
|
|
|
|
|
|
|
import { isEmpty } from '/@/utils/is'; |
|
|
|
|
|
|
|
|
|
|
|
enum Api { |
|
|
|
enum Api { |
|
|
|
get = '/system_proxy/system/address', |
|
|
|
|
|
|
|
QueryById = '/system_proxy/system/address/query', |
|
|
|
|
|
|
|
list = '/system_proxy/system/address/list', |
|
|
|
list = '/system_proxy/system/address/list', |
|
|
|
QueryByParentIds = '/system_proxy/system/address/queryByParentIds', |
|
|
|
lazyList= '/system_proxy/system/address/lazyList', |
|
|
|
|
|
|
|
get = '/system_proxy/system/address', |
|
|
|
add = '/system_proxy/system/address/add', |
|
|
|
add = '/system_proxy/system/address/add', |
|
|
|
edit = '/system_proxy/system/address/update', |
|
|
|
edit = '/system_proxy/system/address/update', |
|
|
|
del = '/system_proxy/system/address/remove' |
|
|
|
del = '/system_proxy/system/address/remove' |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export const queryById = (params: { id: String }) => |
|
|
|
|
|
|
|
defHttp.get<AddressItem>({url: Api.QueryById + `/${params.id}`}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const treeList = (params: AddressParams) => defHttp.get({url: Api.list, params}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const listAddr = (params?: Partial<AddressParams>) => |
|
|
|
export const listAddr = (params?: Partial<AddressParams>) => { |
|
|
|
|
|
|
|
if (params?.name || params?.id || !isEmpty(params?.dateRange)) { |
|
|
|
defHttp.get({url: Api.list, params}); |
|
|
|
defHttp.get({url: Api.list, params}); |
|
|
|
|
|
|
|
} else |
|
|
|
|
|
|
|
defHttp.get({url: Api.lazyList, params}); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/**新增 */ |
|
|
|
/**新增 */ |
|
|
|
export const addAddr =(params:Partial<AddressItem>) =>defHttp.post({url:Api.add,data:params}); |
|
|
|
export const addAddr =(params:Partial<AddressItem>) =>defHttp.post({url:Api.add,data:params}); |
|
|
|
|
|
|
|
|
|
|
|
/**修改 */ |
|
|
|
/**修改 */ |
|
|
|
export const editAddr =(params:Partial<AddressItem>) =>defHttp.put({url:Api.edit,data:params}); |
|
|
|
export const editAddr =(params:Partial<AddressItem>) =>defHttp.put({url:Api.edit,data:params}); |
|
|
|
|
|
|
|
|
|
|
|
export const queryByParentIds = (params) => |
|
|
|
|
|
|
|
defHttp.get({url: Api.QueryByParentIds + `/${params}`}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**查询详细 */ |
|
|
|
/**查询详细 */ |
|
|
|
export const getAddr = (id: string) => defHttp.get<AddressItem>({ url: `${Api.get}/${id}` }); |
|
|
|
export const getAddr = (id: string) => defHttp.get<AddressItem>({ url: `${Api.get}/${id}` }); |
|
|
|
|
|
|
|
|
|
|
|