第一次提交
This commit is contained in:
43
src/App.vue
Normal file
43
src/App.vue
Normal file
@@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<ele-config-provider
|
||||
:map-key="MAP_KEY"
|
||||
:keep-alive="keepAlive"
|
||||
:license="LICENSE_CODE"
|
||||
>
|
||||
<a-config-provider :locale="antLocale">
|
||||
<router-view />
|
||||
</a-config-provider>
|
||||
</ele-config-provider>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { unref, computed } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import {
|
||||
MAP_KEY,
|
||||
MAP_CODE,
|
||||
LICENSE_CODE,
|
||||
TAB_KEEP_ALIVE
|
||||
} from '@/config/setting';
|
||||
import { useSetDocumentTitle } from '@/utils/document-title-util';
|
||||
import { useLocale } from '@/i18n/use-locale';
|
||||
|
||||
const themeStore = useThemeStore();
|
||||
const { showTabs } = storeToRefs(themeStore);
|
||||
|
||||
// 恢复主题
|
||||
themeStore.recoverTheme();
|
||||
|
||||
// 切换路由自动更新浏览器页签标题
|
||||
useSetDocumentTitle();
|
||||
|
||||
// 国际化配置
|
||||
const { antLocale } = useLocale();
|
||||
|
||||
// 用于内链 iframe 组件获取 KeepAlive
|
||||
const keepAlive = computed(() => TAB_KEEP_ALIVE && unref(showTabs));
|
||||
window._AMapSecurityConfig = {
|
||||
securityJsCode: MAP_CODE
|
||||
};
|
||||
</script>
|
||||
144
src/api/app/index.ts
Normal file
144
src/api/app/index.ts
Normal file
@@ -0,0 +1,144 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { App, AppParam } from './model/index';
|
||||
import { Menu } from '@/api/system/menu/model';
|
||||
|
||||
/**
|
||||
* 分页查询应用
|
||||
*/
|
||||
export async function pageApp(params: AppParam) {
|
||||
const res = await request.get<ApiResult<PageResult<App>>>('/oa/app/page', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应用列表
|
||||
*/
|
||||
export async function listApp(params?: AppParam) {
|
||||
const res = await request.get<ApiResult<App[]>>('/oa/app', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询应用
|
||||
*/
|
||||
export async function getApp(id: number) {
|
||||
const res = await request.get<ApiResult<App>>('/oa/app/' + id);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加应用
|
||||
*/
|
||||
export async function addApp(data: App) {
|
||||
const res = await request.post<ApiResult<unknown>>('/oa/app', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用
|
||||
*/
|
||||
export async function updateApp(data: App) {
|
||||
const res = await request.put<ApiResult<unknown>>('/oa/app', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用
|
||||
*/
|
||||
export async function removeApp(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/app/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除应用
|
||||
*/
|
||||
export async function removeBatchApp(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/app/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/app/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 getAppSecret(data: App) {
|
||||
const res = await request.post<ApiResult<App>>('/open/app/getAppSecret', data);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function updateAppSecret(data: App) {
|
||||
const res = await request.post<ApiResult<App>>(
|
||||
'/oa/app/updateAppSecret',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
// 添加菜单
|
||||
export async function saveMenu(data: App) {
|
||||
const res = await request.post<ApiResult<unknown>>('/oa/app/saveMenu', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
// 添加菜单按钮
|
||||
export async function saveAuthority(data: Menu[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/oa/app/saveAuthority',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
118
src/api/app/model/index.ts
Normal file
118
src/api/app/model/index.ts
Normal file
@@ -0,0 +1,118 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import { AppUser } from '@/api/app/user/model';
|
||||
|
||||
/**
|
||||
* 应用
|
||||
*/
|
||||
export interface App {
|
||||
// 应用id
|
||||
appId?: number;
|
||||
// 应用秘钥
|
||||
appSecret?: string;
|
||||
// 应用名称
|
||||
appName?: string;
|
||||
// 上级id, 0是顶级
|
||||
parentId?: number;
|
||||
// 应用编号
|
||||
appCode?: string;
|
||||
// 应用图标
|
||||
appIcon?: string;
|
||||
appQrcode?: string;
|
||||
// 应用截图
|
||||
images?: string;
|
||||
// 应用类型
|
||||
appType?: string;
|
||||
// 菜单类型
|
||||
menuType?: number;
|
||||
// 应用地址
|
||||
appUrl?: string;
|
||||
// 下载地址
|
||||
downUrl?: string;
|
||||
// 应用包名
|
||||
packageName?: string;
|
||||
// 点击次数
|
||||
clicks?: string;
|
||||
// 安装次数
|
||||
installs?: string;
|
||||
// 应用介绍
|
||||
content?: string;
|
||||
// 开发者(个人)
|
||||
developer?: string;
|
||||
// 软件定价
|
||||
price?: string;
|
||||
// 评分
|
||||
score?: string;
|
||||
// 星级
|
||||
star?: string;
|
||||
// 菜单组件地址
|
||||
component?: string;
|
||||
// 菜单路由地址
|
||||
path?: string;
|
||||
// 权限标识
|
||||
authority?: string;
|
||||
// 打开位置
|
||||
target?: string;
|
||||
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)
|
||||
hide?: number;
|
||||
// 菜单侧栏选中的path
|
||||
active?: string;
|
||||
// 其它路由元信息
|
||||
meta?: string;
|
||||
// 版本
|
||||
edition?: string;
|
||||
// 版本号
|
||||
version?: string;
|
||||
// 是否已安装
|
||||
isUse?: number;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
tenantName?: string;
|
||||
// 租户编号
|
||||
tenantCode?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 发布者
|
||||
userId?: any;
|
||||
// 发布者昵称
|
||||
nickname?: string;
|
||||
// 子菜单
|
||||
children?: App[];
|
||||
// 权限树回显选中状态, 0未选中, 1选中
|
||||
checked?: boolean;
|
||||
//
|
||||
key?: number;
|
||||
//
|
||||
value?: number;
|
||||
//
|
||||
parentIds?: number[];
|
||||
//
|
||||
openType?: number;
|
||||
//
|
||||
search?: number;
|
||||
// 成员管理
|
||||
users?: AppUser[];
|
||||
// 项目需求
|
||||
requirement?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用搜索条件
|
||||
*/
|
||||
export interface AppParam extends PageParam {
|
||||
userId?: number;
|
||||
appName?: string;
|
||||
appCode?: string;
|
||||
appId?: number;
|
||||
developer?: string;
|
||||
tenantCode?: string;
|
||||
parentId?: string;
|
||||
tenantName?: string;
|
||||
status?: number;
|
||||
nickname?: string;
|
||||
}
|
||||
106
src/api/app/user/index.ts
Normal file
106
src/api/app/user/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { AppUser, AppUserParam } from '@/api/app/user/model/index';
|
||||
|
||||
/**
|
||||
* 分页查询开发成员
|
||||
*/
|
||||
export async function pageAppUser(params: AppUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<AppUser>>>(
|
||||
'/app-user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询开发成员列表
|
||||
*/
|
||||
export async function listAppUser(params?: AppUserParam) {
|
||||
const res = await request.get<ApiResult<AppUser[]>>('/app-user', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询开发成员
|
||||
*/
|
||||
export async function getAppUser(id: number) {
|
||||
const res = await request.get<ApiResult<AppUser>>('/app-user/' + id);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加开发成员
|
||||
*/
|
||||
export async function addAppUser(data: AppUser) {
|
||||
const res = await request.post<ApiResult<unknown>>('/app-user', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改开发成员
|
||||
*/
|
||||
export async function updateAppUser(data: AppUser) {
|
||||
const res = await request.put<ApiResult<unknown>>('/app-user', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除开发成员
|
||||
*/
|
||||
export async function removeAppUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/app-user/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除开发成员
|
||||
*/
|
||||
export async function removeBatchAppUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/app-user/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>>('/app-user/existence', {
|
||||
params: { field, value, id }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
35
src/api/app/user/model/index.ts
Normal file
35
src/api/app/user/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 开发成员
|
||||
*/
|
||||
export interface AppUser {
|
||||
// 开发成员id
|
||||
appUserId?: number;
|
||||
role?: number;
|
||||
userId?: number;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
avatar?: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
appId?: number;
|
||||
status?: string;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开发成员搜索条件
|
||||
*/
|
||||
export interface AppUserParam extends PageParam {
|
||||
userId?: number;
|
||||
appId?: number;
|
||||
}
|
||||
|
||||
export interface UserItem {
|
||||
key: string;
|
||||
isEdit?: boolean;
|
||||
number?: string;
|
||||
name?: string;
|
||||
department?: string;
|
||||
}
|
||||
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 {
|
||||
|
||||
}
|
||||
125
src/api/cms/article/index.ts
Normal file
125
src/api/cms/article/index.ts
Normal file
@@ -0,0 +1,125 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Article, ArticleParam } from './model';
|
||||
// const merchantCode = localStorage.getItem('merchantCode');
|
||||
|
||||
/**
|
||||
* 分页查询文章
|
||||
*/
|
||||
export async function pageArticle(params: ArticleParam) {
|
||||
// // 按商户筛选
|
||||
// if (merchantCode != 'null') {
|
||||
// params.merchantCode = `${merchantCode}`;
|
||||
// }
|
||||
const res = await request.get<ApiResult<PageResult<Article>>>(
|
||||
'/cms/article/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文章列表
|
||||
*/
|
||||
export async function listArticle(params?: ArticleParam) {
|
||||
const res = await request.get<ApiResult<Article[]>>('/cms/article', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文章
|
||||
*/
|
||||
export async function addArticle(data: Article) {
|
||||
const res = await request.post<ApiResult<unknown>>('/cms/article', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章
|
||||
*/
|
||||
export async function updateArticle(data: Article) {
|
||||
const res = await request.put<ApiResult<unknown>>('/cms/article', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文章
|
||||
*/
|
||||
export async function removeArticle(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/cms/article/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文章
|
||||
*/
|
||||
export async function removeBatchArticle(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/cms/article/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateArticleStatus(articleId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>('/cms/article/status', {
|
||||
articleId,
|
||||
status
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询文章
|
||||
*/
|
||||
export async function getArticle(id: number) {
|
||||
const res = await request.get<ApiResult<Article>>('/cms/article/' + id);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
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>>('/cms/article/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/cms/article/model/index.ts
Normal file
72
src/api/cms/article/model/index.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 文章
|
||||
*/
|
||||
export interface Article {
|
||||
// 文章id
|
||||
articleId?: number;
|
||||
// 文章标题
|
||||
title?: string;
|
||||
// 展现方式
|
||||
showType?: number;
|
||||
// 文章类型
|
||||
categoryId?: number;
|
||||
// 封面图
|
||||
image?: string;
|
||||
// 附件
|
||||
files?: string;
|
||||
// 缩列图
|
||||
thumbnail?: string;
|
||||
// 视频地址
|
||||
video?: string;
|
||||
// 上传的文件类型
|
||||
accept?: string;
|
||||
// 来源
|
||||
source?: string;
|
||||
// 文章内容
|
||||
content?: string;
|
||||
// 虚拟阅读量
|
||||
virtualViews?: string;
|
||||
// 实际阅读量
|
||||
actualViews?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 用户昵称
|
||||
nickname?: string;
|
||||
// 账号
|
||||
username?: string;
|
||||
// 用户头像
|
||||
userAvatar?: string;
|
||||
// 所属门店ID
|
||||
shopId?: string;
|
||||
//
|
||||
likes?: number;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文章搜索条件
|
||||
*/
|
||||
export interface ArticleParam extends PageParam {
|
||||
title?: string;
|
||||
articleId?: number;
|
||||
categoryId?: string;
|
||||
status?: string;
|
||||
sortNumber?: string;
|
||||
createTime?: string;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
userId?: number;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
112
src/api/cms/category/index.ts
Normal file
112
src/api/cms/category/index.ts
Normal file
@@ -0,0 +1,112 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ArticleCategory, ArticleCategoryParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询文章分类
|
||||
*/
|
||||
export async function pageArticleCategory(params: ArticleCategoryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ArticleCategory>>>(
|
||||
'/cms/article-category/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文章分类列表
|
||||
*/
|
||||
export async function listArticleCategory(params?: ArticleCategoryParam) {
|
||||
const res = await request.get<ApiResult<ArticleCategory[]>>(
|
||||
'/cms/article-category',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文章分类
|
||||
*/
|
||||
export async function addArticleCategory(data: ArticleCategory) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/cms/article-category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章分类
|
||||
*/
|
||||
export async function updateArticleCategory(data: ArticleCategory) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/cms/article-category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文章分类
|
||||
*/
|
||||
export async function removeArticleCategory(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/cms/article-category/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文章分类
|
||||
*/
|
||||
export async function removeBatchArticleCategory(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/cms/article-category/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>>(
|
||||
'/cms/article-category/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
47
src/api/cms/category/model/index.ts
Normal file
47
src/api/cms/category/model/index.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 文章分类
|
||||
*/
|
||||
export interface ArticleCategory {
|
||||
// 文章分类id
|
||||
categoryId?: number;
|
||||
// 文章分类
|
||||
title?: string;
|
||||
// 文章分类图片
|
||||
image?: string;
|
||||
// 上级分类
|
||||
parentId?: number;
|
||||
// 封面图
|
||||
avatar?: string;
|
||||
// 用户ID
|
||||
userId?: string;
|
||||
// 所属门店ID
|
||||
shopId?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
//
|
||||
key?: number;
|
||||
//
|
||||
value?: number;
|
||||
// 子菜单
|
||||
children?: ArticleCategory[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 文章分类搜索条件
|
||||
*/
|
||||
export interface ArticleCategoryParam extends PageParam {
|
||||
title?: string;
|
||||
categoryId?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
136
src/api/cms/docs-content/index.ts
Normal file
136
src/api/cms/docs-content/index.ts
Normal file
@@ -0,0 +1,136 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { DocsContent, DocsContentParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询文档
|
||||
*/
|
||||
export async function pageDocsContent(params: DocsContentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<DocsContent>>>(
|
||||
'/cms/docs-content/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文档列表
|
||||
*/
|
||||
export async function listDocsContent(params?: DocsContentParam) {
|
||||
const res = await request.get<ApiResult<DocsContent[]>>('/cms/docs-content', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文档
|
||||
*/
|
||||
export async function addDocsContent(data: DocsContent) {
|
||||
const res = await request.post<ApiResult<unknown>>('/cms/docs-content', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文档
|
||||
*/
|
||||
export async function updateDocsContent(data: DocsContent) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/cms/docs-content',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文档
|
||||
*/
|
||||
export async function removeDocsContent(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/cms/docs-content/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文档
|
||||
*/
|
||||
export async function removeBatchDocsContent(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/cms/docs-content/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateDocsContentStatus(
|
||||
docsId?: number,
|
||||
status?: number
|
||||
) {
|
||||
const res = await request.put<ApiResult<unknown>>('/cms/docs-content/status', {
|
||||
docsId,
|
||||
status
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询文档
|
||||
*/
|
||||
export async function getDocsContent(id: number) {
|
||||
const res = await request.get<ApiResult<DocsContent>>(
|
||||
'/cms/docs-content/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
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>>(
|
||||
'/cms/docs-content/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
37
src/api/cms/docs-content/model/index.ts
Normal file
37
src/api/cms/docs-content/model/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 文档内容
|
||||
*/
|
||||
export interface DocsContent {
|
||||
// 自增ID
|
||||
docsContentId?: number;
|
||||
// 文档内容id
|
||||
docsId?: number;
|
||||
// 文档内容
|
||||
content?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
//
|
||||
key?: number;
|
||||
//
|
||||
value?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文档内容搜索条件
|
||||
*/
|
||||
export interface DocsContentParam extends PageParam {
|
||||
docsId?: number;
|
||||
content?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
117
src/api/cms/docs/index.ts
Normal file
117
src/api/cms/docs/index.ts
Normal file
@@ -0,0 +1,117 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Docs, DocsParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询文档
|
||||
*/
|
||||
export async function pageDocs(params: DocsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Docs>>>('/cms/docs/page', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文档列表
|
||||
*/
|
||||
export async function listDocs(params?: DocsParam) {
|
||||
const res = await request.get<ApiResult<Docs[]>>('/cms/docs', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文档
|
||||
*/
|
||||
export async function addDocs(data: Docs) {
|
||||
const res = await request.post<ApiResult<unknown>>('/cms/docs', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文档
|
||||
*/
|
||||
export async function updateDocs(data: Docs) {
|
||||
const res = await request.put<ApiResult<unknown>>('/cms/docs', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文档
|
||||
*/
|
||||
export async function removeDocs(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/cms/docs/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文档
|
||||
*/
|
||||
export async function removeBatchDocs(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/cms/docs/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateDocsStatus(docsId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>('/cms/docs/status', {
|
||||
docsId,
|
||||
status
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询文档
|
||||
*/
|
||||
export async function getDocs(id: number) {
|
||||
const res = await request.get<ApiResult<Docs>>('/cms/docs/' + id);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
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>>('/cms/docs/existence', {
|
||||
params: { field, value, id }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
71
src/api/cms/docs/model/index.ts
Normal file
71
src/api/cms/docs/model/index.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 文档
|
||||
*/
|
||||
export interface Docs {
|
||||
// 文档id
|
||||
docsId?: number;
|
||||
// 文档标题
|
||||
title?: string;
|
||||
// 文档类型 0目录 1文档
|
||||
type?: number;
|
||||
// 展现方式
|
||||
showType?: number;
|
||||
// 文档类型
|
||||
categoryId?: number;
|
||||
// 上级分类
|
||||
parentId?: number;
|
||||
// 封面图
|
||||
avatar?: string;
|
||||
// 来源
|
||||
source?: string;
|
||||
// 文档内容
|
||||
content?: string;
|
||||
// 虚拟阅读量
|
||||
virtualViews?: string;
|
||||
// 实际阅读量
|
||||
actualViews?: string;
|
||||
// 用户ID
|
||||
userId?: string;
|
||||
// 用户昵称
|
||||
nickname?: string;
|
||||
// 账号
|
||||
username?: string;
|
||||
// 用户头像
|
||||
userAvatar?: string;
|
||||
// 所属门店ID
|
||||
shopId?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
//
|
||||
key?: number;
|
||||
//
|
||||
value?: number;
|
||||
//
|
||||
docsContentId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文档搜索条件
|
||||
*/
|
||||
export interface DocsParam extends PageParam {
|
||||
title?: string;
|
||||
docsId?: number;
|
||||
categoryId?: string;
|
||||
status?: string;
|
||||
sortNumber?: string;
|
||||
createTime?: string;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
1
src/api/dashboard/20230508/analysis-hot-search.json
Normal file
1
src/api/dashboard/20230508/analysis-hot-search.json
Normal file
@@ -0,0 +1 @@
|
||||
{"code":0,"data":[{"name":"软妹子","value":23},{"name":"汪星人","value":23},{"name":"长腿欧巴","value":23},{"name":"萝莉","value":22},{"name":"辣~","value":22},{"name":"K歌","value":22},{"name":"大长腿","value":21},{"name":"川妹子","value":21},{"name":"女神","value":21},{"name":"米粉","value":20},{"name":"专注设计","value":20},{"name":"逛街","value":20},{"name":"黑长直","value":20},{"name":"海纳百川","value":19},{"name":"萌萌哒","value":19},{"name":"坚持","value":19},{"name":"话唠","value":19},{"name":"果粉","value":18},{"name":"喵星人","value":18},{"name":"花粉","value":18},{"name":"衬衫控","value":18},{"name":"宅男","value":17},{"name":"小清新","value":17},{"name":"眼镜男","value":17},{"name":"琼瑶","value":17},{"name":"穷游党","value":16},{"name":"铲屎官","value":16},{"name":"正太","value":16},{"name":"中二病","value":16},{"name":"夜猫子","value":15},{"name":"逗比","value":15},{"name":"腹黑","value":15},{"name":"吃鸡","value":15},{"name":"为了联盟","value":14},{"name":"背包客","value":14},{"name":"民谣","value":14},{"name":"为了部落","value":14},{"name":"懒癌患者","value":13},{"name":"追剧","value":13},{"name":"IT民工","value":13},{"name":"CNB成员","value":13},{"name":"选择困难","value":12},{"name":"锤粉","value":12},{"name":"欧皇","value":12},{"name":"仙气十足","value":12}]}
|
||||
1
src/api/dashboard/20230508/analysis-pay-num.json
Normal file
1
src/api/dashboard/20230508/analysis-pay-num.json
Normal file
@@ -0,0 +1 @@
|
||||
{"code":0,"data":[{"date":"2020-06-12","value":7},{"date":"2020-06-13","value":5},{"date":"2020-06-14","value":4},{"date":"2020-06-15","value":2},{"date":"2020-06-16","value":4},{"date":"2020-06-17","value":7},{"date":"2020-06-18","value":5},{"date":"2020-06-19","value":6},{"date":"2020-06-20","value":5},{"date":"2020-06-21","value":9},{"date":"2020-06-22","value":6},{"date":"2020-06-23","value":3},{"date":"2020-06-24","value":1},{"date":"2020-06-25","value":5},{"date":"2020-06-26","value":3},{"date":"2020-06-27","value":6},{"date":"2020-06-18","value":5}]}
|
||||
1
src/api/dashboard/20230508/analysis-saleroom.json
Normal file
1
src/api/dashboard/20230508/analysis-saleroom.json
Normal file
@@ -0,0 +1 @@
|
||||
{"code":0,"data":{"list1":[{"month":"1月","value":816},{"month":"2月","value":542},{"month":"3月","value":914},{"month":"4月","value":781},{"month":"5月","value":355},{"month":"6月","value":796},{"month":"7月","value":714},{"month":"8月","value":1195},{"month":"9月","value":1055},{"month":"10月","value":271},{"month":"11月","value":384},{"month":"12月","value":1098}],"list2":[{"month":"1月","value":1098},{"month":"2月","value":384},{"month":"3月","value":271},{"month":"4月","value":1055},{"month":"5月","value":1195},{"month":"6月","value":714},{"month":"7月","value":796},{"month":"8月","value":355},{"month":"9月","value":781},{"month":"10月","value":914},{"month":"11月","value":542},{"month":"12月","value":816}]}}
|
||||
1
src/api/dashboard/20230508/analysis-visits.json
Normal file
1
src/api/dashboard/20230508/analysis-visits.json
Normal file
@@ -0,0 +1 @@
|
||||
{"code":0,"data":[{"time":"16:00","visits":15,"views":45},{"time":"16:05","visits":39,"views":169},{"time":"16:10","visits":152,"views":400},{"time":"16:15","visits":94,"views":285},{"time":"16:20","visits":102,"views":316},{"time":"16:25","visits":86,"views":148},{"time":"16:30","visits":39,"views":150},{"time":"16:35","visits":38,"views":234},{"time":"16:40","visits":95,"views":158},{"time":"16:45","visits":30,"views":100},{"time":"16:50","visits":86,"views":266}]}
|
||||
56
src/api/dashboard/analysis/index.ts
Normal file
56
src/api/dashboard/analysis/index.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { PayNumData, SaleroomResult, VisitData, CloudData } from './model';
|
||||
|
||||
/**
|
||||
* 获取支付笔数数据
|
||||
*/
|
||||
export async function getPayNumList() {
|
||||
const res = await request.get<ApiResult<PayNumData[]>>(
|
||||
'https://oa.gxwebsoft.com/20230508/analysis-pay-num.json'
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取销售量数据
|
||||
*/
|
||||
export async function getSaleroomList() {
|
||||
const res = await request.get<ApiResult<SaleroomResult>>(
|
||||
'https://oa.gxwebsoft.com/20230508/analysis-saleroom.json'
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取最近 1 小时访问情况数据
|
||||
* @returns {Promise<Object>}
|
||||
*/
|
||||
export async function getVisitHourList() {
|
||||
const res = await request.get<ApiResult<VisitData[]>>(
|
||||
'https://oa.gxwebsoft.com/20230508/analysis-visits.json'
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取词云数据
|
||||
*/
|
||||
export async function getWordCloudList() {
|
||||
const res = await request.get<ApiResult<CloudData[]>>(
|
||||
'https://oa.gxwebsoft.com/20230508/analysis-hot-search.json'
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
46
src/api/dashboard/analysis/model/index.ts
Normal file
46
src/api/dashboard/analysis/model/index.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* 支付笔数数据格式
|
||||
*/
|
||||
export interface PayNumData {
|
||||
// 日期
|
||||
date?: string;
|
||||
// 支付笔数
|
||||
value?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 销售量数据格式
|
||||
*/
|
||||
export interface SaleroomData {
|
||||
// 月份
|
||||
month?: string;
|
||||
// 销售量
|
||||
value?: number;
|
||||
}
|
||||
|
||||
export interface SaleroomResult {
|
||||
list1: SaleroomData[];
|
||||
list2: SaleroomData[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 访问情况数据格式
|
||||
*/
|
||||
export interface VisitData {
|
||||
// 时间
|
||||
time?: string;
|
||||
// 访问量
|
||||
visits?: number;
|
||||
// 浏览量
|
||||
views?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 词云数据格式
|
||||
*/
|
||||
export interface CloudData {
|
||||
// 标题
|
||||
name: string;
|
||||
// 数量
|
||||
value: number;
|
||||
}
|
||||
114
src/api/dashboard/appstore/index.ts
Normal file
114
src/api/dashboard/appstore/index.ts
Normal file
@@ -0,0 +1,114 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { App, AppParam } from './model';
|
||||
import { Menu } from '@/api/system/menu/model';
|
||||
|
||||
/**
|
||||
* 分页查询应用
|
||||
*/
|
||||
export async function pageApp(params: AppParam) {
|
||||
const res = await request.get<ApiResult<PageResult<App>>>('/oa/app/page', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应用列表
|
||||
*/
|
||||
export async function listApp(params?: AppParam) {
|
||||
const res = await request.get<ApiResult<App[]>>('/oa/app', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加应用
|
||||
*/
|
||||
export async function addApp(data: App) {
|
||||
const res = await request.post<ApiResult<unknown>>('/oa/app', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用
|
||||
*/
|
||||
export async function updateApp(data: App) {
|
||||
const res = await request.put<ApiResult<unknown>>('/oa/app', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用
|
||||
*/
|
||||
export async function removeApp(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/app/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除应用
|
||||
*/
|
||||
export async function removeBatchApp(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/app/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/app/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 saveMenu(data: App) {
|
||||
const res = await request.post<ApiResult<unknown>>('/oa/app/saveMenu', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
// 添加菜单按钮
|
||||
export async function saveAuthority(data: Menu[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/oa/app/saveAuthority',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
97
src/api/dashboard/appstore/model/index.ts
Normal file
97
src/api/dashboard/appstore/model/index.ts
Normal file
@@ -0,0 +1,97 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 应用
|
||||
*/
|
||||
export interface App {
|
||||
// 应用id
|
||||
appId?: number;
|
||||
// 应用名称
|
||||
appName?: string;
|
||||
// 上级id, 0是顶级
|
||||
parentId?: number;
|
||||
// 应用编号
|
||||
appCode?: string;
|
||||
// 应用图标
|
||||
appIcon?: string;
|
||||
// 应用类型
|
||||
appType?: string;
|
||||
// 菜单类型
|
||||
menuType?: number;
|
||||
// 应用地址
|
||||
appUrl?: string;
|
||||
// 下载地址
|
||||
downUrl?: string;
|
||||
// 应用包名
|
||||
packageName?: string;
|
||||
// 点击次数
|
||||
clicks?: string;
|
||||
// 安装次数
|
||||
installs?: string;
|
||||
// 应用介绍
|
||||
content?: string;
|
||||
// 开发者(个人)
|
||||
developer?: string;
|
||||
// 软件定价
|
||||
price?: string;
|
||||
// 评分
|
||||
score?: string;
|
||||
// 星级
|
||||
star?: string;
|
||||
// 菜单组件地址
|
||||
component?: string;
|
||||
// 菜单路由地址
|
||||
path?: string;
|
||||
// 权限标识
|
||||
authority?: string;
|
||||
// 打开位置
|
||||
target?: string;
|
||||
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)
|
||||
hide?: number;
|
||||
// 菜单侧栏选中的path
|
||||
active?: string;
|
||||
// 其它路由元信息
|
||||
meta?: string;
|
||||
// 版本
|
||||
edition?: string;
|
||||
// 版本号
|
||||
version?: string;
|
||||
// 是否已安装
|
||||
isUse?: number;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 发布者
|
||||
userId?: any;
|
||||
// 发布者昵称
|
||||
nickname?: string;
|
||||
// 子菜单
|
||||
children?: App[];
|
||||
// 权限树回显选中状态, 0未选中, 1选中
|
||||
checked?: boolean;
|
||||
//
|
||||
key?: number;
|
||||
//
|
||||
value?: number;
|
||||
//
|
||||
parentIds?: number[];
|
||||
//
|
||||
openType?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用搜索条件
|
||||
*/
|
||||
export interface AppParam extends PageParam {
|
||||
appName?: string;
|
||||
appCode?: string;
|
||||
developer?: string;
|
||||
parentId?: number;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
44
src/api/dashboard/monitor/index.ts
Normal file
44
src/api/dashboard/monitor/index.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { UserCount, BrowserCount } from './model';
|
||||
const BASE_URL = import.meta.env.BASE_URL;
|
||||
|
||||
/**
|
||||
* 获取中国地图geo数据
|
||||
*/
|
||||
export async function getChinaMapData() {
|
||||
const res = await request.get<any>(
|
||||
BASE_URL + 'json/china-provinces.geo.json',
|
||||
{ baseURL: '' }
|
||||
);
|
||||
if (res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error('获取地图数据失败'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户分布数据
|
||||
*/
|
||||
export async function getUserCountList() {
|
||||
const res = await request.get<ApiResult<UserCount[]>>(
|
||||
'https://cdn.eleadmin.com/20200610/monitor-user-count.json'
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户浏览器分布数据
|
||||
*/
|
||||
export async function getBrowserCountList() {
|
||||
const res = await request.get<ApiResult<BrowserCount[]>>(
|
||||
'https://cdn.eleadmin.com/20200610/monitor-browser-count.json'
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
21
src/api/dashboard/monitor/model/index.ts
Normal file
21
src/api/dashboard/monitor/model/index.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* 用户分布数据格式
|
||||
*/
|
||||
export interface UserCount {
|
||||
// 省份
|
||||
name: string;
|
||||
// 用户数量
|
||||
value: number;
|
||||
// 百分比
|
||||
percent?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 浏览器分布数据格式
|
||||
*/
|
||||
export interface BrowserCount {
|
||||
// 浏览器
|
||||
name: string;
|
||||
// 用户数量
|
||||
value: number;
|
||||
}
|
||||
99
src/api/goods/category/index.ts
Normal file
99
src/api/goods/category/index.ts
Normal file
@@ -0,0 +1,99 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Category, CategoryParam } from './model';
|
||||
// const merchantCode = String(localStorage.getItem('merchantCode'));
|
||||
|
||||
/**
|
||||
* 分页查询商品分类
|
||||
*/
|
||||
export async function pageCategory(params: CategoryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Category>>>(
|
||||
'/shop/category/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品分类列表
|
||||
*/
|
||||
export async function listCategory(params?: CategoryParam) {
|
||||
const res = await request.get<ApiResult<Category[]>>('/shop/category', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品分类
|
||||
*/
|
||||
export async function addCategory(data: Category) {
|
||||
const res = await request.post<ApiResult<unknown>>('/shop/category', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品分类
|
||||
*/
|
||||
export async function updateCategory(data: Category) {
|
||||
const res = await request.put<ApiResult<unknown>>('/shop/category', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品分类
|
||||
*/
|
||||
export async function removeCategory(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/shop/category/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品分类
|
||||
*/
|
||||
export async function removeBatchCategory(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/shop/category/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>>(
|
||||
'/shop/category/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
51
src/api/goods/category/model/index.ts
Normal file
51
src/api/goods/category/model/index.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品分类
|
||||
*/
|
||||
export interface Category {
|
||||
// 商品分类id
|
||||
categoryId?: number;
|
||||
// 商品分类
|
||||
title?: string;
|
||||
// 商品分类图片
|
||||
image?: string;
|
||||
// 上级分类
|
||||
parentId?: number;
|
||||
// 是否隐藏
|
||||
hide?: number;
|
||||
// 封面图
|
||||
avatar?: string;
|
||||
// 用户ID
|
||||
userId?: string;
|
||||
// 所属门店ID
|
||||
shopId?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
//
|
||||
key?: number;
|
||||
//
|
||||
merchantCode?: string;
|
||||
value?: any;
|
||||
// 子菜单
|
||||
children?: Category[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品分类搜索条件
|
||||
*/
|
||||
export interface CategoryParam extends PageParam {
|
||||
title?: string;
|
||||
categoryId?: number;
|
||||
parentId?: number;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
76
src/api/goods/comment/index.ts
Normal file
76
src/api/goods/comment/index.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Comment, CommentParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询商品评价
|
||||
*/
|
||||
export async function pageComments(params: CommentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Comment>>>(
|
||||
'/shop/comment/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品评价列表
|
||||
*/
|
||||
export async function listComments(params?: CommentParam) {
|
||||
const res = await request.get<ApiResult<Comment[]>>('/shop/comment', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品评价
|
||||
*/
|
||||
export async function addComment(data: Comment) {
|
||||
const res = await request.post<ApiResult<unknown>>('/shop/comment', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品评价
|
||||
*/
|
||||
export async function updateComment(data: Comment) {
|
||||
const res = await request.put<ApiResult<unknown>>('/shop/comment', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品评价
|
||||
*/
|
||||
export async function removeComment(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/shop/comment/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品评价
|
||||
*/
|
||||
export async function removeComments(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/shop/comment/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
30
src/api/goods/comment/model/index.ts
Normal file
30
src/api/goods/comment/model/index.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品评价
|
||||
*/
|
||||
export interface Comment {
|
||||
// 商品评价id
|
||||
commentId?: number;
|
||||
// 商品评价标识
|
||||
commentCode?: string;
|
||||
// 商品评价名称
|
||||
commentName?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品评价搜索条件
|
||||
*/
|
||||
export interface CommentParam extends PageParam {
|
||||
type?: string;
|
||||
goodsName?: string;
|
||||
goodsCode?: string;
|
||||
userId?: string;
|
||||
score?: number;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
95
src/api/goods/index.ts
Normal file
95
src/api/goods/index.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Goods, GoodsParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询商品
|
||||
*/
|
||||
export async function pageGoods(params: GoodsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Goods>>>(
|
||||
'/shop/goods/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品列表
|
||||
*/
|
||||
export async function listGoods(params?: GoodsParam) {
|
||||
const res = await request.get<ApiResult<Goods[]>>('/shop/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 addGoods(data: Goods) {
|
||||
const res = await request.post<ApiResult<unknown>>('/shop/goods', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品
|
||||
*/
|
||||
export async function updateGoods(data: Goods) {
|
||||
const res = await request.put<ApiResult<unknown>>('/shop/goods', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品
|
||||
*/
|
||||
export async function removeGoods(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/shop/goods/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品
|
||||
*/
|
||||
export async function removeBatchGoods(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/shop/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>>('/shop/goods/existence', {
|
||||
params: { field, value, id }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
53
src/api/goods/model/index.ts
Normal file
53
src/api/goods/model/index.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品
|
||||
*/
|
||||
export interface Goods {
|
||||
goodsType?: number;
|
||||
goodsId?: number;
|
||||
goodsName?: string;
|
||||
goodsCode?: string;
|
||||
period?: string;
|
||||
gear?: number;
|
||||
categoryId?: number;
|
||||
categoryName?: 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;
|
||||
goodsPriceMin?: number;
|
||||
linePriceMin?: number;
|
||||
linePriceMax?: number;
|
||||
sellingPoint?: string;
|
||||
purchaseLimit?: number;
|
||||
deductStockType?: number;
|
||||
salesActual?: number;
|
||||
goodsWeight?: number;
|
||||
stockTotal?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface GoodsParam extends PageParam {
|
||||
goodsId?: number;
|
||||
goodsName?: string;
|
||||
goodsCode?: string;
|
||||
listType?: string;
|
||||
status?: number;
|
||||
stockTotal?: number;
|
||||
merchantCode?: string;
|
||||
}
|
||||
76
src/api/goods/service/index.ts
Normal file
76
src/api/goods/service/index.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Service, ServiceParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询服务承诺
|
||||
*/
|
||||
export async function pageServices(params: ServiceParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Service>>>(
|
||||
'/shop/goods-service/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询服务承诺列表
|
||||
*/
|
||||
export async function listServices(params?: ServiceParam) {
|
||||
const res = await request.get<ApiResult<Service[]>>('/shop/goods-service', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加服务承诺
|
||||
*/
|
||||
export async function addService(data: Service) {
|
||||
const res = await request.post<ApiResult<unknown>>('/shop/goods-service', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改服务承诺
|
||||
*/
|
||||
export async function updateService(data: Service) {
|
||||
const res = await request.put<ApiResult<unknown>>('/shop/goods-service', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除服务承诺
|
||||
*/
|
||||
export async function removeService(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/shop/goods-service/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除服务承诺
|
||||
*/
|
||||
export async function removeServices(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/shop/goods-service/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
29
src/api/goods/service/model/index.ts
Normal file
29
src/api/goods/service/model/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 服务承诺
|
||||
*/
|
||||
export interface Service {
|
||||
// 服务承诺id
|
||||
serviceId?: number;
|
||||
// 服务承诺名称
|
||||
name?: string;
|
||||
// 描述
|
||||
summary?: string;
|
||||
// 是否默认勾选
|
||||
isDefault?: number;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务承诺搜索条件
|
||||
*/
|
||||
export interface ServiceParam extends PageParam {
|
||||
serviceId?: string;
|
||||
name?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
99
src/api/house/info/index.ts
Normal file
99
src/api/house/info/index.ts
Normal file
@@ -0,0 +1,99 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { HouseInfo, HouseInfoParam } from '@/api/house/info/model';
|
||||
/**
|
||||
* 分页查询用户详细资料
|
||||
*/
|
||||
export async function pageHouseInfo(params: HouseInfoParam) {
|
||||
const res = await request.get<ApiResult<PageResult<HouseInfo>>>(
|
||||
'/house/info/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户详细资料列表
|
||||
*/
|
||||
export async function listHouseInfo(params?: HouseInfoParam) {
|
||||
const res = await request.get<ApiResult<HouseInfo[]>>('/house/info', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户详细资料
|
||||
*/
|
||||
export async function addHouseInfo(data: HouseInfo) {
|
||||
const res = await request.post<ApiResult<unknown>>('/house/info', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户详细资料
|
||||
*/
|
||||
export async function updateHouseInfo(data: HouseInfo) {
|
||||
const res = await request.put<ApiResult<unknown>>('/house/info', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定用户详细资料
|
||||
*/
|
||||
export async function bindHouseInfo(data: HouseInfo) {
|
||||
const res = await request.put<ApiResult<unknown>>('/house/info/bind', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加设备
|
||||
*/
|
||||
export async function addBatchHouseInfo(data: HouseInfo[]) {
|
||||
const res = await request.post<ApiResult<unknown>>('/house/info/batch', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户详细资料
|
||||
*/
|
||||
export async function removeHouseInfo(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/house/info/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户详细资料
|
||||
*/
|
||||
export async function removeBatchHouseInfo(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/house/info/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
51
src/api/house/info/model/index.ts
Normal file
51
src/api/house/info/model/index.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface HouseInfo {
|
||||
houseId?: number;
|
||||
userId?: number;
|
||||
houseTitle?: string;
|
||||
cityByHouse?: string;
|
||||
houseType?: string;
|
||||
leaseMethod?: string;
|
||||
rent?: number;
|
||||
monthlyRent?: number;
|
||||
extent?: number;
|
||||
floor?: string;
|
||||
roomNumber?: string;
|
||||
realName?: string;
|
||||
nickname?: string;
|
||||
houseLabel?: any;
|
||||
address?: string;
|
||||
longitude?: string;
|
||||
latitude?: string;
|
||||
phone?: string;
|
||||
password?: string;
|
||||
toward?: string;
|
||||
files?: string;
|
||||
content?: string;
|
||||
expirationTime?: string;
|
||||
province?: string;
|
||||
city?: string;
|
||||
region?: string;
|
||||
area?: string;
|
||||
status?: number;
|
||||
comments?: any;
|
||||
sortNumber?: number;
|
||||
deleted?: number;
|
||||
tenantId?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
isEdit?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface HouseInfoParam extends PageParam {
|
||||
houseId?: number;
|
||||
houseTitle?: string;
|
||||
userId?: number;
|
||||
status?: number;
|
||||
nickname?: string;
|
||||
keywords?: any;
|
||||
}
|
||||
41
src/api/index.ts
Normal file
41
src/api/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* 接口统一返回结果
|
||||
*/
|
||||
export interface ApiResult<T> {
|
||||
// 状态码
|
||||
code: number;
|
||||
// 状态信息
|
||||
message?: string;
|
||||
// 返回数据
|
||||
data?: T;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询统一结果
|
||||
*/
|
||||
export interface PageResult<T> {
|
||||
// 返回数据
|
||||
list: T[];
|
||||
// 总数量
|
||||
count: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询基本参数
|
||||
*/
|
||||
export interface PageParam {
|
||||
// 第几页
|
||||
page?: number;
|
||||
// 每页多少条
|
||||
limit?: number;
|
||||
// 排序字段
|
||||
sort?: string;
|
||||
// 排序方式, asc升序, desc降序
|
||||
order?: string;
|
||||
// 租户ID
|
||||
tenantId?: number;
|
||||
// 搜素关键词
|
||||
keywords?: string;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
}
|
||||
91
src/api/json.ts
Normal file
91
src/api/json.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* 默认字典数据
|
||||
*/
|
||||
export async function getLinkType() {
|
||||
return {
|
||||
list: [
|
||||
{ value: '0', label: '应用组件', text: '应用组件', comments: '' },
|
||||
{ value: '1', label: '外部链接', text: '外部链接', comments: '' }
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
// 默认字典数据
|
||||
export function getJson(dictName) {
|
||||
if (dictName == 'customerFollowStatus') {
|
||||
return [
|
||||
{ value: '1', label: '初访', text: '初访', comments: '' },
|
||||
{ value: '2', label: '意向', text: '意向', comments: '' },
|
||||
{ value: '3', label: '报价', text: '报价', comments: '' },
|
||||
{ value: '4', label: '成交', text: '成交', comments: '' },
|
||||
{ value: '5', label: '暂时搁置', text: '暂时搁置', comments: '' },
|
||||
{ value: '6', label: '未成交', text: '未成交', comments: '' }
|
||||
];
|
||||
}
|
||||
if (dictName == 'customerCategory') {
|
||||
return [
|
||||
{ value: 'my', label: '我创建的', text: '我创建的', comments: '' },
|
||||
{ value: 'stars', label: '标星客户', text: '标星客户', comments: '' },
|
||||
{ value: 'join', label: '我协作的', text: '我协作的', comments: '' }
|
||||
];
|
||||
}
|
||||
if (dictName == 'orderType') {
|
||||
return [
|
||||
{ value: 'all', label: '全部订单', text: '全部订单', comments: '' },
|
||||
{ value: 'delivery', label: '待发货', text: '待发货', comments: '' },
|
||||
{ value: 'receipt', label: '待收货', text: '待收货', comments: '' },
|
||||
{ value: 'pay', label: '待付款', text: '待付款', comments: '' },
|
||||
{ value: 'complete', label: '已完成', text: '已完成', comments: '' },
|
||||
{ value: 'cancel', label: '已取消', text: '已取消', comments: '' }
|
||||
];
|
||||
}
|
||||
if (dictName == 'customerSource') {
|
||||
return [
|
||||
{ value: '搜索引擎', label: '搜索引擎', text: '搜索引擎', comments: '' },
|
||||
{ value: '客户介绍', label: '客户介绍', text: '客户介绍', comments: '' },
|
||||
{ value: '代理商', label: '代理商', text: '代理商', comments: '' },
|
||||
{ value: '社交推广', label: '社交推广', text: '社交推广', comments: '' },
|
||||
{ value: '其他', label: '其他', text: '其他', comments: '' }
|
||||
];
|
||||
}
|
||||
if (dictName == 'serverBrand') {
|
||||
return [
|
||||
{ value: '阿里云', label: '阿里云', text: '阿里云', comments: '' },
|
||||
{ value: '腾讯云', label: '腾讯云', text: '腾讯云', comments: '' },
|
||||
{ value: '华为云', label: '华为云', text: '华为云', comments: '' },
|
||||
{ value: '西部数码', label: '西部数码', text: '西部数码', comments: '' },
|
||||
{ value: '其他', label: '其他', text: '其他', comments: '' }
|
||||
];
|
||||
}
|
||||
if (dictName == 'orderType') {
|
||||
return [
|
||||
{ value: 'all', label: '全部订单', text: '全部订单', comments: '' },
|
||||
{ value: 'delivery', label: '待发货', text: '待发货', comments: '' },
|
||||
{ value: 'receipt', label: '待收货', text: '待收货', comments: '' },
|
||||
{ value: 'pay', label: '待付款', text: '待付款', comments: '' },
|
||||
{ value: 'complete', label: '已完成', text: '已完成', comments: '' },
|
||||
{ value: 'cancel', label: '已取消', text: '已取消', comments: '' }
|
||||
];
|
||||
}
|
||||
if (dictName == 'sex') {
|
||||
return [
|
||||
{ value: '1', label: '男', text: '男', comments: null },
|
||||
{ value: '2', label: '女', text: '女', comments: null }
|
||||
];
|
||||
}
|
||||
if (dictName == 'payMethod') {
|
||||
return [
|
||||
{
|
||||
value: '余额支付',
|
||||
label: '余额支付',
|
||||
text: '余额支付'
|
||||
},
|
||||
{
|
||||
value: '微信支付',
|
||||
label: '微信支付',
|
||||
text: '微信支付'
|
||||
},
|
||||
{ value: '支付宝', label: '支付宝', text: '支付宝' }
|
||||
];
|
||||
}
|
||||
}
|
||||
120
src/api/layout/index.ts
Normal file
120
src/api/layout/index.ts
Normal file
@@ -0,0 +1,120 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { User } from '@/api/system/user/model';
|
||||
import type { UpdatePasswordParam, NoticeResult } from './model';
|
||||
|
||||
/**
|
||||
* 获取当前登录的用户信息、菜单、权限、角色
|
||||
*/
|
||||
export async function getUserInfo(): Promise<User> {
|
||||
const res = await request.get<ApiResult<User>>('/auth/user');
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改当前登录的用户密码
|
||||
*/
|
||||
export async function updatePassword(
|
||||
data: UpdatePasswordParam
|
||||
): Promise<string> {
|
||||
const res = await request.put<ApiResult<unknown>>('/auth/password', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message ?? '修改成功';
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询未读通知
|
||||
*/
|
||||
export async function getUnreadNotice(): Promise<NoticeResult> {
|
||||
return {
|
||||
notice: [
|
||||
{
|
||||
color: '#60B2FC',
|
||||
icon: 'NotificationFilled',
|
||||
title: '你收到了一封14份新周报',
|
||||
time: '2020-07-27 18:30:18'
|
||||
},
|
||||
{
|
||||
color: '#F5686F',
|
||||
icon: 'PushpinFilled',
|
||||
title: '许经理同意了你的请假申请',
|
||||
time: '2020-07-27 09:08:36'
|
||||
},
|
||||
{
|
||||
color: '#7CD734',
|
||||
icon: 'VideoCameraFilled',
|
||||
title: '陈总邀请你参加视频会议',
|
||||
time: '2020-07-26 18:30:01'
|
||||
},
|
||||
{
|
||||
color: '#FAAD14',
|
||||
icon: 'CarryOutFilled',
|
||||
title: '你推荐的刘诗雨已通过第三轮面试',
|
||||
time: '2020-07-25 16:38:46'
|
||||
},
|
||||
{
|
||||
color: '#2BCACD',
|
||||
icon: 'BellFilled',
|
||||
title: '你的6月加班奖金已发放',
|
||||
time: '2020-07-25 11:03:31'
|
||||
}
|
||||
],
|
||||
letter: [
|
||||
{
|
||||
avatar:
|
||||
'https://cdn.eleadmin.com/20200609/c184eef391ae48dba87e3057e70238fb.jpg',
|
||||
title: 'SunSmile 评论了你的日志',
|
||||
content: '写的不错, 以后多多向你学习~',
|
||||
time: '2020-07-27 18:30:18'
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
'https://cdn.eleadmin.com/20200609/948344a2a77c47a7a7b332fe12ff749a.jpg',
|
||||
title: '刘诗雨 点赞了你的日志',
|
||||
content: '写的不错, 以后多多向你学习~',
|
||||
time: '2020-07-27 09:08:36'
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
'https://cdn.eleadmin.com/20200609/2d98970a51b34b6b859339c96b240dcd.jpg',
|
||||
title: '酷酷的大叔 评论了你的周报',
|
||||
content: '写的不错, 以后多多向你学习~',
|
||||
time: '2020-07-26 18:30:01'
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
'https://cdn.eleadmin.com/20200609/f6bc05af944a4f738b54128717952107.jpg',
|
||||
title: 'Jasmine 点赞了你的周报',
|
||||
content: '写的不错, 以后多多向你学习~',
|
||||
time: '2020-07-25 11:03:31'
|
||||
}
|
||||
],
|
||||
todo: [
|
||||
{
|
||||
status: 0,
|
||||
title: '刘诗雨的请假审批',
|
||||
description: '刘诗雨在 07-27 18:30 提交的请假申请'
|
||||
},
|
||||
{
|
||||
status: 1,
|
||||
title: '第三方代码紧急变更',
|
||||
description: '需要在 2020-07-27 之前完成'
|
||||
},
|
||||
{
|
||||
status: 2,
|
||||
title: '信息安全考试',
|
||||
description: '需要在 2020-07-26 18:30 前完成'
|
||||
},
|
||||
{
|
||||
status: 2,
|
||||
title: 'EleAdmin发布新版本',
|
||||
description: '需要在 2020-07-25 11:03 前完成'
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
58
src/api/layout/model/index.ts
Normal file
58
src/api/layout/model/index.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* 修改密码参数
|
||||
*/
|
||||
export interface UpdatePasswordParam {
|
||||
// 新密码
|
||||
password: string;
|
||||
// 原始密码
|
||||
oldPassword: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知数据格式
|
||||
*/
|
||||
export interface NoticeModel {
|
||||
// 图标颜色
|
||||
color?: string;
|
||||
// 图标
|
||||
icon?: string;
|
||||
// 标题
|
||||
title?: string;
|
||||
// 时间
|
||||
time?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 私信数据格式
|
||||
*/
|
||||
export interface LetterModel {
|
||||
// 头像
|
||||
avatar?: string;
|
||||
// 标题
|
||||
title?: string;
|
||||
// 内容
|
||||
content?: string;
|
||||
// 时间
|
||||
time?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 代办数据格式
|
||||
*/
|
||||
export interface TodoModel {
|
||||
// 状态
|
||||
status?: number;
|
||||
// 标题
|
||||
title?: string;
|
||||
// 描述
|
||||
description?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询未读通知返回结果
|
||||
*/
|
||||
export interface NoticeResult {
|
||||
notice: NoticeModel[];
|
||||
letter: LetterModel[];
|
||||
todo: TodoModel[];
|
||||
}
|
||||
72
src/api/login/index.ts
Normal file
72
src/api/login/index.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
import type { ApiResult } from '@/api';
|
||||
import { UpdatePasswordParam } from '@/api/layout/model';
|
||||
import { User } from '@/api/system/user/model';
|
||||
import request from '@/utils/request';
|
||||
import { setToken } from '@/utils/token-util';
|
||||
import type {
|
||||
CaptchaResult,
|
||||
LoginParam,
|
||||
LoginResult,
|
||||
SmsCaptchaResult
|
||||
} from './model';
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
export async function login(data: LoginParam) {
|
||||
const res = await request.post<ApiResult<LoginResult>>('/login', data);
|
||||
if (res.data.code === 0) {
|
||||
setToken(res.data.data?.access_token, data.remember);
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取验证码
|
||||
*/
|
||||
export async function getCaptcha() {
|
||||
const res = await request.get<ApiResult<CaptchaResult>>('/captcha');
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送短信验证码
|
||||
*/
|
||||
export async function sendSmsCaptcha(data: LoginParam) {
|
||||
const res = await request.post<ApiResult<SmsCaptchaResult>>(
|
||||
'/sendSmsCaptcha',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改当前登录的用户密码
|
||||
*/
|
||||
export async function updatePassword(
|
||||
data: UpdatePasswordParam
|
||||
): Promise<string> {
|
||||
const res = await request.put<ApiResult<unknown>>('/password', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message ?? '修改成功';
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册用户
|
||||
*/
|
||||
export async function registerUser(data: User) {
|
||||
const res = await request.post<ApiResult<unknown>>('/register', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
47
src/api/login/model/index.ts
Normal file
47
src/api/login/model/index.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { User } from '../../system/user/model';
|
||||
/**
|
||||
* 登录参数
|
||||
*/
|
||||
export interface LoginParam {
|
||||
// 账号
|
||||
username?: string;
|
||||
// 密码
|
||||
password?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 是否记住密码
|
||||
remember?: boolean;
|
||||
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
//
|
||||
key?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录返回结果
|
||||
*/
|
||||
export interface LoginResult {
|
||||
// token
|
||||
access_token?: string;
|
||||
// 用户信息
|
||||
user?: User;
|
||||
}
|
||||
|
||||
/**
|
||||
* 图形验证码返回结果
|
||||
*/
|
||||
export interface CaptchaResult {
|
||||
// 图形验证码base64数据
|
||||
base64: string;
|
||||
// 验证码文本
|
||||
text: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 短信验证码返回结果
|
||||
*/
|
||||
export interface SmsCaptchaResult {
|
||||
// 验证码文本
|
||||
text: string;
|
||||
}
|
||||
24
src/api/login/wx-official/index.ts
Normal file
24
src/api/login/wx-official/index.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
/**
|
||||
* 微信公众号授权登录
|
||||
*/
|
||||
export async function getCode() {
|
||||
const res = await request.get<ApiResult<unknown>>('/wx-official/code');
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信公众号授权登录
|
||||
*/
|
||||
export async function wxOfficialLogin() {
|
||||
const res = await request.get<ApiResult<unknown>>('/wx-official');
|
||||
console.log(res.data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
47
src/api/login/wx-official/model/index.ts
Normal file
47
src/api/login/wx-official/model/index.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { User } from '../../../system/user/model';
|
||||
/**
|
||||
* 登录参数
|
||||
*/
|
||||
export interface LoginParam {
|
||||
// 账号
|
||||
username?: string;
|
||||
// 密码
|
||||
password?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 是否记住密码
|
||||
remember?: boolean;
|
||||
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
//
|
||||
key?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录返回结果
|
||||
*/
|
||||
export interface LoginResult {
|
||||
// token
|
||||
access_token?: string;
|
||||
// 用户信息
|
||||
user?: User;
|
||||
}
|
||||
|
||||
/**
|
||||
* 图形验证码返回结果
|
||||
*/
|
||||
export interface CaptchaResult {
|
||||
// 图形验证码base64数据
|
||||
base64: string;
|
||||
// 验证码文本
|
||||
text: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 短信验证码返回结果
|
||||
*/
|
||||
export interface SmsCaptchaResult {
|
||||
// 验证码文本
|
||||
text: string;
|
||||
}
|
||||
113
src/api/love/certficate/index.ts
Normal file
113
src/api/love/certficate/index.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
Certificate,
|
||||
CertificateParam
|
||||
} from '@/api/love/certficate/model';
|
||||
/**
|
||||
* 分页查询证件
|
||||
*/
|
||||
export async function pageCertificate(params: CertificateParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Certificate>>>(
|
||||
'/love/certificate/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询证件列表
|
||||
*/
|
||||
export async function listCertificate(params?: CertificateParam) {
|
||||
const res = await request.get<ApiResult<Certificate[]>>('/love/certificate', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加证件
|
||||
*/
|
||||
export async function addCertificate(data: Certificate) {
|
||||
const res = await request.post<ApiResult<unknown>>('/love/certificate', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改证件
|
||||
*/
|
||||
export async function updateCertificate(data: Certificate) {
|
||||
const res = await request.put<ApiResult<unknown>>('/love/certificate', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定证件
|
||||
*/
|
||||
export async function bindCertificate(data: Certificate) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/love/certificate/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加设备
|
||||
*/
|
||||
export async function addBatchCertificate(data: Certificate[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/love/certificate/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除证件
|
||||
*/
|
||||
export async function removeCertificate(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/love/certificate/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除证件
|
||||
*/
|
||||
export async function removeBatchCertificate(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/love/certificate/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
39
src/api/love/certficate/model/index.ts
Normal file
39
src/api/love/certficate/model/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface Certificate {
|
||||
certificateId?: undefined;
|
||||
certificateName?: string;
|
||||
fullName?: string;
|
||||
certificateCode?: object;
|
||||
certificateType?: string;
|
||||
files?: string[];
|
||||
realName?: string;
|
||||
nickname?: string;
|
||||
phone?: number;
|
||||
avatar?: string;
|
||||
expirationTime?: string;
|
||||
businessEntity?: string;
|
||||
college?: string;
|
||||
companyName?: string;
|
||||
cityByHouse?: string;
|
||||
status?: number;
|
||||
authentication?: number;
|
||||
comments?: string;
|
||||
sortNumber?: number;
|
||||
userId?: number;
|
||||
deleted?: number;
|
||||
tenantId?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface CertificateParam extends PageParam {
|
||||
certificateId?: number;
|
||||
certificateType?: string;
|
||||
certificateName?: string;
|
||||
status?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
156
src/api/love/chat/index.ts
Normal file
156
src/api/love/chat/index.ts
Normal file
@@ -0,0 +1,156 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
ChatConversation,
|
||||
ChatConversationParam,
|
||||
ChatMessage,
|
||||
ChatMessageParam
|
||||
} from '@/api/love/chat/model';
|
||||
|
||||
/**
|
||||
* 查询聊天列表
|
||||
*/
|
||||
export async function pageChatConversation(params: ChatConversationParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ChatConversation>>>(
|
||||
'/love/chat-conversation/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询聊天列表
|
||||
*/
|
||||
export async function pageChatMessage(params: ChatMessageParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ChatMessage>>>(
|
||||
'/love/chat-message/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
/**
|
||||
* 查询日志列表
|
||||
*/
|
||||
export async function listChatConversation(params?: ChatConversationParam) {
|
||||
const res = await request.get<ApiResult<ChatConversation[]>>(
|
||||
'/love/chat-conversation',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加日志
|
||||
*/
|
||||
export async function addChatMessage(data: ChatMessage) {
|
||||
const res = await request.post<ApiResult<ChatConversation>>(
|
||||
'/love/chat-message',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加日志
|
||||
*/
|
||||
export async function addChatConversation(data: ChatConversation) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/love/chat-conversation',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改日志
|
||||
*/
|
||||
export async function updateChatConversation(data: any) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/love/chat-conversation',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定日志
|
||||
*/
|
||||
export async function bindChatConversation(data: ChatConversation) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/love/chat-conversation/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加
|
||||
*/
|
||||
export async function addBatchChatConversation(data: ChatConversation[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/love/chat-conversation/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除日志
|
||||
*/
|
||||
export async function removeChatConversation(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/love/chat-conversation/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除日志
|
||||
*/
|
||||
export async function removeBatchChatConversation(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/love/chat-conversation/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
50
src/api/love/chat/model/index.ts
Normal file
50
src/api/love/chat/model/index.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import type { User } from '@/api/system/user/model';
|
||||
import { UserProfile } from '@/api/love/user-profile/model';
|
||||
|
||||
export interface ChatConversation {
|
||||
id?: number;
|
||||
userId?: number;
|
||||
friendId?: number;
|
||||
userInfo?: User;
|
||||
userProfile?: UserProfile;
|
||||
friendInfo?: User;
|
||||
content: string;
|
||||
messages: ChatMessage[];
|
||||
unRead: number;
|
||||
createTime?: string;
|
||||
updateTime: string | number | Date;
|
||||
}
|
||||
|
||||
export interface ChatMessage {
|
||||
id?: number;
|
||||
formUserId?: number;
|
||||
formUserInfo?: User;
|
||||
toUserInfo?: User;
|
||||
toUserId?: number;
|
||||
type: string;
|
||||
content: string;
|
||||
status?: number;
|
||||
createTime?: number;
|
||||
updateTime?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface ChatConversationParam extends PageParam {
|
||||
userId?: number;
|
||||
status: number;
|
||||
onlyFake: boolean;
|
||||
keywords: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface ChatMessageParam extends PageParam {
|
||||
formUserId?: number;
|
||||
toUserId?: number;
|
||||
type?: string;
|
||||
keywords: string;
|
||||
}
|
||||
99
src/api/love/grade/index.ts
Normal file
99
src/api/love/grade/index.ts
Normal file
@@ -0,0 +1,99 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Grade, GradeParam } from '@/api/love/grade/model';
|
||||
/**
|
||||
* 分页查询仓库
|
||||
*/
|
||||
export async function pageGrade(params: GradeParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Grade>>>(
|
||||
'/love/grade/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仓库列表
|
||||
*/
|
||||
export async function listGrade(params?: GradeParam) {
|
||||
const res = await request.get<ApiResult<Grade[]>>('/love/grade', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加仓库
|
||||
*/
|
||||
export async function addGrade(data: Grade) {
|
||||
const res = await request.post<ApiResult<unknown>>('/love/grade', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仓库
|
||||
*/
|
||||
export async function updateGrade(data: Grade) {
|
||||
const res = await request.put<ApiResult<unknown>>('/love/grade', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定仓库
|
||||
*/
|
||||
export async function bindGrade(data: Grade) {
|
||||
const res = await request.put<ApiResult<unknown>>('/love/grade/bind', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加设备
|
||||
*/
|
||||
export async function addBatchGrade(data: Grade[]) {
|
||||
const res = await request.post<ApiResult<unknown>>('/love/grade/batch', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仓库
|
||||
*/
|
||||
export async function removeGrade(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/love/grade/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除仓库
|
||||
*/
|
||||
export async function removeBatchGrade(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/love/grade/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
40
src/api/love/grade/model/index.ts
Normal file
40
src/api/love/grade/model/index.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface Grade {
|
||||
gradeId?: undefined;
|
||||
gradeName?: string;
|
||||
gradeNo?: string;
|
||||
gradeCategory?: object;
|
||||
gradeModel?: string;
|
||||
gradeModelMultiple?: string[];
|
||||
gradeSpecs?: string;
|
||||
gradePrice?: number;
|
||||
gradeUnit?: string;
|
||||
gradeStock?: string;
|
||||
companyNo?: string;
|
||||
companyName?: string;
|
||||
manufactor?: string;
|
||||
manufactorNo?: string;
|
||||
gradeWeight?: string;
|
||||
lifeYear?: number;
|
||||
factoryDate?: string;
|
||||
scrapDate?: string;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
sortNumber?: number;
|
||||
userId?: number;
|
||||
deleted?: number;
|
||||
tenantId?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface GradeParam extends PageParam {
|
||||
gradeId?: number;
|
||||
gradeName?: string;
|
||||
status?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
122
src/api/love/plan-equity/index.ts
Normal file
122
src/api/love/plan-equity/index.ts
Normal file
@@ -0,0 +1,122 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
UserPlanEquity,
|
||||
UserPlanEquityParam
|
||||
} from '@/api/love/plan-equity/model';
|
||||
/**
|
||||
* 分页查询会员权益
|
||||
*/
|
||||
export async function pageUserPlanEquity(params: UserPlanEquityParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserPlanEquity>>>(
|
||||
'/love/user-plan-equity/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员权益列表
|
||||
*/
|
||||
export async function listUserPlanEquity(params?: UserPlanEquityParam) {
|
||||
const res = await request.get<ApiResult<UserPlanEquity[]>>(
|
||||
'/love/user-plan-equity',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加会员权益
|
||||
*/
|
||||
export async function addUserPlanEquity(data: UserPlanEquity) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/love/user-plan-equity',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员权益
|
||||
*/
|
||||
export async function updateUserPlanEquity(data: UserPlanEquity) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/love/user-plan-equity',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定会员权益
|
||||
*/
|
||||
export async function bindUserPlanEquity(data: UserPlanEquity) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/love/user-plan-equity/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加
|
||||
*/
|
||||
export async function addBatchUserPlanEquity(data: UserPlanEquity[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/love/user-plan-equity/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员权益
|
||||
*/
|
||||
export async function removeUserPlanEquity(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/love/user-plan-equity/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除会员权益
|
||||
*/
|
||||
export async function removeBatchUserPlanEquity(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/love/user-plan-equity/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
26
src/api/love/plan-equity/model/index.ts
Normal file
26
src/api/love/plan-equity/model/index.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface UserPlanEquity {
|
||||
planEquityId?: number;
|
||||
planId?: number;
|
||||
planName?: string;
|
||||
money?: number;
|
||||
expirationTime?: string;
|
||||
comments?: string;
|
||||
sortNumber?: number;
|
||||
userId?: number;
|
||||
deleted?: number;
|
||||
tenantId?: number;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface UserPlanEquityParam extends PageParam {
|
||||
planEquityId?: number;
|
||||
type?: number;
|
||||
planId?: number;
|
||||
planName?: string;
|
||||
keywords?: string;
|
||||
}
|
||||
122
src/api/love/plan-icon/index.ts
Normal file
122
src/api/love/plan-icon/index.ts
Normal file
@@ -0,0 +1,122 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
UserPlanIcon,
|
||||
UserPlanIconParam
|
||||
} from '@/api/love/plan-icon/model';
|
||||
/**
|
||||
* 分页查询价格
|
||||
*/
|
||||
export async function pageUserPlanIcon(params: UserPlanIconParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserPlanIcon>>>(
|
||||
'/love/user-plan-icon/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询价格列表
|
||||
*/
|
||||
export async function listUserPlanIcon(params?: UserPlanIconParam) {
|
||||
const res = await request.get<ApiResult<UserPlanIcon[]>>(
|
||||
'/love/user-plan-icon',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加价格
|
||||
*/
|
||||
export async function addUserPlanIcon(data: UserPlanIcon) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/love/user-plan-icon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改价格
|
||||
*/
|
||||
export async function updateUserPlanIcon(data: UserPlanIcon) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/love/user-plan-icon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定价格
|
||||
*/
|
||||
export async function bindUserPlanIcon(data: UserPlanIcon) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/love/user-plan-icon/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加设备
|
||||
*/
|
||||
export async function addBatchUserPlanIcon(data: UserPlanIcon[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/love/user-plan-icon/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除价格
|
||||
*/
|
||||
export async function removeUserPlanIcon(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/love/user-plan-icon/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除价格
|
||||
*/
|
||||
export async function removeBatchUserPlanIcon(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/love/user-plan-icon/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
29
src/api/love/plan-icon/model/index.ts
Normal file
29
src/api/love/plan-icon/model/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface UserPlanIcon {
|
||||
id?: number;
|
||||
name?: string;
|
||||
planId?: number;
|
||||
price?: string;
|
||||
icon?: string;
|
||||
days?: number;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
sortNumber?: number;
|
||||
deleted?: number;
|
||||
tenantId?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
isEdit?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface UserPlanIconParam extends PageParam {
|
||||
id?: number;
|
||||
name?: string;
|
||||
planId?: number;
|
||||
status?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
119
src/api/love/plan-log/index.ts
Normal file
119
src/api/love/plan-log/index.ts
Normal file
@@ -0,0 +1,119 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserPlanLog, UserPlanLogParam } from '@/api/love/plan-log/model';
|
||||
/**
|
||||
* 分页查询日志
|
||||
*/
|
||||
export async function pageUserPlanLog(params: UserPlanLogParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserPlanLog>>>(
|
||||
'/love/user-plan-log/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询日志列表
|
||||
*/
|
||||
export async function listUserPlanLog(params?: UserPlanLogParam) {
|
||||
const res = await request.get<ApiResult<UserPlanLog[]>>(
|
||||
'/love/user-plan-log',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加日志
|
||||
*/
|
||||
export async function addUserPlanLog(data: UserPlanLog) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/love/user-plan-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改日志
|
||||
*/
|
||||
export async function updateUserPlanLog(data: UserPlanLog) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/love/user-plan-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定日志
|
||||
*/
|
||||
export async function bindUserPlanLog(data: UserPlanLog) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/love/user-plan-log/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加
|
||||
*/
|
||||
export async function addBatchUserPlanLog(data: UserPlanLog[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/love/user-plan-log/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除日志
|
||||
*/
|
||||
export async function removeUserPlanLog(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/love/user-plan-log/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除日志
|
||||
*/
|
||||
export async function removeBatchUserPlanLog(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/love/user-plan-log/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
30
src/api/love/plan-log/model/index.ts
Normal file
30
src/api/love/plan-log/model/index.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface UserPlanLog {
|
||||
logId?: number;
|
||||
logNo?: string;
|
||||
money?: string;
|
||||
planId?: number;
|
||||
status?: number;
|
||||
payStatus?: number;
|
||||
isSettled?: number;
|
||||
comments?: string;
|
||||
sortNumber?: number;
|
||||
userId?: number;
|
||||
deleted?: number;
|
||||
tenantId?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
idCard?: string;
|
||||
realName2?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface UserPlanLogParam extends PageParam {
|
||||
logId?: number;
|
||||
logNo?: string;
|
||||
status?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
122
src/api/love/plan-price/index.ts
Normal file
122
src/api/love/plan-price/index.ts
Normal file
@@ -0,0 +1,122 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
UserPlanPrice,
|
||||
UserPlanPriceParam
|
||||
} from '@/api/love/plan-price/model';
|
||||
/**
|
||||
* 分页查询价格
|
||||
*/
|
||||
export async function pageUserPlanPrice(params: UserPlanPriceParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserPlanPrice>>>(
|
||||
'/love/user-plan-price/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询价格列表
|
||||
*/
|
||||
export async function listUserPlanPrice(params?: UserPlanPriceParam) {
|
||||
const res = await request.get<ApiResult<UserPlanPrice[]>>(
|
||||
'/love/user-plan-price',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加价格
|
||||
*/
|
||||
export async function addUserPlanPrice(data: UserPlanPrice) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/love/user-plan-price',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改价格
|
||||
*/
|
||||
export async function updateUserPlanPrice(data: UserPlanPrice) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/love/user-plan-price',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定价格
|
||||
*/
|
||||
export async function bindUserPlanPrice(data: UserPlanPrice) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/love/user-plan-price/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加设备
|
||||
*/
|
||||
export async function addBatchUserPlanPrice(data: UserPlanPrice[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/love/user-plan-price/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除价格
|
||||
*/
|
||||
export async function removeUserPlanPrice(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/love/user-plan-price/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除价格
|
||||
*/
|
||||
export async function removeBatchUserPlanPrice(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/love/user-plan-price/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user