初始化
This commit is contained in:
140
api/cms/ad/index.ts
Normal file
140
api/cms/ad/index.ts
Normal file
@@ -0,0 +1,140 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Ad, AdParam } from './model';
|
||||
import { MODULES_API_URL } from '~/config';
|
||||
|
||||
/**
|
||||
* 分页查询广告位
|
||||
*/
|
||||
export async function pageAd(params: AdParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Ad>>>(
|
||||
MODULES_API_URL + '/cms/ad/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询广告位列表
|
||||
*/
|
||||
export async function listAd(params?: AdParam) {
|
||||
const res = await request.get<ApiResult<Ad[]>>(MODULES_API_URL + '/cms/ad', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加广告位
|
||||
*/
|
||||
export async function addAd(data: Ad) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/ad',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改广告位
|
||||
*/
|
||||
export async function updateAd(data: Ad) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/ad',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除广告位
|
||||
*/
|
||||
export async function removeAd(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/ad/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除广告位
|
||||
*/
|
||||
export async function removeBatchAd(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/ad/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateAdStatus(adId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/ad/status',
|
||||
{
|
||||
adId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询广告位
|
||||
*/
|
||||
export async function getAd(id: number) {
|
||||
const res = await request.get<ApiResult<Ad>>(
|
||||
MODULES_API_URL + '/cms/ad/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/ad/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
42
api/cms/ad/model/index.ts
Normal file
42
api/cms/ad/model/index.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 广告位
|
||||
*/
|
||||
export interface Ad {
|
||||
adId?: number;
|
||||
name?: string;
|
||||
adType?: string;
|
||||
type?: string;
|
||||
width?: string;
|
||||
height?: string;
|
||||
path?: string;
|
||||
images?: string;
|
||||
userId?: number;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片列表
|
||||
*/
|
||||
export interface AdItem {
|
||||
uid?: number;
|
||||
url?: string;
|
||||
path?: string;
|
||||
status?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 广告位搜索条件
|
||||
*/
|
||||
export interface AdParam extends PageParam {
|
||||
adId?: string;
|
||||
name?: number;
|
||||
type?: number;
|
||||
adType?: string;
|
||||
userId?: number;
|
||||
}
|
||||
143
api/cms/article/index.ts
Normal file
143
api/cms/article/index.ts
Normal file
@@ -0,0 +1,143 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Article, ArticleParam } from './model';
|
||||
import { MODULES_API_URL } from '~/config';
|
||||
|
||||
/**
|
||||
* 分页查询文章
|
||||
*/
|
||||
export async function pageArticle(params: ArticleParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Article>>>(
|
||||
MODULES_API_URL + '/cms/article/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文章列表
|
||||
*/
|
||||
export async function listArticle(params?: ArticleParam) {
|
||||
const res = await request.get<ApiResult<Article[]>>(
|
||||
MODULES_API_URL + '/cms/article',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文章
|
||||
*/
|
||||
export async function addArticle(data: Article) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/article',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章
|
||||
*/
|
||||
export async function updateArticle(data: Article) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/article',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文章
|
||||
*/
|
||||
export async function removeArticle(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/article/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文章
|
||||
*/
|
||||
export async function removeBatchArticle(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/article/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateArticleStatus(articleId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/article/status',
|
||||
{
|
||||
articleId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询文章
|
||||
*/
|
||||
export async function getArticle(id: number) {
|
||||
const res = await request.get<ApiResult<Article>>(
|
||||
MODULES_API_URL + '/cms/article/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/article/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
98
api/cms/article/model/index.ts
Normal file
98
api/cms/article/model/index.ts
Normal file
@@ -0,0 +1,98 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 文章
|
||||
*/
|
||||
export interface Article {
|
||||
// 文章id
|
||||
articleId?: number;
|
||||
// 文章标题
|
||||
title?: string;
|
||||
// 分类类型
|
||||
type?: number;
|
||||
// 展现方式
|
||||
showType?: any;
|
||||
// 文章类型
|
||||
categoryId?: number;
|
||||
// 文章分类
|
||||
categoryName?: string;
|
||||
// 父级分类
|
||||
parentId?: number;
|
||||
// 父级分类名称
|
||||
parentName?: string;
|
||||
// 父级分类路径
|
||||
parentPath?: string;
|
||||
// 封面图
|
||||
image?: string;
|
||||
// 附件
|
||||
files?: string;
|
||||
// 附件
|
||||
fileList?: string[];
|
||||
// 缩列图
|
||||
thumbnail?: string;
|
||||
// 视频地址
|
||||
video?: string;
|
||||
// 上传的文件类型
|
||||
accept?: string;
|
||||
// 来源
|
||||
source?: string;
|
||||
// 文章内容
|
||||
content?: string;
|
||||
// 虚拟阅读量
|
||||
virtualViews?: number;
|
||||
// 实际阅读量
|
||||
actualViews?: number;
|
||||
// 浏览权限
|
||||
permission?: number;
|
||||
// 访问密码
|
||||
password?: string;
|
||||
// 访问密码(客户端传)
|
||||
password2?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 用户昵称
|
||||
nickname?: string;
|
||||
// 账号
|
||||
username?: string;
|
||||
// 用户头像
|
||||
avatar?: string;
|
||||
// 作者
|
||||
author?: string;
|
||||
// 所属门店ID
|
||||
shopId?: number;
|
||||
//
|
||||
likes?: number;
|
||||
// 排序
|
||||
sortNumber?: any;
|
||||
// 备注
|
||||
comments?: any;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
// 租户ID
|
||||
tenantId?: number;
|
||||
// 租户名称
|
||||
tenantName?: string;
|
||||
// 租户logo
|
||||
logo?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文章搜索条件
|
||||
*/
|
||||
export interface ArticleParam extends PageParam {
|
||||
title?: string;
|
||||
articleId?: number;
|
||||
categoryId?: number;
|
||||
status?: string;
|
||||
sortNumber?: string;
|
||||
createTime?: string;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
userId?: number;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
126
api/cms/category/index.ts
Normal file
126
api/cms/category/index.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ArticleCategory, ArticleCategoryParam } from './model';
|
||||
import { MODULES_API_URL } from '~/config';
|
||||
|
||||
/**
|
||||
* 分页查询文章分类
|
||||
*/
|
||||
export async function pageArticleCategory(params: ArticleCategoryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ArticleCategory>>>(
|
||||
MODULES_API_URL + '/cms/article-category/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文章分类列表
|
||||
*/
|
||||
export async function listArticleCategory(params?: ArticleCategoryParam) {
|
||||
const res = await request.get<ApiResult<ArticleCategory[]>>(
|
||||
MODULES_API_URL + '/cms/article-category',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询文章分类
|
||||
*/
|
||||
export async function getArticleCategory(id: number) {
|
||||
const res = await request.get<ApiResult<ArticleCategory>>(
|
||||
MODULES_API_URL + '/cms/article-category/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文章分类
|
||||
*/
|
||||
export async function addArticleCategory(data: ArticleCategory) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/article-category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章分类
|
||||
*/
|
||||
export async function updateArticleCategory(data: ArticleCategory) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/article-category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文章分类
|
||||
*/
|
||||
export async function removeArticleCategory(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/article-category/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文章分类
|
||||
*/
|
||||
export async function removeBatchArticleCategory(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/article-category/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/article-category/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
82
api/cms/category/model/index.ts
Normal file
82
api/cms/category/model/index.ts
Normal file
@@ -0,0 +1,82 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 文章分类
|
||||
*/
|
||||
export interface ArticleCategory {
|
||||
// 文章分类id
|
||||
categoryId?: number;
|
||||
// 文章分类名称
|
||||
categoryName?: string;
|
||||
// 分类类型 0列表 1页面 2链接
|
||||
type?: number;
|
||||
// 文章分类
|
||||
title?: string;
|
||||
// 文章分类图片
|
||||
image?: string;
|
||||
// 路由/链接
|
||||
path?: string;
|
||||
// 组件路径
|
||||
component?: string;
|
||||
// 页面ID
|
||||
pageId?: number;
|
||||
// 页面名称
|
||||
pageName?: string;
|
||||
// 上级分类
|
||||
parentId?: number;
|
||||
// 上级分类名称
|
||||
parentName?: string;
|
||||
// 封面图
|
||||
avatar?: string;
|
||||
// 用户ID
|
||||
userId?: string;
|
||||
// 所属门店ID
|
||||
shopId?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 是否显示在首页
|
||||
showIndex?: number;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
key?: number;
|
||||
value?: number;
|
||||
// 子菜单
|
||||
children?: ArticleCategory[];
|
||||
tempPath?: string;
|
||||
disabled?: boolean;
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 整理分类用于网站导航栏
|
||||
*/
|
||||
export interface ArrangeCategory {
|
||||
categoryId?: number;
|
||||
type?: number;
|
||||
title?: string;
|
||||
parentId?: number;
|
||||
avatar?: string;
|
||||
path?: string;
|
||||
component?: string;
|
||||
pageId?: number;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
children?: ArrangeCategory[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 文章分类搜索条件
|
||||
*/
|
||||
export interface ArticleCategoryParam extends PageParam {
|
||||
title?: string;
|
||||
categoryId?: number;
|
||||
}
|
||||
106
api/cms/cmsArticleComment/index.ts
Normal file
106
api/cms/cmsArticleComment/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { CmsArticleComment, CmsArticleCommentParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/index';
|
||||
|
||||
/**
|
||||
* 分页查询文章评论表
|
||||
*/
|
||||
export async function pageCmsArticleComment(params: CmsArticleCommentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CmsArticleComment>>>(
|
||||
MODULES_API_URL + '/cms/cms-article-comment/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文章评论表列表
|
||||
*/
|
||||
export async function listCmsArticleComment(params?: CmsArticleCommentParam) {
|
||||
const res = await request.get<ApiResult<CmsArticleComment[]>>(
|
||||
MODULES_API_URL + '/cms/cms-article-comment',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文章评论表
|
||||
*/
|
||||
export async function addCmsArticleComment(data: CmsArticleComment) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/cms-article-comment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章评论表
|
||||
*/
|
||||
export async function updateCmsArticleComment(data: CmsArticleComment) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/cms-article-comment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文章评论表
|
||||
*/
|
||||
export async function removeCmsArticleComment(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/cms-article-comment/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文章评论表
|
||||
*/
|
||||
export async function removeBatchCmsArticleComment(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/cms-article-comment/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询文章评论表
|
||||
*/
|
||||
export async function getCmsArticleComment(id: number) {
|
||||
const res = await request.get<ApiResult<CmsArticleComment>>(
|
||||
MODULES_API_URL + '/cms/cms-article-comment/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
47
api/cms/cmsArticleComment/model/index.ts
Normal file
47
api/cms/cmsArticleComment/model/index.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 文章评论表
|
||||
*/
|
||||
export interface CmsArticleComment {
|
||||
// 评价ID
|
||||
commentId?: number;
|
||||
// 文章ID
|
||||
articleId?: number;
|
||||
// 评分 (10好评 20中评 30差评)
|
||||
score?: number;
|
||||
// 评价内容
|
||||
content?: string;
|
||||
// 是否为图片评价
|
||||
isPicture?: number;
|
||||
// 评论者ID
|
||||
userId?: number;
|
||||
// 被评价者ID
|
||||
toUserId?: number;
|
||||
// 回复的评论ID
|
||||
replyCommentId?: number;
|
||||
// 回复者ID
|
||||
replyUserId?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0未读, 1已读
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文章评论表搜索条件
|
||||
*/
|
||||
export interface CmsArticleCommentParam extends PageParam {
|
||||
commentId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
117
api/cms/cmsProduct/index.ts
Normal file
117
api/cms/cmsProduct/index.ts
Normal file
@@ -0,0 +1,117 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { CmsProduct, CmsProductParam } from './model';
|
||||
import { SERVER_API_URL } from '~/config';
|
||||
import type { ArticleParam } from "@/api/cms/article/model";
|
||||
|
||||
/**
|
||||
* 分页查询产品
|
||||
*/
|
||||
export async function pageCmsProduct(params: CmsProductParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CmsProduct>>>(
|
||||
SERVER_API_URL + '/cms/cms-product/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询产品列表
|
||||
*/
|
||||
export async function listCmsProduct(params?: CmsProductParam) {
|
||||
const res = await request.get<ApiResult<CmsProduct[]>>(
|
||||
SERVER_API_URL + '/cms/cms-product',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加产品
|
||||
*/
|
||||
export async function addCmsProduct(data: CmsProduct) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/cms/cms-product',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品
|
||||
*/
|
||||
export async function updateCmsProduct(data: CmsProduct) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/cms/cms-product',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品
|
||||
*/
|
||||
export async function removeCmsProduct(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/cms/cms-product/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除产品
|
||||
*/
|
||||
export async function removeBatchCmsProduct(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/cms/cms-product/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询产品
|
||||
*/
|
||||
export async function getCmsProduct(id: number) {
|
||||
const res = await request.get<ApiResult<CmsProduct>>(
|
||||
SERVER_API_URL + '/cms/cms-product/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function getCount(params: ArticleParam) {
|
||||
const res = await request.get(SERVER_API_URL + '/cms/cms-product/data', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
105
api/cms/cmsProduct/model/index.ts
Normal file
105
api/cms/cmsProduct/model/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import type {PageParam} from '@/api';
|
||||
import type {CmsProductParameter} from "~/api/cms/cmsProductParameter/model";
|
||||
import type {CmsProductUrl} from "~/api/cms/cmsProductUrl/model";
|
||||
|
||||
/**
|
||||
* 产品
|
||||
*/
|
||||
export interface CmsProduct {
|
||||
// 自增ID
|
||||
productId?: number;
|
||||
// 类型 0软件产品 1实物商品 2虚拟商品
|
||||
type?: number;
|
||||
// 产品编码
|
||||
code?: string;
|
||||
// 产品标题
|
||||
title?: string;
|
||||
// 封面图
|
||||
image?: string;
|
||||
// 产品详情
|
||||
content?: string;
|
||||
// 父级分类ID
|
||||
parentId?: number;
|
||||
// 产品分类ID
|
||||
categoryId?: number;
|
||||
// 产品规格 0单规格 1多规格
|
||||
specs?: number;
|
||||
// 货架
|
||||
position?: string;
|
||||
// 单位名称 (个)
|
||||
unitName?: string;
|
||||
// 进货价格
|
||||
price?: number;
|
||||
// 销售价格
|
||||
salePrice?: number;
|
||||
// 库存计算方式(10下单减库存 20付款减库存)
|
||||
deductStockType?: number;
|
||||
// 轮播图
|
||||
files?: any;
|
||||
// 销量
|
||||
sales?: number;
|
||||
// 库存
|
||||
stock?: number;
|
||||
// 安装次数
|
||||
install?: number;
|
||||
// 消费赚取积分
|
||||
gainIntegral?: string;
|
||||
// 计费方式
|
||||
durationMethod?: number;
|
||||
// 推荐
|
||||
recommend?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
merchantName: undefined,
|
||||
merchantAvatar: undefined,
|
||||
merchantComments: undefined,
|
||||
// 状态(0:未上架,1:上架)
|
||||
isShow?: string;
|
||||
// 状态, 0上架 1待上架 2待审核 3审核不通过
|
||||
status?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 父级分类名称
|
||||
parentName?: string;
|
||||
// 父级分类路径
|
||||
parentPath?: string;
|
||||
// 分类名称
|
||||
categoryName?: string;
|
||||
// 评分
|
||||
rate?: string;
|
||||
// 是否已购买
|
||||
isBuy?: boolean;
|
||||
// 是否已安装插件
|
||||
installed?: boolean;
|
||||
// 产品参数
|
||||
parameters?: CmsProductParameter[];
|
||||
// 产品链接
|
||||
links?: CmsProductUrl[];
|
||||
// 插件入口
|
||||
path?: string;
|
||||
// 标签
|
||||
tag?: string;
|
||||
// 菜单ID
|
||||
menuId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 产品搜索条件
|
||||
*/
|
||||
export interface CmsProductParam extends PageParam {
|
||||
productId?: number;
|
||||
status?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
api/cms/cmsProductComment/index.ts
Normal file
106
api/cms/cmsProductComment/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type {ApiResult, PageResult} from '@/api';
|
||||
import type {CmsProductComment, CmsProductCommentParam} from './model';
|
||||
import {SERVER_API_URL} from '@/config/index';
|
||||
|
||||
/**
|
||||
* 分页查询产品评论
|
||||
*/
|
||||
export async function pageCmsProductComment(params: CmsProductCommentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CmsProductComment>>>(
|
||||
SERVER_API_URL + '/cms/cms-product-comment/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询产品评论列表
|
||||
*/
|
||||
export async function listCmsProductComment(params?: CmsProductCommentParam) {
|
||||
const res = await request.get<ApiResult<CmsProductComment[]>>(
|
||||
SERVER_API_URL + '/cms/cms-product-comment',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加产品评论
|
||||
*/
|
||||
export async function addCmsProductComment(data: CmsProductComment) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/cms/cms-product-comment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品评论
|
||||
*/
|
||||
export async function updateCmsProductComment(data: CmsProductComment) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/cms/cms-product-comment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品评论
|
||||
*/
|
||||
export async function removeCmsProductComment(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/cms/cms-product-comment/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除产品评论
|
||||
*/
|
||||
export async function removeBatchCmsProductComment(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/cms/cms-product-comment/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询产品评论
|
||||
*/
|
||||
export async function getCmsProductComment(id: number) {
|
||||
const res = await request.get<ApiResult<CmsProductComment>>(
|
||||
SERVER_API_URL + '/cms/cms-product-comment/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
41
api/cms/cmsProductComment/model/index.ts
Normal file
41
api/cms/cmsProductComment/model/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 产品评论
|
||||
*/
|
||||
export interface CmsProductComment {
|
||||
// ID
|
||||
id?: number;
|
||||
// 产品ID
|
||||
productId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 用户头像
|
||||
avatar?: string;
|
||||
// 用户昵称
|
||||
nickname?: string;
|
||||
image?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 评论内容
|
||||
comments?: string;
|
||||
// 评分
|
||||
rate?: number;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 子列表
|
||||
children?: CmsProductComment[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 产品评论搜索条件
|
||||
*/
|
||||
export interface CmsProductCommentParam extends PageParam {
|
||||
id?: number;
|
||||
userId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
api/cms/cmsProductParameter/index.ts
Normal file
106
api/cms/cmsProductParameter/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type {ApiResult, PageResult} from '@/api';
|
||||
import type {CmsProductParameter, CmsProductParameterParam} from './model';
|
||||
import {SERVER_API_URL} from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询产品参数
|
||||
*/
|
||||
export async function pageCmsProductParameter(params: CmsProductParameterParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CmsProductParameter>>>(
|
||||
SERVER_API_URL + '/cms/cms-product-parameter/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询产品参数列表
|
||||
*/
|
||||
export async function listCmsProductParameter(params?: CmsProductParameterParam) {
|
||||
const res = await request.get<ApiResult<CmsProductParameter[]>>(
|
||||
SERVER_API_URL + '/cms/cms-product-parameter',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加产品参数
|
||||
*/
|
||||
export async function addCmsProductParameter(data: CmsProductParameter) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/cms/cms-product-parameter',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品参数
|
||||
*/
|
||||
export async function updateCmsProductParameter(data: CmsProductParameter) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/cms/cms-product-parameter',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品参数
|
||||
*/
|
||||
export async function removeCmsProductParameter(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/cms/cms-product-parameter/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除产品参数
|
||||
*/
|
||||
export async function removeBatchCmsProductParameter(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/cms/cms-product-parameter/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询产品参数
|
||||
*/
|
||||
export async function getCmsProductParameter(id: number) {
|
||||
const res = await request.get<ApiResult<CmsProductParameter>>(
|
||||
SERVER_API_URL + '/cms/cms-product-parameter/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
33
api/cms/cmsProductParameter/model/index.ts
Normal file
33
api/cms/cmsProductParameter/model/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 产品参数
|
||||
*/
|
||||
export interface CmsProductParameter {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 产品ID
|
||||
productId?: number;
|
||||
// 参数名称
|
||||
name?: string;
|
||||
// 参数内容
|
||||
value?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0正常, 1待确认
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 产品参数搜索条件
|
||||
*/
|
||||
export interface CmsProductParameterParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
api/cms/cmsProductSpec/index.ts
Normal file
106
api/cms/cmsProductSpec/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { CmsProductSpec, CmsProductSpecParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询规格
|
||||
*/
|
||||
export async function pageCmsProductSpec(params: CmsProductSpecParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CmsProductSpec>>>(
|
||||
MODULES_API_URL + '/cms/cms-product-spec/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询规格列表
|
||||
*/
|
||||
export async function listCmsProductSpec(params?: CmsProductSpecParam) {
|
||||
const res = await request.get<ApiResult<CmsProductSpec[]>>(
|
||||
MODULES_API_URL + '/cms/cms-product-spec',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加规格
|
||||
*/
|
||||
export async function addCmsProductSpec(data: CmsProductSpec) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/cms-product-spec',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改规格
|
||||
*/
|
||||
export async function updateCmsProductSpec(data: CmsProductSpec) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/cms-product-spec',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除规格
|
||||
*/
|
||||
export async function removeCmsProductSpec(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/cms-product-spec/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除规格
|
||||
*/
|
||||
export async function removeBatchCmsProductSpec(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/cms-product-spec/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询规格
|
||||
*/
|
||||
export async function getCmsProductSpec(id: number) {
|
||||
const res = await request.get<ApiResult<CmsProductSpec>>(
|
||||
MODULES_API_URL + '/cms/cms-product-spec/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
35
api/cms/cmsProductSpec/model/index.ts
Normal file
35
api/cms/cmsProductSpec/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
export interface CmsProductSpec {
|
||||
// 规格ID
|
||||
specId?: number;
|
||||
// 规格名称
|
||||
specName?: string;
|
||||
// 规格值
|
||||
specValue?: string;
|
||||
// 创建用户
|
||||
userId?: number;
|
||||
// 更新者
|
||||
updater?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0正常, 1待修,2异常已修,3异常未修
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 规格搜索条件
|
||||
*/
|
||||
export interface CmsProductSpecParam extends PageParam {
|
||||
specId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
api/cms/cmsProductSpecValue/index.ts
Normal file
106
api/cms/cmsProductSpecValue/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { CmsProductSpecValue, CmsProductSpecValueParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询规格值
|
||||
*/
|
||||
export async function pageCmsProductSpecValue(params: CmsProductSpecValueParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CmsProductSpecValue>>>(
|
||||
MODULES_API_URL + '/cms/cms-product-spec-value/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询规格值列表
|
||||
*/
|
||||
export async function listCmsProductSpecValue(params?: CmsProductSpecValueParam) {
|
||||
const res = await request.get<ApiResult<CmsProductSpecValue[]>>(
|
||||
MODULES_API_URL + '/cms/cms-product-spec-value',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加规格值
|
||||
*/
|
||||
export async function addCmsProductSpecValue(data: CmsProductSpecValue) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/cms-product-spec-value',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改规格值
|
||||
*/
|
||||
export async function updateCmsProductSpecValue(data: CmsProductSpecValue) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/cms-product-spec-value',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除规格值
|
||||
*/
|
||||
export async function removeCmsProductSpecValue(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/cms-product-spec-value/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除规格值
|
||||
*/
|
||||
export async function removeBatchCmsProductSpecValue(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/cms-product-spec-value/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询规格值
|
||||
*/
|
||||
export async function getCmsProductSpecValue(id: number) {
|
||||
const res = await request.get<ApiResult<CmsProductSpecValue>>(
|
||||
MODULES_API_URL + '/cms/cms-product-spec-value/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
29
api/cms/cmsProductSpecValue/model/index.ts
Normal file
29
api/cms/cmsProductSpecValue/model/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 规格值
|
||||
*/
|
||||
export interface CmsProductSpecValue {
|
||||
// 规格值ID
|
||||
specValueId?: number;
|
||||
// 规格组ID
|
||||
specId?: number;
|
||||
// 规格值
|
||||
specValue?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 规格值搜索条件
|
||||
*/
|
||||
export interface CmsProductSpecValueParam extends PageParam {
|
||||
specValueId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
api/cms/cmsProductUrl/index.ts
Normal file
106
api/cms/cmsProductUrl/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { CmsProductUrl, CmsProductUrlParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询域名
|
||||
*/
|
||||
export async function pageCmsProductUrl(params: CmsProductUrlParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CmsProductUrl>>>(
|
||||
MODULES_API_URL + '/cms/cms-product-url/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询域名列表
|
||||
*/
|
||||
export async function listCmsProductUrl(params?: CmsProductUrlParam) {
|
||||
const res = await request.get<ApiResult<CmsProductUrl[]>>(
|
||||
MODULES_API_URL + '/cms/cms-product-url',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加域名
|
||||
*/
|
||||
export async function addCmsProductUrl(data: CmsProductUrl) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/cms-product-url',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改域名
|
||||
*/
|
||||
export async function updateCmsProductUrl(data: CmsProductUrl) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/cms-product-url',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除域名
|
||||
*/
|
||||
export async function removeCmsProductUrl(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/cms-product-url/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除域名
|
||||
*/
|
||||
export async function removeBatchCmsProductUrl(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/cms-product-url/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询域名
|
||||
*/
|
||||
export async function getCmsProductUrl(id: number) {
|
||||
const res = await request.get<ApiResult<CmsProductUrl>>(
|
||||
MODULES_API_URL + '/cms/cms-product-url/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
41
api/cms/cmsProductUrl/model/index.ts
Normal file
41
api/cms/cmsProductUrl/model/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 域名
|
||||
*/
|
||||
export interface CmsProductUrl {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 产品ID
|
||||
productId?: number;
|
||||
// 域名类型
|
||||
type?: string;
|
||||
// 域名
|
||||
domain?: string;
|
||||
// 二维码
|
||||
qrcode?: string;
|
||||
// 账号
|
||||
account?: string;
|
||||
// 密码
|
||||
password?: string;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0正常, 1待确认
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 域名搜索条件
|
||||
*/
|
||||
export interface CmsProductUrlParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
143
api/cms/design/index.ts
Normal file
143
api/cms/design/index.ts
Normal file
@@ -0,0 +1,143 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Design, DesignParam } from './model';
|
||||
import { MODULES_API_URL } from '~/config';
|
||||
|
||||
/**
|
||||
* 分页查询页面设计
|
||||
*/
|
||||
export async function pageDesign(params: DesignParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Design>>>(
|
||||
MODULES_API_URL + '/cms/design/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询页面设计列表
|
||||
*/
|
||||
export async function listDesign(params?: DesignParam) {
|
||||
const res = await request.get<ApiResult<Design[]>>(
|
||||
MODULES_API_URL + '/cms/design',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加页面设计
|
||||
*/
|
||||
export async function addDesign(data: Design) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/design',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改页面设计
|
||||
*/
|
||||
export async function updateDesign(data: Design) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/design',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除页面设计
|
||||
*/
|
||||
export async function removeDesign(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/design/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除页面设计
|
||||
*/
|
||||
export async function removeBatchDesign(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/design/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateDesignStatus(designId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/design/status',
|
||||
{
|
||||
designId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询页面设计
|
||||
*/
|
||||
export async function getDesign(id: number) {
|
||||
const res = await request.get<ApiResult<Design>>(
|
||||
MODULES_API_URL + '/cms/design/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/design/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
55
api/cms/design/model/index.ts
Normal file
55
api/cms/design/model/index.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 页面
|
||||
*/
|
||||
export interface Design {
|
||||
pageId?: number;
|
||||
name?: string;
|
||||
keywords?: string;
|
||||
description?: string;
|
||||
path?: string;
|
||||
component?: string;
|
||||
photo?: string;
|
||||
content?: string;
|
||||
// 类型
|
||||
type?: string;
|
||||
// 宽
|
||||
width?: string;
|
||||
// 高
|
||||
height?: string;
|
||||
// 页面样式
|
||||
style?: string;
|
||||
// 附件
|
||||
images?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 设为首页
|
||||
home?: number;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
// 页面布局
|
||||
layout?: string;
|
||||
backgroundColor?: string;
|
||||
demoUrl?: string;
|
||||
buyUrl?: string;
|
||||
docUrl?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 页面搜索条件
|
||||
*/
|
||||
export interface DesignParam extends PageParam {
|
||||
pageId?: string;
|
||||
name?: number;
|
||||
type?: number;
|
||||
userId?: number;
|
||||
}
|
||||
143
api/cms/docs-book/index.ts
Normal file
143
api/cms/docs-book/index.ts
Normal file
@@ -0,0 +1,143 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { DocsBook, DocsBookParam } from './model';
|
||||
import { MODULES_API_URL } from '~/config';
|
||||
|
||||
/**
|
||||
* 分页查询书籍
|
||||
*/
|
||||
export async function pageDocsBook(params: DocsBookParam) {
|
||||
const res = await request.get<ApiResult<PageResult<DocsBook>>>(
|
||||
MODULES_API_URL + '/cms/docs-book/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询书籍列表
|
||||
*/
|
||||
export async function listDocsBook(params?: DocsBookParam) {
|
||||
const res = await request.get<ApiResult<DocsBook[]>>(
|
||||
MODULES_API_URL + '/cms/docs-book',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加书籍
|
||||
*/
|
||||
export async function addDocsBook(data: DocsBook) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs-book',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改书籍
|
||||
*/
|
||||
export async function updateDocsBook(data: DocsBook) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs-book',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除书籍
|
||||
*/
|
||||
export async function removeDocsBook(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs-book/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除书籍
|
||||
*/
|
||||
export async function removeBatchDocsBook(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs-book/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateDocsBookStatus(docsId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs-book/status',
|
||||
{
|
||||
docsId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询书籍
|
||||
*/
|
||||
export async function getDocsBook(id: number) {
|
||||
const res = await request.get<ApiResult<DocsBook>>(
|
||||
MODULES_API_URL + '/cms/docs-book/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs-book/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
api/cms/docs-book/model/index.ts
Normal file
31
api/cms/docs-book/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 书籍内容
|
||||
*/
|
||||
export interface DocsBook {
|
||||
// 自增ID
|
||||
bookId?: number;
|
||||
// 名称
|
||||
name?: string;
|
||||
// 书籍标识
|
||||
code?: string;
|
||||
// 封面图
|
||||
photo?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 书籍搜索条件
|
||||
*/
|
||||
export interface DocsBookParam extends PageParam {
|
||||
bookId?: number;
|
||||
docsId?: number;
|
||||
}
|
||||
146
api/cms/docs-content/index.ts
Normal file
146
api/cms/docs-content/index.ts
Normal file
@@ -0,0 +1,146 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { DocsContent, DocsContentParam } from './model';
|
||||
import { MODULES_API_URL } from '~/config';
|
||||
|
||||
/**
|
||||
* 分页查询文档
|
||||
*/
|
||||
export async function pageDocsContent(params: DocsContentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<DocsContent>>>(
|
||||
MODULES_API_URL + '/cms/docs-content/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文档列表
|
||||
*/
|
||||
export async function listDocsContent(params?: DocsContentParam) {
|
||||
const res = await request.get<ApiResult<DocsContent[]>>(
|
||||
MODULES_API_URL + '/cms/docs-content',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文档
|
||||
*/
|
||||
export async function addDocsContent(data: DocsContent) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs-content',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文档
|
||||
*/
|
||||
export async function updateDocsContent(data: DocsContent) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs-content',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文档
|
||||
*/
|
||||
export async function removeDocsContent(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs-content/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文档
|
||||
*/
|
||||
export async function removeBatchDocsContent(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs-content/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateDocsContentStatus(
|
||||
docsId?: number,
|
||||
status?: number
|
||||
) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs-content/status',
|
||||
{
|
||||
docsId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询文档
|
||||
*/
|
||||
export async function getDocsContent(id: number) {
|
||||
const res = await request.get<ApiResult<DocsContent>>(
|
||||
MODULES_API_URL + '/cms/docs-content/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs-content/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
36
api/cms/docs-content/model/index.ts
Normal file
36
api/cms/docs-content/model/index.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 文档内容
|
||||
*/
|
||||
export interface DocsContent {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 文档内容id
|
||||
docsId?: number;
|
||||
// 文档内容
|
||||
content?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
//
|
||||
key?: number;
|
||||
//
|
||||
value?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文档内容搜索条件
|
||||
*/
|
||||
export interface DocsContentParam extends PageParam {
|
||||
id?: number;
|
||||
docsId?: number;
|
||||
content?: string;
|
||||
}
|
||||
143
api/cms/docs/index.ts
Normal file
143
api/cms/docs/index.ts
Normal file
@@ -0,0 +1,143 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Docs, DocsParam } from './model';
|
||||
import { MODULES_API_URL } from '~/config';
|
||||
|
||||
/**
|
||||
* 分页查询文档
|
||||
*/
|
||||
export async function pageDocs(params: DocsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Docs>>>(
|
||||
MODULES_API_URL + '/cms/docs/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文档列表
|
||||
*/
|
||||
export async function listDocs(params?: DocsParam) {
|
||||
const res = await request.get<ApiResult<Docs[]>>(
|
||||
MODULES_API_URL + '/cms/docs',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文档
|
||||
*/
|
||||
export async function addDocs(data: Docs) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文档
|
||||
*/
|
||||
export async function updateDocs(data: Docs) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文档
|
||||
*/
|
||||
export async function removeDocs(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文档
|
||||
*/
|
||||
export async function removeBatchDocs(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateDocsStatus(docsId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs/status',
|
||||
{
|
||||
docsId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询文档
|
||||
*/
|
||||
export async function getDocs(id: number) {
|
||||
const res = await request.get<ApiResult<Docs>>(
|
||||
MODULES_API_URL + '/cms/docs/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/docs/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
64
api/cms/docs/model/index.ts
Normal file
64
api/cms/docs/model/index.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 文档
|
||||
*/
|
||||
export interface Docs {
|
||||
// 文档id
|
||||
docsId?: number;
|
||||
// 书籍ID
|
||||
bookId?: number;
|
||||
// 书籍标识
|
||||
code?: string;
|
||||
// 文档标题
|
||||
title?: string;
|
||||
// 上级分类
|
||||
parentId?: number;
|
||||
// 上级分类名称
|
||||
parentName?: string;
|
||||
// 文档内容
|
||||
content?: string;
|
||||
// 虚拟阅读量
|
||||
virtualViews?: string;
|
||||
// 实际阅读量
|
||||
actualViews?: string;
|
||||
// 用户ID
|
||||
userId?: string;
|
||||
// 用户昵称
|
||||
nickname?: string;
|
||||
// 账号
|
||||
username?: string;
|
||||
// 用户头像
|
||||
userAvatar?: string;
|
||||
// 所属门店ID
|
||||
shopId?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
key?: number;
|
||||
value?: number;
|
||||
isUpdate?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文档搜索条件
|
||||
*/
|
||||
export interface DocsParam extends PageParam {
|
||||
bookId?: number;
|
||||
code?: string;
|
||||
title?: string;
|
||||
docsId?: number;
|
||||
categoryId?: string;
|
||||
status?: string;
|
||||
sortNumber?: string;
|
||||
createTime?: string;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
}
|
||||
153
api/cms/domain/index.ts
Normal file
153
api/cms/domain/index.ts
Normal file
@@ -0,0 +1,153 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Domain, DomainParam } from './model';
|
||||
import { MODULES_API_URL } from '~/config';
|
||||
|
||||
/**
|
||||
* 分页查询网站域名
|
||||
*/
|
||||
export async function pageDomain(params: DomainParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Domain>>>(
|
||||
MODULES_API_URL + '/cms/domain/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询网站域名列表
|
||||
*/
|
||||
export async function listDomain(params?: DomainParam) {
|
||||
const res = await request.get<ApiResult<Domain[]>>(
|
||||
MODULES_API_URL + '/cms/domain',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加网站域名
|
||||
*/
|
||||
export async function addDomain(data: Domain) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/domain',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改网站域名
|
||||
*/
|
||||
export async function updateDomain(data: Domain) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/domain',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除网站域名
|
||||
*/
|
||||
export async function removeDomain(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/domain/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除网站域名
|
||||
*/
|
||||
export async function removeBatchDomain(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/domain/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateDomainStatus(docsId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/domain/status',
|
||||
{
|
||||
docsId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询网站域名
|
||||
*/
|
||||
export async function getDomain(id: number) {
|
||||
const res = await request.get<ApiResult<Domain>>(
|
||||
MODULES_API_URL + '/cms/domain/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/domain/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function resolvable(id: number) {
|
||||
const res = await request.get<ApiResult<Domain>>(
|
||||
MODULES_API_URL + '/cms/domain/resolvable/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
33
api/cms/domain/model/index.ts
Normal file
33
api/cms/domain/model/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 网站域名
|
||||
*/
|
||||
export interface Domain {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 域名
|
||||
domain?: string;
|
||||
// 主机记录
|
||||
hostName?: string;
|
||||
// 主机记录值
|
||||
hostValue?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 租户ID
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 网站域名搜索条件
|
||||
*/
|
||||
export interface DomainParam extends PageParam {
|
||||
id?: number;
|
||||
domain?: string;
|
||||
}
|
||||
126
api/cms/form-record/index.ts
Normal file
126
api/cms/form-record/index.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { FormRecord, FormRecordParam } from './model';
|
||||
import { MODULES_API_URL } from '~/config';
|
||||
|
||||
/**
|
||||
* 分页查询表单设计
|
||||
*/
|
||||
export async function pageFormRecord(params: FormRecordParam) {
|
||||
const res = await request.get<ApiResult<PageResult<FormRecord>>>(
|
||||
MODULES_API_URL + '/cms/form-record/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询表单设计列表
|
||||
*/
|
||||
export async function listFormRecord(params?: FormRecordParam) {
|
||||
const res = await request.get<ApiResult<FormRecord[]>>(
|
||||
MODULES_API_URL + '/cms/form-record',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加表单设计
|
||||
*/
|
||||
export async function addFormRecord(data: FormRecord) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/form-record',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改表单设计
|
||||
*/
|
||||
export async function updateFormRecord(data: FormRecord) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/form-record',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除表单设计
|
||||
*/
|
||||
export async function removeFormRecord(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/form-record/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除表单设计
|
||||
*/
|
||||
export async function removeBatchFormRecord(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/form-record/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询表单设计
|
||||
*/
|
||||
export async function getFormRecord(id: number) {
|
||||
const res = await request.get<ApiResult<FormRecord>>(
|
||||
MODULES_API_URL + '/cms/form-record/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/form-record/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
28
api/cms/form-record/model/index.ts
Normal file
28
api/cms/form-record/model/index.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 表单数据
|
||||
*/
|
||||
export interface FormRecord {
|
||||
formRecordId?: number;
|
||||
formId?: number;
|
||||
name?: string;
|
||||
formData?: string;
|
||||
formObj?: Object;
|
||||
userId?: number;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
createTime?: string;
|
||||
layout?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface FormRecordParam extends PageParam {
|
||||
formRecordId?: string;
|
||||
formId?: number;
|
||||
phone?: string;
|
||||
name?: number;
|
||||
}
|
||||
143
api/cms/form/index.ts
Normal file
143
api/cms/form/index.ts
Normal file
@@ -0,0 +1,143 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Form, FormParam } from './model';
|
||||
import { MODULES_API_URL } from '~/config';
|
||||
|
||||
/**
|
||||
* 分页查询表单设计
|
||||
*/
|
||||
export async function pageForm(params: FormParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Form>>>(
|
||||
MODULES_API_URL + '/cms/form/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询表单设计列表
|
||||
*/
|
||||
export async function listForm(params?: FormParam) {
|
||||
const res = await request.get<ApiResult<Form[]>>(
|
||||
MODULES_API_URL + '/cms/form',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加表单设计
|
||||
*/
|
||||
export async function addForm(data: Form) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/form',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改表单设计
|
||||
*/
|
||||
export async function updateForm(data: Form) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/form',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除表单设计
|
||||
*/
|
||||
export async function removeForm(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/form/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除表单设计
|
||||
*/
|
||||
export async function removeBatchForm(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/form/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateFormStatus(formId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/form/status',
|
||||
{
|
||||
formId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询表单设计
|
||||
*/
|
||||
export async function getForm(id: number) {
|
||||
const res = await request.get<ApiResult<Form>>(
|
||||
MODULES_API_URL + '/cms/form/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/form/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
33
api/cms/form/model/index.ts
Normal file
33
api/cms/form/model/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 表单设计
|
||||
*/
|
||||
export interface Form {
|
||||
formId?: number;
|
||||
name?: string;
|
||||
photo?: string;
|
||||
background?: string;
|
||||
video?: string;
|
||||
submitNumber?: number;
|
||||
layout?: string;
|
||||
userId?: number;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
createTime?: string;
|
||||
hidePhoto?: any;
|
||||
hideBackground?: number;
|
||||
hideVideo?: number;
|
||||
opacity?: number;
|
||||
data?: any[];
|
||||
clearCache?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface FormParam extends PageParam {
|
||||
formId?: number;
|
||||
name?: number;
|
||||
}
|
||||
113
api/cms/link/index.ts
Normal file
113
api/cms/link/index.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Link, LinkParam } from './model';
|
||||
import { MODULES_API_URL } from '~/config';
|
||||
|
||||
/**
|
||||
* 分页查询链接
|
||||
*/
|
||||
export async function pageLink(params: LinkParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Link>>>(
|
||||
MODULES_API_URL + '/oa/link/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询链接列表
|
||||
*/
|
||||
export async function listLink(params?: LinkParam) {
|
||||
const res = await request.get<ApiResult<Link[]>>(
|
||||
MODULES_API_URL + '/oa/link',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加链接
|
||||
*/
|
||||
export async function addLink(data: Link) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/link',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改链接
|
||||
*/
|
||||
export async function updateLink(data: Link) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/link',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除链接
|
||||
*/
|
||||
export async function removeLink(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/link/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除链接
|
||||
*/
|
||||
export async function removeBatchLink(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/link/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/link/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
29
api/cms/link/model/index.ts
Normal file
29
api/cms/link/model/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
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;
|
||||
}
|
||||
106
api/cms/mp-menu/index.ts
Normal file
106
api/cms/mp-menu/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { MpMenu, MpMenuParam } from './model';
|
||||
import { MODULES_API_URL } from '~/config';
|
||||
|
||||
/**
|
||||
* 分页查询小程序端菜单
|
||||
*/
|
||||
export async function pageMpMenu(params: MpMenuParam) {
|
||||
const res = await request.get<ApiResult<PageResult<MpMenu>>>(
|
||||
MODULES_API_URL + '/cms/mp-menu/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询小程序端菜单列表
|
||||
*/
|
||||
export async function listMpMenu(params?: MpMenuParam) {
|
||||
const res = await request.get<ApiResult<MpMenu[]>>(
|
||||
MODULES_API_URL + '/cms/mp-menu',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加小程序端菜单
|
||||
*/
|
||||
export async function addMpMenu(data: MpMenu) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/mp-menu',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改小程序端菜单
|
||||
*/
|
||||
export async function updateMpMenu(data: MpMenu) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/mp-menu',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除小程序端菜单
|
||||
*/
|
||||
export async function removeMpMenu(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/mp-menu/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除小程序端菜单
|
||||
*/
|
||||
export async function removeBatchMpMenu(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/mp-menu/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询小程序端菜单
|
||||
*/
|
||||
export async function getMpMenu(id: number) {
|
||||
const res = await request.get<ApiResult<MpMenu>>(
|
||||
MODULES_API_URL + '/cms/mp-menu/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
85
api/cms/mp-menu/model/index.ts
Normal file
85
api/cms/mp-menu/model/index.ts
Normal file
@@ -0,0 +1,85 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 小程序端菜单
|
||||
*/
|
||||
export interface MpMenu {
|
||||
// ID
|
||||
menuId?: number;
|
||||
// 上级id, 0是顶级
|
||||
parentId?: number;
|
||||
// 菜单名称
|
||||
title?: string;
|
||||
// 类型 0自定义 1单页内容2外部链接
|
||||
type?: number;
|
||||
// 是否微信小程序菜单
|
||||
isMpWeixin?: boolean;
|
||||
// 菜单路由地址
|
||||
path?: string;
|
||||
// 菜单组件地址, 目录可为空
|
||||
component?: string;
|
||||
// 打开位置
|
||||
target?: string;
|
||||
// 菜单图标
|
||||
icon?: string;
|
||||
// 图标颜色
|
||||
color?: string;
|
||||
// 上传图标
|
||||
avatar?: string;
|
||||
// 所在行
|
||||
rows?: number;
|
||||
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)
|
||||
hide?: number;
|
||||
// 位置 0不限 1顶部 2底部
|
||||
position?: number;
|
||||
// 菜单侧栏选中的path
|
||||
active?: string;
|
||||
// 其它路由元信息
|
||||
meta?: string;
|
||||
// 绑定的页面
|
||||
pageId?: number;
|
||||
// 绑定的文章分类ID
|
||||
articleCategoryId?: number;
|
||||
// 绑定的文章ID
|
||||
articleId?: number;
|
||||
// 绑定的表单ID
|
||||
formId?: number;
|
||||
// 绑定的书籍标识
|
||||
bookCode?: string;
|
||||
// 绑定的商品分类ID
|
||||
goodsCategoryId?: number;
|
||||
// 绑定的商品ID
|
||||
goodsId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 是否管理人员可见
|
||||
adminShow?: number;
|
||||
// 设为首页
|
||||
home?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 子菜单
|
||||
children?: MpMenu[];
|
||||
pageName?: string;
|
||||
groupName?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序端菜单搜索条件
|
||||
*/
|
||||
export interface MpMenuParam extends PageParam {
|
||||
parentId?: number;
|
||||
menuId?: number;
|
||||
pageId?: number;
|
||||
subpackage?: string;
|
||||
type?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
103
api/cms/mp/index.ts
Normal file
103
api/cms/mp/index.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Mp, MpParam } from './model';
|
||||
import { MODULES_API_URL } from '~/config';
|
||||
|
||||
/**
|
||||
* 分页查询小程序信息
|
||||
*/
|
||||
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));
|
||||
}
|
||||
62
api/cms/mp/model/index.ts
Normal file
62
api/cms/mp/model/index.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 小程序信息
|
||||
*/
|
||||
export interface Mp {
|
||||
// ID
|
||||
mpId?: number;
|
||||
// 小程序ID
|
||||
appId?: string;
|
||||
// 小程序密钥
|
||||
appSecret?: string;
|
||||
// 是否主账号
|
||||
type?: number;
|
||||
// 小程序名称
|
||||
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;
|
||||
type?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
api/cms/mpAd/index.ts
Normal file
106
api/cms/mpAd/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { MpAd, MpAdParam } from './model';
|
||||
import { MODULES_API_URL } from '~/config';
|
||||
|
||||
/**
|
||||
* 分页查询小程序广告位
|
||||
*/
|
||||
export async function pageMpAd(params: MpAdParam) {
|
||||
const res = await request.get<ApiResult<PageResult<MpAd>>>(
|
||||
MODULES_API_URL + '/cms/mp-ad/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询小程序广告位列表
|
||||
*/
|
||||
export async function listMpAd(params?: MpAdParam) {
|
||||
const res = await request.get<ApiResult<MpAd[]>>(
|
||||
MODULES_API_URL + '/cms/mp-ad',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加小程序广告位
|
||||
*/
|
||||
export async function addMpAd(data: MpAd) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/mp-ad',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改小程序广告位
|
||||
*/
|
||||
export async function updateMpAd(data: MpAd) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/mp-ad',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除小程序广告位
|
||||
*/
|
||||
export async function removeMpAd(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/mp-ad/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除小程序广告位
|
||||
*/
|
||||
export async function removeBatchMpAd(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/mp-ad/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询小程序广告位
|
||||
*/
|
||||
export async function getMpAd(id: number) {
|
||||
const res = await request.get<ApiResult<MpAd>>(
|
||||
MODULES_API_URL + '/cms/mp-ad/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
47
api/cms/mpAd/model/index.ts
Normal file
47
api/cms/mpAd/model/index.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 小程序广告位
|
||||
*/
|
||||
export interface MpAd {
|
||||
// ID
|
||||
adId?: number;
|
||||
// 页面ID
|
||||
pageId?: number;
|
||||
// 页面名称
|
||||
pageName?: string;
|
||||
// 广告类型
|
||||
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
api/cms/mpField/index.ts
Normal file
132
api/cms/mpField/index.ts
Normal 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';
|
||||
|
||||
/**
|
||||
* 分页查询小程序配置
|
||||
*/
|
||||
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));
|
||||
}
|
||||
37
api/cms/mpField/model/index.ts
Normal file
37
api/cms/mpField/model/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 小程序配置
|
||||
*/
|
||||
export interface MpField {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 类型,0文本 1图片 2其他
|
||||
type?: number;
|
||||
// 名称
|
||||
name?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 名称
|
||||
value?: string;
|
||||
// 页面ID
|
||||
pageId?: number;
|
||||
// 页面名称
|
||||
pageName?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序配置搜索条件
|
||||
*/
|
||||
export interface MpFieldParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
api/cms/mpPages/index.ts
Normal file
106
api/cms/mpPages/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { MpPages, MpPagesParam } from './model';
|
||||
import { MODULES_API_URL } from '~/config';
|
||||
|
||||
/**
|
||||
* 分页查询小程序页面
|
||||
*/
|
||||
export async function pageMpPages(params: MpPagesParam) {
|
||||
const res = await request.get<ApiResult<PageResult<MpPages>>>(
|
||||
MODULES_API_URL + '/cms/mp-pages/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询小程序页面列表
|
||||
*/
|
||||
export async function listMpPages(params?: MpPagesParam) {
|
||||
const res = await request.get<ApiResult<MpPages[]>>(
|
||||
MODULES_API_URL + '/cms/mp-pages',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加小程序页面
|
||||
*/
|
||||
export async function addMpPages(data: MpPages) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/mp-pages',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改小程序页面
|
||||
*/
|
||||
export async function updateMpPages(data: MpPages) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/mp-pages',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除小程序页面
|
||||
*/
|
||||
export async function removeMpPages(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/mp-pages/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除小程序页面
|
||||
*/
|
||||
export async function removeBatchMpPages(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/mp-pages/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据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 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
52
api/cms/mpPages/model/index.ts
Normal file
52
api/cms/mpPages/model/index.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
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;
|
||||
// (优先级高于图标)
|
||||
iconPath?: string;
|
||||
// (优先级高于图标)
|
||||
selectedIconPath?: 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;
|
||||
}
|
||||
173
api/cms/navigation/index.ts
Normal file
173
api/cms/navigation/index.ts
Normal file
@@ -0,0 +1,173 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Navigation, NavigationParam } from './model';
|
||||
import { MODULES_API_URL } from '~/config';
|
||||
|
||||
/**
|
||||
* 分页查询导航
|
||||
*/
|
||||
export async function pageNavigation(params: NavigationParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Navigation>>>(
|
||||
MODULES_API_URL + '/cms/navigation/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询导航列表
|
||||
*/
|
||||
export async function listNavigation(params?: NavigationParam) {
|
||||
const res = await request.get<ApiResult<Navigation[]>>(
|
||||
MODULES_API_URL + '/cms/navigation',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加导航
|
||||
*/
|
||||
export async function addNavigation(data: Navigation) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/navigation',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改导航
|
||||
*/
|
||||
export async function updateNavigation(data: Navigation) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/navigation',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除导航
|
||||
*/
|
||||
export async function removeNavigation(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/navigation/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除导航
|
||||
*/
|
||||
export async function removeBatchNavigation(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/navigation/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateNavigationStatus(navigationId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/navigation/status',
|
||||
{
|
||||
navigationId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询导航
|
||||
*/
|
||||
export async function getNavigation(id: number) {
|
||||
const res = await request.get<ApiResult<Navigation>>(
|
||||
MODULES_API_URL + '/cms/navigation/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/navigation/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 树形结构
|
||||
* @param params
|
||||
*/
|
||||
export async function treeNavigation(params?: NavigationParam) {
|
||||
const res = await request.get<ApiResult<Navigation[]>>(
|
||||
MODULES_API_URL + '/cms/navigation/tree',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据path查询导航
|
||||
*/
|
||||
export async function getNavigationByPath(path: string) {
|
||||
const res = await request.get<ApiResult<Navigation>>(
|
||||
MODULES_API_URL + '/cms/navigation/getNavigationByPath/' + path
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
59
api/cms/navigation/model/index.ts
Normal file
59
api/cms/navigation/model/index.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import type {Design} from "~/api/cms/design/model";
|
||||
|
||||
/**
|
||||
* 菜单
|
||||
*/
|
||||
export interface Navigation{
|
||||
navigationId?: number;
|
||||
parentId?: number;
|
||||
title?: string;
|
||||
path?: string;
|
||||
icon?: string;
|
||||
component?: string;
|
||||
type?: number;
|
||||
sortNumber?: number;
|
||||
hide?: number;
|
||||
permission?: number;
|
||||
password?: string;
|
||||
home?: number;
|
||||
position?: number;
|
||||
meta?: string;
|
||||
children?: Navigation[];
|
||||
disabled?: boolean;
|
||||
tenantId?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
pageId?: number;
|
||||
articleCategoryId?: number;
|
||||
articleId?: number;
|
||||
goodsCategoryId?: number;
|
||||
goodsId?: number;
|
||||
bookCode?: string;
|
||||
formId?: number;
|
||||
pageName?: string;
|
||||
createTime?: string;
|
||||
isMpWeixin?: boolean;
|
||||
target?: string;
|
||||
layout?: string;
|
||||
design?: Design;
|
||||
// 用于面包肖屑
|
||||
parentName?: string;
|
||||
parentPath?: string;
|
||||
parentStatus?: number;
|
||||
categoryName?: string;
|
||||
categoryPath?: string;
|
||||
currentTitle?: string;
|
||||
style?: string;
|
||||
label?: string;
|
||||
value?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单搜索参数
|
||||
*/
|
||||
export interface NavigationParam {
|
||||
title?: string;
|
||||
path?: string;
|
||||
authority?: string;
|
||||
parentId?: number;
|
||||
}
|
||||
159
api/cms/website/field/index.ts
Normal file
159
api/cms/website/field/index.ts
Normal file
@@ -0,0 +1,159 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
WebsiteField,
|
||||
WebsiteFieldParam
|
||||
} from '@/api/cms/website/field/model';
|
||||
import { MODULES_API_URL } from '~/config';
|
||||
|
||||
/**
|
||||
* 分页查询项目参数
|
||||
*/
|
||||
export async function pageWebsiteField(params: WebsiteFieldParam) {
|
||||
const res = await request.get<ApiResult<PageResult<WebsiteField>>>(
|
||||
MODULES_API_URL + '/cms/website-field/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目参数列表
|
||||
*/
|
||||
export async function listWebsiteField(params?: WebsiteFieldParam) {
|
||||
const res = await request.get<ApiResult<WebsiteField[]>>(
|
||||
MODULES_API_URL + '/cms/website-field',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询项目参数
|
||||
*/
|
||||
export async function getWebsiteField(id: number) {
|
||||
const res = await request.get<ApiResult<WebsiteField>>(
|
||||
MODULES_API_URL + '/cms/website-field/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加项目参数
|
||||
*/
|
||||
export async function addWebsiteField(data: WebsiteField) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website-field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目参数
|
||||
*/
|
||||
export async function updateWebsiteField(data: WebsiteField) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website-field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目参数
|
||||
*/
|
||||
export async function removeWebsiteField(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website-field/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除项目参数
|
||||
*/
|
||||
export async function removeBatchWebsiteField(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website-field/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website-field/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 恢复项目参数
|
||||
*/
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询网站参数(对象形式)
|
||||
*/
|
||||
export async function getSiteConfig(params: WebsiteFieldParam) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website-field/config',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
45
api/cms/website/field/model/index.ts
Normal file
45
api/cms/website/field/model/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 网站参数
|
||||
*/
|
||||
export interface WebsiteField {
|
||||
id?: number;
|
||||
name?: string;
|
||||
value?: string;
|
||||
comments?: string;
|
||||
userId?: number;
|
||||
type?: number;
|
||||
status?: any;
|
||||
sortNumber?: any;
|
||||
createTime?: string;
|
||||
deleted?: number;
|
||||
}
|
||||
|
||||
// 约定的网站参数名称
|
||||
export interface WebsiteParam {
|
||||
// 网站名称
|
||||
site_logo?: string;
|
||||
// 登录页面标题
|
||||
login_name?: string;
|
||||
// 登录页面的背景图片
|
||||
login_bg_img?: string;
|
||||
}
|
||||
|
||||
// 约定的小程序参数名称
|
||||
export interface MpWeixinParam {
|
||||
// 小程序LOGO
|
||||
site_logo?: string;
|
||||
// 我的页面顶部背景图片
|
||||
mp_user_top?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 网站参数搜索条件
|
||||
*/
|
||||
export interface WebsiteFieldParam extends PageParam {
|
||||
id?: number;
|
||||
userId?: number;
|
||||
name?: string;
|
||||
websiteId?: number;
|
||||
}
|
||||
169
api/cms/website/index.ts
Normal file
169
api/cms/website/index.ts
Normal file
@@ -0,0 +1,169 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Website, WebsiteParam } from './model';
|
||||
import { MODULES_API_URL } from '~/config';
|
||||
|
||||
/**
|
||||
* 获取网站信息
|
||||
*/
|
||||
export async function getSiteInfo() {
|
||||
const res = await request.get<ApiResult<Website>>(
|
||||
MODULES_API_URL + '/cms/website/getSiteInfo'
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除缓存
|
||||
*/
|
||||
export async function removeSiteInfoCache(key?: string) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website/clearSiteInfo/' + key
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询网站
|
||||
*/
|
||||
export async function pageWebsite(params: WebsiteParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Website>>>(
|
||||
MODULES_API_URL + '/cms/website/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询网站列表
|
||||
*/
|
||||
export async function listWebsite(params?: WebsiteParam) {
|
||||
const res = await request.get<ApiResult<Website[]>>(
|
||||
MODULES_API_URL + '/cms/website',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加网站
|
||||
*/
|
||||
export async function addWebsite(data: Website) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改网站
|
||||
*/
|
||||
export async function updateWebsite(data: Website) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除网站
|
||||
*/
|
||||
export async function removeWebsite(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除网站
|
||||
*/
|
||||
export async function removeBatchWebsite(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateWebsiteStatus(websiteId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website/status',
|
||||
{
|
||||
websiteId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询网站
|
||||
*/
|
||||
export async function getWebsite(id: number) {
|
||||
const res = await request.get<ApiResult<Website>>(
|
||||
MODULES_API_URL + '/cms/website/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/website/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
79
api/cms/website/model/index.ts
Normal file
79
api/cms/website/model/index.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
import type { WebsiteField } from '@/api/cms/website/field/model';
|
||||
import type {Navigation} from "@/api/cms/navigation/model";
|
||||
import type {ArrangeCategory} from "@/api/cms/category/model";
|
||||
import type {Link} from "~/api/cms/link/model";
|
||||
import type {User} from "~/api/system/user/model";
|
||||
|
||||
/**
|
||||
* 菜单
|
||||
*/
|
||||
export interface Website {
|
||||
websiteId?: number;
|
||||
websiteName?: string;
|
||||
websiteCode?: string;
|
||||
websiteIcon?: string;
|
||||
websiteLogo?: string;
|
||||
websiteDarkLogo?: string;
|
||||
websiteType?: string;
|
||||
styles?: string;
|
||||
keywords?: string;
|
||||
address?: string;
|
||||
phone?: string;
|
||||
email?: string;
|
||||
version?: number;
|
||||
expirationTime?: string;
|
||||
templateId?: string;
|
||||
industryParent?: string;
|
||||
industryChild?: string;
|
||||
companyId?: number;
|
||||
prefix?: string;
|
||||
domain?: string;
|
||||
adminUrl?: 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;
|
||||
// 状态名称
|
||||
statusName?: string;
|
||||
// 状态图标
|
||||
statusIcon?: string;
|
||||
// 状态说明
|
||||
statusText?: string;
|
||||
// 关闭原因
|
||||
statusClose?: string;
|
||||
// 跳转按钮文本
|
||||
statusBtnText?: string;
|
||||
// 跳转地址
|
||||
statusUrl?: string;
|
||||
tenantId?: number;
|
||||
tenantName?: string;
|
||||
navigations?: Navigation[];
|
||||
categoryList?: ArrangeCategory[];
|
||||
links?: Link[];
|
||||
// 配置信息
|
||||
config?: any;
|
||||
topNavs?: Navigation[];
|
||||
bottomNavs?: Navigation[];
|
||||
loginUser?: User;
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单搜索参数
|
||||
*/
|
||||
export interface WebsiteParam {
|
||||
title?: string;
|
||||
path?: string;
|
||||
authority?: string;
|
||||
parentId?: number;
|
||||
domain?: string;
|
||||
}
|
||||
58
api/index.ts
Normal file
58
api/index.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* 接口统一返回结果
|
||||
*/
|
||||
export interface ApiResult<T> {
|
||||
// 状态码
|
||||
code: number;
|
||||
// 状态信息
|
||||
message?: string;
|
||||
// 返回数据
|
||||
data?: T;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询统一结果
|
||||
*/
|
||||
export interface PageResult<T> {
|
||||
// 返回数据
|
||||
list: T[];
|
||||
// 总数量
|
||||
count: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询基本参数
|
||||
*/
|
||||
export interface PageParam {
|
||||
// 第几页
|
||||
page?: number;
|
||||
// 每页多少条
|
||||
limit?: number;
|
||||
// 排序字段
|
||||
sort?: string;
|
||||
sortNum?: string;
|
||||
// 排序方式, asc升序, desc降序
|
||||
order?: string;
|
||||
// 租户ID
|
||||
tenantId?: number;
|
||||
// 企业ID
|
||||
companyId?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
merchantName?: string;
|
||||
categoryIds?: any;
|
||||
// 商品分类
|
||||
categoryId?: number;
|
||||
categoryName?: string;
|
||||
// 搜素关键词
|
||||
keywords?: string;
|
||||
// 起始时间
|
||||
createTimeStart?: number;
|
||||
// 结束时间
|
||||
createTimeEnd?: number;
|
||||
timeStart?: number;
|
||||
timeEnd?: number;
|
||||
isExpireTime?: number;
|
||||
showSoldStatus?: boolean;
|
||||
dateTime?: string;
|
||||
}
|
||||
1
api/json/china-provinces.geo.json
Normal file
1
api/json/china-provinces.geo.json
Normal file
File diff suppressed because one or more lines are too long
1
api/json/industry-data.json
Normal file
1
api/json/industry-data.json
Normal file
File diff suppressed because one or more lines are too long
1
api/json/regions-data.json
Normal file
1
api/json/regions-data.json
Normal file
File diff suppressed because one or more lines are too long
84
api/layout/index.ts
Normal file
84
api/layout/index.ts
Normal file
@@ -0,0 +1,84 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { User } from '@/api/system/user/model';
|
||||
import type { UpdatePasswordParam } from './model';
|
||||
import { MODULES_API_URL, SERVER_API_URL } from '~/config';
|
||||
import type {Website} from "~/api/cms/website/model";
|
||||
|
||||
/**
|
||||
* 获取网站信息
|
||||
*/
|
||||
export async function getSiteInfo() {
|
||||
const res = await request.get<ApiResult<Website>>(
|
||||
MODULES_API_URL + '/cms/website/getSiteInfo'
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前登录的用户信息、菜单、权限、角色
|
||||
*/
|
||||
export async function getUserInfo(): Promise<User> {
|
||||
const res = await request.get<ApiResult<User>>(SERVER_API_URL + '/auth/user');
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取服务器时间(实时)
|
||||
* @return
|
||||
*/
|
||||
export async function getServerTime() {
|
||||
const res = await request.get<ApiResult<any>>(
|
||||
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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取未来7天的日期
|
||||
* @return
|
||||
*/
|
||||
export async function getNext7day() {
|
||||
const res = await request.get<ApiResult<any>>(
|
||||
MODULES_API_URL + '/cms/website/getNext7day'
|
||||
);
|
||||
console.log('res.data.code: ', res.data.code);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 向子模块传递token
|
||||
* @param url
|
||||
*/
|
||||
export async function transferToken(url: string): Promise<string> {
|
||||
const res = await request.get<ApiResult<unknown>>(url);
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改当前登录的用户密码
|
||||
*/
|
||||
export async function updatePassword(
|
||||
data: UpdatePasswordParam
|
||||
): Promise<string> {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/auth/password',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message ?? '修改成功';
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
26
api/layout/model/index.ts
Normal file
26
api/layout/model/index.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
/**
|
||||
* 首页布局样式
|
||||
*/
|
||||
export interface Layout {
|
||||
// 内容区域的宽度
|
||||
width?: string;
|
||||
// 文字颜色
|
||||
color?: string;
|
||||
// 高亮颜色
|
||||
hover?: string;
|
||||
// 背景颜色
|
||||
backgroundColor?: string;
|
||||
headerStyle?: any;
|
||||
siteNameStyle?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码参数
|
||||
*/
|
||||
export interface UpdatePasswordParam {
|
||||
// 新密码
|
||||
password: string;
|
||||
// 原始密码
|
||||
oldPassword: string;
|
||||
}
|
||||
126
api/oa/app/field/index.ts
Normal file
126
api/oa/app/field/index.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { AppField, AppFieldParam } from '@/api/oa/app/field/model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询项目参数
|
||||
*/
|
||||
export async function pageAppField(params: AppFieldParam) {
|
||||
const res = await request.get<ApiResult<PageResult<AppField>>>(
|
||||
MODULES_API_URL + '/oa/app-field/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目参数列表
|
||||
*/
|
||||
export async function listAppField(params?: AppFieldParam) {
|
||||
const res = await request.get<ApiResult<AppField[]>>(
|
||||
MODULES_API_URL + '/oa/app-field',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询项目参数
|
||||
*/
|
||||
export async function getAppField(id: number) {
|
||||
const res = await request.get<ApiResult<AppField>>(
|
||||
MODULES_API_URL + '/oa/app-field/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加项目参数
|
||||
*/
|
||||
export async function addAppField(data: AppField) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目参数
|
||||
*/
|
||||
export async function updateAppField(data: AppField) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目参数
|
||||
*/
|
||||
export async function removeAppField(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-field/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除项目参数
|
||||
*/
|
||||
export async function removeBatchAppField(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-field/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-field/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
24
api/oa/app/field/model/index.ts
Normal file
24
api/oa/app/field/model/index.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 项目参数
|
||||
*/
|
||||
export interface AppField {
|
||||
id?: number;
|
||||
name?: string;
|
||||
comments?: string;
|
||||
userId?: number;
|
||||
appId?: number;
|
||||
status?: any;
|
||||
sortNumber?: any;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目参数搜索条件
|
||||
*/
|
||||
export interface AppFieldParam extends PageParam {
|
||||
id?: number;
|
||||
userId?: number;
|
||||
appId?: number;
|
||||
}
|
||||
190
api/oa/app/index.ts
Normal file
190
api/oa/app/index.ts
Normal file
@@ -0,0 +1,190 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { App, AppParam } from './model/index';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
export async function getCount() {
|
||||
const res = await request.get(MODULES_API_URL + '/oa/app/data');
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询应用
|
||||
*/
|
||||
export async function pageApp(params: AppParam) {
|
||||
const res = await request.get<ApiResult<PageResult<App>>>(
|
||||
MODULES_API_URL + '/oa/app/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应用列表
|
||||
*/
|
||||
export async function listApp(params?: AppParam) {
|
||||
const res = await request.get<ApiResult<App[]>>(MODULES_API_URL + '/oa/app', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询应用
|
||||
*/
|
||||
export async function getApp(id: number) {
|
||||
const res = await request.get<ApiResult<App>>(
|
||||
MODULES_API_URL + '/oa/app/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加应用
|
||||
*/
|
||||
export async function addApp(data: App) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用
|
||||
*/
|
||||
export async function updateApp(data: App) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用
|
||||
*/
|
||||
export async function removeApp(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除应用
|
||||
*/
|
||||
export async function removeBatchApp(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function getAppSecret(data: App) {
|
||||
const res = await request.post<ApiResult<App>>(
|
||||
MODULES_API_URL + '/open/app/getAppSecret',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function updateAppSecret(data: App) {
|
||||
const res = await request.post<ApiResult<App>>(
|
||||
MODULES_API_URL + '/oa/app/updateAppSecret',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
// 添加菜单
|
||||
export async function saveMenu(data: App) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app/saveMenu',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
// 添加菜单按钮
|
||||
export async function saveAuthority(data: any[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app/saveAuthority',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我的项目信息
|
||||
*/
|
||||
export async function getMyApp() {
|
||||
const res = await request.get<ApiResult<App>>(
|
||||
MODULES_API_URL + '/oa/app/getMyApp'
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
166
api/oa/app/model/index.ts
Normal file
166
api/oa/app/model/index.ts
Normal file
@@ -0,0 +1,166 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import { AppUser } from '@/api/oa/app/user/model';
|
||||
import { AppField } from '@/api/oa/app/field/model';
|
||||
|
||||
/**
|
||||
* 应用
|
||||
*/
|
||||
export interface App {
|
||||
// 应用id
|
||||
appId?: number;
|
||||
// 应用秘钥
|
||||
appSecret?: string;
|
||||
// 英文名称
|
||||
enName?: string;
|
||||
// 应用名称
|
||||
appName?: string;
|
||||
// 上级id, 0是顶级
|
||||
parentId?: number;
|
||||
// 应用编号
|
||||
appCode?: string;
|
||||
// 应用图标
|
||||
appIcon?: string;
|
||||
appQrcode?: string;
|
||||
// 应用截图
|
||||
images?: string;
|
||||
// 应用类型
|
||||
appType?: string;
|
||||
appTypeMultiple?: string[];
|
||||
// 菜单类型
|
||||
menuType?: number;
|
||||
// 应用地址
|
||||
appUrl?: string;
|
||||
// 后台管理地址
|
||||
adminUrl?: string;
|
||||
// 原型图地址
|
||||
prototypeUrl?: string;
|
||||
// 下载地址
|
||||
downUrl?: string;
|
||||
// 服务器接口地址
|
||||
serverUrl?: string;
|
||||
// 模块接口地址
|
||||
modulesUrl?: string;
|
||||
// 回调地址
|
||||
callbackUrl?: string;
|
||||
// 腾讯文档地址
|
||||
gitUrl?: string;
|
||||
docsUrl?: string;
|
||||
ipAddress?: string;
|
||||
fileUrl?: string;
|
||||
// 应用包名
|
||||
packageName?: string;
|
||||
// 点击次数
|
||||
clicks?: string;
|
||||
// 安装次数
|
||||
installs?: string;
|
||||
// 项目介绍
|
||||
content?: string;
|
||||
// 开发者(个人)
|
||||
developer?: string;
|
||||
director?: string;
|
||||
projectDirector?: string;
|
||||
salesman?: string;
|
||||
// 续费金额
|
||||
renewMoney?: string;
|
||||
// 软件定价
|
||||
price?: number;
|
||||
// 评分
|
||||
score?: string;
|
||||
// 星级
|
||||
star?: string;
|
||||
// 菜单组件地址
|
||||
component?: string;
|
||||
// 菜单路由地址
|
||||
path?: string;
|
||||
// 权限标识
|
||||
authority?: string;
|
||||
// 打开位置
|
||||
target?: string;
|
||||
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)
|
||||
hide?: number;
|
||||
// 菜单侧栏选中的path
|
||||
active?: string;
|
||||
// 其它路由元信息
|
||||
meta?: string;
|
||||
// 版本
|
||||
edition?: string;
|
||||
// 版本号
|
||||
version?: string;
|
||||
// 是否已安装
|
||||
isUse?: number;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: any;
|
||||
tenantName?: string;
|
||||
companyId?: number;
|
||||
companyName?: string;
|
||||
// 租户编号
|
||||
tenantCode?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 过期时间
|
||||
expirationTime?: string;
|
||||
// 应用状态
|
||||
appStatus?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 发布者
|
||||
userId?: any;
|
||||
// 发布者昵称
|
||||
nickname?: string;
|
||||
// 子菜单
|
||||
children?: App[];
|
||||
// 权限树回显选中状态, 0未选中, 1选中
|
||||
checked?: boolean;
|
||||
//
|
||||
key?: number;
|
||||
//
|
||||
value?: number;
|
||||
//
|
||||
parentIds?: number[];
|
||||
//
|
||||
openType?: number;
|
||||
//
|
||||
search?: any;
|
||||
// 成员管理
|
||||
users?: AppUser[];
|
||||
fields?: AppField[];
|
||||
// 项目需求
|
||||
requirement?: string;
|
||||
phone?: string;
|
||||
file1?: string;
|
||||
file2?: string;
|
||||
file3?: string;
|
||||
showCase?: boolean;
|
||||
showIndex?: boolean;
|
||||
recommend?: boolean;
|
||||
categoryName?: string;
|
||||
title?: 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;
|
||||
showCase?: boolean;
|
||||
showIndex?: boolean;
|
||||
showExpiration?: boolean;
|
||||
keywords?: any;
|
||||
sceneType?: string;
|
||||
}
|
||||
126
api/oa/app/renew/index.ts
Normal file
126
api/oa/app/renew/index.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { AppRenew, AppRenewParam } from '@/api/oa/app/renew/model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询开发成员
|
||||
*/
|
||||
export async function pageAppRenew(params: AppRenewParam) {
|
||||
const res = await request.get<ApiResult<PageResult<AppRenew>>>(
|
||||
MODULES_API_URL + '/oa/app-renew/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询开发成员列表
|
||||
*/
|
||||
export async function listAppRenew(params?: AppRenewParam) {
|
||||
const res = await request.get<ApiResult<AppRenew[]>>(
|
||||
MODULES_API_URL + '/oa/app-renew',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询开发成员
|
||||
*/
|
||||
export async function getAppRenew(id: number) {
|
||||
const res = await request.get<ApiResult<AppRenew>>(
|
||||
MODULES_API_URL + '/oa/app-renew/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加开发成员
|
||||
*/
|
||||
export async function addAppRenew(data: AppRenew) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-renew',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改开发成员
|
||||
*/
|
||||
export async function updateAppRenew(data: AppRenew) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-renew',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除开发成员
|
||||
*/
|
||||
export async function removeAppRenew(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-renew/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除开发成员
|
||||
*/
|
||||
export async function removeBatchAppRenew(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-renew/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-renew/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
40
api/oa/app/renew/model/index.ts
Normal file
40
api/oa/app/renew/model/index.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 开发成员
|
||||
*/
|
||||
export interface AppRenew {
|
||||
appRenewId?: number;
|
||||
money?: any;
|
||||
comments?: string;
|
||||
startTime?: any;
|
||||
endTime?: any;
|
||||
userId?: number;
|
||||
nickname?: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
mobile?: string;
|
||||
appId?: number;
|
||||
companyId?: number;
|
||||
status?: any;
|
||||
images?: string;
|
||||
files?: any;
|
||||
createTime?: string;
|
||||
editStatus?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开发成员搜索条件
|
||||
*/
|
||||
export interface AppRenewParam extends PageParam {
|
||||
userId?: number;
|
||||
appId?: number;
|
||||
}
|
||||
|
||||
export interface UserItem {
|
||||
key: string;
|
||||
isEdit?: boolean;
|
||||
number?: string;
|
||||
name?: string;
|
||||
department?: string;
|
||||
}
|
||||
106
api/oa/app/url/index.ts
Normal file
106
api/oa/app/url/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { AppUrl, AppUrlParam } from '@/api/oa/app/url/model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询项目域名
|
||||
*/
|
||||
export async function pageAppUrl(params: AppUrlParam) {
|
||||
const res = await request.get<ApiResult<PageResult<AppUrl>>>(
|
||||
MODULES_API_URL + '/oa/app-url/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目域名列表
|
||||
*/
|
||||
export async function listAppUrl(params?: AppUrlParam) {
|
||||
const res = await request.get<ApiResult<AppUrl[]>>(
|
||||
MODULES_API_URL + '/oa/app-url',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询项目域名
|
||||
*/
|
||||
export async function getAppUrl(id: number) {
|
||||
const res = await request.get<ApiResult<AppUrl>>(
|
||||
MODULES_API_URL + '/oa/app-url/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加项目域名
|
||||
*/
|
||||
export async function addAppUrl(data: AppUrl) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-url',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目域名
|
||||
*/
|
||||
export async function updateAppUrl(data: AppUrl) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-url',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目域名
|
||||
*/
|
||||
export async function removeAppUrl(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-url/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除项目域名
|
||||
*/
|
||||
export async function removeBatchAppUrl(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-url/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
26
api/oa/app/url/model/index.ts
Normal file
26
api/oa/app/url/model/index.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 项目域名
|
||||
*/
|
||||
export interface AppUrl {
|
||||
appUrlId?: number;
|
||||
name?: string;
|
||||
domain?: string;
|
||||
account?: string;
|
||||
password?: string;
|
||||
comments?: string;
|
||||
appId?: number;
|
||||
status?: any;
|
||||
sortNumber?: any;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目域名搜索条件
|
||||
*/
|
||||
export interface AppUrlParam extends PageParam {
|
||||
id?: number;
|
||||
userId?: number;
|
||||
appId?: number;
|
||||
}
|
||||
126
api/oa/app/user/index.ts
Normal file
126
api/oa/app/user/index.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { AppUser, AppUserParam } from '@/api/oa/app/user/model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询开发成员
|
||||
*/
|
||||
export async function pageAppUser(params: AppUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<AppUser>>>(
|
||||
MODULES_API_URL + '/oa/app-user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询开发成员列表
|
||||
*/
|
||||
export async function listAppUser(params?: AppUserParam) {
|
||||
const res = await request.get<ApiResult<AppUser[]>>(
|
||||
MODULES_API_URL + '/oa/app-user',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询开发成员
|
||||
*/
|
||||
export async function getAppUser(id: number) {
|
||||
const res = await request.get<ApiResult<AppUser>>(
|
||||
MODULES_API_URL + '/oa/app-user/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加开发成员
|
||||
*/
|
||||
export async function addAppUser(data: AppUser) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改开发成员
|
||||
*/
|
||||
export async function updateAppUser(data: AppUser) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除开发成员
|
||||
*/
|
||||
export async function removeAppUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-user/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除开发成员
|
||||
*/
|
||||
export async function removeBatchAppUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-user/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/app-user/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
37
api/oa/app/user/model/index.ts
Normal file
37
api/oa/app/user/model/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 开发成员
|
||||
*/
|
||||
export interface AppUser {
|
||||
// 开发成员id
|
||||
appUserId?: number;
|
||||
role?: number;
|
||||
userId?: number;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
avatar?: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
mobile?: string;
|
||||
appId?: number;
|
||||
status?: string;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开发成员搜索条件
|
||||
*/
|
||||
export interface AppUserParam extends PageParam {
|
||||
userId?: number;
|
||||
appId?: number;
|
||||
role?: number;
|
||||
}
|
||||
|
||||
export interface UserItem {
|
||||
key: string;
|
||||
isEdit?: boolean;
|
||||
number?: string;
|
||||
name?: string;
|
||||
department?: string;
|
||||
}
|
||||
18
api/oa/apply/index.ts
Normal file
18
api/oa/apply/index.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { Customer } from './model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 申请免费体验
|
||||
*/
|
||||
export async function apply(data: Customer) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/customer-apply',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
43
api/oa/apply/model/index.ts
Normal file
43
api/oa/apply/model/index.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 客户
|
||||
*/
|
||||
export interface Customer {
|
||||
// 客户id
|
||||
customerId?: number;
|
||||
// 客户类型
|
||||
customerType?: string;
|
||||
// 客户标识
|
||||
customerCode: string;
|
||||
// 客户名称
|
||||
customerName?: string;
|
||||
// 客户头像
|
||||
customerAvatar?: string;
|
||||
// 座机电话
|
||||
customerPhone?: string;
|
||||
// 手机号码
|
||||
customerMobile?: string;
|
||||
// 联系人
|
||||
customerContacts?: string;
|
||||
// 联系地址
|
||||
customerAddress?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 状态
|
||||
status?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户搜索条件
|
||||
*/
|
||||
export interface CustomerParam extends PageParam {
|
||||
customerName?: string;
|
||||
customerCode?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
134
api/oa/assets/index.ts
Normal file
134
api/oa/assets/index.ts
Normal file
@@ -0,0 +1,134 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Assets, AssetsParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
export async function getCount() {
|
||||
const res = await request.get(MODULES_API_URL + '/oa/assets/data');
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询资产
|
||||
*/
|
||||
export async function pageAssets(params: AssetsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Assets>>>(
|
||||
MODULES_API_URL + '/oa/assets/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询资产列表
|
||||
*/
|
||||
export async function listAssets(params?: AssetsParam) {
|
||||
const res = await request.get<ApiResult<Assets[]>>(
|
||||
MODULES_API_URL + '/oa/assets',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询服务器
|
||||
*/
|
||||
export async function getAssets(id: number) {
|
||||
const res = await request.get<ApiResult<Assets>>(
|
||||
MODULES_API_URL + '/oa/assets/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加资产
|
||||
*/
|
||||
export async function addAssets(data: Assets) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/assets',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改资产
|
||||
*/
|
||||
export async function updateAssets(data: Assets) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/assets',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资产
|
||||
*/
|
||||
export async function removeAssets(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/assets/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除资产
|
||||
*/
|
||||
export async function removeBatchAssets(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/assets/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/assets/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
89
api/oa/assets/model/index.ts
Normal file
89
api/oa/assets/model/index.ts
Normal file
@@ -0,0 +1,89 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import type { User } from '@/api/system/user/model';
|
||||
import {AssetsUser} from "@/api/oa/assets/user/model";
|
||||
|
||||
/**
|
||||
* 资产
|
||||
*/
|
||||
export interface Assets {
|
||||
// 资产id
|
||||
assetsId?: number;
|
||||
// 资产类型
|
||||
type?: string;
|
||||
// 资产标识
|
||||
code: string;
|
||||
// 资产名称
|
||||
name?: string;
|
||||
//
|
||||
account?: string;
|
||||
//
|
||||
password?: string;
|
||||
//
|
||||
panel?: string;
|
||||
//
|
||||
panelAccount?: string;
|
||||
//
|
||||
panelPassword?: string;
|
||||
//
|
||||
configuration?: any;
|
||||
root?: string;
|
||||
//
|
||||
sortNumber?: number;
|
||||
financeAmount?: any;
|
||||
financeYears?: any;
|
||||
financeRenew?: any;
|
||||
financeCustomerName?: string;
|
||||
financeCustomerContact?: string;
|
||||
financeCustomerPhone?: string;
|
||||
//
|
||||
brandAccount?: string;
|
||||
brandPassword?: string;
|
||||
btSign?: string;
|
||||
openPort?: any;
|
||||
comments?: string;
|
||||
// 所属客户
|
||||
customerId?: number;
|
||||
customerName?: string;
|
||||
// 品牌
|
||||
brand?: string;
|
||||
// 购买时间
|
||||
startTime?: string;
|
||||
// 到期时间
|
||||
endTime?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 状态
|
||||
status?: string;
|
||||
userId?: number;
|
||||
companyId?: number;
|
||||
companyName?: string;
|
||||
nickname?: string;
|
||||
// 可见性类型
|
||||
visibility?: string;
|
||||
// 可见用户ID
|
||||
userList?: User[];
|
||||
systemTotal?: Object;
|
||||
diskInfo?: Object;
|
||||
netWork?: Object;
|
||||
sites?: Object;
|
||||
users?: AssetsUser[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 资产搜索条件
|
||||
*/
|
||||
export interface AssetsParam extends PageParam {
|
||||
assetsId?: number;
|
||||
name?: string;
|
||||
code?: string;
|
||||
isExpire?: string;
|
||||
status?: string;
|
||||
brand?: string;
|
||||
customerId?: string;
|
||||
companyId?: number;
|
||||
companyName?: string;
|
||||
userId?: number;
|
||||
showExpiration?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
129
api/oa/assets/user/index.ts
Normal file
129
api/oa/assets/user/index.ts
Normal file
@@ -0,0 +1,129 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
AssetsUser,
|
||||
AssetsUserParam
|
||||
} from '@/api/oa/assets/user/model/index';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询开发成员
|
||||
*/
|
||||
export async function pageAssetsUser(params: AssetsUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<AssetsUser>>>(
|
||||
MODULES_API_URL + '/oa/assets-user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询开发成员列表
|
||||
*/
|
||||
export async function listAssetsUser(params?: AssetsUserParam) {
|
||||
const res = await request.get<ApiResult<AssetsUser[]>>(
|
||||
MODULES_API_URL + '/oa/assets-user',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询开发成员
|
||||
*/
|
||||
export async function getAssetsUser(id: number) {
|
||||
const res = await request.get<ApiResult<AssetsUser>>(
|
||||
MODULES_API_URL + '/oa/assets-user/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加开发成员
|
||||
*/
|
||||
export async function addAssetsUser(data: AssetsUser) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/assets-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改开发成员
|
||||
*/
|
||||
export async function updateAssetsUser(data: AssetsUser) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/assets-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除开发成员
|
||||
*/
|
||||
export async function removeAssetsUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/assets-user/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除开发成员
|
||||
*/
|
||||
export async function removeBatchAssetsUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/assets-user/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/assets-user/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
35
api/oa/assets/user/model/index.ts
Normal file
35
api/oa/assets/user/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 开发成员
|
||||
*/
|
||||
export interface AssetsUser {
|
||||
// 开发成员id
|
||||
id?: number;
|
||||
role?: number;
|
||||
userId?: number;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
avatar?: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
assetsId?: number;
|
||||
status?: string;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开发成员搜索条件
|
||||
*/
|
||||
export interface AssetsUserParam extends PageParam {
|
||||
userId?: number;
|
||||
assetsId?: number;
|
||||
}
|
||||
|
||||
export interface UserItem {
|
||||
key: string;
|
||||
isEdit?: boolean;
|
||||
number?: string;
|
||||
name?: string;
|
||||
department?: string;
|
||||
}
|
||||
31
api/oa/chatgpt/index.ts
Normal file
31
api/oa/chatgpt/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import { ChatParam } from '@/api/oa/chatgpt/model';
|
||||
import {MODULES_API_URL} from "@/config/setting";
|
||||
|
||||
/**
|
||||
* 发送
|
||||
*/
|
||||
export async function send(data: ChatParam) {
|
||||
const res = await request.post<ApiResult<unknown>>(MODULES_API_URL + '/open/chat/send', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求openAI
|
||||
* /open/chat/chat
|
||||
* 'https://chatgpt.websoft.top/api/open/chat/chat',
|
||||
*/
|
||||
export async function chat(data: ChatParam) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'https://chatgpt.websoft.top/api/open/chat/chat',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
17
api/oa/chatgpt/model/index.ts
Normal file
17
api/oa/chatgpt/model/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
export interface Chat {
|
||||
noticeId?: number;
|
||||
content?: any;
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务搜索条件
|
||||
*/
|
||||
export interface ChatParam {
|
||||
tenantId?: number;
|
||||
content?: string;
|
||||
noticeId?: number;
|
||||
}
|
||||
140
api/oa/customer/index.ts
Normal file
140
api/oa/customer/index.ts
Normal file
@@ -0,0 +1,140 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Customer, CustomerParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询客户
|
||||
*/
|
||||
export async function pageCustomer(params: CustomerParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Customer>>>(
|
||||
MODULES_API_URL + '/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[]>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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>>(
|
||||
MODULES_API_URL + '/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
api/oa/customer/model/index.ts
Normal file
67
api/oa/customer/model/index.ts
Normal file
@@ -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;
|
||||
}
|
||||
113
api/oa/link/index.ts
Normal file
113
api/oa/link/index.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Link, LinkParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询链接
|
||||
*/
|
||||
export async function pageLink(params: LinkParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Link>>>(
|
||||
MODULES_API_URL + '/oa/link/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询链接列表
|
||||
*/
|
||||
export async function listLink(params?: LinkParam) {
|
||||
const res = await request.get<ApiResult<Link[]>>(
|
||||
MODULES_API_URL + '/oa/link',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加链接
|
||||
*/
|
||||
export async function addLink(data: Link) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/link',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改链接
|
||||
*/
|
||||
export async function updateLink(data: Link) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/link',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除链接
|
||||
*/
|
||||
export async function removeLink(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/link/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除链接
|
||||
*/
|
||||
export async function removeBatchLink(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/link/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/link/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
29
api/oa/link/model/index.ts
Normal file
29
api/oa/link/model/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
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
api/oa/notice/index.ts
Normal file
111
api/oa/notice/index.ts
Normal file
@@ -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));
|
||||
}
|
||||
40
api/oa/notice/model/index.ts
Normal file
40
api/oa/notice/model/index.ts
Normal file
@@ -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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
106
api/oa/oaAppField/index.ts
Normal file
106
api/oa/oaAppField/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OaAppField, OaAppFieldParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询应用参数
|
||||
*/
|
||||
export async function pageOaAppField(params: OaAppFieldParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OaAppField>>>(
|
||||
MODULES_API_URL + '/oa/oa-app-field/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应用参数列表
|
||||
*/
|
||||
export async function listOaAppField(params?: OaAppFieldParam) {
|
||||
const res = await request.get<ApiResult<OaAppField[]>>(
|
||||
MODULES_API_URL + '/oa/oa-app-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 addOaAppField(data: OaAppField) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-app-field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用参数
|
||||
*/
|
||||
export async function updateOaAppField(data: OaAppField) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-app-field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用参数
|
||||
*/
|
||||
export async function removeOaAppField(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-app-field/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除应用参数
|
||||
*/
|
||||
export async function removeBatchOaAppField(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-app-field/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询应用参数
|
||||
*/
|
||||
export async function getOaAppField(id: number) {
|
||||
const res = await request.get<ApiResult<OaAppField>>(
|
||||
MODULES_API_URL + '/oa/oa-app-field/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
33
api/oa/oaAppField/model/index.ts
Normal file
33
api/oa/oaAppField/model/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 应用参数
|
||||
*/
|
||||
export interface OaAppField {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 应用ID
|
||||
appId?: number;
|
||||
// 名称
|
||||
name?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 状态, 0正常, 1删除
|
||||
status?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用参数搜索条件
|
||||
*/
|
||||
export interface OaAppFieldParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
api/oa/oaAppRenew/index.ts
Normal file
106
api/oa/oaAppRenew/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OaAppRenew, OaAppRenewParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询续费管理
|
||||
*/
|
||||
export async function pageOaAppRenew(params: OaAppRenewParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OaAppRenew>>>(
|
||||
MODULES_API_URL + '/oa/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 listOaAppRenew(params?: OaAppRenewParam) {
|
||||
const res = await request.get<ApiResult<OaAppRenew[]>>(
|
||||
MODULES_API_URL + '/oa/oa-app-renew',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加续费管理
|
||||
*/
|
||||
export async function addOaAppRenew(data: OaAppRenew) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-app-renew',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改续费管理
|
||||
*/
|
||||
export async function updateOaAppRenew(data: OaAppRenew) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-app-renew',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除续费管理
|
||||
*/
|
||||
export async function removeOaAppRenew(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-app-renew/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除续费管理
|
||||
*/
|
||||
export async function removeBatchOaAppRenew(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-app-renew/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询续费管理
|
||||
*/
|
||||
export async function getOaAppRenew(id: number) {
|
||||
const res = await request.get<ApiResult<OaAppRenew>>(
|
||||
MODULES_API_URL + '/oa/oa-app-renew/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
41
api/oa/oaAppRenew/model/index.ts
Normal file
41
api/oa/oaAppRenew/model/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 续费管理
|
||||
*/
|
||||
export interface OaAppRenew {
|
||||
// 自增ID
|
||||
appRenewId?: number;
|
||||
// 应用ID
|
||||
appId?: number;
|
||||
// 续费金额
|
||||
money?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 开始时间
|
||||
startTime?: string;
|
||||
// 到期时间
|
||||
endTime?: string;
|
||||
// 企业ID
|
||||
companyId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 付款凭证
|
||||
images?: string;
|
||||
// 用户姓名
|
||||
nickname?: string;
|
||||
// 状态, 0正常, 1待确认
|
||||
status?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 续费管理搜索条件
|
||||
*/
|
||||
export interface OaAppRenewParam extends PageParam {
|
||||
appRenewId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
api/oa/oaAppUrl/index.ts
Normal file
106
api/oa/oaAppUrl/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OaAppUrl, OaAppUrlParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询项目域名
|
||||
*/
|
||||
export async function pageOaAppUrl(params: OaAppUrlParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OaAppUrl>>>(
|
||||
MODULES_API_URL + '/oa/oa-app-url/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目域名列表
|
||||
*/
|
||||
export async function listOaAppUrl(params?: OaAppUrlParam) {
|
||||
const res = await request.get<ApiResult<OaAppUrl[]>>(
|
||||
MODULES_API_URL + '/oa/oa-app-url',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加项目域名
|
||||
*/
|
||||
export async function addOaAppUrl(data: OaAppUrl) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-app-url',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目域名
|
||||
*/
|
||||
export async function updateOaAppUrl(data: OaAppUrl) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-app-url',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目域名
|
||||
*/
|
||||
export async function removeOaAppUrl(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-app-url/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除项目域名
|
||||
*/
|
||||
export async function removeBatchOaAppUrl(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-app-url/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询项目域名
|
||||
*/
|
||||
export async function getOaAppUrl(id: number) {
|
||||
const res = await request.get<ApiResult<OaAppUrl>>(
|
||||
MODULES_API_URL + '/oa/oa-app-url/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
37
api/oa/oaAppUrl/model/index.ts
Normal file
37
api/oa/oaAppUrl/model/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 项目域名
|
||||
*/
|
||||
export interface OaAppUrl {
|
||||
// 自增ID
|
||||
appUrlId?: number;
|
||||
// 应用ID
|
||||
appId?: number;
|
||||
// 域名类型
|
||||
name?: string;
|
||||
// 域名
|
||||
domain?: string;
|
||||
// 账号
|
||||
account?: string;
|
||||
// 密码
|
||||
password?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0正常, 1待确认
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目域名搜索条件
|
||||
*/
|
||||
export interface OaAppUrlParam extends PageParam {
|
||||
appUrlId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
api/oa/oaAppUser/index.ts
Normal file
106
api/oa/oaAppUser/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OaAppUser, OaAppUserParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询应用成员
|
||||
*/
|
||||
export async function pageOaAppUser(params: OaAppUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OaAppUser>>>(
|
||||
MODULES_API_URL + '/oa/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 listOaAppUser(params?: OaAppUserParam) {
|
||||
const res = await request.get<ApiResult<OaAppUser[]>>(
|
||||
MODULES_API_URL + '/oa/oa-app-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 addOaAppUser(data: OaAppUser) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-app-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用成员
|
||||
*/
|
||||
export async function updateOaAppUser(data: OaAppUser) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-app-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用成员
|
||||
*/
|
||||
export async function removeOaAppUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-app-user/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除应用成员
|
||||
*/
|
||||
export async function removeBatchOaAppUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-app-user/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询应用成员
|
||||
*/
|
||||
export async function getOaAppUser(id: number) {
|
||||
const res = await request.get<ApiResult<OaAppUser>>(
|
||||
MODULES_API_URL + '/oa/oa-app-user/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
api/oa/oaAppUser/model/index.ts
Normal file
31
api/oa/oaAppUser/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 应用成员
|
||||
*/
|
||||
export interface OaAppUser {
|
||||
// 自增ID
|
||||
appUserId?: number;
|
||||
// 角色,10体验成员 20开发者成员 30管理员
|
||||
role?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 应用ID
|
||||
appId?: number;
|
||||
// 昵称
|
||||
nickname?: string;
|
||||
// 状态, 0正常, 1待确认
|
||||
status?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用成员搜索条件
|
||||
*/
|
||||
export interface OaAppUserParam extends PageParam {
|
||||
appUserId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
api/oa/oaAssets/index.ts
Normal file
106
api/oa/oaAssets/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OaAssets, OaAssetsParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询服务器资产记录表
|
||||
*/
|
||||
export async function pageOaAssets(params: OaAssetsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OaAssets>>>(
|
||||
MODULES_API_URL + '/oa/oa-assets/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询服务器资产记录表列表
|
||||
*/
|
||||
export async function listOaAssets(params?: OaAssetsParam) {
|
||||
const res = await request.get<ApiResult<OaAssets[]>>(
|
||||
MODULES_API_URL + '/oa/oa-assets',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加服务器资产记录表
|
||||
*/
|
||||
export async function addOaAssets(data: OaAssets) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-assets',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改服务器资产记录表
|
||||
*/
|
||||
export async function updateOaAssets(data: OaAssets) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-assets',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除服务器资产记录表
|
||||
*/
|
||||
export async function removeOaAssets(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-assets/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除服务器资产记录表
|
||||
*/
|
||||
export async function removeBatchOaAssets(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-assets/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询服务器资产记录表
|
||||
*/
|
||||
export async function getOaAssets(id: number) {
|
||||
const res = await request.get<ApiResult<OaAssets>>(
|
||||
MODULES_API_URL + '/oa/oa-assets/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
91
api/oa/oaAssets/model/index.ts
Normal file
91
api/oa/oaAssets/model/index.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 服务器资产记录表
|
||||
*/
|
||||
export interface OaAssets {
|
||||
// 资产ID
|
||||
assetsId?: number;
|
||||
// 资产名称
|
||||
name?: string;
|
||||
// 资产标识
|
||||
code?: string;
|
||||
// 资产类型
|
||||
type?: string;
|
||||
// 服务器厂商
|
||||
brand?: string;
|
||||
// 服务器配置
|
||||
configuration?: string;
|
||||
// 初始账号
|
||||
account?: string;
|
||||
// 初始密码
|
||||
password?: string;
|
||||
// (阿里云/腾讯云)登录账号
|
||||
brandAccount?: string;
|
||||
// (阿里云/腾讯云)登录密码
|
||||
brandPassword?: string;
|
||||
// 宝塔面板
|
||||
panel?: string;
|
||||
// 宝塔面板账号
|
||||
panelAccount?: string;
|
||||
// 宝塔面板密码
|
||||
panelPassword?: string;
|
||||
// 财务信息-合同金额
|
||||
financeAmount?: string;
|
||||
// 购买年限
|
||||
financeYears?: number;
|
||||
// 续费金额
|
||||
financeRenew?: string;
|
||||
// 客户名称
|
||||
financeCustomerName?: string;
|
||||
// 客户联系人
|
||||
financeCustomerContact?: string;
|
||||
// 客户联系电话
|
||||
financeCustomerPhone?: string;
|
||||
// 客户ID
|
||||
customerId?: number;
|
||||
// 客户名称
|
||||
customerName?: string;
|
||||
// 开放端口
|
||||
openPort?: string;
|
||||
// 详情内容
|
||||
content?: string;
|
||||
// 购买时间
|
||||
startTime?: string;
|
||||
// 到期时间
|
||||
endTime?: string;
|
||||
// 置顶状态
|
||||
isTop?: string;
|
||||
// 可见性(public,private,protected)
|
||||
visibility?: string;
|
||||
// 宝塔接口秘钥
|
||||
btSign?: string;
|
||||
// 文章排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 描述
|
||||
comments?: string;
|
||||
// 客户ID
|
||||
companyId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 机构id
|
||||
organizationId?: number;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: string;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务器资产记录表搜索条件
|
||||
*/
|
||||
export interface OaAssetsParam extends PageParam {
|
||||
assetsId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
api/oa/oaAssetsCode/index.ts
Normal file
106
api/oa/oaAssetsCode/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OaAssetsCode, OaAssetsCodeParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询代码仓库
|
||||
*/
|
||||
export async function pageOaAssetsCode(params: OaAssetsCodeParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OaAssetsCode>>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-code/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询代码仓库列表
|
||||
*/
|
||||
export async function listOaAssetsCode(params?: OaAssetsCodeParam) {
|
||||
const res = await request.get<ApiResult<OaAssetsCode[]>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-code',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加代码仓库
|
||||
*/
|
||||
export async function addOaAssetsCode(data: OaAssetsCode) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-code',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改代码仓库
|
||||
*/
|
||||
export async function updateOaAssetsCode(data: OaAssetsCode) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-code',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除代码仓库
|
||||
*/
|
||||
export async function removeOaAssetsCode(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-code/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除代码仓库
|
||||
*/
|
||||
export async function removeBatchOaAssetsCode(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-code/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询代码仓库
|
||||
*/
|
||||
export async function getOaAssetsCode(id: number) {
|
||||
const res = await request.get<ApiResult<OaAssetsCode>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-code/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
51
api/oa/oaAssetsCode/model/index.ts
Normal file
51
api/oa/oaAssetsCode/model/index.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 代码仓库
|
||||
*/
|
||||
export interface OaAssetsCode {
|
||||
// ID
|
||||
id?: number;
|
||||
// 名称
|
||||
name?: string;
|
||||
// 英文标识
|
||||
code?: string;
|
||||
// 仓库地址
|
||||
gitUrl?: string;
|
||||
// 仓库品牌
|
||||
brand?: string;
|
||||
// 价格
|
||||
price?: number;
|
||||
// 详情内容
|
||||
content?: string;
|
||||
// 购买时间
|
||||
startTime?: string;
|
||||
// 到期时间
|
||||
endTime?: string;
|
||||
// 置顶状态
|
||||
isTop?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 描述
|
||||
comments?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: string;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 代码仓库搜索条件
|
||||
*/
|
||||
export interface OaAssetsCodeParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
api/oa/oaAssetsDomain/index.ts
Normal file
106
api/oa/oaAssetsDomain/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OaAssetsDomain, OaAssetsDomainParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询域名管理记录表
|
||||
*/
|
||||
export async function pageOaAssetsDomain(params: OaAssetsDomainParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OaAssetsDomain>>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-domain/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询域名管理记录表列表
|
||||
*/
|
||||
export async function listOaAssetsDomain(params?: OaAssetsDomainParam) {
|
||||
const res = await request.get<ApiResult<OaAssetsDomain[]>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-domain',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加域名管理记录表
|
||||
*/
|
||||
export async function addOaAssetsDomain(data: OaAssetsDomain) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-domain',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改域名管理记录表
|
||||
*/
|
||||
export async function updateOaAssetsDomain(data: OaAssetsDomain) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-domain',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除域名管理记录表
|
||||
*/
|
||||
export async function removeOaAssetsDomain(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-domain/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除域名管理记录表
|
||||
*/
|
||||
export async function removeBatchOaAssetsDomain(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-domain/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询域名管理记录表
|
||||
*/
|
||||
export async function getOaAssetsDomain(id: number) {
|
||||
const res = await request.get<ApiResult<OaAssetsDomain>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-domain/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
55
api/oa/oaAssetsDomain/model/index.ts
Normal file
55
api/oa/oaAssetsDomain/model/index.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 域名管理记录表
|
||||
*/
|
||||
export interface OaAssetsDomain {
|
||||
// ID
|
||||
domainId?: number;
|
||||
// 域名
|
||||
name?: string;
|
||||
// 域名标识
|
||||
code?: string;
|
||||
// 注册厂商
|
||||
brand?: string;
|
||||
// 初始账号
|
||||
account?: string;
|
||||
// 初始密码
|
||||
password?: string;
|
||||
// 价格
|
||||
price?: number;
|
||||
// 详情内容
|
||||
content?: string;
|
||||
// ssl证书
|
||||
ssl?: string;
|
||||
// 购买时间
|
||||
startTime?: string;
|
||||
// 到期时间
|
||||
endTime?: string;
|
||||
// 置顶状态
|
||||
isTop?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 描述
|
||||
comments?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: string;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 域名管理记录表搜索条件
|
||||
*/
|
||||
export interface OaAssetsDomainParam extends PageParam {
|
||||
domainId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
api/oa/oaAssetsEmail/index.ts
Normal file
106
api/oa/oaAssetsEmail/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OaAssetsEmail, OaAssetsEmailParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询企业邮箱记录表
|
||||
*/
|
||||
export async function pageOaAssetsEmail(params: OaAssetsEmailParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OaAssetsEmail>>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-email/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询企业邮箱记录表列表
|
||||
*/
|
||||
export async function listOaAssetsEmail(params?: OaAssetsEmailParam) {
|
||||
const res = await request.get<ApiResult<OaAssetsEmail[]>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-email',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加企业邮箱记录表
|
||||
*/
|
||||
export async function addOaAssetsEmail(data: OaAssetsEmail) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-email',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改企业邮箱记录表
|
||||
*/
|
||||
export async function updateOaAssetsEmail(data: OaAssetsEmail) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-email',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除企业邮箱记录表
|
||||
*/
|
||||
export async function removeOaAssetsEmail(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-email/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除企业邮箱记录表
|
||||
*/
|
||||
export async function removeBatchOaAssetsEmail(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-email/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询企业邮箱记录表
|
||||
*/
|
||||
export async function getOaAssetsEmail(id: number) {
|
||||
const res = await request.get<ApiResult<OaAssetsEmail>>(
|
||||
MODULES_API_URL + '/oa/oa-assets-email/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
55
api/oa/oaAssetsEmail/model/index.ts
Normal file
55
api/oa/oaAssetsEmail/model/index.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 企业邮箱记录表
|
||||
*/
|
||||
export interface OaAssetsEmail {
|
||||
// ID
|
||||
emailId?: number;
|
||||
// 域名
|
||||
name?: string;
|
||||
// 域名标识
|
||||
code?: string;
|
||||
// 主机型号
|
||||
type?: string;
|
||||
// 品牌厂商
|
||||
brand?: string;
|
||||
// 初始账号
|
||||
system?: string;
|
||||
// 价格
|
||||
price?: number;
|
||||
// 详情内容
|
||||
content?: string;
|
||||
// ssl证书
|
||||
ssl?: string;
|
||||
// 购买时间
|
||||
startTime?: string;
|
||||
// 到期时间
|
||||
endTime?: string;
|
||||
// 置顶状态
|
||||
isTop?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 描述
|
||||
comments?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: string;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业邮箱记录表搜索条件
|
||||
*/
|
||||
export interface OaAssetsEmailParam extends PageParam {
|
||||
emailId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user