SnapshotRecordApi.js 2.54 KB
import axiosInstance from "@/Request/PublicAxiosInstance"
import {filterEmptyValueInObject} from "@/PublicUtil/PublicUtil"

class SnapshotRecordApi {
    getSnapshotRecordList(data) {
        return axiosInstance.request(
            {
                method: 'GET',
                url: `/car4s/engage/page`,
                params: filterEmptyValueInObject(
                    data
                )
            }
        )
    }

    getAccountList() {
        return axiosInstance.request(
            {
                method: 'GET',
                url: `/accounts`,
            }
        )
    }

    getPlazaList(data) {
        return axiosInstance.request(
            {
                method: 'GET',
                url: `/malls`,
                params: filterEmptyValueInObject(
                    {
                        accountIds: data.account_id
                    },
                )
            }
        )
    }
    getResidenceList(data) {
        return axiosInstance.request(
            {
                method: 'GET',
                url: `/residence`,
                params:data
            }
        )
    }

    getZoneList(data) {
        return axiosInstance.request(
            {
                method: 'GET',
                url: `/zones/zoneList`,
                params: filterEmptyValueInObject(
                    {
                        account_id: data.account_id,
                        plaza_id: data.plaza_id,
                    },
                )
            }
        )
    }

    getGateList(data) {
        return axiosInstance.request(
            {
                method: 'GET',
                url: `/gates/gateByInfo`,
                params: filterEmptyValueInObject(
                    {
                        account_id: data.account_id,
                        plaza_id: data.plaza_id,
                        zone_id: data.zone_id,
                        type: data.type,
                    },
                )
            }
        )
    }

		// 删除试乘记录
		deleteOneDrive(data) {
		    return axiosInstance.request(
		        {
		            method: 'DELETE',
		            url: `/car4s/engage/${data.id}`,
		        }
		    )
		}
		
		// 上传试乘记录
		uploadDrive(data) {
		    return axiosInstance.request(
		        {
		            method: 'POST',
		            url: `/car4s/engage/upload`,
								headers: {
								    'Content-Type': 'multipart/form-data'
								},
								data: data
		        }
		    )
		}
}

const snapshotRecordApi = new SnapshotRecordApi()

export default snapshotRecordApi