框架更新

This commit is contained in:
2024-08-02 23:22:38 +08:00
parent 0cda1968e8
commit ff46808425
214 changed files with 6171 additions and 15881 deletions
+8
View File
@@ -24,6 +24,8 @@ export interface MpMenu {
icon?: string;
// 图标颜色
color?: string;
// 所在行
rows?: number;
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)
hide?: number;
// 位置 0不限 1顶部 2底部
@@ -48,6 +50,8 @@ export interface MpMenu {
goodsId?: number;
// 用户ID
userId?: number;
// 是否管理人员可见
adminShow?: number;
// 设为首页
home?: number;
// 排序(数字越小越靠前)
@@ -63,13 +67,17 @@ export interface MpMenu {
// 子菜单
children?: MpMenu[];
pageName?: string;
groupName?: string;
}
/**
* 小程序端菜单搜索条件
*/
export interface MpMenuParam extends PageParam {
parentId?: number;
menuId?: number;
pageId?: number;
subpackage?: string;
type?: number;
keywords?: string;
}
+123
View File
@@ -0,0 +1,123 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { Mp, MpParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 首页数据
* @param params
*/
export async function getIndex(params: MpParam) {
const res = await request.get<ApiResult<PageResult<Mp>>>(
MODULES_API_URL + '/cms/mp/index',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 分页查询小程序信息
*/
export async function pageMp(params: MpParam) {
const res = await request.get<ApiResult<PageResult<Mp>>>(
MODULES_API_URL + '/cms/mp/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询小程序信息列表
*/
export async function listMp(params?: MpParam) {
const res = await request.get<ApiResult<Mp[]>>(
MODULES_API_URL + '/cms/mp',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加小程序信息
*/
export async function addMp(data: Mp) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/cms/mp',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改小程序信息
*/
export async function updateMp(data: Mp) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/cms/mp',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除小程序信息
*/
export async function removeMp(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/cms/mp/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除小程序信息
*/
export async function removeBatchMp(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/cms/mp/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询小程序信息
*/
export async function getMp(id: number) {
const res = await request.get<ApiResult<Mp>>(
MODULES_API_URL + '/cms/mp/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
+73
View File
@@ -0,0 +1,73 @@
import type { PageParam } from '@/api';
import type {MpMenu} from "@/api/cms/mp-menu/model";
import type {Ad} from "@/api/cms/ad/model";
/**
* 小程序信息封装
*/
export interface MpInfo {
mp?: Mp;
config?: any;
tabBar?: MpMenu[];
slide?: Ad;
mpMenus?: MpMenu[];
serverTime?: any;
}
/**
* 小程序信息
*/
export interface Mp {
// ID
mpId?: number;
// 小程序ID
appId?: string;
// 小程序密钥
appSecret?: string;
// 小程序名称
mpName?: string;
// 小程序简称
shortName?: string;
// 头像
avatar?: string;
// 小程序码
mpQrcode?: string;
// 微信认证
authentication?: number;
// 主体信息
companyName?: string;
// 小程序备案
icpNo?: string;
// 登录邮箱
email?: string;
// 登录密码
password?: string;
// 原始ID
ghId?: string;
// 入口页面
mainPath?: string;
// 过期时间
expirationTime?: string;
// 排序(数字越小越靠前)
sortNumber?: number;
// 介绍
comments?: string;
// 用户ID
userId?: number;
// 状态, 0正常, 1冻结
status?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 注册时间
createTime?: string;
}
/**
* 小程序信息搜索条件
*/
export interface MpParam extends PageParam {
mpId?: number;
keywords?: string;
}
+45
View File
@@ -0,0 +1,45 @@
import type { PageParam } from '@/api';
/**
* 小程序广告位
*/
export interface MpAd {
// ID
adId?: number;
// 页面ID
pageId?: number;
// 广告类型
adType?: string;
// 广告位名称
name?: string;
// 宽
width?: string;
// 高
height?: string;
// 广告图片
images?: string;
// 路由/链接地址
path?: string;
// 用户ID
userId?: number;
// 排序(数字越小越靠前)
sortNumber?: number;
// 备注
comments?: string;
// 状态, 0正常, 1冻结
status?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 注册时间
createTime?: string;
}
/**
* 小程序广告位搜索条件
*/
export interface MpAdParam extends PageParam {
adId?: number;
keywords?: string;
}
+132
View File
@@ -0,0 +1,132 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { MpField, MpFieldParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询小程序配置
*/
export async function pageMpField(params: MpFieldParam) {
const res = await request.get<ApiResult<PageResult<MpField>>>(
MODULES_API_URL + '/cms/mp-field/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询小程序配置列表
*/
export async function listMpField(params?: MpFieldParam) {
const res = await request.get<ApiResult<MpField[]>>(
MODULES_API_URL + '/cms/mp-field',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加小程序配置
*/
export async function addMpField(data: MpField) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/cms/mp-field',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改小程序配置
*/
export async function updateMpField(data: MpField) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/cms/mp-field',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除小程序配置
*/
export async function removeMpField(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/cms/mp-field/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除小程序配置
*/
export async function removeBatchMpField(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/cms/mp-field/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询小程序配置
*/
export async function getMpField(id: number) {
const res = await request.get<ApiResult<MpField>>(
MODULES_API_URL + '/cms/mp-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 removeMpInfoCache(key?: string) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/cms/mp-field/clearMpInfo/' + key
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 恢复项目参数
*/
export async function undeleteMpField(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/cms/mp-field/undelete/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
+33
View File
@@ -0,0 +1,33 @@
import type { PageParam } from '@/api';
/**
* 小程序配置
*/
export interface MpField {
// 自增ID
id?: number;
// 类型,0文本 1图片 2其他
type?: number;
// 名称
name?: string;
// 备注
comments?: string;
// 名称
value?: string;
// 排序(数字越小越靠前)
sortNumber?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 注册时间
createTime?: string;
}
/**
* 小程序配置搜索条件
*/
export interface MpFieldParam extends PageParam {
id?: number;
keywords?: string;
}
@@ -1,14 +1,14 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { Link, LinkParam } from './model';
import type { MpPages, MpPagesParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询链接
* 分页查询小程序页面
*/
export async function pageLink(params: LinkParam) {
const res = await request.get<ApiResult<PageResult<Link>>>(
MODULES_API_URL + '/oa/link/page',
export async function pageMpPages(params: MpPagesParam) {
const res = await request.get<ApiResult<PageResult<MpPages>>>(
MODULES_API_URL + '/cms/mp-pages/page',
{
params
}
@@ -20,11 +20,11 @@ export async function pageLink(params: LinkParam) {
}
/**
* 查询链接列表
* 查询小程序页面列表
*/
export async function listLink(params?: LinkParam) {
const res = await request.get<ApiResult<Link[]>>(
MODULES_API_URL + '/oa/link',
export async function listMpPages(params?: MpPagesParam) {
const res = await request.get<ApiResult<MpPages[]>>(
MODULES_API_URL + '/cms/mp-pages',
{
params
}
@@ -36,11 +36,11 @@ export async function listLink(params?: LinkParam) {
}
/**
* 添加链接
* 添加小程序页面
*/
export async function addLink(data: Link) {
export async function addMpPages(data: MpPages) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/oa/link',
MODULES_API_URL + '/cms/mp-pages',
data
);
if (res.data.code === 0) {
@@ -50,11 +50,11 @@ export async function addLink(data: Link) {
}
/**
* 修改链接
* 修改小程序页面
*/
export async function updateLink(data: Link) {
export async function updateMpPages(data: MpPages) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/oa/link',
MODULES_API_URL + '/cms/mp-pages',
data
);
if (res.data.code === 0) {
@@ -64,11 +64,11 @@ export async function updateLink(data: Link) {
}
/**
* 删除链接
* 删除小程序页面
*/
export async function removeLink(id?: number) {
export async function removeMpPages(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/oa/link/' + id
MODULES_API_URL + '/cms/mp-pages/' + id
);
if (res.data.code === 0) {
return res.data.message;
@@ -77,11 +77,11 @@ export async function removeLink(id?: number) {
}
/**
* 批量删除链接
* 批量删除小程序页面
*/
export async function removeBatchLink(data: (number | undefined)[]) {
export async function removeBatchMpPages(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/oa/link/batch',
MODULES_API_URL + '/cms/mp-pages/batch',
{
data
}
@@ -93,21 +93,14 @@ export async function removeBatchLink(data: (number | undefined)[]) {
}
/**
* 检查IP是否存在
* 根据id查询小程序页面
*/
export async function checkExistence(
field: string,
value: string,
id?: number
) {
const res = await request.get<ApiResult<unknown>>(
MODULES_API_URL + '/oa/link/existence',
{
params: { field, value, id }
}
export async function getMpPages(id: number) {
const res = await request.get<ApiResult<MpPages>>(
MODULES_API_URL + '/cms/mp-pages/' + id
);
if (res.data.code === 0) {
return res.data.message;
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
+48
View File
@@ -0,0 +1,48 @@
import type { PageParam } from '@/api';
/**
* 小程序页面
*/
export interface MpPages {
// ID
id?: number;
// 上级id, 0是顶级
parentId?: number;
// 页面名称
title?: string;
// 页面路径
path?: string;
// 设为首页
home?: number;
// 分包
subpackage?: string;
// 图标
icon?: string;
// 排序(数字越小越靠前)
sortNumber?: number;
// 备注
comments?: string;
// 用户ID
userId?: number;
// 状态, 0正常, 1冻结
status?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 注册时间
createTime?: string;
// 子页面
children?: MpPages[];
}
/**
* 小程序页面搜索条件
*/
export interface MpPagesParam extends PageParam {
id?: number;
title?: string;
path?: string;
subpackage?: string;
keywords?: string;
}
+13
View File
@@ -127,3 +127,16 @@ export async function checkExistence(
}
return Promise.reject(new Error(res.data.message));
}
/**
* 恢复项目参数
*/
export async function undeleteWebsiteField(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/cms/website-field/undelete/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
+6 -1
View File
@@ -9,12 +9,14 @@ export interface WebsiteField {
value?: string;
comments?: string;
userId?: number;
websiteId?: number;
type?: number;
status?: any;
sortNumber?: any;
createTime?: string;
deleted?: number;
}
// 约定的网站参数名称
export interface WebsiteParam {
// 网站名称
site_logo?: string;
@@ -26,6 +28,8 @@ export interface WebsiteParam {
// 约定的小程序参数名称
export interface MpWeixinParam {
// 小程序LOGO
site_logo?: string;
// 我的页面顶部背景图片
mp_user_top?: string;
}
@@ -36,5 +40,6 @@ export interface MpWeixinParam {
export interface WebsiteFieldParam extends PageParam {
id?: number;
userId?: number;
name?: string;
websiteId?: number;
}
+65 -8
View File
@@ -1,13 +1,40 @@
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>>>(
'/cms/website/page',
MODULES_API_URL + '/cms/website/page',
{
params
}
@@ -23,7 +50,7 @@ export async function pageWebsite(params: WebsiteParam) {
*/
export async function listWebsite(params?: WebsiteParam) {
const res = await request.get<ApiResult<Website[]>>(
'/cms/website',
MODULES_API_URL + '/cms/website',
{
params
}
@@ -39,7 +66,7 @@ export async function listWebsite(params?: WebsiteParam) {
*/
export async function addWebsite(data: Website) {
const res = await request.post<ApiResult<unknown>>(
'/cms/website',
MODULES_API_URL + '/cms/website',
data
);
if (res.data.code === 0) {
@@ -53,7 +80,7 @@ export async function addWebsite(data: Website) {
*/
export async function updateWebsite(data: Website) {
const res = await request.put<ApiResult<unknown>>(
'/cms/website',
MODULES_API_URL + '/cms/website',
data
);
if (res.data.code === 0) {
@@ -67,7 +94,7 @@ export async function updateWebsite(data: Website) {
*/
export async function removeWebsite(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/cms/website/' + id
MODULES_API_URL + '/cms/website/' + id
);
if (res.data.code === 0) {
return res.data.message;
@@ -80,7 +107,7 @@ export async function removeWebsite(id?: number) {
*/
export async function removeBatchWebsite(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/cms/website/batch',
MODULES_API_URL + '/cms/website/batch',
{
data
}
@@ -91,6 +118,36 @@ export async function removeBatchWebsite(data: (number | undefined)[]) {
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是否存在
*/
@@ -100,7 +157,7 @@ export async function checkExistence(
id?: number
) {
const res = await request.get<ApiResult<unknown>>(
'/cms/website/existence',
MODULES_API_URL + '/cms/website/existence',
{
params: { field, value, id }
}
+61 -48
View File
@@ -1,58 +1,71 @@
import type { PageParam } from '@/api';
import type { WebsiteField } from '@/api/cms/website/field/model';
import type { Navigation } from "@/api/cms/navigation/model";
import type { Link } from "@/api/oa/link/model";
import type { ArrangeCategory } from "@/api/cms/category/model";
import type {WebsiteField} from '@/api/cms/website/field/model';
import type {Navigation} from "@/api/cms/navigation/model";
import type {Link} from "@/api/oa/link/model";
import type {ArrangeCategory} from "@/api/cms/category/model";
import type {MpMenu} from "@/api/cms/mp-menu/model";
import type {Ad} from "@/api/cms/ad/model";
/**
* 网站信息
*/
export interface WebSiteInfo {
website?: Website;
config?: any;
tabBar?: MpMenu[];
slide?: Ad;
mpMenus?: MpMenu[];
serverTime?: any;
}
/**
* 网站
*/
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;
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?: boolean;
tenantId?: number;
tenantName?: string;
navigations?: Navigation[];
categoryList?: ArrangeCategory[];
links?: Link[];
// 配置信息
config?: any;
}
/**
* 网站搜索条件
* 菜单搜索参数
*/
export interface WebsiteParam extends PageParam {
title ?: string;
path ?: string;
authority ?: string;
parentId ?: number;
export interface WebsiteParam {
title?: string;
path?: string;
authority?: string;
parentId?: number;
}
+72 -151
View File
@@ -1,86 +1,99 @@
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 type { Company } from '@/api/system/company/model';
import type { Website } from '@/api/cms/website/model';
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 type {Company} from '@/api/system/company/model';
import type {WebSiteInfo} from '@/api/cms/website/model';
import type {MpInfo} from "@/api/cms/mp/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 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));
const res = await request.get<ApiResult<WebSiteInfo>>(
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 getMpInfo() {
const res = await request.get<ApiResult<MpInfo>>(
MODULES_API_URL + '/cms/mp/getMpInfo'
);
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));
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 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));
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));
}
/**
* 获取未来7天的日期
* @return
*/
export async function getNext7day() {
const res = await request.get<ApiResult<unknown>>(MODULES_API_URL + '/cms/website/getNext7day');
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
const res = await request.get<ApiResult<unknown>>(MODULES_API_URL + '/cms/website/getNext7day');
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
@@ -88,11 +101,11 @@ export async function getNext7day() {
* @return
*/
export async function getServerTime() {
const res = await request.get<ApiResult<unknown>>(MODULES_API_URL + '/cms/website/getServerTime');
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
const res = await request.get<ApiResult<unknown>>(MODULES_API_URL + '/cms/website/getServerTime');
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
@@ -100,104 +113,12 @@ export async function getServerTime() {
* https://modules.gxwebsoft.com/json/regions-data.json
*/
export async function getRegions() {
const res = await request.get<ApiResult<unknown>>(
'https://modules.gxwebsoft.com/json/regions-data.json'
);
console.log('res: ',res);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
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 前完成'
}
]
};
const res = await request.get<ApiResult<unknown>>(
'https://modules.gxwebsoft.com/json/regions-data.json'
);
console.log('res: ', res);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
+153
View File
@@ -0,0 +1,153 @@
/** 菜单用到的图标 */
export {
HomeOutlined,
SettingOutlined,
TeamOutlined,
DesktopOutlined,
FileTextOutlined,
TableOutlined,
AppstoreOutlined,
CheckCircleOutlined,
ExclamationCircleOutlined,
UserOutlined,
TagOutlined,
IdcardOutlined,
BarChartOutlined,
AuditOutlined,
PicLeftOutlined,
BellOutlined,
CloseCircleOutlined,
QuestionCircleOutlined,
SoundOutlined,
ApartmentOutlined,
DashboardOutlined,
OneToOneOutlined,
DragOutlined,
InteractionOutlined,
BankOutlined,
BlockOutlined,
CheckSquareOutlined,
ProfileOutlined,
WarningOutlined,
FolderOutlined,
YoutubeOutlined,
ControlOutlined,
EllipsisOutlined,
CalendarOutlined,
AppstoreAddOutlined,
FileSearchOutlined,
EnvironmentOutlined,
CompassOutlined,
FontSizeOutlined,
SketchOutlined,
BgColorsOutlined,
PrinterOutlined,
QrcodeOutlined,
BarcodeOutlined,
PictureOutlined,
LinkOutlined,
AlertOutlined,
HistoryOutlined,
ChromeOutlined,
CodeOutlined,
AntDesignOutlined,
ReadOutlined,
CrownOutlined,
LaptopOutlined,
ShoppingCartOutlined,
SkinOutlined,
ShopOutlined,
ShoppingOutlined,
AliyunOutlined,
GiftOutlined,
InsuranceOutlined,
FileZipOutlined,
SearchOutlined,
RedEnvelopeOutlined,
MoneyCollectOutlined,
TagsOutlined,
PayCircleOutlined,
RocketOutlined,
BarsOutlined,
WalletOutlined,
UngroupOutlined,
ToolOutlined,
HourglassOutlined,
FormatPainterOutlined,
CarOutlined,
DownloadOutlined,
UploadOutlined,
MailOutlined,
CloudOutlined,
ClearOutlined,
CoffeeOutlined,
CopyrightOutlined,
CompressOutlined,
CalculatorOutlined,
AimOutlined,
AudioOutlined,
BugOutlined,
CloudSyncOutlined,
CommentOutlined,
DisconnectOutlined,
DingtalkOutlined,
ExpandOutlined,
DollarOutlined,
FolderOpenOutlined,
ExperimentOutlined,
ForkOutlined,
FolderAddOutlined,
FunnelPlotOutlined,
GlobalOutlined,
LikeOutlined,
LayoutOutlined,
MergeCellsOutlined,
MehOutlined,
MobileOutlined,
NodeExpandOutlined,
PaperClipOutlined,
ScanOutlined,
ShakeOutlined,
ThunderboltOutlined,
TrademarkOutlined,
UnlockOutlined,
UsbOutlined,
WhatsAppOutlined,
WomanOutlined,
WifiOutlined,
VerifiedOutlined,
UserSwitchOutlined,
UsergroupAddOutlined,
UsergroupDeleteOutlined,
UserAddOutlined,
UserDeleteOutlined,
TranslationOutlined,
TransactionOutlined,
TrophyOutlined,
StarOutlined,
SplitCellsOutlined,
ShareAltOutlined,
RestOutlined,
PartitionOutlined,
MedicineBoxOutlined,
HeartOutlined,
GatewayOutlined,
FlagOutlined,
FireOutlined,
FieldNumberOutlined,
FieldStringOutlined,
AppleOutlined,
AndroidOutlined,
GithubOutlined,
Html5Outlined,
QqOutlined,
AlipayOutlined,
RedditOutlined,
InstagramOutlined,
WechatOutlined,
BorderOutlined,
PieChartOutlined,
AreaChartOutlined,
KeyOutlined,
LockOutlined
} from '@ant-design/icons-vue';
-146
View File
@@ -1,146 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { App, AppParam } from './model/index';
/**
* 分页查询应用
*/
export async function pageApp(params: AppParam) {
const res = await request.get<ApiResult<PageResult<App>>>('/oa/app/page', {
params
});
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询应用列表
*/
export async function listApp(params?: AppParam) {
const res = await request.get<ApiResult<App[]>>('/oa/app', {
params
});
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询应用
*/
export async function getApp(id: number) {
const res = await request.get<ApiResult<App>>('/oa/app/' + id);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加应用
*/
export async function addApp(data: App) {
const res = await request.post<ApiResult<unknown>>('/oa/app', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改应用
*/
export async function updateApp(data: App) {
const res = await request.put<ApiResult<unknown>>('/oa/app', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除应用
*/
export async function removeApp(id?: number) {
const res = await request.delete<ApiResult<unknown>>('/oa/app/' + id);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除应用
*/
export async function removeBatchApp(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>('/oa/app/batch', {
data
});
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 检查IP是否存在
*/
export async function checkExistence(
field: string,
value: string,
id?: number
) {
const res = await request.get<ApiResult<unknown>>('/oa/app/existence', {
params: { field, value, id }
});
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
export async function getAppSecret(data: App) {
const res = await request.post<ApiResult<App>>(
'/open/app/getAppSecret',
data
);
if (res.data.code === 0 && res.data.data) {
return res.data;
}
return Promise.reject(new Error(res.data.message));
}
export async function updateAppSecret(data: App) {
const res = await request.post<ApiResult<App>>(
'/oa/app/updateAppSecret',
data
);
if (res.data.code === 0 && res.data.data) {
return res.data;
}
return Promise.reject(new Error(res.data.message));
}
// 添加菜单
export async function saveMenu(data: App) {
const res = await request.post<ApiResult<unknown>>('/oa/app/saveMenu', data);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
// 添加菜单按钮
export async function saveAuthority(data: any[]) {
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));
}
-155
View File
@@ -1,155 +0,0 @@
import type { PageParam } from '@/api';
import { AppUser } from '@/api/oa/app/user/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[];
// 项目需求
requirement?: string;
file1?: string;
file2?: string;
file3?: string;
}
/**
* 应用搜索条件
*/
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;
showExpiration?: boolean;
keywords?: any;
}
-106
View File
@@ -1,106 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { AppRenew, AppRenewParam } from '@/api/oa/app/renew/model';
/**
* 分页查询开发成员
*/
export async function pageAppRenew(params: AppRenewParam) {
const res = await request.get<ApiResult<PageResult<AppRenew>>>(
'/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[]>>('/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>>('/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>>('/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>>('/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>>('/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>>('/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>>('/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
View File
@@ -1,40 +0,0 @@
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;
}
-114
View File
@@ -1,114 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { AppUser, AppUserParam } from '@/api/oa/app/user/model';
/**
* 分页查询开发成员
*/
export async function pageAppUser(params: AppUserParam) {
const res = await request.get<ApiResult<PageResult<AppUser>>>(
'/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[]>>('/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>>('/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>>('/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>>('/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>>(
'/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>>(
'/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>>(
'/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));
}
-36
View File
@@ -1,36 +0,0 @@
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;
}
export interface UserItem {
key: string;
isEdit?: boolean;
number?: string;
name?: string;
department?: string;
}
-14
View File
@@ -1,14 +0,0 @@
import request from '@/utils/request';
import type { ApiResult } from '@/api';
import type { Customer } from './model';
/**
* 申请免费体验
*/
export async function apply(data: Customer) {
const res = await request.post<ApiResult<unknown>>('/customer-apply', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
-43
View File
@@ -1,43 +0,0 @@
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;
}
-106
View File
@@ -1,106 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { Assets, AssetsParam } from './model';
/**
* 分页查询资产
*/
export async function pageAssets(params: AssetsParam) {
const res = await request.get<ApiResult<PageResult<Assets>>>(
'/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[]>>('/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>>('/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>>('/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>>('/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>>('/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>>('/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>>('/oa/assets/existence', {
params: { field, value, id }
});
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
-85
View File
@@ -1,85 +0,0 @@
import type { PageParam } from '@/api';
import type { User } from '@/api/system/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;
}
/**
* 资产搜索条件
*/
export interface AssetsParam extends PageParam {
name?: string;
code?: string;
isExpire?: string;
status?: string;
brand?: string;
customerId?: string;
companyId?: number;
companyName?: string;
userId?: number;
// 商户编号
merchantCode?: string;
}
-112
View File
@@ -1,112 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type {
AssetsUser,
AssetsUserParam
} from '@/api/oa/assets/user/model/index';
/**
* 分页查询开发成员
*/
export async function pageAssetsUser(params: AssetsUserParam) {
const res = await request.get<ApiResult<PageResult<AssetsUser>>>(
'/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[]>>('/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>>('/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>>('/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>>('/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>>('/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>>('/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>>(
'/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
View File
@@ -1,35 +0,0 @@
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;
}
-30
View File
@@ -1,30 +0,0 @@
import request from '@/utils/request';
import type { ApiResult } from '@/api';
import { ChatParam } from '@/api/oa/chatgpt/model';
/**
* 发送
*/
export async function send(data: ChatParam) {
const res = await request.post<ApiResult<unknown>>('/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
View File
@@ -1,17 +0,0 @@
/**
* 消息
*/
export interface Chat {
noticeId?: number;
content?: any;
tenantId?: number;
}
/**
* 任务搜索条件
*/
export interface ChatParam {
tenantId?: number;
content?: string;
noticeId?: number;
}
-117
View File
@@ -1,117 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { Customer, CustomerParam } from './model';
/**
* 分页查询客户
*/
export async function pageCustomer(params: CustomerParam) {
const res = await request.get<ApiResult<PageResult<Customer>>>(
'/oa/customer/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询客户列表
*/
export async function listCustomer(params?: CustomerParam) {
const res = await request.get<ApiResult<Customer[]>>('/oa/customer', {
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 getCustomer(id: number) {
const res = await request.get<ApiResult<Customer>>('/oa/customer/' + id);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加客户
*/
export async function addCustomer(data: Customer) {
const res = await request.post<ApiResult<unknown>>('/oa/customer', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改客户
*/
export async function updateCustomer(data: Customer) {
const res = await request.put<ApiResult<unknown>>('/oa/customer', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量修改客户
*/
export async function updateBatchCustomer(data: Customer[]) {
const res = await request.put<ApiResult<unknown>>('/oa/customer/batch', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除客户
*/
export async function removeCustomer(id?: number) {
const res = await request.delete<ApiResult<unknown>>('/oa/customer/' + id);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除客户
*/
export async function removeBatchCustomer(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>('/oa/customer/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/customer/existence', {
params: { field, value, id }
});
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
-67
View File
@@ -1,67 +0,0 @@
import type { PageParam } from '@/api';
/**
* 客户
*/
export interface Customer {
// 客户id
customerId?: number;
// 客户类型
customerType?: string;
// 客户来源
customerSource?: string;
// 客户标识
customerCode: string;
// 客户名称
customerName?: string;
// 客户全称
customerFullName?: string;
// 客户头像
customerAvatar?: string;
// 座机电话
customerPhone?: string;
// 手机号码
customerMobile?: string;
// 联系人
customerContacts?: string;
// 联系地址
customerAddress?: string;
customerProvince?: string;
customerCity?: string;
customerRegion?: string;
longitude?: string;
latitude?: string;
// 跟进状态
progress?: string;
// 排序
sortNumber?: number;
// 备注
comments?: string;
// 创建时间
createTime?: string;
// 状态
status?: string;
// 用户ID
userId?: any;
// 发布者昵称
nickname?: string;
}
/**
* 客户搜索条件
*/
export interface CustomerParam extends PageParam {
customerName?: string;
customerCode?: string;
customerType?: string;
createTimeStart?: string;
createTimeEnd?: string;
customerCategory?: string;
progress?: string;
customerSource?: string;
betweenTime?: any;
userId?: number;
nickname?: string;
// 商户编号
merchantCode?: string;
}
-29
View File
@@ -1,29 +0,0 @@
import type { PageParam } from '@/api';
/**
* 链接
*/
export interface Link {
id?: number;
name?: string;
icon?: string;
url?: string;
linkType?: string;
appId?: number;
userId?: number;
comments?: string;
recommend?: number;
sortNumber?: number;
deleted?: number;
status?: number;
createTime?: number;
}
/**
* 链接搜索条件
*/
export interface LinkParam extends PageParam {
id?: number;
linkType?: string;
name?: string;
}
-111
View File
@@ -1,111 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { Notice, NoticeParam } from './model/index';
import { TabsParam } from '@/api/tabs';
/**
* 分页查询消息
*/
export async function pageNotice(params: NoticeParam) {
const res = await request.get<ApiResult<PageResult<Notice>>>(
'/oa/notice/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询消息列表
*/
export async function listNotice(params?: NoticeParam) {
const res = await request.get<ApiResult<Notice[]>>('/oa/notice', {
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 getNotice(id: number) {
const res = await request.get<ApiResult<Notice>>('/oa/notice/' + id);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加消息
*/
export async function addNotice(data: Notice) {
const res = await request.post<ApiResult<unknown>>('/oa/notice', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改消息
*/
export async function updateNotice(data: Notice) {
const res = await request.put<ApiResult<unknown>>('/oa/notice', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除消息
*/
export async function removeNotice(id?: number) {
const res = await request.delete<ApiResult<unknown>>('/oa/notice/' + id);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量修改消息
*/
export async function updateBatchNotices(data: Notice[]) {
const res = await request.put<ApiResult<unknown>>('/oa/notice/batch', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除消息
*/
export async function removeBatchNotice(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>('/oa/notice/batch', {
data
});
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
export async function getCount(params?: TabsParam) {
const res = await request.get<ApiResult<TabsParam>>('/oa/notice/count', {
params
});
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
-40
View File
@@ -1,40 +0,0 @@
import type { PageParam } from '@/api';
/**
* 消息
*/
export interface Notice {
// 消息id
noticeRecordId?: number;
noticeId?: number;
title?: string;
channel?: string;
avatar?: string;
content?: string;
files?: string;
developerId?: number;
userId?: number;
sortNumber?: number;
comments?: string;
status?: number;
}
/**
* 消息搜索条件
*/
export interface NoticeParam extends PageParam {
type?: string;
noticeRecordId?: number;
noticeId?: number;
userId?: number;
developerId?: number;
status?: number;
}
// 查询未读数量
export interface NnReadNum {
notice?: string;
letter?: number;
todo?: number;
chatGPT?: number;
}
-106
View File
@@ -1,106 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { Project, ProjectParam } from './model';
/**
* 分页查询项目
*/
export async function pageProject(params: ProjectParam) {
const res = await request.get<ApiResult<PageResult<Project>>>(
'/oa/project/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询项目列表
*/
export async function listProject(params?: ProjectParam) {
const res = await request.get<ApiResult<Project[]>>('/oa/project', {
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 getProject(id: number) {
const res = await request.get<ApiResult<Project>>('/oa/project/' + id);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加项目
*/
export async function addProject(data: Project) {
const res = await request.post<ApiResult<unknown>>('/oa/project', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改项目
*/
export async function updateProject(data: Project) {
const res = await request.put<ApiResult<unknown>>('/oa/project', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除项目
*/
export async function removeProject(id?: number) {
const res = await request.delete<ApiResult<unknown>>('/oa/project/' + id);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除项目
*/
export async function removeBatchProject(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>('/oa/project/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/project/existence', {
params: { field, value, id }
});
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
-56
View File
@@ -1,56 +0,0 @@
import type { PageParam } from '@/api';
/**
* 项目
*/
export interface Project {
// 项目id
projectId?: number;
// 项目类型
projectType?: string;
// 项目分类
projectCategory?: string;
// 项目标识
projectCode: string;
// 项目名称
projectName?: string;
// 项目图标
projectAvatar?: string;
url?: string;
urlDev?: string;
urlAdmin?: string;
account?: string;
money?: string;
realMoney?: string;
annualFee?: string;
qrcode?: string;
progress?: string;
views?: string;
// 项目详情
content?: string;
// 客户ID
customerId?: number;
// 客户名称
customerName?: string;
// 排序
sortNumber?: number;
// 备注
comments?: string;
// 创建时间
createTime?: string;
// 状态
status?: string;
// 用户ID
userId?: number;
}
/**
* 项目搜索条件
*/
export interface ProjectParam extends PageParam {
projectName?: string;
projectCode?: string;
status?: string;
// 商户编号
merchantCode?: string;
}
-100
View File
@@ -1,100 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { TaskCount, TaskCountParam } from './model/index';
import { TabsParam } from '@/api/tabs';
/**
* 分页查询统计
*/
export async function pageTaskCount(params: TaskCountParam) {
const res = await request.get<ApiResult<PageResult<TaskCount>>>(
'/oa/task-count/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询统计列表
*/
export async function listTaskCount(params?: TaskCountParam) {
const res = await request.get<ApiResult<TaskCount[]>>('/oa/task-count', {
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 getTaskCount(id: number) {
const res = await request.get<ApiResult<TaskCount>>('/oa/task-count/' + id);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加统计
*/
export async function addTaskCount(data: TaskCount) {
const res = await request.post<ApiResult<unknown>>('/oa/task-count', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改统计
*/
export async function updateTaskCount(data: TaskCount) {
const res = await request.put<ApiResult<unknown>>('/oa/task-count', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除统计
*/
export async function removeTaskCount(id?: number) {
const res = await request.delete<ApiResult<unknown>>('/oa/task-count/' + id);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除统计
*/
export async function removeBatchTaskCount(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>('/oa/task-count/batch', {
data
});
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
export async function getCount(params?: TabsParam) {
const res = await request.get<ApiResult<TabsParam>>('/oa/task-count/count', {
params
});
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
-32
View File
@@ -1,32 +0,0 @@
import type { PageParam } from '@/api';
/**
* 统计
*/
export interface TaskCount {
// 统计id
taskCountId?: number;
userId?: number;
nickname?: string;
avatar?: string;
phone?: string;
pending?: number;
unused?: number;
today?: number;
month?: number;
year?: number;
total?: number;
commander?: number;
createTime?: string;
updateTime?: string;
}
/**
* 统计搜索条件
*/
export interface TaskCountParam extends PageParam {
taskCountId?: number;
userId?: number;
roleId?: number;
roleCode?: string;
}
-103
View File
@@ -1,103 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { TaskRecord, TaskRecordParam } from './model/index';
import { TabsParam } from '@/api/tabs';
/**
* 分页查询任务
*/
export async function pageTaskRecord(params: TaskRecordParam) {
const res = await request.get<ApiResult<PageResult<TaskRecord>>>(
'/oa/task-record/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询任务列表
*/
export async function listTaskRecord(params?: TaskRecordParam) {
const res = await request.get<ApiResult<TaskRecord[]>>('/oa/task-record', {
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 getTaskRecord(id: number) {
const res = await request.get<ApiResult<TaskRecord>>('/oa/task-record/' + id);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加任务
*/
export async function addTaskRecord(data: TaskRecord) {
const res = await request.post<ApiResult<unknown>>('/oa/task-record', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改任务
*/
export async function updateTaskRecord(data: TaskRecord) {
const res = await request.put<ApiResult<unknown>>('/oa/task-record', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除任务
*/
export async function removeTaskRecord(id?: number) {
const res = await request.delete<ApiResult<unknown>>('/oa/task-record/' + id);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除任务
*/
export async function removeBatchTaskRecord(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/oa/task-record/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
export async function getCount(params?: TabsParam) {
const res = await request.get<ApiResult<TabsParam>>('/oa/task-record/count', {
params
});
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
-35
View File
@@ -1,35 +0,0 @@
import type { PageParam } from '@/api';
import { User } from '@/api/user/model';
/**
* 任务
*/
export interface TaskRecord {
// 任务id
taskRecordId?: number;
taskId?: number;
parentId?: number;
nickname?: string;
avatar?: string;
content?: string;
files?: any;
appId?: number;
developerId?: number;
userId?: number;
sortNumber?: number;
comments?: string;
status?: string;
children?: TaskRecord[] | [];
createTime?: string;
toUser: User | null;
}
/**
* 任务搜索条件
*/
export interface TaskRecordParam extends PageParam {
taskRecordId?: number;
taskId?: number;
userId?: number;
developerId?: number;
}
-100
View File
@@ -1,100 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { TaskUser, TaskUserParam } from './model/index';
import { TabsParam } from '@/api/tabs';
/**
* 分页查询工单成员
*/
export async function pageTaskUser(params: TaskUserParam) {
const res = await request.get<ApiResult<PageResult<TaskUser>>>(
'/oa/task-user/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询工单成员列表
*/
export async function listTaskUser(params?: TaskUserParam) {
const res = await request.get<ApiResult<TaskUser[]>>('/oa/task-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 getTaskUser(id: number) {
const res = await request.get<ApiResult<TaskUser>>('/oa/task-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 addTaskUser(data: TaskUser) {
const res = await request.post<ApiResult<unknown>>('/oa/task-user', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改工单成员
*/
export async function updateTaskUser(data: TaskUser) {
const res = await request.put<ApiResult<unknown>>('/oa/task-user', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除工单成员
*/
export async function removeTaskUser(id?: number) {
const res = await request.delete<ApiResult<unknown>>('/oa/task-user/' + id);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除工单成员
*/
export async function removeBatchTaskUser(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>('/oa/task-user/batch', {
data
});
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
export async function getCount(params?: TabsParam) {
const res = await request.get<ApiResult<TabsParam>>('/oa/task-user/count', {
params
});
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
-27
View File
@@ -1,27 +0,0 @@
import type { PageParam } from '@/api';
/**
* 任务
*/
export interface TaskUser {
// 任务id
taskUserId?: number;
taskId?: number;
role?: number;
userId?: number;
status?: string;
avatar?: string;
name?: string;
username?: string;
email?: string;
phone?: string;
}
/**
* 任务搜索条件
*/
export interface TaskUserParam extends PageParam {
taskUserId?: number;
taskId?: number;
userId?: number;
}
-132
View File
@@ -1,132 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { Task, TaskParam } from './model/index';
import { TabsParam } from '@/api/tabs';
import { MODULES_API_URL } from "@/config/setting";
/**
* 分页查询任务
*/
export async function pageTask(params: TaskParam) {
const res = await request.get<ApiResult<PageResult<Task>>>('/oa/task/page', {
params
});
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询任务列表
*/
export async function listTask(params?: TaskParam) {
const res = await request.get<ApiResult<Task[]>>('/oa/task', {
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 getTask(id: number) {
const res = await request.get<ApiResult<Task>>('/oa/task/' + id);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加任务
*/
export async function addTask(data: Task) {
const res = await request.post<ApiResult<Task>>('/oa/task', data);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改任务
*/
export async function updateTask(data: Task) {
const res = await request.put<ApiResult<unknown>>('/oa/task', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除任务
*/
export async function removeTask(id?: number) {
const res = await request.delete<ApiResult<unknown>>('/oa/task/' + id);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除任务
*/
export async function removeBatchTask(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>('/oa/task/batch', {
data
});
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
export async function getCount(params?: TabsParam) {
const res = await request.get<ApiResult<TabsParam>>('/oa/task/count', {
params
});
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 获取工单二维码
* @param params
*/
export async function taskQRCode(params: TaskParam) {
const res = await request.get<ApiResult<PageResult<Task>>>(
MODULES_API_URL + '/oa/task/taskQRCode',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 获取邀请加入二维码
* @param params
*/
export async function taskJoinQRCode(params: TaskParam) {
const res = await request.get<ApiResult<PageResult<Task>>>(
MODULES_API_URL + '/oa/task/taskJoinQRCode',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
-109
View File
@@ -1,109 +0,0 @@
import type { PageParam } from '@/api';
import { TaskRecord } from '@/api/oa/task-record/model';
import { TaskUser } from '@/api/oa/task-user/model';
/**
* 任务
*/
export interface Task {
// 任务id
taskId?: number;
// 任务名称
name?: string;
// 任务类型
taskType?: string;
// 关联应用
appId?: number;
appName?: string;
// 项目ID
projectId?: string;
// 客户ID
customerId?: string;
// 资产ID
assetsId?: string;
// 开始时间
startTime?: string;
// 结束时间
endTime?: string;
// 任务内容
content?: string;
files?: string;
// 任务发起人
promoter?: number;
promoterName?: string;
promoterAlias?: string;
promoterAvatar?: string;
promoterCompanyName?: string;
// 任务状态
progress?: number;
isRead?: boolean;
// 优先级
priority?: string;
// 品质要求
quality?: string;
// 期限(天)
day?: string;
// 排序
sortNumber?: number;
// 备注
comments?: string;
redirect?: string;
// 创建时间
createTime?: string;
updateTime?: string;
// 状态
status?: number;
// 发布者
userId?: any;
// 发布者昵称
nickname?: string;
// 项目名称
projectName?: string;
// 图片集
images?: [];
avatar?: string;
// 受理人
commander?: number;
commanderName?: string;
commanderAlias?: string;
commanderAvatar?: string;
commanderCompanyName?: string;
commanderRealName?: string;
// 最后回复人
lastRealName?: string;
lastAvatar?: string;
lastReadUser?: number;
lastNickname?: string;
recordList?: TaskRecord[];
users?: TaskUser[];
phone?: string;
phoneXX?: string;
action?: string;
// 机密信息
confidential?: any;
}
/**
* 任务搜索条件
*/
export interface TaskParam extends PageParam {
taskId?: number;
status?: any;
name?: string;
promoter?: number;
promoterName?: string;
commander?: number;
commanderName?: string;
progress?: number;
betweenTime?: any;
userId?: number;
nickname?: string;
keywords?: any;
current?: string;
pending?: number;
appId?: number;
appName?: string;
companyId?: number;
companyName?: string;
taskType?: string;
}
-9
View File
@@ -1,9 +0,0 @@
/**
* 枚举类
*/
export const TOBEARRANGED = 0; // 待安排
export const PENDING = 1; // 待处理
export const PROCESSING = 2; // 处理中
export const TOBECONFIRMED = 3; // 待评价
export const COMPLETED = 4; // 已完成
export const CLOSED = 5; // 已关闭
-8
View File
@@ -1,8 +0,0 @@
export const TASK_STATUS_0 = 0; // 待处理
export const TASK_STATUS_1 = 1; // 已完成
export const ACTION_1 = '派单';
export const ACTION_2 = '已解决';
export const ACTION_3 = '关单';
export const ACTION_4 = '分享';
export const ACTION_5 = '编辑';
-155
View File
@@ -1,155 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { Tenant, TenantParam } from './model';
import { Menu } from '@/api/system/menu/model';
/**
* 分页查询租户
*/
export async function pageTenant(params: TenantParam) {
// 租户列表查询需要传一个key
// params.tenantCode = 'ZAcxbdmDQFwUKC3e';
const res = await request.get<ApiResult<PageResult<Tenant>>>(
'/system/tenant/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询租户资料
*/
export async function profile(params?: TenantParam) {
const res = await request.get<ApiResult<Tenant>>('/system/tenant/profile', {
params
});
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询租户列表
*/
export async function listTenant(params?: TenantParam) {
const res = await request.get<ApiResult<Tenant[]>>('/system/tenant', {
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 getTenant(id: number) {
const res = await request.get<ApiResult<Tenant>>('/system/tenant/' + id);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加租户
*/
export async function addTenant(data: Tenant) {
const res = await request.post<ApiResult<unknown>>('/system/tenant', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改租户
*/
export async function updateTenant(data: Tenant) {
const res = await request.put<ApiResult<unknown>>('/system/tenant', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除租户
*/
export async function removeTenant(id?: number) {
const res = await request.delete<ApiResult<unknown>>('/system/tenant/' + id);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除租户
*/
export async function removeBatchTenant(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>('/system/tenant/batch', {
data
});
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 重置用户密码
*/
export async function updateTenantPassword(
tenantId?: number,
password = 'gxwebsoft.com'
) {
const res = await request.put<ApiResult<unknown>>('/system/tenant/password', {
tenantId,
password
});
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>>(
'/system/tenant/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 initialization(roleId?: number) {
const res = await request.get<ApiResult<Menu[]>>(
'/system/tenant/role-menu/' + roleId
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
-39
View File
@@ -1,39 +0,0 @@
import type { PageParam } from '@/api';
/**
* 租户
*/
export interface Tenant {
// 租户id
tenantId?: number;
// 租户名称
tenantName?: string;
// 应用ID
appId?: string;
// 应用秘钥
appSecret?: string;
logo?: string;
// 所属客户
companyName?: string;
// 关联客户ID
companyId?: string;
// 备注
comments?: string;
// 创建时间
createTime?: string;
// 状态
status?: number;
//
password?: string;
}
/**
* 租户搜索条件
*/
export interface TenantParam extends PageParam {
tenantName?: string;
appId?: string;
companyId?: number;
companyName?: string;
tenantCode?: string;
}
+35 -1
View File
@@ -17,6 +17,40 @@ export async function login(data: LoginParam) {
return Promise.reject(new Error(res.data.message));
}
/**
* 短信验证码登录
*/
export async function loginBySms(data: LoginParam): Promise<string | undefined> {
const res = await request.post<ApiResult<unknown>>(
SERVER_API_URL + '/loginBySms',
data
);
if (res.data.code === 0) {
// @ts-ignore
uni.setStorageSync('access_token', res.data.data?.access_token)
// setToken(res.data.data?.access_token, data.remember);
// @ts-ignore
const user = res.data.data?.user;
if (user) {
console.log('user: ', user.userId);
uni.setStorageSync('user_id', user.userId)
console.log('TenantId: ', user.tenantId);
console.log('Phone: ', user.phone);
console.log('UserId: ', user.userId);
console.log('MerchantId: ', user.merchantId);
uni.setStorageSync('TenantId', user.tenantId)
uni.setStorageSync('Phone', user.phone)
uni.setStorageSync('UserId', user.userId)
if (user.merchantId) {
uni.setStorageSync('MerchantId', user.merchantId)
}
}
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 获取验证码
*/
@@ -73,7 +107,7 @@ export async function registerUser(data: User) {
export async function loginMpWxMobile(data: User) {
const res = await request.post<ApiResult<unknown>>('/wx-login/loginByMpWxPhone', data);
if (res.data.code === 0) {
return res.data.message;
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
+156
View File
@@ -0,0 +1,156 @@
import request from '@/utils/request';
import type {ApiResult, PageResult} from '@/api';
import {MODULES_API_URL} from '@/config/setting';
import type {Cart, CartParam, CartVo} from "@/api/shop/cart/model";
import type {Merchant} from "@/api/shop/merchant/model";
/**
* 分页查询商品记录表
*/
export async function pageCart(params: CartParam) {
const res = await request.get<ApiResult<PageResult<Cart>>>(
MODULES_API_URL + '/shop/cart/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询商品记录表列表
*/
export async function listCart(params?: CartParam) {
const res = await request.get<ApiResult<CartVo>>(
MODULES_API_URL + '/shop/cart',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加商品记录表
*/
export async function addCart(data: Cart) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/shop/cart',
data
);
console.log(res)
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改商品记录表
*/
export async function updateCart(data: Cart) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/shop/cart',
data
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除商品记录表
*/
export async function removeCart(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/cart/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
// 按店铺ID更新选中
export async function updateCartByMerchantId(id?: number) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/shop/cart/updateCartByMerchantId/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
// 全选操作
export async function onSelectAll(yes: Boolean) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/shop/cart/onSelectAll/' + yes
);
if (res.data.code === 0) {
return res.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量修改
*/
export async function updateBatchCart(data: Cart[]) {
const res = await request.put<ApiResult<unknown>>(MODULES_API_URL + '/shop/cart/batch', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除商品记录表
*/
export async function removeBatchCart(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/cart/batch',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询商品记录表
*/
export async function getCart(id: number) {
const res = await request.get<ApiResult<Cart>>(
MODULES_API_URL + '/shop/cart/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 分页查询商品记录表
*/
export async function myCart(params: CartParam) {
const res = await request.get<ApiResult<Merchant[]>>(
MODULES_API_URL + '/shop/cart/myCart',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
+81
View File
@@ -0,0 +1,81 @@
import type { PageParam } from '@/api';
export interface CartVo {
// 店铺列表
shops?: CartShopVo[];
// 购物车总金额
totalPrice?: number;
// 宝贝总数量
totalNums?: number;
// 已选宝贝
selectNums?: number;
// 是否全选
selectAll?: boolean;
}
export interface CartShopVo {
// 店铺ID
shopId?: number;
// 店铺名称
shopName?: string;
// 店铺LOGO
shopLogo?: string;
// 购物车商品列表
carts?: Cart[];
}
/**
* 购物车
*/
export interface Cart {
// 购物车表ID
id?: string;
// 类型 0商城 1预定
type?: number;
// 商品ID
goodsId?: string;
// 唯一标识
code?: string;
// 商品规格
spec?: string;
// 商品数量
cartNum?: number;
// 0 = 未购买 1 = 已购买
isPay?: string;
// 是否为立即购买
isNew?: string;
// 拼团id
combinationId?: number;
// 秒杀产品ID
seckillId?: number;
// 砍价id
bargainId?: number;
// 用户ID
userId?: string;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 注册时间
createTime?: string;
// 修改时间
updateTime?: string;
// 是否已选中
selected?: boolean;
// 全选操作
selectAll?: boolean;
}
/**
* 购物车搜索条件
*/
export interface CartParam extends PageParam {
id?: number;
page?: number;
type?: number;
selected?: boolean;
isNew?: boolean;
cartId?: number;
keywords?: string;
}
+39
View File
@@ -0,0 +1,39 @@
import type { PageParam } from '@/api';
/**
* 商城销售统计表
*/
export interface Count {
// ID
id?: number;
// 统计日期
dateTime?: string;
// 总销售额
totalPrice?: string;
// 今日销售额
todayPrice?: string;
// 总会员数
totalUsers?: string;
// 今日新增
todayUsers?: string;
// 总订单笔数
totalOrders?: string;
// 今日订单笔数
todayOrders?: string;
// 备注
comments?: string;
// 状态, 0正常, 1冻结
status?: number;
// 租户id
tenantId?: number;
// 注册时间
createTime?: string;
}
/**
* 商城销售统计表搜索条件
*/
export interface CountParam extends PageParam {
id?: number;
keywords?: string;
}
+106
View File
@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { DealerApply, DealerApplyParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询分销商申请记录表
*/
export async function pageDealerApply(params: DealerApplyParam) {
const res = await request.get<ApiResult<PageResult<DealerApply>>>(
MODULES_API_URL + '/shop/dealer-apply/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询分销商申请记录表列表
*/
export async function listDealerApply(params?: DealerApplyParam) {
const res = await request.get<ApiResult<DealerApply[]>>(
MODULES_API_URL + '/shop/dealer-apply',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加分销商申请记录表
*/
export async function addDealerApply(data: DealerApply) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-apply',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改分销商申请记录表
*/
export async function updateDealerApply(data: DealerApply) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-apply',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除分销商申请记录表
*/
export async function removeDealerApply(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-apply/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除分销商申请记录表
*/
export async function removeBatchDealerApply(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-apply/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询分销商申请记录表
*/
export async function getDealerApply(id: number) {
const res = await request.get<ApiResult<DealerApply>>(
MODULES_API_URL + '/shop/dealer-apply/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
+41
View File
@@ -0,0 +1,41 @@
import type { PageParam } from '@/api';
/**
* 分销商申请记录表
*/
export interface DealerApply {
// 主键ID
applyId?: number;
// 用户ID
userId?: number;
// 姓名
realName?: string;
// 手机号
mobile?: string;
// 推荐人用户ID
refereeId?: number;
// 申请方式(10需后台审核 20无需审核)
applyType?: number;
// 申请时间
applyTime?: number;
// 审核状态 (10待审核 20审核通过 30驳回)
applyStatus?: number;
// 审核时间
auditTime?: number;
// 驳回原因
rejectReason?: string;
// 商城ID
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 分销商申请记录表搜索条件
*/
export interface DealerApplyParam extends PageParam {
applyId?: number;
keywords?: string;
}
+106
View File
@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { DealerCapital, DealerCapitalParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询分销商资金明细表
*/
export async function pageDealerCapital(params: DealerCapitalParam) {
const res = await request.get<ApiResult<PageResult<DealerCapital>>>(
MODULES_API_URL + '/shop/dealer-capital/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询分销商资金明细表列表
*/
export async function listDealerCapital(params?: DealerCapitalParam) {
const res = await request.get<ApiResult<DealerCapital[]>>(
MODULES_API_URL + '/shop/dealer-capital',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加分销商资金明细表
*/
export async function addDealerCapital(data: DealerCapital) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-capital',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改分销商资金明细表
*/
export async function updateDealerCapital(data: DealerCapital) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-capital',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除分销商资金明细表
*/
export async function removeDealerCapital(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-capital/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除分销商资金明细表
*/
export async function removeBatchDealerCapital(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-capital/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询分销商资金明细表
*/
export async function getDealerCapital(id: number) {
const res = await request.get<ApiResult<DealerCapital>>(
MODULES_API_URL + '/shop/dealer-capital/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
+35
View File
@@ -0,0 +1,35 @@
import type { PageParam } from '@/api';
/**
* 分销商资金明细表
*/
export interface DealerCapital {
// 主键ID
id?: number;
// 分销商用户ID
userId?: number;
// 订单ID
orderId?: number;
// 资金流动类型 (10佣金收入 20提现支出 30转账支出 40转账收入)
flowType?: number;
// 金额
money?: string;
// 描述
describe?: string;
// 对方用户ID
toUserId?: number;
// 商城ID
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 分销商资金明细表搜索条件
*/
export interface DealerCapitalParam extends PageParam {
id?: number;
keywords?: string;
}
+106
View File
@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { DealerOrder, DealerOrderParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询分销商订单记录表
*/
export async function pageDealerOrder(params: DealerOrderParam) {
const res = await request.get<ApiResult<PageResult<DealerOrder>>>(
MODULES_API_URL + '/shop/dealer-order/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询分销商订单记录表列表
*/
export async function listDealerOrder(params?: DealerOrderParam) {
const res = await request.get<ApiResult<DealerOrder[]>>(
MODULES_API_URL + '/shop/dealer-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 addDealerOrder(data: DealerOrder) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-order',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改分销商订单记录表
*/
export async function updateDealerOrder(data: DealerOrder) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-order',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除分销商订单记录表
*/
export async function removeDealerOrder(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-order/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除分销商订单记录表
*/
export async function removeBatchDealerOrder(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-order/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询分销商订单记录表
*/
export async function getDealerOrder(id: number) {
const res = await request.get<ApiResult<DealerOrder>>(
MODULES_API_URL + '/shop/dealer-order/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
+47
View File
@@ -0,0 +1,47 @@
import type { PageParam } from '@/api';
/**
* 分销商订单记录表
*/
export interface DealerOrder {
// 主键ID
id?: number;
// 买家用户ID
userId?: number;
// 订单ID
orderId?: number;
// 订单总金额(不含运费)
orderPrice?: string;
// 分销商用户id(一级)
firstUserId?: number;
// 分销商用户id(二级)
secondUserId?: number;
// 分销商用户id(三级)
thirdUserId?: number;
// 分销佣金(一级)
firstMoney?: string;
// 分销佣金(二级)
secondMoney?: string;
// 分销佣金(三级)
thirdMoney?: string;
// 订单是否失效(0未失效 1已失效)
isInvalid?: number;
// 佣金结算(0未结算 1已结算)
isSettled?: number;
// 结算时间
settleTime?: number;
// 商城ID
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 分销商订单记录表搜索条件
*/
export interface DealerOrderParam extends PageParam {
id?: number;
keywords?: string;
}
+106
View File
@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { DealerReferee, DealerRefereeParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询分销商推荐关系表
*/
export async function pageDealerReferee(params: DealerRefereeParam) {
const res = await request.get<ApiResult<PageResult<DealerReferee>>>(
MODULES_API_URL + '/shop/dealer-referee/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询分销商推荐关系表列表
*/
export async function listDealerReferee(params?: DealerRefereeParam) {
const res = await request.get<ApiResult<DealerReferee[]>>(
MODULES_API_URL + '/shop/dealer-referee',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加分销商推荐关系表
*/
export async function addDealerReferee(data: DealerReferee) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-referee',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改分销商推荐关系表
*/
export async function updateDealerReferee(data: DealerReferee) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-referee',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除分销商推荐关系表
*/
export async function removeDealerReferee(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-referee/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除分销商推荐关系表
*/
export async function removeBatchDealerReferee(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-referee/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询分销商推荐关系表
*/
export async function getDealerReferee(id: number) {
const res = await request.get<ApiResult<DealerReferee>>(
MODULES_API_URL + '/shop/dealer-referee/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
+29
View File
@@ -0,0 +1,29 @@
import type { PageParam } from '@/api';
/**
* 分销商推荐关系表
*/
export interface DealerReferee {
// 主键ID
id?: number;
// 分销商用户ID
dealerId?: number;
// 用户id(被推荐人)
userId?: number;
// 推荐关系层级(1,2,3)
level?: number;
// 商城ID
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 分销商推荐关系表搜索条件
*/
export interface DealerRefereeParam extends PageParam {
id?: number;
keywords?: string;
}
+106
View File
@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { DealerSetting, DealerSettingParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询分销商设置表
*/
export async function pageDealerSetting(params: DealerSettingParam) {
const res = await request.get<ApiResult<PageResult<DealerSetting>>>(
MODULES_API_URL + '/shop/dealer-setting/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询分销商设置表列表
*/
export async function listDealerSetting(params?: DealerSettingParam) {
const res = await request.get<ApiResult<DealerSetting[]>>(
MODULES_API_URL + '/shop/dealer-setting',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加分销商设置表
*/
export async function addDealerSetting(data: DealerSetting) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-setting',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改分销商设置表
*/
export async function updateDealerSetting(data: DealerSetting) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-setting',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除分销商设置表
*/
export async function removeDealerSetting(id?: string) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-setting/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除分销商设置表
*/
export async function removeBatchDealerSetting(data: (string | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-setting/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询分销商设置表
*/
export async function getDealerSetting(id: string) {
const res = await request.get<ApiResult<DealerSetting>>(
MODULES_API_URL + '/shop/dealer-setting/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
+25
View File
@@ -0,0 +1,25 @@
import type { PageParam } from '@/api';
/**
* 分销商设置表
*/
export interface DealerSetting {
// 设置项标示
key?: string;
// 设置项描述
describe?: string;
// 设置内容(json格式)
values?: string;
// 商城ID
tenantId?: number;
// 更新时间
updateTime?: number;
}
/**
* 分销商设置表搜索条件
*/
export interface DealerSettingParam extends PageParam {
key?: number;
keywords?: string;
}
+120
View File
@@ -0,0 +1,120 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { DealerUser, DealerUserParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询分销商用户记录表
*/
export async function pageDealerUser(params: DealerUserParam) {
const res = await request.get<ApiResult<PageResult<DealerUser>>>(
MODULES_API_URL + '/shop/dealer-user/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询分销商用户记录表列表
*/
export async function listDealerUser(params?: DealerUserParam) {
const res = await request.get<ApiResult<DealerUser[]>>(
MODULES_API_URL + '/shop/dealer-user',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加分销商用户记录表
*/
export async function addDealerUser(data: DealerUser) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-user',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改分销商用户记录表
*/
export async function updateDealerUser(data: DealerUser) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-user',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除分销商用户记录表
*/
export async function removeDealerUser(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-user/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除分销商用户记录表
*/
export async function removeBatchDealerUser(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-user/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询分销商用户记录表
*/
export async function getDealerUser(id: number) {
const res = await request.get<ApiResult<DealerUser>>(
MODULES_API_URL + '/shop/dealer-user/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询分销商用户记录表
*/
export async function getDealerUserQrcode() {
const res = await request.get<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-user/getDealerUserQrcode'
);
if (res.data?.code == 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
+48
View File
@@ -0,0 +1,48 @@
import type { PageParam } from '@/api';
/**
* 分销商用户记录表
*/
export interface DealerUser {
// 主键ID
id?: number;
// 自增ID
userId?: number;
// 姓名
realName?: string;
// 手机号
mobile?: string;
// 支付密码
payPassword?: string;
// 当前可提现佣金
money?: string;
// 已冻结佣金
freezeMoney?: string;
// 累积提现佣金
totalMoney?: string;
// 推荐人用户ID
refereeId?: number;
// 成员数量(一级)
firstNum?: number;
// 成员数量(二级)
secondNum?: number;
// 成员数量(三级)
thirdNum?: number;
// 是否删除
isDelete?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 分销商用户记录表搜索条件
*/
export interface DealerUserParam extends PageParam {
id?: number;
refereeId?: number;
keywords?: string;
}
+106
View File
@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { DealerWithdraw, DealerWithdrawParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询分销商提现明细表
*/
export async function pageDealerWithdraw(params: DealerWithdrawParam) {
const res = await request.get<ApiResult<PageResult<DealerWithdraw>>>(
MODULES_API_URL + '/shop/dealer-withdraw/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询分销商提现明细表列表
*/
export async function listDealerWithdraw(params?: DealerWithdrawParam) {
const res = await request.get<ApiResult<DealerWithdraw[]>>(
MODULES_API_URL + '/shop/dealer-withdraw',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加分销商提现明细表
*/
export async function addDealerWithdraw(data: DealerWithdraw) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-withdraw',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改分销商提现明细表
*/
export async function updateDealerWithdraw(data: DealerWithdraw) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-withdraw',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除分销商提现明细表
*/
export async function removeDealerWithdraw(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-withdraw/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除分销商提现明细表
*/
export async function removeBatchDealerWithdraw(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/dealer-withdraw/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询分销商提现明细表
*/
export async function getDealerWithdraw(id: number) {
const res = await request.get<ApiResult<DealerWithdraw>>(
MODULES_API_URL + '/shop/dealer-withdraw/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
@@ -0,0 +1,47 @@
import type { PageParam } from '@/api';
/**
* 分销商提现明细表
*/
export interface DealerWithdraw {
// 主键ID
id?: number;
// 分销商用户ID
userId?: number;
// 提现金额
money?: string;
// 打款方式 (10微信 20支付宝 30银行卡)
payType?: number;
// 支付宝姓名
alipayName?: string;
// 支付宝账号
alipayAccount?: string;
// 开户行名称
bankName?: string;
// 银行开户名
bankAccount?: string;
// 银行卡号
bankCard?: string;
// 申请状态 (10待审核 20审核通过 30驳回 40已打款)
applyStatus?: number;
// 审核时间
auditTime?: number;
// 驳回原因
rejectReason?: string;
// 来源客户端(APP、H5、小程序等)
platform?: string;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 分销商提现明细表搜索条件
*/
export interface DealerWithdrawParam extends PageParam {
id?: number;
keywords?: string;
}
+47
View File
@@ -104,3 +104,50 @@ export async function getGoodsCategory(id: number) {
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询商城菜单分类
*/
export async function listCategoryTree(params?: GoodsCategoryParam) {
const res = await request.get<ApiResult<GoodsCategory[]>>(
MODULES_API_URL + '/shop/goods-category/listCategoryTree',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询父节点下的子分类分类及商品数据
*/
export async function listCategoryParentIdTree(id: number) {
const res = await request.get<ApiResult<GoodsCategory[]>>(
MODULES_API_URL + '/shop/goods-category/listCategoryParentIdTree/' + id,
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询门店菜单分类及菜品数据
*/
export async function listShopCategoryTree(params?: GoodsCategoryParam) {
const res = await request.get<ApiResult<GoodsCategory[]>>(
MODULES_API_URL + '/shop/goods-category/listShopCategoryTree',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
@@ -59,5 +59,7 @@ export interface GoodsCategory {
*/
export interface GoodsCategoryParam extends PageParam {
categoryId?: number;
parentId?: number;
merchantId?: number;
keywords?: string;
}