第一次提交
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
yudao-ui-admin CI / build (14.x) (push) Has been cancelled
yudao-ui-admin CI / build (16.x) (push) Has been cancelled
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
yudao-ui-admin CI / build (14.x) (push) Has been cancelled
yudao-ui-admin CI / build (16.x) (push) Has been cancelled
This commit is contained in:
57
yudao-ui/yudao-ui-admin-vue3-master/src/App.vue
Normal file
57
yudao-ui/yudao-ui-admin-vue3-master/src/App.vue
Normal file
@@ -0,0 +1,57 @@
|
||||
<script lang="ts" setup>
|
||||
import { isDark } from '@/utils/is'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import routerSearch from '@/components/RouterSearch/index.vue'
|
||||
|
||||
defineOptions({ name: 'APP' })
|
||||
|
||||
const { getPrefixCls } = useDesign()
|
||||
const prefixCls = getPrefixCls('app')
|
||||
const appStore = useAppStore()
|
||||
const currentSize = computed(() => appStore.getCurrentSize)
|
||||
const greyMode = computed(() => appStore.getGreyMode)
|
||||
const { wsCache } = useCache()
|
||||
|
||||
// 根据浏览器当前主题设置系统主题色
|
||||
const setDefaultTheme = () => {
|
||||
let isDarkTheme = wsCache.get(CACHE_KEY.IS_DARK)
|
||||
if (isDarkTheme === null) {
|
||||
isDarkTheme = isDark()
|
||||
}
|
||||
appStore.setIsDark(isDarkTheme)
|
||||
}
|
||||
setDefaultTheme()
|
||||
</script>
|
||||
<template>
|
||||
<ConfigGlobal :size="currentSize">
|
||||
<RouterView :class="greyMode ? `${prefixCls}-grey-mode` : ''" />
|
||||
<routerSearch />
|
||||
</ConfigGlobal>
|
||||
</template>
|
||||
<style lang="scss">
|
||||
$prefix-cls: #{$namespace}-app;
|
||||
|
||||
.size {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
@extend .size;
|
||||
|
||||
padding: 0 !important;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
|
||||
#app {
|
||||
@extend .size;
|
||||
}
|
||||
}
|
||||
|
||||
.#{$prefix-cls}-grey-mode {
|
||||
filter: grayscale(100%);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,65 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// AI 聊天对话 VO
|
||||
export interface ChatConversationVO {
|
||||
id: number // ID 编号
|
||||
userId: number // 用户编号
|
||||
title: string // 对话标题
|
||||
pinned: boolean // 是否置顶
|
||||
roleId: number // 角色编号
|
||||
modelId: number // 模型编号
|
||||
model: string // 模型标志
|
||||
temperature: number // 温度参数
|
||||
maxTokens: number // 单条回复的最大 Token 数量
|
||||
maxContexts: number // 上下文的最大 Message 数量
|
||||
createTime?: Date // 创建时间
|
||||
// 额外字段
|
||||
systemMessage?: string // 角色设定
|
||||
modelName?: string // 模型名字
|
||||
roleAvatar?: string // 角色头像
|
||||
modelMaxTokens?: string // 模型的单条回复的最大 Token 数量
|
||||
modelMaxContexts?: string // 模型的上下文的最大 Message 数量
|
||||
}
|
||||
|
||||
// AI 聊天对话 API
|
||||
export const ChatConversationApi = {
|
||||
// 获得【我的】聊天对话
|
||||
getChatConversationMy: async (id: number) => {
|
||||
return await request.get({ url: `/ai/chat/conversation/get-my?id=${id}` })
|
||||
},
|
||||
|
||||
// 新增【我的】聊天对话
|
||||
createChatConversationMy: async (data?: ChatConversationVO) => {
|
||||
return await request.post({ url: `/ai/chat/conversation/create-my`, data })
|
||||
},
|
||||
|
||||
// 更新【我的】聊天对话
|
||||
updateChatConversationMy: async (data: ChatConversationVO) => {
|
||||
return await request.put({ url: `/ai/chat/conversation/update-my`, data })
|
||||
},
|
||||
|
||||
// 删除【我的】聊天对话
|
||||
deleteChatConversationMy: async (id: string) => {
|
||||
return await request.delete({ url: `/ai/chat/conversation/delete-my?id=${id}` })
|
||||
},
|
||||
|
||||
// 删除【我的】所有对话,置顶除外
|
||||
deleteChatConversationMyByUnpinned: async () => {
|
||||
return await request.delete({ url: `/ai/chat/conversation/delete-by-unpinned` })
|
||||
},
|
||||
|
||||
// 获得【我的】聊天对话列表
|
||||
getChatConversationMyList: async () => {
|
||||
return await request.get({ url: `/ai/chat/conversation/my-list` })
|
||||
},
|
||||
|
||||
// 获得对话分页
|
||||
getChatConversationPage: async (params: any) => {
|
||||
return await request.get({ url: `/ai/chat/conversation/page`, params })
|
||||
},
|
||||
|
||||
// 管理员删除消息
|
||||
deleteChatConversationByAdmin: async (id: number) => {
|
||||
return await request.delete({ url: `/ai/chat/conversation/delete-by-admin?id=${id}` })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
import request from '@/config/axios'
|
||||
import { fetchEventSource } from '@microsoft/fetch-event-source'
|
||||
import { getAccessToken } from '@/utils/auth'
|
||||
import { config } from '@/config/axios/config'
|
||||
|
||||
// 聊天VO
|
||||
export interface ChatMessageVO {
|
||||
id: number // 编号
|
||||
conversationId: number // 对话编号
|
||||
type: string // 消息类型
|
||||
userId: string // 用户编号
|
||||
roleId: string // 角色编号
|
||||
model: number // 模型标志
|
||||
modelId: number // 模型编号
|
||||
content: string // 聊天内容
|
||||
reasoningContent?: string // 推理内容
|
||||
attachmentUrls?: string[] // 附件 URL 数组
|
||||
tokens: number // 消耗 Token 数量
|
||||
segmentIds?: number[] // 段落编号
|
||||
segments?: {
|
||||
id: number // 段落编号
|
||||
content: string // 段落内容
|
||||
documentId: number // 文档编号
|
||||
documentName: string // 文档名称
|
||||
}[]
|
||||
webSearchPages?: {
|
||||
name: string // 名称
|
||||
icon: string // 图标
|
||||
title: string // 标题
|
||||
url: string // URL
|
||||
snippet: string // 内容的简短描述
|
||||
summary: string // 内容的文本摘要
|
||||
}[]
|
||||
createTime: Date // 创建时间
|
||||
roleAvatar: string // 角色头像
|
||||
userAvatar: string // 用户头像
|
||||
}
|
||||
|
||||
// AI chat 聊天
|
||||
export const ChatMessageApi = {
|
||||
// 消息列表
|
||||
getChatMessageListByConversationId: async (conversationId: number | null) => {
|
||||
return await request.get({
|
||||
url: `/ai/chat/message/list-by-conversation-id?conversationId=${conversationId}`
|
||||
})
|
||||
},
|
||||
|
||||
// 发送 Stream 消息
|
||||
// 为什么不用 axios 呢?因为它不支持 SSE 调用
|
||||
sendChatMessageStream: async (
|
||||
conversationId: number,
|
||||
content: string,
|
||||
ctrl,
|
||||
enableContext: boolean,
|
||||
enableWebSearch: boolean,
|
||||
onMessage,
|
||||
onError,
|
||||
onClose,
|
||||
attachmentUrls?: string[]
|
||||
) => {
|
||||
const token = getAccessToken()
|
||||
return fetchEventSource(`${config.base_url}/ai/chat/message/send-stream`, {
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${token}`
|
||||
},
|
||||
openWhenHidden: true,
|
||||
body: JSON.stringify({
|
||||
conversationId,
|
||||
content,
|
||||
useContext: enableContext,
|
||||
useSearch: enableWebSearch,
|
||||
attachmentUrls: attachmentUrls || []
|
||||
}),
|
||||
onmessage: onMessage,
|
||||
onerror: onError,
|
||||
onclose: onClose,
|
||||
signal: ctrl.signal
|
||||
})
|
||||
},
|
||||
|
||||
// 删除消息
|
||||
deleteChatMessage: async (id: string) => {
|
||||
return await request.delete({ url: `/ai/chat/message/delete?id=${id}` })
|
||||
},
|
||||
|
||||
// 删除指定对话的消息
|
||||
deleteByConversationId: async (conversationId: number) => {
|
||||
return await request.delete({
|
||||
url: `/ai/chat/message/delete-by-conversation-id?conversationId=${conversationId}`
|
||||
})
|
||||
},
|
||||
|
||||
// 获得消息分页
|
||||
getChatMessagePage: async (params: any) => {
|
||||
return await request.get({ url: '/ai/chat/message/page', params })
|
||||
},
|
||||
|
||||
// 管理员删除消息
|
||||
deleteChatMessageByAdmin: async (id: number) => {
|
||||
return await request.delete({ url: `/ai/chat/message/delete-by-admin?id=${id}` })
|
||||
}
|
||||
}
|
||||
102
yudao-ui/yudao-ui-admin-vue3-master/src/api/ai/image/index.ts
Normal file
102
yudao-ui/yudao-ui-admin-vue3-master/src/api/ai/image/index.ts
Normal file
@@ -0,0 +1,102 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// AI 绘图 VO
|
||||
export interface ImageVO {
|
||||
id: number // 编号
|
||||
platform: string // 平台
|
||||
model: string // 模型
|
||||
prompt: string // 提示词
|
||||
width: number // 图片宽度
|
||||
height: number // 图片高度
|
||||
status: number // 状态
|
||||
publicStatus: boolean // 公开状态
|
||||
picUrl: string // 任务地址
|
||||
errorMessage: string // 错误信息
|
||||
options: any // 配置 Map<string, string>
|
||||
taskId: number // 任务编号
|
||||
buttons: ImageMidjourneyButtonsVO[] // mj 操作按钮
|
||||
createTime: Date // 创建时间
|
||||
finishTime: Date // 完成时间
|
||||
}
|
||||
|
||||
export interface ImageDrawReqVO {
|
||||
prompt: string // 提示词
|
||||
modelId: number // 模型
|
||||
style: string // 图像生成的风格
|
||||
width: string // 图片宽度
|
||||
height: string // 图片高度
|
||||
options: object // 绘制参数,Map<String, String>
|
||||
}
|
||||
|
||||
export interface ImageMidjourneyImagineReqVO {
|
||||
prompt: string // 提示词
|
||||
modelId: number // 模型
|
||||
base64Array: string[] // size不能为空
|
||||
width: string // 图片宽度
|
||||
height: string // 图片高度
|
||||
version: string // 版本
|
||||
}
|
||||
|
||||
export interface ImageMidjourneyActionVO {
|
||||
id: number // 图片编号
|
||||
customId: string // MJ::JOB::upsample::1::85a4b4c1-8835-46c5-a15c-aea34fad1862 动作标识
|
||||
}
|
||||
|
||||
export interface ImageMidjourneyButtonsVO {
|
||||
customId: string // MJ::JOB::upsample::1::85a4b4c1-8835-46c5-a15c-aea34fad1862 动作标识
|
||||
emoji: string // 图标 emoji
|
||||
label: string // Make Variations 文本
|
||||
style: number // 样式: 2(Primary)、3(Green)
|
||||
}
|
||||
|
||||
// AI 图片 API
|
||||
export const ImageApi = {
|
||||
// 获取【我的】绘图分页
|
||||
getImagePageMy: async (params: any) => {
|
||||
return await request.get({ url: `/ai/image/my-page`, params })
|
||||
},
|
||||
// 获取【我的】绘图记录
|
||||
getImageMy: async (id: number) => {
|
||||
return await request.get({ url: `/ai/image/get-my?id=${id}` })
|
||||
},
|
||||
// 获取【我的】绘图记录列表
|
||||
getImageListMyByIds: async (ids: number[]) => {
|
||||
return await request.get({ url: `/ai/image/my-list-by-ids`, params: { ids: ids.join(',') } })
|
||||
},
|
||||
// 生成图片
|
||||
drawImage: async (data: ImageDrawReqVO) => {
|
||||
return await request.post({ url: `/ai/image/draw`, data })
|
||||
},
|
||||
// 删除【我的】绘画记录
|
||||
deleteImageMy: async (id: number) => {
|
||||
return await request.delete({ url: `/ai/image/delete-my?id=${id}` })
|
||||
},
|
||||
|
||||
// ================ midjourney 专属 ================
|
||||
|
||||
// 【Midjourney】生成图片
|
||||
midjourneyImagine: async (data: ImageMidjourneyImagineReqVO) => {
|
||||
return await request.post({ url: `/ai/image/midjourney/imagine`, data })
|
||||
},
|
||||
// 【Midjourney】Action 操作(二次生成图片)
|
||||
midjourneyAction: async (data: ImageMidjourneyActionVO) => {
|
||||
return await request.post({ url: `/ai/image/midjourney/action`, data })
|
||||
},
|
||||
|
||||
// ================ 绘图管理 ================
|
||||
|
||||
// 查询绘画分页
|
||||
getImagePage: async (params: any) => {
|
||||
return await request.get({ url: `/ai/image/page`, params })
|
||||
},
|
||||
|
||||
// 更新绘画发布状态
|
||||
updateImage: async (data: any) => {
|
||||
return await request.put({ url: '/ai/image/update', data })
|
||||
},
|
||||
|
||||
// 删除绘画
|
||||
deleteImage: async (id: number) => {
|
||||
return await request.delete({ url: `/ai/image/delete?id=` + id })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// AI 知识库文档 VO
|
||||
export interface KnowledgeDocumentVO {
|
||||
id: number // 编号
|
||||
knowledgeId: number // 知识库编号
|
||||
name: string // 文档名称
|
||||
contentLength: number // 字符数
|
||||
tokens: number // token 数
|
||||
segmentMaxTokens: number // 分片最大 token 数
|
||||
retrievalCount: number // 召回次数
|
||||
status: number // 是否启用
|
||||
}
|
||||
|
||||
// AI 知识库文档 API
|
||||
export const KnowledgeDocumentApi = {
|
||||
// 查询知识库文档分页
|
||||
getKnowledgeDocumentPage: async (params: any) => {
|
||||
return await request.get({ url: `/ai/knowledge/document/page`, params })
|
||||
},
|
||||
|
||||
// 查询知识库文档详情
|
||||
getKnowledgeDocument: async (id: number) => {
|
||||
return await request.get({ url: `/ai/knowledge/document/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增知识库文档(单个)
|
||||
createKnowledgeDocument: async (data: any) => {
|
||||
return await request.post({ url: `/ai/knowledge/document/create`, data })
|
||||
},
|
||||
|
||||
// 新增知识库文档(多个)
|
||||
createKnowledgeDocumentList: async (data: any) => {
|
||||
return await request.post({ url: `/ai/knowledge/document/create-list`, data })
|
||||
},
|
||||
|
||||
// 修改知识库文档
|
||||
updateKnowledgeDocument: async (data: any) => {
|
||||
return await request.put({ url: `/ai/knowledge/document/update`, data })
|
||||
},
|
||||
|
||||
// 修改知识库文档状态
|
||||
updateKnowledgeDocumentStatus: async (data: any) => {
|
||||
return await request.put({
|
||||
url: `/ai/knowledge/document/update-status`,
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
// 删除知识库文档
|
||||
deleteKnowledgeDocument: async (id: number) => {
|
||||
return await request.delete({ url: `/ai/knowledge/document/delete?id=` + id })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// AI 知识库 VO
|
||||
export interface KnowledgeVO {
|
||||
id: number // 编号
|
||||
name: string // 知识库名称
|
||||
description: string // 知识库描述
|
||||
embeddingModelId: number // 嵌入模型编号,高质量模式时维护
|
||||
topK: number // topK
|
||||
similarityThreshold: number // 相似度阈值
|
||||
}
|
||||
|
||||
// AI 知识库 API
|
||||
export const KnowledgeApi = {
|
||||
// 查询知识库分页
|
||||
getKnowledgePage: async (params: any) => {
|
||||
return await request.get({ url: `/ai/knowledge/page`, params })
|
||||
},
|
||||
|
||||
// 查询知识库详情
|
||||
getKnowledge: async (id: number) => {
|
||||
return await request.get({ url: `/ai/knowledge/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增知识库
|
||||
createKnowledge: async (data: KnowledgeVO) => {
|
||||
return await request.post({ url: `/ai/knowledge/create`, data })
|
||||
},
|
||||
|
||||
// 修改知识库
|
||||
updateKnowledge: async (data: KnowledgeVO) => {
|
||||
return await request.put({ url: `/ai/knowledge/update`, data })
|
||||
},
|
||||
|
||||
// 删除知识库
|
||||
deleteKnowledge: async (id: number) => {
|
||||
return await request.delete({ url: `/ai/knowledge/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 获取知识库简单列表
|
||||
getSimpleKnowledgeList: async () => {
|
||||
return await request.get({ url: `/ai/knowledge/simple-list` })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// AI 知识库分段 VO
|
||||
export interface KnowledgeSegmentVO {
|
||||
id: number // 编号
|
||||
documentId: number // 文档编号
|
||||
knowledgeId: number // 知识库编号
|
||||
vectorId: string // 向量库编号
|
||||
content: string // 切片内容
|
||||
contentLength: number // 切片内容长度
|
||||
tokens: number // token 数量
|
||||
retrievalCount: number // 召回次数
|
||||
status: number // 文档状态
|
||||
createTime: number // 创建时间
|
||||
}
|
||||
|
||||
// AI 知识库分段 API
|
||||
export const KnowledgeSegmentApi = {
|
||||
// 查询知识库分段分页
|
||||
getKnowledgeSegmentPage: async (params: any) => {
|
||||
return await request.get({ url: `/ai/knowledge/segment/page`, params })
|
||||
},
|
||||
|
||||
// 查询知识库分段详情
|
||||
getKnowledgeSegment: async (id: number) => {
|
||||
return await request.get({ url: `/ai/knowledge/segment/get?id=` + id })
|
||||
},
|
||||
|
||||
// 删除知识库分段
|
||||
deleteKnowledgeSegment: async (id: number) => {
|
||||
return await request.delete({ url: `/ai/knowledge/segment/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 新增知识库分段
|
||||
createKnowledgeSegment: async (data: KnowledgeSegmentVO) => {
|
||||
return await request.post({ url: `/ai/knowledge/segment/create`, data })
|
||||
},
|
||||
|
||||
// 修改知识库分段
|
||||
updateKnowledgeSegment: async (data: KnowledgeSegmentVO) => {
|
||||
return await request.put({ url: `/ai/knowledge/segment/update`, data })
|
||||
},
|
||||
|
||||
// 修改知识库分段状态
|
||||
updateKnowledgeSegmentStatus: async (data: any) => {
|
||||
return await request.put({
|
||||
url: `/ai/knowledge/segment/update-status`,
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
// 切片内容
|
||||
splitContent: async (url: string, segmentMaxTokens: number) => {
|
||||
return await request.get({
|
||||
url: `/ai/knowledge/segment/split`,
|
||||
params: { url, segmentMaxTokens }
|
||||
})
|
||||
},
|
||||
|
||||
// 获取文档处理列表
|
||||
getKnowledgeSegmentProcessList: async (documentIds: number[]) => {
|
||||
return await request.get({
|
||||
url: `/ai/knowledge/segment/get-process-list`,
|
||||
params: { documentIds: documentIds.join(',') }
|
||||
})
|
||||
},
|
||||
|
||||
// 搜索知识库分段
|
||||
searchKnowledgeSegment: async (params: any) => {
|
||||
return await request.get({
|
||||
url: `/ai/knowledge/segment/search`,
|
||||
params
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
import { getAccessToken } from '@/utils/auth'
|
||||
import { fetchEventSource } from '@microsoft/fetch-event-source'
|
||||
import { config } from '@/config/axios/config'
|
||||
import request from '@/config/axios' // AI 思维导图 VO
|
||||
|
||||
// AI 思维导图 VO
|
||||
export interface MindMapVO {
|
||||
id: number // 编号
|
||||
userId: number // 用户编号
|
||||
prompt: string // 生成内容提示
|
||||
generatedContent: string // 生成的思维导图内容
|
||||
platform: string // 平台
|
||||
model: string // 模型
|
||||
errorMessage: string // 错误信息
|
||||
}
|
||||
|
||||
// AI 思维导图生成 VO
|
||||
export interface AiMindMapGenerateReqVO {
|
||||
prompt: string
|
||||
}
|
||||
|
||||
export const AiMindMapApi = {
|
||||
generateMindMap: ({
|
||||
data,
|
||||
onClose,
|
||||
onMessage,
|
||||
onError,
|
||||
ctrl
|
||||
}: {
|
||||
data: AiMindMapGenerateReqVO
|
||||
onMessage?: (res: any) => void
|
||||
onError?: (...args: any[]) => void
|
||||
onClose?: (...args: any[]) => void
|
||||
ctrl: AbortController
|
||||
}) => {
|
||||
const token = getAccessToken()
|
||||
return fetchEventSource(`${config.base_url}/ai/mind-map/generate-stream`, {
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${token}`
|
||||
},
|
||||
openWhenHidden: true,
|
||||
body: JSON.stringify(data),
|
||||
onmessage: onMessage,
|
||||
onerror: onError,
|
||||
onclose: onClose,
|
||||
signal: ctrl.signal
|
||||
})
|
||||
},
|
||||
|
||||
// 查询思维导图分页
|
||||
getMindMapPage: async (params: any) => {
|
||||
return await request.get({ url: `/ai/mind-map/page`, params })
|
||||
},
|
||||
// 删除思维导图
|
||||
deleteMindMap: async (id: number) => {
|
||||
return await request.delete({ url: `/ai/mind-map/delete?id=` + id })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// AI API 密钥 VO
|
||||
export interface ApiKeyVO {
|
||||
id: number // 编号
|
||||
name: string // 名称
|
||||
apiKey: string // 密钥
|
||||
platform: string // 平台
|
||||
url: string // 自定义 API 地址
|
||||
status: number // 状态
|
||||
}
|
||||
|
||||
// AI API 密钥 API
|
||||
export const ApiKeyApi = {
|
||||
// 查询 API 密钥分页
|
||||
getApiKeyPage: async (params: any) => {
|
||||
return await request.get({ url: `/ai/api-key/page`, params })
|
||||
},
|
||||
|
||||
// 获得 API 密钥列表
|
||||
getApiKeySimpleList: async () => {
|
||||
return await request.get({ url: `/ai/api-key/simple-list` })
|
||||
},
|
||||
|
||||
// 查询 API 密钥详情
|
||||
getApiKey: async (id: number) => {
|
||||
return await request.get({ url: `/ai/api-key/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增 API 密钥
|
||||
createApiKey: async (data: ApiKeyVO) => {
|
||||
return await request.post({ url: `/ai/api-key/create`, data })
|
||||
},
|
||||
|
||||
// 修改 API 密钥
|
||||
updateApiKey: async (data: ApiKeyVO) => {
|
||||
return await request.put({ url: `/ai/api-key/update`, data })
|
||||
},
|
||||
|
||||
// 删除 API 密钥
|
||||
deleteApiKey: async (id: number) => {
|
||||
return await request.delete({ url: `/ai/api-key/delete?id=` + id })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// AI 聊天角色 VO
|
||||
export interface ChatRoleVO {
|
||||
id: number // 角色编号
|
||||
modelId: number // 模型编号
|
||||
name: string // 角色名称
|
||||
avatar: string // 角色头像
|
||||
category: string // 角色类别
|
||||
sort: number // 角色排序
|
||||
description: string // 角色描述
|
||||
systemMessage: string // 角色设定
|
||||
welcomeMessage: string // 角色设定
|
||||
publicStatus: boolean // 是否公开
|
||||
status: number // 状态
|
||||
knowledgeIds?: number[] // 引用的知识库 ID 列表
|
||||
toolIds?: number[] // 引用的工具 ID 列表
|
||||
mcpClientNames?: string[] // 引用的 MCP Client 名字列表
|
||||
}
|
||||
|
||||
// AI 聊天角色 分页请求 vo
|
||||
export interface ChatRolePageReqVO {
|
||||
name?: string // 角色名称
|
||||
category?: string // 角色类别
|
||||
publicStatus: boolean // 是否公开
|
||||
pageNo: number // 是否公开
|
||||
pageSize: number // 是否公开
|
||||
}
|
||||
|
||||
// AI 聊天角色 API
|
||||
export const ChatRoleApi = {
|
||||
// 查询聊天角色分页
|
||||
getChatRolePage: async (params: any) => {
|
||||
return await request.get({ url: `/ai/chat-role/page`, params })
|
||||
},
|
||||
|
||||
// 查询聊天角色详情
|
||||
getChatRole: async (id: number) => {
|
||||
return await request.get({ url: `/ai/chat-role/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增聊天角色
|
||||
createChatRole: async (data: ChatRoleVO) => {
|
||||
return await request.post({ url: `/ai/chat-role/create`, data })
|
||||
},
|
||||
|
||||
// 修改聊天角色
|
||||
updateChatRole: async (data: ChatRoleVO) => {
|
||||
return await request.put({ url: `/ai/chat-role/update`, data })
|
||||
},
|
||||
|
||||
// 删除聊天角色
|
||||
deleteChatRole: async (id: number) => {
|
||||
return await request.delete({ url: `/ai/chat-role/delete?id=` + id })
|
||||
},
|
||||
|
||||
// ======= chat 聊天
|
||||
|
||||
// 获取 my role
|
||||
getMyPage: async (params: ChatRolePageReqVO) => {
|
||||
return await request.get({ url: `/ai/chat-role/my-page`, params })
|
||||
},
|
||||
|
||||
// 获取角色分类
|
||||
getCategoryList: async () => {
|
||||
return await request.get({ url: `/ai/chat-role/category-list` })
|
||||
},
|
||||
|
||||
// 创建角色
|
||||
createMy: async (data: ChatRoleVO) => {
|
||||
return await request.post({ url: `/ai/chat-role/create-my`, data })
|
||||
},
|
||||
|
||||
// 更新角色
|
||||
updateMy: async (data: ChatRoleVO) => {
|
||||
return await request.put({ url: `/ai/chat-role/update-my`, data })
|
||||
},
|
||||
|
||||
// 删除角色 my
|
||||
deleteMy: async (id: number) => {
|
||||
return await request.delete({ url: `/ai/chat-role/delete-my?id=` + id })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// AI 模型 VO
|
||||
export interface ModelVO {
|
||||
id: number // 编号
|
||||
keyId: number // API 秘钥编号
|
||||
name: string // 模型名字
|
||||
model: string // 模型标识
|
||||
platform: string // 模型平台
|
||||
type: number // 模型类型
|
||||
sort: number // 排序
|
||||
status: number // 状态
|
||||
temperature?: number // 温度参数
|
||||
maxTokens?: number // 单条回复的最大 Token 数量
|
||||
maxContexts?: number // 上下文的最大 Message 数量
|
||||
}
|
||||
|
||||
// AI 模型 API
|
||||
export const ModelApi = {
|
||||
// 查询模型分页
|
||||
getModelPage: async (params: any) => {
|
||||
return await request.get({ url: `/ai/model/page`, params })
|
||||
},
|
||||
|
||||
// 获得模型列表
|
||||
getModelSimpleList: async (type?: number) => {
|
||||
return await request.get({
|
||||
url: `/ai/model/simple-list`,
|
||||
params: {
|
||||
type
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 查询模型详情
|
||||
getModel: async (id: number) => {
|
||||
return await request.get({ url: `/ai/model/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增模型
|
||||
createModel: async (data: ModelVO) => {
|
||||
return await request.post({ url: `/ai/model/create`, data })
|
||||
},
|
||||
|
||||
// 修改模型
|
||||
updateModel: async (data: ModelVO) => {
|
||||
return await request.put({ url: `/ai/model/update`, data })
|
||||
},
|
||||
|
||||
// 删除模型
|
||||
deleteModel: async (id: number) => {
|
||||
return await request.delete({ url: `/ai/model/delete?id=` + id })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// AI 工具 VO
|
||||
export interface ToolVO {
|
||||
id: number // 工具编号
|
||||
name: string // 工具名称
|
||||
description: string // 工具描述
|
||||
status: number // 状态
|
||||
}
|
||||
|
||||
// AI 工具 API
|
||||
export const ToolApi = {
|
||||
// 查询工具分页
|
||||
getToolPage: async (params: any) => {
|
||||
return await request.get({ url: `/ai/tool/page`, params })
|
||||
},
|
||||
|
||||
// 查询工具详情
|
||||
getTool: async (id: number) => {
|
||||
return await request.get({ url: `/ai/tool/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增工具
|
||||
createTool: async (data: ToolVO) => {
|
||||
return await request.post({ url: `/ai/tool/create`, data })
|
||||
},
|
||||
|
||||
// 修改工具
|
||||
updateTool: async (data: ToolVO) => {
|
||||
return await request.put({ url: `/ai/tool/update`, data })
|
||||
},
|
||||
|
||||
// 删除工具
|
||||
deleteTool: async (id: number) => {
|
||||
return await request.delete({ url: `/ai/tool/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 获取工具简单列表
|
||||
getToolSimpleList: async () => {
|
||||
return await request.get({ url: `/ai/tool/simple-list` })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// AI 音乐 VO
|
||||
export interface MusicVO {
|
||||
id: number // 编号
|
||||
userId: number // 用户编号
|
||||
title: string // 音乐名称
|
||||
lyric: string // 歌词
|
||||
imageUrl: string // 图片地址
|
||||
audioUrl: string // 音频地址
|
||||
videoUrl: string // 视频地址
|
||||
status: number // 音乐状态
|
||||
gptDescriptionPrompt: string // 描述词
|
||||
prompt: string // 提示词
|
||||
platform: string // 模型平台
|
||||
model: string // 模型
|
||||
generateMode: number // 生成模式
|
||||
tags: string // 音乐风格标签
|
||||
duration: number // 音乐时长
|
||||
publicStatus: boolean // 是否发布
|
||||
taskId: string // 任务id
|
||||
errorMessage: string // 错误信息
|
||||
}
|
||||
|
||||
// AI 音乐 API
|
||||
export const MusicApi = {
|
||||
// 查询音乐分页
|
||||
getMusicPage: async (params: any) => {
|
||||
return await request.get({ url: `/ai/music/page`, params })
|
||||
},
|
||||
|
||||
// 更新音乐
|
||||
updateMusic: async (data: any) => {
|
||||
return await request.put({ url: '/ai/music/update', data })
|
||||
},
|
||||
|
||||
// 删除音乐
|
||||
deleteMusic: async (id: number) => {
|
||||
return await request.delete({ url: `/ai/music/delete?id=` + id })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export const getWorkflowPage = async (params) => {
|
||||
return await request.get({ url: '/ai/workflow/page', params })
|
||||
}
|
||||
|
||||
export const getWorkflow = async (id) => {
|
||||
return await request.get({ url: '/ai/workflow/get?id=' + id })
|
||||
}
|
||||
|
||||
export const createWorkflow = async (data) => {
|
||||
return await request.post({ url: '/ai/workflow/create', data })
|
||||
}
|
||||
|
||||
export const updateWorkflow = async (data) => {
|
||||
return await request.put({ url: '/ai/workflow/update', data })
|
||||
}
|
||||
|
||||
export const deleteWorkflow = async (id) => {
|
||||
return await request.delete({ url: '/ai/workflow/delete?id=' + id })
|
||||
}
|
||||
|
||||
export const testWorkflow = async (data) => {
|
||||
return await request.post({ url: '/ai/workflow/test', data })
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
import { fetchEventSource } from '@microsoft/fetch-event-source'
|
||||
|
||||
import { getAccessToken } from '@/utils/auth'
|
||||
import { config } from '@/config/axios/config'
|
||||
import { AiWriteTypeEnum } from '@/views/ai/utils/constants'
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface WriteVO {
|
||||
type: AiWriteTypeEnum.WRITING | AiWriteTypeEnum.REPLY // 1:撰写 2:回复
|
||||
prompt: string // 写作内容提示 1。撰写 2回复
|
||||
originalContent: string // 原文
|
||||
length: number // 长度
|
||||
format: number // 格式
|
||||
tone: number // 语气
|
||||
language: number // 语言
|
||||
userId?: number // 用户编号
|
||||
platform?: string // 平台
|
||||
model?: string // 模型
|
||||
generatedContent?: string // 生成的内容
|
||||
errorMessage?: string // 错误信息
|
||||
createTime?: Date // 创建时间
|
||||
}
|
||||
|
||||
export interface AiWritePageReqVO extends PageParam {
|
||||
userId?: number // 用户编号
|
||||
type?: AiWriteTypeEnum // 写作类型
|
||||
platform?: string // 平台
|
||||
createTime?: [string, string] // 创建时间
|
||||
}
|
||||
|
||||
export interface AiWriteRespVo {
|
||||
id: number
|
||||
userId: number
|
||||
type: number
|
||||
platform: string
|
||||
model: string
|
||||
prompt: string
|
||||
generatedContent: string
|
||||
originalContent: string
|
||||
length: number
|
||||
format: number
|
||||
tone: number
|
||||
language: number
|
||||
errorMessage: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
export const WriteApi = {
|
||||
writeStream: ({
|
||||
data,
|
||||
onClose,
|
||||
onMessage,
|
||||
onError,
|
||||
ctrl
|
||||
}: {
|
||||
data: WriteVO
|
||||
onMessage?: (res: any) => void
|
||||
onError?: (...args: any[]) => void
|
||||
onClose?: (...args: any[]) => void
|
||||
ctrl: AbortController
|
||||
}) => {
|
||||
const token = getAccessToken()
|
||||
return fetchEventSource(`${config.base_url}/ai/write/generate-stream`, {
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${token}`
|
||||
},
|
||||
openWhenHidden: true,
|
||||
body: JSON.stringify(data),
|
||||
onmessage: onMessage,
|
||||
onerror: onError,
|
||||
onclose: onClose,
|
||||
signal: ctrl.signal
|
||||
})
|
||||
},
|
||||
// 获取写作列表
|
||||
getWritePage: (params: AiWritePageReqVO) => {
|
||||
return request.get<PageResult<AiWriteRespVo[]>>({ url: `/ai/write/page`, params })
|
||||
},
|
||||
// 删除写作
|
||||
deleteWrite(id: number) {
|
||||
return request.delete({ url: `/ai/write/delete`, params: { id } })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// BPM 流程分类 VO
|
||||
export interface CategoryVO {
|
||||
id: number // 分类编号
|
||||
name: string // 分类名
|
||||
code: string // 分类标志
|
||||
status: number // 分类状态
|
||||
sort: number // 分类排序
|
||||
}
|
||||
|
||||
// BPM 流程分类 API
|
||||
export const CategoryApi = {
|
||||
// 查询流程分类分页
|
||||
getCategoryPage: async (params: any) => {
|
||||
return await request.get({ url: `/bpm/category/page`, params })
|
||||
},
|
||||
|
||||
// 查询流程分类列表
|
||||
getCategorySimpleList: async () => {
|
||||
return await request.get({ url: `/bpm/category/simple-list` })
|
||||
},
|
||||
|
||||
// 查询流程分类详情
|
||||
getCategory: async (id: number) => {
|
||||
return await request.get({ url: `/bpm/category/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增流程分类
|
||||
createCategory: async (data: CategoryVO) => {
|
||||
return await request.post({ url: `/bpm/category/create`, data })
|
||||
},
|
||||
|
||||
// 修改流程分类
|
||||
updateCategory: async (data: CategoryVO) => {
|
||||
return await request.put({ url: `/bpm/category/update`, data })
|
||||
},
|
||||
|
||||
// 批量修改流程分类的排序
|
||||
updateCategorySortBatch: async (ids: number[]) => {
|
||||
return await request.put({
|
||||
url: `/bpm/category/update-sort-batch`,
|
||||
params: {
|
||||
ids: ids.join(',')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 删除流程分类
|
||||
deleteCategory: async (id: number) => {
|
||||
return await request.delete({ url: `/bpm/category/delete?id=` + id })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export const getProcessDefinition = async (id?: string, key?: string) => {
|
||||
return await request.get({
|
||||
url: '/bpm/process-definition/get',
|
||||
params: { id, key }
|
||||
})
|
||||
}
|
||||
|
||||
export const getProcessDefinitionPage = async (params) => {
|
||||
return await request.get({
|
||||
url: '/bpm/process-definition/page',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export const getProcessDefinitionList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/bpm/process-definition/list',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export const getSimpleProcessDefinitionList = async () => {
|
||||
return await request.get({
|
||||
url: '/bpm/process-definition/simple-list'
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export type FormVO = {
|
||||
id: number
|
||||
name: string
|
||||
conf: string
|
||||
fields: string[]
|
||||
status: number
|
||||
remark: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
// 创建工作流的表单定义
|
||||
export const createForm = async (data: FormVO) => {
|
||||
return await request.post({
|
||||
url: '/bpm/form/create',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新工作流的表单定义
|
||||
export const updateForm = async (data: FormVO) => {
|
||||
return await request.put({
|
||||
url: '/bpm/form/update',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除工作流的表单定义
|
||||
export const deleteForm = async (id: number) => {
|
||||
return await request.delete({
|
||||
url: '/bpm/form/delete?id=' + id
|
||||
})
|
||||
}
|
||||
|
||||
// 获得工作流的表单定义
|
||||
export const getForm = async (id: number) => {
|
||||
return await request.get({
|
||||
url: '/bpm/form/get?id=' + id
|
||||
})
|
||||
}
|
||||
|
||||
// 获得工作流的表单定义分页
|
||||
export const getFormPage = async (params) => {
|
||||
return await request.get({
|
||||
url: '/bpm/form/page',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 获得动态表单的精简列表
|
||||
export const getFormSimpleList = async () => {
|
||||
return await request.get({
|
||||
url: '/bpm/form/simple-list'
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export type LeaveVO = {
|
||||
id: number
|
||||
status: number
|
||||
type: number
|
||||
reason: string
|
||||
processInstanceId: string
|
||||
startTime: string
|
||||
endTime: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
// 创建请假申请
|
||||
export const createLeave = async (data: LeaveVO) => {
|
||||
return await request.post({ url: '/bpm/oa/leave/create', data: data })
|
||||
}
|
||||
|
||||
// 获得请假申请
|
||||
export const getLeave = async (id: number) => {
|
||||
return await request.get({ url: '/bpm/oa/leave/get?id=' + id })
|
||||
}
|
||||
|
||||
// 获得请假申请分页
|
||||
export const getLeavePage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/bpm/oa/leave/page', params })
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export type ProcessDefinitionVO = {
|
||||
id: string
|
||||
version: number
|
||||
deploymentTIme: string
|
||||
suspensionState: number
|
||||
formType?: number
|
||||
}
|
||||
|
||||
export type ModelVO = {
|
||||
id: number
|
||||
formName: string
|
||||
key: string
|
||||
name: string
|
||||
description: string
|
||||
category: string
|
||||
formType: number
|
||||
formId: number
|
||||
formCustomCreatePath: string
|
||||
formCustomViewPath: string
|
||||
processDefinition: ProcessDefinitionVO
|
||||
status: number
|
||||
remark: string
|
||||
createTime: string
|
||||
bpmnXml: string
|
||||
}
|
||||
|
||||
export const getModelList = async (name: string | undefined) => {
|
||||
return await request.get({ url: '/bpm/model/list', params: { name } })
|
||||
}
|
||||
|
||||
export const getModel = async (id: string) => {
|
||||
return await request.get({ url: '/bpm/model/get?id=' + id })
|
||||
}
|
||||
|
||||
export const updateModel = async (data: ModelVO) => {
|
||||
return await request.put({ url: '/bpm/model/update', data: data })
|
||||
}
|
||||
|
||||
// 批量修改流程分类的排序
|
||||
export const updateModelSortBatch = async (ids: number[]) => {
|
||||
return await request.put({
|
||||
url: `/bpm/model/update-sort-batch`,
|
||||
params: {
|
||||
ids: ids.join(',')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const updateModelBpmn = async (data: ModelVO) => {
|
||||
return await request.put({ url: '/bpm/model/update-bpmn', data: data })
|
||||
}
|
||||
|
||||
// 任务状态修改
|
||||
export const updateModelState = async (id: number, state: number) => {
|
||||
const data = {
|
||||
id: id,
|
||||
state: state
|
||||
}
|
||||
return await request.put({ url: '/bpm/model/update-state', data: data })
|
||||
}
|
||||
|
||||
export const createModel = async (data: ModelVO) => {
|
||||
return await request.post({ url: '/bpm/model/create', data: data })
|
||||
}
|
||||
|
||||
export const deleteModel = async (id: number) => {
|
||||
return await request.delete({ url: '/bpm/model/delete?id=' + id })
|
||||
}
|
||||
|
||||
export const deployModel = async (id: number) => {
|
||||
return await request.post({ url: '/bpm/model/deploy?id=' + id })
|
||||
}
|
||||
|
||||
export const cleanModel = async (id: number) => {
|
||||
return await request.delete({ url: '/bpm/model/clean?id=' + id })
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// BPM 流程表达式 VO
|
||||
export interface ProcessExpressionVO {
|
||||
id: number // 编号
|
||||
name: string // 表达式名字
|
||||
status: number // 表达式状态
|
||||
expression: string // 表达式
|
||||
}
|
||||
|
||||
// BPM 流程表达式 API
|
||||
export const ProcessExpressionApi = {
|
||||
// 查询BPM 流程表达式分页
|
||||
getProcessExpressionPage: async (params: any) => {
|
||||
return await request.get({ url: `/bpm/process-expression/page`, params })
|
||||
},
|
||||
|
||||
// 查询BPM 流程表达式详情
|
||||
getProcessExpression: async (id: number) => {
|
||||
return await request.get({ url: `/bpm/process-expression/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增BPM 流程表达式
|
||||
createProcessExpression: async (data: ProcessExpressionVO) => {
|
||||
return await request.post({ url: `/bpm/process-expression/create`, data })
|
||||
},
|
||||
|
||||
// 修改BPM 流程表达式
|
||||
updateProcessExpression: async (data: ProcessExpressionVO) => {
|
||||
return await request.put({ url: `/bpm/process-expression/update`, data })
|
||||
},
|
||||
|
||||
// 删除BPM 流程表达式
|
||||
deleteProcessExpression: async (id: number) => {
|
||||
return await request.delete({ url: `/bpm/process-expression/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出BPM 流程表达式 Excel
|
||||
exportProcessExpression: async (params) => {
|
||||
return await request.download({ url: `/bpm/process-expression/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
import request from '@/config/axios'
|
||||
import { ProcessDefinitionVO } from '@/api/bpm/model'
|
||||
import { NodeType, CandidateStrategy } from '@/components/SimpleProcessDesignerV2/src/consts'
|
||||
export type Task = {
|
||||
id: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export type ProcessInstanceVO = {
|
||||
id: number
|
||||
name: string
|
||||
processDefinitionId: string
|
||||
category: string
|
||||
result: number
|
||||
tasks: Task[]
|
||||
fields: string[]
|
||||
status: number
|
||||
remark: string
|
||||
businessKey: string
|
||||
createTime: string
|
||||
endTime: string
|
||||
processDefinition?: ProcessDefinitionVO
|
||||
}
|
||||
|
||||
// 用户信息
|
||||
export type User = {
|
||||
id: number
|
||||
nickname: string
|
||||
avatar: string
|
||||
}
|
||||
|
||||
// 审批任务信息
|
||||
export type ApprovalTaskInfo = {
|
||||
id: number
|
||||
ownerUser: User
|
||||
assigneeUser: User
|
||||
status: number
|
||||
reason: string
|
||||
signPicUrl: string
|
||||
}
|
||||
|
||||
// 审批节点信息
|
||||
export type ApprovalNodeInfo = {
|
||||
id: number
|
||||
name: string
|
||||
nodeType: NodeType
|
||||
candidateStrategy?: CandidateStrategy
|
||||
status: number
|
||||
startTime?: Date
|
||||
endTime?: Date
|
||||
processInstanceId?: string
|
||||
candidateUsers?: User[]
|
||||
tasks: ApprovalTaskInfo[]
|
||||
}
|
||||
|
||||
export const getProcessInstanceMyPage = async (params: any) => {
|
||||
return await request.get({ url: '/bpm/process-instance/my-page', params })
|
||||
}
|
||||
|
||||
export const getProcessInstanceManagerPage = async (params: any) => {
|
||||
return await request.get({ url: '/bpm/process-instance/manager-page', params })
|
||||
}
|
||||
|
||||
export const createProcessInstance = async (data) => {
|
||||
return await request.post({ url: '/bpm/process-instance/create', data: data })
|
||||
}
|
||||
|
||||
export const cancelProcessInstanceByStartUser = async (id: number, reason: string) => {
|
||||
const data = {
|
||||
id: id,
|
||||
reason: reason
|
||||
}
|
||||
return await request.delete({ url: '/bpm/process-instance/cancel-by-start-user', data: data })
|
||||
}
|
||||
|
||||
export const cancelProcessInstanceByAdmin = async (id: number, reason: string) => {
|
||||
const data = {
|
||||
id: id,
|
||||
reason: reason
|
||||
}
|
||||
return await request.delete({ url: '/bpm/process-instance/cancel-by-admin', data: data })
|
||||
}
|
||||
|
||||
export const getProcessInstance = async (id: string) => {
|
||||
return await request.get({ url: '/bpm/process-instance/get?id=' + id })
|
||||
}
|
||||
|
||||
export const getProcessInstanceCopyPage = async (params: any) => {
|
||||
return await request.get({ url: '/bpm/process-instance/copy/page', params })
|
||||
}
|
||||
|
||||
// 获取审批详情
|
||||
export const getApprovalDetail = async (params: any) => {
|
||||
return await request.get({ url: '/bpm/process-instance/get-approval-detail', params })
|
||||
}
|
||||
|
||||
// 获取下一个执行的流程节点
|
||||
export const getNextApprovalNodes = async (params: any) => {
|
||||
return await request.get({ url: '/bpm/process-instance/get-next-approval-nodes', params })
|
||||
}
|
||||
|
||||
// 获取表单字段权限
|
||||
export const getFormFieldsPermission = async (params: any) => {
|
||||
return await request.get({ url: '/bpm/process-instance/get-form-fields-permission', params })
|
||||
}
|
||||
|
||||
// 获取流程实例的 BPMN 模型视图
|
||||
export const getProcessInstanceBpmnModelView = async (id: string) => {
|
||||
return await request.get({ url: '/bpm/process-instance/get-bpmn-model-view?id=' + id })
|
||||
}
|
||||
|
||||
// 获取流程实例打印数据
|
||||
export const getProcessInstancePrintData = async (id: string) => {
|
||||
return await request.get({ url: '/bpm/process-instance/get-print-data?processInstanceId=' + id })
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// BPM 流程监听器 VO
|
||||
export interface ProcessListenerVO {
|
||||
id: number // 编号
|
||||
name: string // 监听器名字
|
||||
type: string // 监听器类型
|
||||
status: number // 监听器状态
|
||||
event: string // 监听事件
|
||||
valueType: string // 监听器值类型
|
||||
value: string // 监听器值
|
||||
}
|
||||
|
||||
// BPM 流程监听器 API
|
||||
export const ProcessListenerApi = {
|
||||
// 查询流程监听器分页
|
||||
getProcessListenerPage: async (params: any) => {
|
||||
return await request.get({ url: `/bpm/process-listener/page`, params })
|
||||
},
|
||||
|
||||
// 查询流程监听器详情
|
||||
getProcessListener: async (id: number) => {
|
||||
return await request.get({ url: `/bpm/process-listener/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增流程监听器
|
||||
createProcessListener: async (data: ProcessListenerVO) => {
|
||||
return await request.post({ url: `/bpm/process-listener/create`, data })
|
||||
},
|
||||
|
||||
// 修改流程监听器
|
||||
updateProcessListener: async (data: ProcessListenerVO) => {
|
||||
return await request.put({ url: `/bpm/process-listener/update`, data })
|
||||
},
|
||||
|
||||
// 删除流程监听器
|
||||
deleteProcessListener: async (id: number) => {
|
||||
return await request.delete({ url: `/bpm/process-listener/delete?id=` + id })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
|
||||
export const updateBpmSimpleModel = async (data) => {
|
||||
return await request.post({
|
||||
url: '/bpm/model/simple/update',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const getBpmSimpleModel = async (id) => {
|
||||
return await request.get({
|
||||
url: '/bpm/model/simple/get?id=' + id
|
||||
})
|
||||
}
|
||||
122
yudao-ui/yudao-ui-admin-vue3-master/src/api/bpm/task/index.ts
Normal file
122
yudao-ui/yudao-ui-admin-vue3-master/src/api/bpm/task/index.ts
Normal file
@@ -0,0 +1,122 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/**
|
||||
* 任务状态枚举
|
||||
*/
|
||||
export enum TaskStatusEnum {
|
||||
/**
|
||||
* 跳过
|
||||
*/
|
||||
SKIP = -2,
|
||||
/**
|
||||
* 未开始
|
||||
*/
|
||||
NOT_START = -1,
|
||||
|
||||
/**
|
||||
* 待审批
|
||||
*/
|
||||
WAIT = 0,
|
||||
/**
|
||||
* 审批中
|
||||
*/
|
||||
RUNNING = 1,
|
||||
/**
|
||||
* 审批通过
|
||||
*/
|
||||
APPROVE = 2,
|
||||
|
||||
/**
|
||||
* 审批不通过
|
||||
*/
|
||||
REJECT = 3,
|
||||
|
||||
/**
|
||||
* 已取消
|
||||
*/
|
||||
CANCEL = 4,
|
||||
/**
|
||||
* 已退回
|
||||
*/
|
||||
RETURN = 5,
|
||||
/**
|
||||
* 审批通过中
|
||||
*/
|
||||
APPROVING = 7
|
||||
}
|
||||
|
||||
export const getTaskTodoPage = async (params: any) => {
|
||||
return await request.get({ url: '/bpm/task/todo-page', params })
|
||||
}
|
||||
|
||||
export const getTaskDonePage = async (params: any) => {
|
||||
return await request.get({ url: '/bpm/task/done-page', params })
|
||||
}
|
||||
|
||||
export const getTaskManagerPage = async (params: any) => {
|
||||
return await request.get({ url: '/bpm/task/manager-page', params })
|
||||
}
|
||||
|
||||
export const approveTask = async (data: any) => {
|
||||
return await request.put({ url: '/bpm/task/approve', data })
|
||||
}
|
||||
|
||||
export const rejectTask = async (data: any) => {
|
||||
return await request.put({ url: '/bpm/task/reject', data })
|
||||
}
|
||||
|
||||
export const getTaskListByProcessInstanceId = async (processInstanceId: string) => {
|
||||
return await request.get({
|
||||
url: '/bpm/task/list-by-process-instance-id?processInstanceId=' + processInstanceId
|
||||
})
|
||||
}
|
||||
|
||||
// 获取所有可退回的节点
|
||||
export const getTaskListByReturn = async (id: string) => {
|
||||
return await request.get({ url: '/bpm/task/list-by-return', params: { id } })
|
||||
}
|
||||
|
||||
// 退回
|
||||
export const returnTask = async (data: any) => {
|
||||
return await request.put({ url: '/bpm/task/return', data })
|
||||
}
|
||||
|
||||
// 委派
|
||||
export const delegateTask = async (data: any) => {
|
||||
return await request.put({ url: '/bpm/task/delegate', data })
|
||||
}
|
||||
|
||||
// 转派
|
||||
export const transferTask = async (data: any) => {
|
||||
return await request.put({ url: '/bpm/task/transfer', data })
|
||||
}
|
||||
|
||||
// 加签
|
||||
export const signCreateTask = async (data: any) => {
|
||||
return await request.put({ url: '/bpm/task/create-sign', data })
|
||||
}
|
||||
|
||||
// 减签
|
||||
export const signDeleteTask = async (data: any) => {
|
||||
return await request.delete({ url: '/bpm/task/delete-sign', data })
|
||||
}
|
||||
|
||||
// 抄送
|
||||
export const copyTask = async (data: any) => {
|
||||
return await request.put({ url: '/bpm/task/copy', data })
|
||||
}
|
||||
|
||||
// 撤回
|
||||
export const withdrawTask = async (taskId: string) => {
|
||||
return await request.put({ url: '/bpm/task/withdraw', params: { taskId } })
|
||||
}
|
||||
|
||||
// 获取我的待办任务
|
||||
export const myTodoTask = async (processInstanceId: string) => {
|
||||
return await request.get({ url: '/bpm/task/my-todo?processInstanceId=' + processInstanceId })
|
||||
}
|
||||
|
||||
// 获取减签任务列表
|
||||
export const getChildrenTaskList = async (id: string) => {
|
||||
return await request.get({ url: '/bpm/task/list-by-parent-task-id?parentTaskId=' + id })
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export type UserGroupVO = {
|
||||
id: number
|
||||
name: string
|
||||
description: string
|
||||
userIds: number[]
|
||||
status: number
|
||||
remark: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
// 创建用户组
|
||||
export const createUserGroup = async (data: UserGroupVO) => {
|
||||
return await request.post({
|
||||
url: '/bpm/user-group/create',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新用户组
|
||||
export const updateUserGroup = async (data: UserGroupVO) => {
|
||||
return await request.put({
|
||||
url: '/bpm/user-group/update',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除用户组
|
||||
export const deleteUserGroup = async (id: number) => {
|
||||
return await request.delete({ url: '/bpm/user-group/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 获得用户组
|
||||
export const getUserGroup = async (id: number) => {
|
||||
return await request.get({ url: '/bpm/user-group/get?id=' + id })
|
||||
}
|
||||
|
||||
// 获得用户组分页
|
||||
export const getUserGroupPage = async (params) => {
|
||||
return await request.get({ url: '/bpm/user-group/page', params })
|
||||
}
|
||||
|
||||
// 获取用户组精简信息列表
|
||||
export const getUserGroupSimpleList = async (): Promise<UserGroupVO[]> => {
|
||||
return await request.get({ url: '/bpm/user-group/simple-list' })
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
import request from '@/config/axios'
|
||||
import { TransferReqVO } from '@/api/crm/permission'
|
||||
|
||||
export interface BusinessVO {
|
||||
id: number
|
||||
name: string
|
||||
customerId: number
|
||||
customerName?: string
|
||||
followUpStatus: boolean
|
||||
contactLastTime: Date
|
||||
contactNextTime: Date
|
||||
ownerUserId: number
|
||||
ownerUserName?: string // 负责人的用户名称
|
||||
ownerUserDept?: string // 负责人的部门名称
|
||||
statusTypeId: number
|
||||
statusTypeName?: string
|
||||
statusId: number
|
||||
statusName?: string
|
||||
endStatus: number
|
||||
endRemark: string
|
||||
dealTime: Date
|
||||
totalProductPrice: number
|
||||
totalPrice: number
|
||||
discountPercent: number
|
||||
remark: string
|
||||
creator: string // 创建人
|
||||
creatorName?: string // 创建人名称
|
||||
createTime: Date // 创建时间
|
||||
updateTime: Date // 更新时间
|
||||
products?: [
|
||||
{
|
||||
id: number
|
||||
productId: number
|
||||
productName: string
|
||||
productNo: string
|
||||
productUnit: number
|
||||
productPrice: number
|
||||
businessPrice: number
|
||||
count: number
|
||||
totalPrice: number
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
// 查询 CRM 商机列表
|
||||
export const getBusinessPage = async (params) => {
|
||||
return await request.get({ url: `/crm/business/page`, params })
|
||||
}
|
||||
|
||||
// 查询 CRM 商机列表,基于指定客户
|
||||
export const getBusinessPageByCustomer = async (params) => {
|
||||
return await request.get({ url: `/crm/business/page-by-customer`, params })
|
||||
}
|
||||
|
||||
// 查询 CRM 商机详情
|
||||
export const getBusiness = async (id: number) => {
|
||||
return await request.get({ url: `/crm/business/get?id=` + id })
|
||||
}
|
||||
|
||||
// 获得 CRM 商机列表(精简)
|
||||
export const getSimpleBusinessList = async () => {
|
||||
return await request.get({ url: `/crm/business/simple-all-list` })
|
||||
}
|
||||
|
||||
// 新增 CRM 商机
|
||||
export const createBusiness = async (data: BusinessVO) => {
|
||||
return await request.post({ url: `/crm/business/create`, data })
|
||||
}
|
||||
|
||||
// 修改 CRM 商机
|
||||
export const updateBusiness = async (data: BusinessVO) => {
|
||||
return await request.put({ url: `/crm/business/update`, data })
|
||||
}
|
||||
|
||||
// 修改 CRM 商机状态
|
||||
export const updateBusinessStatus = async (data: BusinessVO) => {
|
||||
return await request.put({ url: `/crm/business/update-status`, data })
|
||||
}
|
||||
|
||||
// 删除 CRM 商机
|
||||
export const deleteBusiness = async (id: number) => {
|
||||
return await request.delete({ url: `/crm/business/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出 CRM 商机 Excel
|
||||
export const exportBusiness = async (params) => {
|
||||
return await request.download({ url: `/crm/business/export-excel`, params })
|
||||
}
|
||||
|
||||
// 联系人关联商机列表
|
||||
export const getBusinessPageByContact = async (params) => {
|
||||
return await request.get({ url: `/crm/business/page-by-contact`, params })
|
||||
}
|
||||
|
||||
// 商机转移
|
||||
export const transferBusiness = async (data: TransferReqVO) => {
|
||||
return await request.put({ url: '/crm/business/transfer', data })
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface BusinessStatusTypeVO {
|
||||
id: number
|
||||
name: string
|
||||
deptIds: number[]
|
||||
statuses?: {
|
||||
id: number
|
||||
name: string
|
||||
percent: number
|
||||
}
|
||||
}
|
||||
|
||||
export const DEFAULT_STATUSES = [
|
||||
{
|
||||
endStatus: 1,
|
||||
key: '结束',
|
||||
name: '赢单',
|
||||
percent: 100
|
||||
},
|
||||
{
|
||||
endStatus: 2,
|
||||
key: '结束',
|
||||
name: '输单',
|
||||
percent: 0
|
||||
},
|
||||
{
|
||||
endStatus: 3,
|
||||
key: '结束',
|
||||
name: '无效',
|
||||
percent: 0
|
||||
}
|
||||
]
|
||||
|
||||
// 查询商机状态组列表
|
||||
export const getBusinessStatusPage = async (params: any) => {
|
||||
return await request.get({ url: `/crm/business-status/page`, params })
|
||||
}
|
||||
|
||||
// 新增商机状态组
|
||||
export const createBusinessStatus = async (data: BusinessStatusTypeVO) => {
|
||||
return await request.post({ url: `/crm/business-status/create`, data })
|
||||
}
|
||||
|
||||
// 修改商机状态组
|
||||
export const updateBusinessStatus = async (data: BusinessStatusTypeVO) => {
|
||||
return await request.put({ url: `/crm/business-status/update`, data })
|
||||
}
|
||||
|
||||
// 查询商机状态类型详情
|
||||
export const getBusinessStatus = async (id: number) => {
|
||||
return await request.get({ url: `/crm/business-status/get?id=` + id })
|
||||
}
|
||||
|
||||
// 删除商机状态
|
||||
export const deleteBusinessStatus = async (id: number) => {
|
||||
return await request.delete({ url: `/crm/business-status/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 获得商机状态组列表
|
||||
export const getBusinessStatusTypeSimpleList = async () => {
|
||||
return await request.get({ url: `/crm/business-status/type-simple-list` })
|
||||
}
|
||||
|
||||
// 获得商机阶段列表
|
||||
export const getBusinessStatusSimpleList = async (typeId: number) => {
|
||||
return await request.get({ url: `/crm/business-status/status-simple-list`, params: { typeId } })
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
import request from '@/config/axios'
|
||||
import { TransferReqVO } from '@/api/crm/permission'
|
||||
|
||||
export interface ClueVO {
|
||||
id: number // 编号
|
||||
name: string // 线索名称
|
||||
followUpStatus: boolean // 跟进状态
|
||||
contactLastTime: Date // 最后跟进时间
|
||||
contactLastContent: string // 最后跟进内容
|
||||
contactNextTime: Date // 下次联系时间
|
||||
ownerUserId: number // 负责人的用户编号
|
||||
ownerUserName?: string // 负责人的用户名称
|
||||
ownerUserDept?: string // 负责人的部门名称
|
||||
transformStatus: boolean // 转化状态
|
||||
customerId: number // 客户编号
|
||||
customerName?: string // 客户名称
|
||||
mobile: string // 手机号
|
||||
telephone: string // 电话
|
||||
qq: string // QQ
|
||||
wechat: string // wechat
|
||||
email: string // email
|
||||
areaId: number // 所在地
|
||||
areaName?: string // 所在地名称
|
||||
detailAddress: string // 详细地址
|
||||
industryId: number // 所属行业
|
||||
level: number // 客户等级
|
||||
source: number // 客户来源
|
||||
remark: string // 备注
|
||||
creator: string // 创建人
|
||||
creatorName?: string // 创建人名称
|
||||
createTime: Date // 创建时间
|
||||
updateTime: Date // 更新时间
|
||||
}
|
||||
|
||||
// 查询线索列表
|
||||
export const getCluePage = async (params: any) => {
|
||||
return await request.get({ url: `/crm/clue/page`, params })
|
||||
}
|
||||
|
||||
// 查询线索详情
|
||||
export const getClue = async (id: number) => {
|
||||
return await request.get({ url: `/crm/clue/get?id=` + id })
|
||||
}
|
||||
|
||||
// 新增线索
|
||||
export const createClue = async (data: ClueVO) => {
|
||||
return await request.post({ url: `/crm/clue/create`, data })
|
||||
}
|
||||
|
||||
// 修改线索
|
||||
export const updateClue = async (data: ClueVO) => {
|
||||
return await request.put({ url: `/crm/clue/update`, data })
|
||||
}
|
||||
|
||||
// 删除线索
|
||||
export const deleteClue = async (id: number) => {
|
||||
return await request.delete({ url: `/crm/clue/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出线索 Excel
|
||||
export const exportClue = async (params) => {
|
||||
return await request.download({ url: `/crm/clue/export-excel`, params })
|
||||
}
|
||||
|
||||
// 线索转移
|
||||
export const transferClue = async (data: TransferReqVO) => {
|
||||
return await request.put({ url: '/crm/clue/transfer', data })
|
||||
}
|
||||
|
||||
// 线索转化为客户
|
||||
export const transformClue = async (id: number) => {
|
||||
return await request.put({ url: '/crm/clue/transform', params: { id } })
|
||||
}
|
||||
|
||||
// 获得分配给我的、待跟进的线索数量
|
||||
export const getFollowClueCount = async () => {
|
||||
return await request.get({ url: '/crm/clue/follow-count' })
|
||||
}
|
||||
113
yudao-ui/yudao-ui-admin-vue3-master/src/api/crm/contact/index.ts
Normal file
113
yudao-ui/yudao-ui-admin-vue3-master/src/api/crm/contact/index.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import request from '@/config/axios'
|
||||
import { TransferReqVO } from '@/api/crm/permission'
|
||||
|
||||
export interface ContactVO {
|
||||
id: number // 编号
|
||||
name: string // 联系人名称
|
||||
customerId: number // 客户编号
|
||||
customerName?: string // 客户名称
|
||||
contactLastTime: Date // 最后跟进时间
|
||||
contactLastContent: string // 最后跟进内容
|
||||
contactNextTime: Date // 下次联系时间
|
||||
ownerUserId: number // 负责人的用户编号
|
||||
ownerUserName?: string // 负责人的用户名称
|
||||
ownerUserDept?: string // 负责人的部门名称
|
||||
mobile: string // 手机号
|
||||
telephone: string // 电话
|
||||
qq: string // QQ
|
||||
wechat: string // wechat
|
||||
email: string // email
|
||||
areaId: number // 所在地
|
||||
areaName?: string // 所在地名称
|
||||
detailAddress: string // 详细地址
|
||||
sex: number // 性别
|
||||
master: boolean // 是否主联系人
|
||||
post: string // 职务
|
||||
parentId: number // 上级联系人编号
|
||||
parentName?: string // 上级联系人名称
|
||||
remark: string // 备注
|
||||
creator: string // 创建人
|
||||
creatorName?: string // 创建人名称
|
||||
createTime: Date // 创建时间
|
||||
updateTime: Date // 更新时间
|
||||
}
|
||||
|
||||
export interface ContactBusinessReqVO {
|
||||
contactId: number
|
||||
businessIds: number[]
|
||||
}
|
||||
|
||||
export interface ContactBusiness2ReqVO {
|
||||
businessId: number
|
||||
contactIds: number[]
|
||||
}
|
||||
|
||||
// 查询 CRM 联系人列表
|
||||
export const getContactPage = async (params) => {
|
||||
return await request.get({ url: `/crm/contact/page`, params })
|
||||
}
|
||||
|
||||
// 查询 CRM 联系人列表,基于指定客户
|
||||
export const getContactPageByCustomer = async (params: any) => {
|
||||
return await request.get({ url: `/crm/contact/page-by-customer`, params })
|
||||
}
|
||||
|
||||
// 查询 CRM 联系人列表,基于指定商机
|
||||
export const getContactPageByBusiness = async (params: any) => {
|
||||
return await request.get({ url: `/crm/contact/page-by-business`, params })
|
||||
}
|
||||
|
||||
// 查询 CRM 联系人详情
|
||||
export const getContact = async (id: number) => {
|
||||
return await request.get({ url: `/crm/contact/get?id=` + id })
|
||||
}
|
||||
|
||||
// 新增 CRM 联系人
|
||||
export const createContact = async (data: ContactVO) => {
|
||||
return await request.post({ url: `/crm/contact/create`, data })
|
||||
}
|
||||
|
||||
// 修改 CRM 联系人
|
||||
export const updateContact = async (data: ContactVO) => {
|
||||
return await request.put({ url: `/crm/contact/update`, data })
|
||||
}
|
||||
|
||||
// 删除 CRM 联系人
|
||||
export const deleteContact = async (id: number) => {
|
||||
return await request.delete({ url: `/crm/contact/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出 CRM 联系人 Excel
|
||||
export const exportContact = async (params) => {
|
||||
return await request.download({ url: `/crm/contact/export-excel`, params })
|
||||
}
|
||||
|
||||
// 获得 CRM 联系人列表(精简)
|
||||
export const getSimpleContactList = async () => {
|
||||
return await request.get({ url: `/crm/contact/simple-all-list` })
|
||||
}
|
||||
|
||||
// 批量新增联系人商机关联
|
||||
export const createContactBusinessList = async (data: ContactBusinessReqVO) => {
|
||||
return await request.post({ url: `/crm/contact/create-business-list`, data })
|
||||
}
|
||||
|
||||
// 批量新增联系人商机关联
|
||||
export const createContactBusinessList2 = async (data: ContactBusiness2ReqVO) => {
|
||||
return await request.post({ url: `/crm/contact/create-business-list2`, data })
|
||||
}
|
||||
|
||||
// 解除联系人商机关联
|
||||
export const deleteContactBusinessList = async (data: ContactBusinessReqVO) => {
|
||||
return await request.delete({ url: `/crm/contact/delete-business-list`, data })
|
||||
}
|
||||
|
||||
// 解除联系人商机关联
|
||||
export const deleteContactBusinessList2 = async (data: ContactBusiness2ReqVO) => {
|
||||
return await request.delete({ url: `/crm/contact/delete-business-list2`, data })
|
||||
}
|
||||
|
||||
// 联系人转移
|
||||
export const transferContact = async (data: TransferReqVO) => {
|
||||
return await request.put({ url: '/crm/contact/transfer', data })
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface ContractConfigVO {
|
||||
notifyEnabled?: boolean
|
||||
notifyDays?: number
|
||||
}
|
||||
|
||||
// 获取合同配置
|
||||
export const getContractConfig = async () => {
|
||||
return await request.get({ url: `/crm/contract-config/get` })
|
||||
}
|
||||
|
||||
// 更新合同配置
|
||||
export const saveContractConfig = async (data: ContractConfigVO) => {
|
||||
return await request.put({ url: `/crm/contract-config/save`, data })
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
import request from '@/config/axios'
|
||||
import { TransferReqVO } from '@/api/crm/permission'
|
||||
|
||||
export interface ContractVO {
|
||||
id: number
|
||||
name: string
|
||||
no: string
|
||||
customerId: number
|
||||
customerName?: string
|
||||
businessId: number
|
||||
businessName: string
|
||||
contactLastTime: Date
|
||||
ownerUserId: number
|
||||
ownerUserName?: string
|
||||
ownerUserDeptName?: string
|
||||
processInstanceId: number
|
||||
auditStatus: number
|
||||
orderDate: Date
|
||||
startTime: Date
|
||||
endTime: Date
|
||||
totalProductPrice: number
|
||||
discountPercent: number
|
||||
totalPrice: number
|
||||
totalReceivablePrice: number
|
||||
signContactId: number
|
||||
signContactName?: string
|
||||
signUserId: number
|
||||
signUserName: string
|
||||
remark: string
|
||||
createTime?: Date
|
||||
creator: string
|
||||
creatorName: string
|
||||
updateTime?: Date
|
||||
products?: [
|
||||
{
|
||||
id: number
|
||||
productId: number
|
||||
productName: string
|
||||
productNo: string
|
||||
productUnit: number
|
||||
productPrice: number
|
||||
contractPrice: number
|
||||
count: number
|
||||
totalPrice: number
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
// 查询 CRM 合同列表
|
||||
export const getContractPage = async (params) => {
|
||||
return await request.get({ url: `/crm/contract/page`, params })
|
||||
}
|
||||
|
||||
// 查询 CRM 联系人列表,基于指定客户
|
||||
export const getContractPageByCustomer = async (params: any) => {
|
||||
return await request.get({ url: `/crm/contract/page-by-customer`, params })
|
||||
}
|
||||
|
||||
// 查询 CRM 联系人列表,基于指定商机
|
||||
export const getContractPageByBusiness = async (params: any) => {
|
||||
return await request.get({ url: `/crm/contract/page-by-business`, params })
|
||||
}
|
||||
|
||||
// 查询 CRM 合同详情
|
||||
export const getContract = async (id: number) => {
|
||||
return await request.get({ url: `/crm/contract/get?id=` + id })
|
||||
}
|
||||
|
||||
// 查询 CRM 合同下拉列表
|
||||
export const getContractSimpleList = async (customerId: number) => {
|
||||
return await request.get({
|
||||
url: `/crm/contract/simple-list?customerId=${customerId}`
|
||||
})
|
||||
}
|
||||
|
||||
// 新增 CRM 合同
|
||||
export const createContract = async (data: ContractVO) => {
|
||||
return await request.post({ url: `/crm/contract/create`, data })
|
||||
}
|
||||
|
||||
// 修改 CRM 合同
|
||||
export const updateContract = async (data: ContractVO) => {
|
||||
return await request.put({ url: `/crm/contract/update`, data })
|
||||
}
|
||||
|
||||
// 删除 CRM 合同
|
||||
export const deleteContract = async (id: number) => {
|
||||
return await request.delete({ url: `/crm/contract/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出 CRM 合同 Excel
|
||||
export const exportContract = async (params) => {
|
||||
return await request.download({ url: `/crm/contract/export-excel`, params })
|
||||
}
|
||||
|
||||
// 提交审核
|
||||
export const submitContract = async (id: number) => {
|
||||
return await request.put({ url: `/crm/contract/submit?id=${id}` })
|
||||
}
|
||||
|
||||
// 合同转移
|
||||
export const transferContract = async (data: TransferReqVO) => {
|
||||
return await request.put({ url: '/crm/contract/transfer', data })
|
||||
}
|
||||
|
||||
// 获得待审核合同数量
|
||||
export const getAuditContractCount = async () => {
|
||||
return await request.get({ url: '/crm/contract/audit-count' })
|
||||
}
|
||||
|
||||
// 获得即将到期(提醒)的合同数量
|
||||
export const getRemindContractCount = async () => {
|
||||
return await request.get({ url: '/crm/contract/remind-count' })
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
import request from '@/config/axios'
|
||||
import { TransferReqVO } from '@/api/crm/permission'
|
||||
|
||||
export interface CustomerVO {
|
||||
id: number // 编号
|
||||
name: string // 客户名称
|
||||
followUpStatus: boolean // 跟进状态
|
||||
contactLastTime: Date // 最后跟进时间
|
||||
contactLastContent: string // 最后跟进内容
|
||||
contactNextTime: Date // 下次联系时间
|
||||
ownerUserId: number // 负责人的用户编号
|
||||
ownerUserName?: string // 负责人的用户名称
|
||||
ownerUserDept?: string // 负责人的部门名称
|
||||
lockStatus?: boolean
|
||||
dealStatus?: boolean
|
||||
mobile: string // 手机号
|
||||
telephone: string // 电话
|
||||
qq: string // QQ
|
||||
wechat: string // wechat
|
||||
email: string // email
|
||||
areaId: number // 所在地
|
||||
areaName?: string // 所在地名称
|
||||
detailAddress: string // 详细地址
|
||||
industryId: number // 所属行业
|
||||
level: number // 客户等级
|
||||
source: number // 客户来源
|
||||
remark: string // 备注
|
||||
creator: string // 创建人
|
||||
creatorName?: string // 创建人名称
|
||||
createTime: Date // 创建时间
|
||||
updateTime: Date // 更新时间
|
||||
}
|
||||
|
||||
// 查询客户列表
|
||||
export const getCustomerPage = async (params) => {
|
||||
return await request.get({ url: `/crm/customer/page`, params })
|
||||
}
|
||||
|
||||
// 进入公海客户提醒的客户列表
|
||||
export const getPutPoolRemindCustomerPage = async (params) => {
|
||||
return await request.get({ url: `/crm/customer/put-pool-remind-page`, params })
|
||||
}
|
||||
|
||||
// 获得待进入公海客户数量
|
||||
export const getPutPoolRemindCustomerCount = async () => {
|
||||
return await request.get({ url: `/crm/customer/put-pool-remind-count` })
|
||||
}
|
||||
|
||||
// 获得今日需联系客户数量
|
||||
export const getTodayContactCustomerCount = async () => {
|
||||
return await request.get({ url: `/crm/customer/today-contact-count` })
|
||||
}
|
||||
|
||||
// 获得分配给我、待跟进的线索数量的客户数量
|
||||
export const getFollowCustomerCount = async () => {
|
||||
return await request.get({ url: `/crm/customer/follow-count` })
|
||||
}
|
||||
|
||||
// 查询客户详情
|
||||
export const getCustomer = async (id: number) => {
|
||||
return await request.get({ url: `/crm/customer/get?id=` + id })
|
||||
}
|
||||
|
||||
// 新增客户
|
||||
export const createCustomer = async (data: CustomerVO) => {
|
||||
return await request.post({ url: `/crm/customer/create`, data })
|
||||
}
|
||||
|
||||
// 修改客户
|
||||
export const updateCustomer = async (data: CustomerVO) => {
|
||||
return await request.put({ url: `/crm/customer/update`, data })
|
||||
}
|
||||
|
||||
// 更新客户的成交状态
|
||||
export const updateCustomerDealStatus = async (id: number, dealStatus: boolean) => {
|
||||
return await request.put({ url: `/crm/customer/update-deal-status`, params: { id, dealStatus } })
|
||||
}
|
||||
|
||||
// 删除客户
|
||||
export const deleteCustomer = async (id: number) => {
|
||||
return await request.delete({ url: `/crm/customer/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出客户 Excel
|
||||
export const exportCustomer = async (params: any) => {
|
||||
return await request.download({ url: `/crm/customer/export-excel`, params })
|
||||
}
|
||||
|
||||
// 下载客户导入模板
|
||||
export const importCustomerTemplate = () => {
|
||||
return request.download({ url: '/crm/customer/get-import-template' })
|
||||
}
|
||||
|
||||
// 导入客户
|
||||
export const handleImport = async (formData) => {
|
||||
return await request.upload({ url: `/crm/customer/import`, data: formData })
|
||||
}
|
||||
|
||||
// 客户列表
|
||||
export const getCustomerSimpleList = async () => {
|
||||
return await request.get({ url: `/crm/customer/simple-list` })
|
||||
}
|
||||
|
||||
// ======================= 业务操作 =======================
|
||||
|
||||
// 客户转移
|
||||
export const transferCustomer = async (data: TransferReqVO) => {
|
||||
return await request.put({ url: '/crm/customer/transfer', data })
|
||||
}
|
||||
|
||||
// 锁定/解锁客户
|
||||
export const lockCustomer = async (id: number, lockStatus: boolean) => {
|
||||
return await request.put({ url: `/crm/customer/lock`, data: { id, lockStatus } })
|
||||
}
|
||||
|
||||
// 领取公海客户
|
||||
export const receiveCustomer = async (ids: any[]) => {
|
||||
return await request.put({ url: '/crm/customer/receive', params: { ids: ids.join(',') } })
|
||||
}
|
||||
|
||||
// 分配公海给对应负责人
|
||||
export const distributeCustomer = async (ids: any[], ownerUserId: number) => {
|
||||
return await request.put({
|
||||
url: '/crm/customer/distribute',
|
||||
data: { ids: ids, ownerUserId }
|
||||
})
|
||||
}
|
||||
|
||||
// 客户放入公海
|
||||
export const putCustomerPool = async (id: number) => {
|
||||
return await request.put({ url: `/crm/customer/put-pool?id=${id}` })
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface CustomerLimitConfigVO {
|
||||
id?: number
|
||||
type?: number
|
||||
userIds?: string
|
||||
deptIds?: string
|
||||
maxCount?: number
|
||||
dealCountEnabled?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户限制配置类型
|
||||
*/
|
||||
export enum LimitConfType {
|
||||
/**
|
||||
* 拥有客户数限制
|
||||
*/
|
||||
CUSTOMER_QUANTITY_LIMIT = 1,
|
||||
/**
|
||||
* 锁定客户数限制
|
||||
*/
|
||||
CUSTOMER_LOCK_LIMIT = 2
|
||||
}
|
||||
|
||||
// 查询客户限制配置列表
|
||||
export const getCustomerLimitConfigPage = async (params) => {
|
||||
return await request.get({ url: `/crm/customer-limit-config/page`, params })
|
||||
}
|
||||
|
||||
// 查询客户限制配置详情
|
||||
export const getCustomerLimitConfig = async (id: number) => {
|
||||
return await request.get({ url: `/crm/customer-limit-config/get?id=` + id })
|
||||
}
|
||||
|
||||
// 新增客户限制配置
|
||||
export const createCustomerLimitConfig = async (data: CustomerLimitConfigVO) => {
|
||||
return await request.post({ url: `/crm/customer-limit-config/create`, data })
|
||||
}
|
||||
|
||||
// 修改客户限制配置
|
||||
export const updateCustomerLimitConfig = async (data: CustomerLimitConfigVO) => {
|
||||
return await request.put({ url: `/crm/customer-limit-config/update`, data })
|
||||
}
|
||||
|
||||
// 删除客户限制配置
|
||||
export const deleteCustomerLimitConfig = async (id: number) => {
|
||||
return await request.delete({ url: `/crm/customer-limit-config/delete?id=` + id })
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface CustomerPoolConfigVO {
|
||||
enabled?: boolean
|
||||
contactExpireDays?: number
|
||||
dealExpireDays?: number
|
||||
notifyEnabled?: boolean
|
||||
notifyDays?: number
|
||||
}
|
||||
|
||||
// 获取客户公海规则设置
|
||||
export const getCustomerPoolConfig = async () => {
|
||||
return await request.get({ url: `/crm/customer-pool-config/get` })
|
||||
}
|
||||
|
||||
// 更新客户公海规则设置
|
||||
export const saveCustomerPoolConfig = async (data: CustomerPoolConfigVO) => {
|
||||
return await request.put({ url: `/crm/customer-pool-config/save`, data })
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 跟进记录 VO
|
||||
export interface FollowUpRecordVO {
|
||||
id: number // 编号
|
||||
bizType: number // 数据类型
|
||||
bizId: number // 数据编号
|
||||
type: number // 跟进类型
|
||||
content: string // 跟进内容
|
||||
picUrls: string[] // 图片
|
||||
fileUrls: string[] // 附件
|
||||
nextTime: Date // 下次联系时间
|
||||
businessIds: number[] // 关联的商机编号数组
|
||||
businesses: {
|
||||
id: number
|
||||
name: string
|
||||
}[] // 关联的商机数组
|
||||
contactIds: number[] // 关联的联系人编号数组
|
||||
contacts: {
|
||||
id: number
|
||||
name: string
|
||||
}[] // 关联的联系人数组
|
||||
creator: string
|
||||
creatorName?: string
|
||||
}
|
||||
|
||||
// 跟进记录 API
|
||||
export const FollowUpRecordApi = {
|
||||
// 查询跟进记录分页
|
||||
getFollowUpRecordPage: async (params: any) => {
|
||||
return await request.get({ url: `/crm/follow-up-record/page`, params })
|
||||
},
|
||||
|
||||
// 新增跟进记录
|
||||
createFollowUpRecord: async (data: FollowUpRecordVO) => {
|
||||
return await request.post({ url: `/crm/follow-up-record/create`, data })
|
||||
},
|
||||
|
||||
// 删除跟进记录
|
||||
deleteFollowUpRecord: async (id: number) => {
|
||||
return await request.delete({ url: `/crm/follow-up-record/delete?id=` + id })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface OperateLogVO extends PageParam {
|
||||
bizType: number
|
||||
bizId: number
|
||||
}
|
||||
|
||||
// 获得操作日志
|
||||
export const getOperateLogPage = async (params: OperateLogVO) => {
|
||||
return await request.get({ url: `/crm/operate-log/page`, params })
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface PermissionVO {
|
||||
id?: number // 数据权限编号
|
||||
userId: number // 用户编号
|
||||
bizType: number // Crm 类型
|
||||
bizId: number // Crm 类型数据编号
|
||||
level: number // 权限级别
|
||||
toBizTypes?: number[] // 同时添加至
|
||||
deptName?: string // 部门名称
|
||||
nickname?: string // 用户昵称
|
||||
postNames?: string[] // 岗位名称数组
|
||||
createTime?: Date
|
||||
ids?: number[]
|
||||
}
|
||||
|
||||
export interface TransferReqVO {
|
||||
id: number // 模块编号
|
||||
newOwnerUserId: number // 新负责人的用户编号
|
||||
oldOwnerPermissionLevel?: number // 老负责人加入团队后的权限级别
|
||||
toBizTypes?: number[] // 转移客户时,需要额外有【联系人】【商机】【合同】的 checkbox 选择
|
||||
}
|
||||
|
||||
/**
|
||||
* CRM 业务类型枚举
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
export enum BizTypeEnum {
|
||||
CRM_CLUE = 1, // 线索
|
||||
CRM_CUSTOMER = 2, // 客户
|
||||
CRM_CONTACT = 3, // 联系人
|
||||
CRM_BUSINESS = 4, // 商机
|
||||
CRM_CONTRACT = 5, // 合同
|
||||
CRM_PRODUCT = 6, // 产品
|
||||
CRM_RECEIVABLE = 7, // 回款
|
||||
CRM_RECEIVABLE_PLAN = 8 // 回款计划
|
||||
}
|
||||
|
||||
/**
|
||||
* CRM 数据权限级别枚举
|
||||
*/
|
||||
export enum PermissionLevelEnum {
|
||||
OWNER = 1, // 负责人
|
||||
READ = 2, // 只读
|
||||
WRITE = 3 // 读写
|
||||
}
|
||||
|
||||
// 获得数据权限列表(查询团队成员列表)
|
||||
export const getPermissionList = async (params) => {
|
||||
return await request.get({ url: `/crm/permission/list`, params })
|
||||
}
|
||||
|
||||
// 创建数据权限(新增团队成员)
|
||||
export const createPermission = async (data: PermissionVO) => {
|
||||
return await request.post({ url: `/crm/permission/create`, data })
|
||||
}
|
||||
|
||||
// 编辑数据权限(修改团队成员权限级别)
|
||||
export const updatePermission = async (data) => {
|
||||
return await request.put({ url: `/crm/permission/update`, data })
|
||||
}
|
||||
|
||||
// 删除数据权限(删除团队成员)
|
||||
export const deletePermissionBatch = async (val: number[]) => {
|
||||
return await request.delete({ url: '/crm/permission/delete?ids=' + val.join(',') })
|
||||
}
|
||||
|
||||
// 删除自己的数据权限(退出团队)
|
||||
export const deleteSelfPermission = async (id: number) => {
|
||||
return await request.delete({ url: '/crm/permission/delete-self?id=' + id })
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// TODO @zange:挪到 product 下,建个 category 包,挪进去哈;
|
||||
export interface ProductCategoryVO {
|
||||
id: number
|
||||
name: string
|
||||
parentId: number
|
||||
}
|
||||
|
||||
// 查询产品分类详情
|
||||
export const getProductCategory = async (id: number) => {
|
||||
return await request.get({ url: `/crm/product-category/get?id=` + id })
|
||||
}
|
||||
|
||||
// 新增产品分类
|
||||
export const createProductCategory = async (data: ProductCategoryVO) => {
|
||||
return await request.post({ url: `/crm/product-category/create`, data })
|
||||
}
|
||||
|
||||
// 修改产品分类
|
||||
export const updateProductCategory = async (data: ProductCategoryVO) => {
|
||||
return await request.put({ url: `/crm/product-category/update`, data })
|
||||
}
|
||||
|
||||
// 删除产品分类
|
||||
export const deleteProductCategory = async (id: number) => {
|
||||
return await request.delete({ url: `/crm/product-category/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 产品分类列表
|
||||
export const getProductCategoryList = async (params) => {
|
||||
return await request.get({ url: `/crm/product-category/list`, params })
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface ProductVO {
|
||||
id: number
|
||||
name: string
|
||||
no: string
|
||||
unit: number
|
||||
price: number
|
||||
status: number
|
||||
categoryId: number
|
||||
categoryName?: string
|
||||
description: string
|
||||
ownerUserId: number
|
||||
}
|
||||
|
||||
// 查询产品列表
|
||||
export const getProductPage = async (params) => {
|
||||
return await request.get({ url: `/crm/product/page`, params })
|
||||
}
|
||||
|
||||
// 获得产品精简列表
|
||||
export const getProductSimpleList = async () => {
|
||||
return await request.get({ url: `/crm/product/simple-list` })
|
||||
}
|
||||
|
||||
// 查询产品详情
|
||||
export const getProduct = async (id: number) => {
|
||||
return await request.get({ url: `/crm/product/get?id=` + id })
|
||||
}
|
||||
|
||||
// 新增产品
|
||||
export const createProduct = async (data: ProductVO) => {
|
||||
return await request.post({ url: `/crm/product/create`, data })
|
||||
}
|
||||
|
||||
// 修改产品
|
||||
export const updateProduct = async (data: ProductVO) => {
|
||||
return await request.put({ url: `/crm/product/update`, data })
|
||||
}
|
||||
|
||||
// 删除产品
|
||||
export const deleteProduct = async (id: number) => {
|
||||
return await request.delete({ url: `/crm/product/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出产品 Excel
|
||||
export const exportProduct = async (params) => {
|
||||
return await request.download({ url: `/crm/product/export-excel`, params })
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface ReceivableVO {
|
||||
id: number
|
||||
no: string
|
||||
planId?: number
|
||||
customerId?: number
|
||||
customerName?: string
|
||||
contractId?: number
|
||||
contract?: {
|
||||
id?: number
|
||||
name?: string
|
||||
no: string
|
||||
totalPrice: number
|
||||
}
|
||||
auditStatus: number
|
||||
processInstanceId: number
|
||||
returnTime: Date
|
||||
returnType: number
|
||||
price: number
|
||||
ownerUserId: number
|
||||
ownerUserName?: string
|
||||
remark: string
|
||||
creator: string // 创建人
|
||||
creatorName?: string // 创建人名称
|
||||
createTime: Date // 创建时间
|
||||
updateTime: Date // 更新时间
|
||||
}
|
||||
|
||||
// 查询回款列表
|
||||
export const getReceivablePage = async (params) => {
|
||||
return await request.get({ url: `/crm/receivable/page`, params })
|
||||
}
|
||||
|
||||
// 查询回款列表
|
||||
export const getReceivablePageByCustomer = async (params) => {
|
||||
return await request.get({ url: `/crm/receivable/page-by-customer`, params })
|
||||
}
|
||||
|
||||
// 查询回款详情
|
||||
export const getReceivable = async (id: number) => {
|
||||
return await request.get({ url: `/crm/receivable/get?id=` + id })
|
||||
}
|
||||
|
||||
// 新增回款
|
||||
export const createReceivable = async (data: ReceivableVO) => {
|
||||
return await request.post({ url: `/crm/receivable/create`, data })
|
||||
}
|
||||
|
||||
// 修改回款
|
||||
export const updateReceivable = async (data: ReceivableVO) => {
|
||||
return await request.put({ url: `/crm/receivable/update`, data })
|
||||
}
|
||||
|
||||
// 删除回款
|
||||
export const deleteReceivable = async (id: number) => {
|
||||
return await request.delete({ url: `/crm/receivable/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出回款 Excel
|
||||
export const exportReceivable = async (params) => {
|
||||
return await request.download({ url: `/crm/receivable/export-excel`, params })
|
||||
}
|
||||
|
||||
// 提交审核
|
||||
export const submitReceivable = async (id: number) => {
|
||||
return await request.put({ url: `/crm/receivable/submit?id=${id}` })
|
||||
}
|
||||
|
||||
// 获得待审核回款数量
|
||||
export const getAuditReceivableCount = async () => {
|
||||
return await request.get({ url: '/crm/receivable/audit-count' })
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface ReceivablePlanVO {
|
||||
id: number
|
||||
period: number
|
||||
receivableId: number
|
||||
price: number
|
||||
returnTime: Date
|
||||
remindDays: number
|
||||
returnType: number
|
||||
remindTime: Date
|
||||
customerId: number
|
||||
customerName?: string
|
||||
contractId?: number
|
||||
contractNo?: string
|
||||
ownerUserId: number
|
||||
ownerUserName?: string
|
||||
remark: string
|
||||
creator: string // 创建人
|
||||
creatorName?: string // 创建人名称
|
||||
createTime: Date // 创建时间
|
||||
updateTime: Date // 更新时间
|
||||
receivable?: {
|
||||
price: number
|
||||
returnTime: Date
|
||||
}
|
||||
}
|
||||
|
||||
// 查询回款计划列表
|
||||
export const getReceivablePlanPage = async (params) => {
|
||||
return await request.get({ url: `/crm/receivable-plan/page`, params })
|
||||
}
|
||||
|
||||
// 查询回款计划列表
|
||||
export const getReceivablePlanPageByCustomer = async (params) => {
|
||||
return await request.get({ url: `/crm/receivable-plan/page-by-customer`, params })
|
||||
}
|
||||
|
||||
// 查询回款计划详情
|
||||
export const getReceivablePlan = async (id: number) => {
|
||||
return await request.get({ url: `/crm/receivable-plan/get?id=` + id })
|
||||
}
|
||||
|
||||
// 查询回款计划下拉数据
|
||||
export const getReceivablePlanSimpleList = async (customerId: number, contractId: number) => {
|
||||
return await request.get({
|
||||
url: `/crm/receivable-plan/simple-list?customerId=${customerId}&contractId=${contractId}`
|
||||
})
|
||||
}
|
||||
|
||||
// 新增回款计划
|
||||
export const createReceivablePlan = async (data: ReceivablePlanVO) => {
|
||||
return await request.post({ url: `/crm/receivable-plan/create`, data })
|
||||
}
|
||||
|
||||
// 修改回款计划
|
||||
export const updateReceivablePlan = async (data: ReceivablePlanVO) => {
|
||||
return await request.put({ url: `/crm/receivable-plan/update`, data })
|
||||
}
|
||||
|
||||
// 删除回款计划
|
||||
export const deleteReceivablePlan = async (id: number) => {
|
||||
return await request.delete({ url: `/crm/receivable-plan/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出回款计划 Excel
|
||||
export const exportReceivablePlan = async (params) => {
|
||||
return await request.download({ url: `/crm/receivable-plan/export-excel`, params })
|
||||
}
|
||||
|
||||
// 获得待回款提醒数量
|
||||
export const getReceivablePlanRemindCount = async () => {
|
||||
return await request.get({ url: '/crm/receivable-plan/remind-count' })
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface CrmStatisticsCustomerSummaryByDateRespVO {
|
||||
time: string
|
||||
customerCreateCount: number
|
||||
customerDealCount: number
|
||||
}
|
||||
|
||||
export interface CrmStatisticsCustomerSummaryByUserRespVO {
|
||||
ownerUserName: string
|
||||
customerCreateCount: number
|
||||
customerDealCount: number
|
||||
contractPrice: number
|
||||
receivablePrice: number
|
||||
}
|
||||
|
||||
export interface CrmStatisticsFollowUpSummaryByDateRespVO {
|
||||
time: string
|
||||
followUpRecordCount: number
|
||||
followUpCustomerCount: number
|
||||
}
|
||||
|
||||
export interface CrmStatisticsFollowUpSummaryByUserRespVO {
|
||||
ownerUserName: string
|
||||
followupRecordCount: number
|
||||
followupCustomerCount: number
|
||||
}
|
||||
|
||||
export interface CrmStatisticsFollowUpSummaryByTypeRespVO {
|
||||
followUpType: string
|
||||
followUpRecordCount: number
|
||||
}
|
||||
|
||||
export interface CrmStatisticsCustomerContractSummaryRespVO {
|
||||
customerName: string
|
||||
contractName: string
|
||||
totalPrice: number
|
||||
receivablePrice: number
|
||||
customerType: string
|
||||
customerSource: string
|
||||
ownerUserName: string
|
||||
creatorUserName: string
|
||||
createTime: Date
|
||||
orderDate: Date
|
||||
}
|
||||
|
||||
export interface CrmStatisticsPoolSummaryByDateRespVO {
|
||||
time: string
|
||||
customerPutCount: number
|
||||
customerTakeCount: number
|
||||
}
|
||||
|
||||
export interface CrmStatisticsPoolSummaryByUserRespVO {
|
||||
ownerUserName: string
|
||||
customerPutCount: number
|
||||
customerTakeCount: number
|
||||
}
|
||||
|
||||
export interface CrmStatisticsCustomerDealCycleByDateRespVO {
|
||||
time: string
|
||||
customerDealCycle: number
|
||||
}
|
||||
|
||||
export interface CrmStatisticsCustomerDealCycleByUserRespVO {
|
||||
ownerUserName: string
|
||||
customerDealCycle: number
|
||||
customerDealCount: number
|
||||
}
|
||||
|
||||
export interface CrmStatisticsCustomerDealCycleByAreaRespVO {
|
||||
areaName: string
|
||||
customerDealCycle: number
|
||||
customerDealCount: number
|
||||
}
|
||||
|
||||
export interface CrmStatisticsCustomerDealCycleByProductRespVO {
|
||||
productName: string
|
||||
customerDealCycle: number
|
||||
customerDealCount: number
|
||||
}
|
||||
|
||||
// 客户分析 API
|
||||
export const StatisticsCustomerApi = {
|
||||
// 1.1 客户总量分析(按日期)
|
||||
getCustomerSummaryByDate: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-customer/get-customer-summary-by-date',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 1.2 客户总量分析(按用户)
|
||||
getCustomerSummaryByUser: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-customer/get-customer-summary-by-user',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 2.1 客户跟进次数分析(按日期)
|
||||
getFollowUpSummaryByDate: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-customer/get-follow-up-summary-by-date',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 2.2 客户跟进次数分析(按用户)
|
||||
getFollowUpSummaryByUser: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-customer/get-follow-up-summary-by-user',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 3.1 获取客户跟进方式统计数
|
||||
getFollowUpSummaryByType: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-customer/get-follow-up-summary-by-type',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 4.1 合同摘要信息(客户转化率页面)
|
||||
getContractSummary: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-customer/get-contract-summary',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 5.1 获取客户公海分析(按日期)
|
||||
getPoolSummaryByDate: (param: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-customer/get-pool-summary-by-date',
|
||||
params: param
|
||||
})
|
||||
},
|
||||
// 5.2 获取客户公海分析(按用户)
|
||||
getPoolSummaryByUser: (param: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-customer/get-pool-summary-by-user',
|
||||
params: param
|
||||
})
|
||||
},
|
||||
// 6.1 获取客户成交周期(按日期)
|
||||
getCustomerDealCycleByDate: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-customer/get-customer-deal-cycle-by-date',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 6.2 获取客户成交周期(按用户)
|
||||
getCustomerDealCycleByUser: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-customer/get-customer-deal-cycle-by-user',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 6.2 获取客户成交周期(按用户)
|
||||
getCustomerDealCycleByArea: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-customer/get-customer-deal-cycle-by-area',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 6.2 获取客户成交周期(按用户)
|
||||
getCustomerDealCycleByProduct: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-customer/get-customer-deal-cycle-by-product',
|
||||
params
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface CrmStatisticFunnelRespVO {
|
||||
customerCount: number // 客户数
|
||||
businessCount: number // 商机数
|
||||
businessWinCount: number // 赢单数
|
||||
}
|
||||
|
||||
export interface CrmStatisticsBusinessSummaryByDateRespVO {
|
||||
time: string // 时间
|
||||
businessCreateCount: number // 商机数
|
||||
totalPrice: number | string // 商机金额
|
||||
}
|
||||
|
||||
export interface CrmStatisticsBusinessInversionRateSummaryByDateRespVO {
|
||||
time: string // 时间
|
||||
businessCount: number // 商机数量
|
||||
businessWinCount: number // 赢单商机数
|
||||
}
|
||||
|
||||
// 客户分析 API
|
||||
export const StatisticFunnelApi = {
|
||||
// 1. 获取销售漏斗统计数据
|
||||
getFunnelSummary: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-funnel/get-funnel-summary',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 2. 获取商机结束状态统计
|
||||
getBusinessSummaryByEndStatus: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-funnel/get-business-summary-by-end-status',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 3. 获取新增商机分析(按日期)
|
||||
getBusinessSummaryByDate: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-funnel/get-business-summary-by-date',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 4. 获取商机转化率分析(按日期)
|
||||
getBusinessInversionRateSummaryByDate: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-funnel/get-business-inversion-rate-summary-by-date',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 5. 获取商机列表(按日期)
|
||||
getBusinessPageByDate: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-funnel/get-business-page-by-date',
|
||||
params
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface StatisticsPerformanceRespVO {
|
||||
time: string
|
||||
currentMonthCount: number
|
||||
lastMonthCount: number
|
||||
lastYearCount: number
|
||||
}
|
||||
|
||||
// 排行 API
|
||||
export const StatisticsPerformanceApi = {
|
||||
// 员工获得合同金额统计
|
||||
getContractPricePerformance: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-performance/get-contract-price-performance',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 员工获得回款统计
|
||||
getReceivablePricePerformance: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-performance/get-receivable-price-performance',
|
||||
params
|
||||
})
|
||||
},
|
||||
//员工获得签约合同数量统计
|
||||
getContractCountPerformance: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-performance/get-contract-count-performance',
|
||||
params
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface CrmStatisticCustomerBaseRespVO {
|
||||
customerCount: number
|
||||
dealCount: number
|
||||
dealPortion: string | number
|
||||
}
|
||||
|
||||
export interface CrmStatisticCustomerIndustryRespVO extends CrmStatisticCustomerBaseRespVO {
|
||||
industryId: number
|
||||
industryPortion: string | number
|
||||
}
|
||||
|
||||
export interface CrmStatisticCustomerSourceRespVO extends CrmStatisticCustomerBaseRespVO {
|
||||
source: number
|
||||
sourcePortion: string | number
|
||||
}
|
||||
|
||||
export interface CrmStatisticCustomerLevelRespVO extends CrmStatisticCustomerBaseRespVO {
|
||||
level: number
|
||||
levelPortion: string | number
|
||||
}
|
||||
|
||||
export interface CrmStatisticCustomerAreaRespVO extends CrmStatisticCustomerBaseRespVO {
|
||||
areaId: number
|
||||
areaName: string
|
||||
areaPortion: string | number
|
||||
}
|
||||
|
||||
// 客户分析 API
|
||||
export const StatisticsPortraitApi = {
|
||||
// 1. 获取客户行业统计数据
|
||||
getCustomerIndustry: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-portrait/get-customer-industry-summary',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 2. 获取客户来源统计数据
|
||||
getCustomerSource: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-portrait/get-customer-source-summary',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 3. 获取客户级别统计数据
|
||||
getCustomerLevel: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-portrait/get-customer-level-summary',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 4. 获取客户地区统计数据
|
||||
getCustomerArea: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-portrait/get-customer-area-summary',
|
||||
params
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface StatisticsRankRespVO {
|
||||
count: number
|
||||
nickname: string
|
||||
deptName: string
|
||||
}
|
||||
|
||||
// 排行 API
|
||||
export const StatisticsRankApi = {
|
||||
// 获得合同排行榜
|
||||
getContractPriceRank: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-rank/get-contract-price-rank',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 获得回款排行榜
|
||||
getReceivablePriceRank: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-rank/get-receivable-price-rank',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 签约合同排行
|
||||
getContractCountRank: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-rank/get-contract-count-rank',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 产品销量排行
|
||||
getProductSalesRank: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-rank/get-product-sales-rank',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 新增客户数排行
|
||||
getCustomerCountRank: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-rank/get-customer-count-rank',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 新增联系人数排行
|
||||
getContactsCountRank: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-rank/get-contacts-count-rank',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 跟进次数排行
|
||||
getFollowCountRank: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-rank/get-follow-count-rank',
|
||||
params
|
||||
})
|
||||
},
|
||||
// 跟进客户数排行
|
||||
getFollowCustomerCountRank: (params: any) => {
|
||||
return request.get({
|
||||
url: '/crm/statistics-rank/get-follow-customer-count-rank',
|
||||
params
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 结算账户 VO
|
||||
export interface AccountVO {
|
||||
id: number // 结算账户编号
|
||||
no: string // 账户编码
|
||||
remark: string // 备注
|
||||
status: number // 开启状态
|
||||
sort: number // 排序
|
||||
defaultStatus: boolean // 是否默认
|
||||
name: string // 账户名称
|
||||
}
|
||||
|
||||
// ERP 结算账户 API
|
||||
export const AccountApi = {
|
||||
// 查询结算账户分页
|
||||
getAccountPage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/account/page`, params })
|
||||
},
|
||||
|
||||
// 查询结算账户精简列表
|
||||
getAccountSimpleList: async () => {
|
||||
return await request.get({ url: `/erp/account/simple-list` })
|
||||
},
|
||||
|
||||
// 查询结算账户详情
|
||||
getAccount: async (id: number) => {
|
||||
return await request.get({ url: `/erp/account/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增结算账户
|
||||
createAccount: async (data: AccountVO) => {
|
||||
return await request.post({ url: `/erp/account/create`, data })
|
||||
},
|
||||
|
||||
// 修改结算账户
|
||||
updateAccount: async (data: AccountVO) => {
|
||||
return await request.put({ url: `/erp/account/update`, data })
|
||||
},
|
||||
|
||||
// 修改结算账户默认状态
|
||||
updateAccountDefaultStatus: async (id: number, defaultStatus: boolean) => {
|
||||
return await request.put({
|
||||
url: `/erp/account/update-default-status`,
|
||||
params: {
|
||||
id,
|
||||
defaultStatus
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 删除结算账户
|
||||
deleteAccount: async (id: number) => {
|
||||
return await request.delete({ url: `/erp/account/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出结算账户 Excel
|
||||
exportAccount: async (params: any) => {
|
||||
return await request.download({ url: `/erp/account/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 付款单 VO
|
||||
export interface FinancePaymentVO {
|
||||
id: number // 付款单编号
|
||||
no: string // 付款单号
|
||||
supplierId: number // 供应商编号
|
||||
paymentTime: Date // 付款时间
|
||||
totalPrice: number // 合计金额,单位:元
|
||||
status: number // 状态
|
||||
remark: string // 备注
|
||||
}
|
||||
|
||||
// ERP 付款单 API
|
||||
export const FinancePaymentApi = {
|
||||
// 查询付款单分页
|
||||
getFinancePaymentPage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/finance-payment/page`, params })
|
||||
},
|
||||
|
||||
// 查询付款单详情
|
||||
getFinancePayment: async (id: number) => {
|
||||
return await request.get({ url: `/erp/finance-payment/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增付款单
|
||||
createFinancePayment: async (data: FinancePaymentVO) => {
|
||||
return await request.post({ url: `/erp/finance-payment/create`, data })
|
||||
},
|
||||
|
||||
// 修改付款单
|
||||
updateFinancePayment: async (data: FinancePaymentVO) => {
|
||||
return await request.put({ url: `/erp/finance-payment/update`, data })
|
||||
},
|
||||
|
||||
// 更新付款单的状态
|
||||
updateFinancePaymentStatus: async (id: number, status: number) => {
|
||||
return await request.put({
|
||||
url: `/erp/finance-payment/update-status`,
|
||||
params: {
|
||||
id,
|
||||
status
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 删除付款单
|
||||
deleteFinancePayment: async (ids: number[]) => {
|
||||
return await request.delete({
|
||||
url: `/erp/finance-payment/delete`,
|
||||
params: {
|
||||
ids: ids.join(',')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 导出付款单 Excel
|
||||
exportFinancePayment: async (params: any) => {
|
||||
return await request.download({ url: `/erp/finance-payment/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 收款单 VO
|
||||
export interface FinanceReceiptVO {
|
||||
id: number // 收款单编号
|
||||
no: string // 收款单号
|
||||
customerId: number // 客户编号
|
||||
receiptTime: Date // 收款时间
|
||||
totalPrice: number // 合计金额,单位:元
|
||||
status: number // 状态
|
||||
remark: string // 备注
|
||||
}
|
||||
|
||||
// ERP 收款单 API
|
||||
export const FinanceReceiptApi = {
|
||||
// 查询收款单分页
|
||||
getFinanceReceiptPage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/finance-receipt/page`, params })
|
||||
},
|
||||
|
||||
// 查询收款单详情
|
||||
getFinanceReceipt: async (id: number) => {
|
||||
return await request.get({ url: `/erp/finance-receipt/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增收款单
|
||||
createFinanceReceipt: async (data: FinanceReceiptVO) => {
|
||||
return await request.post({ url: `/erp/finance-receipt/create`, data })
|
||||
},
|
||||
|
||||
// 修改收款单
|
||||
updateFinanceReceipt: async (data: FinanceReceiptVO) => {
|
||||
return await request.put({ url: `/erp/finance-receipt/update`, data })
|
||||
},
|
||||
|
||||
// 更新收款单的状态
|
||||
updateFinanceReceiptStatus: async (id: number, status: number) => {
|
||||
return await request.put({
|
||||
url: `/erp/finance-receipt/update-status`,
|
||||
params: {
|
||||
id,
|
||||
status
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 删除收款单
|
||||
deleteFinanceReceipt: async (ids: number[]) => {
|
||||
return await request.delete({
|
||||
url: `/erp/finance-receipt/delete`,
|
||||
params: {
|
||||
ids: ids.join(',')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 导出收款单 Excel
|
||||
exportFinanceReceipt: async (params: any) => {
|
||||
return await request.download({ url: `/erp/finance-receipt/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 产品分类 VO
|
||||
export interface ProductCategoryVO {
|
||||
id: number // 分类编号
|
||||
parentId: number // 父分类编号
|
||||
name: string // 分类名称
|
||||
code: string // 分类编码
|
||||
sort: number // 分类排序
|
||||
status: number // 开启状态
|
||||
}
|
||||
|
||||
// ERP 产品分类 API
|
||||
export const ProductCategoryApi = {
|
||||
// 查询产品分类列表
|
||||
getProductCategoryList: async () => {
|
||||
return await request.get({ url: `/erp/product-category/list` })
|
||||
},
|
||||
|
||||
// 查询产品分类精简列表
|
||||
getProductCategorySimpleList: async () => {
|
||||
return await request.get({ url: `/erp/product-category/simple-list` })
|
||||
},
|
||||
|
||||
// 查询产品分类详情
|
||||
getProductCategory: async (id: number) => {
|
||||
return await request.get({ url: `/erp/product-category/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增产品分类
|
||||
createProductCategory: async (data: ProductCategoryVO) => {
|
||||
return await request.post({ url: `/erp/product-category/create`, data })
|
||||
},
|
||||
|
||||
// 修改产品分类
|
||||
updateProductCategory: async (data: ProductCategoryVO) => {
|
||||
return await request.put({ url: `/erp/product-category/update`, data })
|
||||
},
|
||||
|
||||
// 删除产品分类
|
||||
deleteProductCategory: async (id: number) => {
|
||||
return await request.delete({ url: `/erp/product-category/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出产品分类 Excel
|
||||
exportProductCategory: async (params) => {
|
||||
return await request.download({ url: `/erp/product-category/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 产品 VO
|
||||
export interface ProductVO {
|
||||
id: number // 产品编号
|
||||
name: string // 产品名称
|
||||
barCode: string // 产品条码
|
||||
categoryId: number // 产品类型编号
|
||||
unitId: number // 单位编号
|
||||
unitName?: string // 单位名字
|
||||
status: number // 产品状态
|
||||
standard: string // 产品规格
|
||||
remark: string // 产品备注
|
||||
expiryDay: number // 保质期天数
|
||||
weight: number // 重量(kg)
|
||||
purchasePrice: number // 采购价格,单位:元
|
||||
salePrice: number // 销售价格,单位:元
|
||||
minPrice: number // 最低价格,单位:元
|
||||
}
|
||||
|
||||
// ERP 产品 API
|
||||
export const ProductApi = {
|
||||
// 查询产品分页
|
||||
getProductPage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/product/page`, params })
|
||||
},
|
||||
|
||||
// 查询产品精简列表
|
||||
getProductSimpleList: async () => {
|
||||
return await request.get({ url: `/erp/product/simple-list` })
|
||||
},
|
||||
|
||||
// 查询产品详情
|
||||
getProduct: async (id: number) => {
|
||||
return await request.get({ url: `/erp/product/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增产品
|
||||
createProduct: async (data: ProductVO) => {
|
||||
return await request.post({ url: `/erp/product/create`, data })
|
||||
},
|
||||
|
||||
// 修改产品
|
||||
updateProduct: async (data: ProductVO) => {
|
||||
return await request.put({ url: `/erp/product/update`, data })
|
||||
},
|
||||
|
||||
// 删除产品
|
||||
deleteProduct: async (id: number) => {
|
||||
return await request.delete({ url: `/erp/product/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出产品 Excel
|
||||
exportProduct: async (params) => {
|
||||
return await request.download({ url: `/erp/product/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 产品单位 VO
|
||||
export interface ProductUnitVO {
|
||||
id: number // 单位编号
|
||||
name: string // 单位名字
|
||||
status: number // 单位状态
|
||||
}
|
||||
|
||||
// ERP 产品单位 API
|
||||
export const ProductUnitApi = {
|
||||
// 查询产品单位分页
|
||||
getProductUnitPage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/product-unit/page`, params })
|
||||
},
|
||||
|
||||
// 查询产品单位精简列表
|
||||
getProductUnitSimpleList: async () => {
|
||||
return await request.get({ url: `/erp/product-unit/simple-list` })
|
||||
},
|
||||
|
||||
// 查询产品单位详情
|
||||
getProductUnit: async (id: number) => {
|
||||
return await request.get({ url: `/erp/product-unit/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增产品单位
|
||||
createProductUnit: async (data: ProductUnitVO) => {
|
||||
return await request.post({ url: `/erp/product-unit/create`, data })
|
||||
},
|
||||
|
||||
// 修改产品单位
|
||||
updateProductUnit: async (data: ProductUnitVO) => {
|
||||
return await request.put({ url: `/erp/product-unit/update`, data })
|
||||
},
|
||||
|
||||
// 删除产品单位
|
||||
deleteProductUnit: async (id: number) => {
|
||||
return await request.delete({ url: `/erp/product-unit/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出产品单位 Excel
|
||||
exportProductUnit: async (params) => {
|
||||
return await request.download({ url: `/erp/product-unit/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 采购入库 VO
|
||||
export interface PurchaseInVO {
|
||||
id: number // 入库工单编号
|
||||
no: string // 采购入库号
|
||||
customerId: number // 客户编号
|
||||
inTime: Date // 入库时间
|
||||
totalCount: number // 合计数量
|
||||
totalPrice: number // 合计金额,单位:元
|
||||
status: number // 状态
|
||||
remark: string // 备注
|
||||
outCount: number // 采购出库数量
|
||||
returnCount: number // 采购退货数量
|
||||
}
|
||||
|
||||
// ERP 采购入库 API
|
||||
export const PurchaseInApi = {
|
||||
// 查询采购入库分页
|
||||
getPurchaseInPage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/purchase-in/page`, params })
|
||||
},
|
||||
|
||||
// 查询采购入库详情
|
||||
getPurchaseIn: async (id: number) => {
|
||||
return await request.get({ url: `/erp/purchase-in/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增采购入库
|
||||
createPurchaseIn: async (data: PurchaseInVO) => {
|
||||
return await request.post({ url: `/erp/purchase-in/create`, data })
|
||||
},
|
||||
|
||||
// 修改采购入库
|
||||
updatePurchaseIn: async (data: PurchaseInVO) => {
|
||||
return await request.put({ url: `/erp/purchase-in/update`, data })
|
||||
},
|
||||
|
||||
// 更新采购入库的状态
|
||||
updatePurchaseInStatus: async (id: number, status: number) => {
|
||||
return await request.put({
|
||||
url: `/erp/purchase-in/update-status`,
|
||||
params: {
|
||||
id,
|
||||
status
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 删除采购入库
|
||||
deletePurchaseIn: async (ids: number[]) => {
|
||||
return await request.delete({
|
||||
url: `/erp/purchase-in/delete`,
|
||||
params: {
|
||||
ids: ids.join(',')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 导出采购入库 Excel
|
||||
exportPurchaseIn: async (params: any) => {
|
||||
return await request.download({ url: `/erp/purchase-in/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 采购订单 VO
|
||||
export interface PurchaseOrderVO {
|
||||
id: number // 订单工单编号
|
||||
no: string // 采购订单号
|
||||
customerId: number // 客户编号
|
||||
orderTime: Date // 订单时间
|
||||
totalCount: number // 合计数量
|
||||
totalPrice: number // 合计金额,单位:元
|
||||
status: number // 状态
|
||||
remark: string // 备注
|
||||
outCount: number // 采购出库数量
|
||||
returnCount: number // 采购退货数量
|
||||
}
|
||||
|
||||
// ERP 采购订单 API
|
||||
export const PurchaseOrderApi = {
|
||||
// 查询采购订单分页
|
||||
getPurchaseOrderPage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/purchase-order/page`, params })
|
||||
},
|
||||
|
||||
// 查询采购订单详情
|
||||
getPurchaseOrder: async (id: number) => {
|
||||
return await request.get({ url: `/erp/purchase-order/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增采购订单
|
||||
createPurchaseOrder: async (data: PurchaseOrderVO) => {
|
||||
return await request.post({ url: `/erp/purchase-order/create`, data })
|
||||
},
|
||||
|
||||
// 修改采购订单
|
||||
updatePurchaseOrder: async (data: PurchaseOrderVO) => {
|
||||
return await request.put({ url: `/erp/purchase-order/update`, data })
|
||||
},
|
||||
|
||||
// 更新采购订单的状态
|
||||
updatePurchaseOrderStatus: async (id: number, status: number) => {
|
||||
return await request.put({
|
||||
url: `/erp/purchase-order/update-status`,
|
||||
params: {
|
||||
id,
|
||||
status
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 删除采购订单
|
||||
deletePurchaseOrder: async (ids: number[]) => {
|
||||
return await request.delete({
|
||||
url: `/erp/purchase-order/delete`,
|
||||
params: {
|
||||
ids: ids.join(',')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 导出采购订单 Excel
|
||||
exportPurchaseOrder: async (params: any) => {
|
||||
return await request.download({ url: `/erp/purchase-order/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 采购退货 VO
|
||||
export interface PurchaseReturnVO {
|
||||
id: number // 采购退货编号
|
||||
no: string // 采购退货号
|
||||
customerId: number // 客户编号
|
||||
returnTime: Date // 退货时间
|
||||
totalCount: number // 合计数量
|
||||
totalPrice: number // 合计金额,单位:元
|
||||
status: number // 状态
|
||||
remark: string // 备注
|
||||
}
|
||||
|
||||
// ERP 采购退货 API
|
||||
export const PurchaseReturnApi = {
|
||||
// 查询采购退货分页
|
||||
getPurchaseReturnPage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/purchase-return/page`, params })
|
||||
},
|
||||
|
||||
// 查询采购退货详情
|
||||
getPurchaseReturn: async (id: number) => {
|
||||
return await request.get({ url: `/erp/purchase-return/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增采购退货
|
||||
createPurchaseReturn: async (data: PurchaseReturnVO) => {
|
||||
return await request.post({ url: `/erp/purchase-return/create`, data })
|
||||
},
|
||||
|
||||
// 修改采购退货
|
||||
updatePurchaseReturn: async (data: PurchaseReturnVO) => {
|
||||
return await request.put({ url: `/erp/purchase-return/update`, data })
|
||||
},
|
||||
|
||||
// 更新采购退货的状态
|
||||
updatePurchaseReturnStatus: async (id: number, status: number) => {
|
||||
return await request.put({
|
||||
url: `/erp/purchase-return/update-status`,
|
||||
params: {
|
||||
id,
|
||||
status
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 删除采购退货
|
||||
deletePurchaseReturn: async (ids: number[]) => {
|
||||
return await request.delete({
|
||||
url: `/erp/purchase-return/delete`,
|
||||
params: {
|
||||
ids: ids.join(',')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 导出采购退货 Excel
|
||||
exportPurchaseReturn: async (params: any) => {
|
||||
return await request.download({ url: `/erp/purchase-return/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 供应商 VO
|
||||
export interface SupplierVO {
|
||||
id: number // 供应商编号
|
||||
name: string // 供应商名称
|
||||
contact: string // 联系人
|
||||
mobile: string // 手机号码
|
||||
telephone: string // 联系电话
|
||||
email: string // 电子邮箱
|
||||
fax: string // 传真
|
||||
remark: string // 备注
|
||||
status: number // 开启状态
|
||||
sort: number // 排序
|
||||
taxNo: string // 纳税人识别号
|
||||
taxPercent: number // 税率
|
||||
bankName: string // 开户行
|
||||
bankAccount: string // 开户账号
|
||||
bankAddress: string // 开户地址
|
||||
}
|
||||
|
||||
// ERP 供应商 API
|
||||
export const SupplierApi = {
|
||||
// 查询供应商分页
|
||||
getSupplierPage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/supplier/page`, params })
|
||||
},
|
||||
|
||||
// 获得供应商精简列表
|
||||
getSupplierSimpleList: async () => {
|
||||
return await request.get({ url: `/erp/supplier/simple-list` })
|
||||
},
|
||||
|
||||
// 查询供应商详情
|
||||
getSupplier: async (id: number) => {
|
||||
return await request.get({ url: `/erp/supplier/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增供应商
|
||||
createSupplier: async (data: SupplierVO) => {
|
||||
return await request.post({ url: `/erp/supplier/create`, data })
|
||||
},
|
||||
|
||||
// 修改供应商
|
||||
updateSupplier: async (data: SupplierVO) => {
|
||||
return await request.put({ url: `/erp/supplier/update`, data })
|
||||
},
|
||||
|
||||
// 删除供应商
|
||||
deleteSupplier: async (id: number) => {
|
||||
return await request.delete({ url: `/erp/supplier/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出供应商 Excel
|
||||
exportSupplier: async (params) => {
|
||||
return await request.download({ url: `/erp/supplier/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 客户 VO
|
||||
export interface CustomerVO {
|
||||
id: number // 客户编号
|
||||
name: string // 客户名称
|
||||
contact: string // 联系人
|
||||
mobile: string // 手机号码
|
||||
telephone: string // 联系电话
|
||||
email: string // 电子邮箱
|
||||
fax: string // 传真
|
||||
remark: string // 备注
|
||||
status: number // 开启状态
|
||||
sort: number // 排序
|
||||
taxNo: string // 纳税人识别号
|
||||
taxPercent: number // 税率
|
||||
bankName: string // 开户行
|
||||
bankAccount: string // 开户账号
|
||||
bankAddress: string // 开户地址
|
||||
}
|
||||
|
||||
// ERP 客户 API
|
||||
export const CustomerApi = {
|
||||
// 查询客户分页
|
||||
getCustomerPage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/customer/page`, params })
|
||||
},
|
||||
|
||||
// 查询客户精简列表
|
||||
getCustomerSimpleList: async () => {
|
||||
return await request.get({ url: `/erp/customer/simple-list` })
|
||||
},
|
||||
|
||||
// 查询客户详情
|
||||
getCustomer: async (id: number) => {
|
||||
return await request.get({ url: `/erp/customer/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增客户
|
||||
createCustomer: async (data: CustomerVO) => {
|
||||
return await request.post({ url: `/erp/customer/create`, data })
|
||||
},
|
||||
|
||||
// 修改客户
|
||||
updateCustomer: async (data: CustomerVO) => {
|
||||
return await request.put({ url: `/erp/customer/update`, data })
|
||||
},
|
||||
|
||||
// 删除客户
|
||||
deleteCustomer: async (id: number) => {
|
||||
return await request.delete({ url: `/erp/customer/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出客户 Excel
|
||||
exportCustomer: async (params) => {
|
||||
return await request.download({ url: `/erp/customer/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 销售订单 VO
|
||||
export interface SaleOrderVO {
|
||||
id: number // 订单工单编号
|
||||
no: string // 销售订单号
|
||||
customerId: number // 客户编号
|
||||
orderTime: Date // 订单时间
|
||||
totalCount: number // 合计数量
|
||||
totalPrice: number // 合计金额,单位:元
|
||||
status: number // 状态
|
||||
remark: string // 备注
|
||||
outCount: number // 销售出库数量
|
||||
returnCount: number // 销售退货数量
|
||||
}
|
||||
|
||||
// ERP 销售订单 API
|
||||
export const SaleOrderApi = {
|
||||
// 查询销售订单分页
|
||||
getSaleOrderPage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/sale-order/page`, params })
|
||||
},
|
||||
|
||||
// 查询销售订单详情
|
||||
getSaleOrder: async (id: number) => {
|
||||
return await request.get({ url: `/erp/sale-order/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增销售订单
|
||||
createSaleOrder: async (data: SaleOrderVO) => {
|
||||
return await request.post({ url: `/erp/sale-order/create`, data })
|
||||
},
|
||||
|
||||
// 修改销售订单
|
||||
updateSaleOrder: async (data: SaleOrderVO) => {
|
||||
return await request.put({ url: `/erp/sale-order/update`, data })
|
||||
},
|
||||
|
||||
// 更新销售订单的状态
|
||||
updateSaleOrderStatus: async (id: number, status: number) => {
|
||||
return await request.put({
|
||||
url: `/erp/sale-order/update-status`,
|
||||
params: {
|
||||
id,
|
||||
status
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 删除销售订单
|
||||
deleteSaleOrder: async (ids: number[]) => {
|
||||
return await request.delete({
|
||||
url: `/erp/sale-order/delete`,
|
||||
params: {
|
||||
ids: ids.join(',')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 导出销售订单 Excel
|
||||
exportSaleOrder: async (params: any) => {
|
||||
return await request.download({ url: `/erp/sale-order/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 销售出库 VO
|
||||
export interface SaleOutVO {
|
||||
id: number // 销售出库编号
|
||||
no: string // 销售出库号
|
||||
customerId: number // 客户编号
|
||||
outTime: Date // 出库时间
|
||||
totalCount: number // 合计数量
|
||||
totalPrice: number // 合计金额,单位:元
|
||||
status: number // 状态
|
||||
remark: string // 备注
|
||||
}
|
||||
|
||||
// ERP 销售出库 API
|
||||
export const SaleOutApi = {
|
||||
// 查询销售出库分页
|
||||
getSaleOutPage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/sale-out/page`, params })
|
||||
},
|
||||
|
||||
// 查询销售出库详情
|
||||
getSaleOut: async (id: number) => {
|
||||
return await request.get({ url: `/erp/sale-out/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增销售出库
|
||||
createSaleOut: async (data: SaleOutVO) => {
|
||||
return await request.post({ url: `/erp/sale-out/create`, data })
|
||||
},
|
||||
|
||||
// 修改销售出库
|
||||
updateSaleOut: async (data: SaleOutVO) => {
|
||||
return await request.put({ url: `/erp/sale-out/update`, data })
|
||||
},
|
||||
|
||||
// 更新销售出库的状态
|
||||
updateSaleOutStatus: async (id: number, status: number) => {
|
||||
return await request.put({
|
||||
url: `/erp/sale-out/update-status`,
|
||||
params: {
|
||||
id,
|
||||
status
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 删除销售出库
|
||||
deleteSaleOut: async (ids: number[]) => {
|
||||
return await request.delete({
|
||||
url: `/erp/sale-out/delete`,
|
||||
params: {
|
||||
ids: ids.join(',')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 导出销售出库 Excel
|
||||
exportSaleOut: async (params: any) => {
|
||||
return await request.download({ url: `/erp/sale-out/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 销售退货 VO
|
||||
export interface SaleReturnVO {
|
||||
id: number // 销售退货编号
|
||||
no: string // 销售退货号
|
||||
customerId: number // 客户编号
|
||||
returnTime: Date // 退货时间
|
||||
totalCount: number // 合计数量
|
||||
totalPrice: number // 合计金额,单位:元
|
||||
status: number // 状态
|
||||
remark: string // 备注
|
||||
}
|
||||
|
||||
// ERP 销售退货 API
|
||||
export const SaleReturnApi = {
|
||||
// 查询销售退货分页
|
||||
getSaleReturnPage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/sale-return/page`, params })
|
||||
},
|
||||
|
||||
// 查询销售退货详情
|
||||
getSaleReturn: async (id: number) => {
|
||||
return await request.get({ url: `/erp/sale-return/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增销售退货
|
||||
createSaleReturn: async (data: SaleReturnVO) => {
|
||||
return await request.post({ url: `/erp/sale-return/create`, data })
|
||||
},
|
||||
|
||||
// 修改销售退货
|
||||
updateSaleReturn: async (data: SaleReturnVO) => {
|
||||
return await request.put({ url: `/erp/sale-return/update`, data })
|
||||
},
|
||||
|
||||
// 更新销售退货的状态
|
||||
updateSaleReturnStatus: async (id: number, status: number) => {
|
||||
return await request.put({
|
||||
url: `/erp/sale-return/update-status`,
|
||||
params: {
|
||||
id,
|
||||
status
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 删除销售退货
|
||||
deleteSaleReturn: async (ids: number[]) => {
|
||||
return await request.delete({
|
||||
url: `/erp/sale-return/delete`,
|
||||
params: {
|
||||
ids: ids.join(',')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 导出销售退货 Excel
|
||||
exportSaleReturn: async (params: any) => {
|
||||
return await request.download({ url: `/erp/sale-return/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 采购全局统计 VO
|
||||
export interface ErpPurchaseSummaryRespVO {
|
||||
todayPrice: number // 今日采购金额
|
||||
yesterdayPrice: number // 昨日采购金额
|
||||
monthPrice: number // 本月采购金额
|
||||
yearPrice: number // 今年采购金额
|
||||
}
|
||||
|
||||
// ERP 采购时间段统计 VO
|
||||
export interface ErpPurchaseTimeSummaryRespVO {
|
||||
time: string // 时间
|
||||
price: number // 采购金额
|
||||
}
|
||||
|
||||
// ERP 采购统计 API
|
||||
export const PurchaseStatisticsApi = {
|
||||
// 获得采购统计
|
||||
getPurchaseSummary: async (): Promise<ErpPurchaseSummaryRespVO> => {
|
||||
return await request.get({ url: `/erp/purchase-statistics/summary` })
|
||||
},
|
||||
|
||||
// 获得采购时间段统计
|
||||
getPurchaseTimeSummary: async (): Promise<ErpPurchaseTimeSummaryRespVO[]> => {
|
||||
return await request.get({ url: `/erp/purchase-statistics/time-summary` })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 销售全局统计 VO
|
||||
export interface ErpSaleSummaryRespVO {
|
||||
todayPrice: number // 今日销售金额
|
||||
yesterdayPrice: number // 昨日销售金额
|
||||
monthPrice: number // 本月销售金额
|
||||
yearPrice: number // 今年销售金额
|
||||
}
|
||||
|
||||
// ERP 销售时间段统计 VO
|
||||
export interface ErpSaleTimeSummaryRespVO {
|
||||
time: string // 时间
|
||||
price: number // 销售金额
|
||||
}
|
||||
|
||||
// ERP 销售统计 API
|
||||
export const SaleStatisticsApi = {
|
||||
// 获得销售统计
|
||||
getSaleSummary: async (): Promise<ErpSaleSummaryRespVO> => {
|
||||
return await request.get({ url: `/erp/sale-statistics/summary` })
|
||||
},
|
||||
|
||||
// 获得销售时间段统计
|
||||
getSaleTimeSummary: async (): Promise<ErpSaleTimeSummaryRespVO[]> => {
|
||||
return await request.get({ url: `/erp/sale-statistics/time-summary` })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 库存盘点单 VO
|
||||
export interface StockCheckVO {
|
||||
id: number // 出库编号
|
||||
no: string // 出库单号
|
||||
outTime: Date // 出库时间
|
||||
totalCount: number // 合计数量
|
||||
totalPrice: number // 合计金额,单位:元
|
||||
status: number // 状态
|
||||
remark: string // 备注
|
||||
}
|
||||
|
||||
// ERP 库存盘点单 API
|
||||
export const StockCheckApi = {
|
||||
// 查询库存盘点单分页
|
||||
getStockCheckPage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/stock-check/page`, params })
|
||||
},
|
||||
|
||||
// 查询库存盘点单详情
|
||||
getStockCheck: async (id: number) => {
|
||||
return await request.get({ url: `/erp/stock-check/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增库存盘点单
|
||||
createStockCheck: async (data: StockCheckVO) => {
|
||||
return await request.post({ url: `/erp/stock-check/create`, data })
|
||||
},
|
||||
|
||||
// 修改库存盘点单
|
||||
updateStockCheck: async (data: StockCheckVO) => {
|
||||
return await request.put({ url: `/erp/stock-check/update`, data })
|
||||
},
|
||||
|
||||
// 更新库存盘点单的状态
|
||||
updateStockCheckStatus: async (id: number, status: number) => {
|
||||
return await request.put({
|
||||
url: `/erp/stock-check/update-status`,
|
||||
params: {
|
||||
id,
|
||||
status
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 删除库存盘点单
|
||||
deleteStockCheck: async (ids: number[]) => {
|
||||
return await request.delete({
|
||||
url: `/erp/stock-check/delete`,
|
||||
params: {
|
||||
ids: ids.join(',')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 导出库存盘点单 Excel
|
||||
exportStockCheck: async (params) => {
|
||||
return await request.download({ url: `/erp/stock-check/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 其它入库单 VO
|
||||
export interface StockInVO {
|
||||
id: number // 入库编号
|
||||
no: string // 入库单号
|
||||
supplierId: number // 供应商编号
|
||||
inTime: Date // 入库时间
|
||||
totalCount: number // 合计数量
|
||||
totalPrice: number // 合计金额,单位:元
|
||||
status: number // 状态
|
||||
remark: string // 备注
|
||||
}
|
||||
|
||||
// ERP 其它入库单 API
|
||||
export const StockInApi = {
|
||||
// 查询其它入库单分页
|
||||
getStockInPage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/stock-in/page`, params })
|
||||
},
|
||||
|
||||
// 查询其它入库单详情
|
||||
getStockIn: async (id: number) => {
|
||||
return await request.get({ url: `/erp/stock-in/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增其它入库单
|
||||
createStockIn: async (data: StockInVO) => {
|
||||
return await request.post({ url: `/erp/stock-in/create`, data })
|
||||
},
|
||||
|
||||
// 修改其它入库单
|
||||
updateStockIn: async (data: StockInVO) => {
|
||||
return await request.put({ url: `/erp/stock-in/update`, data })
|
||||
},
|
||||
|
||||
// 更新其它入库单的状态
|
||||
updateStockInStatus: async (id: number, status: number) => {
|
||||
return await request.put({
|
||||
url: `/erp/stock-in/update-status`,
|
||||
params: {
|
||||
id,
|
||||
status
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 删除其它入库单
|
||||
deleteStockIn: async (ids: number[]) => {
|
||||
return await request.delete({
|
||||
url: `/erp/stock-in/delete`,
|
||||
params: {
|
||||
ids: ids.join(',')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 导出其它入库单 Excel
|
||||
exportStockIn: async (params) => {
|
||||
return await request.download({ url: `/erp/stock-in/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 库存调度单 VO
|
||||
export interface StockMoveVO {
|
||||
id: number // 出库编号
|
||||
no: string // 出库单号
|
||||
outTime: Date // 出库时间
|
||||
totalCount: number // 合计数量
|
||||
totalPrice: number // 合计金额,单位:元
|
||||
status: number // 状态
|
||||
remark: string // 备注
|
||||
}
|
||||
|
||||
// ERP 库存调度单 API
|
||||
export const StockMoveApi = {
|
||||
// 查询库存调度单分页
|
||||
getStockMovePage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/stock-move/page`, params })
|
||||
},
|
||||
|
||||
// 查询库存调度单详情
|
||||
getStockMove: async (id: number) => {
|
||||
return await request.get({ url: `/erp/stock-move/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增库存调度单
|
||||
createStockMove: async (data: StockMoveVO) => {
|
||||
return await request.post({ url: `/erp/stock-move/create`, data })
|
||||
},
|
||||
|
||||
// 修改库存调度单
|
||||
updateStockMove: async (data: StockMoveVO) => {
|
||||
return await request.put({ url: `/erp/stock-move/update`, data })
|
||||
},
|
||||
|
||||
// 更新库存调度单的状态
|
||||
updateStockMoveStatus: async (id: number, status: number) => {
|
||||
return await request.put({
|
||||
url: `/erp/stock-move/update-status`,
|
||||
params: {
|
||||
id,
|
||||
status
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 删除库存调度单
|
||||
deleteStockMove: async (ids: number[]) => {
|
||||
return await request.delete({
|
||||
url: `/erp/stock-move/delete`,
|
||||
params: {
|
||||
ids: ids.join(',')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 导出库存调度单 Excel
|
||||
exportStockMove: async (params) => {
|
||||
return await request.download({ url: `/erp/stock-move/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 其它出库单 VO
|
||||
export interface StockOutVO {
|
||||
id: number // 出库编号
|
||||
no: string // 出库单号
|
||||
customerId: number // 客户编号
|
||||
outTime: Date // 出库时间
|
||||
totalCount: number // 合计数量
|
||||
totalPrice: number // 合计金额,单位:元
|
||||
status: number // 状态
|
||||
remark: string // 备注
|
||||
}
|
||||
|
||||
// ERP 其它出库单 API
|
||||
export const StockOutApi = {
|
||||
// 查询其它出库单分页
|
||||
getStockOutPage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/stock-out/page`, params })
|
||||
},
|
||||
|
||||
// 查询其它出库单详情
|
||||
getStockOut: async (id: number) => {
|
||||
return await request.get({ url: `/erp/stock-out/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增其它出库单
|
||||
createStockOut: async (data: StockOutVO) => {
|
||||
return await request.post({ url: `/erp/stock-out/create`, data })
|
||||
},
|
||||
|
||||
// 修改其它出库单
|
||||
updateStockOut: async (data: StockOutVO) => {
|
||||
return await request.put({ url: `/erp/stock-out/update`, data })
|
||||
},
|
||||
|
||||
// 更新其它出库单的状态
|
||||
updateStockOutStatus: async (id: number, status: number) => {
|
||||
return await request.put({
|
||||
url: `/erp/stock-out/update-status`,
|
||||
params: {
|
||||
id,
|
||||
status
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 删除其它出库单
|
||||
deleteStockOut: async (ids: number[]) => {
|
||||
return await request.delete({
|
||||
url: `/erp/stock-out/delete`,
|
||||
params: {
|
||||
ids: ids.join(',')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 导出其它出库单 Excel
|
||||
exportStockOut: async (params) => {
|
||||
return await request.download({ url: `/erp/stock-out/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 产品库存明细 VO
|
||||
export interface StockRecordVO {
|
||||
id: number // 编号
|
||||
productId: number // 产品编号
|
||||
warehouseId: number // 仓库编号
|
||||
count: number // 出入库数量
|
||||
totalCount: number // 总库存量
|
||||
bizType: number // 业务类型
|
||||
bizId: number // 业务编号
|
||||
bizItemId: number // 业务项编号
|
||||
bizNo: string // 业务单号
|
||||
}
|
||||
|
||||
// ERP 产品库存明细 API
|
||||
export const StockRecordApi = {
|
||||
// 查询产品库存明细分页
|
||||
getStockRecordPage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/stock-record/page`, params })
|
||||
},
|
||||
|
||||
// 查询产品库存明细详情
|
||||
getStockRecord: async (id: number) => {
|
||||
return await request.get({ url: `/erp/stock-record/get?id=` + id })
|
||||
},
|
||||
|
||||
// 导出产品库存明细 Excel
|
||||
exportStockRecord: async (params) => {
|
||||
return await request.download({ url: `/erp/stock-record/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 产品库存 VO
|
||||
export interface StockVO {
|
||||
// 编号
|
||||
id: number
|
||||
// 产品编号
|
||||
productId: number
|
||||
// 仓库编号
|
||||
warehouseId: number
|
||||
// 库存数量
|
||||
count: number
|
||||
}
|
||||
|
||||
// ERP 产品库存 API
|
||||
export const StockApi = {
|
||||
// 查询产品库存分页
|
||||
getStockPage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/stock/page`, params })
|
||||
},
|
||||
|
||||
// 查询产品库存详情
|
||||
getStock: async (id: number) => {
|
||||
return await request.get({ url: `/erp/stock/get?id=` + id })
|
||||
},
|
||||
|
||||
// 查询产品库存详情
|
||||
getStock2: async (productId: number, warehouseId: number) => {
|
||||
return await request.get({ url: `/erp/stock/get`, params: { productId, warehouseId } })
|
||||
},
|
||||
|
||||
// 获得产品库存数量
|
||||
getStockCount: async (productId: number) => {
|
||||
return await request.get({ url: `/erp/stock/get-count`, params: { productId } })
|
||||
},
|
||||
|
||||
// 导出产品库存 Excel
|
||||
exportStock: async (params) => {
|
||||
return await request.download({ url: `/erp/stock/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// ERP 仓库 VO
|
||||
export interface WarehouseVO {
|
||||
id: number // 仓库编号
|
||||
name: string // 仓库名称
|
||||
address: string // 仓库地址
|
||||
sort: number // 排序
|
||||
remark: string // 备注
|
||||
principal: string // 负责人
|
||||
warehousePrice: number // 仓储费,单位:元
|
||||
truckagePrice: number // 搬运费,单位:元
|
||||
status: number // 开启状态
|
||||
defaultStatus: boolean // 是否默认
|
||||
}
|
||||
|
||||
// ERP 仓库 API
|
||||
export const WarehouseApi = {
|
||||
// 查询仓库分页
|
||||
getWarehousePage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/warehouse/page`, params })
|
||||
},
|
||||
|
||||
// 查询仓库精简列表
|
||||
getWarehouseSimpleList: async () => {
|
||||
return await request.get({ url: `/erp/warehouse/simple-list` })
|
||||
},
|
||||
|
||||
// 查询仓库详情
|
||||
getWarehouse: async (id: number) => {
|
||||
return await request.get({ url: `/erp/warehouse/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增仓库
|
||||
createWarehouse: async (data: WarehouseVO) => {
|
||||
return await request.post({ url: `/erp/warehouse/create`, data })
|
||||
},
|
||||
|
||||
// 修改仓库
|
||||
updateWarehouse: async (data: WarehouseVO) => {
|
||||
return await request.put({ url: `/erp/warehouse/update`, data })
|
||||
},
|
||||
|
||||
// 修改仓库默认状态
|
||||
updateWarehouseDefaultStatus: async (id: number, defaultStatus: boolean) => {
|
||||
return await request.put({
|
||||
url: `/erp/warehouse/update-default-status`,
|
||||
params: {
|
||||
id,
|
||||
defaultStatus
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 删除仓库
|
||||
deleteWarehouse: async (id: number) => {
|
||||
return await request.delete({ url: `/erp/warehouse/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出仓库 Excel
|
||||
exportWarehouse: async (params) => {
|
||||
return await request.download({ url: `/erp/warehouse/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface ApiAccessLogVO {
|
||||
id: number
|
||||
traceId: string
|
||||
userId: number
|
||||
userType: number
|
||||
applicationName: string
|
||||
requestMethod: string
|
||||
requestParams: string
|
||||
responseBody: string
|
||||
requestUrl: string
|
||||
userIp: string
|
||||
userAgent: string
|
||||
operateModule: string
|
||||
operateName: string
|
||||
operateType: number
|
||||
beginTime: Date
|
||||
endTime: Date
|
||||
duration: number
|
||||
resultCode: number
|
||||
resultMsg: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
// 查询列表API 访问日志
|
||||
export const getApiAccessLogPage = (params: PageParam) => {
|
||||
return request.get({ url: '/infra/api-access-log/page', params })
|
||||
}
|
||||
|
||||
// 导出API 访问日志
|
||||
export const exportApiAccessLog = (params) => {
|
||||
return request.download({ url: '/infra/api-access-log/export-excel', params })
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface ApiErrorLogVO {
|
||||
id: number
|
||||
traceId: string
|
||||
userId: number
|
||||
userType: number
|
||||
applicationName: string
|
||||
requestMethod: string
|
||||
requestParams: string
|
||||
requestUrl: string
|
||||
userIp: string
|
||||
userAgent: string
|
||||
exceptionTime: Date
|
||||
exceptionName: string
|
||||
exceptionMessage: string
|
||||
exceptionRootCauseMessage: string
|
||||
exceptionStackTrace: string
|
||||
exceptionClassName: string
|
||||
exceptionFileName: string
|
||||
exceptionMethodName: string
|
||||
exceptionLineNumber: number
|
||||
processUserId: number
|
||||
processStatus: number
|
||||
processTime: Date
|
||||
resultCode: number
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
// 查询列表API 访问日志
|
||||
export const getApiErrorLogPage = (params: PageParam) => {
|
||||
return request.get({ url: '/infra/api-error-log/page', params })
|
||||
}
|
||||
|
||||
// 更新 API 错误日志的处理状态
|
||||
export const updateApiErrorLogPage = (id: number, processStatus: number) => {
|
||||
return request.put({
|
||||
url: '/infra/api-error-log/update-status?id=' + id + '&processStatus=' + processStatus
|
||||
})
|
||||
}
|
||||
|
||||
// 导出API 访问日志
|
||||
export const exportApiErrorLog = (params) => {
|
||||
return request.download({
|
||||
url: '/infra/api-error-log/export-excel',
|
||||
params
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export type CodegenTableVO = {
|
||||
id: number
|
||||
tableId: number
|
||||
isParentMenuIdValid: boolean
|
||||
dataSourceConfigId: number
|
||||
scene: number
|
||||
tableName: string
|
||||
tableComment: string
|
||||
remark: string
|
||||
moduleName: string
|
||||
businessName: string
|
||||
className: string
|
||||
classComment: string
|
||||
author: string
|
||||
createTime: Date
|
||||
updateTime: Date
|
||||
templateType: number
|
||||
parentMenuId: number
|
||||
}
|
||||
|
||||
export type CodegenColumnVO = {
|
||||
id: number
|
||||
tableId: number
|
||||
columnName: string
|
||||
dataType: string
|
||||
columnComment: string
|
||||
nullable: number
|
||||
primaryKey: number
|
||||
ordinalPosition: number
|
||||
javaType: string
|
||||
javaField: string
|
||||
dictType: string
|
||||
example: string
|
||||
createOperation: number
|
||||
updateOperation: number
|
||||
listOperation: number
|
||||
listOperationCondition: string
|
||||
listOperationResult: number
|
||||
htmlType: string
|
||||
}
|
||||
|
||||
export type DatabaseTableVO = {
|
||||
name: string
|
||||
comment: string
|
||||
}
|
||||
|
||||
export type CodegenPreviewVO = {
|
||||
filePath: string
|
||||
code: string
|
||||
}
|
||||
|
||||
export type CodegenUpdateReqVO = {
|
||||
table: CodegenTableVO | any
|
||||
columns: CodegenColumnVO[]
|
||||
}
|
||||
|
||||
// 查询列表代码生成表定义
|
||||
export const getCodegenTableList = (dataSourceConfigId: number) => {
|
||||
return request.get({ url: '/infra/codegen/table/list?dataSourceConfigId=' + dataSourceConfigId })
|
||||
}
|
||||
|
||||
// 查询列表代码生成表定义
|
||||
export const getCodegenTablePage = (params: PageParam) => {
|
||||
return request.get({ url: '/infra/codegen/table/page', params })
|
||||
}
|
||||
|
||||
// 查询详情代码生成表定义
|
||||
export const getCodegenTable = (id: number) => {
|
||||
return request.get({ url: '/infra/codegen/detail?tableId=' + id })
|
||||
}
|
||||
|
||||
// 修改代码生成表定义
|
||||
export const updateCodegenTable = (data: CodegenUpdateReqVO) => {
|
||||
return request.put({ url: '/infra/codegen/update', data })
|
||||
}
|
||||
|
||||
// 基于数据库的表结构,同步数据库的表和字段定义
|
||||
export const syncCodegenFromDB = (id: number) => {
|
||||
return request.put({ url: '/infra/codegen/sync-from-db?tableId=' + id })
|
||||
}
|
||||
|
||||
// 预览生成代码
|
||||
export const previewCodegen = (id: number) => {
|
||||
return request.get({ url: '/infra/codegen/preview?tableId=' + id })
|
||||
}
|
||||
|
||||
// 下载生成代码
|
||||
export const downloadCodegen = (id: number) => {
|
||||
return request.download({ url: '/infra/codegen/download?tableId=' + id })
|
||||
}
|
||||
|
||||
// 获得表定义
|
||||
export const getSchemaTableList = (params) => {
|
||||
return request.get({ url: '/infra/codegen/db/table/list', params })
|
||||
}
|
||||
|
||||
// 基于数据库的表结构,创建代码生成器的表定义
|
||||
export const createCodegenList = (data) => {
|
||||
return request.post({ url: '/infra/codegen/create-list', data })
|
||||
}
|
||||
|
||||
// 删除代码生成表定义
|
||||
export const deleteCodegenTable = (id: number) => {
|
||||
return request.delete({ url: '/infra/codegen/delete?tableId=' + id })
|
||||
}
|
||||
|
||||
// 批量删除代码生成表定义
|
||||
export const deleteCodegenTableList = (ids: number[]) => {
|
||||
return request.delete({ url: '/infra/codegen/delete-list', params: { tableIds: ids.join(',') } })
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface ConfigVO {
|
||||
id: number | undefined
|
||||
category: string
|
||||
name: string
|
||||
key: string
|
||||
value: string
|
||||
type: number
|
||||
visible: boolean
|
||||
remark: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
// 查询参数列表
|
||||
export const getConfigPage = (params: PageParam) => {
|
||||
return request.get({ url: '/infra/config/page', params })
|
||||
}
|
||||
|
||||
// 查询参数详情
|
||||
export const getConfig = (id: number) => {
|
||||
return request.get({ url: '/infra/config/get?id=' + id })
|
||||
}
|
||||
|
||||
// 根据参数键名查询参数值
|
||||
export const getConfigKey = (configKey: string) => {
|
||||
return request.get({ url: '/infra/config/get-value-by-key?key=' + configKey })
|
||||
}
|
||||
|
||||
// 新增参数
|
||||
export const createConfig = (data: ConfigVO) => {
|
||||
return request.post({ url: '/infra/config/create', data })
|
||||
}
|
||||
|
||||
// 修改参数
|
||||
export const updateConfig = (data: ConfigVO) => {
|
||||
return request.put({ url: '/infra/config/update', data })
|
||||
}
|
||||
|
||||
// 删除参数
|
||||
export const deleteConfig = (id: number) => {
|
||||
return request.delete({ url: '/infra/config/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 批量删除参数
|
||||
export const deleteConfigList = (ids: number[]) => {
|
||||
return request.delete({ url: '/infra/config/delete-list', params: { ids: ids.join(',') } })
|
||||
}
|
||||
|
||||
// 导出参数
|
||||
export const exportConfig = (params) => {
|
||||
return request.download({ url: '/infra/config/export-excel', params })
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface DataSourceConfigVO {
|
||||
id: number | undefined
|
||||
name: string
|
||||
url: string
|
||||
username: string
|
||||
password: string
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
// 新增数据源配置
|
||||
export const createDataSourceConfig = (data: DataSourceConfigVO) => {
|
||||
return request.post({ url: '/infra/data-source-config/create', data })
|
||||
}
|
||||
|
||||
// 修改数据源配置
|
||||
export const updateDataSourceConfig = (data: DataSourceConfigVO) => {
|
||||
return request.put({ url: '/infra/data-source-config/update', data })
|
||||
}
|
||||
|
||||
// 删除数据源配置
|
||||
export const deleteDataSourceConfig = (id: number) => {
|
||||
return request.delete({ url: '/infra/data-source-config/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 批量删除数据源配置
|
||||
export const deleteDataSourceConfigList = (ids: number[]) => {
|
||||
return request.delete({ url: '/infra/data-source-config/delete-list', params: { ids: ids.join(',') } })
|
||||
}
|
||||
|
||||
// 查询数据源配置详情
|
||||
export const getDataSourceConfig = (id: number) => {
|
||||
return request.get({ url: '/infra/data-source-config/get?id=' + id })
|
||||
}
|
||||
|
||||
// 查询数据源配置列表
|
||||
export const getDataSourceConfigList = () => {
|
||||
return request.get({ url: '/infra/data-source-config/list' })
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
import request from '@/config/axios'
|
||||
import type { Dayjs } from 'dayjs'
|
||||
|
||||
/** 示例联系人信息 */
|
||||
export interface Demo01Contact {
|
||||
id: number // 编号
|
||||
name?: string // 名字
|
||||
sex?: number // 性别
|
||||
birthday?: string | Dayjs // 出生年
|
||||
description?: string // 简介
|
||||
avatar: string // 头像
|
||||
}
|
||||
|
||||
// 示例联系人 API
|
||||
export const Demo01ContactApi = {
|
||||
// 查询示例联系人分页
|
||||
getDemo01ContactPage: async (params: any) => {
|
||||
return await request.get({ url: `/infra/demo01-contact/page`, params })
|
||||
},
|
||||
|
||||
// 查询示例联系人详情
|
||||
getDemo01Contact: async (id: number) => {
|
||||
return await request.get({ url: `/infra/demo01-contact/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增示例联系人
|
||||
createDemo01Contact: async (data: Demo01Contact) => {
|
||||
return await request.post({ url: `/infra/demo01-contact/create`, data })
|
||||
},
|
||||
|
||||
// 修改示例联系人
|
||||
updateDemo01Contact: async (data: Demo01Contact) => {
|
||||
return await request.put({ url: `/infra/demo01-contact/update`, data })
|
||||
},
|
||||
|
||||
// 删除示例联系人
|
||||
deleteDemo01Contact: async (id: number) => {
|
||||
return await request.delete({ url: `/infra/demo01-contact/delete?id=` + id })
|
||||
},
|
||||
|
||||
/** 批量删除示例联系人 */
|
||||
deleteDemo01ContactList: async (ids: number[]) => {
|
||||
return await request.delete({ url: `/infra/demo01-contact/delete-list?ids=${ids.join(',')}` })
|
||||
},
|
||||
|
||||
// 导出示例联系人 Excel
|
||||
exportDemo01Contact: async (params) => {
|
||||
return await request.download({ url: `/infra/demo01-contact/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface Demo02CategoryVO {
|
||||
id: number
|
||||
name: string
|
||||
parentId: number
|
||||
}
|
||||
|
||||
// 查询示例分类列表
|
||||
export const getDemo02CategoryList = async () => {
|
||||
return await request.get({ url: `/infra/demo02-category/list` })
|
||||
}
|
||||
|
||||
// 查询示例分类详情
|
||||
export const getDemo02Category = async (id: number) => {
|
||||
return await request.get({ url: `/infra/demo02-category/get?id=` + id })
|
||||
}
|
||||
|
||||
// 新增示例分类
|
||||
export const createDemo02Category = async (data: Demo02CategoryVO) => {
|
||||
return await request.post({ url: `/infra/demo02-category/create`, data })
|
||||
}
|
||||
|
||||
// 修改示例分类
|
||||
export const updateDemo02Category = async (data: Demo02CategoryVO) => {
|
||||
return await request.put({ url: `/infra/demo02-category/update`, data })
|
||||
}
|
||||
|
||||
// 删除示例分类
|
||||
export const deleteDemo02Category = async (id: number) => {
|
||||
return await request.delete({ url: `/infra/demo02-category/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出示例分类 Excel
|
||||
export const exportDemo02Category = async (params) => {
|
||||
return await request.download({ url: `/infra/demo02-category/export-excel`, params })
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
import request from '@/config/axios'
|
||||
import type { Dayjs } from 'dayjs';
|
||||
|
||||
/** 学生课程信息 */
|
||||
export interface Demo03Course {
|
||||
id: number; // 编号
|
||||
studentId?: number; // 学生编号
|
||||
name?: string; // 名字
|
||||
score?: number; // 分数
|
||||
}
|
||||
|
||||
/** 学生班级信息 */
|
||||
export interface Demo03Grade {
|
||||
id: number; // 编号
|
||||
studentId?: number; // 学生编号
|
||||
name?: string; // 名字
|
||||
teacher?: string; // 班主任
|
||||
}
|
||||
|
||||
/** 学生信息 */
|
||||
export interface Demo03Student {
|
||||
id: number; // 编号
|
||||
name?: string; // 名字
|
||||
sex?: number; // 性别
|
||||
birthday?: string | Dayjs; // 出生日期
|
||||
description?: string; // 简介
|
||||
}
|
||||
|
||||
// 学生 API
|
||||
export const Demo03StudentApi = {
|
||||
// 查询学生分页
|
||||
getDemo03StudentPage: async (params: any) => {
|
||||
return await request.get({ url: `/infra/demo03-student-erp/page`, params })
|
||||
},
|
||||
|
||||
// 查询学生详情
|
||||
getDemo03Student: async (id: number) => {
|
||||
return await request.get({ url: `/infra/demo03-student-erp/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增学生
|
||||
createDemo03Student: async (data: Demo03Student) => {
|
||||
return await request.post({ url: `/infra/demo03-student-erp/create`, data })
|
||||
},
|
||||
|
||||
// 修改学生
|
||||
updateDemo03Student: async (data: Demo03Student) => {
|
||||
return await request.put({ url: `/infra/demo03-student-erp/update`, data })
|
||||
},
|
||||
|
||||
// 删除学生
|
||||
deleteDemo03Student: async (id: number) => {
|
||||
return await request.delete({ url: `/infra/demo03-student-erp/delete?id=` + id })
|
||||
},
|
||||
|
||||
/** 批量删除学生 */
|
||||
deleteDemo03StudentList: async (ids: number[]) => {
|
||||
return await request.delete({ url: `/infra/demo03-student-erp/delete-list?ids=${ids.join(',')}` })
|
||||
},
|
||||
|
||||
// 导出学生 Excel
|
||||
exportDemo03Student: async (params) => {
|
||||
return await request.download({ url: `/infra/demo03-student-erp/export-excel`, params })
|
||||
},
|
||||
|
||||
// ==================== 子表(学生课程) ====================
|
||||
|
||||
// 获得学生课程分页
|
||||
getDemo03CoursePage: async (params) => {
|
||||
return await request.get({ url: `/infra/demo03-student-erp/demo03-course/page`, params })
|
||||
},
|
||||
// 新增学生课程
|
||||
createDemo03Course: async (data: Demo03Course) => {
|
||||
return await request.post({ url: `/infra/demo03-student-erp/demo03-course/create`, data })
|
||||
},
|
||||
|
||||
// 修改学生课程
|
||||
updateDemo03Course: async (data: Demo03Course) => {
|
||||
return await request.put({ url: `/infra/demo03-student-erp/demo03-course/update`, data })
|
||||
},
|
||||
|
||||
// 删除学生课程
|
||||
deleteDemo03Course: async (id: number) => {
|
||||
return await request.delete({ url: `/infra/demo03-student-erp/demo03-course/delete?id=` + id })
|
||||
},
|
||||
|
||||
/** 批量删除学生课程 */
|
||||
deleteDemo03CourseList: async (ids: number[]) => {
|
||||
return await request.delete({ url: `/infra/demo03-student-erp/demo03-course/delete-list?ids=${ids.join(',')}` })
|
||||
},
|
||||
|
||||
// 获得学生课程
|
||||
getDemo03Course: async (id: number) => {
|
||||
return await request.get({ url: `/infra/demo03-student-erp/demo03-course/get?id=` + id })
|
||||
},
|
||||
|
||||
// ==================== 子表(学生班级) ====================
|
||||
|
||||
// 获得学生班级分页
|
||||
getDemo03GradePage: async (params) => {
|
||||
return await request.get({ url: `/infra/demo03-student-erp/demo03-grade/page`, params })
|
||||
},
|
||||
// 新增学生班级
|
||||
createDemo03Grade: async (data: Demo03Grade) => {
|
||||
return await request.post({ url: `/infra/demo03-student-erp/demo03-grade/create`, data })
|
||||
},
|
||||
|
||||
// 修改学生班级
|
||||
updateDemo03Grade: async (data: Demo03Grade) => {
|
||||
return await request.put({ url: `/infra/demo03-student-erp/demo03-grade/update`, data })
|
||||
},
|
||||
|
||||
// 删除学生班级
|
||||
deleteDemo03Grade: async (id: number) => {
|
||||
return await request.delete({ url: `/infra/demo03-student-erp/demo03-grade/delete?id=` + id })
|
||||
},
|
||||
|
||||
/** 批量删除学生班级 */
|
||||
deleteDemo03GradeList: async (ids: number[]) => {
|
||||
return await request.delete({ url: `/infra/demo03-student-erp/demo03-grade/delete-list?ids=${ids.join(',')}` })
|
||||
},
|
||||
|
||||
// 获得学生班级
|
||||
getDemo03Grade: async (id: number) => {
|
||||
return await request.get({ url: `/infra/demo03-student-erp/demo03-grade/get?id=` + id })
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
import request from '@/config/axios'
|
||||
import type { Dayjs } from 'dayjs';
|
||||
|
||||
/** 学生课程信息 */
|
||||
export interface Demo03Course {
|
||||
id: number; // 编号
|
||||
studentId?: number; // 学生编号
|
||||
name?: string; // 名字
|
||||
score?: number; // 分数
|
||||
}
|
||||
|
||||
/** 学生班级信息 */
|
||||
export interface Demo03Grade {
|
||||
id: number; // 编号
|
||||
studentId?: number; // 学生编号
|
||||
name?: string; // 名字
|
||||
teacher?: string; // 班主任
|
||||
}
|
||||
|
||||
/** 学生信息 */
|
||||
export interface Demo03Student {
|
||||
id: number; // 编号
|
||||
name?: string; // 名字
|
||||
sex?: number; // 性别
|
||||
birthday?: string | Dayjs; // 出生日期
|
||||
description?: string; // 简介
|
||||
demo03courses?: Demo03Course[]
|
||||
demo03grade?: Demo03Grade
|
||||
}
|
||||
|
||||
// 学生 API
|
||||
export const Demo03StudentApi = {
|
||||
// 查询学生分页
|
||||
getDemo03StudentPage: async (params: any) => {
|
||||
return await request.get({ url: `/infra/demo03-student-inner/page`, params })
|
||||
},
|
||||
|
||||
// 查询学生详情
|
||||
getDemo03Student: async (id: number) => {
|
||||
return await request.get({ url: `/infra/demo03-student-inner/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增学生
|
||||
createDemo03Student: async (data: Demo03Student) => {
|
||||
return await request.post({ url: `/infra/demo03-student-inner/create`, data })
|
||||
},
|
||||
|
||||
// 修改学生
|
||||
updateDemo03Student: async (data: Demo03Student) => {
|
||||
return await request.put({ url: `/infra/demo03-student-inner/update`, data })
|
||||
},
|
||||
|
||||
// 删除学生
|
||||
deleteDemo03Student: async (id: number) => {
|
||||
return await request.delete({ url: `/infra/demo03-student-inner/delete?id=` + id })
|
||||
},
|
||||
|
||||
/** 批量删除学生 */
|
||||
deleteDemo03StudentList: async (ids: number[]) => {
|
||||
return await request.delete({ url: `/infra/demo03-student-inner/delete-list?ids=${ids.join(',')}` })
|
||||
},
|
||||
|
||||
// 导出学生 Excel
|
||||
exportDemo03Student: async (params) => {
|
||||
return await request.download({ url: `/infra/demo03-student-inner/export-excel`, params })
|
||||
},
|
||||
|
||||
// ==================== 子表(学生课程) ====================
|
||||
|
||||
// 获得学生课程列表
|
||||
getDemo03CourseListByStudentId: async (studentId) => {
|
||||
return await request.get({ url: `/infra/demo03-student-inner/demo03-course/list-by-student-id?studentId=` + studentId })
|
||||
},
|
||||
|
||||
// ==================== 子表(学生班级) ====================
|
||||
|
||||
// 获得学生班级
|
||||
getDemo03GradeByStudentId: async (studentId) => {
|
||||
return await request.get({ url: `/infra/demo03-student-inner/demo03-grade/get-by-student-id?studentId=` + studentId })
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
import request from '@/config/axios'
|
||||
import type { Dayjs } from 'dayjs';
|
||||
|
||||
/** 学生课程信息 */
|
||||
export interface Demo03Course {
|
||||
id: number; // 编号
|
||||
studentId?: number; // 学生编号
|
||||
name?: string; // 名字
|
||||
score?: number; // 分数
|
||||
}
|
||||
|
||||
/** 学生班级信息 */
|
||||
export interface Demo03Grade {
|
||||
id: number; // 编号
|
||||
studentId?: number; // 学生编号
|
||||
name?: string; // 名字
|
||||
teacher?: string; // 班主任
|
||||
}
|
||||
|
||||
/** 学生信息 */
|
||||
export interface Demo03Student {
|
||||
id: number; // 编号
|
||||
name?: string; // 名字
|
||||
sex?: number; // 性别
|
||||
birthday?: string | Dayjs; // 出生日期
|
||||
description?: string; // 简介
|
||||
demo03courses?: Demo03Course[]
|
||||
demo03grade?: Demo03Grade
|
||||
}
|
||||
|
||||
// 学生 API
|
||||
export const Demo03StudentApi = {
|
||||
// 查询学生分页
|
||||
getDemo03StudentPage: async (params: any) => {
|
||||
return await request.get({ url: `/infra/demo03-student-normal/page`, params })
|
||||
},
|
||||
|
||||
// 查询学生详情
|
||||
getDemo03Student: async (id: number) => {
|
||||
return await request.get({ url: `/infra/demo03-student-normal/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增学生
|
||||
createDemo03Student: async (data: Demo03Student) => {
|
||||
return await request.post({ url: `/infra/demo03-student-normal/create`, data })
|
||||
},
|
||||
|
||||
// 修改学生
|
||||
updateDemo03Student: async (data: Demo03Student) => {
|
||||
return await request.put({ url: `/infra/demo03-student-normal/update`, data })
|
||||
},
|
||||
|
||||
// 删除学生
|
||||
deleteDemo03Student: async (id: number) => {
|
||||
return await request.delete({ url: `/infra/demo03-student-normal/delete?id=` + id })
|
||||
},
|
||||
|
||||
/** 批量删除学生 */
|
||||
deleteDemo03StudentList: async (ids: number[]) => {
|
||||
return await request.delete({ url: `/infra/demo03-student-normal/delete-list?ids=${ids.join(',')}` })
|
||||
},
|
||||
|
||||
// 导出学生 Excel
|
||||
exportDemo03Student: async (params) => {
|
||||
return await request.download({ url: `/infra/demo03-student-normal/export-excel`, params })
|
||||
},
|
||||
|
||||
// ==================== 子表(学生课程) ====================
|
||||
|
||||
// 获得学生课程列表
|
||||
getDemo03CourseListByStudentId: async (studentId) => {
|
||||
return await request.get({ url: `/infra/demo03-student-normal/demo03-course/list-by-student-id?studentId=` + studentId })
|
||||
},
|
||||
|
||||
// ==================== 子表(学生班级) ====================
|
||||
|
||||
// 获得学生班级
|
||||
getDemo03GradeByStudentId: async (studentId) => {
|
||||
return await request.get({ url: `/infra/demo03-student-normal/demo03-grade/get-by-student-id?studentId=` + studentId })
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 文件预签名地址 Response VO
|
||||
export interface FilePresignedUrlRespVO {
|
||||
// 文件配置编号
|
||||
configId: number
|
||||
// 文件上传 URL
|
||||
uploadUrl: string
|
||||
// 文件 URL
|
||||
url: string
|
||||
// 文件路径
|
||||
path: string
|
||||
}
|
||||
|
||||
// 查询文件列表
|
||||
export const getFilePage = (params: PageParam) => {
|
||||
return request.get({ url: '/infra/file/page', params })
|
||||
}
|
||||
|
||||
// 删除文件
|
||||
export const deleteFile = (id: number) => {
|
||||
return request.delete({ url: '/infra/file/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 批量删除文件
|
||||
export const deleteFileList = (ids: number[]) => {
|
||||
return request.delete({ url: '/infra/file/delete-list', params: { ids: ids.join(',') } })
|
||||
}
|
||||
|
||||
// 获取文件预签名地址
|
||||
export const getFilePresignedUrl = (name: string, directory?: string) => {
|
||||
return request.get<FilePresignedUrlRespVO>({
|
||||
url: '/infra/file/presigned-url',
|
||||
params: { name, directory }
|
||||
})
|
||||
}
|
||||
|
||||
// 创建文件
|
||||
export const createFile = (data: any) => {
|
||||
return request.post({ url: '/infra/file/create', data })
|
||||
}
|
||||
|
||||
// 上传文件
|
||||
export const updateFile = (data: any) => {
|
||||
return request.upload({ url: '/infra/file/upload', data })
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface FileClientConfig {
|
||||
basePath: string
|
||||
host?: string
|
||||
port?: number
|
||||
username?: string
|
||||
password?: string
|
||||
mode?: string
|
||||
endpoint?: string
|
||||
bucket?: string
|
||||
accessKey?: string
|
||||
accessSecret?: string
|
||||
enablePathStyleAccess?: boolean
|
||||
enablePublicAccess?: boolean
|
||||
domain: string
|
||||
}
|
||||
|
||||
export interface FileConfigVO {
|
||||
id: number
|
||||
name: string
|
||||
storage?: number
|
||||
master: boolean
|
||||
visible: boolean
|
||||
config: FileClientConfig
|
||||
remark: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
// 查询文件配置列表
|
||||
export const getFileConfigPage = (params: PageParam) => {
|
||||
return request.get({ url: '/infra/file-config/page', params })
|
||||
}
|
||||
|
||||
// 查询文件配置详情
|
||||
export const getFileConfig = (id: number) => {
|
||||
return request.get({ url: '/infra/file-config/get?id=' + id })
|
||||
}
|
||||
|
||||
// 更新文件配置为主配置
|
||||
export const updateFileConfigMaster = (id: number) => {
|
||||
return request.put({ url: '/infra/file-config/update-master?id=' + id })
|
||||
}
|
||||
|
||||
// 新增文件配置
|
||||
export const createFileConfig = (data: FileConfigVO) => {
|
||||
return request.post({ url: '/infra/file-config/create', data })
|
||||
}
|
||||
|
||||
// 修改文件配置
|
||||
export const updateFileConfig = (data: FileConfigVO) => {
|
||||
return request.put({ url: '/infra/file-config/update', data })
|
||||
}
|
||||
|
||||
// 删除文件配置
|
||||
export const deleteFileConfig = (id: number) => {
|
||||
return request.delete({ url: '/infra/file-config/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 批量删除文件配置
|
||||
export const deleteFileConfigList = (ids: number[]) => {
|
||||
return request.delete({ url: '/infra/file-config/delete-list', params: { ids: ids.join(',') } })
|
||||
}
|
||||
|
||||
// 测试文件配置
|
||||
export const testFileConfig = (id: number) => {
|
||||
return request.get({ url: '/infra/file-config/test?id=' + id })
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface JobVO {
|
||||
id: number
|
||||
name: string
|
||||
status: number
|
||||
handlerName: string
|
||||
handlerParam: string
|
||||
cronExpression: string
|
||||
retryCount: number
|
||||
retryInterval: number
|
||||
monitorTimeout: number
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
// 任务列表
|
||||
export const getJobPage = (params: PageParam) => {
|
||||
return request.get({ url: '/infra/job/page', params })
|
||||
}
|
||||
|
||||
// 任务详情
|
||||
export const getJob = (id: number) => {
|
||||
return request.get({ url: '/infra/job/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增任务
|
||||
export const createJob = (data: JobVO) => {
|
||||
return request.post({ url: '/infra/job/create', data })
|
||||
}
|
||||
|
||||
// 修改定时任务调度
|
||||
export const updateJob = (data: JobVO) => {
|
||||
return request.put({ url: '/infra/job/update', data })
|
||||
}
|
||||
|
||||
// 删除定时任务调度
|
||||
export const deleteJob = (id: number) => {
|
||||
return request.delete({ url: '/infra/job/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 批量删除定时任务调度
|
||||
export const deleteJobList = (ids: number[]) => {
|
||||
return request.delete({ url: '/infra/job/delete-list', params: { ids: ids.join(',') } })
|
||||
}
|
||||
|
||||
// 导出定时任务调度
|
||||
export const exportJob = (params) => {
|
||||
return request.download({ url: '/infra/job/export-excel', params })
|
||||
}
|
||||
|
||||
// 任务状态修改
|
||||
export const updateJobStatus = (id: number, status: number) => {
|
||||
const params = {
|
||||
id,
|
||||
status
|
||||
}
|
||||
return request.put({ url: '/infra/job/update-status', params })
|
||||
}
|
||||
|
||||
// 定时任务立即执行一次
|
||||
export const runJob = (id: number) => {
|
||||
return request.put({ url: '/infra/job/trigger?id=' + id })
|
||||
}
|
||||
|
||||
// 获得定时任务的下 n 次执行时间
|
||||
export const getJobNextTimes = (id: number) => {
|
||||
return request.get({ url: '/infra/job/get_next_times?id=' + id })
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface JobLogVO {
|
||||
id: number
|
||||
jobId: number
|
||||
handlerName: string
|
||||
handlerParam: string
|
||||
cronExpression: string
|
||||
executeIndex: string
|
||||
beginTime: Date
|
||||
endTime: Date
|
||||
duration: string
|
||||
status: number
|
||||
createTime: string
|
||||
result: string
|
||||
}
|
||||
|
||||
// 任务日志列表
|
||||
export const getJobLogPage = (params: PageParam) => {
|
||||
return request.get({ url: '/infra/job-log/page', params })
|
||||
}
|
||||
|
||||
// 任务日志详情
|
||||
export const getJobLog = (id: number) => {
|
||||
return request.get({ url: '/infra/job-log/get?id=' + id })
|
||||
}
|
||||
|
||||
// 导出定时任务日志
|
||||
export const exportJobLog = (params) => {
|
||||
return request.download({
|
||||
url: '/infra/job-log/export-excel',
|
||||
params
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/**
|
||||
* 获取redis 监控信息
|
||||
*/
|
||||
export const getCache = () => {
|
||||
return request.get({ url: '/infra/redis/get-monitor-info' })
|
||||
}
|
||||
176
yudao-ui/yudao-ui-admin-vue3-master/src/api/infra/redis/types.ts
Normal file
176
yudao-ui/yudao-ui-admin-vue3-master/src/api/infra/redis/types.ts
Normal file
@@ -0,0 +1,176 @@
|
||||
export interface RedisMonitorInfoVO {
|
||||
info: RedisInfoVO
|
||||
dbSize: number
|
||||
commandStats: RedisCommandStatsVO[]
|
||||
}
|
||||
|
||||
export interface RedisInfoVO {
|
||||
io_threaded_reads_processed: string
|
||||
tracking_clients: string
|
||||
uptime_in_seconds: string
|
||||
cluster_connections: string
|
||||
current_cow_size: string
|
||||
maxmemory_human: string
|
||||
aof_last_cow_size: string
|
||||
master_replid2: string
|
||||
mem_replication_backlog: string
|
||||
aof_rewrite_scheduled: string
|
||||
total_net_input_bytes: string
|
||||
rss_overhead_ratio: string
|
||||
hz: string
|
||||
current_cow_size_age: string
|
||||
redis_build_id: string
|
||||
errorstat_BUSYGROUP: string
|
||||
aof_last_bgrewrite_status: string
|
||||
multiplexing_api: string
|
||||
client_recent_max_output_buffer: string
|
||||
allocator_resident: string
|
||||
mem_fragmentation_bytes: string
|
||||
aof_current_size: string
|
||||
repl_backlog_first_byte_offset: string
|
||||
tracking_total_prefixes: string
|
||||
redis_mode: string
|
||||
redis_git_dirty: string
|
||||
aof_delayed_fsync: string
|
||||
allocator_rss_bytes: string
|
||||
repl_backlog_histlen: string
|
||||
io_threads_active: string
|
||||
rss_overhead_bytes: string
|
||||
total_system_memory: string
|
||||
loading: string
|
||||
evicted_keys: string
|
||||
maxclients: string
|
||||
cluster_enabled: string
|
||||
redis_version: string
|
||||
repl_backlog_active: string
|
||||
mem_aof_buffer: string
|
||||
allocator_frag_bytes: string
|
||||
io_threaded_writes_processed: string
|
||||
instantaneous_ops_per_sec: string
|
||||
used_memory_human: string
|
||||
total_error_replies: string
|
||||
role: string
|
||||
maxmemory: string
|
||||
used_memory_lua: string
|
||||
rdb_current_bgsave_time_sec: string
|
||||
used_memory_startup: string
|
||||
used_cpu_sys_main_thread: string
|
||||
lazyfree_pending_objects: string
|
||||
aof_pending_bio_fsync: string
|
||||
used_memory_dataset_perc: string
|
||||
allocator_frag_ratio: string
|
||||
arch_bits: string
|
||||
used_cpu_user_main_thread: string
|
||||
mem_clients_normal: string
|
||||
expired_time_cap_reached_count: string
|
||||
unexpected_error_replies: string
|
||||
mem_fragmentation_ratio: string
|
||||
aof_last_rewrite_time_sec: string
|
||||
master_replid: string
|
||||
aof_rewrite_in_progress: string
|
||||
lru_clock: string
|
||||
maxmemory_policy: string
|
||||
run_id: string
|
||||
latest_fork_usec: string
|
||||
tracking_total_items: string
|
||||
total_commands_processed: string
|
||||
expired_keys: string
|
||||
errorstat_ERR: string
|
||||
used_memory: string
|
||||
module_fork_in_progress: string
|
||||
errorstat_WRONGPASS: string
|
||||
aof_buffer_length: string
|
||||
dump_payload_sanitizations: string
|
||||
mem_clients_slaves: string
|
||||
keyspace_misses: string
|
||||
server_time_usec: string
|
||||
executable: string
|
||||
lazyfreed_objects: string
|
||||
db0: string
|
||||
used_memory_peak_human: string
|
||||
keyspace_hits: string
|
||||
rdb_last_cow_size: string
|
||||
aof_pending_rewrite: string
|
||||
used_memory_overhead: string
|
||||
active_defrag_hits: string
|
||||
tcp_port: string
|
||||
uptime_in_days: string
|
||||
used_memory_peak_perc: string
|
||||
current_save_keys_processed: string
|
||||
blocked_clients: string
|
||||
total_reads_processed: string
|
||||
expire_cycle_cpu_milliseconds: string
|
||||
sync_partial_err: string
|
||||
used_memory_scripts_human: string
|
||||
aof_current_rewrite_time_sec: string
|
||||
aof_enabled: string
|
||||
process_supervised: string
|
||||
master_repl_offset: string
|
||||
used_memory_dataset: string
|
||||
used_cpu_user: string
|
||||
rdb_last_bgsave_status: string
|
||||
tracking_total_keys: string
|
||||
atomicvar_api: string
|
||||
allocator_rss_ratio: string
|
||||
client_recent_max_input_buffer: string
|
||||
clients_in_timeout_table: string
|
||||
aof_last_write_status: string
|
||||
mem_allocator: string
|
||||
used_memory_scripts: string
|
||||
used_memory_peak: string
|
||||
process_id: string
|
||||
master_failover_state: string
|
||||
errorstat_NOAUTH: string
|
||||
used_cpu_sys: string
|
||||
repl_backlog_size: string
|
||||
connected_slaves: string
|
||||
current_save_keys_total: string
|
||||
gcc_version: string
|
||||
total_system_memory_human: string
|
||||
sync_full: string
|
||||
connected_clients: string
|
||||
module_fork_last_cow_size: string
|
||||
total_writes_processed: string
|
||||
allocator_active: string
|
||||
total_net_output_bytes: string
|
||||
pubsub_channels: string
|
||||
current_fork_perc: string
|
||||
active_defrag_key_hits: string
|
||||
rdb_changes_since_last_save: string
|
||||
instantaneous_input_kbps: string
|
||||
used_memory_rss_human: string
|
||||
configured_hz: string
|
||||
expired_stale_perc: string
|
||||
active_defrag_misses: string
|
||||
used_cpu_sys_children: string
|
||||
number_of_cached_scripts: string
|
||||
sync_partial_ok: string
|
||||
used_memory_lua_human: string
|
||||
rdb_last_save_time: string
|
||||
pubsub_patterns: string
|
||||
slave_expires_tracked_keys: string
|
||||
redis_git_sha1: string
|
||||
used_memory_rss: string
|
||||
rdb_last_bgsave_time_sec: string
|
||||
os: string
|
||||
mem_not_counted_for_evict: string
|
||||
active_defrag_running: string
|
||||
rejected_connections: string
|
||||
aof_rewrite_buffer_length: string
|
||||
total_forks: string
|
||||
active_defrag_key_misses: string
|
||||
allocator_allocated: string
|
||||
aof_base_size: string
|
||||
instantaneous_output_kbps: string
|
||||
second_repl_offset: string
|
||||
rdb_bgsave_in_progress: string
|
||||
used_cpu_user_children: string
|
||||
total_connections_received: string
|
||||
migrate_cached_sockets: string
|
||||
}
|
||||
|
||||
export interface RedisCommandStatsVO {
|
||||
command: string
|
||||
calls: number
|
||||
usec: number
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** IoT 告警配置信息 */
|
||||
export interface AlertConfig {
|
||||
id: number // 配置编号
|
||||
name?: string // 配置名称
|
||||
description: string // 配置描述
|
||||
level?: number // 告警级别
|
||||
status?: number // 配置状态
|
||||
sceneRuleIds: string // 关联的场景联动规则编号数组
|
||||
receiveUserIds: string // 接收的用户编号数组
|
||||
receiveTypes: string // 接收的类型数组
|
||||
}
|
||||
|
||||
// IoT 告警配置 API
|
||||
export const AlertConfigApi = {
|
||||
// 查询告警配置分页
|
||||
getAlertConfigPage: async (params: any) => {
|
||||
return await request.get({ url: `/iot/alert-config/page`, params })
|
||||
},
|
||||
|
||||
// 查询告警配置详情
|
||||
getAlertConfig: async (id: number) => {
|
||||
return await request.get({ url: `/iot/alert-config/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增告警配置
|
||||
createAlertConfig: async (data: AlertConfig) => {
|
||||
return await request.post({ url: `/iot/alert-config/create`, data })
|
||||
},
|
||||
|
||||
// 修改告警配置
|
||||
updateAlertConfig: async (data: AlertConfig) => {
|
||||
return await request.put({ url: `/iot/alert-config/update`, data })
|
||||
},
|
||||
|
||||
// 删除告警配置
|
||||
deleteAlertConfig: async (id: number) => {
|
||||
return await request.delete({ url: `/iot/alert-config/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 获取告警配置简单列表
|
||||
getSimpleAlertConfigList: async () => {
|
||||
return await request.get({ url: `/iot/alert-config/simple-list` })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** IoT 告警记录信息 */
|
||||
export interface AlertRecord {
|
||||
id: number // 记录编号
|
||||
configId: number // 告警配置编号
|
||||
configName: string // 告警名称
|
||||
configLevel: number // 告警级别
|
||||
productId: number // 产品编号
|
||||
deviceId: number // 设备编号
|
||||
deviceMessage: any // 触发的设备消息
|
||||
processStatus?: boolean // 是否处理
|
||||
processRemark: string // 处理结果(备注)
|
||||
}
|
||||
|
||||
// IoT 告警记录 API
|
||||
export const AlertRecordApi = {
|
||||
// 查询告警记录分页
|
||||
getAlertRecordPage: async (params: any) => {
|
||||
return await request.get({ url: `/iot/alert-record/page`, params })
|
||||
},
|
||||
|
||||
// 查询告警记录详情
|
||||
getAlertRecord: async (id: number) => {
|
||||
return await request.get({ url: `/iot/alert-record/get?id=` + id })
|
||||
},
|
||||
|
||||
// 处理告警记录
|
||||
processAlertRecord: async (id: number, processRemark: string) => {
|
||||
return await request.put({
|
||||
url: `/iot/alert-record/process`,
|
||||
data: { id, processRemark }
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// IoT 设备 VO
|
||||
export interface DeviceVO {
|
||||
id: number // 设备 ID,主键,自增
|
||||
deviceName: string // 设备名称
|
||||
productId: number // 产品编号
|
||||
productKey: string // 产品标识
|
||||
deviceType: number // 设备类型
|
||||
nickname: string // 设备备注名称
|
||||
gatewayId: number // 网关设备 ID
|
||||
state: number // 设备状态
|
||||
onlineTime: Date // 最后上线时间
|
||||
offlineTime: Date // 最后离线时间
|
||||
activeTime: Date // 设备激活时间
|
||||
createTime: Date // 创建时间
|
||||
ip: string // 设备的 IP 地址
|
||||
firmwareVersion: string // 设备的固件版本
|
||||
deviceSecret: string // 设备密钥,用于设备认证,需安全存储
|
||||
mqttClientId: string // MQTT 客户端 ID
|
||||
mqttUsername: string // MQTT 用户名
|
||||
mqttPassword: string // MQTT 密码
|
||||
authType: string // 认证类型
|
||||
locationType: number // 定位类型
|
||||
latitude?: number // 设备位置的纬度
|
||||
longitude?: number // 设备位置的经度
|
||||
areaId: number // 地区编码
|
||||
address: string // 设备详细地址
|
||||
serialNumber: string // 设备序列号
|
||||
config: string // 设备配置
|
||||
groupIds?: number[] // 添加分组 ID
|
||||
}
|
||||
|
||||
// IoT 设备属性详细 VO
|
||||
export interface IotDevicePropertyDetailRespVO {
|
||||
identifier: string // 属性标识符
|
||||
value: string // 最新值
|
||||
updateTime: Date // 更新时间
|
||||
name: string // 属性名称
|
||||
dataType: string // 数据类型
|
||||
dataSpecs: any // 数据定义
|
||||
dataSpecsList: any[] // 数据定义列表
|
||||
}
|
||||
|
||||
// IoT 设备属性 VO
|
||||
export interface IotDevicePropertyRespVO {
|
||||
identifier: string // 属性标识符
|
||||
value: string // 最新值
|
||||
updateTime: Date // 更新时间
|
||||
}
|
||||
|
||||
// TODO @芋艿:调整到 constants
|
||||
// IoT 设备状态枚举
|
||||
export enum DeviceStateEnum {
|
||||
INACTIVE = 0, // 未激活
|
||||
ONLINE = 1, // 在线
|
||||
OFFLINE = 2 // 离线
|
||||
}
|
||||
|
||||
// 设备认证参数 VO
|
||||
export interface IotDeviceAuthInfoVO {
|
||||
clientId: string // 客户端 ID
|
||||
username: string // 用户名
|
||||
password: string // 密码
|
||||
}
|
||||
|
||||
// IoT 设备发送消息 Request VO
|
||||
export interface IotDeviceMessageSendReqVO {
|
||||
deviceId: number // 设备编号
|
||||
method: string // 请求方法
|
||||
params?: any // 请求参数
|
||||
}
|
||||
|
||||
// 设备 API
|
||||
export const DeviceApi = {
|
||||
// 查询设备分页
|
||||
getDevicePage: async (params: any) => {
|
||||
return await request.get({ url: `/iot/device/page`, params })
|
||||
},
|
||||
|
||||
// 查询设备详情
|
||||
getDevice: async (id: number) => {
|
||||
return await request.get({ url: `/iot/device/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增设备
|
||||
createDevice: async (data: DeviceVO) => {
|
||||
return await request.post({ url: `/iot/device/create`, data })
|
||||
},
|
||||
|
||||
// 修改设备
|
||||
updateDevice: async (data: DeviceVO) => {
|
||||
return await request.put({ url: `/iot/device/update`, data })
|
||||
},
|
||||
|
||||
// 修改设备分组
|
||||
updateDeviceGroup: async (data: { ids: number[]; groupIds: number[] }) => {
|
||||
return await request.put({ url: `/iot/device/update-group`, data })
|
||||
},
|
||||
|
||||
// 删除单个设备
|
||||
deleteDevice: async (id: number) => {
|
||||
return await request.delete({ url: `/iot/device/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 删除多个设备
|
||||
deleteDeviceList: async (ids: number[]) => {
|
||||
return await request.delete({ url: `/iot/device/delete-list`, params: { ids: ids.join(',') } })
|
||||
},
|
||||
|
||||
// 导出设备
|
||||
exportDeviceExcel: async (params: any) => {
|
||||
return await request.download({ url: `/iot/device/export-excel`, params })
|
||||
},
|
||||
|
||||
// 获取设备数量
|
||||
getDeviceCount: async (productId: number) => {
|
||||
return await request.get({ url: `/iot/device/count?productId=` + productId })
|
||||
},
|
||||
|
||||
// 获取设备的精简信息列表
|
||||
getSimpleDeviceList: async (deviceType?: number, productId?: number) => {
|
||||
return await request.get({ url: `/iot/device/simple-list?`, params: { deviceType, productId } })
|
||||
},
|
||||
|
||||
// 根据产品编号,获取设备的精简信息列表
|
||||
getDeviceListByProductId: async (productId: number) => {
|
||||
return await request.get({ url: `/iot/device/simple-list?`, params: { productId } })
|
||||
},
|
||||
|
||||
// 获取导入模板
|
||||
importDeviceTemplate: async () => {
|
||||
return await request.download({ url: `/iot/device/get-import-template` })
|
||||
},
|
||||
|
||||
// 获取设备属性最新数据
|
||||
getLatestDeviceProperties: async (params: any) => {
|
||||
return await request.get({ url: `/iot/device/property/get-latest`, params })
|
||||
},
|
||||
|
||||
// 获取设备属性历史数据
|
||||
getHistoryDevicePropertyList: async (params: any) => {
|
||||
return await request.get({ url: `/iot/device/property/history-list`, params })
|
||||
},
|
||||
|
||||
// 获取设备认证信息
|
||||
getDeviceAuthInfo: async (id: number) => {
|
||||
return await request.get({ url: `/iot/device/get-auth-info`, params: { id } })
|
||||
},
|
||||
|
||||
// 查询设备消息分页
|
||||
getDeviceMessagePage: async (params: any) => {
|
||||
return await request.get({ url: `/iot/device/message/page`, params })
|
||||
},
|
||||
|
||||
// 查询设备消息配对分页
|
||||
getDeviceMessagePairPage: async (params: any) => {
|
||||
return await request.get({ url: `/iot/device/message/pair-page`, params })
|
||||
},
|
||||
|
||||
// 发送设备消息
|
||||
sendDeviceMessage: async (params: IotDeviceMessageSendReqVO) => {
|
||||
return await request.post({ url: `/iot/device/message/send`, data: params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// IoT 设备分组 VO
|
||||
export interface DeviceGroupVO {
|
||||
id: number // 分组 ID
|
||||
name: string // 分组名字
|
||||
status: number // 分组状态
|
||||
description: string // 分组描述
|
||||
deviceCount?: number // 设备数量
|
||||
}
|
||||
|
||||
// IoT 设备分组 API
|
||||
export const DeviceGroupApi = {
|
||||
// 查询设备分组分页
|
||||
getDeviceGroupPage: async (params: any) => {
|
||||
return await request.get({ url: `/iot/device-group/page`, params })
|
||||
},
|
||||
|
||||
// 查询设备分组详情
|
||||
getDeviceGroup: async (id: number) => {
|
||||
return await request.get({ url: `/iot/device-group/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增设备分组
|
||||
createDeviceGroup: async (data: DeviceGroupVO) => {
|
||||
return await request.post({ url: `/iot/device-group/create`, data })
|
||||
},
|
||||
|
||||
// 修改设备分组
|
||||
updateDeviceGroup: async (data: DeviceGroupVO) => {
|
||||
return await request.put({ url: `/iot/device-group/update`, data })
|
||||
},
|
||||
|
||||
// 删除设备分组
|
||||
deleteDeviceGroup: async (id: number) => {
|
||||
return await request.delete({ url: `/iot/device-group/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 获取设备分组的精简信息列表
|
||||
getSimpleDeviceGroupList: async () => {
|
||||
return await request.get({ url: `/iot/device-group/simple-list` })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** IoT OTA 固件信息 */
|
||||
export interface IoTOtaFirmware {
|
||||
id?: number // 固件编号
|
||||
name?: string // 固件名称
|
||||
description?: string // 固件描述
|
||||
version?: string // 版本号
|
||||
productId?: number // 产品编号
|
||||
productName?: string // 产品名称
|
||||
fileUrl?: string // 固件文件 URL
|
||||
fileSize?: number // 固件文件大小
|
||||
fileDigestAlgorithm?: string // 固件文件签名算法
|
||||
fileDigestValue?: string // 固件文件签名结果
|
||||
createTime?: Date // 创建时间
|
||||
}
|
||||
|
||||
// IoT OTA 固件 API
|
||||
export const IoTOtaFirmwareApi = {
|
||||
// 查询 OTA 固件分页
|
||||
getOtaFirmwarePage: async (params: any) => {
|
||||
return await request.get({ url: `/iot/ota/firmware/page`, params })
|
||||
},
|
||||
|
||||
// 查询 OTA 固件详情
|
||||
getOtaFirmware: async (id: number) => {
|
||||
return await request.get({ url: `/iot/ota/firmware/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增 OTA 固件
|
||||
createOtaFirmware: async (data: IoTOtaFirmware) => {
|
||||
return await request.post({ url: `/iot/ota/firmware/create`, data })
|
||||
},
|
||||
|
||||
// 修改 OTA 固件
|
||||
updateOtaFirmware: async (data: IoTOtaFirmware) => {
|
||||
return await request.put({ url: `/iot/ota/firmware/update`, data })
|
||||
},
|
||||
|
||||
// 删除 OTA 固件
|
||||
deleteOtaFirmware: async (id: number) => {
|
||||
return await request.delete({ url: `/iot/ota/firmware/delete?id=` + id })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** IoT OTA 任务信息 */
|
||||
export interface OtaTask {
|
||||
id?: number // 任务编号
|
||||
name: string // 任务名称
|
||||
description?: string // 任务描述
|
||||
firmwareId?: number // 固件编号
|
||||
status: number // 任务状态
|
||||
deviceScope?: number // 升级范围
|
||||
deviceIds?: number[] // 指定设备ID列表(当升级范围为指定设备时使用)
|
||||
deviceTotalCount?: number // 设备总共数量
|
||||
deviceSuccessCount?: number // 设备成功数量
|
||||
createTime?: Date // 创建时间
|
||||
}
|
||||
|
||||
// IoT OTA 任务 API
|
||||
export const IoTOtaTaskApi = {
|
||||
// 查询 OTA 升级任务分页
|
||||
getOtaTaskPage: async (params: any) => {
|
||||
return await request.get({ url: `/iot/ota/task/page`, params })
|
||||
},
|
||||
|
||||
// 查询 OTA 升级任务详情
|
||||
getOtaTask: async (id: number) => {
|
||||
return await request.get({ url: `/iot/ota/task/get?id=` + id })
|
||||
},
|
||||
|
||||
// 创建 OTA 升级任务
|
||||
createOtaTask: async (data: OtaTask) => {
|
||||
return await request.post({ url: `/iot/ota/task/create`, data })
|
||||
},
|
||||
|
||||
// 取消 OTA 升级任务
|
||||
cancelOtaTask: async (id: number) => {
|
||||
return await request.post({ url: `/iot/ota/task/cancel?id=` + id })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** IoT OTA 任务记录信息 */
|
||||
export interface OtaTaskRecord {
|
||||
id?: number // 升级记录编号
|
||||
firmwareId?: number // 固件编号
|
||||
firmwareVersion?: string // 固件版本
|
||||
taskId?: number // 任务编号
|
||||
deviceId?: string // 设备编号
|
||||
deviceName?: string // 设备名称
|
||||
currentVersion?: string // 当前版本
|
||||
fromFirmwareId?: number // 来源的固件编号
|
||||
fromFirmwareVersion?: string // 来源的固件版本
|
||||
status?: number // 升级状态
|
||||
progress?: number // 升级进度,百分比
|
||||
description?: string // 升级进度描述
|
||||
updateTime?: Date // 更新时间
|
||||
}
|
||||
|
||||
// IoT OTA 任务记录 API
|
||||
export const IoTOtaTaskRecordApi = {
|
||||
getOtaTaskRecordStatusStatistics: async (firmwareId?: number, taskId?: number) => {
|
||||
const params: any = {}
|
||||
if (firmwareId) params.firmwareId = firmwareId
|
||||
if (taskId) params.taskId = taskId
|
||||
return await request.get({ url: `/iot/ota/task/record/get-status-statistics`, params })
|
||||
},
|
||||
|
||||
// 查询 OTA 任务记录分页
|
||||
getOtaTaskRecordPage: async (params: any) => {
|
||||
return await request.get({ url: `/iot/ota/task/record/page`, params })
|
||||
},
|
||||
|
||||
// 取消 OTA 任务记录
|
||||
cancelOtaTaskRecord: async (id: number) => {
|
||||
return await request.put({ url: `/iot/ota/task/record/cancel?id=` + id })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// IoT 产品分类 VO
|
||||
export interface ProductCategoryVO {
|
||||
id: number // 分类 ID
|
||||
name: string // 分类名字
|
||||
sort: number // 分类排序
|
||||
status: number // 分类状态
|
||||
description: string // 分类描述
|
||||
}
|
||||
|
||||
// IoT 产品分类 API
|
||||
export const ProductCategoryApi = {
|
||||
// 查询产品分类分页
|
||||
getProductCategoryPage: async (params: any) => {
|
||||
return await request.get({ url: `/iot/product-category/page`, params })
|
||||
},
|
||||
|
||||
// 查询产品分类详情
|
||||
getProductCategory: async (id: number) => {
|
||||
return await request.get({ url: `/iot/product-category/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增产品分类
|
||||
createProductCategory: async (data: ProductCategoryVO) => {
|
||||
return await request.post({ url: `/iot/product-category/create`, data })
|
||||
},
|
||||
|
||||
// 修改产品分类
|
||||
updateProductCategory: async (data: ProductCategoryVO) => {
|
||||
return await request.put({ url: `/iot/product-category/update`, data })
|
||||
},
|
||||
|
||||
// 删除产品分类
|
||||
deleteProductCategory: async (id: number) => {
|
||||
return await request.delete({ url: `/iot/product-category/delete?id=` + id })
|
||||
},
|
||||
|
||||
/** 获取产品分类精简列表 */
|
||||
getSimpleProductCategoryList: () => {
|
||||
return request.get({ url: '/iot/product-category/simple-list' })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// IoT 产品 VO
|
||||
export interface ProductVO {
|
||||
id: number // 产品编号
|
||||
name: string // 产品名称
|
||||
productKey: string // 产品标识
|
||||
protocolId: number // 协议编号
|
||||
categoryId: number // 产品所属品类标识符
|
||||
categoryName?: string // 产品所属品类名称
|
||||
icon: string // 产品图标
|
||||
picUrl: string // 产品图片
|
||||
description: string // 产品描述
|
||||
status: number // 产品状态
|
||||
deviceType: number // 设备类型
|
||||
locationType: number // 设备类型
|
||||
netType: number // 联网方式
|
||||
codecType: string // 数据格式(编解码器类型)
|
||||
deviceCount: number // 设备数量
|
||||
createTime: Date // 创建时间
|
||||
}
|
||||
|
||||
// IOT 产品设备类型枚举类 0: 直连设备, 1: 网关子设备, 2: 网关设备
|
||||
export enum DeviceTypeEnum {
|
||||
DEVICE = 0, // 直连设备
|
||||
GATEWAY_SUB = 1, // 网关子设备
|
||||
GATEWAY = 2 // 网关设备
|
||||
}
|
||||
// IOT 产品定位类型枚举类 0: 手动定位, 1: IP 定位, 2: 定位模块定位
|
||||
export enum LocationTypeEnum {
|
||||
IP = 1, // IP 定位
|
||||
MODULE = 2, // 设备定位
|
||||
MANUAL = 3 // 手动定位
|
||||
}
|
||||
// IOT 数据格式(编解码器类型)枚举类
|
||||
export enum CodecTypeEnum {
|
||||
ALINK = 'Alink' // 阿里云 Alink 协议
|
||||
}
|
||||
|
||||
// IoT 产品 API
|
||||
export const ProductApi = {
|
||||
// 查询产品分页
|
||||
getProductPage: async (params: any) => {
|
||||
return await request.get({ url: `/iot/product/page`, params })
|
||||
},
|
||||
|
||||
// 查询产品详情
|
||||
getProduct: async (id: number) => {
|
||||
return await request.get({ url: `/iot/product/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增产品
|
||||
createProduct: async (data: ProductVO) => {
|
||||
return await request.post({ url: `/iot/product/create`, data })
|
||||
},
|
||||
|
||||
// 修改产品
|
||||
updateProduct: async (data: ProductVO) => {
|
||||
return await request.put({ url: `/iot/product/update`, data })
|
||||
},
|
||||
|
||||
// 删除产品
|
||||
deleteProduct: async (id: number) => {
|
||||
return await request.delete({ url: `/iot/product/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出产品 Excel
|
||||
exportProduct: async (params) => {
|
||||
return await request.download({ url: `/iot/product/export-excel`, params })
|
||||
},
|
||||
|
||||
// 更新产品状态
|
||||
updateProductStatus: async (id: number, status: number) => {
|
||||
return await request.put({ url: `/iot/product/update-status?id=` + id + `&status=` + status })
|
||||
},
|
||||
|
||||
// 查询产品(精简)列表
|
||||
getSimpleProductList() {
|
||||
return request.get({ url: '/iot/product/simple-list' })
|
||||
},
|
||||
|
||||
// 根据 ProductKey 获取产品信息
|
||||
getProductByKey: async (productKey: string) => {
|
||||
return await request.get({ url: `/iot/product/get-by-key`, params: { productKey } })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** IoT 数据流转规则信息 */
|
||||
export interface DataRule {
|
||||
id: number // 场景编号
|
||||
name?: string // 场景名称
|
||||
description: string // 场景描述
|
||||
status?: number // 场景状态
|
||||
sourceConfigs?: any[] // 数据源配置数组
|
||||
sinkIds?: number[] // 数据目的编号数组
|
||||
}
|
||||
|
||||
// IoT 数据流转规则 API
|
||||
export const DataRuleApi = {
|
||||
// 查询数据流转规则分页
|
||||
getDataRulePage: async (params: any) => {
|
||||
return await request.get({ url: `/iot/data-rule/page`, params })
|
||||
},
|
||||
|
||||
// 查询数据流转规则详情
|
||||
getDataRule: async (id: number) => {
|
||||
return await request.get({ url: `/iot/data-rule/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增数据流转规则
|
||||
createDataRule: async (data: DataRule) => {
|
||||
return await request.post({ url: `/iot/data-rule/create`, data })
|
||||
},
|
||||
|
||||
// 修改数据流转规则
|
||||
updateDataRule: async (data: DataRule) => {
|
||||
return await request.put({ url: `/iot/data-rule/update`, data })
|
||||
},
|
||||
|
||||
// 删除数据流转规则
|
||||
deleteDataRule: async (id: number) => {
|
||||
return await request.delete({ url: `/iot/data-rule/delete?id=` + id })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// IoT 数据流转目的 VO
|
||||
export interface DataSinkVO {
|
||||
id?: number // 桥梁编号
|
||||
name?: string // 桥梁名称
|
||||
description?: string // 桥梁描述
|
||||
status?: number // 桥梁状态
|
||||
direction?: number // 桥梁方向
|
||||
type?: number // 桥梁类型
|
||||
config?:
|
||||
| HttpConfig
|
||||
| MqttConfig
|
||||
| RocketMQConfig
|
||||
| KafkaMQConfig
|
||||
| RabbitMQConfig
|
||||
| RedisStreamMQConfig // 桥梁配置
|
||||
}
|
||||
|
||||
interface Config {
|
||||
type: string
|
||||
}
|
||||
|
||||
/** HTTP 配置 */
|
||||
export interface HttpConfig extends Config {
|
||||
url: string
|
||||
method: string
|
||||
headers: Record<string, string>
|
||||
query: Record<string, string>
|
||||
body: string
|
||||
}
|
||||
|
||||
/** MQTT 配置 */
|
||||
export interface MqttConfig extends Config {
|
||||
url: string
|
||||
username: string
|
||||
password: string
|
||||
clientId: string
|
||||
topic: string
|
||||
}
|
||||
|
||||
/** RocketMQ 配置 */
|
||||
export interface RocketMQConfig extends Config {
|
||||
nameServer: string
|
||||
accessKey: string
|
||||
secretKey: string
|
||||
group: string
|
||||
topic: string
|
||||
tags: string
|
||||
}
|
||||
|
||||
/** Kafka 配置 */
|
||||
export interface KafkaMQConfig extends Config {
|
||||
bootstrapServers: string
|
||||
username: string
|
||||
password: string
|
||||
ssl: boolean
|
||||
topic: string
|
||||
}
|
||||
|
||||
/** RabbitMQ 配置 */
|
||||
export interface RabbitMQConfig extends Config {
|
||||
host: string
|
||||
port: number
|
||||
virtualHost: string
|
||||
username: string
|
||||
password: string
|
||||
exchange: string
|
||||
routingKey: string
|
||||
queue: string
|
||||
}
|
||||
|
||||
/** Redis Stream MQ 配置 */
|
||||
export interface RedisStreamMQConfig extends Config {
|
||||
host: string
|
||||
port: number
|
||||
password: string
|
||||
database: number
|
||||
topic: string
|
||||
}
|
||||
|
||||
/** 数据流转目的类型 */
|
||||
export const IotDataSinkTypeEnum = {
|
||||
HTTP: 1,
|
||||
TCP: 2,
|
||||
WEBSOCKET: 3,
|
||||
MQTT: 10,
|
||||
DATABASE: 20,
|
||||
REDIS_STREAM: 21,
|
||||
ROCKETMQ: 30,
|
||||
RABBITMQ: 31,
|
||||
KAFKA: 32
|
||||
} as const
|
||||
|
||||
// 数据流转目的 API
|
||||
export const DataSinkApi = {
|
||||
// 查询数据流转目的分页
|
||||
getDataSinkPage: async (params: any) => {
|
||||
return await request.get({ url: `/iot/data-sink/page`, params })
|
||||
},
|
||||
|
||||
// 查询数据流转目的详情
|
||||
getDataSink: async (id: number) => {
|
||||
return await request.get({ url: `/iot/data-sink/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增数据流转目的
|
||||
createDataSink: async (data: DataSinkVO) => {
|
||||
return await request.post({ url: `/iot/data-sink/create`, data })
|
||||
},
|
||||
|
||||
// 修改数据流转目的
|
||||
updateDataSink: async (data: DataSinkVO) => {
|
||||
return await request.put({ url: `/iot/data-sink/update`, data })
|
||||
},
|
||||
|
||||
// 删除数据流转目的
|
||||
deleteDataSink: async (id: number) => {
|
||||
return await request.delete({ url: `/iot/data-sink/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 查询数据流转目的(精简)列表
|
||||
getDataSinkSimpleList() {
|
||||
return request.get({ url: '/iot/data-sink/simple-list' })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 场景联动
|
||||
export interface IotSceneRule {
|
||||
id?: number // 场景编号
|
||||
name: string // 场景名称
|
||||
description?: string // 场景描述
|
||||
status: number // 场景状态:0-开启,1-关闭
|
||||
triggers: Trigger[] // 触发器数组
|
||||
actions: Action[] // 执行器数组
|
||||
}
|
||||
|
||||
// 触发器结构
|
||||
export interface Trigger {
|
||||
type: number // 触发类型
|
||||
productId?: number // 产品编号
|
||||
deviceId?: number // 设备编号
|
||||
identifier?: string // 物模型标识符
|
||||
operator?: string // 操作符
|
||||
value?: string // 参数值
|
||||
cronExpression?: string // CRON 表达式
|
||||
conditionGroups?: TriggerCondition[][] // 条件组(二维数组)
|
||||
}
|
||||
|
||||
// 触发条件结构
|
||||
export interface TriggerCondition {
|
||||
type: number // 条件类型:1-设备状态,2-设备属性,3-当前时间
|
||||
productId?: number // 产品编号
|
||||
deviceId?: number // 设备编号
|
||||
identifier?: string // 标识符
|
||||
operator: string // 操作符
|
||||
param: string // 参数
|
||||
}
|
||||
|
||||
// 执行器结构
|
||||
export interface Action {
|
||||
type: number // 执行类型
|
||||
productId?: number // 产品编号
|
||||
deviceId?: number // 设备编号
|
||||
identifier?: string // 物模型标识符(服务调用时使用)
|
||||
params?: string // 请求参数
|
||||
alertConfigId?: number // 告警配置编号
|
||||
}
|
||||
|
||||
// IoT 场景联动 API
|
||||
export const RuleSceneApi = {
|
||||
// 查询场景联动分页
|
||||
getRuleScenePage: async (params: any) => {
|
||||
return await request.get({ url: `/iot/scene-rule/page`, params })
|
||||
},
|
||||
|
||||
// 查询场景联动详情
|
||||
getRuleScene: async (id: number) => {
|
||||
return await request.get({ url: `/iot/scene-rule/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增场景联动
|
||||
createRuleScene: async (data: IotSceneRule) => {
|
||||
return await request.post({ url: `/iot/scene-rule/create`, data })
|
||||
},
|
||||
|
||||
// 修改场景联动
|
||||
updateRuleScene: async (data: IotSceneRule) => {
|
||||
return await request.put({ url: `/iot/scene-rule/update`, data })
|
||||
},
|
||||
|
||||
// 修改场景联动
|
||||
updateRuleSceneStatus: async (id: number, status: number) => {
|
||||
return await request.put({
|
||||
url: `/iot/scene-rule/update-status`,
|
||||
data: {
|
||||
id,
|
||||
status
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 删除场景联动
|
||||
deleteRuleScene: async (id: number) => {
|
||||
return await request.delete({ url: `/iot/scene-rule/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 获取场景联动简单列表
|
||||
getSimpleRuleSceneList: async () => {
|
||||
return await request.get({ url: `/iot/scene-rule/simple-list` })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** IoT 统计数据类型 */
|
||||
export interface IotStatisticsSummaryRespVO {
|
||||
productCategoryCount: number
|
||||
productCount: number
|
||||
deviceCount: number
|
||||
deviceMessageCount: number
|
||||
productCategoryTodayCount: number
|
||||
productTodayCount: number
|
||||
deviceTodayCount: number
|
||||
deviceMessageTodayCount: number
|
||||
deviceOnlineCount: number
|
||||
deviceOfflineCount: number
|
||||
deviceInactiveCount: number
|
||||
productCategoryDeviceCounts: Record<string, number>
|
||||
}
|
||||
|
||||
/** 时间戳-数值的键值对类型 */
|
||||
interface TimeValueItem {
|
||||
[key: string]: number
|
||||
}
|
||||
|
||||
/** IoT 消息统计数据类型 */
|
||||
export interface IotStatisticsDeviceMessageSummaryRespVO {
|
||||
statType: number
|
||||
upstreamCounts: TimeValueItem[]
|
||||
downstreamCounts: TimeValueItem[]
|
||||
}
|
||||
|
||||
/** 新的消息统计数据项 */
|
||||
export interface IotStatisticsDeviceMessageSummaryByDateRespVO {
|
||||
time: string
|
||||
upstreamCount: number
|
||||
downstreamCount: number
|
||||
}
|
||||
|
||||
/** 新的消息统计接口参数 */
|
||||
export interface IotStatisticsDeviceMessageReqVO {
|
||||
interval: number
|
||||
times?: string[]
|
||||
}
|
||||
|
||||
// IoT 数据统计 API
|
||||
export const StatisticsApi = {
|
||||
// 查询全局的数据统计
|
||||
getStatisticsSummary: async () => {
|
||||
return await request.get<IotStatisticsSummaryRespVO>({
|
||||
url: `/iot/statistics/get-summary`
|
||||
})
|
||||
},
|
||||
|
||||
// 获取设备消息的数据统计
|
||||
getDeviceMessageSummaryByDate: async (params: IotStatisticsDeviceMessageReqVO) => {
|
||||
return await request.get<IotStatisticsDeviceMessageSummaryByDateRespVO[]>({
|
||||
url: `/iot/statistics/get-device-message-summary-by-date`,
|
||||
params
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,301 @@
|
||||
import request from '@/config/axios'
|
||||
import { isEmpty } from '@/utils/is'
|
||||
|
||||
/**
|
||||
* IoT 产品物模型
|
||||
*/
|
||||
export interface ThingModelData {
|
||||
id?: number // 物模型功能编号
|
||||
identifier?: string // 功能标识
|
||||
name?: string // 功能名称
|
||||
description?: string // 功能描述
|
||||
productId?: number // 产品编号
|
||||
productKey?: string // 产品标识
|
||||
dataType: string // 数据类型,与 dataSpecs 的 dataType 保持一致
|
||||
type: number // 功能类型
|
||||
property: ThingModelProperty // 属性
|
||||
event?: ThingModelEvent // 事件
|
||||
service?: ThingModelService // 服务
|
||||
}
|
||||
|
||||
/**
|
||||
* ThingModelProperty 类型
|
||||
*/
|
||||
export interface ThingModelProperty {
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
/**
|
||||
* ThingModelEvent 类型
|
||||
*/
|
||||
export interface ThingModelEvent {
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
/**
|
||||
* ThingModelService 类型
|
||||
*/
|
||||
export interface ThingModelService {
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
/** dataSpecs 数值型数据结构 */
|
||||
export interface DataSpecsNumberData {
|
||||
dataType: 'int' | 'float' | 'double' // 数据类型,取值为 INT、FLOAT 或 DOUBLE
|
||||
max: string // 最大值,必须与 dataType 设置一致,且为 STRING 类型
|
||||
min: string // 最小值,必须与 dataType 设置一致,且为 STRING 类型
|
||||
step: string // 步长,必须与 dataType 设置一致,且为 STRING 类型
|
||||
precise?: string // 精度,当 dataType 为 FLOAT 或 DOUBLE 时可选
|
||||
defaultValue?: string // 默认值,可选
|
||||
unit: string // 单位的符号
|
||||
unitName: string // 单位的名称
|
||||
}
|
||||
|
||||
/** dataSpecs 枚举型数据结构 */
|
||||
export interface DataSpecsEnumOrBoolData {
|
||||
dataType: 'enum' | 'bool'
|
||||
defaultValue?: string // 默认值,可选
|
||||
name: string // 枚举项的名称
|
||||
value: number | undefined // 枚举值
|
||||
}
|
||||
|
||||
/** 物模型TSL响应数据结构 */
|
||||
export interface IotThingModelTSLResp {
|
||||
productId: number
|
||||
productKey: string
|
||||
properties: ThingModelProperty[]
|
||||
events: ThingModelEvent[]
|
||||
services: ThingModelService[]
|
||||
}
|
||||
|
||||
/** 物模型属性 */
|
||||
export interface ThingModelProperty {
|
||||
identifier: string
|
||||
name: string
|
||||
accessMode: string
|
||||
required?: boolean
|
||||
dataType: string
|
||||
description?: string
|
||||
dataSpecs?: ThingModelProperty
|
||||
dataSpecsList?: ThingModelProperty[]
|
||||
}
|
||||
|
||||
/** 物模型事件 */
|
||||
export interface ThingModelEvent {
|
||||
identifier: string
|
||||
name: string
|
||||
required?: boolean
|
||||
type: string
|
||||
description?: string
|
||||
outputParams?: ThingModelParam[]
|
||||
method?: string
|
||||
}
|
||||
|
||||
/** 物模型服务 */
|
||||
export interface ThingModelService {
|
||||
identifier: string
|
||||
name: string
|
||||
required?: boolean
|
||||
callType: string
|
||||
description?: string
|
||||
inputParams?: ThingModelParam[]
|
||||
outputParams?: ThingModelParam[]
|
||||
method?: string
|
||||
}
|
||||
|
||||
/** 物模型参数 */
|
||||
export interface ThingModelParam {
|
||||
identifier: string
|
||||
name: string
|
||||
direction: string
|
||||
paraOrder?: number
|
||||
dataType: string
|
||||
dataSpecs?: ThingModelProperty
|
||||
dataSpecsList?: ThingModelProperty[]
|
||||
}
|
||||
|
||||
/** 数值型数据规范 */
|
||||
export interface ThingModelNumericDataSpec {
|
||||
dataType: 'int' | 'float' | 'double'
|
||||
max: string
|
||||
min: string
|
||||
step: string
|
||||
precise?: string
|
||||
defaultValue?: string
|
||||
unit?: string
|
||||
unitName?: string
|
||||
}
|
||||
|
||||
/** 布尔/枚举型数据规范 */
|
||||
export interface ThingModelBoolOrEnumDataSpecs {
|
||||
dataType: 'bool' | 'enum'
|
||||
name: string
|
||||
value: number
|
||||
}
|
||||
|
||||
/** 文本/时间型数据规范 */
|
||||
export interface ThingModelDateOrTextDataSpecs {
|
||||
dataType: 'text' | 'date'
|
||||
length?: number
|
||||
defaultValue?: string
|
||||
}
|
||||
|
||||
/** 数组型数据规范 */
|
||||
export interface ThingModelArrayDataSpecs {
|
||||
dataType: 'array'
|
||||
size: number
|
||||
childDataType: string
|
||||
dataSpecsList?: ThingModelProperty[]
|
||||
}
|
||||
|
||||
/** 结构体型数据规范 */
|
||||
export interface ThingModelStructDataSpecs {
|
||||
dataType: 'struct'
|
||||
identifier: string
|
||||
name: string
|
||||
accessMode: string
|
||||
required?: boolean
|
||||
childDataType: string
|
||||
dataSpecs?: ThingModelProperty
|
||||
dataSpecsList?: ThingModelProperty[]
|
||||
}
|
||||
|
||||
// IoT 产品物模型 API
|
||||
export const ThingModelApi = {
|
||||
// 查询产品物模型分页
|
||||
getThingModelPage: async (params: any) => {
|
||||
return await request.get({ url: `/iot/thing-model/page`, params })
|
||||
},
|
||||
|
||||
// 获得产品物模型列表
|
||||
getThingModelList: async (params: any) => {
|
||||
return await request.get({ url: `/iot/thing-model/list`, params })
|
||||
},
|
||||
|
||||
// 获得产品物模型 TSL
|
||||
getThingModelTSLByProductId: async (productId: number) => {
|
||||
return await request.get({
|
||||
url: `/iot/thing-model/get-tsl?productId=${productId}`
|
||||
})
|
||||
},
|
||||
|
||||
// 查询产品物模型详情
|
||||
getThingModel: async (id: number) => {
|
||||
return await request.get({ url: `/iot/thing-model/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增产品物模型
|
||||
createThingModel: async (data: ThingModelData) => {
|
||||
return await request.post({ url: `/iot/thing-model/create`, data })
|
||||
},
|
||||
|
||||
// 修改产品物模型
|
||||
updateThingModel: async (data: ThingModelData) => {
|
||||
return await request.put({ url: `/iot/thing-model/update`, data })
|
||||
},
|
||||
|
||||
// 删除产品物模型
|
||||
deleteThingModel: async (id: number) => {
|
||||
return await request.delete({ url: `/iot/thing-model/delete?id=` + id })
|
||||
}
|
||||
}
|
||||
|
||||
/** 公共校验规则 */
|
||||
export const ThingModelFormRules = {
|
||||
name: [
|
||||
{ required: true, message: '功能名称不能为空', trigger: 'blur' },
|
||||
{
|
||||
pattern: /^[\u4e00-\u9fa5a-zA-Z0-9][\u4e00-\u9fa5a-zA-Z0-9\-_/\.]{0,29}$/,
|
||||
message:
|
||||
'支持中文、大小写字母、日文、数字、短划线、下划线、斜杠和小数点,必须以中文、英文或数字开头,不超过 30 个字符',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
type: [{ required: true, message: '功能类型不能为空', trigger: 'blur' }],
|
||||
identifier: [
|
||||
{ required: true, message: '标识符不能为空', trigger: 'blur' },
|
||||
{
|
||||
pattern: /^[a-zA-Z0-9_]{1,50}$/,
|
||||
message: '支持大小写字母、数字和下划线,不超过 50 个字符',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
validator: (_: any, value: string, callback: any) => {
|
||||
const reservedKeywords = ['set', 'get', 'post', 'property', 'event', 'time', 'value']
|
||||
if (reservedKeywords.includes(value)) {
|
||||
callback(
|
||||
new Error(
|
||||
'set, get, post, property, event, time, value 是系统保留字段,不能用于标识符定义'
|
||||
)
|
||||
)
|
||||
} else if (/^\d+$/.test(value)) {
|
||||
callback(new Error('标识符不能是纯数字'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
'property.dataSpecs.childDataType': [{ required: true, message: '元素类型不能为空' }],
|
||||
'property.dataSpecs.size': [
|
||||
{ required: true, message: '元素个数不能为空' },
|
||||
{
|
||||
validator: (_: any, value: any, callback: any) => {
|
||||
if (isEmpty(value)) {
|
||||
callback(new Error('元素个数不能为空'))
|
||||
return
|
||||
}
|
||||
if (isNaN(Number(value))) {
|
||||
callback(new Error('元素个数必须是数字'))
|
||||
return
|
||||
}
|
||||
callback()
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
'property.dataSpecs.length': [
|
||||
{ required: true, message: '请输入文本字节长度', trigger: 'blur' },
|
||||
{
|
||||
validator: (_: any, value: any, callback: any) => {
|
||||
if (isEmpty(value)) {
|
||||
callback(new Error('文本长度不能为空'))
|
||||
return
|
||||
}
|
||||
if (isNaN(Number(value))) {
|
||||
callback(new Error('文本长度必须是数字'))
|
||||
return
|
||||
}
|
||||
callback()
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
'property.accessMode': [{ required: true, message: '请选择读写类型', trigger: 'change' }]
|
||||
}
|
||||
|
||||
/** 校验布尔值名称 */
|
||||
export const validateBoolName = (_: any, value: string, callback: any) => {
|
||||
if (isEmpty(value)) {
|
||||
callback(new Error('布尔值名称不能为空'))
|
||||
return
|
||||
}
|
||||
// 检查开头字符
|
||||
if (!/^[\u4e00-\u9fa5a-zA-Z0-9]/.test(value)) {
|
||||
callback(new Error('布尔值名称必须以中文、英文字母或数字开头'))
|
||||
return
|
||||
}
|
||||
// 检查整体格式
|
||||
if (!/^[\u4e00-\u9fa5a-zA-Z0-9][a-zA-Z0-9\u4e00-\u9fa5_-]*$/.test(value)) {
|
||||
callback(new Error('布尔值名称只能包含中文、英文字母、数字、下划线和短划线'))
|
||||
return
|
||||
}
|
||||
// 检查长度(一个中文算一个字符)
|
||||
if (value.length > 20) {
|
||||
callback(new Error('布尔值名称长度不能超过 20 个字符'))
|
||||
return
|
||||
}
|
||||
|
||||
callback()
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user