mirror of
https://gitee.com/san-bing/JChargePointProtocol
synced 2026-05-05 10:29:56 +08:00
充电枪编辑功能
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* 付费课程知识星球:https://t.zsxq.com/aKtXo
|
||||
*/
|
||||
import {api} from './api';
|
||||
import type {Gun, GunCreateRequest, PageResponse, QueryParams} from '../types';
|
||||
import type {Gun, GunCreateRequest, GunUpdateRequest, PageResponse, QueryParams} from '../types';
|
||||
|
||||
export const getGuns = async (params: QueryParams): Promise<PageResponse<Gun>> => {
|
||||
const response = await api.get('/api/guns', { params });
|
||||
@@ -17,7 +17,7 @@ export const createGun = async (data: GunCreateRequest): Promise<Gun> => {
|
||||
return response.data.data;
|
||||
};
|
||||
|
||||
export const updateGun = async (id: string, data: Partial<Gun>): Promise<Gun> => {
|
||||
export const updateGun = async (id: string, data: GunUpdateRequest): Promise<Gun> => {
|
||||
const response = await api.put(`/api/guns/${id}`, data);
|
||||
return response.data.data;
|
||||
};
|
||||
|
||||
@@ -39,4 +39,11 @@ export const searchStationOptions = async (params: StationSearchRequest): Promis
|
||||
export const getStationOptions = async (): Promise<StationOption[]> => {
|
||||
const response = await api.get('/api/stations/options');
|
||||
return response.data.data;
|
||||
};
|
||||
|
||||
// 获取充电站-充电桩级联选择器数据
|
||||
export const getStationPileCascaderOptions = async (keyword?: string): Promise<any[]> => {
|
||||
const params = keyword ? { keyword } : {};
|
||||
const response = await api.get('/api/stations/pile-cascader', { params });
|
||||
return response.data.data;
|
||||
};
|
||||
Reference in New Issue
Block a user