Initial commit
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>
|
||||
106
src/api/apps/bc/agent/index.ts
Normal file
106
src/api/apps/bc/agent/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BCAgent, BCAgentParam } from '@/api/apps/bc/agent/model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
/**
|
||||
* 分页查询设备
|
||||
*/
|
||||
export async function pageBCAgent(params: BCAgentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BCAgent>>>(
|
||||
OPEN_API_URL + '/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[]>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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;
|
||||
}
|
||||
104
src/api/apps/bc/balance-log/index.ts
Normal file
104
src/api/apps/bc/balance-log/index.ts
Normal file
@@ -0,0 +1,104 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserBalanceLog, UserBalanceLogParam } from './model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询余额明细
|
||||
*/
|
||||
export async function pageUserBalanceLog(params: UserBalanceLogParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserBalanceLog>>>(
|
||||
OPEN_API_URL + '/shop/user-balance-log/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询余额明细列表
|
||||
*/
|
||||
export async function listUserBalanceLog(params?: UserBalanceLogParam) {
|
||||
const res = await request.get<ApiResult<UserBalanceLog[]>>(
|
||||
OPEN_API_URL + '/shop/user-balance-log',
|
||||
{
|
||||
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 getUserBalanceLog(id: number) {
|
||||
const res = await request.get<ApiResult<UserBalanceLog>>(
|
||||
OPEN_API_URL + '/shop/user-balance-log/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加余额明细
|
||||
*/
|
||||
export async function addUserBalanceLog(data: UserBalanceLog) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/user-balance-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改余额明细
|
||||
*/
|
||||
export async function updateUserBalanceLog(data: UserBalanceLog) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/user-balance-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除余额明细
|
||||
*/
|
||||
export async function removeUserBalanceLog(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/user-balance-log/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除余额明细
|
||||
*/
|
||||
export async function removeUserBalanceLogs(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/user-balance-log/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
33
src/api/apps/bc/balance-log/model/index.ts
Normal file
33
src/api/apps/bc/balance-log/model/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 余额明细
|
||||
*/
|
||||
export interface UserBalanceLog {
|
||||
logId?: number;
|
||||
userId?: number;
|
||||
scene?: number;
|
||||
money?: string;
|
||||
describe?: string;
|
||||
remark?: string;
|
||||
sortNumber?: number;
|
||||
MerchantCode?: string;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
deleted?: number;
|
||||
tenantId?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户搜索条件
|
||||
*/
|
||||
export interface UserBalanceLogParam extends PageParam {
|
||||
logId?: number;
|
||||
userId?: number;
|
||||
scene?: number;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
MerchantCode?: string;
|
||||
}
|
||||
143
src/api/apps/bc/equipment/index.ts
Normal file
143
src/api/apps/bc/equipment/index.ts
Normal file
@@ -0,0 +1,143 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BcEquipment, BcEquipmentParam } from './model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
/**
|
||||
* 分页查询设备
|
||||
*/
|
||||
export async function pageBcEquipment(params: BcEquipmentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BcEquipment>>>(
|
||||
OPEN_API_URL + '/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[]>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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;
|
||||
}
|
||||
107
src/api/apps/bc/export/index.ts
Normal file
107
src/api/apps/bc/export/index.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BcExport, BcExportParam } from '@/api/apps/bc/export/model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询计划
|
||||
*/
|
||||
export async function pageBcExport(params: BcExportParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BcExport>>>(
|
||||
OPEN_API_URL + '/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[]>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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;
|
||||
}
|
||||
106
src/api/apps/bc/food/index.ts
Normal file
106
src/api/apps/bc/food/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BCFood, BCFoodParam } from '@/api/apps/bc/food/model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
/**
|
||||
* 分页查询计划
|
||||
*/
|
||||
export async function pageBCFood(params: BCFoodParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BCFood>>>(
|
||||
OPEN_API_URL + '/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[]>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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;
|
||||
}
|
||||
114
src/api/apps/bc/goods/category/index.ts
Normal file
114
src/api/apps/bc/goods/category/index.ts
Normal file
@@ -0,0 +1,114 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Category, CategoryParam } from './model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
// const merchantCode = String(localStorage.getItem('MerchantCode'));
|
||||
|
||||
/**
|
||||
* 分页查询商品分类
|
||||
*/
|
||||
export async function pageCategory(params: CategoryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Category>>>(
|
||||
OPEN_API_URL + '/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[]>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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/apps/bc/goods/category/model/index.ts
Normal file
51
src/api/apps/bc/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;
|
||||
}
|
||||
91
src/api/apps/bc/goods/comment/index.ts
Normal file
91
src/api/apps/bc/goods/comment/index.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Comment, CommentParam } from './model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品评价
|
||||
*/
|
||||
export async function pageComments(params: CommentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Comment>>>(
|
||||
OPEN_API_URL + '/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[]>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/shop/comment/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
30
src/api/apps/bc/goods/comment/model/index.ts
Normal file
30
src/api/apps/bc/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;
|
||||
}
|
||||
113
src/api/apps/bc/goods/index.ts
Normal file
113
src/api/apps/bc/goods/index.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Goods, GoodsParam } from './model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品
|
||||
*/
|
||||
export async function pageGoods(params: GoodsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Goods>>>(
|
||||
OPEN_API_URL + '/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[]>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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/apps/bc/goods/model/index.ts
Normal file
53
src/api/apps/bc/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;
|
||||
}
|
||||
91
src/api/apps/bc/goods/service/index.ts
Normal file
91
src/api/apps/bc/goods/service/index.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Service, ServiceParam } from './model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询服务承诺
|
||||
*/
|
||||
export async function pageServices(params: ServiceParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Service>>>(
|
||||
OPEN_API_URL + '/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[]>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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/apps/bc/goods/service/model/index.ts
Normal file
29
src/api/apps/bc/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;
|
||||
}
|
||||
113
src/api/apps/bc/order/goods/index.ts
Normal file
113
src/api/apps/bc/order/goods/index.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OrderGoods, OrderGoodsParam } from './model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询订单商品
|
||||
*/
|
||||
export async function pageOrderGoods(params: OrderGoodsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OrderGoods>>>(
|
||||
OPEN_API_URL + '/shop/order-goods/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单商品列表
|
||||
*/
|
||||
export async function listOrderGoods(params?: OrderGoodsParam) {
|
||||
const res = await request.get<ApiResult<OrderGoods[]>>(
|
||||
OPEN_API_URL + '/shop/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 addOrderGoods(data: OrderGoods) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order-goods',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单商品
|
||||
*/
|
||||
export async function updateOrderGoods(data: OrderGoods) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order-goods',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单商品
|
||||
*/
|
||||
export async function removeOrderGoods(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order-goods/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单商品
|
||||
*/
|
||||
export async function removeBatchOrderGoods(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/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>>(
|
||||
OPEN_API_URL + '/shop/order-goods/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
45
src/api/apps/bc/order/goods/model/index.ts
Normal file
45
src/api/apps/bc/order/goods/model/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 订单
|
||||
*/
|
||||
export interface OrderGoods {
|
||||
// 订单id
|
||||
orderGoodsId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
startTime?: string;
|
||||
// 状态
|
||||
status?: string;
|
||||
deliveryStatus?: number;
|
||||
// 用户ID
|
||||
userId?: any;
|
||||
totalNum?: any;
|
||||
organizationName?: string;
|
||||
nickname?: '';
|
||||
breakfastPostUsers?: '';
|
||||
breakfastSignUsers?: '';
|
||||
lunchPostUsers?: '';
|
||||
lunchSignUsers?: '';
|
||||
dinnerPostUsers?: '';
|
||||
dinnerSignUsers?: '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface OrderGoodsParam extends PageParam {
|
||||
keywords?: string;
|
||||
deliveryTime?: string;
|
||||
categoryId?: number;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
deliveryTimeStart?: string;
|
||||
deliveryTimeEnd?: string;
|
||||
payStatus?: number;
|
||||
gear?: number;
|
||||
week?: number;
|
||||
deliveryStatus?: number;
|
||||
organizationId?: number;
|
||||
organizationName?: string;
|
||||
}
|
||||
126
src/api/apps/bc/order/index.ts
Normal file
126
src/api/apps/bc/order/index.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Order, OrderParam } from './model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询订单
|
||||
*/
|
||||
export async function pageOrder(params: OrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Order>>>(
|
||||
OPEN_API_URL + '/shop/order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*/
|
||||
export async function listOrder(params?: OrderParam) {
|
||||
const res = await request.get<ApiResult<Order[]>>(
|
||||
OPEN_API_URL + '/shop/order',
|
||||
{
|
||||
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 getOrder(id: number) {
|
||||
const res = await request.get<ApiResult<Order>>(
|
||||
OPEN_API_URL + '/shop/order/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加订单
|
||||
*/
|
||||
export async function addOrder(data: Order) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*/
|
||||
export async function updateOrder(data: Order) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
*/
|
||||
export async function removeOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*/
|
||||
export async function removeBatchOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order/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>>(
|
||||
OPEN_API_URL + '/shop/order/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
95
src/api/apps/bc/order/model/index.ts
Normal file
95
src/api/apps/bc/order/model/index.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 订单
|
||||
*/
|
||||
export interface Order {
|
||||
// 订单id
|
||||
orderId?: number;
|
||||
// 订单类型
|
||||
orderType?: string;
|
||||
// 订单来源
|
||||
orderSource?: string;
|
||||
// 来源记录ID
|
||||
orderSourceId?: number;
|
||||
// 来源记录的参数 (json格式)
|
||||
orderSourceData?: string;
|
||||
rentOrderId?: number;
|
||||
// 订单编号
|
||||
orderNo?: string;
|
||||
// 订单名称
|
||||
orderName?: string;
|
||||
// 订单头像
|
||||
orderAvatar?: string;
|
||||
// 座机电话
|
||||
orderPhone?: string;
|
||||
// 手机号码
|
||||
orderMobile?: string;
|
||||
// 联系人
|
||||
orderContacts?: string;
|
||||
// 联系地址
|
||||
orderAddress?: string;
|
||||
// 跟进状态
|
||||
progress?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 配送方式
|
||||
deliveryType?: string;
|
||||
// 付款状态
|
||||
payStatus?: number;
|
||||
expressPrice?: string;
|
||||
// 付款金额
|
||||
payPrice?: number;
|
||||
payMethod?: string;
|
||||
tradeId?: string;
|
||||
goodsId?: number;
|
||||
// 总金额
|
||||
totalPrice?: number;
|
||||
// 发货状态
|
||||
deliveryStatus?: number;
|
||||
// 收货状态
|
||||
receiptStatus?: number;
|
||||
// 订单状态
|
||||
orderStatus?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
buyerRemark?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
startTime?: string;
|
||||
deliveryTime?: string;
|
||||
expirationTime?: string;
|
||||
// 状态
|
||||
status?: string;
|
||||
// 用户ID
|
||||
userId?: any;
|
||||
nickname?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface OrderParam extends PageParam {
|
||||
keywords?: string;
|
||||
orderName?: string;
|
||||
orderNo?: string;
|
||||
orderType?: string;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
deliveryTime?: string;
|
||||
orderCategory?: string;
|
||||
progress?: string;
|
||||
orderSource?: string;
|
||||
betweenTime?: any;
|
||||
userId?: string;
|
||||
week?: number;
|
||||
payStatus?: number;
|
||||
rentOrderId?: number;
|
||||
deliveryStatus?: number;
|
||||
receiptStatus?: number;
|
||||
orderStatus?: number;
|
||||
isTemporary?: number;
|
||||
isRenew?: number;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
126
src/api/apps/bc/order/refund/index.ts
Normal file
126
src/api/apps/bc/order/refund/index.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OrderRefund, OrderRefundParam } from './model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询退货单
|
||||
*/
|
||||
export async function pageOrderRefund(params: OrderRefundParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OrderRefund>>>(
|
||||
OPEN_API_URL + '/shop/order-refund/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询退货单列表
|
||||
*/
|
||||
export async function listOrderRefund(params?: OrderRefundParam) {
|
||||
const res = await request.get<ApiResult<OrderRefund[]>>(
|
||||
OPEN_API_URL + '/shop/order-refund',
|
||||
{
|
||||
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 getOrderRefund(id: number) {
|
||||
const res = await request.get<ApiResult<OrderRefund>>(
|
||||
OPEN_API_URL + '/shop/order-refund/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加退货单
|
||||
*/
|
||||
export async function addOrderRefund(data: OrderRefund) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order-refund',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改退货单
|
||||
*/
|
||||
export async function updateOrderRefund(data: OrderRefund) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order-refund',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除退货单
|
||||
*/
|
||||
export async function removeOrderRefund(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order-refund/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除退货单
|
||||
*/
|
||||
export async function removeBatchOrderRefund(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order-refund/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>>(
|
||||
OPEN_API_URL + '/shop/order-refund/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
38
src/api/apps/bc/order/refund/model/index.ts
Normal file
38
src/api/apps/bc/order/refund/model/index.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 退货订单
|
||||
*/
|
||||
export interface OrderRefund {
|
||||
orderRefundId?: number;
|
||||
orderId?: number;
|
||||
orderGoodsId?: number;
|
||||
userId?: number;
|
||||
type?: number;
|
||||
applyDesc?: string;
|
||||
auditStatus?: number;
|
||||
refuseDesc?: string;
|
||||
refundMoney?: number;
|
||||
isUserSend?: number;
|
||||
sendTime?: string;
|
||||
expressId?: string;
|
||||
expressNo?: string;
|
||||
isReceipt?: number;
|
||||
shopId?: number;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
merchantCode?: string;
|
||||
createTime?: string;
|
||||
updateTIme?: string;
|
||||
tenantId?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退货订单搜索条件
|
||||
*/
|
||||
export interface OrderRefundParam extends PageParam {
|
||||
orderRefundId?: number;
|
||||
orderId?: number;
|
||||
orderGoodsId?: number;
|
||||
}
|
||||
106
src/api/apps/bc/plan/index.ts
Normal file
106
src/api/apps/bc/plan/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BCPlan, BCPlanParam } from '@/api/apps/bc/plan/model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
/**
|
||||
* 分页查询计划
|
||||
*/
|
||||
export async function pageBCPlan(params: BCPlanParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BCPlan>>>(
|
||||
OPEN_API_URL + '/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[]>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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;
|
||||
}
|
||||
109
src/api/apps/bc/recharge/export/index.ts
Normal file
109
src/api/apps/bc/recharge/export/index.ts
Normal file
@@ -0,0 +1,109 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
RechargeOrder,
|
||||
RechargeOrderParam
|
||||
} from '@/api/user/recharge/export/model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
/**
|
||||
* 分页查询充值计划
|
||||
*/
|
||||
export async function pageRechargeOrder(params: RechargeOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<RechargeOrder>>>(
|
||||
OPEN_API_URL + '/shop/recharge-order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询充值计划列表
|
||||
*/
|
||||
export async function listRechargeOrder(params?: RechargeOrderParam) {
|
||||
const res = await request.get<ApiResult<RechargeOrder[]>>(
|
||||
OPEN_API_URL + '/shop/recharge-order',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加充值计划
|
||||
*/
|
||||
export async function addRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改充值计划
|
||||
*/
|
||||
export async function updateRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定充值计划
|
||||
*/
|
||||
export async function bindRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除充值计划
|
||||
*/
|
||||
export async function removeRechargeOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除充值计划
|
||||
*/
|
||||
export async function removeBatchRechargeOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
src/api/apps/bc/recharge/export/model/index.ts
Normal file
31
src/api/apps/bc/recharge/export/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface RechargeOrder {
|
||||
orderId?: number;
|
||||
organizationId?: number;
|
||||
organizationName?: string;
|
||||
nickname?: string;
|
||||
payPrice?: number;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
expendMoney?: string;
|
||||
userId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface RechargeOrderParam extends PageParam {
|
||||
exportId?: number;
|
||||
organizationName?: string;
|
||||
organizationId?: number;
|
||||
dayTime?: string;
|
||||
week?: number;
|
||||
status?: number;
|
||||
userId?: number;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
deliveryTimeStart?: string;
|
||||
deliveryTimeEnd?: string;
|
||||
}
|
||||
134
src/api/apps/bc/recharge/order/index.ts
Normal file
134
src/api/apps/bc/recharge/order/index.ts
Normal file
@@ -0,0 +1,134 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { RechargeOrder, RechargeOrderParam } from './model/index';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 充值
|
||||
*/
|
||||
export async function recharge(data: RechargeOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order/recharge',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询充值记录
|
||||
*/
|
||||
export async function pageRechargeOrder(params: RechargeOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<RechargeOrder>>>(
|
||||
OPEN_API_URL + '/shop/recharge-order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询充值记录列表
|
||||
*/
|
||||
export async function listRechargeOrder(params?: RechargeOrderParam) {
|
||||
const res = await request.get<ApiResult<RechargeOrder[]>>(
|
||||
OPEN_API_URL + '/shop/recharge-order',
|
||||
{
|
||||
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 getRechargeOrder(id: number) {
|
||||
const res = await request.get<ApiResult<RechargeOrder>>(
|
||||
OPEN_API_URL + '/shop/recharge-order/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加充值记录
|
||||
*/
|
||||
export async function addRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改充值记录
|
||||
*/
|
||||
export async function updateRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除充值记录
|
||||
*/
|
||||
export async function removeRechargeOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除充值记录
|
||||
*/
|
||||
export async function removeBatchRechargeOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量充值操作
|
||||
*/
|
||||
export async function batchRecharge(data: RechargeOrder[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order/batchRecharge',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
33
src/api/apps/bc/recharge/order/model/index.ts
Normal file
33
src/api/apps/bc/recharge/order/model/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 充值记录
|
||||
*/
|
||||
export interface RechargeOrder {
|
||||
orderId?: number;
|
||||
userId?: number;
|
||||
scene?: number;
|
||||
orderNo?: string;
|
||||
money?: string;
|
||||
payPrice?: number;
|
||||
organizationId?: number;
|
||||
rechargeType?: number;
|
||||
describe?: string;
|
||||
remark?: string;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
deleted?: number;
|
||||
tenantId?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
balance?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户搜索条件
|
||||
*/
|
||||
export interface RechargeOrderParam extends PageParam {
|
||||
orderId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
109
src/api/apps/bc/temporary/index.ts
Normal file
109
src/api/apps/bc/temporary/index.ts
Normal file
@@ -0,0 +1,109 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
BCTemporary,
|
||||
BCTemporaryParam
|
||||
} from '@/api/apps/bc/temporary/model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
/**
|
||||
* 分页查询设备
|
||||
*/
|
||||
export async function pageBCTemporary(params: BCTemporaryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BCTemporary>>>(
|
||||
OPEN_API_URL + '/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[]>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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>>(
|
||||
OPEN_API_URL + '/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;
|
||||
}
|
||||
46
src/api/apps/statistics/index.ts
Normal file
46
src/api/apps/statistics/index.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import { Order, OrderParam } from '@/api/apps/bc/order/model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 菜品预定统计
|
||||
*/
|
||||
export async function countOrderGoods(params: any) {
|
||||
const res = await request.get<ApiResult<any>>(
|
||||
OPEN_API_URL + '/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[]>>(
|
||||
OPEN_API_URL + '/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));
|
||||
}
|
||||
|
||||
export async function pageUserLog(params: any) {
|
||||
const res = await request.get<ApiResult<PageResult<any>>>(
|
||||
'http://127.0.0.1:10051/api/shop/user-balance-log/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
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 {
|
||||
|
||||
}
|
||||
106
src/api/booking/category/index.ts
Normal file
106
src/api/booking/category/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Category, CategoryParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询课程分类
|
||||
*/
|
||||
export async function pageCategory(params: CategoryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Category>>>(
|
||||
MODULES_API_URL + '/booking/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[]>>(
|
||||
MODULES_API_URL + '/booking/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>>(
|
||||
MODULES_API_URL + '/booking/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>>(
|
||||
MODULES_API_URL + '/booking/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>>(
|
||||
MODULES_API_URL + '/booking/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>>(
|
||||
MODULES_API_URL + '/booking/category/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询课程分类
|
||||
*/
|
||||
export async function getCategory(id: number) {
|
||||
const res = await request.get<ApiResult<Category>>(
|
||||
MODULES_API_URL + '/booking/category/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
57
src/api/booking/category/model/index.ts
Normal file
57
src/api/booking/category/model/index.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 课程分类
|
||||
*/
|
||||
export interface Category {
|
||||
// 商品分类ID
|
||||
categoryId?: number;
|
||||
// 分类标识
|
||||
categoryCode?: string;
|
||||
// 分类名称
|
||||
title?: string;
|
||||
// 类型 0列表 1单页 2外链
|
||||
type?: number;
|
||||
// 分类图片
|
||||
image?: string;
|
||||
// 上级分类ID
|
||||
parentId?: number;
|
||||
// 路由/链接地址
|
||||
path?: string;
|
||||
// 组件路径
|
||||
component?: string;
|
||||
// 绑定的页面
|
||||
pageId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 商品数量
|
||||
count?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)
|
||||
hide?: number;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 是否显示在首页
|
||||
showIndex?: number;
|
||||
// 状态, 0正常, 1禁用
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 课程分类搜索条件
|
||||
*/
|
||||
export interface CategoryParam extends PageParam {
|
||||
categoryId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/booking/lesson/index.ts
Normal file
106
src/api/booking/lesson/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Lesson, LessonParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询课程管理
|
||||
*/
|
||||
export async function pageLesson(params: LessonParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Lesson>>>(
|
||||
MODULES_API_URL + '/booking/lesson/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询课程管理列表
|
||||
*/
|
||||
export async function listLesson(params?: LessonParam) {
|
||||
const res = await request.get<ApiResult<Lesson[]>>(
|
||||
MODULES_API_URL + '/booking/lesson',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加课程管理
|
||||
*/
|
||||
export async function addLesson(data: Lesson) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/lesson',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改课程管理
|
||||
*/
|
||||
export async function updateLesson(data: Lesson) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/lesson',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除课程管理
|
||||
*/
|
||||
export async function removeLesson(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/lesson/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除课程管理
|
||||
*/
|
||||
export async function removeBatchLesson(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/lesson/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询课程管理
|
||||
*/
|
||||
export async function getLesson(id: number) {
|
||||
const res = await request.get<ApiResult<Lesson>>(
|
||||
MODULES_API_URL + '/booking/lesson/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
43
src/api/booking/lesson/model/index.ts
Normal file
43
src/api/booking/lesson/model/index.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 课程管理
|
||||
*/
|
||||
export interface Lesson {
|
||||
// ID
|
||||
lessonId?: number;
|
||||
// 课程名称
|
||||
lessonName?: string;
|
||||
// 图标
|
||||
image?: string;
|
||||
// 分类ID
|
||||
categoryId?: number;
|
||||
// 老师ID
|
||||
teacherId?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 上课时间
|
||||
startTime?: string;
|
||||
// 报名人数上限
|
||||
maxNumber?: number;
|
||||
// 上课地点
|
||||
address?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 课程管理搜索条件
|
||||
*/
|
||||
export interface LessonParam extends PageParam {
|
||||
lessonId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/booking/teacher/index.ts
Normal file
106
src/api/booking/teacher/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Teacher, TeacherParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询老师管理
|
||||
*/
|
||||
export async function pageTeacher(params: TeacherParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Teacher>>>(
|
||||
MODULES_API_URL + '/booking/teacher/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询老师管理列表
|
||||
*/
|
||||
export async function listTeacher(params?: TeacherParam) {
|
||||
const res = await request.get<ApiResult<Teacher[]>>(
|
||||
MODULES_API_URL + '/booking/teacher',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加老师管理
|
||||
*/
|
||||
export async function addTeacher(data: Teacher) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/teacher',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改老师管理
|
||||
*/
|
||||
export async function updateTeacher(data: Teacher) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/teacher',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除老师管理
|
||||
*/
|
||||
export async function removeTeacher(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/teacher/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除老师管理
|
||||
*/
|
||||
export async function removeBatchTeacher(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/teacher/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询老师管理
|
||||
*/
|
||||
export async function getTeacher(id: number) {
|
||||
const res = await request.get<ApiResult<Teacher>>(
|
||||
MODULES_API_URL + '/booking/teacher/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
35
src/api/booking/teacher/model/index.ts
Normal file
35
src/api/booking/teacher/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 老师管理
|
||||
*/
|
||||
export interface Teacher {
|
||||
// ID
|
||||
teacherId?: number;
|
||||
// 老师姓名
|
||||
teacherName?: string;
|
||||
// 老师照片
|
||||
image?: string;
|
||||
// 老师介绍
|
||||
content?: string;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 老师管理搜索条件
|
||||
*/
|
||||
export interface TeacherParam extends PageParam {
|
||||
teacherId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
140
src/api/cms/ad/index.ts
Normal file
140
src/api/cms/ad/index.ts
Normal file
@@ -0,0 +1,140 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Ad, AdParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询广告位
|
||||
*/
|
||||
export async function pageAd(params: AdParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Ad>>>(
|
||||
MODULES_API_URL + '/cms/ad/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询广告位列表
|
||||
*/
|
||||
export async function listAd(params?: AdParam) {
|
||||
const res = await request.get<ApiResult<Ad[]>>(MODULES_API_URL + '/cms/ad', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加广告位
|
||||
*/
|
||||
export async function addAd(data: Ad) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/ad',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改广告位
|
||||
*/
|
||||
export async function updateAd(data: Ad) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/ad',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除广告位
|
||||
*/
|
||||
export async function removeAd(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/ad/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除广告位
|
||||
*/
|
||||
export async function removeBatchAd(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/ad/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateAdStatus(adId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/ad/status',
|
||||
{
|
||||
adId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询广告位
|
||||
*/
|
||||
export async function getAd(id: number) {
|
||||
const res = await request.get<ApiResult<Ad>>(
|
||||
MODULES_API_URL + '/cms/ad/' + 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>>(
|
||||
MODULES_API_URL + '/cms/ad/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
src/api/cms/ad/model/index.ts
Normal file
31
src/api/cms/ad/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 广告位
|
||||
*/
|
||||
export interface Ad {
|
||||
adId?: number;
|
||||
name?: string;
|
||||
adType?: string;
|
||||
type?: string;
|
||||
width?: string;
|
||||
height?: string;
|
||||
path?: string;
|
||||
images?: string;
|
||||
userId?: number;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 广告位搜索条件
|
||||
*/
|
||||
export interface AdParam extends PageParam {
|
||||
adId?: string;
|
||||
name?: number;
|
||||
type?: number;
|
||||
userId?: number;
|
||||
}
|
||||
143
src/api/cms/article/index.ts
Normal file
143
src/api/cms/article/index.ts
Normal file
@@ -0,0 +1,143 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Article, ArticleParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询文章
|
||||
*/
|
||||
export async function pageArticle(params: ArticleParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Article>>>(
|
||||
MODULES_API_URL + '/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[]>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/cms/article/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
74
src/api/cms/article/model/index.ts
Normal file
74
src/api/cms/article/model/index.ts
Normal file
@@ -0,0 +1,74 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 文章
|
||||
*/
|
||||
export interface Article {
|
||||
// 文章id
|
||||
articleId?: number;
|
||||
// 文章标题
|
||||
title?: string;
|
||||
// 分类类型
|
||||
type?: number;
|
||||
// 展现方式
|
||||
showType?: any;
|
||||
// 文章类型
|
||||
categoryId?: number;
|
||||
// 封面图
|
||||
image?: string;
|
||||
// 附件
|
||||
files?: string;
|
||||
// 缩列图
|
||||
thumbnail?: string;
|
||||
// 视频地址
|
||||
video?: string;
|
||||
// 上传的文件类型
|
||||
accept?: string;
|
||||
// 来源
|
||||
source?: string;
|
||||
// 文章内容
|
||||
content?: string;
|
||||
// 虚拟阅读量
|
||||
virtualViews?: number;
|
||||
// 实际阅读量
|
||||
actualViews?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 用户昵称
|
||||
nickname?: string;
|
||||
// 账号
|
||||
username?: string;
|
||||
// 用户头像
|
||||
userAvatar?: string;
|
||||
// 所属门店ID
|
||||
shopId?: number;
|
||||
//
|
||||
likes?: number;
|
||||
// 排序
|
||||
sortNumber?: any;
|
||||
// 备注
|
||||
comments?: any;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文章搜索条件
|
||||
*/
|
||||
export interface ArticleParam extends PageParam {
|
||||
title?: string;
|
||||
articleId?: number;
|
||||
categoryId?: number;
|
||||
status?: string;
|
||||
sortNumber?: string;
|
||||
createTime?: string;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
userId?: number;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
126
src/api/cms/category/index.ts
Normal file
126
src/api/cms/category/index.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ArticleCategory, ArticleCategoryParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询文章分类
|
||||
*/
|
||||
export async function pageArticleCategory(params: ArticleCategoryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ArticleCategory>>>(
|
||||
MODULES_API_URL + '/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[]>>(
|
||||
MODULES_API_URL + '/cms/article-category',
|
||||
{
|
||||
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 getArticleCategory(id: number) {
|
||||
const res = await request.get<ApiResult<ArticleCategory>>(
|
||||
MODULES_API_URL + '/cms/article-category/' + id
|
||||
);
|
||||
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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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));
|
||||
}
|
||||
78
src/api/cms/category/model/index.ts
Normal file
78
src/api/cms/category/model/index.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 文章分类
|
||||
*/
|
||||
export interface ArticleCategory {
|
||||
// 文章分类id
|
||||
categoryId?: number;
|
||||
// 分类类型 0列表 1页面 2链接
|
||||
type?: number;
|
||||
// 文章分类
|
||||
title?: string;
|
||||
// 文章分类图片
|
||||
image?: string;
|
||||
// 路由/链接
|
||||
path?: string;
|
||||
// 组件路径
|
||||
component?: string;
|
||||
// 页面ID
|
||||
pageId?: number;
|
||||
// 页面名称
|
||||
pageName?: string;
|
||||
// 上级分类
|
||||
parentId?: number;
|
||||
// 封面图
|
||||
avatar?: string;
|
||||
// 用户ID
|
||||
userId?: string;
|
||||
// 所属门店ID
|
||||
shopId?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 是否显示在首页
|
||||
showIndex?: number;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
key?: number;
|
||||
value?: number;
|
||||
// 子菜单
|
||||
children?: ArticleCategory[];
|
||||
tempPath?: string;
|
||||
disabled?: boolean;
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 整理分类用于网站导航栏
|
||||
*/
|
||||
export interface ArrangeCategory {
|
||||
categoryId?: number;
|
||||
type?: number;
|
||||
title?: string;
|
||||
parentId?: number;
|
||||
avatar?: string;
|
||||
path?: string;
|
||||
component?: string;
|
||||
pageId?: number;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
children?: ArrangeCategory[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 文章分类搜索条件
|
||||
*/
|
||||
export interface ArticleCategoryParam extends PageParam {
|
||||
title?: string;
|
||||
categoryId?: number;
|
||||
}
|
||||
143
src/api/cms/design/index.ts
Normal file
143
src/api/cms/design/index.ts
Normal file
@@ -0,0 +1,143 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Design, DesignParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询页面设计
|
||||
*/
|
||||
export async function pageDesign(params: DesignParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Design>>>(
|
||||
MODULES_API_URL + '/cms/design/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询页面设计列表
|
||||
*/
|
||||
export async function listDesign(params?: DesignParam) {
|
||||
const res = await request.get<ApiResult<Design[]>>(
|
||||
MODULES_API_URL + '/cms/design',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加页面设计
|
||||
*/
|
||||
export async function addDesign(data: Design) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/design',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改页面设计
|
||||
*/
|
||||
export async function updateDesign(data: Design) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/design',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除页面设计
|
||||
*/
|
||||
export async function removeDesign(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/design/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除页面设计
|
||||
*/
|
||||
export async function removeBatchDesign(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/design/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateDesignStatus(designId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/design/status',
|
||||
{
|
||||
designId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询页面设计
|
||||
*/
|
||||
export async function getDesign(id: number) {
|
||||
const res = await request.get<ApiResult<Design>>(
|
||||
MODULES_API_URL + '/cms/design/' + 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>>(
|
||||
MODULES_API_URL + '/cms/design/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
50
src/api/cms/design/model/index.ts
Normal file
50
src/api/cms/design/model/index.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 页面
|
||||
*/
|
||||
export interface Design {
|
||||
pageId?: number;
|
||||
name?: string;
|
||||
keywords?: string;
|
||||
description?: string;
|
||||
path?: string;
|
||||
component?: string;
|
||||
photo?: string;
|
||||
content?: string;
|
||||
// 类型
|
||||
type?: string;
|
||||
// 宽
|
||||
width?: string;
|
||||
// 高
|
||||
height?: string;
|
||||
// 附件
|
||||
images?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 设为首页
|
||||
home?: number;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
// 页面布局
|
||||
layout?: string;
|
||||
backgroundColor?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 页面搜索条件
|
||||
*/
|
||||
export interface DesignParam extends PageParam {
|
||||
pageId?: string;
|
||||
name?: number;
|
||||
type?: number;
|
||||
userId?: number;
|
||||
}
|
||||
143
src/api/cms/docs-book/index.ts
Normal file
143
src/api/cms/docs-book/index.ts
Normal file
@@ -0,0 +1,143 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { DocsBook, DocsBookParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询书籍
|
||||
*/
|
||||
export async function pageDocsBook(params: DocsBookParam) {
|
||||
const res = await request.get<ApiResult<PageResult<DocsBook>>>(
|
||||
MODULES_API_URL + '/cms/docs-book/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询书籍列表
|
||||
*/
|
||||
export async function listDocsBook(params?: DocsBookParam) {
|
||||
const res = await request.get<ApiResult<DocsBook[]>>(
|
||||
MODULES_API_URL + '/cms/docs-book',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加书籍
|
||||
*/
|
||||
export async function addDocsBook(data: DocsBook) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs-book',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改书籍
|
||||
*/
|
||||
export async function updateDocsBook(data: DocsBook) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs-book',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除书籍
|
||||
*/
|
||||
export async function removeDocsBook(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs-book/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除书籍
|
||||
*/
|
||||
export async function removeBatchDocsBook(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs-book/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateDocsBookStatus(docsId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs-book/status',
|
||||
{
|
||||
docsId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询书籍
|
||||
*/
|
||||
export async function getDocsBook(id: number) {
|
||||
const res = await request.get<ApiResult<DocsBook>>(
|
||||
MODULES_API_URL + '/cms/docs-book/' + 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>>(
|
||||
MODULES_API_URL + '/cms/docs-book/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
src/api/cms/docs-book/model/index.ts
Normal file
31
src/api/cms/docs-book/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 书籍内容
|
||||
*/
|
||||
export interface DocsBook {
|
||||
// 自增ID
|
||||
bookId?: number;
|
||||
// 名称
|
||||
name?: string;
|
||||
// 书籍标识
|
||||
code?: string;
|
||||
// 封面图
|
||||
photo?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 书籍搜索条件
|
||||
*/
|
||||
export interface DocsBookParam extends PageParam {
|
||||
bookId?: number;
|
||||
docsId?: number;
|
||||
}
|
||||
146
src/api/cms/docs-content/index.ts
Normal file
146
src/api/cms/docs-content/index.ts
Normal file
@@ -0,0 +1,146 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { DocsContent, DocsContentParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询文档
|
||||
*/
|
||||
export async function pageDocsContent(params: DocsContentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<DocsContent>>>(
|
||||
MODULES_API_URL + '/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[]>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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));
|
||||
}
|
||||
36
src/api/cms/docs-content/model/index.ts
Normal file
36
src/api/cms/docs-content/model/index.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 文档内容
|
||||
*/
|
||||
export interface DocsContent {
|
||||
// 自增ID
|
||||
id?: 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 {
|
||||
id?: number;
|
||||
docsId?: number;
|
||||
content?: string;
|
||||
}
|
||||
143
src/api/cms/docs/index.ts
Normal file
143
src/api/cms/docs/index.ts
Normal file
@@ -0,0 +1,143 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Docs, DocsParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询文档
|
||||
*/
|
||||
export async function pageDocs(params: DocsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Docs>>>(
|
||||
MODULES_API_URL + '/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[]>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/cms/docs/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/cms/docs/model/index.ts
Normal file
64
src/api/cms/docs/model/index.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 文档
|
||||
*/
|
||||
export interface Docs {
|
||||
// 文档id
|
||||
docsId?: number;
|
||||
// 书籍ID
|
||||
bookId?: number;
|
||||
// 书籍标识
|
||||
code?: string;
|
||||
// 文档标题
|
||||
title?: string;
|
||||
// 上级分类
|
||||
parentId?: number;
|
||||
// 上级分类名称
|
||||
parentName?: 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;
|
||||
isUpdate?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文档搜索条件
|
||||
*/
|
||||
export interface DocsParam extends PageParam {
|
||||
bookId?: number;
|
||||
code?: string;
|
||||
title?: string;
|
||||
docsId?: number;
|
||||
categoryId?: string;
|
||||
status?: string;
|
||||
sortNumber?: string;
|
||||
createTime?: string;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
}
|
||||
153
src/api/cms/domain/index.ts
Normal file
153
src/api/cms/domain/index.ts
Normal file
@@ -0,0 +1,153 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Domain, DomainParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询网站域名
|
||||
*/
|
||||
export async function pageDomain(params: DomainParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Domain>>>(
|
||||
MODULES_API_URL + '/cms/domain/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询网站域名列表
|
||||
*/
|
||||
export async function listDomain(params?: DomainParam) {
|
||||
const res = await request.get<ApiResult<Domain[]>>(
|
||||
MODULES_API_URL + '/cms/domain',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加网站域名
|
||||
*/
|
||||
export async function addDomain(data: Domain) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/domain',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改网站域名
|
||||
*/
|
||||
export async function updateDomain(data: Domain) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/domain',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除网站域名
|
||||
*/
|
||||
export async function removeDomain(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/domain/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除网站域名
|
||||
*/
|
||||
export async function removeBatchDomain(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/domain/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateDomainStatus(docsId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/domain/status',
|
||||
{
|
||||
docsId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询网站域名
|
||||
*/
|
||||
export async function getDomain(id: number) {
|
||||
const res = await request.get<ApiResult<Domain>>(
|
||||
MODULES_API_URL + '/cms/domain/' + 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>>(
|
||||
MODULES_API_URL + '/cms/domain/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 resolvable(id: number) {
|
||||
const res = await request.get<ApiResult<Domain>>(
|
||||
MODULES_API_URL + '/cms/domain/resolvable/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
src/api/cms/domain/model/index.ts
Normal file
31
src/api/cms/domain/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 网站域名
|
||||
*/
|
||||
export interface Domain {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 域名
|
||||
domain?: string;
|
||||
// 主机记录
|
||||
hostName?: string;
|
||||
// 主机记录值
|
||||
hostValue?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 网站域名搜索条件
|
||||
*/
|
||||
export interface DomainParam extends PageParam {
|
||||
id?: number;
|
||||
domain?: string;
|
||||
}
|
||||
126
src/api/cms/form-record/index.ts
Normal file
126
src/api/cms/form-record/index.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { FormRecord, FormRecordParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询表单设计
|
||||
*/
|
||||
export async function pageFormRecord(params: FormRecordParam) {
|
||||
const res = await request.get<ApiResult<PageResult<FormRecord>>>(
|
||||
MODULES_API_URL + '/cms/form-record/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询表单设计列表
|
||||
*/
|
||||
export async function listFormRecord(params?: FormRecordParam) {
|
||||
const res = await request.get<ApiResult<FormRecord[]>>(
|
||||
MODULES_API_URL + '/cms/form-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 addFormRecord(data: FormRecord) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/form-record',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改表单设计
|
||||
*/
|
||||
export async function updateFormRecord(data: FormRecord) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/form-record',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除表单设计
|
||||
*/
|
||||
export async function removeFormRecord(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/form-record/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除表单设计
|
||||
*/
|
||||
export async function removeBatchFormRecord(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/form-record/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询表单设计
|
||||
*/
|
||||
export async function getFormRecord(id: number) {
|
||||
const res = await request.get<ApiResult<FormRecord>>(
|
||||
MODULES_API_URL + '/cms/form-record/' + 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>>(
|
||||
MODULES_API_URL + '/cms/form-record/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
28
src/api/cms/form-record/model/index.ts
Normal file
28
src/api/cms/form-record/model/index.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 表单数据
|
||||
*/
|
||||
export interface FormRecord {
|
||||
formRecordId?: number;
|
||||
formId?: number;
|
||||
name?: string;
|
||||
formData?: string;
|
||||
formObj?: Object;
|
||||
userId?: number;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
createTime?: string;
|
||||
layout?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface FormRecordParam extends PageParam {
|
||||
formRecordId?: string;
|
||||
formId?: number;
|
||||
phone?: string;
|
||||
name?: number;
|
||||
}
|
||||
143
src/api/cms/form/index.ts
Normal file
143
src/api/cms/form/index.ts
Normal file
@@ -0,0 +1,143 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Form, FormParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询表单设计
|
||||
*/
|
||||
export async function pageForm(params: FormParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Form>>>(
|
||||
MODULES_API_URL + '/cms/form/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询表单设计列表
|
||||
*/
|
||||
export async function listForm(params?: FormParam) {
|
||||
const res = await request.get<ApiResult<Form[]>>(
|
||||
MODULES_API_URL + '/cms/form',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加表单设计
|
||||
*/
|
||||
export async function addForm(data: Form) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/form',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改表单设计
|
||||
*/
|
||||
export async function updateForm(data: Form) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/form',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除表单设计
|
||||
*/
|
||||
export async function removeForm(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/form/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除表单设计
|
||||
*/
|
||||
export async function removeBatchForm(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/form/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateFormStatus(formId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/form/status',
|
||||
{
|
||||
formId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询表单设计
|
||||
*/
|
||||
export async function getForm(id: number) {
|
||||
const res = await request.get<ApiResult<Form>>(
|
||||
MODULES_API_URL + '/cms/form/' + 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>>(
|
||||
MODULES_API_URL + '/cms/form/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
33
src/api/cms/form/model/index.ts
Normal file
33
src/api/cms/form/model/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 表单设计
|
||||
*/
|
||||
export interface Form {
|
||||
formId?: number;
|
||||
name?: string;
|
||||
photo?: string;
|
||||
background?: string;
|
||||
video?: string;
|
||||
submitNumber?: number;
|
||||
layout?: string;
|
||||
userId?: number;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
createTime?: string;
|
||||
hidePhoto?: any;
|
||||
hideBackground?: number;
|
||||
hideVideo?: number;
|
||||
opacity?: number;
|
||||
data?: any[];
|
||||
clearCache?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface FormParam extends PageParam {
|
||||
formId?: number;
|
||||
name?: number;
|
||||
}
|
||||
143
src/api/cms/navigation/index.ts
Normal file
143
src/api/cms/navigation/index.ts
Normal file
@@ -0,0 +1,143 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Navigation, NavigationParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询导航
|
||||
*/
|
||||
export async function pageNavigation(params: NavigationParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Navigation>>>(
|
||||
MODULES_API_URL + '/cms/navigation/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询导航列表
|
||||
*/
|
||||
export async function listNavigation(params?: NavigationParam) {
|
||||
const res = await request.get<ApiResult<Navigation[]>>(
|
||||
MODULES_API_URL + '/cms/navigation',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加导航
|
||||
*/
|
||||
export async function addNavigation(data: Navigation) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/navigation',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改导航
|
||||
*/
|
||||
export async function updateNavigation(data: Navigation) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/navigation',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除导航
|
||||
*/
|
||||
export async function removeNavigation(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/navigation/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除导航
|
||||
*/
|
||||
export async function removeBatchNavigation(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/navigation/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateNavigationStatus(navigationId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/navigation/status',
|
||||
{
|
||||
navigationId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询导航
|
||||
*/
|
||||
export async function getNavigation(id: number) {
|
||||
const res = await request.get<ApiResult<Navigation>>(
|
||||
MODULES_API_URL + '/cms/navigation/' + 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>>(
|
||||
MODULES_API_URL + '/cms/navigation/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
41
src/api/cms/navigation/model/index.ts
Normal file
41
src/api/cms/navigation/model/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* 菜单
|
||||
*/
|
||||
export interface Navigation {
|
||||
navigationId?: number;
|
||||
parentId?: number;
|
||||
title?: string;
|
||||
path?: string;
|
||||
icon?: string;
|
||||
component?: string;
|
||||
type?: number;
|
||||
sortNumber?: number;
|
||||
hide?: number;
|
||||
home?: number;
|
||||
position?: number;
|
||||
meta?: string;
|
||||
children?: Navigation[];
|
||||
disabled?: boolean;
|
||||
tenantId?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
pageId?: number;
|
||||
articleCategoryId?: number;
|
||||
articleId?: number;
|
||||
goodsCategoryId?: number;
|
||||
goodsId?: number;
|
||||
bookCode?: string;
|
||||
formId?: number;
|
||||
pageName?: string;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单搜索参数
|
||||
*/
|
||||
export interface NavigationParam {
|
||||
title?: string;
|
||||
path?: string;
|
||||
authority?: string;
|
||||
parentId?: number;
|
||||
}
|
||||
129
src/api/cms/website/field/index.ts
Normal file
129
src/api/cms/website/field/index.ts
Normal file
@@ -0,0 +1,129 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
WebsiteField,
|
||||
WebsiteFieldParam
|
||||
} from '@/api/cms/website/field/model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询项目参数
|
||||
*/
|
||||
export async function pageWebsiteField(params: WebsiteFieldParam) {
|
||||
const res = await request.get<ApiResult<PageResult<WebsiteField>>>(
|
||||
MODULES_API_URL + '/cms/website-field/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目参数列表
|
||||
*/
|
||||
export async function listWebsiteField(params?: WebsiteFieldParam) {
|
||||
const res = await request.get<ApiResult<WebsiteField[]>>(
|
||||
MODULES_API_URL + '/cms/website-field',
|
||||
{
|
||||
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 getWebsiteField(id: number) {
|
||||
const res = await request.get<ApiResult<WebsiteField>>(
|
||||
MODULES_API_URL + '/cms/website-field/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加项目参数
|
||||
*/
|
||||
export async function addWebsiteField(data: WebsiteField) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website-field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目参数
|
||||
*/
|
||||
export async function updateWebsiteField(data: WebsiteField) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website-field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目参数
|
||||
*/
|
||||
export async function removeWebsiteField(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website-field/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除项目参数
|
||||
*/
|
||||
export async function removeBatchWebsiteField(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website-field/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>>(
|
||||
MODULES_API_URL + '/cms/website-field/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
25
src/api/cms/website/field/model/index.ts
Normal file
25
src/api/cms/website/field/model/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 网站参数
|
||||
*/
|
||||
export interface WebsiteField {
|
||||
id?: number;
|
||||
name?: string;
|
||||
value?: string;
|
||||
comments?: string;
|
||||
userId?: number;
|
||||
websiteId?: number;
|
||||
status?: any;
|
||||
sortNumber?: any;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 网站参数搜索条件
|
||||
*/
|
||||
export interface WebsiteFieldParam extends PageParam {
|
||||
id?: number;
|
||||
userId?: number;
|
||||
websiteId?: number;
|
||||
}
|
||||
169
src/api/cms/website/index.ts
Normal file
169
src/api/cms/website/index.ts
Normal file
@@ -0,0 +1,169 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Website, WebsiteParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 获取网站信息
|
||||
*/
|
||||
export async function getSiteInfo() {
|
||||
const res = await request.get<ApiResult<Website>>(
|
||||
MODULES_API_URL + '/cms/website/getSiteInfo'
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除缓存
|
||||
*/
|
||||
export async function removeSiteInfoCache(key?: string) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website/clearSiteInfo/' + key
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询网站
|
||||
*/
|
||||
export async function pageWebsite(params: WebsiteParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Website>>>(
|
||||
MODULES_API_URL + '/cms/website/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询网站列表
|
||||
*/
|
||||
export async function listWebsite(params?: WebsiteParam) {
|
||||
const res = await request.get<ApiResult<Website[]>>(
|
||||
MODULES_API_URL + '/cms/website',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加网站
|
||||
*/
|
||||
export async function addWebsite(data: Website) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改网站
|
||||
*/
|
||||
export async function updateWebsite(data: Website) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除网站
|
||||
*/
|
||||
export async function removeWebsite(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除网站
|
||||
*/
|
||||
export async function removeBatchWebsite(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateWebsiteStatus(websiteId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website/status',
|
||||
{
|
||||
websiteId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询网站
|
||||
*/
|
||||
export async function getWebsite(id: number) {
|
||||
const res = await request.get<ApiResult<Website>>(
|
||||
MODULES_API_URL + '/cms/website/' + 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>>(
|
||||
MODULES_API_URL + '/cms/website/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
57
src/api/cms/website/model/index.ts
Normal file
57
src/api/cms/website/model/index.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import { WebsiteField } from '@/api/cms/website/field/model';
|
||||
import {Navigation} from "@/api/cms/navigation/model";
|
||||
import {Link} from "@/api/oa/link/model";
|
||||
import {ArrangeCategory} from "@/api/cms/category/model";
|
||||
|
||||
/**
|
||||
* 菜单
|
||||
*/
|
||||
export interface Website {
|
||||
websiteId?: number;
|
||||
websiteName?: string;
|
||||
websiteCode?: string;
|
||||
websiteIcon?: string;
|
||||
websiteLogo?: string;
|
||||
websiteDarkLogo?: string;
|
||||
keywords?: string;
|
||||
address?: string;
|
||||
phone?: string;
|
||||
email?: string;
|
||||
websiteType?: string;
|
||||
expirationTime?: string;
|
||||
templateId?: string;
|
||||
industryParent?: string;
|
||||
industryChild?: string;
|
||||
companyId?: number;
|
||||
domain?: string;
|
||||
icpNo?: string;
|
||||
policeNo?: string;
|
||||
comments?: string;
|
||||
sortNumber?: number;
|
||||
createTime?: string;
|
||||
disabled?: boolean;
|
||||
country?: string;
|
||||
province?: string;
|
||||
city?: string;
|
||||
region?: string;
|
||||
appId?: number;
|
||||
fields?: WebsiteField[];
|
||||
status?: number;
|
||||
tenantId?: number;
|
||||
tenantName?: string;
|
||||
navigations?: Navigation[];
|
||||
categoryList?: ArrangeCategory[];
|
||||
links?: Link[];
|
||||
// 配置信息
|
||||
config?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单搜索参数
|
||||
*/
|
||||
export interface WebsiteParam {
|
||||
title?: string;
|
||||
path?: string;
|
||||
authority?: string;
|
||||
parentId?: number;
|
||||
}
|
||||
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://www.gxwebsoft.com/20200610/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://www.gxwebsoft.com/20200610/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://www.gxwebsoft.com/20200610/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://www.gxwebsoft.com/20200610/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));
|
||||
}
|
||||
95
src/api/dashboard/appstore/model/index.ts
Normal file
95
src/api/dashboard/appstore/model/index.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
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;
|
||||
}
|
||||
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://www.gxwebsoft.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://www.gxwebsoft.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;
|
||||
}
|
||||
47
src/api/index.ts
Normal file
47
src/api/index.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* 接口统一返回结果
|
||||
*/
|
||||
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;
|
||||
// 企业ID
|
||||
companyId?: number;
|
||||
// 商户ID
|
||||
merchantId?: 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: '支付宝' }
|
||||
];
|
||||
}
|
||||
}
|
||||
161
src/api/layout/index.ts
Normal file
161
src/api/layout/index.ts
Normal file
@@ -0,0 +1,161 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { User } from '@/api/system/user/model';
|
||||
import type { UpdatePasswordParam, NoticeResult } from './model';
|
||||
import { MODULES_API_URL, SERVER_API_URL } from '@/config/setting';
|
||||
import { Company } from '@/api/oa/company/model';
|
||||
import { Website } from '@/api/cms/website/model';
|
||||
|
||||
/**
|
||||
* 获取当前登录的用户信息、菜单、权限、角色
|
||||
*/
|
||||
export async function getTenantInfo(): Promise<Company> {
|
||||
const res = await request.get<ApiResult<Company>>(
|
||||
SERVER_API_URL + '/auth/tenant'
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取网站信息
|
||||
*/
|
||||
export async function getSiteInfo() {
|
||||
const res = await request.get<ApiResult<Website>>(
|
||||
MODULES_API_URL + '/cms/website/getSiteInfo'
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前登录的用户信息、菜单、权限、角色
|
||||
*/
|
||||
export async function getUserInfo(): Promise<User> {
|
||||
const res = await request.get<ApiResult<User>>(SERVER_API_URL + '/auth/user');
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 向子模块传递token
|
||||
* @param url
|
||||
*/
|
||||
export async function transferToken(url: string): Promise<string> {
|
||||
const res = await request.get<ApiResult<unknown>>(url);
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改当前登录的用户密码
|
||||
*/
|
||||
export async function updatePassword(
|
||||
data: UpdatePasswordParam
|
||||
): Promise<string> {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/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 前完成'
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
74
src/api/layout/model/index.ts
Normal file
74
src/api/layout/model/index.ts
Normal file
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* 首页布局样式
|
||||
*/
|
||||
export interface Layout {
|
||||
// 内容区域的宽度
|
||||
width?: string;
|
||||
// 文字颜色
|
||||
color?: string;
|
||||
// 高亮颜色
|
||||
hover?: string;
|
||||
// 背景颜色
|
||||
backgroundColor?: string;
|
||||
headerStyle?: any;
|
||||
siteNameStyle?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码参数
|
||||
*/
|
||||
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[];
|
||||
}
|
||||
73
src/api/login/index.ts
Normal file
73
src/api/login/index.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
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';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
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>>(
|
||||
SERVER_API_URL + '/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.data;
|
||||
}
|
||||
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;
|
||||
}
|
||||
126
src/api/oa/app/field/index.ts
Normal file
126
src/api/oa/app/field/index.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { AppField, AppFieldParam } from '@/api/oa/app/field/model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询项目参数
|
||||
*/
|
||||
export async function pageAppField(params: AppFieldParam) {
|
||||
const res = await request.get<ApiResult<PageResult<AppField>>>(
|
||||
MODULES_API_URL + '/oa/app-field/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目参数列表
|
||||
*/
|
||||
export async function listAppField(params?: AppFieldParam) {
|
||||
const res = await request.get<ApiResult<AppField[]>>(
|
||||
MODULES_API_URL + '/oa/app-field',
|
||||
{
|
||||
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 getAppField(id: number) {
|
||||
const res = await request.get<ApiResult<AppField>>(
|
||||
MODULES_API_URL + '/oa/app-field/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加项目参数
|
||||
*/
|
||||
export async function addAppField(data: AppField) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目参数
|
||||
*/
|
||||
export async function updateAppField(data: AppField) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目参数
|
||||
*/
|
||||
export async function removeAppField(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-field/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除项目参数
|
||||
*/
|
||||
export async function removeBatchAppField(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-field/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>>(
|
||||
MODULES_API_URL + '/oa/app-field/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
24
src/api/oa/app/field/model/index.ts
Normal file
24
src/api/oa/app/field/model/index.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 项目参数
|
||||
*/
|
||||
export interface AppField {
|
||||
id?: number;
|
||||
name?: string;
|
||||
comments?: string;
|
||||
userId?: number;
|
||||
appId?: number;
|
||||
status?: any;
|
||||
sortNumber?: any;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目参数搜索条件
|
||||
*/
|
||||
export interface AppFieldParam extends PageParam {
|
||||
id?: number;
|
||||
userId?: number;
|
||||
appId?: number;
|
||||
}
|
||||
177
src/api/oa/app/index.ts
Normal file
177
src/api/oa/app/index.ts
Normal file
@@ -0,0 +1,177 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { App, AppParam } from './model/index';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
export async function getCount() {
|
||||
const res = await request.get(MODULES_API_URL + '/oa/app/data');
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询应用
|
||||
*/
|
||||
export async function pageApp(params: AppParam) {
|
||||
const res = await request.get<ApiResult<PageResult<App>>>(
|
||||
MODULES_API_URL + '/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[]>>(MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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: any[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app/saveAuthority',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
163
src/api/oa/app/model/index.ts
Normal file
163
src/api/oa/app/model/index.ts
Normal file
@@ -0,0 +1,163 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import { AppUser } from '@/api/oa/app/user/model';
|
||||
import { AppField } from '@/api/oa/app/field/model';
|
||||
|
||||
/**
|
||||
* 应用
|
||||
*/
|
||||
export interface App {
|
||||
// 应用id
|
||||
appId?: number;
|
||||
// 应用秘钥
|
||||
appSecret?: string;
|
||||
// 英文名称
|
||||
enName?: string;
|
||||
// 应用名称
|
||||
appName?: string;
|
||||
// 上级id, 0是顶级
|
||||
parentId?: number;
|
||||
// 应用编号
|
||||
appCode?: string;
|
||||
// 应用图标
|
||||
appIcon?: string;
|
||||
appQrcode?: string;
|
||||
// 应用截图
|
||||
images?: string;
|
||||
// 应用类型
|
||||
appType?: string;
|
||||
appTypeMultiple?: string[];
|
||||
// 菜单类型
|
||||
menuType?: number;
|
||||
// 应用地址
|
||||
appUrl?: string;
|
||||
// 后台管理地址
|
||||
adminUrl?: string;
|
||||
// 原型图地址
|
||||
prototypeUrl?: string;
|
||||
// 下载地址
|
||||
downUrl?: string;
|
||||
// 服务器接口地址
|
||||
serverUrl?: string;
|
||||
// 模块接口地址
|
||||
modulesUrl?: string;
|
||||
// 回调地址
|
||||
callbackUrl?: string;
|
||||
// 腾讯文档地址
|
||||
gitUrl?: string;
|
||||
docsUrl?: string;
|
||||
ipAddress?: string;
|
||||
fileUrl?: string;
|
||||
// 应用包名
|
||||
packageName?: string;
|
||||
// 点击次数
|
||||
clicks?: string;
|
||||
// 安装次数
|
||||
installs?: string;
|
||||
// 项目介绍
|
||||
content?: string;
|
||||
// 开发者(个人)
|
||||
developer?: string;
|
||||
director?: string;
|
||||
projectDirector?: string;
|
||||
salesman?: string;
|
||||
// 续费金额
|
||||
renewMoney?: 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?: any;
|
||||
tenantName?: string;
|
||||
companyId?: number;
|
||||
companyName?: string;
|
||||
// 租户编号
|
||||
tenantCode?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 过期时间
|
||||
expirationTime?: string;
|
||||
// 应用状态
|
||||
appStatus?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 发布者
|
||||
userId?: any;
|
||||
// 发布者昵称
|
||||
nickname?: string;
|
||||
// 子菜单
|
||||
children?: App[];
|
||||
// 权限树回显选中状态, 0未选中, 1选中
|
||||
checked?: boolean;
|
||||
//
|
||||
key?: number;
|
||||
//
|
||||
value?: number;
|
||||
//
|
||||
parentIds?: number[];
|
||||
//
|
||||
openType?: number;
|
||||
//
|
||||
search?: any;
|
||||
// 成员管理
|
||||
users?: AppUser[];
|
||||
fields?: AppField[];
|
||||
// 项目需求
|
||||
requirement?: string;
|
||||
phone?: string;
|
||||
file1?: string;
|
||||
file2?: string;
|
||||
file3?: string;
|
||||
showCase?: boolean;
|
||||
showIndex?: boolean;
|
||||
recommend?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用搜索条件
|
||||
*/
|
||||
export interface AppParam extends PageParam {
|
||||
userId?: number;
|
||||
appName?: any;
|
||||
appCode?: string;
|
||||
appId?: number;
|
||||
developer?: string;
|
||||
tenantCode?: string;
|
||||
parentId?: string;
|
||||
tenantName?: string;
|
||||
companyName?: string;
|
||||
companyId?: number;
|
||||
status?: number;
|
||||
nickname?: string;
|
||||
appStatus?: any;
|
||||
showCase?: boolean;
|
||||
showIndex?: boolean;
|
||||
showExpiration?: boolean;
|
||||
keywords?: any;
|
||||
}
|
||||
126
src/api/oa/app/renew/index.ts
Normal file
126
src/api/oa/app/renew/index.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { AppRenew, AppRenewParam } from '@/api/oa/app/renew/model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询开发成员
|
||||
*/
|
||||
export async function pageAppRenew(params: AppRenewParam) {
|
||||
const res = await request.get<ApiResult<PageResult<AppRenew>>>(
|
||||
MODULES_API_URL + '/oa/app-renew/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询开发成员列表
|
||||
*/
|
||||
export async function listAppRenew(params?: AppRenewParam) {
|
||||
const res = await request.get<ApiResult<AppRenew[]>>(
|
||||
MODULES_API_URL + '/oa/app-renew',
|
||||
{
|
||||
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 getAppRenew(id: number) {
|
||||
const res = await request.get<ApiResult<AppRenew>>(
|
||||
MODULES_API_URL + '/oa/app-renew/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加开发成员
|
||||
*/
|
||||
export async function addAppRenew(data: AppRenew) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-renew',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改开发成员
|
||||
*/
|
||||
export async function updateAppRenew(data: AppRenew) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-renew',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除开发成员
|
||||
*/
|
||||
export async function removeAppRenew(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-renew/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除开发成员
|
||||
*/
|
||||
export async function removeBatchAppRenew(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-renew/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>>(
|
||||
MODULES_API_URL + '/oa/app-renew/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
40
src/api/oa/app/renew/model/index.ts
Normal file
40
src/api/oa/app/renew/model/index.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 开发成员
|
||||
*/
|
||||
export interface AppRenew {
|
||||
appRenewId?: number;
|
||||
money?: any;
|
||||
comments?: string;
|
||||
startTime?: any;
|
||||
endTime?: any;
|
||||
userId?: number;
|
||||
nickname?: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
mobile?: string;
|
||||
appId?: number;
|
||||
companyId?: number;
|
||||
status?: any;
|
||||
images?: string;
|
||||
files?: any;
|
||||
createTime?: string;
|
||||
editStatus?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开发成员搜索条件
|
||||
*/
|
||||
export interface AppRenewParam extends PageParam {
|
||||
userId?: number;
|
||||
appId?: number;
|
||||
}
|
||||
|
||||
export interface UserItem {
|
||||
key: string;
|
||||
isEdit?: boolean;
|
||||
number?: string;
|
||||
name?: string;
|
||||
department?: string;
|
||||
}
|
||||
106
src/api/oa/app/url/index.ts
Normal file
106
src/api/oa/app/url/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { AppUrl, AppUrlParam } from '@/api/oa/app/url/model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询项目域名
|
||||
*/
|
||||
export async function pageAppUrl(params: AppUrlParam) {
|
||||
const res = await request.get<ApiResult<PageResult<AppUrl>>>(
|
||||
MODULES_API_URL + '/oa/app-url/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目域名列表
|
||||
*/
|
||||
export async function listAppUrl(params?: AppUrlParam) {
|
||||
const res = await request.get<ApiResult<AppUrl[]>>(
|
||||
MODULES_API_URL + '/oa/app-url',
|
||||
{
|
||||
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 getAppUrl(id: number) {
|
||||
const res = await request.get<ApiResult<AppUrl>>(
|
||||
MODULES_API_URL + '/oa/app-url/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加项目域名
|
||||
*/
|
||||
export async function addAppUrl(data: AppUrl) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-url',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目域名
|
||||
*/
|
||||
export async function updateAppUrl(data: AppUrl) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-url',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目域名
|
||||
*/
|
||||
export async function removeAppUrl(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-url/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除项目域名
|
||||
*/
|
||||
export async function removeBatchAppUrl(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-url/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
26
src/api/oa/app/url/model/index.ts
Normal file
26
src/api/oa/app/url/model/index.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 项目域名
|
||||
*/
|
||||
export interface AppUrl {
|
||||
appUrlId?: number;
|
||||
name?: string;
|
||||
domain?: string;
|
||||
account?: string;
|
||||
password?: string;
|
||||
comments?: string;
|
||||
appId?: number;
|
||||
status?: any;
|
||||
sortNumber?: any;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目域名搜索条件
|
||||
*/
|
||||
export interface AppUrlParam extends PageParam {
|
||||
id?: number;
|
||||
userId?: number;
|
||||
appId?: number;
|
||||
}
|
||||
126
src/api/oa/app/user/index.ts
Normal file
126
src/api/oa/app/user/index.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { AppUser, AppUserParam } from '@/api/oa/app/user/model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询开发成员
|
||||
*/
|
||||
export async function pageAppUser(params: AppUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<AppUser>>>(
|
||||
MODULES_API_URL + '/oa/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[]>>(
|
||||
MODULES_API_URL + '/oa/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>>(
|
||||
MODULES_API_URL + '/oa/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>>(
|
||||
MODULES_API_URL + '/oa/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>>(
|
||||
MODULES_API_URL + '/oa/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>>(
|
||||
MODULES_API_URL + '/oa/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>>(
|
||||
MODULES_API_URL + '/oa/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>>(
|
||||
MODULES_API_URL + '/oa/app-user/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/oa/app/user/model/index.ts
Normal file
37
src/api/oa/app/user/model/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
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;
|
||||
mobile?: string;
|
||||
appId?: number;
|
||||
status?: string;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开发成员搜索条件
|
||||
*/
|
||||
export interface AppUserParam extends PageParam {
|
||||
userId?: number;
|
||||
appId?: number;
|
||||
role?: number;
|
||||
}
|
||||
|
||||
export interface UserItem {
|
||||
key: string;
|
||||
isEdit?: boolean;
|
||||
number?: string;
|
||||
name?: string;
|
||||
department?: string;
|
||||
}
|
||||
18
src/api/oa/apply/index.ts
Normal file
18
src/api/oa/apply/index.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { Customer } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 申请免费体验
|
||||
*/
|
||||
export async function apply(data: Customer) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/customer-apply',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
43
src/api/oa/apply/model/index.ts
Normal file
43
src/api/oa/apply/model/index.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 客户
|
||||
*/
|
||||
export interface Customer {
|
||||
// 客户id
|
||||
customerId?: number;
|
||||
// 客户类型
|
||||
customerType?: string;
|
||||
// 客户标识
|
||||
customerCode: string;
|
||||
// 客户名称
|
||||
customerName?: string;
|
||||
// 客户头像
|
||||
customerAvatar?: string;
|
||||
// 座机电话
|
||||
customerPhone?: string;
|
||||
// 手机号码
|
||||
customerMobile?: string;
|
||||
// 联系人
|
||||
customerContacts?: string;
|
||||
// 联系地址
|
||||
customerAddress?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 状态
|
||||
status?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户搜索条件
|
||||
*/
|
||||
export interface CustomerParam extends PageParam {
|
||||
customerName?: string;
|
||||
customerCode?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
134
src/api/oa/assets/index.ts
Normal file
134
src/api/oa/assets/index.ts
Normal file
@@ -0,0 +1,134 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Assets, AssetsParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
export async function getCount() {
|
||||
const res = await request.get(MODULES_API_URL + '/oa/assets/data');
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询资产
|
||||
*/
|
||||
export async function pageAssets(params: AssetsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Assets>>>(
|
||||
MODULES_API_URL + '/oa/assets/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询资产列表
|
||||
*/
|
||||
export async function listAssets(params?: AssetsParam) {
|
||||
const res = await request.get<ApiResult<Assets[]>>(
|
||||
MODULES_API_URL + '/oa/assets',
|
||||
{
|
||||
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 getAssets(id: number) {
|
||||
const res = await request.get<ApiResult<Assets>>(
|
||||
MODULES_API_URL + '/oa/assets/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加资产
|
||||
*/
|
||||
export async function addAssets(data: Assets) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/assets',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改资产
|
||||
*/
|
||||
export async function updateAssets(data: Assets) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/assets',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资产
|
||||
*/
|
||||
export async function removeAssets(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/assets/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除资产
|
||||
*/
|
||||
export async function removeBatchAssets(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/assets/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>>(
|
||||
MODULES_API_URL + '/oa/assets/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
89
src/api/oa/assets/model/index.ts
Normal file
89
src/api/oa/assets/model/index.ts
Normal file
@@ -0,0 +1,89 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import type { User } from '@/api/system/user/model';
|
||||
import {AssetsUser} from "@/api/oa/assets/user/model";
|
||||
|
||||
/**
|
||||
* 资产
|
||||
*/
|
||||
export interface Assets {
|
||||
// 资产id
|
||||
assetsId?: number;
|
||||
// 资产类型
|
||||
type?: string;
|
||||
// 资产标识
|
||||
code: string;
|
||||
// 资产名称
|
||||
name?: string;
|
||||
//
|
||||
account?: string;
|
||||
//
|
||||
password?: string;
|
||||
//
|
||||
panel?: string;
|
||||
//
|
||||
panelAccount?: string;
|
||||
//
|
||||
panelPassword?: string;
|
||||
//
|
||||
configuration?: any;
|
||||
root?: string;
|
||||
//
|
||||
sortNumber?: number;
|
||||
financeAmount?: any;
|
||||
financeYears?: any;
|
||||
financeRenew?: any;
|
||||
financeCustomerName?: string;
|
||||
financeCustomerContact?: string;
|
||||
financeCustomerPhone?: string;
|
||||
//
|
||||
brandAccount?: string;
|
||||
brandPassword?: string;
|
||||
btSign?: string;
|
||||
openPort?: any;
|
||||
comments?: string;
|
||||
// 所属客户
|
||||
customerId?: number;
|
||||
customerName?: string;
|
||||
// 品牌
|
||||
brand?: string;
|
||||
// 购买时间
|
||||
startTime?: string;
|
||||
// 到期时间
|
||||
endTime?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 状态
|
||||
status?: string;
|
||||
userId?: number;
|
||||
companyId?: number;
|
||||
companyName?: string;
|
||||
nickname?: string;
|
||||
// 可见性类型
|
||||
visibility?: string;
|
||||
// 可见用户ID
|
||||
userList?: User[];
|
||||
systemTotal?: Object;
|
||||
diskInfo?: Object;
|
||||
netWork?: Object;
|
||||
sites?: Object;
|
||||
users?: AssetsUser[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 资产搜索条件
|
||||
*/
|
||||
export interface AssetsParam extends PageParam {
|
||||
assetsId?: number;
|
||||
name?: string;
|
||||
code?: string;
|
||||
isExpire?: string;
|
||||
status?: string;
|
||||
brand?: string;
|
||||
customerId?: string;
|
||||
companyId?: number;
|
||||
companyName?: string;
|
||||
userId?: number;
|
||||
showExpiration?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
129
src/api/oa/assets/user/index.ts
Normal file
129
src/api/oa/assets/user/index.ts
Normal file
@@ -0,0 +1,129 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
AssetsUser,
|
||||
AssetsUserParam
|
||||
} from '@/api/oa/assets/user/model/index';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询开发成员
|
||||
*/
|
||||
export async function pageAssetsUser(params: AssetsUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<AssetsUser>>>(
|
||||
MODULES_API_URL + '/oa/assets-user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询开发成员列表
|
||||
*/
|
||||
export async function listAssetsUser(params?: AssetsUserParam) {
|
||||
const res = await request.get<ApiResult<AssetsUser[]>>(
|
||||
MODULES_API_URL + '/oa/assets-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 getAssetsUser(id: number) {
|
||||
const res = await request.get<ApiResult<AssetsUser>>(
|
||||
MODULES_API_URL + '/oa/assets-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 addAssetsUser(data: AssetsUser) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/assets-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改开发成员
|
||||
*/
|
||||
export async function updateAssetsUser(data: AssetsUser) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/assets-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除开发成员
|
||||
*/
|
||||
export async function removeAssetsUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/assets-user/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除开发成员
|
||||
*/
|
||||
export async function removeBatchAssetsUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/assets-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>>(
|
||||
MODULES_API_URL + '/oa/assets-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/oa/assets/user/model/index.ts
Normal file
35
src/api/oa/assets/user/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 开发成员
|
||||
*/
|
||||
export interface AssetsUser {
|
||||
// 开发成员id
|
||||
id?: number;
|
||||
role?: number;
|
||||
userId?: number;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
avatar?: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
assetsId?: number;
|
||||
status?: string;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开发成员搜索条件
|
||||
*/
|
||||
export interface AssetsUserParam extends PageParam {
|
||||
userId?: number;
|
||||
assetsId?: number;
|
||||
}
|
||||
|
||||
export interface UserItem {
|
||||
key: string;
|
||||
isEdit?: boolean;
|
||||
number?: string;
|
||||
name?: string;
|
||||
department?: string;
|
||||
}
|
||||
31
src/api/oa/chatgpt/index.ts
Normal file
31
src/api/oa/chatgpt/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import { ChatParam } from '@/api/oa/chatgpt/model';
|
||||
import {MODULES_API_URL} from "@/config/setting";
|
||||
|
||||
/**
|
||||
* 发送
|
||||
*/
|
||||
export async function send(data: ChatParam) {
|
||||
const res = await request.post<ApiResult<unknown>>(MODULES_API_URL + '/open/chat/send', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求openAI
|
||||
* /open/chat/chat
|
||||
* 'https://chatgpt.websoft.top/api/open/chat/chat',
|
||||
*/
|
||||
export async function chat(data: ChatParam) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'https://chatgpt.websoft.top/api/open/chat/chat',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
17
src/api/oa/chatgpt/model/index.ts
Normal file
17
src/api/oa/chatgpt/model/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
export interface Chat {
|
||||
noticeId?: number;
|
||||
content?: any;
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务搜索条件
|
||||
*/
|
||||
export interface ChatParam {
|
||||
tenantId?: number;
|
||||
content?: string;
|
||||
noticeId?: number;
|
||||
}
|
||||
130
src/api/oa/company/field/index.ts
Normal file
130
src/api/oa/company/field/index.ts
Normal file
@@ -0,0 +1,130 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
CompanyField,
|
||||
CompanyFieldParam
|
||||
} from '@/api/oa/company/field/model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询客户资料
|
||||
*/
|
||||
export async function pageCompanyField(params: CompanyFieldParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CompanyField>>>(
|
||||
MODULES_API_URL + '/oa/company-field/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
console.log(res.data.data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户资料列表
|
||||
*/
|
||||
export async function listCompanyField(params?: CompanyFieldParam) {
|
||||
const res = await request.get<ApiResult<CompanyField[]>>(
|
||||
MODULES_API_URL + '/oa/company-field',
|
||||
{
|
||||
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 getCompanyField(id: number) {
|
||||
const res = await request.get<ApiResult<CompanyField>>(
|
||||
MODULES_API_URL + '/oa/company-field/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加客户资料
|
||||
*/
|
||||
export async function addCompanyField(data: CompanyField) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/company-field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户资料
|
||||
*/
|
||||
export async function updateCompanyField(data: CompanyField) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/company-field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户资料
|
||||
*/
|
||||
export async function removeCompanyField(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/company-field/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除客户资料
|
||||
*/
|
||||
export async function removeBatchCompanyField(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/company-field/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>>(
|
||||
MODULES_API_URL + '/oa/company-field/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
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