Initial commit
This commit is contained in:
@@ -0,0 +1,144 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { App, AppParam } from './model/index';
|
||||
import { Menu } from '@/api/system/menu/model';
|
||||
|
||||
/**
|
||||
* 分页查询应用
|
||||
*/
|
||||
export async function pageApp(params: AppParam) {
|
||||
const res = await request.get<ApiResult<PageResult<App>>>('/oa/app/page', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应用列表
|
||||
*/
|
||||
export async function listApp(params?: AppParam) {
|
||||
const res = await request.get<ApiResult<App[]>>('/oa/app', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询应用
|
||||
*/
|
||||
export async function getApp(id: number) {
|
||||
const res = await request.get<ApiResult<App>>('/oa/app/' + id);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加应用
|
||||
*/
|
||||
export async function addApp(data: App) {
|
||||
const res = await request.post<ApiResult<unknown>>('/oa/app', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用
|
||||
*/
|
||||
export async function updateApp(data: App) {
|
||||
const res = await request.put<ApiResult<unknown>>('/oa/app', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用
|
||||
*/
|
||||
export async function removeApp(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/app/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除应用
|
||||
*/
|
||||
export async function removeBatchApp(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/app/batch', {
|
||||
data
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>('/oa/app/existence', {
|
||||
params: { field, value, id }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function getAppSecret(data: App) {
|
||||
const res = await request.post<ApiResult<App>>('/open/app/getAppSecret', data);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function updateAppSecret(data: App) {
|
||||
const res = await request.post<ApiResult<App>>(
|
||||
'/oa/app/updateAppSecret',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
// 添加菜单
|
||||
export async function saveMenu(data: App) {
|
||||
const res = await request.post<ApiResult<unknown>>('/oa/app/saveMenu', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
// 添加菜单按钮
|
||||
export async function saveAuthority(data: Menu[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/oa/app/saveAuthority',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import { AppUser } from '@/api/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;
|
||||
// 回调地址
|
||||
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;
|
||||
// 软件定价
|
||||
price?: string;
|
||||
// 评分
|
||||
score?: string;
|
||||
// 星级
|
||||
star?: string;
|
||||
// 菜单组件地址
|
||||
component?: string;
|
||||
// 菜单路由地址
|
||||
path?: string;
|
||||
// 权限标识
|
||||
authority?: string;
|
||||
// 打开位置
|
||||
target?: string;
|
||||
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)
|
||||
hide?: number;
|
||||
// 菜单侧栏选中的path
|
||||
active?: string;
|
||||
// 其它路由元信息
|
||||
meta?: string;
|
||||
// 版本
|
||||
edition?: string;
|
||||
// 版本号
|
||||
version?: string;
|
||||
// 是否已安装
|
||||
isUse?: number;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
tenantName?: string;
|
||||
companyId?: number;
|
||||
companyName?: string;
|
||||
// 租户编号
|
||||
tenantCode?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: 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?: string;
|
||||
appCode?: string;
|
||||
appId?: number;
|
||||
developer?: string;
|
||||
tenantCode?: string;
|
||||
parentId?: string;
|
||||
tenantName?: string;
|
||||
companyName?: string;
|
||||
companyId?: number;
|
||||
status?: number;
|
||||
nickname?: string;
|
||||
appStatus?: string;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { AppUser, AppUserParam } from '@/api/app/user/model/index';
|
||||
|
||||
/**
|
||||
* 分页查询开发成员
|
||||
*/
|
||||
export async function pageAppUser(params: AppUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<AppUser>>>(
|
||||
'/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));
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 开发成员
|
||||
*/
|
||||
export interface AppUser {
|
||||
// 开发成员id
|
||||
appUserId?: number;
|
||||
role?: number;
|
||||
userId?: number;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
avatar?: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
appId?: number;
|
||||
status?: string;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开发成员搜索条件
|
||||
*/
|
||||
export interface AppUserParam extends PageParam {
|
||||
userId?: number;
|
||||
appId?: number;
|
||||
}
|
||||
|
||||
export interface UserItem {
|
||||
key: string;
|
||||
isEdit?: boolean;
|
||||
number?: string;
|
||||
name?: string;
|
||||
department?: string;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
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));
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 客户
|
||||
*/
|
||||
export interface Customer {
|
||||
// 客户id
|
||||
customerId?: number;
|
||||
// 客户类型
|
||||
customerType?: string;
|
||||
// 客户标识
|
||||
customerCode: string;
|
||||
// 客户名称
|
||||
customerName?: string;
|
||||
// 客户头像
|
||||
customerAvatar?: string;
|
||||
// 座机电话
|
||||
customerPhone?: string;
|
||||
// 手机号码
|
||||
customerMobile?: string;
|
||||
// 联系人
|
||||
customerContacts?: string;
|
||||
// 联系地址
|
||||
customerAddress?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 状态
|
||||
status?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户搜索条件
|
||||
*/
|
||||
export interface CustomerParam extends PageParam {
|
||||
customerName?: string;
|
||||
customerCode?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
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));
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
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?: string;
|
||||
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;
|
||||
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;
|
||||
brand?: string;
|
||||
customerId?: string;
|
||||
userId?: number;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
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));
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
export interface Chat {
|
||||
noticeId?: number;
|
||||
content?: any;
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务搜索条件
|
||||
*/
|
||||
export interface ChatParam {
|
||||
tenantId?: number;
|
||||
content?: string;
|
||||
noticeId?: number;
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
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));
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
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));
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
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));
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
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));
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 任务
|
||||
*/
|
||||
export interface TaskRecord {
|
||||
// 任务id
|
||||
taskRecordId?: number;
|
||||
taskId?: number;
|
||||
parentId?: number;
|
||||
nickname?: string;
|
||||
content?: string;
|
||||
files?: string;
|
||||
developerId?: number;
|
||||
userId?: number;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: string;
|
||||
children?: TaskRecord[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务搜索条件
|
||||
*/
|
||||
export interface TaskRecordParam extends PageParam {
|
||||
taskRecordId?: number;
|
||||
taskId?: number;
|
||||
userId?: number;
|
||||
developerId?: number;
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
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));
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Task, TaskParam } from './model/index';
|
||||
import { TabsParam } from '@/api/tabs';
|
||||
|
||||
/**
|
||||
* 分页查询任务
|
||||
*/
|
||||
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<unknown>>('/oa/task', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
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));
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
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;
|
||||
// 项目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;
|
||||
// 优先级
|
||||
priority?: string;
|
||||
// 品质要求
|
||||
quality?: string;
|
||||
// 期限(天)
|
||||
day?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 创建时间
|
||||
createTime?: 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[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务搜索条件
|
||||
*/
|
||||
export interface TaskParam extends PageParam {
|
||||
taskId?: number;
|
||||
status?: number;
|
||||
name?: string;
|
||||
promoter?: number;
|
||||
promoterName?: string;
|
||||
commander?: number;
|
||||
commanderName?: string;
|
||||
progress?: string;
|
||||
betweenTime?: any;
|
||||
userId?: string;
|
||||
nickname?: string;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
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>>>(
|
||||
'/oa/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>>('/oa/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[]>>('/oa/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>>('/oa/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>>('/oa/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>>('/oa/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>>('/oa/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>>('/oa/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>>('/oa/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>>('/oa/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[]>>(
|
||||
'/oa/tenant/role-menu/' + roleId
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user