初始化
This commit is contained in:
106
api/oa/oaApp/index.ts
Normal file
106
api/oa/oaApp/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OaApp, OaAppParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询应用
|
||||
*/
|
||||
export async function pageOaApp(params: OaAppParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OaApp>>>(
|
||||
MODULES_API_URL + '/oa/oa-app/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应用列表
|
||||
*/
|
||||
export async function listOaApp(params?: OaAppParam) {
|
||||
const res = await request.get<ApiResult<OaApp[]>>(
|
||||
MODULES_API_URL + '/oa/oa-app',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加应用
|
||||
*/
|
||||
export async function addOaApp(data: OaApp) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-app',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用
|
||||
*/
|
||||
export async function updateOaApp(data: OaApp) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-app',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用
|
||||
*/
|
||||
export async function removeOaApp(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-app/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除应用
|
||||
*/
|
||||
export async function removeBatchOaApp(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-app/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询应用
|
||||
*/
|
||||
export async function getOaApp(id: number) {
|
||||
const res = await request.get<ApiResult<OaApp>>(
|
||||
MODULES_API_URL + '/oa/oa-app/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
149
api/oa/oaApp/model/index.ts
Normal file
149
api/oa/oaApp/model/index.ts
Normal file
@@ -0,0 +1,149 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 应用
|
||||
*/
|
||||
export interface OaApp {
|
||||
// 应用ID
|
||||
appId?: number;
|
||||
// 应用名称
|
||||
appName?: string;
|
||||
// 应用标识
|
||||
appCode?: string;
|
||||
// 应用秘钥
|
||||
appSecret?: string;
|
||||
// 上级id, 0是顶级
|
||||
parentId?: number;
|
||||
// 应用类型
|
||||
appType?: string;
|
||||
// 应用类型
|
||||
appTypeMultiple?: string;
|
||||
// 类型, 0菜单, 1按钮
|
||||
menuType?: number;
|
||||
// 企业ID
|
||||
companyId?: number;
|
||||
// 企业名称
|
||||
companyName?: string;
|
||||
// 应用图标
|
||||
appIcon?: string;
|
||||
// 二维码
|
||||
appQrcode?: string;
|
||||
// 链接地址
|
||||
appUrl?: string;
|
||||
// 后台管理地址
|
||||
adminUrl?: string;
|
||||
// 下载地址
|
||||
downUrl?: string;
|
||||
// 链接地址
|
||||
serverUrl?: string;
|
||||
// 文件服务器
|
||||
fileUrl?: string;
|
||||
// 回调地址
|
||||
callbackUrl?: string;
|
||||
// 腾讯文档地址
|
||||
docsUrl?: string;
|
||||
// 代码仓库地址
|
||||
gitUrl?: string;
|
||||
// 原型图地址
|
||||
prototypeUrl?: string;
|
||||
// IP白名单
|
||||
ipAddress?: string;
|
||||
// 应用截图
|
||||
images?: string;
|
||||
// 应用包名
|
||||
packageName?: string;
|
||||
// 下载次数
|
||||
clicks?: number;
|
||||
// 安装次数
|
||||
installs?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 应用介绍
|
||||
content?: string;
|
||||
// 项目需求
|
||||
requirement?: string;
|
||||
// 开发者(个人或公司)
|
||||
developer?: string;
|
||||
// 项目负责人
|
||||
director?: string;
|
||||
// 项目经理
|
||||
projectDirector?: string;
|
||||
// 业务员
|
||||
salesman?: string;
|
||||
// 软件定价
|
||||
price?: number;
|
||||
// 划线价格
|
||||
linePrice?: string;
|
||||
// 评分
|
||||
score?: string;
|
||||
// 星级
|
||||
star?: string;
|
||||
// 菜单路由地址
|
||||
path?: string;
|
||||
// 菜单组件地址, 目录可为空
|
||||
component?: string;
|
||||
// 权限标识
|
||||
authority?: string;
|
||||
// 打开位置
|
||||
target?: string;
|
||||
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)
|
||||
hide?: number;
|
||||
// 禁止搜索,1禁止 0 允许
|
||||
search?: number;
|
||||
// 菜单侧栏选中的path
|
||||
active?: string;
|
||||
// 其它路由元信息
|
||||
meta?: string;
|
||||
// 版本,0正式版 1基础版 2开发版
|
||||
edition?: string;
|
||||
// 版本号
|
||||
version?: string;
|
||||
// 是否已安装
|
||||
isUse?: number;
|
||||
// 附近1
|
||||
file1?: string;
|
||||
// 附件2
|
||||
file2?: string;
|
||||
// 附件3
|
||||
file3?: string;
|
||||
// 是否显示续费提醒
|
||||
showExpiration?: number;
|
||||
// 是否作为案例展示
|
||||
showCase?: number;
|
||||
// 是否显示在首页
|
||||
showIndex?: number;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 到期时间
|
||||
expirationTime?: string;
|
||||
// 续费金额
|
||||
renewMoney?: string;
|
||||
// 应用状态
|
||||
appStatus?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 机构id
|
||||
organizationId?: number;
|
||||
// 租户编号
|
||||
tenantCode?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用搜索条件
|
||||
*/
|
||||
export interface OaAppParam extends PageParam {
|
||||
appId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user