130 changed files with 1473 additions and 605 deletions
@ -1,32 +1,41 @@ |
|||||||
import { defHttp } from '@/utils/http/axios' |
import { defHttp } from '@/utils/http/axios' |
||||||
import { FormVO } from './types' |
|
||||||
|
export type FormVO = { |
||||||
|
id: number |
||||||
|
name: string |
||||||
|
conf: string |
||||||
|
fields: string[] |
||||||
|
status: number |
||||||
|
remark: string |
||||||
|
createTime: string |
||||||
|
} |
||||||
|
|
||||||
// 创建工作流的表单定义
|
// 创建工作流的表单定义
|
||||||
export const createFormApi = (data: FormVO) => { |
export function createForm(data: FormVO) { |
||||||
return defHttp.post({ url: '/bpm/form/create', data: data }) |
return defHttp.post({ url: '/bpm/form/create', data }) |
||||||
} |
} |
||||||
|
|
||||||
// 更新工作流的表单定义
|
// 更新工作流的表单定义
|
||||||
export const updateFormApi = (data: FormVO) => { |
export function updateForm(data: FormVO) { |
||||||
return defHttp.put({ url: '/bpm/form/update', data: data }) |
return defHttp.put({ url: '/bpm/form/update', data }) |
||||||
} |
} |
||||||
|
|
||||||
// 删除工作流的表单定义
|
// 删除工作流的表单定义
|
||||||
export const deleteFormApi = (id: number) => { |
export function deleteForm(id: number) { |
||||||
return defHttp.delete({ url: '/bpm/form/delete?id=' + id }) |
return defHttp.delete({ url: '/bpm/form/delete?id=' + id }) |
||||||
} |
} |
||||||
|
|
||||||
// 获得工作流的表单定义
|
// 获得工作流的表单定义
|
||||||
export const getFormApi = (id: number) => { |
export function getForm(id: number) { |
||||||
return defHttp.get({ url: '/bpm/form/get?id=' + id }) |
return defHttp.get({ url: '/bpm/form/get?id=' + id }) |
||||||
} |
} |
||||||
|
|
||||||
// 获得工作流的表单定义分页
|
// 获得工作流的表单定义分页
|
||||||
export const getFormPageApi = (params) => { |
export function getFormPage(params) { |
||||||
return defHttp.get({ url: '/bpm/form/page', params }) |
return defHttp.get({ url: '/bpm/form/page', params }) |
||||||
} |
} |
||||||
|
|
||||||
// 获得动态表单的精简列表
|
// 获得动态表单的精简列表
|
||||||
export const getSimpleFormsApi = async () => { |
export function getSimpleForms() { |
||||||
return await defHttp.get({ url: '/bpm/form/list-all-simple' }) |
return defHttp.get({ url: '/bpm/form/list-all-simple' }) |
||||||
} |
} |
||||||
|
@ -1,9 +0,0 @@ |
|||||||
export type FormVO = { |
|
||||||
id: number |
|
||||||
name: string |
|
||||||
conf: string |
|
||||||
fields: string[] |
|
||||||
status: number |
|
||||||
remark: string |
|
||||||
createTime: string |
|
||||||
} |
|
@ -1,17 +1,27 @@ |
|||||||
import { defHttp } from '@/utils/http/axios' |
import { defHttp } from '@/utils/http/axios' |
||||||
import { LeaveVO } from './types' |
|
||||||
|
export type LeaveVO = { |
||||||
|
id: number |
||||||
|
result: number |
||||||
|
type: number |
||||||
|
reason: string |
||||||
|
processInstanceId: string |
||||||
|
startTime: string |
||||||
|
endTime: string |
||||||
|
createTime: string |
||||||
|
} |
||||||
|
|
||||||
// 创建请假申请
|
// 创建请假申请
|
||||||
export const createLeaveApi = (data: LeaveVO) => { |
export function createLeave(data: LeaveVO) { |
||||||
return defHttp.post({ url: '/bpm/oa/leave/create', data: data }) |
return defHttp.post({ url: '/bpm/oa/leave/create', data }) |
||||||
} |
} |
||||||
|
|
||||||
// 获得请假申请
|
// 获得请假申请
|
||||||
export const getLeaveApi = (id: number) => { |
export function getLeave(id: number) { |
||||||
return defHttp.get({ url: '/bpm/oa/leave/get?id=' + id }) |
return defHttp.get({ url: '/bpm/oa/leave/get?id=' + id }) |
||||||
} |
} |
||||||
|
|
||||||
// 获得请假申请分页
|
// 获得请假申请分页
|
||||||
export const getLeavePageApi = (params) => { |
export function getLeavePage(params) { |
||||||
return defHttp.get({ url: '/bpm/oa/leave/page', params }) |
return defHttp.get({ url: '/bpm/oa/leave/page', params }) |
||||||
} |
} |
||||||
|
@ -1,10 +0,0 @@ |
|||||||
export type LeaveVO = { |
|
||||||
id: number |
|
||||||
result: number |
|
||||||
type: number |
|
||||||
reason: string |
|
||||||
processInstanceId: string |
|
||||||
startTime: string |
|
||||||
endTime: string |
|
||||||
createTime: string |
|
||||||
} |
|
@ -1,35 +1,58 @@ |
|||||||
import { defHttp } from '@/utils/http/axios' |
import { defHttp } from '@/utils/http/axios' |
||||||
import { ModelVO } from './types' |
|
||||||
|
|
||||||
export const getModelPageApi = (params) => { |
export type ProcessDefinitionVO = { |
||||||
|
id: string |
||||||
|
version: number |
||||||
|
deploymentTIme: string |
||||||
|
suspensionState: 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 |
||||||
|
} |
||||||
|
|
||||||
|
export function getModelPage(params) { |
||||||
return defHttp.get({ url: '/bpm/model/page', params }) |
return defHttp.get({ url: '/bpm/model/page', params }) |
||||||
} |
} |
||||||
|
|
||||||
export const getModelApi = (id: number) => { |
export function getModel(id: number) { |
||||||
return defHttp.get({ url: '/bpm/model/get?id=' + id }) |
return defHttp.get({ url: '/bpm/model/get?id=' + id }) |
||||||
} |
} |
||||||
|
|
||||||
export const updateModelApi = (data: ModelVO) => { |
export function updateModel(data: ModelVO) { |
||||||
return defHttp.put({ url: '/bpm/model/update', data: data }) |
return defHttp.put({ url: '/bpm/model/update', data }) |
||||||
} |
} |
||||||
|
|
||||||
// 任务状态修改
|
// 任务状态修改
|
||||||
export const updateModelStateApi = (id: number, state: number) => { |
export function updateModelState(id: number, state: number) { |
||||||
const data = { |
const data = { |
||||||
id: id, |
id: id, |
||||||
state: state |
state: state |
||||||
} |
} |
||||||
return defHttp.put({ url: '/bpm/model/update-state', data: data }) |
return defHttp.put({ url: '/bpm/model/update-state', data }) |
||||||
} |
} |
||||||
|
|
||||||
export const createModelApi = (data: ModelVO) => { |
export function createModel(data: ModelVO) { |
||||||
return defHttp.post({ url: '/bpm/model/create', data: data }) |
return defHttp.post({ url: '/bpm/model/create', data }) |
||||||
} |
} |
||||||
|
|
||||||
export const deleteModelApi = (id: number) => { |
export function deleteModel(id: number) { |
||||||
return defHttp.delete({ url: '/bpm/model/delete?id=' + id }) |
return defHttp.delete({ url: '/bpm/model/delete?id=' + id }) |
||||||
} |
} |
||||||
|
|
||||||
export const deployModelApi = (id: number) => { |
export function deployModel(id: number) { |
||||||
return defHttp.post({ url: '/bpm/model/deploy?id=' + id }) |
return defHttp.post({ url: '/bpm/model/deploy?id=' + id }) |
||||||
} |
} |
||||||
|
@ -1,23 +0,0 @@ |
|||||||
export type ProcessDefinitionVO = { |
|
||||||
id: string |
|
||||||
version: number |
|
||||||
deploymentTIme: string |
|
||||||
suspensionState: 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 |
|
||||||
} |
|
@ -1,22 +1,40 @@ |
|||||||
import { defHttp } from '@/utils/http/axios' |
import { defHttp } from '@/utils/http/axios' |
||||||
import { ProcessInstanceVO } from './types' |
|
||||||
|
|
||||||
export const getMyProcessInstancePageApi = (params) => { |
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 |
||||||
|
} |
||||||
|
|
||||||
|
export function getMyProcessInstancePage(params) { |
||||||
return defHttp.get({ url: '/bpm/process-instance/my-page', params }) |
return defHttp.get({ url: '/bpm/process-instance/my-page', params }) |
||||||
} |
} |
||||||
|
|
||||||
export const createProcessInstanceApi = (data: ProcessInstanceVO) => { |
export function createProcessInstance(data: ProcessInstanceVO) { |
||||||
return defHttp.post({ url: '/bpm/process-instance/create', data: data }) |
return defHttp.post({ url: '/bpm/process-instance/create', data }) |
||||||
} |
} |
||||||
|
|
||||||
export const cancelProcessInstanceApi = (id: number, reason: string) => { |
export function cancelProcessInstance(id: number, reason: string) { |
||||||
const data = { |
const data = { |
||||||
id: id, |
id: id, |
||||||
reason: reason |
reason: reason |
||||||
} |
} |
||||||
return defHttp.delete({ url: '/bpm/process-instance/cancel', data: data }) |
return defHttp.delete({ url: '/bpm/process-instance/cancel', data }) |
||||||
} |
} |
||||||
|
|
||||||
export const getProcessInstanceApi = (id: number) => { |
export function getProcessInstance(id: number) { |
||||||
return defHttp.get({ url: '/bpm/process-instance/get?id=' + id }) |
return defHttp.get({ url: '/bpm/process-instance/get?id=' + id }) |
||||||
} |
} |
||||||
|
@ -1,18 +0,0 @@ |
|||||||
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 |
|
||||||
} |
|
@ -1,20 +1,23 @@ |
|||||||
import { defHttp } from '@/utils/http/axios' |
import { defHttp } from '@/utils/http/axios' |
||||||
import { TaskAssignVO } from './types' |
|
||||||
|
|
||||||
export const getTaskAssignRuleList = (params) => { |
export type TaskAssignVO = { |
||||||
|
id: number |
||||||
|
modelId: string |
||||||
|
processDefinitionId: string |
||||||
|
taskDefinitionKey: string |
||||||
|
taskDefinitionName: string |
||||||
|
options: string[] |
||||||
|
type: number |
||||||
|
} |
||||||
|
|
||||||
|
export function getTaskAssignRuleList(params) { |
||||||
return defHttp.get({ url: '/bpm/task-assign-rule/list', params }) |
return defHttp.get({ url: '/bpm/task-assign-rule/list', params }) |
||||||
} |
} |
||||||
|
|
||||||
export const createTaskAssignRule = (data: TaskAssignVO) => { |
export function createTaskAssignRule(data: TaskAssignVO) { |
||||||
return defHttp.post({ |
return defHttp.post({ url: '/bpm/task-assign-rule/create', data }) |
||||||
url: '/bpm/task-assign-rule/create', |
|
||||||
data: data |
|
||||||
}) |
|
||||||
} |
} |
||||||
|
|
||||||
export const updateTaskAssignRule = (data: TaskAssignVO) => { |
export function updateTaskAssignRule(data: TaskAssignVO) { |
||||||
return defHttp.put({ |
return defHttp.put({ url: '/bpm/task-assign-rule/update', data }) |
||||||
url: '/bpm/task-assign-rule/update', |
|
||||||
data: data |
|
||||||
}) |
|
||||||
} |
} |
||||||
|
@ -1,9 +0,0 @@ |
|||||||
export type TaskAssignVO = { |
|
||||||
id: number |
|
||||||
modelId: string |
|
||||||
processDefinitionId: string |
|
||||||
taskDefinitionKey: string |
|
||||||
taskDefinitionName: string |
|
||||||
options: string[] |
|
||||||
type: number |
|
||||||
} |
|
@ -1,38 +1,41 @@ |
|||||||
import { defHttp } from '@/utils/http/axios' |
import { defHttp } from '@/utils/http/axios' |
||||||
import { UserGroupVO } from './types' |
|
||||||
|
export type UserGroupVO = { |
||||||
|
id: number |
||||||
|
name: string |
||||||
|
description: string |
||||||
|
memberUserIds: number[] |
||||||
|
status: number |
||||||
|
remark: string |
||||||
|
createTime: string |
||||||
|
} |
||||||
|
|
||||||
// 创建用户组
|
// 创建用户组
|
||||||
export const createUserGroupApi = (data: UserGroupVO) => { |
export function createUserGroup(data: UserGroupVO) { |
||||||
return defHttp.post({ |
return defHttp.post({ url: '/bpm/user-group/create', data }) |
||||||
url: '/bpm/user-group/create', |
|
||||||
data: data |
|
||||||
}) |
|
||||||
} |
} |
||||||
|
|
||||||
// 更新用户组
|
// 更新用户组
|
||||||
export const updateUserGroupApi = (data: UserGroupVO) => { |
export function updateUserGroup(data: UserGroupVO) { |
||||||
return defHttp.put({ |
return defHttp.put({ url: '/bpm/user-group/update', data }) |
||||||
url: '/bpm/user-group/update', |
|
||||||
data: data |
|
||||||
}) |
|
||||||
} |
} |
||||||
|
|
||||||
// 删除用户组
|
// 删除用户组
|
||||||
export const deleteUserGroupApi = (id: number) => { |
export function deleteUserGroup(id: number) { |
||||||
return defHttp.delete({ url: '/bpm/user-group/delete?id=' + id }) |
return defHttp.delete({ url: '/bpm/user-group/delete?id=' + id }) |
||||||
} |
} |
||||||
|
|
||||||
// 获得用户组
|
// 获得用户组
|
||||||
export const getUserGroupApi = (id: number) => { |
export function getUserGroup(id: number) { |
||||||
return defHttp.get({ url: '/bpm/user-group/get?id=' + id }) |
return defHttp.get({ url: '/bpm/user-group/get?id=' + id }) |
||||||
} |
} |
||||||
|
|
||||||
// 获得用户组分页
|
// 获得用户组分页
|
||||||
export const getUserGroupPageApi = (params) => { |
export function getUserGroupPage(params) { |
||||||
return defHttp.get({ url: '/bpm/user-group/page', params }) |
return defHttp.get({ url: '/bpm/user-group/page', params }) |
||||||
} |
} |
||||||
|
|
||||||
// 获取用户组精简信息列表
|
// 获取用户组精简信息列表
|
||||||
export const listSimpleUserGroupsApi = () => { |
export function listSimpleUserGroups() { |
||||||
return defHttp.get({ url: '/bpm/user-group/list-all-simple' }) |
return defHttp.get({ url: '/bpm/user-group/list-all-simple' }) |
||||||
} |
} |
||||||
|
@ -1,9 +0,0 @@ |
|||||||
export type UserGroupVO = { |
|
||||||
id: number |
|
||||||
name: string |
|
||||||
description: string |
|
||||||
memberUserIds: number[] |
|
||||||
status: number |
|
||||||
remark: string |
|
||||||
createTime: string |
|
||||||
} |
|
@ -1,16 +1,16 @@ |
|||||||
import { defHttp } from '@/utils/http/axios' |
import { defHttp } from '@/utils/http/axios' |
||||||
|
|
||||||
// 导出Html
|
// 导出Html
|
||||||
export const exportHtmlApi = async () => { |
export function exportHtml() { |
||||||
return defHttp.get({ url: '/infra/db-doc/export-html', responseType: 'blob' }) |
return defHttp.get({ url: '/infra/db-doc/export-html', responseType: 'blob' }) |
||||||
} |
} |
||||||
|
|
||||||
// 导出Word
|
// 导出Word
|
||||||
export const exportWordApi = () => { |
export function exportWord() { |
||||||
return defHttp.get({ url: '/infra/db-doc/export-word', responseType: 'blob' }) |
return defHttp.get({ url: '/infra/db-doc/export-word', responseType: 'blob' }) |
||||||
} |
} |
||||||
|
|
||||||
// 导出Markdown
|
// 导出Markdown
|
||||||
export const exportMarkdownApi = () => { |
export function exportMarkdown() { |
||||||
return defHttp.get({ url: '/infra/db-doc/export-markdown', responseType: 'blob' }) |
return defHttp.get({ url: '/infra/db-doc/export-markdown', responseType: 'blob' }) |
||||||
} |
} |
||||||
|
@ -0,0 +1,41 @@ |
|||||||
|
import { defHttp } from '@/utils/http/axios' |
||||||
|
|
||||||
|
// 创建公众号账号
|
||||||
|
export function createAccount(data) { |
||||||
|
return defHttp.post({ url: '/mp/account/create', data }) |
||||||
|
} |
||||||
|
|
||||||
|
// 更新公众号账号
|
||||||
|
export function updateAccount(data) { |
||||||
|
return defHttp.put({ url: '/mp/account/update', data }) |
||||||
|
} |
||||||
|
|
||||||
|
// 删除公众号账号
|
||||||
|
export function deleteAccount(id) { |
||||||
|
return defHttp.delete({ url: '/mp/account/delete?id=' + id, method: 'delete' }) |
||||||
|
} |
||||||
|
|
||||||
|
// 获得公众号账号
|
||||||
|
export function getAccount(id) { |
||||||
|
return defHttp.get({ url: '/mp/account/get?id=' + id }) |
||||||
|
} |
||||||
|
|
||||||
|
// 获得公众号账号分页
|
||||||
|
export function getAccountPage(params) { |
||||||
|
return defHttp.get({ url: '/mp/account/page', params }) |
||||||
|
} |
||||||
|
|
||||||
|
// 获取公众号账号精简信息列表
|
||||||
|
export function getSimpleAccounts() { |
||||||
|
return defHttp.get({ url: '/mp/account/list-all-simple' }) |
||||||
|
} |
||||||
|
|
||||||
|
// 生成公众号二维码
|
||||||
|
export function generateAccountQrCode(id) { |
||||||
|
return defHttp.put({ url: '/mp/account/generate-qr-code?id=' + id }) |
||||||
|
} |
||||||
|
|
||||||
|
// 清空公众号 API 配额
|
||||||
|
export function clearAccountQuota(id) { |
||||||
|
return defHttp.put({ url: '/mp/account/clear-quota?id=' + id }) |
||||||
|
} |
@ -0,0 +1,26 @@ |
|||||||
|
import { defHttp } from '@/utils/http/axios' |
||||||
|
|
||||||
|
// 创建公众号的自动回复
|
||||||
|
export function createAutoReply(data) { |
||||||
|
return defHttp.post({ url: '/mp/auto-reply/create', data }) |
||||||
|
} |
||||||
|
|
||||||
|
// 更新公众号的自动回复
|
||||||
|
export function updateAutoReply(data) { |
||||||
|
return defHttp.put({ url: '/mp/auto-reply/update', data }) |
||||||
|
} |
||||||
|
|
||||||
|
// 删除公众号的自动回复
|
||||||
|
export function deleteAutoReply(id) { |
||||||
|
return defHttp.delete({ url: '/mp/auto-reply/delete?id=' + id }) |
||||||
|
} |
||||||
|
|
||||||
|
// 获得公众号的自动回复
|
||||||
|
export function getAutoReply(id) { |
||||||
|
return defHttp.get({ url: '/mp/auto-reply/get?id=' + id }) |
||||||
|
} |
||||||
|
|
||||||
|
// 获得公众号的自动回复分页
|
||||||
|
export function getAutoReplyPage(params) { |
||||||
|
return defHttp.get({ url: '/mp/auto-reply/page', params }) |
||||||
|
} |
@ -0,0 +1,26 @@ |
|||||||
|
import { defHttp } from '@/utils/http/axios' |
||||||
|
|
||||||
|
// 获得公众号草稿分页
|
||||||
|
export function getDraftPage(params) { |
||||||
|
return defHttp.get({ url: '/mp/draft/page', params }) |
||||||
|
} |
||||||
|
|
||||||
|
// 创建公众号草稿
|
||||||
|
export function createDraft(accountId, articles) { |
||||||
|
return defHttp.post({ |
||||||
|
url: '/mp/draft/create?accountId=' + accountId, |
||||||
|
data: { |
||||||
|
articles |
||||||
|
} |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
// 更新公众号草稿
|
||||||
|
export function updateDraft(accountId, mediaId, articles) { |
||||||
|
return defHttp.put({ url: '/mp/draft/update?accountId=' + accountId + '&mediaId=' + mediaId, data: articles }) |
||||||
|
} |
||||||
|
|
||||||
|
// 删除公众号草稿
|
||||||
|
export function deleteDraft(accountId, mediaId) { |
||||||
|
return defHttp.delete({ url: '/mp/draft/delete?accountId=' + accountId + '&mediaId=' + mediaId }) |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
import { defHttp } from '@/utils/http/axios' |
||||||
|
|
||||||
|
// 获得公众号素材分页
|
||||||
|
export function getFreePublishPage(params) { |
||||||
|
return defHttp.get({ url: '/mp/free-publish/page', params }) |
||||||
|
} |
||||||
|
|
||||||
|
// 删除公众号素材
|
||||||
|
export function deleteFreePublish(accountId, articleId) { |
||||||
|
return defHttp.delete({ url: '/mp/free-publish/delete?accountId=' + accountId + '&&articleId=' + articleId }) |
||||||
|
} |
||||||
|
|
||||||
|
// 发布公众号素材
|
||||||
|
export function submitFreePublish(accountId, mediaId) { |
||||||
|
return defHttp.post({ url: '/mp/free-publish/submit?accountId=' + accountId + '&&mediaId=' + mediaId }) |
||||||
|
} |
@ -0,0 +1,11 @@ |
|||||||
|
import { defHttp } from '@/utils/http/axios' |
||||||
|
|
||||||
|
// 获得公众号素材分页
|
||||||
|
export function getMaterialPage(params) { |
||||||
|
return defHttp.get({ url: '/mp/material/page', params }) |
||||||
|
} |
||||||
|
|
||||||
|
// 删除公众号永久素材
|
||||||
|
export function deletePermanentMaterial(id) { |
||||||
|
return defHttp.delete({ url: '/mp/material/delete-permanent?id=' + id }) |
||||||
|
} |
@ -0,0 +1,22 @@ |
|||||||
|
import { defHttp } from '@/utils/http/axios' |
||||||
|
|
||||||
|
// 获得公众号菜单列表
|
||||||
|
export function getMenuList(accountId) { |
||||||
|
return defHttp.get({ url: '/mp/menu/list?accountId=' + accountId }) |
||||||
|
} |
||||||
|
|
||||||
|
// 保存公众号菜单
|
||||||
|
export function saveMenu(accountId, menus) { |
||||||
|
return defHttp.post({ |
||||||
|
url: '/mp/menu/save', |
||||||
|
data: { |
||||||
|
accountId, |
||||||
|
menus |
||||||
|
} |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
// 删除公众号菜单
|
||||||
|
export function deleteMenu(accountId) { |
||||||
|
return defHttp.delete({ url: '/mp/menu/delete?accountId=' + accountId }) |
||||||
|
} |
@ -0,0 +1,11 @@ |
|||||||
|
import { defHttp } from '@/utils/http/axios' |
||||||
|
|
||||||
|
// 获得公众号消息分页
|
||||||
|
export function getMessagePage(params) { |
||||||
|
return defHttp.get({ url: '/mp/message/page', params }) |
||||||
|
} |
||||||
|
|
||||||
|
// 给粉丝发送消息
|
||||||
|
export function sendMessage(data) { |
||||||
|
return defHttp.post({ url: '/mp/message/send', data }) |
||||||
|
} |
@ -0,0 +1,21 @@ |
|||||||
|
import { defHttp } from '@/utils/http/axios' |
||||||
|
|
||||||
|
// 更新公众号粉丝
|
||||||
|
export function updateUser(data) { |
||||||
|
return defHttp.put({ url: '/mp/user/update', data }) |
||||||
|
} |
||||||
|
|
||||||
|
// 获得公众号粉丝
|
||||||
|
export function getUser(id) { |
||||||
|
return defHttp.get({ url: '/mp/user/get?id=' + id }) |
||||||
|
} |
||||||
|
|
||||||
|
// 获得公众号粉丝分页
|
||||||
|
export function getUserPage(params) { |
||||||
|
return defHttp.get({ url: '/mp/user/page', params }) |
||||||
|
} |
||||||
|
|
||||||
|
// 同步公众号粉丝
|
||||||
|
export function syncUser(accountId) { |
||||||
|
return defHttp.post({ url: '/mp/tag/sync?accountId=' + accountId }) |
||||||
|
} |
@ -0,0 +1,21 @@ |
|||||||
|
import { defHttp } from '@/utils/http/axios' |
||||||
|
|
||||||
|
// 获取消息发送概况数据
|
||||||
|
export function getUpstreamMessage(params) { |
||||||
|
return defHttp.get({ url: '/mp/statistics/upstream-message', params }) |
||||||
|
} |
||||||
|
|
||||||
|
// 用户增减数据
|
||||||
|
export function getUserSummary(params) { |
||||||
|
return defHttp.get({ url: '/mp/statistics/user-summary', params }) |
||||||
|
} |
||||||
|
|
||||||
|
// 获得用户累计数据
|
||||||
|
export function getUserCumulate(params) { |
||||||
|
return defHttp.get({ url: '/mp/statistics/user-cumulate', params }) |
||||||
|
} |
||||||
|
|
||||||
|
// 获得接口分析数据
|
||||||
|
export function getInterfaceSummary(params) { |
||||||
|
return defHttp.get({ url: '/mp/statistics/interface-summary', params }) |
||||||
|
} |
@ -0,0 +1,36 @@ |
|||||||
|
import { defHttp } from '@/utils/http/axios' |
||||||
|
|
||||||
|
// 创建公众号标签
|
||||||
|
export function createTag(data) { |
||||||
|
return defHttp.post({ url: '/mp/tag/create', data }) |
||||||
|
} |
||||||
|
|
||||||
|
// 更新公众号标签
|
||||||
|
export function updateTag(data) { |
||||||
|
return defHttp.put({ url: '/mp/tag/update', data }) |
||||||
|
} |
||||||
|
|
||||||
|
// 删除公众号标签
|
||||||
|
export function deleteTag(id) { |
||||||
|
return defHttp.delete({ url: '/mp/tag/delete?id=' + id }) |
||||||
|
} |
||||||
|
|
||||||
|
// 获得公众号标签
|
||||||
|
export function getTag(id) { |
||||||
|
return defHttp.get({ url: '/mp/tag/get?id=' + id }) |
||||||
|
} |
||||||
|
|
||||||
|
// 获得公众号标签分页
|
||||||
|
export function getTagPage(params) { |
||||||
|
return defHttp.get({ url: '/mp/tag/page', params }) |
||||||
|
} |
||||||
|
|
||||||
|
// 获取公众号标签精简信息列表
|
||||||
|
export function getSimpleTags() { |
||||||
|
return defHttp.get({ url: '/mp/tag/list-all-simple' }) |
||||||
|
} |
||||||
|
|
||||||
|
// 同步公众号标签
|
||||||
|
export function syncTag(accountId) { |
||||||
|
return defHttp.post({ url: '/mp/tag/sync?accountId=' + accountId }) |
||||||
|
} |
@ -1,11 +1,11 @@ |
|||||||
import { defHttp } from '@/utils/http/axios' |
import { defHttp } from '@/utils/http/axios' |
||||||
|
|
||||||
// 获得地区树
|
// 获得地区树
|
||||||
export const getAreaTree = () => { |
export function getAreaTree() { |
||||||
return defHttp.get({ url: '/system/area/tree' }) |
return defHttp.get({ url: '/system/area/tree' }) |
||||||
} |
} |
||||||
|
|
||||||
// 获得 IP 对应的地区名
|
// 获得 IP 对应的地区名
|
||||||
export const getAreaByIp = (ip: string) => { |
export function getAreaByIp(ip: string) { |
||||||
return defHttp.get({ url: '/system/area/get-by-ip?ip=' + ip }) |
return defHttp.get({ url: '/system/area/get-by-ip?ip=' + ip }) |
||||||
} |
} |
||||||
|
@ -1,31 +1,31 @@ |
|||||||
import { defHttp } from '@/utils/http/axios' |
import { defHttp } from '@/utils/http/axios' |
||||||
|
|
||||||
// 创建邮箱账号
|
// 创建邮箱账号
|
||||||
export const createMailAccountApi = (data) => { |
export function createMailAccount(data) { |
||||||
return defHttp.post({ url: '/system/mail-account/create', data }) |
return defHttp.post({ url: '/system/mail-account/create', data }) |
||||||
} |
} |
||||||
|
|
||||||
// 更新邮箱账号
|
// 更新邮箱账号
|
||||||
export const updateMailAccountApi = (data) => { |
export function updateMailAccount(data) { |
||||||
return defHttp.put({ url: '/system/mail-account/update', data }) |
return defHttp.put({ url: '/system/mail-account/update', data }) |
||||||
} |
} |
||||||
|
|
||||||
// 删除邮箱账号
|
// 删除邮箱账号
|
||||||
export const deleteMailAccountApi = (id: number) => { |
export function deleteMailAccount(id: number) { |
||||||
return defHttp.delete({ url: '/system/mail-account/delete?id=' + id }) |
return defHttp.delete({ url: '/system/mail-account/delete?id=' + id }) |
||||||
} |
} |
||||||
|
|
||||||
// 获得邮箱账号
|
// 获得邮箱账号
|
||||||
export const getMailAccountApi = (id: number) => { |
export function getMailAccount(id: number) { |
||||||
return defHttp.get({ url: '/system/mail-account/get?id=' + id }) |
return defHttp.get({ url: '/system/mail-account/get?id=' + id }) |
||||||
} |
} |
||||||
|
|
||||||
// 获得邮箱账号分页
|
// 获得邮箱账号分页
|
||||||
export const getMailAccountPageApi = (params) => { |
export function getMailAccountPage(params) { |
||||||
return defHttp.get({ url: '/system/mail-account/page', params }) |
return defHttp.get({ url: '/system/mail-account/page', params }) |
||||||
} |
} |
||||||
|
|
||||||
// 获取邮箱账号的精简信息列表
|
// 获取邮箱账号的精简信息列表
|
||||||
export const getSimpleMailAccountListApi = () => { |
export function getSimpleMailAccountList() { |
||||||
return defHttp.get({ url: '/system/mail-account/list-all-simple' }) |
return defHttp.get({ url: '/system/mail-account/list-all-simple' }) |
||||||
} |
} |
||||||
|
@ -1,11 +1,11 @@ |
|||||||
import { defHttp } from '@/utils/http/axios' |
import { defHttp } from '@/utils/http/axios' |
||||||
|
|
||||||
// 获得邮件日志
|
// 获得邮件日志
|
||||||
export const getMailLogApi = (id: number) => { |
export function getMailLog(id: number) { |
||||||
return defHttp.get({ url: '/system/mail-log/get?id=' + id }) |
return defHttp.get({ url: '/system/mail-log/get?id=' + id }) |
||||||
} |
} |
||||||
|
|
||||||
// 获得邮件日志分页
|
// 获得邮件日志分页
|
||||||
export const getMailAccountPageApi = (params) => { |
export function getMailAccountPage(params) { |
||||||
return defHttp.get({ url: '/system/mail-log/page', params }) |
return defHttp.get({ url: '/system/mail-log/page', params }) |
||||||
} |
} |
||||||
|
@ -1,31 +1,31 @@ |
|||||||
import { defHttp } from '@/utils/http/axios' |
import { defHttp } from '@/utils/http/axios' |
||||||
|
|
||||||
// 创建邮件模版
|
// 创建邮件模版
|
||||||
export const createMailTemplateApi = (data) => { |
export function createMailTemplate(data) { |
||||||
return defHttp.post({ url: '/system/mail-template/create', data }) |
return defHttp.post({ url: '/system/mail-template/create', data }) |
||||||
} |
} |
||||||
|
|
||||||
// 更新邮件模版
|
// 更新邮件模版
|
||||||
export const updateMailTemplateApi = (data) => { |
export function updateMailTemplate(data) { |
||||||
return defHttp.put({ url: '/system/mail-template/update', data }) |
return defHttp.put({ url: '/system/mail-template/update', data }) |
||||||
} |
} |
||||||
|
|
||||||
// 删除邮件模版
|
// 删除邮件模版
|
||||||
export const deleteMailTemplateApi = (id: number) => { |
export function deleteMailTemplate(id: number) { |
||||||
return defHttp.delete({ url: '/system/mail-template/delete?id=' + id }) |
return defHttp.delete({ url: '/system/mail-template/delete?id=' + id }) |
||||||
} |
} |
||||||
|
|
||||||
// 获得邮件模版
|
// 获得邮件模版
|
||||||
export const getMailTemplateApi = (id: number) => { |
export function getMailTemplate(id: number) { |
||||||
return defHttp.get({ url: '/system/mail-template/get?id=' + id }) |
return defHttp.get({ url: '/system/mail-template/get?id=' + id }) |
||||||
} |
} |
||||||
|
|
||||||
// 获得邮件模版分页
|
// 获得邮件模版分页
|
||||||
export const getMailTemplatePageApi = (params) => { |
export function getMailTemplatePage(params) { |
||||||
return defHttp.get({ url: '/system/mail-template/page', params }) |
return defHttp.get({ url: '/system/mail-template/page', params }) |
||||||
} |
} |
||||||
|
|
||||||
// 发送测试邮件
|
// 发送测试邮件
|
||||||
export const sendMail = (data) => { |
export function sendMail(data) { |
||||||
return defHttp.post({ url: '/system/mail-template/send-mail', data }) |
return defHttp.post({ url: '/system/mail-template/send-mail', data }) |
||||||
} |
} |
||||||
|
@ -1,36 +1,36 @@ |
|||||||
import { defHttp } from '@/utils/http/axios' |
import { defHttp } from '@/utils/http/axios' |
||||||
|
|
||||||
// 创建站内信模板
|
// 创建站内信模板
|
||||||
export const createNotifyTemplateApi = (data) => { |
export function createNotifyTemplate(data) { |
||||||
return defHttp.post({ url: '/system/notify-template/create', data }) |
return defHttp.post({ url: '/system/notify-template/create', data }) |
||||||
} |
} |
||||||
|
|
||||||
// 更新站内信模板
|
// 更新站内信模板
|
||||||
export const updateNotifyTemplateApi = (data) => { |
export function updateNotifyTemplate(data) { |
||||||
return defHttp.put({ url: '/system/notify-template/update', data }) |
return defHttp.put({ url: '/system/notify-template/update', data }) |
||||||
} |
} |
||||||
|
|
||||||
// 删除站内信模板
|
// 删除站内信模板
|
||||||
export const deleteNotifyTemplateApi = (id: number) => { |
export function deleteNotifyTemplate(id: number) { |
||||||
return defHttp.delete({ url: '/system/notify-template/delete?id=' + id }) |
return defHttp.delete({ url: '/system/notify-template/delete?id=' + id }) |
||||||
} |
} |
||||||
|
|
||||||
// 获得站内信模板
|
// 获得站内信模板
|
||||||
export const getNotifyTemplateApi = (id: number) => { |
export function getNotifyTemplate(id: number) { |
||||||
return defHttp.get({ url: '/system/notify-template/get?id=' + id }) |
return defHttp.get({ url: '/system/notify-template/get?id=' + id }) |
||||||
} |
} |
||||||
|
|
||||||
// 获得站内信模板分页
|
// 获得站内信模板分页
|
||||||
export const getNotifyTemplatePageApi = (params) => { |
export function getNotifyTemplatePage(params) { |
||||||
return defHttp.get({ url: '/system/notify-template/page', params }) |
return defHttp.get({ url: '/system/notify-template/page', params }) |
||||||
} |
} |
||||||
|
|
||||||
// 获取岗位精简信息列表
|
// 获取岗位精简信息列表
|
||||||
export const listSimplePostsApi = () => { |
export function listSimplePosts() { |
||||||
return defHttp.get({ url: '/system/post/list-all-simple' }) |
return defHttp.get({ url: '/system/post/list-all-simple' }) |
||||||
} |
} |
||||||
|
|
||||||
// 导出站内信模板 Excel
|
// 导出站内信模板 Excel
|
||||||
export const exportNotifyTemplateExcelApi = (params) => { |
export function exportNotifyTemplateExcel(params) { |
||||||
return defHttp.download({ url: '/system/notify-template/export-excel', params }, '导出站内信模板.xls') |
return defHttp.download({ url: '/system/notify-template/export-excel', params }, '导出站内信模板.xls') |
||||||
} |
} |
||||||
|
@ -0,0 +1,110 @@ |
|||||||
|
import { BasicColumn, FormSchema, useRender } from '@/components/Table' |
||||||
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' |
||||||
|
|
||||||
|
export const columns: BasicColumn[] = [ |
||||||
|
{ |
||||||
|
title: '日志编号', |
||||||
|
dataIndex: 'id', |
||||||
|
width: 100 |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '用户编号', |
||||||
|
dataIndex: 'userId', |
||||||
|
width: 100 |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '用户类型', |
||||||
|
dataIndex: 'userType', |
||||||
|
width: 120, |
||||||
|
customRender: ({ text }) => { |
||||||
|
return useRender.renderDict(text, DICT_TYPE.USER_TYPE) |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '应用名', |
||||||
|
dataIndex: 'applicationName', |
||||||
|
width: 120 |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '请求方法名', |
||||||
|
dataIndex: 'requestMethod', |
||||||
|
width: 120 |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '请求地址', |
||||||
|
dataIndex: 'requestUrl', |
||||||
|
width: 250 |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '请求时间', |
||||||
|
dataIndex: 'beginTime', |
||||||
|
width: 180, |
||||||
|
customRender: ({ text }) => { |
||||||
|
return useRender.renderDate(text) |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '执行时长', |
||||||
|
dataIndex: 'duration', |
||||||
|
width: 180, |
||||||
|
customRender: ({ text }) => { |
||||||
|
return useRender.renderText(text, 'ms') |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '操作结果', |
||||||
|
dataIndex: 'status', |
||||||
|
width: 180, |
||||||
|
customRender: ({ record }) => { |
||||||
|
return useRender.renderTag(record.resultCode === 0 ? '成功' : '失败(' + record.resultMsg + ')') |
||||||
|
} |
||||||
|
} |
||||||
|
] |
||||||
|
|
||||||
|
export const searchFormSchema: FormSchema[] = [ |
||||||
|
{ |
||||||
|
label: '用户编号', |
||||||
|
field: 'userId', |
||||||
|
component: 'Input', |
||||||
|
colProps: { span: 8 } |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '用户类型', |
||||||
|
field: 'userType', |
||||||
|
component: 'Select', |
||||||
|
componentProps: { |
||||||
|
options: getIntDictOptions(DICT_TYPE.USER_TYPE) |
||||||
|
}, |
||||||
|
colProps: { span: 8 } |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '应用名', |
||||||
|
field: 'applicationName', |
||||||
|
component: 'Input', |
||||||
|
colProps: { span: 8 } |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '请求地址', |
||||||
|
field: 'requestUrl', |
||||||
|
component: 'Input', |
||||||
|
colProps: { span: 8 } |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '请求时间', |
||||||
|
field: 'beginTime', |
||||||
|
component: 'RangePicker', |
||||||
|
colProps: { span: 8 } |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '执行时长', |
||||||
|
field: 'duration', |
||||||
|
component: 'Input', |
||||||
|
colProps: { span: 8 } |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '结果码', |
||||||
|
field: 'resultCode', |
||||||
|
component: 'Input', |
||||||
|
colProps: { span: 8 } |
||||||
|
} |
||||||
|
] |
@ -1,3 +1,43 @@ |
|||||||
<template> |
<template> |
||||||
<div>开发中</div> |
<div> |
||||||
|
<BasicTable @register="registerTable"> |
||||||
|
<template #toolbar> |
||||||
|
<a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button> |
||||||
|
</template> |
||||||
|
</BasicTable> |
||||||
|
</div> |
||||||
</template> |
</template> |
||||||
|
<script lang="ts" setup name="ApiErrorLog"> |
||||||
|
import { useI18n } from '@/hooks/web/useI18n' |
||||||
|
import { useMessage } from '@/hooks/web/useMessage' |
||||||
|
import { BasicTable, useTable } from '@/components/Table' |
||||||
|
import { getApiAccessLogPage, exportApiAccessLog, ApiAccessLogExportReqVO } from '@/api/infra/apiAccessLog' |
||||||
|
import { columns, searchFormSchema } from './apiAccessLog.data' |
||||||
|
|
||||||
|
const { t } = useI18n() |
||||||
|
const { createConfirm, createMessage } = useMessage() |
||||||
|
const [registerTable, { getForm }] = useTable({ |
||||||
|
title: '访问日志列表', |
||||||
|
api: getApiAccessLogPage, |
||||||
|
columns, |
||||||
|
formConfig: { |
||||||
|
labelWidth: 120, |
||||||
|
schemas: searchFormSchema |
||||||
|
}, |
||||||
|
useSearchForm: true, |
||||||
|
showTableSetting: true, |
||||||
|
showIndexColumn: false |
||||||
|
}) |
||||||
|
|
||||||
|
async function handleExport() { |
||||||
|
createConfirm({ |
||||||
|
title: t('common.exportTitle'), |
||||||
|
iconType: 'warning', |
||||||
|
content: t('common.exportMessage'), |
||||||
|
async onOk() { |
||||||
|
await exportApiAccessLog(getForm().getFieldsValue() as ApiAccessLogExportReqVO) |
||||||
|
createMessage.success(t('common.exportSuccessText')) |
||||||
|
} |
||||||
|
}) |
||||||
|
} |
||||||
|
</script> |
||||||
|
@ -0,0 +1,110 @@ |
|||||||
|
import { BasicColumn, FormSchema, useRender } from '@/components/Table' |
||||||
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' |
||||||
|
|
||||||
|
export const columns: BasicColumn[] = [ |
||||||
|
{ |
||||||
|
title: '日志编号', |
||||||
|
dataIndex: 'id', |
||||||
|
width: 100 |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '用户编号', |
||||||
|
dataIndex: 'userId', |
||||||
|
width: 100 |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '用户类型', |
||||||
|
dataIndex: 'userType', |
||||||
|
width: 120, |
||||||
|
customRender: ({ text }) => { |
||||||
|
return useRender.renderDict(text, DICT_TYPE.USER_TYPE) |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '应用名', |
||||||
|
dataIndex: 'applicationName', |
||||||
|
width: 120 |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '请求方法名', |
||||||
|
dataIndex: 'requestMethod', |
||||||
|
width: 120 |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '请求地址', |
||||||
|
dataIndex: 'requestUrl', |
||||||
|
width: 250 |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '异常发生时间', |
||||||
|
dataIndex: 'exceptionTime', |
||||||
|
width: 180, |
||||||
|
customRender: ({ text }) => { |
||||||
|
return useRender.renderDate(text) |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '异常名', |
||||||
|
dataIndex: 'exceptionName', |
||||||
|
width: 250 |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '处理状态', |
||||||
|
dataIndex: 'processStatus', |
||||||
|
width: 180, |
||||||
|
customRender: ({ text }) => { |
||||||
|
return useRender.renderDict(text, DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS) |
||||||
|
} |
||||||
|
} |
||||||
|
] |
||||||
|
|
||||||
|
export const searchFormSchema: FormSchema[] = [ |
||||||
|
{ |
||||||
|
label: '用户编号', |
||||||
|
field: 'userId', |
||||||
|
component: 'Input', |
||||||
|
colProps: { span: 8 } |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '用户名称', |
||||||
|
field: 'username', |
||||||
|
component: 'Input', |
||||||
|
colProps: { span: 8 } |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '用户类型', |
||||||
|
field: 'userType', |
||||||
|
component: 'Select', |
||||||
|
componentProps: { |
||||||
|
options: getIntDictOptions(DICT_TYPE.USER_TYPE) |
||||||
|
}, |
||||||
|
colProps: { span: 8 } |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '应用名', |
||||||
|
field: 'applicationName', |
||||||
|
component: 'Input', |
||||||
|
colProps: { span: 8 } |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '请求地址', |
||||||
|
field: 'requestUrl', |
||||||
|
component: 'Input', |
||||||
|
colProps: { span: 8 } |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '异常时间', |
||||||
|
field: 'exceptionTime', |
||||||
|
component: 'RangePicker', |
||||||
|
colProps: { span: 8 } |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '处理状态', |
||||||
|
field: 'processStatus', |
||||||
|
component: 'Select', |
||||||
|
componentProps: { |
||||||
|
options: getIntDictOptions(DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS) |
||||||
|
}, |
||||||
|
colProps: { span: 8 } |
||||||
|
} |
||||||
|
] |
@ -1,3 +1,83 @@ |
|||||||
<template> |
<template> |
||||||
<div>开发中</div> |
<div> |
||||||
|
<BasicTable @register="registerTable"> |
||||||
|
<template #toolbar> |
||||||
|
<a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button> |
||||||
|
</template> |
||||||
|
<template #bodyCell="{ column, record }"> |
||||||
|
<template v-if="column.key === 'action'"> |
||||||
|
<TableAction |
||||||
|
:actions="[ |
||||||
|
{ |
||||||
|
icon: IconEnum.EDIT, |
||||||
|
label: '已处理', |
||||||
|
ifShow: () => record.processStatus === InfraApiErrorLogProcessStatusEnum.INIT, |
||||||
|
onClick: handleProcessClick.bind(null, record, InfraApiErrorLogProcessStatusEnum.DONE, '已处理') |
||||||
|
}, |
||||||
|
{ |
||||||
|
icon: IconEnum.EDIT, |
||||||
|
label: '已忽略', |
||||||
|
ifShow: () => record.processStatus === InfraApiErrorLogProcessStatusEnum.INIT, |
||||||
|
onClick: handleProcessClick.bind(null, record, InfraApiErrorLogProcessStatusEnum.IGNORE, '已忽略') |
||||||
|
} |
||||||
|
]" |
||||||
|
/> |
||||||
|
</template> |
||||||
|
</template> |
||||||
|
</BasicTable> |
||||||
|
</div> |
||||||
</template> |
</template> |
||||||
|
<script lang="ts" setup name="ApiErrorLog"> |
||||||
|
import { useI18n } from '@/hooks/web/useI18n' |
||||||
|
import { IconEnum } from '@/enums/appEnum' |
||||||
|
import { InfraApiErrorLogProcessStatusEnum } from '@/enums/systemEnum' |
||||||
|
import { useMessage } from '@/hooks/web/useMessage' |
||||||
|
import { BasicTable, useTable, TableAction } from '@/components/Table' |
||||||
|
import { updateApiErrorLogProcess, getApiErrorLogPage, exportApiErrorLog, ApiErrorLogExportReqVO } from '@/api/infra/apiErrorLog' |
||||||
|
import { columns, searchFormSchema } from './apiErrorLog.data' |
||||||
|
|
||||||
|
const { t } = useI18n() |
||||||
|
const { createConfirm, createMessage } = useMessage() |
||||||
|
const [registerTable, { getForm, reload }] = useTable({ |
||||||
|
title: '异常日志列表', |
||||||
|
api: getApiErrorLogPage, |
||||||
|
columns, |
||||||
|
formConfig: { |
||||||
|
labelWidth: 120, |
||||||
|
schemas: searchFormSchema |
||||||
|
}, |
||||||
|
useSearchForm: true, |
||||||
|
showTableSetting: true, |
||||||
|
showIndexColumn: false, |
||||||
|
actionColumn: { |
||||||
|
width: 180, |
||||||
|
title: t('common.action'), |
||||||
|
dataIndex: 'action', |
||||||
|
fixed: 'right' |
||||||
|
} |
||||||
|
}) |
||||||
|
|
||||||
|
function handleProcessClick(record, processStatus: number, type: string) { |
||||||
|
createConfirm({ |
||||||
|
iconType: 'warning', |
||||||
|
content: '确认标记为' + type + '?', |
||||||
|
async onOk() { |
||||||
|
await updateApiErrorLogProcess(record.id, processStatus) |
||||||
|
createMessage.success(t('common.successText')) |
||||||
|
reload() |
||||||
|
} |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
async function handleExport() { |
||||||
|
createConfirm({ |
||||||
|
title: t('common.exportTitle'), |
||||||
|
iconType: 'warning', |
||||||
|
content: t('common.exportMessage'), |
||||||
|
async onOk() { |
||||||
|
await exportApiErrorLog(getForm().getFieldsValue() as ApiErrorLogExportReqVO) |
||||||
|
createMessage.success(t('common.exportSuccessText')) |
||||||
|
} |
||||||
|
}) |
||||||
|
} |
||||||
|
</script> |
||||||
|
@ -0,0 +1,54 @@ |
|||||||
|
<template> |
||||||
|
<BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit"> |
||||||
|
<BasicForm @register="registerForm" /> |
||||||
|
</BasicModal> |
||||||
|
</template> |
||||||
|
<script lang="ts" setup name="ConfigModal"> |
||||||
|
import { ref, computed, unref } from 'vue' |
||||||
|
import { BasicModal, useModalInner } from '@/components/Modal' |
||||||
|
import { BasicForm, useForm } from '@/components/Form' |
||||||
|
import { formSchema } from './config.data' |
||||||
|
import { createConfig, getConfig, updateConfig } from '@/api/infra/config' |
||||||
|
|
||||||
|
const emit = defineEmits(['success', 'register']) |
||||||
|
const isUpdate = ref(true) |
||||||
|
const rowId = ref() |
||||||
|
|
||||||
|
const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({ |
||||||
|
labelWidth: 100, |
||||||
|
baseColProps: { span: 24 }, |
||||||
|
schemas: formSchema, |
||||||
|
showActionButtonGroup: false, |
||||||
|
actionColOptions: { span: 23 } |
||||||
|
}) |
||||||
|
|
||||||
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { |
||||||
|
resetFields() |
||||||
|
setModalProps({ confirmLoading: false }) |
||||||
|
isUpdate.value = !!data?.isUpdate |
||||||
|
|
||||||
|
if (unref(isUpdate)) { |
||||||
|
const res = await getConfig(data.record.id) |
||||||
|
rowId.value = res.id |
||||||
|
setFieldsValue({ ...res }) |
||||||
|
} |
||||||
|
}) |
||||||
|
|
||||||
|
const getTitle = computed(() => (!unref(isUpdate) ? '新增配置' : '编辑配置')) |
||||||
|
|
||||||
|
async function handleSubmit() { |
||||||
|
try { |
||||||
|
const values = await validate() |
||||||
|
setModalProps({ confirmLoading: true }) |
||||||
|
if (unref(isUpdate)) { |
||||||
|
await updateConfig(values) |
||||||
|
} else { |
||||||
|
await createConfig(values) |
||||||
|
} |
||||||
|
closeModal() |
||||||
|
emit('success') |
||||||
|
} finally { |
||||||
|
setModalProps({ confirmLoading: false }) |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
@ -0,0 +1,139 @@ |
|||||||
|
import { BasicColumn, FormSchema, useRender } from '@/components/Table' |
||||||
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' |
||||||
|
|
||||||
|
export const columns: BasicColumn[] = [ |
||||||
|
{ |
||||||
|
title: '参数主键', |
||||||
|
dataIndex: 'id', |
||||||
|
width: 100 |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '参数分类', |
||||||
|
dataIndex: 'category', |
||||||
|
width: 180 |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '参数名称', |
||||||
|
dataIndex: 'name', |
||||||
|
width: 100 |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '参数键名', |
||||||
|
dataIndex: 'key', |
||||||
|
width: 120 |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '参数键值', |
||||||
|
dataIndex: 'value', |
||||||
|
width: 120 |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '系统内置', |
||||||
|
dataIndex: 'type', |
||||||
|
width: 180, |
||||||
|
customRender: ({ text }) => { |
||||||
|
return useRender.renderDict(text, DICT_TYPE.INFRA_CONFIG_TYPE) |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '是否可见', |
||||||
|
dataIndex: 'visible', |
||||||
|
width: 180, |
||||||
|
customRender: ({ text }) => { |
||||||
|
return useRender.renderTag(text ? '是' : '否') |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '备注', |
||||||
|
dataIndex: 'remark', |
||||||
|
width: 180 |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '创建时间', |
||||||
|
dataIndex: 'createTime', |
||||||
|
width: 180, |
||||||
|
customRender: ({ text }) => { |
||||||
|
return useRender.renderDate(text) |
||||||
|
} |
||||||
|
} |
||||||
|
] |
||||||
|
|
||||||
|
export const searchFormSchema: FormSchema[] = [ |
||||||
|
{ |
||||||
|
label: '参数名称', |
||||||
|
field: 'name', |
||||||
|
component: 'Input', |
||||||
|
colProps: { span: 8 } |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '参数键名', |
||||||
|
field: 'key', |
||||||
|
component: 'Input', |
||||||
|
colProps: { span: 8 } |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '系统内置', |
||||||
|
field: 'type', |
||||||
|
component: 'Select', |
||||||
|
componentProps: { |
||||||
|
options: getIntDictOptions(DICT_TYPE.INFRA_CONFIG_TYPE) |
||||||
|
}, |
||||||
|
colProps: { span: 8 } |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '创建时间', |
||||||
|
field: 'createTime', |
||||||
|
component: 'RangePicker', |
||||||
|
colProps: { span: 8 } |
||||||
|
} |
||||||
|
] |
||||||
|
|
||||||
|
export const formSchema: FormSchema[] = [ |
||||||
|
{ |
||||||
|
label: '编号', |
||||||
|
field: 'id', |
||||||
|
show: false, |
||||||
|
component: 'Input' |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '参数分类', |
||||||
|
field: 'category', |
||||||
|
required: true, |
||||||
|
component: 'Input' |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '参数名称', |
||||||
|
field: 'name', |
||||||
|
required: true, |
||||||
|
component: 'Input' |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '参数键名', |
||||||
|
field: 'key', |
||||||
|
required: true, |
||||||
|
component: 'Input' |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '参数键值', |
||||||
|
field: 'value', |
||||||
|
required: true, |
||||||
|
component: 'Input' |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '是否可见', |
||||||
|
field: 'visible', |
||||||
|
component: 'RadioGroup', |
||||||
|
defaultValue: 0, |
||||||
|
componentProps: { |
||||||
|
options: [ |
||||||
|
{ key: true, label: '是', value: true }, |
||||||
|
{ key: false, label: '否', value: false } |
||||||
|
] |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '备注', |
||||||
|
field: 'remark', |
||||||
|
component: 'InputTextArea' |
||||||
|
} |
||||||
|
] |
@ -1,3 +1,94 @@ |
|||||||
<template> |
<template> |
||||||
<div>开发中</div> |
<div> |
||||||
|
<BasicTable @register="registerTable"> |
||||||
|
<template #toolbar> |
||||||
|
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> {{ t('action.create') }} </a-button> |
||||||
|
<a-button type="warning" :preIcon="IconEnum.EXPORT" @click="handleExport"> {{ t('action.export') }} </a-button> |
||||||
|
</template> |
||||||
|
<template #bodyCell="{ column, record }"> |
||||||
|
<template v-if="column.key === 'action'"> |
||||||
|
<TableAction |
||||||
|
:actions="[ |
||||||
|
{ icon: IconEnum.EDIT, label: t('action.edit'), onClick: handleEdit.bind(null, record) }, |
||||||
|
{ |
||||||
|
icon: IconEnum.DELETE, |
||||||
|
color: 'error', |
||||||
|
label: t('action.delete'), |
||||||
|
popConfirm: { |
||||||
|
title: t('common.delMessage'), |
||||||
|
placement: 'left', |
||||||
|
confirm: handleDelete.bind(null, record) |
||||||
|
} |
||||||
|
} |
||||||
|
]" |
||||||
|
/> |
||||||
|
</template> |
||||||
|
</template> |
||||||
|
</BasicTable> |
||||||
|
<ConfigModal @register="registerModal" @success="reload()" /> |
||||||
|
</div> |
||||||
</template> |
</template> |
||||||
|
<script lang="ts" setup name="Config"> |
||||||
|
import { useI18n } from '@/hooks/web/useI18n' |
||||||
|
import { useMessage } from '@/hooks/web/useMessage' |
||||||
|
import { useModal } from '@/components/Modal' |
||||||
|
import ConfigModal from './ConfigModal.vue' |
||||||
|
import { IconEnum } from '@/enums/appEnum' |
||||||
|
import { BasicTable, useTable, TableAction } from '@/components/Table' |
||||||
|
import { getConfigPage, deleteConfig, exportConfig, ConfigExportReqVO } from '@/api/infra/config' |
||||||
|
import { columns, searchFormSchema } from './config.data' |
||||||
|
|
||||||
|
const { t } = useI18n() |
||||||
|
const { createConfirm, createMessage } = useMessage() |
||||||
|
const [registerModal, { openModal }] = useModal() |
||||||
|
|
||||||
|
const [registerTable, { getForm, reload }] = useTable({ |
||||||
|
title: '配置中心列表', |
||||||
|
api: getConfigPage, |
||||||
|
columns, |
||||||
|
formConfig: { |
||||||
|
labelWidth: 120, |
||||||
|
schemas: searchFormSchema |
||||||
|
}, |
||||||
|
useSearchForm: true, |
||||||
|
showTableSetting: true, |
||||||
|
showIndexColumn: false, |
||||||
|
actionColumn: { |
||||||
|
width: 140, |
||||||
|
title: t('common.action'), |
||||||
|
dataIndex: 'action', |
||||||
|
fixed: 'right' |
||||||
|
} |
||||||
|
}) |
||||||
|
|
||||||
|
function handleCreate() { |
||||||
|
openModal(true, { |
||||||
|
isUpdate: false |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
function handleEdit(record: Recordable) { |
||||||
|
openModal(true, { |
||||||
|
record, |
||||||
|
isUpdate: true |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
async function handleExport() { |
||||||
|
createConfirm({ |
||||||
|
title: t('common.exportTitle'), |
||||||
|
iconType: 'warning', |
||||||
|
content: t('common.exportMessage'), |
||||||
|
async onOk() { |
||||||
|
await exportConfig(getForm().getFieldsValue() as ConfigExportReqVO) |
||||||
|
createMessage.success(t('common.exportSuccessText')) |
||||||
|
} |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
async function handleDelete(record: Recordable) { |
||||||
|
await deleteConfig(record.id) |
||||||
|
createMessage.success(t('common.delSuccessText')) |
||||||
|
reload() |
||||||
|
} |
||||||
|
</script> |
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in new issue