第一次提交
This commit is contained in:
91
src/api/apps/bc/agent/index.ts
Normal file
91
src/api/apps/bc/agent/index.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BCAgent, BCAgentParam } from '@/api/apps/bc/agent/model';
|
||||
/**
|
||||
* 分页查询设备
|
||||
*/
|
||||
export async function pageBCAgent(params: BCAgentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BCAgent>>>(
|
||||
'/apps/bc-agent/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*/
|
||||
export async function listBCAgent(params?: BCAgentParam) {
|
||||
const res = await request.get<ApiResult<BCAgent[]>>('/apps/bc-agent', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加设备
|
||||
*/
|
||||
export async function addBCAgent(data: BCAgent) {
|
||||
const res = await request.post<ApiResult<unknown>>('/apps/bc-agent', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*/
|
||||
export async function updateBCAgent(data: BCAgent) {
|
||||
const res = await request.put<ApiResult<unknown>>('/apps/bc-agent', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定设备
|
||||
*/
|
||||
export async function bindBCAgent(data: BCAgent) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/apps/bc-agent/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备
|
||||
*/
|
||||
export async function removeBCAgent(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/apps/bc-agent/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备
|
||||
*/
|
||||
export async function removeBatchBCAgent(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/apps/bc-agent/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
23
src/api/apps/bc/agent/model/index.ts
Normal file
23
src/api/apps/bc/agent/model/index.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 代理报餐
|
||||
*/
|
||||
export interface BCAgent {
|
||||
agentId?: number;
|
||||
userId?: number;
|
||||
parentId?: number;
|
||||
sortNumber?: number;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface BCAgentParam extends PageParam {
|
||||
status?: number;
|
||||
userId?: number;
|
||||
}
|
||||
142
src/api/apps/bc/equipment/index.ts
Normal file
142
src/api/apps/bc/equipment/index.ts
Normal file
@@ -0,0 +1,142 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BcEquipment, BcEquipmentParam } from './model';
|
||||
/**
|
||||
* 分页查询设备
|
||||
*/
|
||||
export async function pageBcEquipment(params: BcEquipmentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BcEquipment>>>(
|
||||
'/apps/bc-equipment/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*/
|
||||
export async function listBcEquipment(params?: BcEquipmentParam) {
|
||||
const res = await request.get<ApiResult<BcEquipment[]>>(
|
||||
'/apps/bc-equipment',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加设备
|
||||
*/
|
||||
export async function addBcEquipment(data: BcEquipment) {
|
||||
const merchantCode = localStorage.getItem('merchantCode');
|
||||
console.log(merchantCode);
|
||||
if (merchantCode !== null && merchantCode != '') {
|
||||
console.log(merchantCode);
|
||||
data.merchantCode = String(merchantCode);
|
||||
}
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/apps/bc-equipment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*/
|
||||
export async function updateBcEquipment(data: BcEquipment) {
|
||||
const res = await request.put<ApiResult<unknown>>('/apps/bc-equipment', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定设备
|
||||
*/
|
||||
export async function bindBcEquipment(data: BcEquipment) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/apps/bc-equipment/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备
|
||||
*/
|
||||
export async function removeBcEquipment(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/apps/bc-equipment/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备
|
||||
*/
|
||||
export async function removeBatchBcEquipment(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/apps/bc-equipment/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/apps/bc-equipment/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送企业微信消息推送
|
||||
*/
|
||||
export async function addSend(data: BcEquipment) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/apps/bc-equipment/addSend',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
src/api/apps/bc/equipment/model/index.ts
Normal file
31
src/api/apps/bc/equipment/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 设备
|
||||
*/
|
||||
export interface BcEquipment {
|
||||
bcEquipmentId?: number;
|
||||
equipmentName?: string;
|
||||
equipmentCode?: string;
|
||||
gear?: number;
|
||||
describe?: string;
|
||||
sortNumber?: number;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
content?: string;
|
||||
merchantCode?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface BcEquipmentParam extends PageParam {
|
||||
bcEquipmentId?: number;
|
||||
equipmentName?: string;
|
||||
equipmentCode?: string;
|
||||
status?: number;
|
||||
merchantCode?: string;
|
||||
userId?: number;
|
||||
}
|
||||
95
src/api/apps/bc/export/index.ts
Normal file
95
src/api/apps/bc/export/index.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BcExport, BcExportParam } from '@/api/apps/bc/export/model';
|
||||
|
||||
/**
|
||||
* 分页查询计划
|
||||
*/
|
||||
export async function pageBcExport(params: BcExportParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BcExport>>>(
|
||||
'/apps/bc-export/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计划列表
|
||||
*/
|
||||
export async function listBcExport(params?: BcExportParam) {
|
||||
const res = await request.get<ApiResult<BcExport[]>>('/apps/bc-export', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加计划
|
||||
*/
|
||||
export async function addBcExport(data: BcExport) {
|
||||
const res = await request.post<ApiResult<unknown>>('/apps/bc-export', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划
|
||||
*/
|
||||
export async function updateBcExport(data: BcExport) {
|
||||
const res = await request.put<ApiResult<unknown>>('/apps/bc-export', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定计划
|
||||
*/
|
||||
export async function bindBcExport(data: BcExport) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/apps/bc-export/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划
|
||||
*/
|
||||
export async function removeBcExport(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/apps/bc-export/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除计划
|
||||
*/
|
||||
export async function removeBatchBcExport(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/apps/bc-export/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
41
src/api/apps/bc/export/model/index.ts
Normal file
41
src/api/apps/bc/export/model/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface BcExport {
|
||||
exportId?: number;
|
||||
organizationName?: string;
|
||||
nickname?: string;
|
||||
breakfastPost?: number;
|
||||
breakfastSign?: number;
|
||||
lunchPost?: number;
|
||||
lunchSign?: number;
|
||||
dinnerPost?: number;
|
||||
dinnerSign?: number;
|
||||
gear10?: number;
|
||||
gear20?: number;
|
||||
signGear10?: number;
|
||||
signGear20?: number;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
expendMoney?: number;
|
||||
userId?: number;
|
||||
lunchPostText?: string;
|
||||
lunchSignText?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface BcExportParam extends PageParam {
|
||||
exportId?: number;
|
||||
organizationName?: string;
|
||||
organizationId?: number;
|
||||
dayTime?: string;
|
||||
week?: number;
|
||||
status?: number;
|
||||
userId?: number;
|
||||
deliveryTime?: string;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
deliveryTimeStart?: string;
|
||||
deliveryTimeEnd?: string;
|
||||
}
|
||||
88
src/api/apps/bc/food/index.ts
Normal file
88
src/api/apps/bc/food/index.ts
Normal file
@@ -0,0 +1,88 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BCFood, BCFoodParam } from '@/api/apps/bc/food/model';
|
||||
/**
|
||||
* 分页查询计划
|
||||
*/
|
||||
export async function pageBCFood(params: BCFoodParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BCFood>>>(
|
||||
'/apps/bc-food/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计划列表
|
||||
*/
|
||||
export async function listBCFood(params?: BCFoodParam) {
|
||||
const res = await request.get<ApiResult<BCFood[]>>('/apps/bc-food', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加计划
|
||||
*/
|
||||
export async function addBCFood(data: BCFood) {
|
||||
const res = await request.post<ApiResult<unknown>>('/apps/bc-food', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划
|
||||
*/
|
||||
export async function updateBCFood(data: BCFood) {
|
||||
const res = await request.put<ApiResult<unknown>>('/apps/bc-food', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定计划
|
||||
*/
|
||||
export async function bindBCFood(data: BCFood) {
|
||||
const res = await request.put<ApiResult<unknown>>('/apps/bc-food/bind', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划
|
||||
*/
|
||||
export async function removeBCFood(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/apps/bc-food/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除计划
|
||||
*/
|
||||
export async function removeBatchBCFood(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/apps/bc-food/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
21
src/api/apps/bc/food/model/index.ts
Normal file
21
src/api/apps/bc/food/model/index.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface BCFood {
|
||||
temporaryId?: number;
|
||||
userId?: number;
|
||||
parentId?: number;
|
||||
sortNumber?: number;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
expirationTime?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface BCFoodParam extends PageParam {
|
||||
status?: number;
|
||||
userId?: number;
|
||||
}
|
||||
88
src/api/apps/bc/plan/index.ts
Normal file
88
src/api/apps/bc/plan/index.ts
Normal file
@@ -0,0 +1,88 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BCPlan, BCPlanParam } from '@/api/apps/bc/plan/model';
|
||||
/**
|
||||
* 分页查询计划
|
||||
*/
|
||||
export async function pageBCPlan(params: BCPlanParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BCPlan>>>(
|
||||
'/apps/bc-plan/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计划列表
|
||||
*/
|
||||
export async function listBCPlan(params?: BCPlanParam) {
|
||||
const res = await request.get<ApiResult<BCPlan[]>>('/apps/bc-plan', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加计划
|
||||
*/
|
||||
export async function addBCPlan(data: BCPlan) {
|
||||
const res = await request.post<ApiResult<unknown>>('/apps/bc-plan', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划
|
||||
*/
|
||||
export async function updateBCPlan(data: BCPlan) {
|
||||
const res = await request.put<ApiResult<unknown>>('/apps/bc-plan', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定计划
|
||||
*/
|
||||
export async function bindBCPlan(data: BCPlan) {
|
||||
const res = await request.put<ApiResult<unknown>>('/apps/bc-plan/bind', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划
|
||||
*/
|
||||
export async function removeBCPlan(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/apps/bc-plan/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除计划
|
||||
*/
|
||||
export async function removeBatchBCPlan(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/apps/bc-plan/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
28
src/api/apps/bc/plan/model/index.ts
Normal file
28
src/api/apps/bc/plan/model/index.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface BCPlan {
|
||||
bcPlanId?: number;
|
||||
dayTime?: any;
|
||||
oldTime?: string;
|
||||
type?: string;
|
||||
userId?: number;
|
||||
goodsIds?: any;
|
||||
status?: number;
|
||||
period?: string;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
isRepeat?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface BCPlanParam extends PageParam {
|
||||
bcPlanId?: number;
|
||||
dayTime?: string;
|
||||
week?: number;
|
||||
status?: number;
|
||||
userId?: number;
|
||||
oldTime?: string;
|
||||
}
|
||||
105
src/api/apps/bc/temporary/index.ts
Normal file
105
src/api/apps/bc/temporary/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
BCTemporary,
|
||||
BCTemporaryParam
|
||||
} from '@/api/apps/bc/temporary/model';
|
||||
/**
|
||||
* 分页查询设备
|
||||
*/
|
||||
export async function pageBCTemporary(params: BCTemporaryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BCTemporary>>>(
|
||||
'/apps/bc-temporary/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*/
|
||||
export async function listBCTemporary(params?: BCTemporaryParam) {
|
||||
const res = await request.get<ApiResult<BCTemporary[]>>(
|
||||
'/apps/bc-temporary',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加设备
|
||||
*/
|
||||
export async function addBCTemporary(data: BCTemporary) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/apps/bc-temporary',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*/
|
||||
export async function updateBCTemporary(data: BCTemporary) {
|
||||
const res = await request.put<ApiResult<unknown>>('/apps/bc-temporary', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定设备
|
||||
*/
|
||||
export async function bindBCTemporary(data: BCTemporary) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/apps/bc-temporary/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备
|
||||
*/
|
||||
export async function removeBCTemporary(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/apps/bc-temporary/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备
|
||||
*/
|
||||
export async function removeBatchBCTemporary(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/apps/bc-temporary/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
25
src/api/apps/bc/temporary/model/index.ts
Normal file
25
src/api/apps/bc/temporary/model/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 代理报餐
|
||||
*/
|
||||
export interface BCTemporary {
|
||||
temporaryId?: number;
|
||||
userId?: number;
|
||||
parentId?: number;
|
||||
sortNumber?: number;
|
||||
applyStatus?: number;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
expirationTime?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface BCTemporaryParam extends PageParam {
|
||||
status?: number;
|
||||
userId?: number;
|
||||
}
|
||||
95
src/api/apps/cashier/index.ts
Normal file
95
src/api/apps/cashier/index.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Cashier, CashierParam } from './model/index';
|
||||
|
||||
/**
|
||||
* 分页查询订单
|
||||
*/
|
||||
export async function pageCashier(params: CashierParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Cashier>>>(
|
||||
'/apps/cashier/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*/
|
||||
export async function listCashier(params?: CashierParam) {
|
||||
const res = await request.get<ApiResult<Cashier[]>>('/apps/cashier', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加订单
|
||||
*/
|
||||
export async function addCashier(data: Cashier) {
|
||||
const res = await request.post<ApiResult<unknown>>('/apps/cashier', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*/
|
||||
export async function updateCashier(data: Cashier) {
|
||||
const res = await request.put<ApiResult<unknown>>('/apps/cashier', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
*/
|
||||
export async function removeCashier(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/apps/cashier/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*/
|
||||
export async function removeBatchCashier(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/apps/cashier/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>('/apps/cashier/existence', {
|
||||
params: { field, value, id }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
39
src/api/apps/cashier/model/index.ts
Normal file
39
src/api/apps/cashier/model/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 订单
|
||||
*/
|
||||
export interface Cashier {
|
||||
// 订单id
|
||||
cashierId?: number;
|
||||
buyerId?: string;
|
||||
code?: string;
|
||||
msg?: string;
|
||||
outTradeNo?: string;
|
||||
amount?: string;
|
||||
payTime?: string;
|
||||
payType?: string;
|
||||
totalAmount?: string;
|
||||
receiptAmount?: string;
|
||||
feeAmount?: string;
|
||||
settleAmount?: string;
|
||||
orderRemark?: string;
|
||||
orderStatus?: string;
|
||||
sign?: string;
|
||||
merchantName?: string;
|
||||
mobile?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
tenantId: number;
|
||||
merchantCode?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface CashierParam extends PageParam {
|
||||
outTradeNo?: string;
|
||||
merchantName?: string;
|
||||
mobile?: string;
|
||||
merchantCode?: string;
|
||||
}
|
||||
115
src/api/apps/equipment/alarm/index.ts
Normal file
115
src/api/apps/equipment/alarm/index.ts
Normal file
@@ -0,0 +1,115 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { EquipmentAlarm, EquipmentAlarmParam } from './model';
|
||||
/**
|
||||
* 分页查询电池报警
|
||||
*/
|
||||
export async function pageEquipmentAlarm(params: EquipmentAlarmParam) {
|
||||
const res = await request.get<ApiResult<PageResult<EquipmentAlarm>>>(
|
||||
'/apps/equipment-alarm/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询电池报警列表
|
||||
*/
|
||||
export async function listEquipmentAlarm(params?: EquipmentAlarmParam) {
|
||||
const res = await request.get<ApiResult<EquipmentAlarm[]>>(
|
||||
'/apps/equipment-alarm',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加电池报警
|
||||
*/
|
||||
export async function addEquipmentAlarm(data: EquipmentAlarm) {
|
||||
const merchantCode = localStorage.getItem('merchantCode');
|
||||
if (merchantCode !== 'null') {
|
||||
data.merchantCode = String(merchantCode);
|
||||
}
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/apps/equipment-alarm',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改电池报警
|
||||
*/
|
||||
export async function updateEquipmentAlarm(data: EquipmentAlarm) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/apps/equipment-alarm',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除电池报警
|
||||
*/
|
||||
export async function removeEquipmentAlarm(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/apps/equipment-alarm/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除电池报警
|
||||
*/
|
||||
export async function removeBatchEquipmentAlarm(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/apps/equipment-alarm/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/apps/equipment-alarm/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
29
src/api/apps/equipment/alarm/model/index.ts
Normal file
29
src/api/apps/equipment/alarm/model/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 电池报警
|
||||
*/
|
||||
export interface EquipmentAlarm {
|
||||
id?: number;
|
||||
equipmentCode?: string;
|
||||
alarmType?: number;
|
||||
handleTime?: string;
|
||||
image?: string;
|
||||
sortNumber?: number;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
merchantCode?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface EquipmentAlarmParam extends PageParam {
|
||||
id?: number;
|
||||
equipmentCode?: string;
|
||||
alarmType?: string;
|
||||
status?: number;
|
||||
merchantCode?: string;
|
||||
}
|
||||
115
src/api/apps/equipment/fault/index.ts
Normal file
115
src/api/apps/equipment/fault/index.ts
Normal file
@@ -0,0 +1,115 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { EquipmentFault, EquipmentFaultParam } from './model';
|
||||
/**
|
||||
* 分页查询故障电池
|
||||
*/
|
||||
export async function pageEquipmentFault(params: EquipmentFaultParam) {
|
||||
const res = await request.get<ApiResult<PageResult<EquipmentFault>>>(
|
||||
'/apps/equipment-fault/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询故障电池列表
|
||||
*/
|
||||
export async function listEquipmentFault(params?: EquipmentFaultParam) {
|
||||
const res = await request.get<ApiResult<EquipmentFault[]>>(
|
||||
'/apps/equipment-fault',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加故障电池
|
||||
*/
|
||||
export async function addEquipmentFault(data: EquipmentFault) {
|
||||
const merchantCode = localStorage.getItem('merchantCode');
|
||||
if (merchantCode !== 'null') {
|
||||
data.merchantCode = String(merchantCode);
|
||||
}
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/apps/equipment-fault',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改故障电池
|
||||
*/
|
||||
export async function updateEquipmentFault(data: EquipmentFault) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/apps/equipment-fault',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除故障电池
|
||||
*/
|
||||
export async function removeEquipmentFault(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/apps/equipment-fault/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除故障电池
|
||||
*/
|
||||
export async function removeBatchEquipmentFault(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/apps/equipment-fault/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/apps/equipment-fault/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
29
src/api/apps/equipment/fault/model/index.ts
Normal file
29
src/api/apps/equipment/fault/model/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 故障电池
|
||||
*/
|
||||
export interface EquipmentFault {
|
||||
id?: number;
|
||||
equipmentCode?: string;
|
||||
faultType?: number;
|
||||
handleTime?: string;
|
||||
image?: string;
|
||||
sortNumber?: number;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
merchantCode?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface EquipmentFaultParam extends PageParam {
|
||||
id?: number;
|
||||
equipmentCode?: string;
|
||||
faultType?: string;
|
||||
status?: number;
|
||||
merchantCode?: string;
|
||||
}
|
||||
112
src/api/apps/equipment/goods/index.ts
Normal file
112
src/api/apps/equipment/goods/index.ts
Normal file
@@ -0,0 +1,112 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { EquipmentGoods, EquipmentGoodsParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询商品
|
||||
*/
|
||||
export async function pageEquipmentGoods(params: EquipmentGoodsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<EquipmentGoods>>>(
|
||||
'/apps/equipment-goods/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品列表
|
||||
*/
|
||||
export async function listEquipmentGoods(params?: EquipmentGoodsParam) {
|
||||
const res = await request.get<ApiResult<EquipmentGoods[]>>(
|
||||
'/apps/equipment-goods',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品
|
||||
*/
|
||||
export async function addEquipmentGoods(data: EquipmentGoods) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/apps/equipment-goods',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品
|
||||
*/
|
||||
export async function updateEquipmentGoods(data: EquipmentGoods) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/apps/equipment-goods',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品
|
||||
*/
|
||||
export async function removeEquipmentGoods(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/apps/equipment-goods/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品
|
||||
*/
|
||||
export async function removeBatchEquipmentGoods(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/apps/equipment-goods/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/apps/equipment-goods/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
67
src/api/apps/equipment/goods/model/index.ts
Normal file
67
src/api/apps/equipment/goods/model/index.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 电池商品
|
||||
*/
|
||||
export interface EquipmentGoods {
|
||||
equipmentCategory?: string;
|
||||
goodsId?: number;
|
||||
goodsName?: string;
|
||||
goodsCode?: string;
|
||||
categoryId?: number;
|
||||
fullName?: string;
|
||||
logo?: string;
|
||||
qrcode?: string;
|
||||
describe?: string;
|
||||
logoImageId?: number;
|
||||
isRecycle?: number;
|
||||
sortNumber?: number;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
specType?: number;
|
||||
deliveryType?: number;
|
||||
batteryModel?: string;
|
||||
content?: string;
|
||||
deliveryId?: number;
|
||||
image?: string;
|
||||
files?: string;
|
||||
goodsPriceMin?: number;
|
||||
linePriceMin?: number;
|
||||
sellingPoint?: string;
|
||||
purchaseLimit?: number;
|
||||
deductStockType?: number;
|
||||
salesActual?: number;
|
||||
goodsWeight?: number;
|
||||
stockTotal?: number;
|
||||
merchantCode?: string;
|
||||
batteryRent?: number;
|
||||
batteryDeposit?: number;
|
||||
batteryInsurance?: number;
|
||||
batteryPrice?: number;
|
||||
userId?: number;
|
||||
// 首付款
|
||||
downPayment?: number;
|
||||
// 分期期数
|
||||
periods?: number;
|
||||
// 每期还款
|
||||
repayment?: number;
|
||||
// 手续费
|
||||
serviceCharges?: number;
|
||||
// 分期方式
|
||||
periodsType?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface EquipmentGoodsParam extends PageParam {
|
||||
goodsId?: number;
|
||||
goodsName?: string;
|
||||
goodsCode?: string;
|
||||
listType?: string;
|
||||
status?: number;
|
||||
stockTotal?: number;
|
||||
merchantCode?: string;
|
||||
}
|
||||
120
src/api/apps/equipment/index.ts
Normal file
120
src/api/apps/equipment/index.ts
Normal file
@@ -0,0 +1,120 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Equipment, EquipmentParam } from './model';
|
||||
/**
|
||||
* 分页查询设备
|
||||
*/
|
||||
export async function pageEquipment(params: EquipmentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Equipment>>>(
|
||||
'/apps/equipment/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*/
|
||||
export async function listEquipment(params?: EquipmentParam) {
|
||||
const res = await request.get<ApiResult<Equipment[]>>('/apps/equipment', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加设备
|
||||
*/
|
||||
export async function addEquipment(data: Equipment) {
|
||||
const merchantCode = localStorage.getItem('merchantCode');
|
||||
console.log(merchantCode);
|
||||
if (merchantCode !== null && merchantCode != '') {
|
||||
console.log(merchantCode);
|
||||
data.merchantCode = String(merchantCode);
|
||||
}
|
||||
const res = await request.post<ApiResult<unknown>>('/apps/equipment', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*/
|
||||
export async function updateEquipment(data: Equipment) {
|
||||
const res = await request.put<ApiResult<unknown>>('/apps/equipment', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定设备
|
||||
*/
|
||||
export async function bindEquipment(data: Equipment) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/apps/equipment/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备
|
||||
*/
|
||||
export async function removeEquipment(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/apps/equipment/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备
|
||||
*/
|
||||
export async function removeBatchEquipment(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/apps/equipment/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/apps/equipment/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
72
src/api/apps/equipment/model/index.ts
Normal file
72
src/api/apps/equipment/model/index.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 设备
|
||||
*/
|
||||
export interface Equipment {
|
||||
equipmentType?: number;
|
||||
equipmentId?: number;
|
||||
equipmentName?: string;
|
||||
equipmentCode?: string;
|
||||
batteryModel?: string;
|
||||
equipmentCategory?: string;
|
||||
categoryId?: number;
|
||||
bms?: string;
|
||||
isCtive?: string;
|
||||
workingStatus?: string;
|
||||
leaseStatus?: string;
|
||||
batteryStatus?: string;
|
||||
batteryPower?: string;
|
||||
isOnline?: string;
|
||||
totalVoltage?: string;
|
||||
bmsBrand?: string;
|
||||
surplusCapacity?: string;
|
||||
iccid?: string;
|
||||
ctiveTime?: string;
|
||||
batteryDeliveryTime?: string;
|
||||
fullName?: string;
|
||||
logo?: string;
|
||||
describe?: string;
|
||||
logoImageId?: number;
|
||||
isRecycle?: number;
|
||||
sortNumber?: number;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
specType?: number;
|
||||
deliveryType?: number;
|
||||
content?: string;
|
||||
deliveryId?: number;
|
||||
image?: string;
|
||||
files?: string;
|
||||
equipmentPriceMin?: number;
|
||||
linePriceMin?: number;
|
||||
sellingPoint?: string;
|
||||
purchaseLimit?: number;
|
||||
deductStockType?: number;
|
||||
salesActual?: number;
|
||||
equipmentWeight?: number;
|
||||
stockTotal?: number;
|
||||
merchantCode?: string;
|
||||
orderId?: number;
|
||||
batteryRent?: number;
|
||||
batteryDeposit?: number;
|
||||
batteryInsurance?: number;
|
||||
batteryPrice?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface EquipmentParam extends PageParam {
|
||||
equipmentId?: number;
|
||||
orderId?: number;
|
||||
equipmentName?: string;
|
||||
equipmentCode?: string;
|
||||
listType?: string;
|
||||
status?: number;
|
||||
stockTotal?: number;
|
||||
merchantCode?: string;
|
||||
userId?: number;
|
||||
}
|
||||
118
src/api/apps/equipment/order/goods/index.ts
Normal file
118
src/api/apps/equipment/order/goods/index.ts
Normal file
@@ -0,0 +1,118 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { EquipmentOrderGoods, EquipmentOrderGoodsParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询商品
|
||||
*/
|
||||
export async function pageEquipmentOrderGoods(
|
||||
params: EquipmentOrderGoodsParam
|
||||
) {
|
||||
const res = await request.get<ApiResult<PageResult<EquipmentOrderGoods>>>(
|
||||
'/apps/equipment-order-goods/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品列表
|
||||
*/
|
||||
export async function listEquipmentOrderGoods(
|
||||
params?: EquipmentOrderGoodsParam
|
||||
) {
|
||||
const res = await request.get<ApiResult<EquipmentOrderGoods[]>>(
|
||||
'/apps/equipment-order-goods',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品
|
||||
*/
|
||||
export async function addEquipmentOrderGoods(data: EquipmentOrderGoods) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/apps/equipment-order-goods',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品
|
||||
*/
|
||||
export async function updateEquipmentOrderGoods(data: EquipmentOrderGoods) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/apps/equipment-order-goods',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品
|
||||
*/
|
||||
export async function removeEquipmentOrderGoods(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/apps/equipment-order-goods/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品
|
||||
*/
|
||||
export async function removeBatchEquipmentOrderGoods(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/apps/equipment-order-goods/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/apps/equipment-order-goods/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
69
src/api/apps/equipment/order/goods/model/index.ts
Normal file
69
src/api/apps/equipment/order/goods/model/index.ts
Normal file
@@ -0,0 +1,69 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 电池订单商品
|
||||
*/
|
||||
export interface EquipmentOrderGoods {
|
||||
equipmentCategory?: string;
|
||||
goodsId?: number;
|
||||
goodsName?: string;
|
||||
goodsCode?: string;
|
||||
categoryId?: number;
|
||||
fullName?: string;
|
||||
logo?: string;
|
||||
qrcode?: string;
|
||||
describe?: string;
|
||||
logoImageId?: number;
|
||||
isRecycle?: number;
|
||||
sortNumber?: number;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
specType?: number;
|
||||
deliveryType?: number;
|
||||
batteryModel?: string;
|
||||
content?: string;
|
||||
deliveryId?: number;
|
||||
image?: string;
|
||||
files?: string;
|
||||
goodsPriceMin?: number;
|
||||
linePriceMin?: number;
|
||||
sellingPoint?: string;
|
||||
purchaseLimit?: number;
|
||||
deductStockType?: number;
|
||||
salesActual?: number;
|
||||
goodsWeight?: number;
|
||||
stockTotal?: number;
|
||||
merchantCode?: string;
|
||||
batteryRent?: number;
|
||||
batteryDeposit?: number;
|
||||
batteryInsurance?: number;
|
||||
batteryPrice?: number;
|
||||
userId?: number;
|
||||
orderId?: number;
|
||||
// 首付款
|
||||
downPayment?: number;
|
||||
// 分期期数
|
||||
periods?: number;
|
||||
// 每期还款
|
||||
repayment?: number;
|
||||
// 手续费
|
||||
serviceCharges?: number;
|
||||
// 分期方式
|
||||
periodsType?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface EquipmentOrderGoodsParam extends PageParam {
|
||||
goodsId?: number;
|
||||
goodsName?: string;
|
||||
goodsCode?: string;
|
||||
listType?: string;
|
||||
status?: number;
|
||||
stockTotal?: number;
|
||||
merchantCode?: string;
|
||||
orderId?: number;
|
||||
}
|
||||
115
src/api/apps/equipment/record/index.ts
Normal file
115
src/api/apps/equipment/record/index.ts
Normal file
@@ -0,0 +1,115 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { EquipmentRecord, EquipmentRecordParam } from './model';
|
||||
/**
|
||||
* 分页查询前世今生
|
||||
*/
|
||||
export async function pageEquipmentRecord(params: EquipmentRecordParam) {
|
||||
const res = await request.get<ApiResult<PageResult<EquipmentRecord>>>(
|
||||
'/apps/equipment-record/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询前世今生列表
|
||||
*/
|
||||
export async function listEquipmentRecord(params?: EquipmentRecordParam) {
|
||||
const res = await request.get<ApiResult<EquipmentRecord[]>>(
|
||||
'/apps/equipment-record',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加前世今生
|
||||
*/
|
||||
export async function addEquipmentRecord(data: EquipmentRecord) {
|
||||
const merchantCode = localStorage.getItem('merchantCode');
|
||||
if (merchantCode !== 'null') {
|
||||
data.merchantCode = String(merchantCode);
|
||||
}
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/apps/equipment-record',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改前世今生
|
||||
*/
|
||||
export async function updateEquipmentRecord(data: EquipmentRecord) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/apps/equipment-record',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除前世今生
|
||||
*/
|
||||
export async function removeEquipmentRecord(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/apps/equipment-record/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除前世今生
|
||||
*/
|
||||
export async function removeBatchEquipmentRecord(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/apps/equipment-record/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/apps/equipment-record/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
30
src/api/apps/equipment/record/model/index.ts
Normal file
30
src/api/apps/equipment/record/model/index.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 电池前世今生
|
||||
*/
|
||||
export interface EquipmentRecord {
|
||||
id?: number;
|
||||
equipmentCode?: string;
|
||||
eventType?: number;
|
||||
params?: string;
|
||||
sortNumber?: number;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
merchantCode?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface EquipmentRecordParam extends PageParam {
|
||||
id?: number;
|
||||
equipmentCode?: string;
|
||||
orderId?: number;
|
||||
userId?: number;
|
||||
eventType?: string;
|
||||
status?: number;
|
||||
merchantCode?: string;
|
||||
}
|
||||
17
src/api/apps/example/choose/index.ts
Normal file
17
src/api/apps/example/choose/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { Classes, ClassesParam } from './model';
|
||||
|
||||
/**
|
||||
* 获取全部的班级数据
|
||||
*/
|
||||
export async function getAllClasses(params?: ClassesParam) {
|
||||
const res = await request.get<ApiResult<Classes[]>>(
|
||||
'https://cdn.eleadmin.com/20200610/classes.json',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
21
src/api/apps/example/choose/model/index.ts
Normal file
21
src/api/apps/example/choose/model/index.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* 班级
|
||||
*/
|
||||
export interface Classes {
|
||||
// 班级id
|
||||
classesId?: number;
|
||||
// 班级名称
|
||||
classesName?: string;
|
||||
// 学院名称
|
||||
college?: string;
|
||||
// 专业名称
|
||||
major?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 班级查询参数
|
||||
*/
|
||||
export interface ClassesParam {
|
||||
classesId?: number;
|
||||
classesName?: string;
|
||||
}
|
||||
31
src/api/apps/example/document/index.ts
Normal file
31
src/api/apps/example/document/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Piece, PieceParam, Archive, ArchiveParam } from './model';
|
||||
|
||||
/**
|
||||
* 获取案卷列表
|
||||
*/
|
||||
export async function getPieceList(params: PieceParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Piece>>>(
|
||||
'https://cdn.eleadmin.com/20200610/document.json',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取卷内文件列表
|
||||
*/
|
||||
export async function getArchiveList(params: ArchiveParam) {
|
||||
const res = await request.get<ApiResult<Archive[]>>(
|
||||
'https://cdn.eleadmin.com/20200610/archive.json',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
71
src/api/apps/example/document/model/index.ts
Normal file
71
src/api/apps/example/document/model/index.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
import { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 案卷
|
||||
*/
|
||||
export interface Piece {
|
||||
// 案卷id
|
||||
id?: number;
|
||||
// 案卷题名
|
||||
title?: string;
|
||||
// 案卷档号
|
||||
piece_no?: string;
|
||||
// 密级
|
||||
secret?: string;
|
||||
// 存放位置
|
||||
location?: string;
|
||||
// 案卷类型
|
||||
type?: string;
|
||||
// 保管期限
|
||||
retention?: string;
|
||||
// 载体类型
|
||||
carrier?: string;
|
||||
// 归档年度
|
||||
year?: string;
|
||||
// 件数
|
||||
amount?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 案卷查询参数
|
||||
*/
|
||||
export interface PieceParam extends PageParam {
|
||||
title?: string;
|
||||
piece_no?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文档
|
||||
*/
|
||||
export interface Archive {
|
||||
// 文件题名
|
||||
title?: string;
|
||||
// 案卷档号
|
||||
piece_no?: string;
|
||||
// 文件档号
|
||||
archive_no?: string;
|
||||
// 密级
|
||||
secret?: string;
|
||||
// 存放位置
|
||||
location?: string;
|
||||
// 文件类型
|
||||
type?: string;
|
||||
// 保管期限
|
||||
retention?: string;
|
||||
// 载体类型
|
||||
carrier?: string;
|
||||
// 归档年度
|
||||
year?: string;
|
||||
// 排序号
|
||||
sort_number?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文档查询参数
|
||||
*/
|
||||
export interface ArchiveParam {
|
||||
title?: string;
|
||||
piece_no?: string;
|
||||
archive_no?: string;
|
||||
piece_no_in?: (string | undefined)[];
|
||||
}
|
||||
28
src/api/apps/example/form/advanced/index.ts
Normal file
28
src/api/apps/example/form/advanced/index.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { UserItem } from './model';
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
export async function queryList() {
|
||||
const data: UserItem[] = [
|
||||
{
|
||||
key: '1',
|
||||
number: '00001',
|
||||
name: 'John Brown',
|
||||
department: '研发部'
|
||||
},
|
||||
{
|
||||
key: '2',
|
||||
number: '00002',
|
||||
name: 'Jim Green',
|
||||
department: '产品部'
|
||||
},
|
||||
{
|
||||
key: '3',
|
||||
number: '00003',
|
||||
name: 'Joe Black',
|
||||
department: '产品部'
|
||||
}
|
||||
];
|
||||
return data;
|
||||
}
|
||||
7
src/api/apps/example/form/advanced/model/index.ts
Normal file
7
src/api/apps/example/form/advanced/model/index.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export interface UserItem {
|
||||
key: string;
|
||||
isEdit?: boolean;
|
||||
number?: string;
|
||||
name?: string;
|
||||
department?: string;
|
||||
}
|
||||
13
src/api/apps/example/table/index.ts
Normal file
13
src/api/apps/example/table/index.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserScore } from './model';
|
||||
|
||||
export async function pageUserScores() {
|
||||
const res = await request.get<ApiResult<PageResult<UserScore>>>(
|
||||
'https://cdn.eleadmin.com/20200610/example-table-merge.json'
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
7
src/api/apps/example/table/model/index.ts
Normal file
7
src/api/apps/example/table/model/index.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export interface UserScore {
|
||||
id: number;
|
||||
userName: string;
|
||||
courseName: string;
|
||||
score: number;
|
||||
userNameRowSpan: number;
|
||||
}
|
||||
114
src/api/apps/hualala/card-benefits/index.ts
Normal file
114
src/api/apps/hualala/card-benefits/index.ts
Normal file
@@ -0,0 +1,114 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
// @ts-ignore
|
||||
import type { HualalaCardBenefits, HualalaCardBenefitsParam } from './model';
|
||||
/**
|
||||
* 分页查询会员权益
|
||||
*/
|
||||
export async function pageHualalaCardBenefits(
|
||||
params: HualalaCardBenefitsParam
|
||||
) {
|
||||
const res = await request.get<ApiResult<PageResult<HualalaCardBenefits>>>(
|
||||
'/apps/hualala-card-benefits/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员权益列表
|
||||
*/
|
||||
export async function listHualalaCardBenefits(
|
||||
params?: HualalaCardBenefitsParam
|
||||
) {
|
||||
const res = await request.get<ApiResult<HualalaCardBenefits[]>>(
|
||||
'/apps/hualala-card-benefits',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加会员权益
|
||||
*/
|
||||
export async function addHualalaCardBenefits(data: HualalaCardBenefits) {
|
||||
const merchantCode = localStorage.getItem('merchantCode');
|
||||
if (merchantCode !== 'null') {
|
||||
data.merchantCode = String(merchantCode);
|
||||
}
|
||||
const res = await request.post<ApiResult<unknown>>('/apps/hualala-card-benefits', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员权益
|
||||
*/
|
||||
export async function updateHualalaCardBenefits(data: HualalaCardBenefits) {
|
||||
const res = await request.put<ApiResult<unknown>>('/apps/hualala-card-benefits', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员权益
|
||||
*/
|
||||
export async function removeHualalaCardBenefits(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/apps/hualala-card-benefits/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除会员权益
|
||||
*/
|
||||
export async function removeBatchHualalaCardBenefits(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/apps/hualala-card-benefits/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/apps/hualala-card-benefits/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
64
src/api/apps/hualala/card-benefits/model/index.ts
Normal file
64
src/api/apps/hualala/card-benefits/model/index.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 会员权益
|
||||
*/
|
||||
export interface HualalaCardBenefits {
|
||||
hualalaCardBenefitsId?: number;
|
||||
equipmentType?: number;
|
||||
equipmentId?: number;
|
||||
equipmentName?: string;
|
||||
equipmentCode?: string;
|
||||
batteryModel?: string;
|
||||
equipmentCategory?: string;
|
||||
categoryId?: number;
|
||||
bms?: string;
|
||||
isCtive?: string;
|
||||
workingStatus?: string;
|
||||
leaseStatus?: string;
|
||||
batteryStatus?: string;
|
||||
batteryPower?: string;
|
||||
isOnline?: string;
|
||||
totalVoltage?: string;
|
||||
bmsBrand?: string;
|
||||
surplusCapacity?: string;
|
||||
iccid?: string;
|
||||
ctiveTime?: string;
|
||||
batteryDeliveryTime?: string;
|
||||
fullName?: string;
|
||||
logo?: string;
|
||||
describe?: string;
|
||||
logoImageId?: number;
|
||||
isRecycle?: number;
|
||||
sortNumber?: number;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
specType?: number;
|
||||
deliveryType?: number;
|
||||
content?: string;
|
||||
deliveryId?: number;
|
||||
image?: string;
|
||||
files?: string;
|
||||
equipmentPriceMin?: number;
|
||||
linePriceMin?: number;
|
||||
sellingPoint?: string;
|
||||
purchaseLimit?: number;
|
||||
deductStockType?: number;
|
||||
salesActual?: number;
|
||||
equipmentWeight?: number;
|
||||
stockTotal?: number;
|
||||
merchantCode?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface HualalaCardBenefitsParam extends PageParam {
|
||||
id?: number;
|
||||
cardLevelName?: string;
|
||||
name?: string;
|
||||
status?: number;
|
||||
merchantCode?: string;
|
||||
}
|
||||
113
src/api/apps/hualala/card/index.ts
Normal file
113
src/api/apps/hualala/card/index.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
// @ts-ignore
|
||||
import type { HualalaCard, HualalaCardParam } from './model';
|
||||
/**
|
||||
* 分页查询会员卡
|
||||
*/
|
||||
export async function pageHualalaCard(params: HualalaCardParam) {
|
||||
const res = await request.get<ApiResult<PageResult<HualalaCard>>>(
|
||||
'/apps/hualala-card/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员卡列表
|
||||
*/
|
||||
export async function listHualalaCard(params?: HualalaCardParam) {
|
||||
const res = await request.get<ApiResult<HualalaCard[]>>(
|
||||
'/apps/hualala-card',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加会员卡
|
||||
*/
|
||||
export async function addHualalaCard(data: HualalaCard) {
|
||||
const merchantCode = localStorage.getItem('merchantCode');
|
||||
if (merchantCode !== 'null') {
|
||||
data.merchantCode = String(merchantCode);
|
||||
}
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/apps/hualala-card',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员卡
|
||||
*/
|
||||
export async function updateHualalaCard(data: HualalaCard) {
|
||||
const res = await request.put<ApiResult<unknown>>('/apps/hualala-card', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员卡
|
||||
*/
|
||||
export async function removeHualalaCard(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/apps/hualala-card/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除会员卡
|
||||
*/
|
||||
export async function removeBatchHualalaCard(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/apps/hualala-card/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/apps/hualala-card/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
18
src/api/apps/hualala/card/model/index.ts
Normal file
18
src/api/apps/hualala/card/model/index.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 会员卡
|
||||
*/
|
||||
export interface HualalaCard {
|
||||
cardid?: number;
|
||||
merchantCode?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface HualalaCardParam extends PageParam {
|
||||
cardid?: number;
|
||||
status?: number;
|
||||
merchantCode?: string;
|
||||
}
|
||||
104
src/api/apps/link/index.ts
Normal file
104
src/api/apps/link/index.ts
Normal file
@@ -0,0 +1,104 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Link, LinkParam } from './model';
|
||||
|
||||
/**
|
||||
* JSON数据
|
||||
*/
|
||||
export async function getLinkType() {
|
||||
return {
|
||||
list: [
|
||||
{ value: '0', label: '应用组件', text: '应用组件', comments: '' },
|
||||
{ value: '1', label: '外部链接', text: '外部链接', comments: '' }
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询链接
|
||||
*/
|
||||
export async function pageLink(params: LinkParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Link>>>('/oa/link/page', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询链接列表
|
||||
*/
|
||||
export async function listLink(params?: LinkParam) {
|
||||
const res = await request.get<ApiResult<Link[]>>('/oa/link', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加链接
|
||||
*/
|
||||
export async function addLink(data: Link) {
|
||||
const res = await request.post<ApiResult<unknown>>('/oa/link', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改链接
|
||||
*/
|
||||
export async function updateLink(data: Link) {
|
||||
const res = await request.put<ApiResult<unknown>>('/oa/link', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除链接
|
||||
*/
|
||||
export async function removeLink(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/link/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除链接
|
||||
*/
|
||||
export async function removeBatchLink(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/link/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>('/oa/link/existence', {
|
||||
params: { field, value, id }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
60
src/api/apps/link/model/index.ts
Normal file
60
src/api/apps/link/model/index.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 链接
|
||||
*/
|
||||
export interface Link {
|
||||
// 链接类型
|
||||
menuType?: number;
|
||||
// 链接id
|
||||
linkId?: number;
|
||||
// 链接地址
|
||||
linkUrl?: string;
|
||||
// 下载地址
|
||||
linkDown?: string;
|
||||
// 链接名称
|
||||
linkName?: string;
|
||||
// 链接图标
|
||||
linkIcon?: string;
|
||||
// 组件路径
|
||||
linkComponent?: string;
|
||||
// 访问账号
|
||||
linkAccount?: string;
|
||||
// 访问密码
|
||||
linkPassword?: string;
|
||||
// 点击次数
|
||||
clicks?: number;
|
||||
// 类型
|
||||
type?: string;
|
||||
// 分类
|
||||
category?: string;
|
||||
// 推荐理由
|
||||
comments?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 打开方式
|
||||
openType?: number;
|
||||
hide?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 链接搜索条件
|
||||
*/
|
||||
export interface LinkParam extends PageParam {
|
||||
// 链接名称
|
||||
linkName?: string;
|
||||
// 链接
|
||||
linkUrl?: string;
|
||||
// 第几页
|
||||
page?: number;
|
||||
// 每页多少条
|
||||
limit?: number;
|
||||
// 总数量
|
||||
count?: number;
|
||||
// 列表数据
|
||||
list?: [];
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
98
src/api/apps/map/components/demo-map.vue
Normal file
98
src/api/apps/map/components/demo-map.vue
Normal file
@@ -0,0 +1,98 @@
|
||||
<template>
|
||||
<a-card title="官网底部地图" :bordered="false">
|
||||
<div ref="locationMapRef" style="height: 360px; max-width: 800px"></div>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, watch, onMounted, onUnmounted } from 'vue';
|
||||
import AMapLoader from '@amap/amap-jsapi-loader';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { MAP_KEY } from '@/config/setting';
|
||||
|
||||
const themeStore = useThemeStore();
|
||||
const { darkMode } = storeToRefs(themeStore);
|
||||
|
||||
//
|
||||
const locationMapRef = ref<HTMLElement | null>(null);
|
||||
|
||||
// 官网底部地图的实例
|
||||
let mapInsLocation: any;
|
||||
|
||||
/* 渲染官网底部地图 */
|
||||
const renderLocationMap = () => {
|
||||
AMapLoader.load({
|
||||
key: MAP_KEY,
|
||||
version: '2.0',
|
||||
plugins: ['AMap.InfoWindow', 'AMap.Marker']
|
||||
})
|
||||
.then((AMap) => {
|
||||
// 渲染地图
|
||||
const option = {
|
||||
zoom: 13, // 初缩放级别
|
||||
center: [114.346084, 30.511215 + 0.005], // 初始中心点
|
||||
mapStyle: darkMode.value ? 'amap://styles/dark' : void 0
|
||||
};
|
||||
mapInsLocation = new AMap.Map(locationMapRef.value, option);
|
||||
// 创建信息窗体
|
||||
const infoWindow = new AMap.InfoWindow({
|
||||
content: `
|
||||
<div style="color: #333;">
|
||||
<div style="padding: 5px;font-size: 16px;">武汉易云智科技有限公司</div>
|
||||
<div style="padding: 0 5px;">地址: 湖北省武汉市洪山区雄楚大道222号</div>
|
||||
<div style="padding: 0 5px;">电话: 020-123456789</div>
|
||||
</div>
|
||||
<a
|
||||
class="ele-text-primary"
|
||||
style="padding: 8px 5px 0;text-decoration: none;display: inline-block;"
|
||||
href="//uri.amap.com/marker?position=114.346084,30.511215&name=武汉易云智科技有限公司"
|
||||
target="_blank">到这里去→
|
||||
</a>
|
||||
`
|
||||
});
|
||||
infoWindow.open(mapInsLocation, [114.346084, 30.511215]);
|
||||
const icon = new AMap.Icon({
|
||||
size: new AMap.Size(25, 34),
|
||||
image:
|
||||
'//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-red.png',
|
||||
imageSize: new AMap.Size(25, 34)
|
||||
});
|
||||
const marker = new AMap.Marker({
|
||||
icon: icon,
|
||||
position: [114.346084, 30.511215],
|
||||
offset: new AMap.Pixel(-12, -28)
|
||||
});
|
||||
marker.setMap(mapInsLocation);
|
||||
marker.on('click', () => {
|
||||
infoWindow.open(mapInsLocation);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
});
|
||||
};
|
||||
|
||||
/* 渲染地图 */
|
||||
onMounted(() => {
|
||||
renderLocationMap();
|
||||
});
|
||||
|
||||
/* 销毁地图 */
|
||||
onUnmounted(() => {
|
||||
if (mapInsLocation) {
|
||||
mapInsLocation.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
/* 同步框架暗黑模式切换 */
|
||||
watch(darkMode, (value) => {
|
||||
if (mapInsLocation) {
|
||||
if (value) {
|
||||
mapInsLocation.setMapStyle('amap://styles/dark');
|
||||
} else {
|
||||
mapInsLocation.setMapStyle('amap://styles/normal');
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
63
src/api/apps/map/components/demo-picker.vue
Normal file
63
src/api/apps/map/components/demo-picker.vue
Normal file
@@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<a-card title="地图位置选择器" :bordered="false">
|
||||
<a-space>
|
||||
<div style="width: 140px">
|
||||
<a-select v-model:value="searchType" class="ele-fluid">
|
||||
<a-select-option :value="0">POI检索模式</a-select-option>
|
||||
<a-select-option :value="1">关键字检索模式</a-select-option>
|
||||
</a-select>
|
||||
</div>
|
||||
<a-button class="ele-btn-icon" @click="openMapPicker">
|
||||
打开地图位置选择器
|
||||
</a-button>
|
||||
</a-space>
|
||||
<div style="margin-top: 12px">选择位置: {{ result.location }}</div>
|
||||
<div style="margin-top: 12px">详细地址: {{ result.address }}</div>
|
||||
<div style="margin-top: 12px">经 纬 度 : {{ result.lngAndLat }}</div>
|
||||
</a-card>
|
||||
<!-- 地图位置选择弹窗 -->
|
||||
<ele-map-picker
|
||||
:need-city="true"
|
||||
:dark-mode="darkMode"
|
||||
v-model:visible="visible"
|
||||
:search-type="searchType"
|
||||
@done="onChoose"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import type { CenterPoint } from 'ele-admin-pro/es/ele-map-picker/types';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
|
||||
const themeStore = useThemeStore();
|
||||
const { darkMode } = storeToRefs(themeStore);
|
||||
|
||||
// 是否显示地图选择弹窗
|
||||
const visible = ref(false);
|
||||
|
||||
// 地点检索类型
|
||||
const searchType = ref(0);
|
||||
|
||||
// 选择结果
|
||||
const result = reactive({
|
||||
location: '',
|
||||
address: '',
|
||||
lngAndLat: ''
|
||||
});
|
||||
|
||||
/* 打开位置选择 */
|
||||
const openMapPicker = () => {
|
||||
visible.value = true;
|
||||
};
|
||||
|
||||
/* 地图选择后回调 */
|
||||
const onChoose = (location: CenterPoint) => {
|
||||
console.log(location);
|
||||
result.location = `${location.city?.province}/${location.city?.city}/${location.city?.district}`;
|
||||
result.address = `${location.name} ${location.address}`;
|
||||
result.lngAndLat = `${location.lng},${location.lat}`;
|
||||
visible.value = false;
|
||||
};
|
||||
</script>
|
||||
164
src/api/apps/map/components/demo-track.vue
Normal file
164
src/api/apps/map/components/demo-track.vue
Normal file
@@ -0,0 +1,164 @@
|
||||
<template>
|
||||
<a-card title="轨迹展示及轨迹回放" :bordered="false">
|
||||
<div
|
||||
ref="trackMapRef"
|
||||
style="height: 360px; max-width: 800px; margin-bottom: 16px"
|
||||
>
|
||||
</div>
|
||||
<a-space>
|
||||
<a-button type="primary" class="ele-btn-icon" @click="startTrackAnim">
|
||||
开始移动
|
||||
</a-button>
|
||||
<a-button type="primary" class="ele-btn-icon" @click="pauseTrackAnim">
|
||||
暂停移动
|
||||
</a-button>
|
||||
<a-button type="primary" class="ele-btn-icon" @click="resumeTrackAnim">
|
||||
继续移动
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, watch, onMounted, onUnmounted } from 'vue';
|
||||
import AMapLoader from '@amap/amap-jsapi-loader';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { MAP_KEY } from '@/config/setting';
|
||||
|
||||
const themeStore = useThemeStore();
|
||||
const { darkMode } = storeToRefs(themeStore);
|
||||
|
||||
//
|
||||
const trackMapRef = ref<HTMLElement | null>(null);
|
||||
|
||||
// 小车轨迹地图的实例
|
||||
let mapInsTrack: any;
|
||||
|
||||
// 小车的 marker
|
||||
let carMarker: any;
|
||||
|
||||
// 轨迹路线
|
||||
const lineData = [
|
||||
[116.478935, 39.997761],
|
||||
[116.478939, 39.997825],
|
||||
[116.478912, 39.998549],
|
||||
[116.478912, 39.998549],
|
||||
[116.478998, 39.998555],
|
||||
[116.478998, 39.998555],
|
||||
[116.479282, 39.99856],
|
||||
[116.479658, 39.998528],
|
||||
[116.480151, 39.998453],
|
||||
[116.480784, 39.998302],
|
||||
[116.480784, 39.998302],
|
||||
[116.481149, 39.998184],
|
||||
[116.481573, 39.997997],
|
||||
[116.481863, 39.997846],
|
||||
[116.482072, 39.997718],
|
||||
[116.482362, 39.997718],
|
||||
[116.483633, 39.998935],
|
||||
[116.48367, 39.998968],
|
||||
[116.484648, 39.999861]
|
||||
];
|
||||
|
||||
/* 渲染轨迹回放地图 */
|
||||
const renderTrackMap = () => {
|
||||
AMapLoader.load({
|
||||
key: MAP_KEY,
|
||||
version: '2.0',
|
||||
plugins: ['AMap.MoveAnimation', 'AMap.Marker', 'AMap.Polyline']
|
||||
})
|
||||
.then((AMap) => {
|
||||
// 渲染地图
|
||||
const option = {
|
||||
zoom: 17,
|
||||
center: [116.478935, 39.997761],
|
||||
|
||||
mapStyle: darkMode.value ? 'amap://styles/dark' : void 0
|
||||
};
|
||||
mapInsTrack = new AMap.Map(trackMapRef.value, option);
|
||||
// 创建小车 marker
|
||||
carMarker = new AMap.Marker({
|
||||
map: mapInsTrack,
|
||||
position: [116.478935, 39.997761],
|
||||
icon: 'https://a.amap.com/jsapi_demos/static/demo-center-v2/car.png',
|
||||
offset: new AMap.Pixel(-13, -26)
|
||||
});
|
||||
// 绘制轨迹
|
||||
new AMap.Polyline({
|
||||
map: mapInsTrack,
|
||||
path: lineData,
|
||||
showDir: true,
|
||||
strokeColor: '#2288FF', // 线颜色
|
||||
strokeOpacity: 1, // 线透明度
|
||||
strokeWeight: 6 // 线宽
|
||||
//strokeStyle: 'solid' // 线样式
|
||||
});
|
||||
// 通过的轨迹
|
||||
const passedPolyline = new AMap.Polyline({
|
||||
map: mapInsTrack,
|
||||
showDir: true,
|
||||
strokeColor: '#44BB55', // 线颜色
|
||||
strokeOpacity: 1, // 线透明度
|
||||
strokeWeight: 6 // 线宽
|
||||
});
|
||||
// 小车移动回调
|
||||
carMarker.on('moving', (e) => {
|
||||
passedPolyline.setPath(e.passedPath);
|
||||
});
|
||||
// 地图自适应
|
||||
mapInsTrack.setFitView();
|
||||
})
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
});
|
||||
};
|
||||
|
||||
/* 开始轨迹回放动画 */
|
||||
const startTrackAnim = () => {
|
||||
if (carMarker) {
|
||||
carMarker.stopMove();
|
||||
carMarker.moveAlong(lineData, {
|
||||
duration: 200,
|
||||
autoRotation: true
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/* 暂停轨迹回放动画 */
|
||||
const pauseTrackAnim = () => {
|
||||
if (carMarker) {
|
||||
carMarker.pauseMove();
|
||||
}
|
||||
};
|
||||
|
||||
/* 继续开始轨迹回放动画 */
|
||||
const resumeTrackAnim = () => {
|
||||
if (carMarker) {
|
||||
carMarker.resumeMove();
|
||||
}
|
||||
};
|
||||
|
||||
/* 渲染地图 */
|
||||
onMounted(() => {
|
||||
renderTrackMap();
|
||||
});
|
||||
|
||||
/* 销毁地图 */
|
||||
onUnmounted(() => {
|
||||
if (mapInsTrack) {
|
||||
mapInsTrack.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
/* 同步框架暗黑模式切换 */
|
||||
watch(darkMode, () => {
|
||||
if (mapInsTrack) {
|
||||
if (darkMode.value) {
|
||||
mapInsTrack.setMapStyle('amap://styles/dark');
|
||||
} else {
|
||||
mapInsTrack.setMapStyle('amap://styles/normal');
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
19
src/api/apps/map/index.vue
Normal file
19
src/api/apps/map/index.vue
Normal file
@@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<div class="ele-body ele-body-card">
|
||||
<demo-picker />
|
||||
<demo-map />
|
||||
<demo-track />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import DemoPicker from './components/demo-picker.vue';
|
||||
import DemoMap from './components/demo-map.vue';
|
||||
import DemoTrack from './components/demo-track.vue';
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'ExtensionMap'
|
||||
};
|
||||
</script>
|
||||
32
src/api/apps/statistics/index.ts
Normal file
32
src/api/apps/statistics/index.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import { Order, OrderParam } from '@/api/order/model';
|
||||
|
||||
/**
|
||||
* 菜品预定统计
|
||||
*/
|
||||
export async function countOrderGoods(params: any) {
|
||||
const res = await request.get<ApiResult<any>>(
|
||||
'/apps/bc-statistics/baoCanUsers',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function repairData(params?: OrderParam) {
|
||||
const res = await request.get<ApiResult<Order[]>>(
|
||||
'/apps/bc-statistics/repairData',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
15
src/api/apps/statistics/model/index.ts
Normal file
15
src/api/apps/statistics/model/index.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 链接
|
||||
*/
|
||||
export interface Link {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 链接搜索条件
|
||||
*/
|
||||
export interface LinkParam extends PageParam {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user