初始化项目,自 v1.7.1 版本开始
49
src/App.vue
Normal file
@@ -0,0 +1,49 @@
|
||||
<script setup lang="ts">
|
||||
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'
|
||||
|
||||
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` : ''" />
|
||||
</ConfigGlobal>
|
||||
</template>
|
||||
<style lang="scss">
|
||||
$prefix-cls: #{$namespace}-app;
|
||||
.size {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
padding: 0 !important;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
@extend .size;
|
||||
|
||||
#app {
|
||||
@extend .size;
|
||||
}
|
||||
}
|
||||
.#{$prefix-cls}-grey-mode {
|
||||
filter: grayscale(100%);
|
||||
}
|
||||
</style>
|
||||
8
src/api/bpm/activity/index.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export const getActivityList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/bpm/activity/list',
|
||||
params
|
||||
})
|
||||
}
|
||||
21
src/api/bpm/definition/index.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export const getProcessDefinitionBpmnXMLApi = async (id: number) => {
|
||||
return await request.get({
|
||||
url: '/bpm/process-definition/get-bpmn-xml?id=' + id
|
||||
})
|
||||
}
|
||||
|
||||
export const getProcessDefinitionPageApi = async (params) => {
|
||||
return await request.get({
|
||||
url: '/bpm/process-definition/page',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export const getProcessDefinitionListApi = async (params) => {
|
||||
return await request.get({
|
||||
url: '/bpm/process-definition/list',
|
||||
params
|
||||
})
|
||||
}
|
||||
56
src/api/bpm/form/index.ts
Normal file
@@ -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 createFormApi = async (data: FormVO) => {
|
||||
return await request.post({
|
||||
url: '/bpm/form/create',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新工作流的表单定义
|
||||
export const updateFormApi = async (data: FormVO) => {
|
||||
return await request.put({
|
||||
url: '/bpm/form/update',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除工作流的表单定义
|
||||
export const deleteFormApi = async (id: number) => {
|
||||
return await request.delete({
|
||||
url: '/bpm/form/delete?id=' + id
|
||||
})
|
||||
}
|
||||
|
||||
// 获得工作流的表单定义
|
||||
export const getFormApi = async (id: number) => {
|
||||
return await request.get({
|
||||
url: '/bpm/form/get?id=' + id
|
||||
})
|
||||
}
|
||||
|
||||
// 获得工作流的表单定义分页
|
||||
export const getFormPageApi = async (params) => {
|
||||
return await request.get({
|
||||
url: '/bpm/form/page',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 获得动态表单的精简列表
|
||||
export const getSimpleFormsApi = async () => {
|
||||
return await request.get({
|
||||
url: '/bpm/form/list-all-simple'
|
||||
})
|
||||
}
|
||||
27
src/api/bpm/leave/index.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export type LeaveVO = {
|
||||
id: number
|
||||
result: number
|
||||
type: number
|
||||
reason: string
|
||||
processInstanceId: string
|
||||
startTime: string
|
||||
endTime: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
// 创建请假申请
|
||||
export const createLeaveApi = async (data: LeaveVO) => {
|
||||
return await request.post({ url: '/bpm/oa/leave/create', data: data })
|
||||
}
|
||||
|
||||
// 获得请假申请
|
||||
export const getLeaveApi = async (id: number) => {
|
||||
return await request.get({ url: '/bpm/oa/leave/get?id=' + id })
|
||||
}
|
||||
|
||||
// 获得请假申请分页
|
||||
export const getLeavePageApi = async (params) => {
|
||||
return await request.get({ url: '/bpm/oa/leave/page', params })
|
||||
}
|
||||
59
src/api/bpm/model/index.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
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
|
||||
bpmnXml: string
|
||||
}
|
||||
|
||||
export const getModelPageApi = async (params) => {
|
||||
return await request.get({ url: '/bpm/model/page', params })
|
||||
}
|
||||
|
||||
export const getModelApi = async (id: number) => {
|
||||
return await request.get({ url: '/bpm/model/get?id=' + id })
|
||||
}
|
||||
|
||||
export const updateModelApi = async (data: ModelVO) => {
|
||||
return await request.put({ url: '/bpm/model/update', data: data })
|
||||
}
|
||||
|
||||
// 任务状态修改
|
||||
export const updateModelStateApi = async (id: number, state: number) => {
|
||||
const data = {
|
||||
id: id,
|
||||
state: state
|
||||
}
|
||||
return await request.put({ url: '/bpm/model/update-state', data: data })
|
||||
}
|
||||
|
||||
export const createModelApi = async (data: ModelVO) => {
|
||||
return await request.post({ url: '/bpm/model/create', data: data })
|
||||
}
|
||||
|
||||
export const deleteModelApi = async (id: number) => {
|
||||
return await request.delete({ url: '/bpm/model/delete?id=' + id })
|
||||
}
|
||||
|
||||
export const deployModelApi = async (id: number) => {
|
||||
return await request.post({ url: '/bpm/model/deploy?id=' + id })
|
||||
}
|
||||
40
src/api/bpm/processInstance/index.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
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 const getMyProcessInstancePageApi = async (params) => {
|
||||
return await request.get({ url: '/bpm/process-instance/my-page', params })
|
||||
}
|
||||
|
||||
export const createProcessInstanceApi = async (data) => {
|
||||
return await request.post({ url: '/bpm/process-instance/create', data: data })
|
||||
}
|
||||
|
||||
export const cancelProcessInstanceApi = async (id: number, reason: string) => {
|
||||
const data = {
|
||||
id: id,
|
||||
reason: reason
|
||||
}
|
||||
return await request.delete({ url: '/bpm/process-instance/cancel', data: data })
|
||||
}
|
||||
|
||||
export const getProcessInstanceApi = async (id: number) => {
|
||||
return await request.get({ url: '/bpm/process-instance/get?id=' + id })
|
||||
}
|
||||
34
src/api/bpm/task/index.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export const getTodoTaskPage = async (params) => {
|
||||
return await request.get({ url: '/bpm/task/todo-page', params })
|
||||
}
|
||||
|
||||
export const getDoneTaskPage = async (params) => {
|
||||
return await request.get({ url: '/bpm/task/done-page', params })
|
||||
}
|
||||
|
||||
export const completeTask = async (data) => {
|
||||
return await request.put({ url: '/bpm/task/complete', data })
|
||||
}
|
||||
|
||||
export const approveTask = async (data) => {
|
||||
return await request.put({ url: '/bpm/task/approve', data })
|
||||
}
|
||||
|
||||
export const rejectTask = async (data) => {
|
||||
return await request.put({ url: '/bpm/task/reject', data })
|
||||
}
|
||||
export const backTask = async (data) => {
|
||||
return await request.put({ url: '/bpm/task/back', data })
|
||||
}
|
||||
|
||||
export const updateTaskAssignee = async (data) => {
|
||||
return await request.put({ url: '/bpm/task/update-assignee', data })
|
||||
}
|
||||
|
||||
export const getTaskListByProcessInstanceId = async (processInstanceId) => {
|
||||
return await request.get({
|
||||
url: '/bpm/task/list-by-process-instance-id?processInstanceId=' + processInstanceId
|
||||
})
|
||||
}
|
||||
29
src/api/bpm/taskAssignRule/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export type TaskAssignVO = {
|
||||
id: number
|
||||
modelId: string
|
||||
processDefinitionId: string
|
||||
taskDefinitionKey: string
|
||||
taskDefinitionName: string
|
||||
options: string[]
|
||||
type: number
|
||||
}
|
||||
|
||||
export const getTaskAssignRuleList = async (params) => {
|
||||
return await request.get({ url: '/bpm/task-assign-rule/list', params })
|
||||
}
|
||||
|
||||
export const createTaskAssignRule = async (data: TaskAssignVO) => {
|
||||
return await request.post({
|
||||
url: '/bpm/task-assign-rule/create',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const updateTaskAssignRule = async (data: TaskAssignVO) => {
|
||||
return await request.put({
|
||||
url: '/bpm/task-assign-rule/update',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
47
src/api/bpm/userGroup/index.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export type UserGroupVO = {
|
||||
id: number
|
||||
name: string
|
||||
description: string
|
||||
memberUserIds: number[]
|
||||
status: number
|
||||
remark: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
// 创建用户组
|
||||
export const createUserGroupApi = async (data: UserGroupVO) => {
|
||||
return await request.post({
|
||||
url: '/bpm/user-group/create',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新用户组
|
||||
export const updateUserGroupApi = async (data: UserGroupVO) => {
|
||||
return await request.put({
|
||||
url: '/bpm/user-group/update',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除用户组
|
||||
export const deleteUserGroupApi = async (id: number) => {
|
||||
return await request.delete({ url: '/bpm/user-group/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 获得用户组
|
||||
export const getUserGroupApi = async (id: number) => {
|
||||
return await request.get({ url: '/bpm/user-group/get?id=' + id })
|
||||
}
|
||||
|
||||
// 获得用户组分页
|
||||
export const getUserGroupPageApi = async (params) => {
|
||||
return await request.get({ url: '/bpm/user-group/page', params })
|
||||
}
|
||||
|
||||
// 获取用户组精简信息列表
|
||||
export const listSimpleUserGroupsApi = async () => {
|
||||
return await request.get({ url: '/bpm/user-group/list-all-simple' })
|
||||
}
|
||||
50
src/api/infra/apiAccessLog/index.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface ApiAccessLogVO {
|
||||
id: number
|
||||
traceId: string
|
||||
userId: number
|
||||
userType: number
|
||||
applicationName: string
|
||||
requestMethod: string
|
||||
requestParams: string
|
||||
requestUrl: string
|
||||
userIp: string
|
||||
userAgent: string
|
||||
beginTime: Date
|
||||
endTIme: Date
|
||||
duration: number
|
||||
resultCode: number
|
||||
resultMsg: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface ApiAccessLogPageReqVO extends PageParam {
|
||||
userId?: number
|
||||
userType?: number
|
||||
applicationName?: string
|
||||
requestUrl?: string
|
||||
beginTime?: Date[]
|
||||
duration?: number
|
||||
resultCode?: number
|
||||
}
|
||||
|
||||
export interface ApiAccessLogExportReqVO {
|
||||
userId?: number
|
||||
userType?: number
|
||||
applicationName?: string
|
||||
requestUrl?: string
|
||||
beginTime?: Date[]
|
||||
duration?: number
|
||||
resultCode?: number
|
||||
}
|
||||
|
||||
// 查询列表API 访问日志
|
||||
export const getApiAccessLogPageApi = (params: ApiAccessLogPageReqVO) => {
|
||||
return request.get({ url: '/infra/api-access-log/page', params })
|
||||
}
|
||||
|
||||
// 导出API 访问日志
|
||||
export const exportApiAccessLogApi = (params: ApiAccessLogExportReqVO) => {
|
||||
return request.download({ url: '/infra/api-access-log/export-excel', params })
|
||||
}
|
||||
66
src/api/infra/apiErrorLog/index.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
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
|
||||
}
|
||||
|
||||
export interface ApiErrorLogPageReqVO extends PageParam {
|
||||
userId?: number
|
||||
userType?: number
|
||||
applicationName?: string
|
||||
requestUrl?: string
|
||||
exceptionTime?: Date[]
|
||||
processStatus: number
|
||||
}
|
||||
|
||||
export interface ApiErrorLogExportReqVO {
|
||||
userId?: number
|
||||
userType?: number
|
||||
applicationName?: string
|
||||
requestUrl?: string
|
||||
exceptionTime?: Date[]
|
||||
processStatus: number
|
||||
}
|
||||
|
||||
// 查询列表API 访问日志
|
||||
export const getApiErrorLogPageApi = (params: ApiErrorLogPageReqVO) => {
|
||||
return request.get({ url: '/infra/api-error-log/page', params })
|
||||
}
|
||||
|
||||
// 更新 API 错误日志的处理状态
|
||||
export const updateApiErrorLogPageApi = (id: number, processStatus: number) => {
|
||||
return request.put({
|
||||
url: '/infra/api-error-log/update-status?id=' + id + '&processStatus=' + processStatus
|
||||
})
|
||||
}
|
||||
|
||||
// 导出API 访问日志
|
||||
export const exportApiErrorLogApi = (params: ApiErrorLogExportReqVO) => {
|
||||
return request.download({
|
||||
url: '/infra/api-error-log/export-excel',
|
||||
params
|
||||
})
|
||||
}
|
||||
57
src/api/infra/codegen/index.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import request from '@/config/axios'
|
||||
import type { CodegenUpdateReqVO, CodegenCreateListReqVO } from './types'
|
||||
|
||||
// 查询列表代码生成表定义
|
||||
export const getCodegenTablePageApi = (params) => {
|
||||
return request.get({ url: '/infra/codegen/table/page', params })
|
||||
}
|
||||
|
||||
// 查询详情代码生成表定义
|
||||
export const getCodegenTableApi = (id: number) => {
|
||||
return request.get({ url: '/infra/codegen/detail?tableId=' + id })
|
||||
}
|
||||
|
||||
// 新增代码生成表定义
|
||||
export const createCodegenTableApi = (data: CodegenCreateListReqVO) => {
|
||||
return request.post({ url: '/infra/codegen/create', data })
|
||||
}
|
||||
|
||||
// 修改代码生成表定义
|
||||
export const updateCodegenTableApi = (data: CodegenUpdateReqVO) => {
|
||||
return request.put({ url: '/infra/codegen/update', data })
|
||||
}
|
||||
|
||||
// 基于数据库的表结构,同步数据库的表和字段定义
|
||||
export const syncCodegenFromDBApi = (id: number) => {
|
||||
return request.put({ url: '/infra/codegen/sync-from-db?tableId=' + id })
|
||||
}
|
||||
|
||||
// 基于 SQL 建表语句,同步数据库的表和字段定义
|
||||
export const syncCodegenFromSQLApi = (id: number, sql: string) => {
|
||||
return request.put({ url: '/infra/codegen/sync-from-sql?tableId=' + id + '&sql=' + sql })
|
||||
}
|
||||
|
||||
// 预览生成代码
|
||||
export const previewCodegenApi = (id: number) => {
|
||||
return request.get({ url: '/infra/codegen/preview?tableId=' + id })
|
||||
}
|
||||
|
||||
// 下载生成代码
|
||||
export const downloadCodegenApi = (id: number) => {
|
||||
return request.download({ url: '/infra/codegen/download?tableId=' + id })
|
||||
}
|
||||
|
||||
// 获得表定义
|
||||
export const getSchemaTableListApi = (params) => {
|
||||
return request.get({ url: '/infra/codegen/db/table/list', params })
|
||||
}
|
||||
|
||||
// 基于数据库的表结构,创建代码生成器的表定义
|
||||
export const createCodegenListApi = (data) => {
|
||||
return request.post({ url: '/infra/codegen/create-list', data })
|
||||
}
|
||||
|
||||
// 删除代码生成表定义
|
||||
export const deleteCodegenTableApi = (id: number) => {
|
||||
return request.delete({ url: '/infra/codegen/delete?tableId=' + id })
|
||||
}
|
||||
61
src/api/infra/codegen/types.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
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
|
||||
autoIncrement: string
|
||||
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 CodegenDetailVO = {
|
||||
table: CodegenTableVO
|
||||
columns: CodegenColumnVO[]
|
||||
}
|
||||
export type CodegenPreviewVO = {
|
||||
filePath: string
|
||||
code: string
|
||||
}
|
||||
export type CodegenUpdateReqVO = {
|
||||
table: CodegenTableVO
|
||||
columns: CodegenColumnVO[]
|
||||
}
|
||||
export type CodegenCreateListReqVO = {
|
||||
dataSourceConfigId: number
|
||||
tableNames: string[]
|
||||
}
|
||||
62
src/api/infra/config/index.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface ConfigVO {
|
||||
id: number
|
||||
category: string
|
||||
name: string
|
||||
key: string
|
||||
value: string
|
||||
type: number
|
||||
visible: boolean
|
||||
remark: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface ConfigPageReqVO extends PageParam {
|
||||
name?: string
|
||||
key?: string
|
||||
type?: number
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
export interface ConfigExportReqVO {
|
||||
name?: string
|
||||
key?: string
|
||||
type?: number
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
// 查询参数列表
|
||||
export const getConfigPageApi = (params: ConfigPageReqVO) => {
|
||||
return request.get({ url: '/infra/config/page', params })
|
||||
}
|
||||
|
||||
// 查询参数详情
|
||||
export const getConfigApi = (id: number) => {
|
||||
return request.get({ url: '/infra/config/get?id=' + id })
|
||||
}
|
||||
|
||||
// 根据参数键名查询参数值
|
||||
export const getConfigKeyApi = (configKey: string) => {
|
||||
return request.get({ url: '/infra/config/get-value-by-key?key=' + configKey })
|
||||
}
|
||||
|
||||
// 新增参数
|
||||
export const createConfigApi = (data: ConfigVO) => {
|
||||
return request.post({ url: '/infra/config/create', data })
|
||||
}
|
||||
|
||||
// 修改参数
|
||||
export const updateConfigApi = (data: ConfigVO) => {
|
||||
return request.put({ url: '/infra/config/update', data })
|
||||
}
|
||||
|
||||
// 删除参数
|
||||
export const deleteConfigApi = (id: number) => {
|
||||
return request.delete({ url: '/infra/config/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 导出参数
|
||||
export const exportConfigApi = (params: ConfigExportReqVO) => {
|
||||
return request.download({ url: '/infra/config/export', params })
|
||||
}
|
||||
35
src/api/infra/dataSourceConfig/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface DataSourceConfigVO {
|
||||
id: number
|
||||
name: string
|
||||
url: string
|
||||
username: string
|
||||
password: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
// 查询数据源配置列表
|
||||
export const getDataSourceConfigListApi = () => {
|
||||
return request.get({ url: '/infra/data-source-config/list' })
|
||||
}
|
||||
|
||||
// 查询数据源配置详情
|
||||
export const getDataSourceConfigApi = (id: number) => {
|
||||
return request.get({ url: '/infra/data-source-config/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增数据源配置
|
||||
export const createDataSourceConfigApi = (data: DataSourceConfigVO) => {
|
||||
return request.post({ url: '/infra/data-source-config/create', data })
|
||||
}
|
||||
|
||||
// 修改数据源配置
|
||||
export const updateDataSourceConfigApi = (data: DataSourceConfigVO) => {
|
||||
return request.put({ url: '/infra/data-source-config/update', data })
|
||||
}
|
||||
|
||||
// 删除数据源配置
|
||||
export const deleteDataSourceConfigApi = (id: number) => {
|
||||
return request.delete({ url: '/infra/data-source-config/delete?id=' + id })
|
||||
}
|
||||
16
src/api/infra/dbDoc/index.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 导出Html
|
||||
export const exportHtmlApi = () => {
|
||||
return request.download({ url: '/infra/db-doc/export-html' })
|
||||
}
|
||||
|
||||
// 导出Word
|
||||
export const exportWordApi = () => {
|
||||
return request.download({ url: '/infra/db-doc/export-word' })
|
||||
}
|
||||
|
||||
// 导出Markdown
|
||||
export const exportMarkdownApi = () => {
|
||||
return request.download({ url: '/infra/db-doc/export-markdown' })
|
||||
}
|
||||
66
src/api/infra/fileConfig/index.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
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
|
||||
domain: string
|
||||
}
|
||||
export interface FileConfigVO {
|
||||
id: number
|
||||
name: string
|
||||
storage: number
|
||||
master: boolean
|
||||
visible: boolean
|
||||
config: FileClientConfig
|
||||
remark: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface FileConfigPageReqVO extends PageParam {
|
||||
name?: string
|
||||
storage?: number
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
// 查询文件配置列表
|
||||
export const getFileConfigPageApi = (params: FileConfigPageReqVO) => {
|
||||
return request.get({ url: '/infra/file-config/page', params })
|
||||
}
|
||||
|
||||
// 查询文件配置详情
|
||||
export const getFileConfigApi = (id: number) => {
|
||||
return request.get({ url: '/infra/file-config/get?id=' + id })
|
||||
}
|
||||
|
||||
// 更新文件配置为主配置
|
||||
export const updateFileConfigMasterApi = (id: number) => {
|
||||
return request.put({ url: '/infra/file-config/update-master?id=' + id })
|
||||
}
|
||||
|
||||
// 新增文件配置
|
||||
export const createFileConfigApi = (data: FileConfigVO) => {
|
||||
return request.post({ url: '/infra/file-config/create', data })
|
||||
}
|
||||
|
||||
// 修改文件配置
|
||||
export const updateFileConfigApi = (data: FileConfigVO) => {
|
||||
return request.put({ url: '/infra/file-config/update', data })
|
||||
}
|
||||
|
||||
// 删除文件配置
|
||||
export const deleteFileConfigApi = (id: number) => {
|
||||
return request.delete({ url: '/infra/file-config/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 测试文件配置
|
||||
export const testFileConfigApi = (id: number) => {
|
||||
return request.get({ url: '/infra/file-config/test?id=' + id })
|
||||
}
|
||||
28
src/api/infra/fileList/index.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface FileVO {
|
||||
id: number
|
||||
configId: number
|
||||
path: string
|
||||
name: string
|
||||
url: string
|
||||
size: string
|
||||
type: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface FilePageReqVO extends PageParam {
|
||||
path?: string
|
||||
type?: string
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
// 查询文件列表
|
||||
export const getFilePageApi = (params: FilePageReqVO) => {
|
||||
return request.get({ url: '/infra/file/page', params })
|
||||
}
|
||||
|
||||
// 删除文件
|
||||
export const deleteFileApi = (id: number) => {
|
||||
return request.delete({ url: '/infra/file/delete?id=' + id })
|
||||
}
|
||||
75
src/api/infra/job/index.ts
Normal file
@@ -0,0 +1,75 @@
|
||||
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 interface JobPageReqVO extends PageParam {
|
||||
name?: string
|
||||
status?: number
|
||||
handlerName?: string
|
||||
}
|
||||
|
||||
export interface JobExportReqVO {
|
||||
name?: string
|
||||
status?: number
|
||||
handlerName?: string
|
||||
}
|
||||
|
||||
// 任务列表
|
||||
export const getJobPageApi = (params: JobPageReqVO) => {
|
||||
return request.get({ url: '/infra/job/page', params })
|
||||
}
|
||||
|
||||
// 任务详情
|
||||
export const getJobApi = (id: number) => {
|
||||
return request.get({ url: '/infra/job/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增任务
|
||||
export const createJobApi = (data: JobVO) => {
|
||||
return request.post({ url: '/infra/job/create', data })
|
||||
}
|
||||
|
||||
// 修改定时任务调度
|
||||
export const updateJobApi = (data: JobVO) => {
|
||||
return request.put({ url: '/infra/job/update', data })
|
||||
}
|
||||
|
||||
// 删除定时任务调度
|
||||
export const deleteJobApi = (id: number) => {
|
||||
return request.delete({ url: '/infra/job/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 导出定时任务调度
|
||||
export const exportJobApi = (params: JobExportReqVO) => {
|
||||
return request.download({ url: '/infra/job/export-excel', params })
|
||||
}
|
||||
|
||||
// 任务状态修改
|
||||
export const updateJobStatusApi = (id: number, status: number) => {
|
||||
const params = {
|
||||
id,
|
||||
status
|
||||
}
|
||||
return request.put({ url: '/infra/job/update-status', params })
|
||||
}
|
||||
|
||||
// 定时任务立即执行一次
|
||||
export const runJobApi = (id: number) => {
|
||||
return request.put({ url: '/infra/job/trigger?id=' + id })
|
||||
}
|
||||
|
||||
// 获得定时任务的下 n 次执行时间
|
||||
export const getJobNextTimesApi = (id: number) => {
|
||||
return request.get({ url: '/infra/job/get_next_times?id=' + id })
|
||||
}
|
||||
49
src/api/infra/jobLog/index.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface JobLogVO {
|
||||
id: number
|
||||
jobId: number
|
||||
handlerName: string
|
||||
handlerParam: string
|
||||
cronExpression: string
|
||||
executeIndex: string
|
||||
beginTime: string
|
||||
endTime: string
|
||||
duration: string
|
||||
status: number
|
||||
createTime: string
|
||||
}
|
||||
|
||||
export interface JobLogPageReqVO extends PageParam {
|
||||
jobId?: number
|
||||
handlerName?: string
|
||||
beginTime?: string
|
||||
endTime?: string
|
||||
status?: number
|
||||
}
|
||||
|
||||
export interface JobLogExportReqVO {
|
||||
jobId?: number
|
||||
handlerName?: string
|
||||
beginTime?: string
|
||||
endTime?: string
|
||||
status?: number
|
||||
}
|
||||
|
||||
// 任务日志列表
|
||||
export const getJobLogPageApi = (params: JobLogPageReqVO) => {
|
||||
return request.get({ url: '/infra/job-log/page', params })
|
||||
}
|
||||
|
||||
// 任务日志详情
|
||||
export const getJobLogApi = (id: number) => {
|
||||
return request.get({ url: '/infra/job-log/get?id=' + id })
|
||||
}
|
||||
|
||||
// 导出定时任务日志
|
||||
export const exportJobLogApi = (params: JobLogExportReqVO) => {
|
||||
return request.download({
|
||||
url: '/infra/job-log/export-excel',
|
||||
params
|
||||
})
|
||||
}
|
||||
41
src/api/infra/redis/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/**
|
||||
* 获取redis 监控信息
|
||||
*/
|
||||
export const getCacheApi = () => {
|
||||
return request.get({ url: '/infra/redis/get-monitor-info' })
|
||||
}
|
||||
// 获取模块
|
||||
export const getKeyDefineListApi = () => {
|
||||
return request.get({ url: '/infra/redis/get-key-define-list' })
|
||||
}
|
||||
/**
|
||||
* 获取redis key列表
|
||||
*/
|
||||
export const getKeyListApi = (keyTemplate: string) => {
|
||||
return request.get({
|
||||
url: '/infra/redis/get-key-list',
|
||||
params: {
|
||||
keyTemplate
|
||||
}
|
||||
})
|
||||
}
|
||||
// 获取缓存内容
|
||||
export const getKeyValueApi = (key: string) => {
|
||||
return request.get({ url: '/infra/redis/get-key-value?key=' + key })
|
||||
}
|
||||
|
||||
// 根据键名删除缓存
|
||||
export const deleteKeyApi = (key: string) => {
|
||||
return request.delete({ url: '/infra/redis/delete-key?key=' + key })
|
||||
}
|
||||
|
||||
export const deleteKeysApi = (keyTemplate: string) => {
|
||||
return request.delete({
|
||||
url: '/infra/redis/delete-keys?',
|
||||
params: {
|
||||
keyTemplate
|
||||
}
|
||||
})
|
||||
}
|
||||
185
src/api/infra/redis/types.ts
Normal file
@@ -0,0 +1,185 @@
|
||||
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
|
||||
}
|
||||
|
||||
export interface RedisKeyInfo {
|
||||
keyTemplate: string
|
||||
keyType: string
|
||||
valueType: string
|
||||
timeoutType: number
|
||||
timeout: number
|
||||
memo: string
|
||||
}
|
||||
73
src/api/login/index.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
import request from '@/config/axios'
|
||||
import { getRefreshToken } from '@/utils/auth'
|
||||
import type { UserLoginVO } from './types'
|
||||
|
||||
export interface CodeImgResult {
|
||||
captchaOnOff: boolean
|
||||
img: string
|
||||
uuid: string
|
||||
}
|
||||
export interface SmsCodeVO {
|
||||
mobile: string
|
||||
scene: number
|
||||
}
|
||||
export interface SmsLoginVO {
|
||||
mobile: string
|
||||
code: string
|
||||
}
|
||||
|
||||
// 登录
|
||||
export const loginApi = (data: UserLoginVO) => {
|
||||
return request.post({ url: '/system/auth/login', data })
|
||||
}
|
||||
|
||||
// 刷新访问令牌
|
||||
export const refreshToken = () => {
|
||||
return request.post({ url: '/system/auth/refresh-token?refreshToken=' + getRefreshToken() })
|
||||
}
|
||||
|
||||
// 使用租户名,获得租户编号
|
||||
export const getTenantIdByNameApi = (name: string) => {
|
||||
return request.get({ url: '/system/tenant/get-id-by-name?name=' + name })
|
||||
}
|
||||
|
||||
// 登出
|
||||
export const loginOutApi = () => {
|
||||
return request.post({ url: '/system/auth/logout' })
|
||||
}
|
||||
|
||||
// 获取用户权限信息
|
||||
export const getInfoApi = () => {
|
||||
return request.get({ url: '/system/auth/get-permission-info' })
|
||||
}
|
||||
|
||||
// 路由
|
||||
export const getAsyncRoutesApi = () => {
|
||||
return request.get({ url: '/system/auth/list-menus' })
|
||||
}
|
||||
|
||||
//获取登录验证码
|
||||
export const sendSmsCodeApi = (data: SmsCodeVO) => {
|
||||
return request.post({ url: '/system/auth/send-sms-code', data })
|
||||
}
|
||||
|
||||
// 短信验证码登录
|
||||
export const smsLoginApi = (data: SmsLoginVO) => {
|
||||
return request.post({ url: '/system/auth/sms-login', data })
|
||||
}
|
||||
|
||||
// 社交授权的跳转
|
||||
export const socialAuthRedirectApi = (type: number, redirectUri: string) => {
|
||||
return request.get({
|
||||
url: '/system/auth/social-auth-redirect?type=' + type + '&redirectUri=' + redirectUri
|
||||
})
|
||||
}
|
||||
// 获取验证图片 以及token
|
||||
export const getCodeApi = (data) => {
|
||||
return request.postOriginal({ url: 'system/captcha/get', data })
|
||||
}
|
||||
|
||||
// 滑动或者点选验证
|
||||
export const reqCheckApi = (data) => {
|
||||
return request.postOriginal({ url: 'system/captcha/check', data })
|
||||
}
|
||||
42
src/api/login/types.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
export type UserLoginVO = {
|
||||
username: string
|
||||
password: string
|
||||
captchaVerification: string
|
||||
}
|
||||
|
||||
export type TokenType = {
|
||||
id: number // 编号
|
||||
accessToken: string // 访问令牌
|
||||
refreshToken: string // 刷新令牌
|
||||
userId: number // 用户编号
|
||||
userType: number //用户类型
|
||||
clientId: string //客户端编号
|
||||
expiresTime: number //过期时间
|
||||
}
|
||||
|
||||
export type UserVO = {
|
||||
id: number
|
||||
username: string
|
||||
nickname: string
|
||||
deptId: number
|
||||
email: string
|
||||
mobile: string
|
||||
sex: number
|
||||
avatar: string
|
||||
loginIp: string
|
||||
loginDate: string
|
||||
}
|
||||
|
||||
export type UserInfoVO = {
|
||||
permissions: []
|
||||
roles: []
|
||||
user: {
|
||||
avatar: string
|
||||
id: number
|
||||
nickname: string
|
||||
}
|
||||
}
|
||||
|
||||
export type TentantNameVO = {
|
||||
name: string
|
||||
}
|
||||
41
src/api/mp/account/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 创建公众号账号
|
||||
export const createAccount = async (data) => {
|
||||
return await request.post({ url: '/mp/account/create', data })
|
||||
}
|
||||
|
||||
// 更新公众号账号
|
||||
export const updateAccount = async (data) => {
|
||||
return request.put({ url: '/mp/account/update', data: data })
|
||||
}
|
||||
|
||||
// 删除公众号账号
|
||||
export const deleteAccount = async (id) => {
|
||||
return request.delete({ url: '/mp/account/delete?id=' + id, method: 'delete' })
|
||||
}
|
||||
|
||||
// 获得公众号账号
|
||||
export const getAccount = async (id) => {
|
||||
return request.get({ url: '/mp/account/get?id=' + id })
|
||||
}
|
||||
|
||||
// 获得公众号账号分页
|
||||
export const getAccountPage = async (query) => {
|
||||
return request.get({ url: '/mp/account/page', params: query })
|
||||
}
|
||||
|
||||
// 获取公众号账号精简信息列表
|
||||
export const getSimpleAccounts = async () => {
|
||||
return request.get({ url: '/mp/account/list-all-simple' })
|
||||
}
|
||||
|
||||
// 生成公众号二维码
|
||||
export const generateAccountQrCode = async (id) => {
|
||||
return request.put({ url: '/mp/account/generate-qr-code?id=' + id })
|
||||
}
|
||||
|
||||
// 清空公众号 API 配额
|
||||
export const clearAccountQuota = async (id) => {
|
||||
return request.put({ url: '/mp/account/clear-quota?id=' + id })
|
||||
}
|
||||
39
src/api/mp/autoReply/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 创建公众号的自动回复
|
||||
export const createAutoReply = (data) => {
|
||||
return request.post({
|
||||
url: '/mp/auto-reply/create',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新公众号的自动回复
|
||||
export const updateAutoReply = (data) => {
|
||||
return request.put({
|
||||
url: '/mp/auto-reply/update',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除公众号的自动回复
|
||||
export const deleteAutoReply = (id) => {
|
||||
return request.delete({
|
||||
url: '/mp/auto-reply/delete?id=' + id
|
||||
})
|
||||
}
|
||||
|
||||
// 获得公众号的自动回复
|
||||
export const getAutoReply = (id) => {
|
||||
return request.get({
|
||||
url: '/mp/auto-reply/get?id=' + id
|
||||
})
|
||||
}
|
||||
|
||||
// 获得公众号的自动回复分页
|
||||
export const getAutoReplyPage = (query) => {
|
||||
return request.get({
|
||||
url: '/mp/auto-reply/page',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
35
src/api/mp/draft/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 获得公众号草稿分页
|
||||
export const getDraftPage = (query) => {
|
||||
return request.get({
|
||||
url: '/mp/draft/page',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 创建公众号草稿
|
||||
export const createDraft = (accountId, articles) => {
|
||||
return request.post({
|
||||
url: '/mp/draft/create?accountId=' + accountId,
|
||||
data: {
|
||||
articles
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 更新公众号草稿
|
||||
export const updateDraft = (accountId, mediaId, articles) => {
|
||||
return request.put({
|
||||
url: '/mp/draft/update?accountId=' + accountId + '&mediaId=' + mediaId,
|
||||
method: 'put',
|
||||
data: articles
|
||||
})
|
||||
}
|
||||
|
||||
// 删除公众号草稿
|
||||
export const deleteDraft = (accountId, mediaId) => {
|
||||
return request.delete({
|
||||
url: '/mp/draft/delete?accountId=' + accountId + '&mediaId=' + mediaId
|
||||
})
|
||||
}
|
||||
23
src/api/mp/freePublish/index.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 获得公众号素材分页
|
||||
export const getFreePublishPage = (query) => {
|
||||
return request.get({
|
||||
url: '/mp/free-publish/page',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 删除公众号素材
|
||||
export const deleteFreePublish = (accountId, articleId) => {
|
||||
return request.delete({
|
||||
url: '/mp/free-publish/delete?accountId=' + accountId + '&articleId=' + articleId
|
||||
})
|
||||
}
|
||||
|
||||
// 发布公众号素材
|
||||
export const submitFreePublish = (accountId, mediaId) => {
|
||||
return request.post({
|
||||
url: '/mp/free-publish/submit?accountId=' + accountId + '&mediaId=' + mediaId
|
||||
})
|
||||
}
|
||||
16
src/api/mp/material/index.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 获得公众号素材分页
|
||||
export const getMaterialPage = (query) => {
|
||||
return request.get({
|
||||
url: '/mp/material/page',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 删除公众号永久素材
|
||||
export const deletePermanentMaterial = (id) => {
|
||||
return request.delete({
|
||||
url: '/mp/material/delete-permanent?id=' + id
|
||||
})
|
||||
}
|
||||
26
src/api/mp/menu/index.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 获得公众号菜单列表
|
||||
export const getMenuList = (accountId) => {
|
||||
return request.get({
|
||||
url: '/mp/menu/list?accountId=' + accountId
|
||||
})
|
||||
}
|
||||
|
||||
// 保存公众号菜单
|
||||
export const saveMenu = (accountId, menus) => {
|
||||
return request.post({
|
||||
url: '/mp/menu/save',
|
||||
data: {
|
||||
accountId,
|
||||
menus
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除公众号菜单
|
||||
export const deleteMenu = (accountId) => {
|
||||
return request.delete({
|
||||
url: '/mp/menu/delete?accountId=' + accountId
|
||||
})
|
||||
}
|
||||
17
src/api/mp/message/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 获得公众号消息分页
|
||||
export const getMessagePage = (query) => {
|
||||
return request.get({
|
||||
url: '/mp/message/page',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 给粉丝发送消息
|
||||
export const sendMessage = (data) => {
|
||||
return request.post({
|
||||
url: '/mp/message/send',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
31
src/api/mp/mpuser/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 更新公众号粉丝
|
||||
export const updateUser = (data) => {
|
||||
return request.put({
|
||||
url: '/mp/user/update',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获得公众号粉丝
|
||||
export const getUser = (id) => {
|
||||
return request.get({
|
||||
url: '/mp/user/get?id=' + id
|
||||
})
|
||||
}
|
||||
|
||||
// 获得公众号粉丝分页
|
||||
export const getUserPage = (query) => {
|
||||
return request.get({
|
||||
url: '/mp/user/page',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 同步公众号粉丝
|
||||
export const syncUser = (accountId) => {
|
||||
return request.post({
|
||||
url: '/mp/tag/sync?accountId=' + accountId
|
||||
})
|
||||
}
|
||||
33
src/api/mp/statistics/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 获取消息发送概况数据
|
||||
export const getUpstreamMessage = (query) => {
|
||||
return request.get({
|
||||
url: '/mp/statistics/upstream-message',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 用户增减数据
|
||||
export const getUserSummary = (query) => {
|
||||
return request.get({
|
||||
url: '/mp/statistics/user-summary',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得用户累计数据
|
||||
export const getUserCumulate = (query) => {
|
||||
return request.get({
|
||||
url: '/mp/statistics/user-cumulate',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得接口分析数据
|
||||
export const getInterfaceSummary = (query) => {
|
||||
return request.get({
|
||||
url: '/mp/statistics/interface-summary',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
53
src/api/mp/tag/index.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 创建公众号标签
|
||||
export const createTag = (data) => {
|
||||
return request.post({
|
||||
url: '/mp/tag/create',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新公众号标签
|
||||
export const updateTag = (data) => {
|
||||
return request.put({
|
||||
url: '/mp/tag/update',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除公众号标签
|
||||
export const deleteTag = (id) => {
|
||||
return request.delete({
|
||||
url: '/mp/tag/delete?id=' + id
|
||||
})
|
||||
}
|
||||
|
||||
// 获得公众号标签
|
||||
export const getTag = (id) => {
|
||||
return request.get({
|
||||
url: '/mp/tag/get?id=' + id
|
||||
})
|
||||
}
|
||||
|
||||
// 获得公众号标签分页
|
||||
export const getTagPage = (query) => {
|
||||
return request.get({
|
||||
url: '/mp/tag/page',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获取公众号标签精简信息列表
|
||||
export const getSimpleTags = () => {
|
||||
return request.get({
|
||||
url: '/mp/tag/list-all-simple'
|
||||
})
|
||||
}
|
||||
|
||||
// 同步公众号标签
|
||||
export const syncTag = (accountId) => {
|
||||
return request.post({
|
||||
url: '/mp/tag/sync?accountId=' + accountId
|
||||
})
|
||||
}
|
||||
78
src/api/pay/app/index.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface AppVO {
|
||||
id: number
|
||||
name: string
|
||||
status: number
|
||||
remark: string
|
||||
payNotifyUrl: string
|
||||
refundNotifyUrl: string
|
||||
merchantId: number
|
||||
merchantName: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface AppPageReqVO extends PageParam {
|
||||
name?: string
|
||||
status?: number
|
||||
remark?: string
|
||||
payNotifyUrl?: string
|
||||
refundNotifyUrl?: string
|
||||
merchantName?: string
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
export interface AppExportReqVO {
|
||||
name?: string
|
||||
status?: number
|
||||
remark?: string
|
||||
payNotifyUrl?: string
|
||||
refundNotifyUrl?: string
|
||||
merchantName?: string
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
export interface AppUpdateStatusReqVO {
|
||||
id: number
|
||||
status: number
|
||||
}
|
||||
|
||||
// 查询列表支付应用
|
||||
export const getAppPageApi = (params: AppPageReqVO) => {
|
||||
return request.get({ url: '/pay/app/page', params })
|
||||
}
|
||||
|
||||
// 查询详情支付应用
|
||||
export const getAppApi = (id: number) => {
|
||||
return request.get({ url: '/pay/app/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增支付应用
|
||||
export const createAppApi = (data: AppVO) => {
|
||||
return request.post({ url: '/pay/app/create', data })
|
||||
}
|
||||
|
||||
// 修改支付应用
|
||||
export const updateAppApi = (data: AppVO) => {
|
||||
return request.put({ url: '/pay/app/update', data })
|
||||
}
|
||||
|
||||
// 支付应用信息状态修改
|
||||
export const changeAppStatusApi = (data: AppUpdateStatusReqVO) => {
|
||||
return request.put({ url: '/pay/app/update-status', data: data })
|
||||
}
|
||||
|
||||
// 删除支付应用
|
||||
export const deleteAppApi = (id: number) => {
|
||||
return request.delete({ url: '/pay/app/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 导出支付应用
|
||||
export const exportAppApi = (params: AppExportReqVO) => {
|
||||
return request.download({ url: '/pay/app/export-excel', params })
|
||||
}
|
||||
|
||||
// 根据商ID称搜索应用列表
|
||||
export const getAppListByMerchantIdApi = (merchantId: number) => {
|
||||
return request.get({ url: '/pay/app/list-merchant-id', params: { merchantId: merchantId } })
|
||||
}
|
||||
70
src/api/pay/channel/index.ts
Normal file
@@ -0,0 +1,70 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface ChannelVO {
|
||||
id: number
|
||||
code: string
|
||||
config: string
|
||||
status: number
|
||||
remark: string
|
||||
feeRate: number
|
||||
merchantId: number
|
||||
appId: number
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface ChannelPageReqVO extends PageParam {
|
||||
code?: string
|
||||
status?: number
|
||||
remark?: string
|
||||
feeRate?: number
|
||||
merchantId?: number
|
||||
appId?: number
|
||||
config?: string
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
export interface ChannelExportReqVO {
|
||||
code?: string
|
||||
status?: number
|
||||
remark?: string
|
||||
feeRate?: number
|
||||
merchantId?: number
|
||||
appId?: number
|
||||
config?: string
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
// 查询列表支付渠道
|
||||
export const getChannelPageApi = (params: ChannelPageReqVO) => {
|
||||
return request.get({ url: '/pay/channel/page', params })
|
||||
}
|
||||
|
||||
// 查询详情支付渠道
|
||||
export const getChannelApi = (merchantId: number, appId: string, code: string) => {
|
||||
const params = {
|
||||
merchantId: merchantId,
|
||||
appId: appId,
|
||||
code: code
|
||||
}
|
||||
return request.get({ url: '/pay/channel/get-channel', params: params })
|
||||
}
|
||||
|
||||
// 新增支付渠道
|
||||
export const createChannelApi = (data: ChannelVO) => {
|
||||
return request.post({ url: '/pay/channel/create', data })
|
||||
}
|
||||
|
||||
// 修改支付渠道
|
||||
export const updateChannelApi = (data: ChannelVO) => {
|
||||
return request.put({ url: '/pay/channel/update', data })
|
||||
}
|
||||
|
||||
// 删除支付渠道
|
||||
export const deleteChannelApi = (id: number) => {
|
||||
return request.delete({ url: '/pay/channel/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 导出支付渠道
|
||||
export const exportChannelApi = (params: ChannelExportReqVO) => {
|
||||
return request.download({ url: '/pay/channel/export-excel', params })
|
||||
}
|
||||
77
src/api/pay/merchant/index.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface MerchantVO {
|
||||
id: number
|
||||
no: string
|
||||
name: string
|
||||
shortName: string
|
||||
status: number
|
||||
remark: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface MerchantPageReqVO extends PageParam {
|
||||
no?: string
|
||||
name?: string
|
||||
shortName?: string
|
||||
status?: number
|
||||
remark?: string
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
export interface MerchantExportReqVO {
|
||||
no?: string
|
||||
name?: string
|
||||
shortName?: string
|
||||
status?: number
|
||||
remark?: string
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
// 查询列表支付商户
|
||||
export const getMerchantPageApi = (params: MerchantPageReqVO) => {
|
||||
return request.get({ url: '/pay/merchant/page', params })
|
||||
}
|
||||
|
||||
// 查询详情支付商户
|
||||
export const getMerchantApi = (id: number) => {
|
||||
return request.get({ url: '/pay/merchant/get?id=' + id })
|
||||
}
|
||||
|
||||
// 根据商户名称搜索商户列表
|
||||
export const getMerchantListByNameApi = (name: string) => {
|
||||
return request.get({
|
||||
url: '/pay/merchant/list-by-name?id=',
|
||||
params: {
|
||||
name: name
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 新增支付商户
|
||||
export const createMerchantApi = (data: MerchantVO) => {
|
||||
return request.post({ url: '/pay/merchant/create', data })
|
||||
}
|
||||
|
||||
// 修改支付商户
|
||||
export const updateMerchantApi = (data: MerchantVO) => {
|
||||
return request.put({ url: '/pay/merchant/update', data })
|
||||
}
|
||||
|
||||
// 删除支付商户
|
||||
export const deleteMerchantApi = (id: number) => {
|
||||
return request.delete({ url: '/pay/merchant/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 导出支付商户
|
||||
export const exportMerchantApi = (params: MerchantExportReqVO) => {
|
||||
return request.download({ url: '/pay/merchant/export-excel', params })
|
||||
}
|
||||
// 支付商户状态修改
|
||||
export const changeMerchantStatusApi = (id: number, status: number) => {
|
||||
const data = {
|
||||
id,
|
||||
status
|
||||
}
|
||||
return request.put({ url: '/pay/merchant/update-status', data: data })
|
||||
}
|
||||
109
src/api/pay/order/index.ts
Normal file
@@ -0,0 +1,109 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface OrderVO {
|
||||
id: number
|
||||
merchantId: number
|
||||
appId: number
|
||||
channelId: number
|
||||
channelCode: string
|
||||
merchantOrderId: string
|
||||
subject: string
|
||||
body: string
|
||||
notifyUrl: string
|
||||
notifyStatus: number
|
||||
amount: number
|
||||
channelFeeRate: number
|
||||
channelFeeAmount: number
|
||||
status: number
|
||||
userIp: string
|
||||
expireTime: Date
|
||||
successTime: Date
|
||||
notifyTime: Date
|
||||
successExtensionId: number
|
||||
refundStatus: number
|
||||
refundTimes: number
|
||||
refundAmount: number
|
||||
channelUserId: string
|
||||
channelOrderNo: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface OrderPageReqVO extends PageParam {
|
||||
merchantId?: number
|
||||
appId?: number
|
||||
channelId?: number
|
||||
channelCode?: string
|
||||
merchantOrderId?: string
|
||||
subject?: string
|
||||
body?: string
|
||||
notifyUrl?: string
|
||||
notifyStatus?: number
|
||||
amount?: number
|
||||
channelFeeRate?: number
|
||||
channelFeeAmount?: number
|
||||
status?: number
|
||||
expireTime?: Date[]
|
||||
successTime?: Date[]
|
||||
notifyTime?: Date[]
|
||||
successExtensionId?: number
|
||||
refundStatus?: number
|
||||
refundTimes?: number
|
||||
channelUserId?: string
|
||||
channelOrderNo?: string
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
export interface OrderExportReqVO {
|
||||
merchantId?: number
|
||||
appId?: number
|
||||
channelId?: number
|
||||
channelCode?: string
|
||||
merchantOrderId?: string
|
||||
subject?: string
|
||||
body?: string
|
||||
notifyUrl?: string
|
||||
notifyStatus?: number
|
||||
amount?: number
|
||||
channelFeeRate?: number
|
||||
channelFeeAmount?: number
|
||||
status?: number
|
||||
expireTime?: Date[]
|
||||
successTime?: Date[]
|
||||
notifyTime?: Date[]
|
||||
successExtensionId?: number
|
||||
refundStatus?: number
|
||||
refundTimes?: number
|
||||
channelUserId?: string
|
||||
channelOrderNo?: string
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
// 查询列表支付订单
|
||||
export const getOrderPageApi = async (params: OrderPageReqVO) => {
|
||||
return await request.get({ url: '/pay/order/page', params })
|
||||
}
|
||||
|
||||
// 查询详情支付订单
|
||||
export const getOrderApi = async (id: number) => {
|
||||
return await request.get({ url: '/pay/order/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增支付订单
|
||||
export const createOrderApi = async (data: OrderVO) => {
|
||||
return await request.post({ url: '/pay/order/create', data })
|
||||
}
|
||||
|
||||
// 修改支付订单
|
||||
export const updateOrderApi = async (data: OrderVO) => {
|
||||
return await request.put({ url: '/pay/order/update', data })
|
||||
}
|
||||
|
||||
// 删除支付订单
|
||||
export const deleteOrderApi = async (id: number) => {
|
||||
return await request.delete({ url: '/pay/order/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 导出支付订单
|
||||
export const exportOrderApi = async (params: OrderExportReqVO) => {
|
||||
return await request.download({ url: '/pay/order/export-excel', params })
|
||||
}
|
||||
116
src/api/pay/refund/index.ts
Normal file
@@ -0,0 +1,116 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface RefundVO {
|
||||
id: number
|
||||
merchantId: number
|
||||
appId: number
|
||||
channelId: number
|
||||
channelCode: string
|
||||
orderId: string
|
||||
tradeNo: string
|
||||
merchantOrderId: string
|
||||
merchantRefundNo: string
|
||||
notifyUrl: string
|
||||
notifyStatus: number
|
||||
status: number
|
||||
type: number
|
||||
payAmount: number
|
||||
refundAmount: number
|
||||
reason: string
|
||||
userIp: string
|
||||
channelOrderNo: string
|
||||
channelRefundNo: string
|
||||
channelErrorCode: string
|
||||
channelErrorMsg: string
|
||||
channelExtras: string
|
||||
expireTime: Date
|
||||
successTime: Date
|
||||
notifyTime: Date
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface RefundPageReqVO extends PageParam {
|
||||
merchantId?: number
|
||||
appId?: number
|
||||
channelId?: number
|
||||
channelCode?: string
|
||||
orderId?: string
|
||||
tradeNo?: string
|
||||
merchantOrderId?: string
|
||||
merchantRefundNo?: string
|
||||
notifyUrl?: string
|
||||
notifyStatus?: number
|
||||
status?: number
|
||||
type?: number
|
||||
payAmount?: number
|
||||
refundAmount?: number
|
||||
reason?: string
|
||||
userIp?: string
|
||||
channelOrderNo?: string
|
||||
channelRefundNo?: string
|
||||
channelErrorCode?: string
|
||||
channelErrorMsg?: string
|
||||
channelExtras?: string
|
||||
expireTime?: Date[]
|
||||
successTime?: Date[]
|
||||
notifyTime?: Date[]
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
export interface PayRefundExportReqVO {
|
||||
merchantId?: number
|
||||
appId?: number
|
||||
channelId?: number
|
||||
channelCode?: string
|
||||
orderId?: string
|
||||
tradeNo?: string
|
||||
merchantOrderId?: string
|
||||
merchantRefundNo?: string
|
||||
notifyUrl?: string
|
||||
notifyStatus?: number
|
||||
status?: number
|
||||
type?: number
|
||||
payAmount?: number
|
||||
refundAmount?: number
|
||||
reason?: string
|
||||
userIp?: string
|
||||
channelOrderNo?: string
|
||||
channelRefundNo?: string
|
||||
channelErrorCode?: string
|
||||
channelErrorMsg?: string
|
||||
channelExtras?: string
|
||||
expireTime?: Date[]
|
||||
successTime?: Date[]
|
||||
notifyTime?: Date[]
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
// 查询列表退款订单
|
||||
export const getRefundPageApi = (params: RefundPageReqVO) => {
|
||||
return request.get({ url: '/pay/refund/page', params })
|
||||
}
|
||||
|
||||
// 查询详情退款订单
|
||||
export const getRefundApi = (id: number) => {
|
||||
return request.get({ url: '/pay/refund/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增退款订单
|
||||
export const createRefundApi = (data: RefundVO) => {
|
||||
return request.post({ url: '/pay/refund/create', data })
|
||||
}
|
||||
|
||||
// 修改退款订单
|
||||
export const updateRefundApi = (data: RefundVO) => {
|
||||
return request.put({ url: '/pay/refund/update', data })
|
||||
}
|
||||
|
||||
// 删除退款订单
|
||||
export const deleteRefundApi = (id: number) => {
|
||||
return request.delete({ url: '/pay/refund/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 导出退款订单
|
||||
export const exportRefundApi = (params: PayRefundExportReqVO) => {
|
||||
return request.download({ url: '/pay/refund/export-excel', params })
|
||||
}
|
||||
48
src/api/system/dept/index.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface DeptVO {
|
||||
id?: number
|
||||
name: string
|
||||
parentId: number
|
||||
status: number
|
||||
sort: number
|
||||
leaderUserId: number
|
||||
phone: string
|
||||
email: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface DeptPageReqVO {
|
||||
name?: string
|
||||
status?: number
|
||||
}
|
||||
|
||||
// 查询部门(精简)列表
|
||||
export const listSimpleDeptApi = async () => {
|
||||
return await request.get({ url: '/system/dept/list-all-simple' })
|
||||
}
|
||||
|
||||
// 查询部门列表
|
||||
export const getDeptPageApi = async (params: DeptPageReqVO) => {
|
||||
return await request.get({ url: '/system/dept/list', params })
|
||||
}
|
||||
|
||||
// 查询部门详情
|
||||
export const getDeptApi = async (id: number) => {
|
||||
return await request.get({ url: '/system/dept/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增部门
|
||||
export const createDeptApi = async (data: DeptVO) => {
|
||||
return await request.post({ url: '/system/dept/create', data: data })
|
||||
}
|
||||
|
||||
// 修改部门
|
||||
export const updateDeptApi = async (params: DeptVO) => {
|
||||
return await request.put({ url: '/system/dept/update', data: params })
|
||||
}
|
||||
|
||||
// 删除部门
|
||||
export const deleteDeptApi = async (id: number) => {
|
||||
return await request.delete({ url: '/system/dept/delete?id=' + id })
|
||||
}
|
||||
36
src/api/system/dict/dict.data.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import request from '@/config/axios'
|
||||
import type { DictDataVO, DictDataPageReqVO, DictDataExportReqVO } from './types'
|
||||
|
||||
// 查询字典数据(精简)列表
|
||||
export const listSimpleDictDataApi = () => {
|
||||
return request.get({ url: '/system/dict-data/list-all-simple' })
|
||||
}
|
||||
|
||||
// 查询字典数据列表
|
||||
export const getDictDataPageApi = (params: DictDataPageReqVO) => {
|
||||
return request.get({ url: '/system/dict-data/page', params })
|
||||
}
|
||||
|
||||
// 查询字典数据详情
|
||||
export const getDictDataApi = (id: number) => {
|
||||
return request.get({ url: '/system/dict-data/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增字典数据
|
||||
export const createDictDataApi = (data: DictDataVO) => {
|
||||
return request.post({ url: '/system/dict-data/create', data })
|
||||
}
|
||||
|
||||
// 修改字典数据
|
||||
export const updateDictDataApi = (data: DictDataVO) => {
|
||||
return request.put({ url: '/system/dict-data/update', data })
|
||||
}
|
||||
|
||||
// 删除字典数据
|
||||
export const deleteDictDataApi = (id: number) => {
|
||||
return request.delete({ url: '/system/dict-data/delete?id=' + id })
|
||||
}
|
||||
// 导出字典类型数据
|
||||
export const exportDictDataApi = (params: DictDataExportReqVO) => {
|
||||
return request.get({ url: '/system/dict-data/export', params })
|
||||
}
|
||||
36
src/api/system/dict/dict.type.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import request from '@/config/axios'
|
||||
import type { DictTypeVO, DictTypePageReqVO, DictTypeExportReqVO } from './types'
|
||||
|
||||
// 查询字典(精简)列表
|
||||
export const listSimpleDictTypeApi = () => {
|
||||
return request.get({ url: '/system/dict-type/list-all-simple' })
|
||||
}
|
||||
|
||||
// 查询字典列表
|
||||
export const getDictTypePageApi = (params: DictTypePageReqVO) => {
|
||||
return request.get({ url: '/system/dict-type/page', params })
|
||||
}
|
||||
|
||||
// 查询字典详情
|
||||
export const getDictTypeApi = (id: number) => {
|
||||
return request.get({ url: '/system/dict-type/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增字典
|
||||
export const createDictTypeApi = (data: DictTypeVO) => {
|
||||
return request.post({ url: '/system/dict-type/create', data })
|
||||
}
|
||||
|
||||
// 修改字典
|
||||
export const updateDictTypeApi = (data: DictTypeVO) => {
|
||||
return request.put({ url: '/system/dict-type/update', data })
|
||||
}
|
||||
|
||||
// 删除字典
|
||||
export const deleteDictTypeApi = (id: number) => {
|
||||
return request.delete({ url: '/system/dict-type/delete?id=' + id })
|
||||
}
|
||||
// 导出字典类型
|
||||
export const exportDictTypeApi = (params: DictTypeExportReqVO) => {
|
||||
return request.get({ url: '/system/dict-type/export', params })
|
||||
}
|
||||
46
src/api/system/dict/types.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
export type DictTypeVO = {
|
||||
id: number
|
||||
name: string
|
||||
type: string
|
||||
status: number
|
||||
remark: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export type DictTypePageReqVO = {
|
||||
name: string
|
||||
type: string
|
||||
status: number
|
||||
createTime: Date[]
|
||||
}
|
||||
|
||||
export type DictTypeExportReqVO = {
|
||||
name: string
|
||||
type: string
|
||||
status: number
|
||||
createTime: Date[]
|
||||
}
|
||||
|
||||
export type DictDataVO = {
|
||||
id: number
|
||||
sort: number
|
||||
label: string
|
||||
value: string
|
||||
dictType: string
|
||||
status: number
|
||||
colorType: string
|
||||
cssClass: string
|
||||
remark: string
|
||||
createTime: Date
|
||||
}
|
||||
export type DictDataPageReqVO = {
|
||||
label: string
|
||||
dictType: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type DictDataExportReqVO = {
|
||||
label: string
|
||||
dictType: string
|
||||
status: number
|
||||
}
|
||||
48
src/api/system/errorCode/index.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface ErrorCodeVO {
|
||||
id: number
|
||||
type: number
|
||||
applicationName: string
|
||||
code: number
|
||||
message: string
|
||||
memo: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface ErrorCodePageReqVO extends PageParam {
|
||||
type?: number
|
||||
applicationName?: string
|
||||
code?: number
|
||||
message?: string
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
// 查询错误码列表
|
||||
export const getErrorCodePageApi = (params: ErrorCodePageReqVO) => {
|
||||
return request.get({ url: '/system/error-code/page', params })
|
||||
}
|
||||
|
||||
// 查询错误码详情
|
||||
export const getErrorCodeApi = (id: number) => {
|
||||
return request.get({ url: '/system/error-code/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增错误码
|
||||
export const createErrorCodeApi = (data: ErrorCodeVO) => {
|
||||
return request.post({ url: '/system/error-code/create', data })
|
||||
}
|
||||
|
||||
// 修改错误码
|
||||
export const updateErrorCodeApi = (data: ErrorCodeVO) => {
|
||||
return request.put({ url: '/system/error-code/update', data })
|
||||
}
|
||||
|
||||
// 删除错误码
|
||||
export const deleteErrorCodeApi = (id: number) => {
|
||||
return request.delete({ url: '/system/error-code/delete?id=' + id })
|
||||
}
|
||||
// 导出错误码
|
||||
export const excelErrorCodeApi = (params: ErrorCodePageReqVO) => {
|
||||
return request.download({ url: '/system/error-code/export-excel', params })
|
||||
}
|
||||
30
src/api/system/loginLog/index.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface LoginLogVO {
|
||||
id: number
|
||||
logType: number
|
||||
traceId: number
|
||||
userId: number
|
||||
userType: number
|
||||
username: string
|
||||
status: number
|
||||
userIp: string
|
||||
userAgent: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface LoginLogReqVO extends PageParam {
|
||||
userIp?: string
|
||||
username?: string
|
||||
status?: boolean
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
// 查询登录日志列表
|
||||
export const getLoginLogPageApi = (params: LoginLogReqVO) => {
|
||||
return request.get({ url: '/system/login-log/page', params })
|
||||
}
|
||||
// 导出登录日志
|
||||
export const exportLoginLogApi = (params: LoginLogReqVO) => {
|
||||
return request.download({ url: '/system/login-log/export', params })
|
||||
}
|
||||
46
src/api/system/mail/account/index.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface MailAccountVO {
|
||||
id: number
|
||||
mail: string
|
||||
username: string
|
||||
password: string
|
||||
host: string
|
||||
port: number
|
||||
sslEnable: boolean
|
||||
}
|
||||
|
||||
export interface MailAccountPageReqVO extends PageParam {
|
||||
mail?: string
|
||||
username?: string
|
||||
}
|
||||
|
||||
// 查询邮箱账号列表
|
||||
export const getMailAccountPageApi = async (params: MailAccountPageReqVO) => {
|
||||
return await request.get({ url: '/system/mail-account/page', params })
|
||||
}
|
||||
|
||||
// 查询邮箱账号详情
|
||||
export const getMailAccountApi = async (id: number) => {
|
||||
return await request.get({ url: '/system/mail-account/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增邮箱账号
|
||||
export const createMailAccountApi = async (data: MailAccountVO) => {
|
||||
return await request.post({ url: '/system/mail-account/create', data })
|
||||
}
|
||||
|
||||
// 修改邮箱账号
|
||||
export const updateMailAccountApi = async (data: MailAccountVO) => {
|
||||
return await request.put({ url: '/system/mail-account/update', data })
|
||||
}
|
||||
|
||||
// 删除邮箱账号
|
||||
export const deleteMailAccountApi = async (id: number) => {
|
||||
return await request.delete({ url: '/system/mail-account/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 获得邮箱账号精简列表
|
||||
export const getSimpleMailAccounts = async () => {
|
||||
return request.get({ url: '/system/mail-account/list-all-simple' })
|
||||
}
|
||||
40
src/api/system/mail/log/index.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface MailLogVO {
|
||||
id: number
|
||||
userId: number
|
||||
userType: number
|
||||
toMail: string
|
||||
accountId: number
|
||||
fromMail: string
|
||||
templateId: number
|
||||
templateCode: string
|
||||
templateNickname: string
|
||||
templateTitle: string
|
||||
templateContent: string
|
||||
templateParams: string
|
||||
sendStatus: number
|
||||
sendTime: Date
|
||||
sendMessageId: string
|
||||
sendException: string
|
||||
}
|
||||
|
||||
export interface MailLogPageReqVO extends PageParam {
|
||||
userId?: number
|
||||
userType?: number
|
||||
toMail?: string
|
||||
accountId?: number
|
||||
templateId?: number
|
||||
sendStatus?: number
|
||||
sendTime?: Date[]
|
||||
}
|
||||
|
||||
// 查询邮件日志列表
|
||||
export const getMailLogPageApi = async (params: MailLogPageReqVO) => {
|
||||
return await request.get({ url: '/system/mail-log/page', params })
|
||||
}
|
||||
|
||||
// 查询邮件日志详情
|
||||
export const getMailLogApi = async (id: number) => {
|
||||
return await request.get({ url: '/system/mail-log/get?id=' + id })
|
||||
}
|
||||
58
src/api/system/mail/template/index.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface MailTemplateVO {
|
||||
id: number
|
||||
name: string
|
||||
code: string
|
||||
accountId: number
|
||||
nickname: string
|
||||
title: string
|
||||
content: string
|
||||
params: string
|
||||
status: number
|
||||
remark: string
|
||||
}
|
||||
|
||||
export interface MailTemplatePageReqVO extends PageParam {
|
||||
name?: string
|
||||
code?: string
|
||||
accountId?: number
|
||||
status?: number
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
export interface MailSendReqVO {
|
||||
mail: string
|
||||
templateCode: string
|
||||
templateParams: Map<String, Object>
|
||||
}
|
||||
|
||||
// 查询邮件模版列表
|
||||
export const getMailTemplatePageApi = async (params: MailTemplatePageReqVO) => {
|
||||
return await request.get({ url: '/system/mail-template/page', params })
|
||||
}
|
||||
|
||||
// 查询邮件模版详情
|
||||
export const getMailTemplateApi = async (id: number) => {
|
||||
return await request.get({ url: '/system/mail-template/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增邮件模版
|
||||
export const createMailTemplateApi = async (data: MailTemplateVO) => {
|
||||
return await request.post({ url: '/system/mail-template/create', data })
|
||||
}
|
||||
|
||||
// 修改邮件模版
|
||||
export const updateMailTemplateApi = async (data: MailTemplateVO) => {
|
||||
return await request.put({ url: '/system/mail-template/update', data })
|
||||
}
|
||||
|
||||
// 删除邮件模版
|
||||
export const deleteMailTemplateApi = async (id: number) => {
|
||||
return await request.delete({ url: '/system/mail-template/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 发送邮件
|
||||
export const sendMailApi = (data: MailSendReqVO) => {
|
||||
return request.post({ url: '/system/mail-template/send-mail', data })
|
||||
}
|
||||
54
src/api/system/menu/index.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface MenuVO {
|
||||
id: number
|
||||
name: string
|
||||
permission: string
|
||||
type: number
|
||||
sort: number
|
||||
parentId: number
|
||||
path: string
|
||||
icon: string
|
||||
component: string
|
||||
componentName?: string
|
||||
status: number
|
||||
visible: boolean
|
||||
keepAlive: boolean
|
||||
alwaysShow?: boolean
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface MenuPageReqVO {
|
||||
name?: string
|
||||
status?: number
|
||||
}
|
||||
|
||||
// 查询菜单(精简)列表
|
||||
export const listSimpleMenusApi = () => {
|
||||
return request.get({ url: '/system/menu/list-all-simple' })
|
||||
}
|
||||
|
||||
// 查询菜单列表
|
||||
export const getMenuListApi = (params: MenuPageReqVO) => {
|
||||
return request.get({ url: '/system/menu/list', params })
|
||||
}
|
||||
|
||||
// 获取菜单详情
|
||||
export const getMenuApi = (id: number) => {
|
||||
return request.get({ url: '/system/menu/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增菜单
|
||||
export const createMenuApi = (data: MenuVO) => {
|
||||
return request.post({ url: '/system/menu/create', data })
|
||||
}
|
||||
|
||||
// 修改菜单
|
||||
export const updateMenuApi = (data: MenuVO) => {
|
||||
return request.put({ url: '/system/menu/update', data })
|
||||
}
|
||||
|
||||
// 删除菜单
|
||||
export const deleteMenuApi = (id: number) => {
|
||||
return request.delete({ url: '/system/menu/delete?id=' + id })
|
||||
}
|
||||
42
src/api/system/notice/index.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface NoticeVO {
|
||||
id: number
|
||||
title: string
|
||||
type: number
|
||||
content: string
|
||||
status: number
|
||||
remark: string
|
||||
creator: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface NoticePageReqVO extends PageParam {
|
||||
title?: string
|
||||
status?: number
|
||||
}
|
||||
|
||||
// 查询公告列表
|
||||
export const getNoticePageApi = (params: NoticePageReqVO) => {
|
||||
return request.get({ url: '/system/notice/page', params })
|
||||
}
|
||||
|
||||
// 查询公告详情
|
||||
export const getNoticeApi = (id: number) => {
|
||||
return request.get({ url: '/system/notice/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增公告
|
||||
export const createNoticeApi = (data: NoticeVO) => {
|
||||
return request.post({ url: '/system/notice/create', data })
|
||||
}
|
||||
|
||||
// 修改公告
|
||||
export const updateNoticeApi = (data: NoticeVO) => {
|
||||
return request.put({ url: '/system/notice/update', data })
|
||||
}
|
||||
|
||||
// 删除公告
|
||||
export const deleteNoticeApi = (id: number) => {
|
||||
return request.delete({ url: '/system/notice/delete?id=' + id })
|
||||
}
|
||||
66
src/api/system/notify/message/index.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
import request from '@/config/axios'
|
||||
import qs from 'qs'
|
||||
|
||||
export interface NotifyMessageVO {
|
||||
id: number
|
||||
userId: number
|
||||
userType: number
|
||||
templateId: number
|
||||
templateCode: string
|
||||
templateNickname: string
|
||||
templateContent: string
|
||||
templateType: number
|
||||
templateParams: string
|
||||
readStatus: boolean
|
||||
readTime: Date
|
||||
}
|
||||
|
||||
export interface NotifyMessagePageReqVO extends PageParam {
|
||||
userId?: number
|
||||
userType?: number
|
||||
templateCode?: string
|
||||
templateType?: number
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
export interface NotifyMessageMyPageReqVO extends PageParam {
|
||||
readStatus?: boolean
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
// 查询站内信消息列表
|
||||
export const getNotifyMessagePageApi = async (params: NotifyMessagePageReqVO) => {
|
||||
return await request.get({ url: '/system/notify-message/page', params })
|
||||
}
|
||||
|
||||
// 查询站内信消息详情
|
||||
export const getNotifyMessageApi = async (id: number) => {
|
||||
return await request.get({ url: '/system/notify-message/get?id=' + id })
|
||||
}
|
||||
|
||||
// 获得我的站内信分页
|
||||
export const getMyNotifyMessagePage = async (params: NotifyMessageMyPageReqVO) => {
|
||||
return await request.get({ url: '/system/notify-message/my-page', params })
|
||||
}
|
||||
|
||||
// 批量标记已读
|
||||
export const updateNotifyMessageRead = async (ids) => {
|
||||
return await request.put({
|
||||
url: '/system/notify-message/update-read?' + qs.stringify({ ids: ids }, { indices: false })
|
||||
})
|
||||
}
|
||||
|
||||
// 标记所有站内信为已读
|
||||
export const updateAllNotifyMessageRead = async () => {
|
||||
return await request.put({ url: '/system/notify-message/update-all-read' })
|
||||
}
|
||||
|
||||
// 获取当前用户的最新站内信列表
|
||||
export const getUnreadNotifyMessageListApi = async () => {
|
||||
return await request.get({ url: '/system/notify-message/get-unread-list' })
|
||||
}
|
||||
|
||||
// 获得当前用户的未读站内信数量
|
||||
export const getUnreadNotifyMessageCountApi = async () => {
|
||||
return await request.get({ url: '/system/notify-message/get-unread-count' })
|
||||
}
|
||||
55
src/api/system/notify/template/index.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface NotifyTemplateVO {
|
||||
id: number
|
||||
name: string
|
||||
code: string
|
||||
content: string
|
||||
type: number
|
||||
params: string
|
||||
status: number
|
||||
remark: string
|
||||
}
|
||||
|
||||
export interface NotifyTemplatePageReqVO extends PageParam {
|
||||
name?: string
|
||||
code?: string
|
||||
status?: number
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
export interface NotifySendReqVO {
|
||||
userId: number
|
||||
templateCode: string
|
||||
templateParams: Map<String, Object>
|
||||
}
|
||||
|
||||
// 查询站内信模板列表
|
||||
export const getNotifyTemplatePageApi = async (params: NotifyTemplatePageReqVO) => {
|
||||
return await request.get({ url: '/system/notify-template/page', params })
|
||||
}
|
||||
|
||||
// 查询站内信模板详情
|
||||
export const getNotifyTemplateApi = async (id: number) => {
|
||||
return await request.get({ url: '/system/notify-template/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增站内信模板
|
||||
export const createNotifyTemplateApi = async (data: NotifyTemplateVO) => {
|
||||
return await request.post({ url: '/system/notify-template/create', data })
|
||||
}
|
||||
|
||||
// 修改站内信模板
|
||||
export const updateNotifyTemplateApi = async (data: NotifyTemplateVO) => {
|
||||
return await request.put({ url: '/system/notify-template/update', data })
|
||||
}
|
||||
|
||||
// 删除站内信模板
|
||||
export const deleteNotifyTemplateApi = async (id: number) => {
|
||||
return await request.delete({ url: '/system/notify-template/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 发送站内信
|
||||
export const sendNotifyApi = (data: NotifySendReqVO) => {
|
||||
return request.post({ url: '/system/notify-template/send-notify', data })
|
||||
}
|
||||
51
src/api/system/oauth2/client.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface OAuth2ClientVO {
|
||||
id: number
|
||||
clientId: string
|
||||
secret: string
|
||||
name: string
|
||||
logo: string
|
||||
description: string
|
||||
status: number
|
||||
accessTokenValiditySeconds: number
|
||||
refreshTokenValiditySeconds: number
|
||||
redirectUris: string[]
|
||||
autoApprove: boolean
|
||||
authorizedGrantTypes: string[]
|
||||
scopes: string[]
|
||||
authorities: string[]
|
||||
resourceIds: string[]
|
||||
additionalInformation: string
|
||||
isAdditionalInformationJson: boolean
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface OAuth2ClientPageReqVO extends PageParam {
|
||||
name?: string
|
||||
status?: number
|
||||
}
|
||||
// 查询 OAuth2列表
|
||||
export const getOAuth2ClientPageApi = (params: OAuth2ClientPageReqVO) => {
|
||||
return request.get({ url: '/system/oauth2-client/page', params })
|
||||
}
|
||||
|
||||
// 查询 OAuth2详情
|
||||
export const getOAuth2ClientApi = (id: number) => {
|
||||
return request.get({ url: '/system/oauth2-client/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增 OAuth2
|
||||
export const createOAuth2ClientApi = (data: OAuth2ClientVO) => {
|
||||
return request.post({ url: '/system/oauth2-client/create', data })
|
||||
}
|
||||
|
||||
// 修改 OAuth2
|
||||
export const updateOAuth2ClientApi = (data: OAuth2ClientVO) => {
|
||||
return request.put({ url: '/system/oauth2-client/update', data })
|
||||
}
|
||||
|
||||
// 删除 OAuth2
|
||||
export const deleteOAuth2ClientApi = (id: number) => {
|
||||
return request.delete({ url: '/system/oauth2-client/delete?id=' + id })
|
||||
}
|
||||
28
src/api/system/oauth2/token.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface OAuth2TokenVO {
|
||||
id: number
|
||||
accessToken: string
|
||||
refreshToken: string
|
||||
userId: number
|
||||
userType: number
|
||||
clientId: string
|
||||
createTime: Date
|
||||
expiresTime: Date
|
||||
}
|
||||
|
||||
export interface OAuth2TokenPageReqVO extends PageParam {
|
||||
userId?: number
|
||||
userType?: number
|
||||
clientId?: string
|
||||
}
|
||||
|
||||
// 查询 token列表
|
||||
export const getAccessTokenPageApi = (params: OAuth2TokenPageReqVO) => {
|
||||
return request.get({ url: '/system/oauth2-token/page', params })
|
||||
}
|
||||
|
||||
// 删除 token
|
||||
export const deleteAccessTokenApi = (accessToken: number) => {
|
||||
return request.delete({ url: '/system/oauth2-token/delete?accessToken=' + accessToken })
|
||||
}
|
||||
41
src/api/system/operatelog/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export type OperateLogVO = {
|
||||
id: number
|
||||
userNickname: string
|
||||
traceId: string
|
||||
userId: number
|
||||
module: string
|
||||
name: string
|
||||
type: number
|
||||
content: string
|
||||
exts: Map<String, Object>
|
||||
requestMethod: string
|
||||
requestUrl: string
|
||||
userIp: string
|
||||
userAgent: string
|
||||
javaMethod: string
|
||||
javaMethodArgs: string
|
||||
startTime: Date
|
||||
duration: number
|
||||
resultCode: number
|
||||
resultMsg: string
|
||||
resultData: string
|
||||
}
|
||||
|
||||
export interface OperateLogPageReqVO extends PageParam {
|
||||
module?: string
|
||||
userNickname?: string
|
||||
type?: number
|
||||
success?: boolean
|
||||
startTime?: Date[]
|
||||
}
|
||||
|
||||
// 查询操作日志列表
|
||||
export const getOperateLogPageApi = (params: OperateLogPageReqVO) => {
|
||||
return request.get({ url: '/system/operate-log/page', params })
|
||||
}
|
||||
// 导出操作日志
|
||||
export const exportOperateLogApi = (params: OperateLogPageReqVO) => {
|
||||
return request.download({ url: '/system/operate-log/export', params })
|
||||
}
|
||||
42
src/api/system/permission/index.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface PermissionAssignUserRoleReqVO {
|
||||
userId: number
|
||||
roleIds: number[]
|
||||
}
|
||||
|
||||
export interface PermissionAssignRoleMenuReqVO {
|
||||
roleId: number
|
||||
menuIds: number[]
|
||||
}
|
||||
|
||||
export interface PermissionAssignRoleDataScopeReqVO {
|
||||
roleId: number
|
||||
dataScope: number
|
||||
dataScopeDeptIds: number[]
|
||||
}
|
||||
|
||||
// 查询角色拥有的菜单权限
|
||||
export const listRoleMenusApi = async (roleId: number) => {
|
||||
return await request.get({ url: '/system/permission/list-role-resources?roleId=' + roleId })
|
||||
}
|
||||
|
||||
// 赋予角色菜单权限
|
||||
export const assignRoleMenuApi = async (data: PermissionAssignRoleMenuReqVO) => {
|
||||
return await request.post({ url: '/system/permission/assign-role-menu', data })
|
||||
}
|
||||
|
||||
// 赋予角色数据权限
|
||||
export const assignRoleDataScopeApi = async (data: PermissionAssignRoleDataScopeReqVO) => {
|
||||
return await request.post({ url: '/system/permission/assign-role-data-scope', data })
|
||||
}
|
||||
|
||||
// 查询用户拥有的角色数组
|
||||
export const listUserRolesApi = async (userId: number) => {
|
||||
return await request.get({ url: '/system/permission/list-user-roles?userId=' + userId })
|
||||
}
|
||||
|
||||
// 赋予用户角色
|
||||
export const aassignUserRoleApi = async (data: PermissionAssignUserRoleReqVO) => {
|
||||
return await request.post({ url: '/system/permission/assign-user-role', data })
|
||||
}
|
||||
58
src/api/system/post/index.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface PostVO {
|
||||
id?: number
|
||||
name: string
|
||||
code: string
|
||||
sort: number
|
||||
status: number
|
||||
remark: string
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
export interface PostPageReqVO extends PageParam {
|
||||
code?: string
|
||||
name?: string
|
||||
status?: number
|
||||
}
|
||||
|
||||
export interface PostExportReqVO {
|
||||
code?: string
|
||||
name?: string
|
||||
status?: number
|
||||
}
|
||||
|
||||
// 查询岗位列表
|
||||
export const getPostPageApi = async (params: PostPageReqVO) => {
|
||||
return await request.get({ url: '/system/post/page', params })
|
||||
}
|
||||
|
||||
// 获取岗位精简信息列表
|
||||
export const listSimplePostsApi = async () => {
|
||||
return await request.get({ url: '/system/post/list-all-simple' })
|
||||
}
|
||||
|
||||
// 查询岗位详情
|
||||
export const getPostApi = async (id: number) => {
|
||||
return await request.get({ url: '/system/post/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增岗位
|
||||
export const createPostApi = async (data: PostVO) => {
|
||||
return await request.post({ url: '/system/post/create', data })
|
||||
}
|
||||
|
||||
// 修改岗位
|
||||
export const updatePostApi = async (data: PostVO) => {
|
||||
return await request.put({ url: '/system/post/update', data })
|
||||
}
|
||||
|
||||
// 删除岗位
|
||||
export const deletePostApi = async (id: number) => {
|
||||
return await request.delete({ url: '/system/post/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 导出岗位
|
||||
export const exportPostApi = async (params: PostExportReqVO) => {
|
||||
return await request.download({ url: '/system/post/export', params })
|
||||
}
|
||||
58
src/api/system/role/index.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface RoleVO {
|
||||
id: number
|
||||
name: string
|
||||
code: string
|
||||
sort: number
|
||||
status: number
|
||||
type: number
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface RolePageReqVO extends PageParam {
|
||||
name?: string
|
||||
code?: string
|
||||
status?: number
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
export interface UpdateStatusReqVO {
|
||||
id: number
|
||||
status: number
|
||||
}
|
||||
|
||||
// 查询角色列表
|
||||
export const getRolePageApi = async (params: RolePageReqVO) => {
|
||||
return await request.get({ url: '/system/role/page', params })
|
||||
}
|
||||
|
||||
// 查询角色(精简)列表
|
||||
export const listSimpleRolesApi = async () => {
|
||||
return await request.get({ url: '/system/role/list-all-simple' })
|
||||
}
|
||||
|
||||
// 查询角色详情
|
||||
export const getRoleApi = async (id: number) => {
|
||||
return await request.get({ url: '/system/role/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增角色
|
||||
export const createRoleApi = async (data: RoleVO) => {
|
||||
return await request.post({ url: '/system/role/create', data })
|
||||
}
|
||||
|
||||
// 修改角色
|
||||
export const updateRoleApi = async (data: RoleVO) => {
|
||||
return await request.put({ url: '/system/role/update', data })
|
||||
}
|
||||
|
||||
// 修改角色状态
|
||||
export const updateRoleStatusApi = async (data: UpdateStatusReqVO) => {
|
||||
return await request.put({ url: '/system/role/update-status', data })
|
||||
}
|
||||
|
||||
// 删除角色
|
||||
export const deleteRoleApi = async (id: number) => {
|
||||
return await request.delete({ url: '/system/role/delete?id=' + id })
|
||||
}
|
||||
64
src/api/system/sensitiveWord/index.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface SensitiveWordVO {
|
||||
id: number
|
||||
name: string
|
||||
status: number
|
||||
description: string
|
||||
tags: string[]
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface SensitiveWordPageReqVO extends PageParam {
|
||||
name?: string
|
||||
tag?: string
|
||||
status?: number
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
export interface SensitiveWordExportReqVO {
|
||||
name?: string
|
||||
tag?: string
|
||||
status?: number
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
// 查询敏感词列表
|
||||
export const getSensitiveWordPageApi = (params: SensitiveWordPageReqVO) => {
|
||||
return request.get({ url: '/system/sensitive-word/page', params })
|
||||
}
|
||||
|
||||
// 查询敏感词详情
|
||||
export const getSensitiveWordApi = (id: number) => {
|
||||
return request.get({ url: '/system/sensitive-word/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增敏感词
|
||||
export const createSensitiveWordApi = (data: SensitiveWordVO) => {
|
||||
return request.post({ url: '/system/sensitive-word/create', data })
|
||||
}
|
||||
|
||||
// 修改敏感词
|
||||
export const updateSensitiveWordApi = (data: SensitiveWordVO) => {
|
||||
return request.put({ url: '/system/sensitive-word/update', data })
|
||||
}
|
||||
|
||||
// 删除敏感词
|
||||
export const deleteSensitiveWordApi = (id: number) => {
|
||||
return request.delete({ url: '/system/sensitive-word/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 导出敏感词
|
||||
export const exportSensitiveWordApi = (params: SensitiveWordExportReqVO) => {
|
||||
return request.download({ url: '/system/sensitive-word/export-excel', params })
|
||||
}
|
||||
|
||||
// 获取所有敏感词的标签数组
|
||||
export const getSensitiveWordTagsApi = () => {
|
||||
return request.get({ url: '/system/sensitive-word/get-tags' })
|
||||
}
|
||||
|
||||
// 获得文本所包含的不合法的敏感词数组
|
||||
export const validateTextApi = (id: number) => {
|
||||
return request.get({ url: '/system/sensitive-word/validate-text?' + id })
|
||||
}
|
||||
50
src/api/system/sms/smsChannel/index.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface SmsChannelVO {
|
||||
id: number
|
||||
code: string
|
||||
status: number
|
||||
signature: string
|
||||
remark: string
|
||||
apiKey: string
|
||||
apiSecret: string
|
||||
callbackUrl: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface SmsChannelPageReqVO extends PageParam {
|
||||
signature?: string
|
||||
code?: string
|
||||
status?: number
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
// 查询短信渠道列表
|
||||
export const getSmsChannelPageApi = (params: SmsChannelPageReqVO) => {
|
||||
return request.get({ url: '/system/sms-channel/page', params })
|
||||
}
|
||||
|
||||
// 获得短信渠道精简列表
|
||||
export function getSimpleSmsChannels() {
|
||||
return request.get({ url: '/system/sms-channel/list-all-simple' })
|
||||
}
|
||||
|
||||
// 查询短信渠道详情
|
||||
export const getSmsChannelApi = (id: number) => {
|
||||
return request.get({ url: '/system/sms-channel/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增短信渠道
|
||||
export const createSmsChannelApi = (data: SmsChannelVO) => {
|
||||
return request.post({ url: '/system/sms-channel/create', data })
|
||||
}
|
||||
|
||||
// 修改短信渠道
|
||||
export const updateSmsChannelApi = (data: SmsChannelVO) => {
|
||||
return request.put({ url: '/system/sms-channel/update', data })
|
||||
}
|
||||
|
||||
// 删除短信渠道
|
||||
export const deleteSmsChannelApi = (id: number) => {
|
||||
return request.delete({ url: '/system/sms-channel/delete?id=' + id })
|
||||
}
|
||||
57
src/api/system/sms/smsLog/index.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface SmsLogVO {
|
||||
id: number
|
||||
channelId: number
|
||||
channelCode: string
|
||||
templateId: number
|
||||
templateCode: string
|
||||
templateType: number
|
||||
templateContent: string
|
||||
templateParams: Map<string, object>
|
||||
mobile: string
|
||||
userId: number
|
||||
userType: number
|
||||
sendStatus: number
|
||||
sendTime: Date
|
||||
sendCode: number
|
||||
sendMsg: string
|
||||
apiSendCode: string
|
||||
apiSendMsg: string
|
||||
apiRequestId: string
|
||||
apiSerialNo: string
|
||||
receiveStatus: number
|
||||
receiveTime: Date
|
||||
apiReceiveCode: string
|
||||
apiReceiveMsg: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface SmsLogPageReqVO extends PageParam {
|
||||
channelId?: number
|
||||
templateId?: number
|
||||
mobile?: string
|
||||
sendStatus?: number
|
||||
sendTime?: Date[]
|
||||
receiveStatus?: number
|
||||
receiveTime?: Date[]
|
||||
}
|
||||
export interface SmsLogExportReqVO {
|
||||
channelId?: number
|
||||
templateId?: number
|
||||
mobile?: string
|
||||
sendStatus?: number
|
||||
sendTime?: Date[]
|
||||
receiveStatus?: number
|
||||
receiveTime?: Date[]
|
||||
}
|
||||
|
||||
// 查询短信日志列表
|
||||
export const getSmsLogPageApi = (params: SmsLogPageReqVO) => {
|
||||
return request.get({ url: '/system/sms-log/page', params })
|
||||
}
|
||||
|
||||
// 导出短信日志
|
||||
export const exportSmsLogApi = (params: SmsLogExportReqVO) => {
|
||||
return request.download({ url: '/system/sms-log/export', params })
|
||||
}
|
||||
80
src/api/system/sms/smsTemplate/index.ts
Normal file
@@ -0,0 +1,80 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface SmsTemplateVO {
|
||||
id: number
|
||||
type: number
|
||||
status: number
|
||||
code: string
|
||||
name: string
|
||||
content: string
|
||||
remark: string
|
||||
apiTemplateId: string
|
||||
channelId: number
|
||||
channelCode: string
|
||||
params: string[]
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface SendSmsReqVO {
|
||||
mobile: string
|
||||
templateCode: string
|
||||
templateParams: Map<String, Object>
|
||||
}
|
||||
|
||||
export interface SmsTemplatePageReqVO {
|
||||
type?: number
|
||||
status?: number
|
||||
code?: string
|
||||
content?: string
|
||||
apiTemplateId?: string
|
||||
channelId?: number
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
export interface SmsTemplateExportReqVO {
|
||||
type?: number
|
||||
status?: number
|
||||
code?: string
|
||||
content?: string
|
||||
apiTemplateId?: string
|
||||
channelId?: number
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
// 查询短信模板列表
|
||||
export const getSmsTemplatePageApi = (params: SmsTemplatePageReqVO) => {
|
||||
return request.get({ url: '/system/sms-template/page', params })
|
||||
}
|
||||
|
||||
// 查询短信模板详情
|
||||
export const getSmsTemplateApi = (id: number) => {
|
||||
return request.get({ url: '/system/sms-template/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增短信模板
|
||||
export const createSmsTemplateApi = (data: SmsTemplateVO) => {
|
||||
return request.post({ url: '/system/sms-template/create', data })
|
||||
}
|
||||
|
||||
// 修改短信模板
|
||||
export const updateSmsTemplateApi = (data: SmsTemplateVO) => {
|
||||
return request.put({ url: '/system/sms-template/update', data })
|
||||
}
|
||||
|
||||
// 删除短信模板
|
||||
export const deleteSmsTemplateApi = (id: number) => {
|
||||
return request.delete({ url: '/system/sms-template/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 发送短信
|
||||
export const sendSmsApi = (data: SendSmsReqVO) => {
|
||||
return request.post({ url: '/system/sms-template/send-sms', data })
|
||||
}
|
||||
|
||||
// 导出短信模板
|
||||
export const exportPostApi = (params: SmsTemplateExportReqVO) => {
|
||||
return request.download({
|
||||
url: '/system/sms-template/export-excel',
|
||||
params
|
||||
})
|
||||
}
|
||||
62
src/api/system/tenant/index.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface TenantVO {
|
||||
id: number
|
||||
name: string
|
||||
contactName: string
|
||||
contactMobile: string
|
||||
status: number
|
||||
domain: string
|
||||
packageId: number
|
||||
username: string
|
||||
password: string
|
||||
expireTime: Date
|
||||
accountCount: number
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface TenantPageReqVO extends PageParam {
|
||||
name?: string
|
||||
contactName?: string
|
||||
contactMobile?: string
|
||||
status?: number
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
export interface TenantExportReqVO {
|
||||
name?: string
|
||||
contactName?: string
|
||||
contactMobile?: string
|
||||
status?: number
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
// 查询租户列表
|
||||
export const getTenantPageApi = (params: TenantPageReqVO) => {
|
||||
return request.get({ url: '/system/tenant/page', params })
|
||||
}
|
||||
|
||||
// 查询租户详情
|
||||
export const getTenantApi = (id: number) => {
|
||||
return request.get({ url: '/system/tenant/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增租户
|
||||
export const createTenantApi = (data: TenantVO) => {
|
||||
return request.post({ url: '/system/tenant/create', data })
|
||||
}
|
||||
|
||||
// 修改租户
|
||||
export const updateTenantApi = (data: TenantVO) => {
|
||||
return request.put({ url: '/system/tenant/update', data })
|
||||
}
|
||||
|
||||
// 删除租户
|
||||
export const deleteTenantApi = (id: number) => {
|
||||
return request.delete({ url: '/system/tenant/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 导出租户
|
||||
export const exportTenantApi = (params: TenantExportReqVO) => {
|
||||
return request.download({ url: '/system/tenant/export-excel', params })
|
||||
}
|
||||
49
src/api/system/tenantPackage/index.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface TenantPackageVO {
|
||||
id: number
|
||||
name: string
|
||||
status: number
|
||||
remark: string
|
||||
creator: string
|
||||
updater: string
|
||||
updateTime: string
|
||||
menuIds: number[]
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface TenantPackagePageReqVO extends PageParam {
|
||||
name?: string
|
||||
status?: number
|
||||
remark?: string
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
// 查询租户套餐列表
|
||||
export const getTenantPackageTypePageApi = (params: TenantPackagePageReqVO) => {
|
||||
return request.get({ url: '/system/tenant-package/page', params })
|
||||
}
|
||||
|
||||
// 获得租户
|
||||
export const getTenantPackageApi = (id: number) => {
|
||||
return request.get({ url: '/system/tenant-package/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增租户套餐
|
||||
export const createTenantPackageTypeApi = (data: TenantPackageVO) => {
|
||||
return request.post({ url: '/system/tenant-package/create', data })
|
||||
}
|
||||
|
||||
// 修改租户套餐
|
||||
export const updateTenantPackageTypeApi = (data: TenantPackageVO) => {
|
||||
return request.put({ url: '/system/tenant-package/update', data })
|
||||
}
|
||||
|
||||
// 删除租户套餐
|
||||
export const deleteTenantPackageTypeApi = (id: number) => {
|
||||
return request.delete({ url: '/system/tenant-package/delete?id=' + id })
|
||||
}
|
||||
// 获取租户套餐精简信息列表
|
||||
export const getTenantPackageList = () => {
|
||||
return request.get({ url: '/system/tenant-package/get-simple-list' })
|
||||
}
|
||||
91
src/api/system/user/index.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface UserVO {
|
||||
id: number
|
||||
username: string
|
||||
nickname: string
|
||||
deptId: number
|
||||
postIds: string[]
|
||||
email: string
|
||||
mobile: string
|
||||
sex: number
|
||||
avatar: string
|
||||
loginIp: string
|
||||
status: number
|
||||
remark: string
|
||||
loginDate: Date
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface UserPageReqVO extends PageParam {
|
||||
deptId?: number
|
||||
username?: string
|
||||
mobile?: string
|
||||
status?: number
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
export interface UserExportReqVO {
|
||||
code?: string
|
||||
name?: string
|
||||
status?: number
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
// 查询用户管理列表
|
||||
export const getUserPageApi = (params: UserPageReqVO) => {
|
||||
return request.get({ url: '/system/user/page', params })
|
||||
}
|
||||
|
||||
// 查询用户详情
|
||||
export const getUserApi = (id: number) => {
|
||||
return request.get({ url: '/system/user/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增用户
|
||||
export const createUserApi = (data: UserVO) => {
|
||||
return request.post({ url: '/system/user/create', data })
|
||||
}
|
||||
|
||||
// 修改用户
|
||||
export const updateUserApi = (data: UserVO) => {
|
||||
return request.put({ url: '/system/user/update', data })
|
||||
}
|
||||
|
||||
// 删除用户
|
||||
export const deleteUserApi = (id: number) => {
|
||||
return request.delete({ url: '/system/user/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 导出用户
|
||||
export const exportUserApi = (params: UserExportReqVO) => {
|
||||
return request.download({ url: '/system/user/export', params })
|
||||
}
|
||||
|
||||
// 下载用户导入模板
|
||||
export const importUserTemplateApi = () => {
|
||||
return request.download({ url: '/system/user/get-import-template' })
|
||||
}
|
||||
|
||||
// 用户密码重置
|
||||
export const resetUserPwdApi = (id: number, password: string) => {
|
||||
const data = {
|
||||
id,
|
||||
password
|
||||
}
|
||||
return request.put({ url: '/system/user/update-password', data: data })
|
||||
}
|
||||
|
||||
// 用户状态修改
|
||||
export const updateUserStatusApi = (id: number, status: number) => {
|
||||
const data = {
|
||||
id,
|
||||
status
|
||||
}
|
||||
return request.put({ url: '/system/user/update-status', data: data })
|
||||
}
|
||||
|
||||
// 获取用户精简信息列表
|
||||
export const getListSimpleUsersApi = () => {
|
||||
return request.get({ url: '/system/user/list-all-simple' })
|
||||
}
|
||||
77
src/api/system/user/profile.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface ProfileDept {
|
||||
id: number
|
||||
name: string
|
||||
}
|
||||
export interface ProfileRole {
|
||||
id: number
|
||||
name: string
|
||||
}
|
||||
export interface ProfilePost {
|
||||
id: number
|
||||
name: string
|
||||
}
|
||||
export interface SocialUser {
|
||||
id: number
|
||||
type: number
|
||||
openid: string
|
||||
token: string
|
||||
rawTokenInfo: string
|
||||
nickname: string
|
||||
avatar: string
|
||||
rawUserInfo: string
|
||||
code: string
|
||||
state: string
|
||||
}
|
||||
export interface ProfileVO {
|
||||
id: number
|
||||
username: string
|
||||
nickname: string
|
||||
dept: ProfileDept
|
||||
roles: ProfileRole[]
|
||||
posts: ProfilePost[]
|
||||
socialUsers: SocialUser[]
|
||||
email: string
|
||||
mobile: string
|
||||
sex: number
|
||||
avatar: string
|
||||
status: number
|
||||
remark: string
|
||||
loginIp: string
|
||||
loginDate: Date
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export interface UserProfileUpdateReqVO {
|
||||
nickname: string
|
||||
email: string
|
||||
mobile: string
|
||||
sex: number
|
||||
}
|
||||
|
||||
// 查询用户个人信息
|
||||
export const getUserProfileApi = () => {
|
||||
return request.get({ url: '/system/user/profile/get' })
|
||||
}
|
||||
|
||||
// 修改用户个人信息
|
||||
export const updateUserProfileApi = (data: UserProfileUpdateReqVO) => {
|
||||
return request.put({ url: '/system/user/profile/update', data })
|
||||
}
|
||||
|
||||
// 用户密码重置
|
||||
export const updateUserPwdApi = (oldPassword: string, newPassword: string) => {
|
||||
return request.put({
|
||||
url: '/system/user/profile/update-password',
|
||||
data: {
|
||||
oldPassword: oldPassword,
|
||||
newPassword: newPassword
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 用户头像上传
|
||||
export const uploadAvatarApi = (data) => {
|
||||
return request.upload({ url: '/system/user/profile/update-avatar', data: data })
|
||||
}
|
||||
31
src/api/system/user/socialUser.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 社交绑定,使用 code 授权码
|
||||
export const socialBind = (type, code, state) => {
|
||||
return request.post({
|
||||
url: '/system/social-user/bind',
|
||||
data: {
|
||||
type,
|
||||
code,
|
||||
state
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 取消社交绑定
|
||||
export const socialUnbind = (type, openid) => {
|
||||
return request.delete({
|
||||
url: '/system/social-user/unbind',
|
||||
data: {
|
||||
type,
|
||||
openid
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 社交授权的跳转
|
||||
export const socialAuthRedirect = (type, redirectUri) => {
|
||||
return request.get({
|
||||
url: '/system/auth/social-auth-redirect?type=' + type + '&redirectUri=' + redirectUri
|
||||
})
|
||||
}
|
||||
BIN
src/assets/imgs/avatar.gif
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
src/assets/imgs/avatar.jpg
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
src/assets/imgs/logo.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
1
src/assets/svgs/403.svg
Normal file
|
After Width: | Height: | Size: 13 KiB |
1
src/assets/svgs/404.svg
Normal file
|
After Width: | Height: | Size: 13 KiB |
1
src/assets/svgs/500.svg
Normal file
|
After Width: | Height: | Size: 19 KiB |
1
src/assets/svgs/icon.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M115.147.062a13 13 0 014.94.945c1.55.63 2.907 1.526 4.069 2.688a13.148 13.148 0 012.761 4.069c.678 1.55 1.017 3.245 1.017 5.086v102.3c0 3.681-1.187 6.733-3.56 9.155-2.373 2.422-5.352 3.633-8.937 3.633H12.992c-3.875 0-7-1.26-9.373-3.779-2.373-2.518-3.56-5.667-3.56-9.445V12.704c0-3.39 1.163-6.345 3.488-8.863C5.872 1.32 8.972.062 12.847.062h102.3zM81.434 109.047c1.744 0 3.003-.412 3.778-1.235.775-.824 1.163-1.914 1.163-3.27 0-1.26-.388-2.325-1.163-3.197-.775-.872-2.034-1.307-3.778-1.307H72.57c.097-.194.145-.485.145-.872V27.09h9.01c1.743 0 2.954-.436 3.633-1.308.678-.872 1.017-1.938 1.017-3.197 0-1.26-.34-2.325-1.017-3.197-.679-.872-1.89-1.308-3.633-1.308H46.268c-1.743 0-2.954.436-3.632 1.308-.678.872-1.018 1.938-1.018 3.197 0 1.26.34 2.325 1.018 3.197.678.872 1.889 1.308 3.632 1.308h8.138v72.075c0 .193.024.339.073.436.048.096.072.242.072.436H46.56c-1.744 0-3.003.435-3.778 1.307-.775.872-1.163 1.938-1.163 3.197 0 1.356.388 2.446 1.163 3.27.775.823 2.034 1.235 3.778 1.235h34.875z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
1
src/assets/svgs/login-bg.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="5760" height="3040"><image width="5760" height="3040" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAFoAAAAvgAQMAAAC1QKagAAAABGdBTUEAALGPC/xhBQAAACBjSFJN AAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABlBMVEUsNEr///91v/yPAAAA AWJLR0QB/wIt3gAAAAd0SU1FB+YBBQYyN1c3BnEAAAhjSURBVHja7cExAQAAAMKg9U9tDB+gAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAACAtwFzzwABY3VrRQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wMS0wNVQwNjo1 MDo1MyswMDowMCfNlVoAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDEtMDVUMDY6NTA6NTQrMDA6 MDCTNxNoAAAAAElFTkSuQmCC"/></svg>
|
||||
|
After Width: | Height: | Size: 3.3 KiB |
1
src/assets/svgs/login-box-bg.svg
Normal file
|
After Width: | Height: | Size: 33 KiB |
1
src/assets/svgs/message.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M0 20.967v59.59c0 11.59 8.537 20.966 19.075 20.966h28.613l1 26.477L76.8 101.523h32.125c10.538 0 19.075-9.377 19.075-20.966v-59.59C128 9.377 119.463 0 108.925 0h-89.85C8.538 0 0 9.377 0 20.967zm82.325 33.1c0-5.524 4.013-9.935 9.037-9.935 5.026 0 9.038 4.41 9.038 9.934 0 5.524-4.025 9.934-9.038 9.934-5.024 0-9.037-4.41-9.037-9.934zm-27.613 0c0-5.524 4.013-9.935 9.038-9.935s9.037 4.41 9.037 9.934c0 5.524-4.025 9.934-9.037 9.934-5.025 0-9.038-4.41-9.038-9.934zm-27.1 0c0-5.524 4.013-9.935 9.038-9.935s9.038 4.41 9.038 9.934c0 5.524-4.026 9.934-9.05 9.934-5.013 0-9.025-4.41-9.025-9.934z"/></svg>
|
||||
|
After Width: | Height: | Size: 669 B |
1
src/assets/svgs/money.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M54.122 127.892v-28.68H7.513V87.274h46.609v-12.4H7.513v-12.86h38.003L.099 0h22.6l32.556 45.07c3.617 5.144 6.44 9.611 8.487 13.385 1.788-3.05 4.89-7.779 9.301-14.186L103.93 0h24.01L82.385 62.013h38.34v12.862h-46.41v12.4h46.41v11.937h-46.41v28.68H54.123z"/></svg>
|
||||
|
After Width: | Height: | Size: 335 B |
1
src/assets/svgs/peoples.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M95.648 118.762c0 5.035-3.563 9.121-7.979 9.121H7.98c-4.416 0-7.979-4.086-7.979-9.121C0 100.519 15.408 83.47 31.152 76.75c-9.099-6.43-15.216-17.863-15.216-30.987v-9.128c0-20.16 14.293-36.518 31.893-36.518s31.894 16.358 31.894 36.518v9.122c0 13.137-6.123 24.556-15.216 30.993 15.738 6.726 31.141 23.769 31.141 42.012z"/><path d="M106.032 118.252h15.867c3.376 0 6.101-3.125 6.101-6.972 0-13.957-11.787-26.984-23.819-32.123 6.955-4.919 11.638-13.66 11.638-23.704v-6.985c0-15.416-10.928-27.926-24.39-27.926-1.674 0-3.306.193-4.89.561 1.936 4.713 3.018 9.974 3.018 15.526v9.121c0 13.137-3.056 23.111-11.066 30.993 14.842 4.41 27.312 23.42 27.541 41.509z"/></svg>
|
||||
|
After Width: | Height: | Size: 731 B |
1
src/assets/svgs/shopping.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M42.913 101.36c1.642 0 3.198.332 4.667.996a12.28 12.28 0 013.89 2.772c1.123 1.184 1.987 2.582 2.592 4.193.605 1.612.908 3.318.908 5.118 0 1.8-.303 3.507-.908 5.118-.605 1.611-1.469 3.01-2.593 4.194a13.3 13.3 0 01-3.889 2.843 10.582 10.582 0 01-4.667 1.066c-1.729 0-3.306-.355-4.732-1.066a13.604 13.604 0 01-3.825-2.843c-1.123-1.185-1.988-2.583-2.593-4.194a14.437 14.437 0 01-.907-5.118c0-1.8.302-3.506.907-5.118.605-1.61 1.47-3.009 2.593-4.193a12.515 12.515 0 013.825-2.772c1.426-.664 3.003-.996 4.732-.996zm53.932.285c1.643 0 3.22.331 4.733.995a11.386 11.386 0 013.889 2.772c1.08 1.185 1.945 2.583 2.593 4.194.648 1.61.972 3.317.972 5.118 0 1.8-.324 3.506-.972 5.117-.648 1.611-1.513 3.01-2.593 4.194a12.253 12.253 0 01-3.89 2.843 11 11 0 01-4.732 1.066 10.58 10.58 0 01-4.667-1.066 12.478 12.478 0 01-3.824-2.843c-1.08-1.185-1.945-2.583-2.593-4.194a13.581 13.581 0 01-.973-5.117c0-1.801.325-3.507.973-5.118.648-1.611 1.512-3.01 2.593-4.194a11.559 11.559 0 013.824-2.772 11.212 11.212 0 014.667-.995zm21.781-80.747c2.42 0 4.3.355 5.64 1.066 1.34.71 2.29 1.587 2.852 2.63a6.427 6.427 0 01.778 3.34c-.044 1.185-.195 2.204-.454 3.057-.26.853-.8 2.606-1.62 5.26a589.268 589.268 0 01-2.788 8.743 1236.373 1236.373 0 00-3.047 9.453c-.994 3.128-1.75 5.592-2.269 7.393-1.123 3.79-2.55 6.42-4.278 7.89-1.728 1.469-3.846 2.203-6.352 2.203H39.023l1.945 12.795h65.342c4.148 0 6.223 1.943 6.223 5.828 0 1.896-.41 3.53-1.232 4.905-.821 1.374-2.442 2.061-4.862 2.061H38.505c-1.729 0-3.176-.426-4.343-1.28-1.167-.852-2.14-1.966-2.917-3.34a21.277 21.277 0 01-1.88-4.478 44.128 44.128 0 01-1.102-4.55c-.087-.568-.324-1.942-.713-4.122-.39-2.18-.865-4.904-1.426-8.174l-1.88-10.947c-.692-4.027-1.383-8.079-2.075-12.154-1.642-9.572-3.5-20.234-5.574-31.986H6.87c-1.296 0-2.377-.356-3.24-1.067a9.024 9.024 0 01-2.14-2.558 10.416 10.416 0 01-1.167-3.2C.108 8.53 0 7.488 0 6.54c0-1.896.583-3.46 1.75-4.69C2.917.615 4.494 0 6.482 0h13.095c1.728 0 3.111.284 4.148.853 1.037.569 1.858 1.28 2.463 2.132a8.548 8.548 0 011.297 2.701c.26.948.475 1.754.648 2.417.173.758.346 1.825.519 3.199.173 1.374.345 2.772.518 4.193.26 1.706.519 3.507.778 5.403h88.678z"/></svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
3
src/components/Backtop/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import Backtop from './src/Backtop.vue'
|
||||
|
||||
export { Backtop }
|
||||
15
src/components/Backtop/src/Backtop.vue
Normal file
@@ -0,0 +1,15 @@
|
||||
<script setup lang="ts">
|
||||
import { ElBacktop } from 'element-plus'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
|
||||
const { getPrefixCls, variables } = useDesign()
|
||||
|
||||
const prefixCls = getPrefixCls('backtop')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ElBacktop
|
||||
:class="`${prefixCls}-backtop`"
|
||||
:target="`.${variables.namespace}-layout-content-scrollbar .${variables.elNamespace}-scrollbar__wrap`"
|
||||
/>
|
||||
</template>
|
||||
3
src/components/ConfigGlobal/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import ConfigGlobal from './src/ConfigGlobal.vue'
|
||||
|
||||
export { ConfigGlobal }
|
||||
61
src/components/ConfigGlobal/src/ConfigGlobal.vue
Normal file
@@ -0,0 +1,61 @@
|
||||
<script setup lang="ts">
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { useLocaleStore } from '@/store/modules/locale'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { setCssVar } from '@/utils'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
import { ElementPlusSize } from '@/types/elementPlus'
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
|
||||
const { variables } = useDesign()
|
||||
|
||||
const appStore = useAppStore()
|
||||
|
||||
const props = defineProps({
|
||||
size: propTypes.oneOf<ElementPlusSize>(['default', 'small', 'large']).def('default')
|
||||
})
|
||||
|
||||
provide('configGlobal', props)
|
||||
|
||||
// 初始化所有主题色
|
||||
onMounted(() => {
|
||||
appStore.setCssVarTheme()
|
||||
})
|
||||
|
||||
const { width } = useWindowSize()
|
||||
|
||||
// 监听窗口变化
|
||||
watch(
|
||||
() => width.value,
|
||||
(width: number) => {
|
||||
if (width < 768) {
|
||||
!appStore.getMobile ? appStore.setMobile(true) : undefined
|
||||
setCssVar('--left-menu-min-width', '0')
|
||||
appStore.setCollapse(true)
|
||||
appStore.getLayout !== 'classic' ? appStore.setLayout('classic') : undefined
|
||||
} else {
|
||||
appStore.getMobile ? appStore.setMobile(false) : undefined
|
||||
setCssVar('--left-menu-min-width', '64px')
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
|
||||
// 多语言相关
|
||||
const localeStore = useLocaleStore()
|
||||
|
||||
const currentLocale = computed(() => localeStore.currentLocale)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ElConfigProvider
|
||||
:namespace="variables.elNamespace"
|
||||
:locale="currentLocale.elLocale"
|
||||
:message="{ max: 1 }"
|
||||
:size="size"
|
||||
>
|
||||
<slot></slot>
|
||||
</ElConfigProvider>
|
||||
</template>
|
||||
3
src/components/ContentDetailWrap/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import ContentDetailWrap from './src/ContentDetailWrap.vue'
|
||||
|
||||
export { ContentDetailWrap }
|
||||
54
src/components/ContentDetailWrap/src/ContentDetailWrap.vue
Normal file
@@ -0,0 +1,54 @@
|
||||
<script setup lang="ts">
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const { getPrefixCls } = useDesign()
|
||||
|
||||
const prefixCls = getPrefixCls('content-detail-wrap')
|
||||
|
||||
defineProps({
|
||||
title: propTypes.string.def(''),
|
||||
message: propTypes.string.def('')
|
||||
})
|
||||
const emit = defineEmits(['back'])
|
||||
const offset = ref(85)
|
||||
const contentDetailWrap = ref()
|
||||
onMounted(() => {
|
||||
offset.value = contentDetailWrap.value.getBoundingClientRect().top
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div :class="[`${prefixCls}-container`]" ref="contentDetailWrap">
|
||||
<Sticky :offset="offset">
|
||||
<div
|
||||
:class="[
|
||||
`${prefixCls}-header`,
|
||||
'flex border-bottom-1 h-50px items-center text-center pr-10px'
|
||||
]"
|
||||
>
|
||||
<div :class="[`${prefixCls}-header__back`, 'flex pl-10px pr-10px ']">
|
||||
<ElButton @click="emit('back')">
|
||||
<Icon icon="ep:arrow-left" class="mr-5px" />
|
||||
{{ t('common.back') }}
|
||||
</ElButton>
|
||||
</div>
|
||||
<div :class="[`${prefixCls}-header__title`, 'flex flex-1 justify-center']">
|
||||
<slot name="title">
|
||||
<label class="text-16px font-700">{{ title }}</label>
|
||||
</slot>
|
||||
</div>
|
||||
<div :class="[`${prefixCls}-header__right`, 'flex pl-10px pr-10px']">
|
||||
<slot name="right"></slot>
|
||||
</div>
|
||||
</div>
|
||||
</Sticky>
|
||||
<div style="padding: var(--app-content-padding)">
|
||||
<ElCard :class="[`${prefixCls}-body`, 'mb-20px']" shadow="never">
|
||||
<div> <slot></slot> </div>
|
||||
</ElCard>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
3
src/components/ContentWrap/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import ContentWrap from './src/ContentWrap.vue'
|
||||
|
||||
export { ContentWrap }
|
||||
32
src/components/ContentWrap/src/ContentWrap.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<script setup lang="ts">
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
|
||||
const { getPrefixCls } = useDesign()
|
||||
|
||||
const prefixCls = getPrefixCls('content-wrap')
|
||||
|
||||
defineProps({
|
||||
title: propTypes.string.def(''),
|
||||
message: propTypes.string.def('')
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ElCard :class="[prefixCls, 'mb-20px']" shadow="never">
|
||||
<template v-if="title" #header>
|
||||
<div class="flex items-center">
|
||||
<span class="text-16px font-700">{{ title }}</span>
|
||||
<ElTooltip v-if="message" effect="dark" placement="right">
|
||||
<template #content>
|
||||
<div class="max-w-200px">{{ message }}</div>
|
||||
</template>
|
||||
<Icon class="ml-5px" icon="ep:question-filled" :size="14" />
|
||||
</ElTooltip>
|
||||
</div>
|
||||
</template>
|
||||
<div>
|
||||
<slot></slot>
|
||||
</div>
|
||||
</ElCard>
|
||||
</template>
|
||||
3
src/components/CountTo/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import CountTo from './src/CountTo.vue'
|
||||
|
||||
export { CountTo }
|
||||
180
src/components/CountTo/src/CountTo.vue
Normal file
@@ -0,0 +1,180 @@
|
||||
<script setup lang="ts">
|
||||
import { PropType } from 'vue'
|
||||
import { isNumber } from '@/utils/is'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
|
||||
const { getPrefixCls } = useDesign()
|
||||
|
||||
const prefixCls = getPrefixCls('count-to')
|
||||
|
||||
const props = defineProps({
|
||||
startVal: propTypes.number.def(0),
|
||||
endVal: propTypes.number.def(2021),
|
||||
duration: propTypes.number.def(3000),
|
||||
autoplay: propTypes.bool.def(true),
|
||||
decimals: propTypes.number.validate((value: number) => value >= 0).def(0),
|
||||
decimal: propTypes.string.def('.'),
|
||||
separator: propTypes.string.def(','),
|
||||
prefix: propTypes.string.def(''),
|
||||
suffix: propTypes.string.def(''),
|
||||
useEasing: propTypes.bool.def(true),
|
||||
easingFn: {
|
||||
type: Function as PropType<(t: number, b: number, c: number, d: number) => number>,
|
||||
default(t: number, b: number, c: number, d: number) {
|
||||
return (c * (-Math.pow(2, (-10 * t) / d) + 1) * 1024) / 1023 + b
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['mounted', 'callback'])
|
||||
|
||||
const formatNumber = (num: number | string) => {
|
||||
const { decimals, decimal, separator, suffix, prefix } = props
|
||||
num = Number(num).toFixed(decimals)
|
||||
num += ''
|
||||
const x = num.split('.')
|
||||
let x1 = x[0]
|
||||
const x2 = x.length > 1 ? decimal + x[1] : ''
|
||||
const rgx = /(\d+)(\d{3})/
|
||||
if (separator && !isNumber(separator)) {
|
||||
while (rgx.test(x1)) {
|
||||
x1 = x1.replace(rgx, '$1' + separator + '$2')
|
||||
}
|
||||
}
|
||||
return prefix + x1 + x2 + suffix
|
||||
}
|
||||
|
||||
const state = reactive<{
|
||||
localStartVal: number
|
||||
printVal: number | null
|
||||
displayValue: string
|
||||
paused: boolean
|
||||
localDuration: number | null
|
||||
startTime: number | null
|
||||
timestamp: number | null
|
||||
rAF: any
|
||||
remaining: number | null
|
||||
}>({
|
||||
localStartVal: props.startVal,
|
||||
displayValue: formatNumber(props.startVal),
|
||||
printVal: null,
|
||||
paused: false,
|
||||
localDuration: props.duration,
|
||||
startTime: null,
|
||||
timestamp: null,
|
||||
remaining: null,
|
||||
rAF: null
|
||||
})
|
||||
|
||||
const displayValue = toRef(state, 'displayValue')
|
||||
|
||||
onMounted(() => {
|
||||
if (props.autoplay) {
|
||||
start()
|
||||
}
|
||||
emit('mounted')
|
||||
})
|
||||
|
||||
const getCountDown = computed(() => {
|
||||
return props.startVal > props.endVal
|
||||
})
|
||||
|
||||
watch([() => props.startVal, () => props.endVal], () => {
|
||||
if (props.autoplay) {
|
||||
start()
|
||||
}
|
||||
})
|
||||
|
||||
const start = () => {
|
||||
const { startVal, duration } = props
|
||||
state.localStartVal = startVal
|
||||
state.startTime = null
|
||||
state.localDuration = duration
|
||||
state.paused = false
|
||||
state.rAF = requestAnimationFrame(count)
|
||||
}
|
||||
|
||||
const pauseResume = () => {
|
||||
if (state.paused) {
|
||||
resume()
|
||||
state.paused = false
|
||||
} else {
|
||||
pause()
|
||||
state.paused = true
|
||||
}
|
||||
}
|
||||
|
||||
const pause = () => {
|
||||
cancelAnimationFrame(state.rAF)
|
||||
}
|
||||
|
||||
const resume = () => {
|
||||
state.startTime = null
|
||||
state.localDuration = +(state.remaining as number)
|
||||
state.localStartVal = +(state.printVal as number)
|
||||
requestAnimationFrame(count)
|
||||
}
|
||||
|
||||
const reset = () => {
|
||||
state.startTime = null
|
||||
cancelAnimationFrame(state.rAF)
|
||||
state.displayValue = formatNumber(props.startVal)
|
||||
}
|
||||
|
||||
const count = (timestamp: number) => {
|
||||
const { useEasing, easingFn, endVal } = props
|
||||
if (!state.startTime) state.startTime = timestamp
|
||||
state.timestamp = timestamp
|
||||
const progress = timestamp - state.startTime
|
||||
state.remaining = (state.localDuration as number) - progress
|
||||
if (useEasing) {
|
||||
if (unref(getCountDown)) {
|
||||
state.printVal =
|
||||
state.localStartVal -
|
||||
easingFn(progress, 0, state.localStartVal - endVal, state.localDuration as number)
|
||||
} else {
|
||||
state.printVal = easingFn(
|
||||
progress,
|
||||
state.localStartVal,
|
||||
endVal - state.localStartVal,
|
||||
state.localDuration as number
|
||||
)
|
||||
}
|
||||
} else {
|
||||
if (unref(getCountDown)) {
|
||||
state.printVal =
|
||||
state.localStartVal -
|
||||
(state.localStartVal - endVal) * (progress / (state.localDuration as number))
|
||||
} else {
|
||||
state.printVal =
|
||||
state.localStartVal +
|
||||
(endVal - state.localStartVal) * (progress / (state.localDuration as number))
|
||||
}
|
||||
}
|
||||
if (unref(getCountDown)) {
|
||||
state.printVal = state.printVal < endVal ? endVal : state.printVal
|
||||
} else {
|
||||
state.printVal = state.printVal > endVal ? endVal : state.printVal
|
||||
}
|
||||
state.displayValue = formatNumber(state.printVal!)
|
||||
if (progress < (state.localDuration as number)) {
|
||||
state.rAF = requestAnimationFrame(count)
|
||||
} else {
|
||||
emit('callback')
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
pauseResume,
|
||||
reset,
|
||||
start,
|
||||
pause
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span :class="prefixCls">
|
||||
{{ displayValue }}
|
||||
</span>
|
||||
</template>
|
||||
2
src/components/Crontab/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
import Crontab from './src/Crontab.vue'
|
||||
export { Crontab }
|
||||
998
src/components/Crontab/src/Crontab.vue
Normal file
@@ -0,0 +1,998 @@
|
||||
<script setup lang="ts">
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { PropType } from 'vue'
|
||||
interface shortcutsType {
|
||||
text: string
|
||||
value: string
|
||||
}
|
||||
const props = defineProps({
|
||||
modelValue: { type: String, default: '* * * * * ?' },
|
||||
shortcuts: { type: Array as PropType<shortcutsType[]>, default: () => [] }
|
||||
})
|
||||
const defaultValue = ref('')
|
||||
const dialogVisible = ref(false)
|
||||
const getYear = () => {
|
||||
let v: number[] = []
|
||||
let y = new Date().getFullYear()
|
||||
for (let i = 0; i < 11; i++) {
|
||||
v.push(y + i)
|
||||
}
|
||||
return v
|
||||
}
|
||||
const cronValue = reactive({
|
||||
second: {
|
||||
type: '0',
|
||||
range: {
|
||||
start: 1,
|
||||
end: 2
|
||||
},
|
||||
loop: {
|
||||
start: 0,
|
||||
end: 1
|
||||
},
|
||||
appoint: [] as string[]
|
||||
},
|
||||
minute: {
|
||||
type: '0',
|
||||
range: {
|
||||
start: 1,
|
||||
end: 2
|
||||
},
|
||||
loop: {
|
||||
start: 0,
|
||||
end: 1
|
||||
},
|
||||
appoint: [] as string[]
|
||||
},
|
||||
hour: {
|
||||
type: '0',
|
||||
range: {
|
||||
start: 1,
|
||||
end: 2
|
||||
},
|
||||
loop: {
|
||||
start: 0,
|
||||
end: 1
|
||||
},
|
||||
appoint: [] as string[]
|
||||
},
|
||||
day: {
|
||||
type: '0',
|
||||
range: {
|
||||
start: 1,
|
||||
end: 2
|
||||
},
|
||||
loop: {
|
||||
start: 1,
|
||||
end: 1
|
||||
},
|
||||
appoint: [] as string[]
|
||||
},
|
||||
month: {
|
||||
type: '0',
|
||||
range: {
|
||||
start: 1,
|
||||
end: 2
|
||||
},
|
||||
loop: {
|
||||
start: 1,
|
||||
end: 1
|
||||
},
|
||||
appoint: [] as string[]
|
||||
},
|
||||
week: {
|
||||
type: '5',
|
||||
range: {
|
||||
start: '2',
|
||||
end: '3'
|
||||
},
|
||||
loop: {
|
||||
start: 0,
|
||||
end: '2'
|
||||
},
|
||||
last: '2',
|
||||
appoint: [] as string[]
|
||||
},
|
||||
year: {
|
||||
type: '-1',
|
||||
range: {
|
||||
start: getYear()[0],
|
||||
end: getYear()[1]
|
||||
},
|
||||
loop: {
|
||||
start: getYear()[0],
|
||||
end: 1
|
||||
},
|
||||
appoint: [] as string[]
|
||||
}
|
||||
})
|
||||
const data = reactive({
|
||||
second: ['0', '5', '15', '20', '25', '30', '35', '40', '45', '50', '55', '59'],
|
||||
minute: ['0', '5', '15', '20', '25', '30', '35', '40', '45', '50', '55', '59'],
|
||||
hour: [
|
||||
'0',
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
'8',
|
||||
'9',
|
||||
'10',
|
||||
'11',
|
||||
'12',
|
||||
'13',
|
||||
'14',
|
||||
'15',
|
||||
'16',
|
||||
'17',
|
||||
'18',
|
||||
'19',
|
||||
'20',
|
||||
'21',
|
||||
'22',
|
||||
'23'
|
||||
],
|
||||
day: [
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
'8',
|
||||
'9',
|
||||
'10',
|
||||
'11',
|
||||
'12',
|
||||
'13',
|
||||
'14',
|
||||
'15',
|
||||
'16',
|
||||
'17',
|
||||
'18',
|
||||
'19',
|
||||
'20',
|
||||
'21',
|
||||
'22',
|
||||
'23',
|
||||
'24',
|
||||
'25',
|
||||
'26',
|
||||
'27',
|
||||
'28',
|
||||
'29',
|
||||
'30',
|
||||
'31'
|
||||
],
|
||||
month: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
|
||||
week: [
|
||||
{
|
||||
value: '1',
|
||||
label: '周日'
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '周一'
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '周二'
|
||||
},
|
||||
{
|
||||
value: '4',
|
||||
label: '周三'
|
||||
},
|
||||
{
|
||||
value: '5',
|
||||
label: '周四'
|
||||
},
|
||||
{
|
||||
value: '6',
|
||||
label: '周五'
|
||||
},
|
||||
{
|
||||
value: '7',
|
||||
label: '周六'
|
||||
}
|
||||
],
|
||||
year: getYear()
|
||||
})
|
||||
|
||||
const value_second = computed(() => {
|
||||
let v = cronValue.second
|
||||
if (v.type == '0') {
|
||||
return '*'
|
||||
} else if (v.type == '1') {
|
||||
return v.range.start + '-' + v.range.end
|
||||
} else if (v.type == '2') {
|
||||
return v.loop.start + '/' + v.loop.end
|
||||
} else if (v.type == '3') {
|
||||
return v.appoint.length > 0 ? v.appoint.join(',') : '*'
|
||||
} else {
|
||||
return '*'
|
||||
}
|
||||
})
|
||||
const value_minute = computed(() => {
|
||||
let v = cronValue.minute
|
||||
if (v.type == '0') {
|
||||
return '*'
|
||||
} else if (v.type == '1') {
|
||||
return v.range.start + '-' + v.range.end
|
||||
} else if (v.type == '2') {
|
||||
return v.loop.start + '/' + v.loop.end
|
||||
} else if (v.type == '3') {
|
||||
return v.appoint.length > 0 ? v.appoint.join(',') : '*'
|
||||
} else {
|
||||
return '*'
|
||||
}
|
||||
})
|
||||
const value_hour = computed(() => {
|
||||
let v = cronValue.hour
|
||||
if (v.type == '0') {
|
||||
return '*'
|
||||
} else if (v.type == '1') {
|
||||
return v.range.start + '-' + v.range.end
|
||||
} else if (v.type == '2') {
|
||||
return v.loop.start + '/' + v.loop.end
|
||||
} else if (v.type == '3') {
|
||||
return v.appoint.length > 0 ? v.appoint.join(',') : '*'
|
||||
} else {
|
||||
return '*'
|
||||
}
|
||||
})
|
||||
const value_day = computed(() => {
|
||||
let v = cronValue.day
|
||||
if (v.type == '0') {
|
||||
return '*'
|
||||
} else if (v.type == '1') {
|
||||
return v.range.start + '-' + v.range.end
|
||||
} else if (v.type == '2') {
|
||||
return v.loop.start + '/' + v.loop.end
|
||||
} else if (v.type == '3') {
|
||||
return v.appoint.length > 0 ? v.appoint.join(',') : '*'
|
||||
} else if (v.type == '4') {
|
||||
return 'L'
|
||||
} else if (v.type == '5') {
|
||||
return '?'
|
||||
} else {
|
||||
return '*'
|
||||
}
|
||||
})
|
||||
const value_month = computed(() => {
|
||||
let v = cronValue.month
|
||||
if (v.type == '0') {
|
||||
return '*'
|
||||
} else if (v.type == '1') {
|
||||
return v.range.start + '-' + v.range.end
|
||||
} else if (v.type == '2') {
|
||||
return v.loop.start + '/' + v.loop.end
|
||||
} else if (v.type == '3') {
|
||||
return v.appoint.length > 0 ? v.appoint.join(',') : '*'
|
||||
} else {
|
||||
return '*'
|
||||
}
|
||||
})
|
||||
const value_week = computed(() => {
|
||||
let v = cronValue.week
|
||||
if (v.type == '0') {
|
||||
return '*'
|
||||
} else if (v.type == '1') {
|
||||
return v.range.start + '-' + v.range.end
|
||||
} else if (v.type == '2') {
|
||||
return v.loop.end + '#' + v.loop.start
|
||||
} else if (v.type == '3') {
|
||||
return v.appoint.length > 0 ? v.appoint.join(',') : '*'
|
||||
} else if (v.type == '4') {
|
||||
return v.last + 'L'
|
||||
} else if (v.type == '5') {
|
||||
return '?'
|
||||
} else {
|
||||
return '*'
|
||||
}
|
||||
})
|
||||
const value_year = computed(() => {
|
||||
let v = cronValue.year
|
||||
if (v.type == '-1') {
|
||||
return ''
|
||||
} else if (v.type == '0') {
|
||||
return '*'
|
||||
} else if (v.type == '1') {
|
||||
return v.range.start + '-' + v.range.end
|
||||
} else if (v.type == '2') {
|
||||
return v.loop.start + '/' + v.loop.end
|
||||
} else if (v.type == '3') {
|
||||
return v.appoint.length > 0 ? v.appoint.join(',') : ''
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
})
|
||||
watch(
|
||||
() => cronValue.week.type,
|
||||
(val) => {
|
||||
if (val != '5') {
|
||||
cronValue.day.type = '5'
|
||||
}
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => cronValue.day.type,
|
||||
(val) => {
|
||||
if (val != '5') {
|
||||
cronValue.week.type = '5'
|
||||
}
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
() => {
|
||||
defaultValue.value = props.modelValue
|
||||
}
|
||||
)
|
||||
onMounted(() => {
|
||||
defaultValue.value = props.modelValue
|
||||
})
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
const select = ref()
|
||||
watch(
|
||||
() => select.value,
|
||||
() => {
|
||||
if (select.value == 'custom') {
|
||||
open()
|
||||
} else {
|
||||
defaultValue.value = select.value
|
||||
emit('update:modelValue', defaultValue.value)
|
||||
}
|
||||
}
|
||||
)
|
||||
const open = () => {
|
||||
set()
|
||||
dialogVisible.value = true
|
||||
}
|
||||
const set = () => {
|
||||
defaultValue.value = props.modelValue
|
||||
let arr = (props.modelValue || '* * * * * ?').split(' ')
|
||||
//简单检查
|
||||
if (arr.length < 6) {
|
||||
ElMessage.warning('cron表达式错误,已转换为默认表达式')
|
||||
arr = '* * * * * ?'.split(' ')
|
||||
}
|
||||
|
||||
//秒
|
||||
if (arr[0] == '*') {
|
||||
cronValue.second.type = '0'
|
||||
} else if (arr[0].includes('-')) {
|
||||
cronValue.second.type = '1'
|
||||
cronValue.second.range.start = Number(arr[0].split('-')[0])
|
||||
cronValue.second.range.end = Number(arr[0].split('-')[1])
|
||||
} else if (arr[0].includes('/')) {
|
||||
cronValue.second.type = '2'
|
||||
cronValue.second.loop.start = Number(arr[0].split('/')[0])
|
||||
cronValue.second.loop.end = Number(arr[0].split('/')[1])
|
||||
} else {
|
||||
cronValue.second.type = '3'
|
||||
cronValue.second.appoint = arr[0].split(',')
|
||||
}
|
||||
//分
|
||||
if (arr[1] == '*') {
|
||||
cronValue.minute.type = '0'
|
||||
} else if (arr[1].includes('-')) {
|
||||
cronValue.minute.type = '1'
|
||||
cronValue.minute.range.start = Number(arr[1].split('-')[0])
|
||||
cronValue.minute.range.end = Number(arr[1].split('-')[1])
|
||||
} else if (arr[1].includes('/')) {
|
||||
cronValue.minute.type = '2'
|
||||
cronValue.minute.loop.start = Number(arr[1].split('/')[0])
|
||||
cronValue.minute.loop.end = Number(arr[1].split('/')[1])
|
||||
} else {
|
||||
cronValue.minute.type = '3'
|
||||
cronValue.minute.appoint = arr[1].split(',')
|
||||
}
|
||||
//小时
|
||||
if (arr[2] == '*') {
|
||||
cronValue.hour.type = '0'
|
||||
} else if (arr[2].includes('-')) {
|
||||
cronValue.hour.type = '1'
|
||||
cronValue.hour.range.start = Number(arr[2].split('-')[0])
|
||||
cronValue.hour.range.end = Number(arr[2].split('-')[1])
|
||||
} else if (arr[2].includes('/')) {
|
||||
cronValue.hour.type = '2'
|
||||
cronValue.hour.loop.start = Number(arr[2].split('/')[0])
|
||||
cronValue.hour.loop.end = Number(arr[2].split('/')[1])
|
||||
} else {
|
||||
cronValue.hour.type = '3'
|
||||
cronValue.hour.appoint = arr[2].split(',')
|
||||
}
|
||||
//日
|
||||
if (arr[3] == '*') {
|
||||
cronValue.day.type = '0'
|
||||
} else if (arr[3] == 'L') {
|
||||
cronValue.day.type = '4'
|
||||
} else if (arr[3] == '?') {
|
||||
cronValue.day.type = '5'
|
||||
} else if (arr[3].includes('-')) {
|
||||
cronValue.day.type = '1'
|
||||
cronValue.day.range.start = Number(arr[3].split('-')[0])
|
||||
cronValue.day.range.end = Number(arr[3].split('-')[1])
|
||||
} else if (arr[3].includes('/')) {
|
||||
cronValue.day.type = '2'
|
||||
cronValue.day.loop.start = Number(arr[3].split('/')[0])
|
||||
cronValue.day.loop.end = Number(arr[3].split('/')[1])
|
||||
} else {
|
||||
cronValue.day.type = '3'
|
||||
cronValue.day.appoint = arr[3].split(',')
|
||||
}
|
||||
//月
|
||||
if (arr[4] == '*') {
|
||||
cronValue.month.type = '0'
|
||||
} else if (arr[4].includes('-')) {
|
||||
cronValue.month.type = '1'
|
||||
cronValue.month.range.start = Number(arr[4].split('-')[0])
|
||||
cronValue.month.range.end = Number(arr[4].split('-')[1])
|
||||
} else if (arr[4].includes('/')) {
|
||||
cronValue.month.type = '2'
|
||||
cronValue.month.loop.start = Number(arr[4].split('/')[0])
|
||||
cronValue.month.loop.end = Number(arr[4].split('/')[1])
|
||||
} else {
|
||||
cronValue.month.type = '3'
|
||||
cronValue.month.appoint = arr[4].split(',')
|
||||
}
|
||||
//周
|
||||
if (arr[5] == '*') {
|
||||
cronValue.week.type = '0'
|
||||
} else if (arr[5] == '?') {
|
||||
cronValue.week.type = '5'
|
||||
} else if (arr[5].includes('-')) {
|
||||
cronValue.week.type = '1'
|
||||
cronValue.week.range.start = arr[5].split('-')[0]
|
||||
cronValue.week.range.end = arr[5].split('-')[1]
|
||||
} else if (arr[5].includes('#')) {
|
||||
cronValue.week.type = '2'
|
||||
cronValue.week.loop.start = Number(arr[5].split('#')[1])
|
||||
cronValue.week.loop.end = arr[5].split('#')[0]
|
||||
} else if (arr[5].includes('L')) {
|
||||
cronValue.week.type = '4'
|
||||
cronValue.week.last = arr[5].split('L')[0]
|
||||
} else {
|
||||
cronValue.week.type = '3'
|
||||
cronValue.week.appoint = arr[5].split(',')
|
||||
}
|
||||
//年
|
||||
if (!arr[6]) {
|
||||
cronValue.year.type = '-1'
|
||||
} else if (arr[6] == '*') {
|
||||
cronValue.year.type = '0'
|
||||
} else if (arr[6].includes('-')) {
|
||||
cronValue.year.type = '1'
|
||||
cronValue.year.range.start = Number(arr[6].split('-')[0])
|
||||
cronValue.year.range.end = Number(arr[6].split('-')[1])
|
||||
} else if (arr[6].includes('/')) {
|
||||
cronValue.year.type = '2'
|
||||
cronValue.year.loop.start = Number(arr[6].split('/')[1])
|
||||
cronValue.year.loop.end = Number(arr[6].split('/')[0])
|
||||
} else {
|
||||
cronValue.year.type = '3'
|
||||
cronValue.year.appoint = arr[6].split(',')
|
||||
}
|
||||
}
|
||||
const submit = () => {
|
||||
let year = value_year.value ? ' ' + value_year.value : ''
|
||||
defaultValue.value =
|
||||
value_second.value +
|
||||
' ' +
|
||||
value_minute.value +
|
||||
' ' +
|
||||
value_hour.value +
|
||||
' ' +
|
||||
value_day.value +
|
||||
' ' +
|
||||
value_month.value +
|
||||
' ' +
|
||||
value_week.value +
|
||||
year
|
||||
emit('update:modelValue', defaultValue.value)
|
||||
dialogVisible.value = false
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<el-input v-model="defaultValue" v-bind="$attrs" class="input-with-select">
|
||||
<template #append>
|
||||
<el-select v-model="select" placeholder="生成器" style="width: 115px">
|
||||
<el-option label="每分钟" value="0 * * * * ?" />
|
||||
<el-option label="每小时" value="0 0 * * * ?" />
|
||||
<el-option label="每天零点" value="0 0 0 * * ?" />
|
||||
<el-option label="每月一号零点" value="0 0 0 1 * ?" />
|
||||
<el-option label="每月最后一天零点" value="0 0 0 L * ?" />
|
||||
<el-option label="每周星期日零点" value="0 0 0 ? * 1" />
|
||||
<el-option
|
||||
v-for="(item, index) in shortcuts"
|
||||
:key="index"
|
||||
:label="item.text"
|
||||
:value="item.value"
|
||||
/>
|
||||
<el-option label="自定义" value="custom" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-input>
|
||||
|
||||
<el-dialog
|
||||
title="cron规则生成器"
|
||||
v-model="dialogVisible"
|
||||
:width="580"
|
||||
destroy-on-close
|
||||
append-to-body
|
||||
>
|
||||
<div class="sc-cron">
|
||||
<el-tabs>
|
||||
<el-tab-pane>
|
||||
<template #label>
|
||||
<div class="sc-cron-num">
|
||||
<h2>秒</h2>
|
||||
<h4>{{ value_second }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.second.type">
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="范围" v-if="cronValue.second.type == '1'">
|
||||
<el-input-number
|
||||
v-model="cronValue.second.range.start"
|
||||
:min="0"
|
||||
:max="59"
|
||||
controls-position="right"
|
||||
/>
|
||||
<span style="padding: 0 15px">-</span>
|
||||
<el-input-number
|
||||
v-model="cronValue.second.range.end"
|
||||
:min="0"
|
||||
:max="59"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="间隔" v-if="cronValue.second.type == '2'">
|
||||
<el-input-number
|
||||
v-model="cronValue.second.loop.start"
|
||||
:min="0"
|
||||
:max="59"
|
||||
controls-position="right"
|
||||
/>
|
||||
秒开始,每
|
||||
<el-input-number
|
||||
v-model="cronValue.second.loop.end"
|
||||
:min="0"
|
||||
:max="59"
|
||||
controls-position="right"
|
||||
/>
|
||||
秒执行一次
|
||||
</el-form-item>
|
||||
<el-form-item label="指定" v-if="cronValue.second.type == '3'">
|
||||
<el-select v-model="cronValue.second.appoint" multiple style="width: 100%">
|
||||
<el-option
|
||||
v-for="(item, index) in data.second"
|
||||
:key="index"
|
||||
:label="item"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane>
|
||||
<template #label>
|
||||
<div class="sc-cron-num">
|
||||
<h2>分钟</h2>
|
||||
<h4>{{ value_minute }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.minute.type">
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="范围" v-if="cronValue.minute.type == '1'">
|
||||
<el-input-number
|
||||
v-model="cronValue.minute.range.start"
|
||||
:min="0"
|
||||
:max="59"
|
||||
controls-position="right"
|
||||
/>
|
||||
<span style="padding: 0 15px">-</span>
|
||||
<el-input-number
|
||||
v-model="cronValue.minute.range.end"
|
||||
:min="0"
|
||||
:max="59"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="间隔" v-if="cronValue.minute.type == '2'">
|
||||
<el-input-number
|
||||
v-model="cronValue.minute.loop.start"
|
||||
:min="0"
|
||||
:max="59"
|
||||
controls-position="right"
|
||||
/>
|
||||
分钟开始,每
|
||||
<el-input-number
|
||||
v-model="cronValue.minute.loop.end"
|
||||
:min="0"
|
||||
:max="59"
|
||||
controls-position="right"
|
||||
/>
|
||||
分钟执行一次
|
||||
</el-form-item>
|
||||
<el-form-item label="指定" v-if="cronValue.minute.type == '3'">
|
||||
<el-select v-model="cronValue.minute.appoint" multiple style="width: 100%">
|
||||
<el-option
|
||||
v-for="(item, index) in data.minute"
|
||||
:key="index"
|
||||
:label="item"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane>
|
||||
<template #label>
|
||||
<div class="sc-cron-num">
|
||||
<h2>小时</h2>
|
||||
<h4>{{ value_hour }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.hour.type">
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="范围" v-if="cronValue.hour.type == '1'">
|
||||
<el-input-number
|
||||
v-model="cronValue.hour.range.start"
|
||||
:min="0"
|
||||
:max="23"
|
||||
controls-position="right"
|
||||
/>
|
||||
<span style="padding: 0 15px">-</span>
|
||||
<el-input-number
|
||||
v-model="cronValue.hour.range.end"
|
||||
:min="0"
|
||||
:max="23"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="间隔" v-if="cronValue.hour.type == '2'">
|
||||
<el-input-number
|
||||
v-model="cronValue.hour.loop.start"
|
||||
:min="0"
|
||||
:max="23"
|
||||
controls-position="right"
|
||||
/>
|
||||
小时开始,每
|
||||
<el-input-number
|
||||
v-model="cronValue.hour.loop.end"
|
||||
:min="0"
|
||||
:max="23"
|
||||
controls-position="right"
|
||||
/>
|
||||
小时执行一次
|
||||
</el-form-item>
|
||||
<el-form-item label="指定" v-if="cronValue.hour.type == '3'">
|
||||
<el-select v-model="cronValue.hour.appoint" multiple style="width: 100%">
|
||||
<el-option
|
||||
v-for="(item, index) in data.hour"
|
||||
:key="index"
|
||||
:label="item"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane>
|
||||
<template #label>
|
||||
<div class="sc-cron-num">
|
||||
<h2>日</h2>
|
||||
<h4>{{ value_day }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.day.type">
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
<el-radio-button label="4">本月最后一天</el-radio-button>
|
||||
<el-radio-button label="5">不指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="范围" v-if="cronValue.day.type == '1'">
|
||||
<el-input-number
|
||||
v-model="cronValue.day.range.start"
|
||||
:min="1"
|
||||
:max="31"
|
||||
controls-position="right"
|
||||
/>
|
||||
<span style="padding: 0 15px">-</span>
|
||||
<el-input-number
|
||||
v-model="cronValue.day.range.end"
|
||||
:min="1"
|
||||
:max="31"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="间隔" v-if="cronValue.day.type == '2'">
|
||||
<el-input-number
|
||||
v-model="cronValue.day.loop.start"
|
||||
:min="1"
|
||||
:max="31"
|
||||
controls-position="right"
|
||||
/>
|
||||
号开始,每
|
||||
<el-input-number
|
||||
v-model="cronValue.day.loop.end"
|
||||
:min="1"
|
||||
:max="31"
|
||||
controls-position="right"
|
||||
/>
|
||||
天执行一次
|
||||
</el-form-item>
|
||||
<el-form-item label="指定" v-if="cronValue.day.type == '3'">
|
||||
<el-select v-model="cronValue.day.appoint" multiple style="width: 100%">
|
||||
<el-option
|
||||
v-for="(item, index) in data.day"
|
||||
:key="index"
|
||||
:label="item"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane>
|
||||
<template #label>
|
||||
<div class="sc-cron-num">
|
||||
<h2>月</h2>
|
||||
<h4>{{ value_month }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.month.type">
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="范围" v-if="cronValue.month.type == '1'">
|
||||
<el-input-number
|
||||
v-model="cronValue.month.range.start"
|
||||
:min="1"
|
||||
:max="12"
|
||||
controls-position="right"
|
||||
/>
|
||||
<span style="padding: 0 15px">-</span>
|
||||
<el-input-number
|
||||
v-model="cronValue.month.range.end"
|
||||
:min="1"
|
||||
:max="12"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="间隔" v-if="cronValue.month.type == '2'">
|
||||
<el-input-number
|
||||
v-model="cronValue.month.loop.start"
|
||||
:min="1"
|
||||
:max="12"
|
||||
controls-position="right"
|
||||
/>
|
||||
月开始,每
|
||||
<el-input-number
|
||||
v-model="cronValue.month.loop.end"
|
||||
:min="1"
|
||||
:max="12"
|
||||
controls-position="right"
|
||||
/>
|
||||
月执行一次
|
||||
</el-form-item>
|
||||
<el-form-item label="指定" v-if="cronValue.month.type == '3'">
|
||||
<el-select v-model="cronValue.month.appoint" multiple style="width: 100%">
|
||||
<el-option
|
||||
v-for="(item, index) in data.month"
|
||||
:key="index"
|
||||
:label="item"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane>
|
||||
<template #label>
|
||||
<div class="sc-cron-num">
|
||||
<h2>周</h2>
|
||||
<h4>{{ value_week }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
<el-form>
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.week.type">
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
<el-radio-button label="4">本月最后一周</el-radio-button>
|
||||
<el-radio-button label="5">不指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="范围" v-if="cronValue.week.type == '1'">
|
||||
<el-select v-model="cronValue.week.range.start">
|
||||
<el-option
|
||||
v-for="(item, index) in data.week"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<span style="padding: 0 15px">-</span>
|
||||
<el-select v-model="cronValue.week.range.end">
|
||||
<el-option
|
||||
v-for="(item, index) in data.week"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="间隔" v-if="cronValue.week.type == '2'">
|
||||
第
|
||||
<el-input-number
|
||||
v-model="cronValue.week.loop.start"
|
||||
:min="1"
|
||||
:max="4"
|
||||
controls-position="right"
|
||||
/>
|
||||
周的星期
|
||||
<el-select v-model="cronValue.week.loop.end">
|
||||
<el-option
|
||||
v-for="(item, index) in data.week"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
执行一次
|
||||
</el-form-item>
|
||||
<el-form-item label="指定" v-if="cronValue.week.type == '3'">
|
||||
<el-select v-model="cronValue.week.appoint" multiple style="width: 100%">
|
||||
<el-option
|
||||
v-for="(item, index) in data.week"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="最后一周" v-if="cronValue.week.type == '4'">
|
||||
<el-select v-model="cronValue.week.last">
|
||||
<el-option
|
||||
v-for="(item, index) in data.week"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane>
|
||||
<template #label>
|
||||
<div class="sc-cron-num">
|
||||
<h2>年</h2>
|
||||
<h4>{{ value_year }}</h4>
|
||||
</div>
|
||||
</template>
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.year.type">
|
||||
<el-radio-button label="-1">忽略</el-radio-button>
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="范围" v-if="cronValue.year.type == '1'">
|
||||
<el-input-number v-model="cronValue.year.range.start" controls-position="right" />
|
||||
<span style="padding: 0 15px">-</span>
|
||||
<el-input-number v-model="cronValue.year.range.end" controls-position="right" />
|
||||
</el-form-item>
|
||||
<el-form-item label="间隔" v-if="cronValue.year.type == '2'">
|
||||
<el-input-number v-model="cronValue.year.loop.start" controls-position="right" />
|
||||
年开始,每
|
||||
<el-input-number
|
||||
v-model="cronValue.year.loop.end"
|
||||
:min="1"
|
||||
controls-position="right"
|
||||
/>
|
||||
年执行一次
|
||||
</el-form-item>
|
||||
<el-form-item label="指定" v-if="cronValue.year.type == '3'">
|
||||
<el-select v-model="cronValue.year.appoint" multiple style="width: 100%">
|
||||
<el-option
|
||||
v-for="(item, index) in data.year"
|
||||
:key="index"
|
||||
:label="item"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit()">确 认</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.sc-cron:deep(.el-tabs__item) {
|
||||
height: auto;
|
||||
line-height: 1;
|
||||
padding: 0 7px;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
.sc-cron-num {
|
||||
text-align: center;
|
||||
margin-bottom: 15px;
|
||||
width: 100%;
|
||||
}
|
||||
.sc-cron-num h2 {
|
||||
font-size: 12px;
|
||||
margin-bottom: 15px;
|
||||
font-weight: normal;
|
||||
}
|
||||
.sc-cron-num h4 {
|
||||
display: block;
|
||||
height: 32px;
|
||||
line-height: 30px;
|
||||
width: 100%;
|
||||
font-size: 12px;
|
||||
padding: 0 15px;
|
||||
background: var(--el-color-primary-light-9);
|
||||
border-radius: 4px;
|
||||
}
|
||||
.sc-cron:deep(.el-tabs__item.is-active) .sc-cron-num h4 {
|
||||
background: var(--el-color-primary);
|
||||
color: #fff;
|
||||
}
|
||||
[data-theme='dark'] .sc-cron-num h4 {
|
||||
background: var(--el-color-white);
|
||||
}
|
||||
.input-with-select .el-input-group__prepend {
|
||||
background-color: var(--el-fill-color-blank);
|
||||
}
|
||||
</style>
|
||||
4
src/components/Cropper/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import CropperImage from './src/Cropper.vue'
|
||||
import CropperAvatar from './src/CropperAvatar.vue'
|
||||
|
||||
export { CropperImage, CropperAvatar }
|
||||
254
src/components/Cropper/src/CopperModal.vue
Normal file
@@ -0,0 +1,254 @@
|
||||
<template>
|
||||
<div>
|
||||
<Dialog
|
||||
v-model="dialogVisible"
|
||||
:title="t('cropper.modalTitle')"
|
||||
width="800px"
|
||||
maxHeight="380px"
|
||||
:canFullscreen="false"
|
||||
>
|
||||
<div :class="prefixCls">
|
||||
<div :class="`${prefixCls}-left`">
|
||||
<div :class="`${prefixCls}-cropper`">
|
||||
<CropperImage
|
||||
v-if="src"
|
||||
:src="src"
|
||||
height="300px"
|
||||
:circled="circled"
|
||||
@cropend="handleCropend"
|
||||
@ready="handleReady"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div :class="`${prefixCls}-toolbar`">
|
||||
<el-upload :fileList="[]" accept="image/*" :beforeUpload="handleBeforeUpload">
|
||||
<el-tooltip :content="t('cropper.selectImage')" placement="bottom">
|
||||
<XButton preIcon="ant-design:upload-outlined" type="primary" />
|
||||
</el-tooltip>
|
||||
</el-upload>
|
||||
<el-space>
|
||||
<el-tooltip :content="t('cropper.btn_reset')" placement="bottom">
|
||||
<XButton
|
||||
type="primary"
|
||||
preIcon="ant-design:reload-outlined"
|
||||
size="small"
|
||||
:disabled="!src"
|
||||
@click="handlerToolbar('reset')"
|
||||
/>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="t('cropper.btn_rotate_left')" placement="bottom">
|
||||
<XButton
|
||||
type="primary"
|
||||
preIcon="ant-design:rotate-left-outlined"
|
||||
size="small"
|
||||
:disabled="!src"
|
||||
@click="handlerToolbar('rotate', -45)"
|
||||
/>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="t('cropper.btn_rotate_right')" placement="bottom">
|
||||
<XButton
|
||||
type="primary"
|
||||
preIcon="ant-design:rotate-right-outlined"
|
||||
size="small"
|
||||
:disabled="!src"
|
||||
@click="handlerToolbar('rotate', 45)"
|
||||
/>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="t('cropper.btn_scale_x')" placement="bottom">
|
||||
<XButton
|
||||
type="primary"
|
||||
preIcon="vaadin:arrows-long-h"
|
||||
size="small"
|
||||
:disabled="!src"
|
||||
@click="handlerToolbar('scaleX')"
|
||||
/>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="t('cropper.btn_scale_y')" placement="bottom">
|
||||
<XButton
|
||||
type="primary"
|
||||
preIcon="vaadin:arrows-long-v"
|
||||
size="small"
|
||||
:disabled="!src"
|
||||
@click="handlerToolbar('scaleY')"
|
||||
/>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="t('cropper.btn_zoom_in')" placement="bottom">
|
||||
<XButton
|
||||
type="primary"
|
||||
preIcon="ant-design:zoom-in-outlined"
|
||||
size="small"
|
||||
:disabled="!src"
|
||||
@click="handlerToolbar('zoom', 0.1)"
|
||||
/>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="t('cropper.btn_zoom_out')" placement="bottom">
|
||||
<XButton
|
||||
type="primary"
|
||||
preIcon="ant-design:zoom-out-outlined"
|
||||
size="small"
|
||||
:disabled="!src"
|
||||
@click="handlerToolbar('zoom', -0.1)"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</el-space>
|
||||
</div>
|
||||
</div>
|
||||
<div :class="`${prefixCls}-right`">
|
||||
<div :class="`${prefixCls}-preview`">
|
||||
<img :src="previewSource" v-if="previewSource" :alt="t('cropper.preview')" />
|
||||
</div>
|
||||
<template v-if="previewSource">
|
||||
<div :class="`${prefixCls}-group`">
|
||||
<el-avatar :src="previewSource" size="large" />
|
||||
<el-avatar :src="previewSource" :size="48" />
|
||||
<el-avatar :src="previewSource" :size="64" />
|
||||
<el-avatar :src="previewSource" :size="80" />
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button type="primary" @click="handleOk">{{ t('cropper.okText') }}</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
import { dataURLtoBlob } from '@/utils/filt'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import type { CropendResult, Cropper } from './types'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { CropperImage } from '@/components/Cropper'
|
||||
|
||||
const props = defineProps({
|
||||
srcValue: propTypes.string.def(''),
|
||||
circled: propTypes.bool.def(true)
|
||||
})
|
||||
const emit = defineEmits(['uploadSuccess'])
|
||||
const { t } = useI18n()
|
||||
const { getPrefixCls } = useDesign()
|
||||
const prefixCls = getPrefixCls('cropper-am')
|
||||
|
||||
const src = ref(props.srcValue)
|
||||
const previewSource = ref('')
|
||||
const cropper = ref<Cropper>()
|
||||
const dialogVisible = ref(false)
|
||||
let filename = ''
|
||||
let scaleX = 1
|
||||
let scaleY = 1
|
||||
|
||||
// Block upload
|
||||
function handleBeforeUpload(file: File) {
|
||||
const reader = new FileReader()
|
||||
reader.readAsDataURL(file)
|
||||
src.value = ''
|
||||
previewSource.value = ''
|
||||
reader.onload = function (e) {
|
||||
src.value = (e.target?.result as string) ?? ''
|
||||
filename = file.name
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
function handleCropend({ imgBase64 }: CropendResult) {
|
||||
previewSource.value = imgBase64
|
||||
}
|
||||
|
||||
function handleReady(cropperInstance: Cropper) {
|
||||
cropper.value = cropperInstance
|
||||
}
|
||||
|
||||
function handlerToolbar(event: string, arg?: number) {
|
||||
if (event === 'scaleX') {
|
||||
scaleX = arg = scaleX === -1 ? 1 : -1
|
||||
}
|
||||
if (event === 'scaleY') {
|
||||
scaleY = arg = scaleY === -1 ? 1 : -1
|
||||
}
|
||||
cropper?.value?.[event]?.(arg)
|
||||
}
|
||||
|
||||
async function handleOk() {
|
||||
const blob = dataURLtoBlob(previewSource.value)
|
||||
emit('uploadSuccess', { source: previewSource.value, data: blob, filename: filename })
|
||||
}
|
||||
function openModal() {
|
||||
dialogVisible.value = true
|
||||
}
|
||||
function closeModal() {
|
||||
dialogVisible.value = false
|
||||
}
|
||||
defineExpose({ openModal, closeModal })
|
||||
</script>
|
||||
<style lang="scss">
|
||||
$prefix-cls: #{$namespace}-cropper-am;
|
||||
|
||||
.#{$prefix-cls} {
|
||||
display: flex;
|
||||
|
||||
&-left,
|
||||
&-right {
|
||||
height: 340px;
|
||||
}
|
||||
|
||||
&-left {
|
||||
width: 55%;
|
||||
}
|
||||
|
||||
&-right {
|
||||
width: 45%;
|
||||
}
|
||||
|
||||
&-cropper {
|
||||
height: 300px;
|
||||
background: #eee;
|
||||
background-image: linear-gradient(
|
||||
45deg,
|
||||
rgb(0 0 0 / 25%) 25%,
|
||||
transparent 0,
|
||||
transparent 75%,
|
||||
rgb(0 0 0 / 25%) 0
|
||||
),
|
||||
linear-gradient(
|
||||
45deg,
|
||||
rgb(0 0 0 / 25%) 25%,
|
||||
transparent 0,
|
||||
transparent 75%,
|
||||
rgb(0 0 0 / 25%) 0
|
||||
);
|
||||
background-position: 0 0, 12px 12px;
|
||||
background-size: 24px 24px;
|
||||
}
|
||||
|
||||
&-toolbar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
&-preview {
|
||||
width: 220px;
|
||||
height: 220px;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
border: 1px solid;
|
||||
border-radius: 50%;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
&-group {
|
||||
display: flex;
|
||||
padding-top: 8px;
|
||||
margin-top: 8px;
|
||||
border-top: 1px solid;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
181
src/components/Cropper/src/Cropper.vue
Normal file
@@ -0,0 +1,181 @@
|
||||
<template>
|
||||
<div :class="getClass" :style="getWrapperStyle">
|
||||
<img
|
||||
v-show="isReady"
|
||||
ref="imgElRef"
|
||||
:src="src"
|
||||
:alt="alt"
|
||||
:crossorigin="crossorigin"
|
||||
:style="getImageStyle"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { CSSProperties, PropType } from 'vue'
|
||||
import Cropper from 'cropperjs'
|
||||
import 'cropperjs/dist/cropper.css'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { useDebounceFn } from '@vueuse/core'
|
||||
|
||||
type Options = Cropper.Options
|
||||
|
||||
const defaultOptions: Options = {
|
||||
aspectRatio: 1,
|
||||
zoomable: true,
|
||||
zoomOnTouch: true,
|
||||
zoomOnWheel: true,
|
||||
cropBoxMovable: true,
|
||||
cropBoxResizable: true,
|
||||
toggleDragModeOnDblclick: true,
|
||||
autoCrop: true,
|
||||
background: true,
|
||||
highlight: true,
|
||||
center: true,
|
||||
responsive: true,
|
||||
restore: true,
|
||||
checkCrossOrigin: true,
|
||||
checkOrientation: true,
|
||||
scalable: true,
|
||||
modal: true,
|
||||
guides: true,
|
||||
movable: true,
|
||||
rotatable: true
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
src: propTypes.string.def(''),
|
||||
alt: propTypes.string.def(''),
|
||||
circled: propTypes.bool.def(false),
|
||||
realTimePreview: propTypes.bool.def(true),
|
||||
height: propTypes.string.def('360px'),
|
||||
crossorigin: {
|
||||
type: String as PropType<'' | 'anonymous' | 'use-credentials' | undefined>,
|
||||
default: undefined
|
||||
},
|
||||
imageStyle: { type: Object as PropType<CSSProperties>, default: () => ({}) },
|
||||
options: { type: Object as PropType<Options>, default: () => ({}) }
|
||||
})
|
||||
|
||||
const emit = defineEmits(['cropend', 'ready', 'cropendError'])
|
||||
const attrs = useAttrs()
|
||||
const imgElRef = ref<ElRef<HTMLImageElement>>()
|
||||
const cropper = ref<Nullable<Cropper>>()
|
||||
const isReady = ref(false)
|
||||
|
||||
const { getPrefixCls } = useDesign()
|
||||
const prefixCls = getPrefixCls('cropper-image')
|
||||
const debounceRealTimeCroppered = useDebounceFn(realTimeCroppered, 80)
|
||||
|
||||
const getImageStyle = computed((): CSSProperties => {
|
||||
return {
|
||||
height: props.height,
|
||||
maxWidth: '100%',
|
||||
...props.imageStyle
|
||||
}
|
||||
})
|
||||
|
||||
const getClass = computed(() => {
|
||||
return [
|
||||
prefixCls,
|
||||
attrs.class,
|
||||
{
|
||||
[`${prefixCls}--circled`]: props.circled
|
||||
}
|
||||
]
|
||||
})
|
||||
const getWrapperStyle = computed((): CSSProperties => {
|
||||
return { height: `${props.height}`.replace(/px/, '') + 'px' }
|
||||
})
|
||||
|
||||
onMounted(init)
|
||||
|
||||
onUnmounted(() => {
|
||||
cropper.value?.destroy()
|
||||
})
|
||||
|
||||
async function init() {
|
||||
const imgEl = unref(imgElRef)
|
||||
if (!imgEl) {
|
||||
return
|
||||
}
|
||||
cropper.value = new Cropper(imgEl, {
|
||||
...defaultOptions,
|
||||
ready: () => {
|
||||
isReady.value = true
|
||||
realTimeCroppered()
|
||||
emit('ready', cropper.value)
|
||||
},
|
||||
crop() {
|
||||
debounceRealTimeCroppered()
|
||||
},
|
||||
zoom() {
|
||||
debounceRealTimeCroppered()
|
||||
},
|
||||
cropmove() {
|
||||
debounceRealTimeCroppered()
|
||||
},
|
||||
...props.options
|
||||
})
|
||||
}
|
||||
|
||||
// Real-time display preview
|
||||
function realTimeCroppered() {
|
||||
props.realTimePreview && croppered()
|
||||
}
|
||||
|
||||
// event: return base64 and width and height information after cropping
|
||||
function croppered() {
|
||||
if (!cropper.value) {
|
||||
return
|
||||
}
|
||||
let imgInfo = cropper.value.getData()
|
||||
const canvas = props.circled ? getRoundedCanvas() : cropper.value.getCroppedCanvas()
|
||||
canvas.toBlob((blob) => {
|
||||
if (!blob) {
|
||||
return
|
||||
}
|
||||
let fileReader: FileReader = new FileReader()
|
||||
fileReader.readAsDataURL(blob)
|
||||
fileReader.onloadend = (e) => {
|
||||
emit('cropend', {
|
||||
imgBase64: e.target?.result ?? '',
|
||||
imgInfo
|
||||
})
|
||||
}
|
||||
fileReader.onerror = () => {
|
||||
emit('cropendError')
|
||||
}
|
||||
}, 'image/png')
|
||||
}
|
||||
|
||||
// Get a circular picture canvas
|
||||
function getRoundedCanvas() {
|
||||
const sourceCanvas = cropper.value!.getCroppedCanvas()
|
||||
const canvas = document.createElement('canvas')
|
||||
const context = canvas.getContext('2d')!
|
||||
const width = sourceCanvas.width
|
||||
const height = sourceCanvas.height
|
||||
canvas.width = width
|
||||
canvas.height = height
|
||||
context.imageSmoothingEnabled = true
|
||||
context.drawImage(sourceCanvas, 0, 0, width, height)
|
||||
context.globalCompositeOperation = 'destination-in'
|
||||
context.beginPath()
|
||||
context.arc(width / 2, height / 2, Math.min(width, height) / 2, 0, 2 * Math.PI, true)
|
||||
context.fill()
|
||||
return canvas
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
$prefix-cls: #{$namespace}-cropper-image;
|
||||
|
||||
.#{$prefix-cls} {
|
||||
&--circled {
|
||||
.cropper-view-box,
|
||||
.cropper-face {
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
135
src/components/Cropper/src/CropperAvatar.vue
Normal file
@@ -0,0 +1,135 @@
|
||||
<template>
|
||||
<div class="user-info-head" @click="open()">
|
||||
<img :src="sourceValue" v-if="sourceValue" class="img-circle img-lg" alt="avatar" />
|
||||
<el-button :class="`${prefixCls}-upload-btn`" @click="open()" v-if="showBtn">
|
||||
{{ btnText ? btnText : t('cropper.selectImage') }}
|
||||
</el-button>
|
||||
<CopperModal
|
||||
ref="cropperModelRef"
|
||||
@upload-success="handleUploadSuccess"
|
||||
:srcValue="sourceValue"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import CopperModal from './CopperModal.vue'
|
||||
|
||||
const props = defineProps({
|
||||
width: propTypes.string.def('200px'),
|
||||
value: propTypes.string.def(''),
|
||||
showBtn: propTypes.bool.def(true),
|
||||
btnText: propTypes.string.def('')
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:value', 'change'])
|
||||
const sourceValue = ref(props.value)
|
||||
const { getPrefixCls } = useDesign()
|
||||
const prefixCls = getPrefixCls('cropper-avatar')
|
||||
const message = useMessage()
|
||||
const { t } = useI18n()
|
||||
|
||||
const cropperModelRef = ref()
|
||||
|
||||
watchEffect(() => {
|
||||
sourceValue.value = props.value
|
||||
})
|
||||
|
||||
watch(
|
||||
() => sourceValue.value,
|
||||
(v: string) => {
|
||||
emit('update:value', v)
|
||||
}
|
||||
)
|
||||
|
||||
function handleUploadSuccess({ source, data, filename }) {
|
||||
sourceValue.value = source
|
||||
emit('change', { source, data, filename })
|
||||
message.success(t('cropper.uploadSuccess'))
|
||||
}
|
||||
|
||||
function open() {
|
||||
cropperModelRef.value.openModal()
|
||||
}
|
||||
function close() {
|
||||
cropperModelRef.value.closeModal()
|
||||
}
|
||||
defineExpose({
|
||||
open,
|
||||
close
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
$prefix-cls: #{$namespace}--cropper-avatar;
|
||||
|
||||
.#{$prefix-cls} {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
|
||||
&-image-wrapper {
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
border: 1px solid;
|
||||
border-radius: 50%;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
&-image-mask {
|
||||
opacity: 0%;
|
||||
position: absolute;
|
||||
width: inherit;
|
||||
height: inherit;
|
||||
border-radius: inherit;
|
||||
border: inherit;
|
||||
background: rgb(0 0 0 / 40%);
|
||||
cursor: pointer;
|
||||
transition: opacity 0.4s;
|
||||
|
||||
::v-deep(svg) {
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
|
||||
&-image-mask:hover {
|
||||
opacity: 4000%;
|
||||
}
|
||||
|
||||
&-upload-btn {
|
||||
margin: 10px auto;
|
||||
}
|
||||
}
|
||||
.user-info-head {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
.img-circle {
|
||||
border-radius: 50%;
|
||||
}
|
||||
.img-lg {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
}
|
||||
.user-info-head:hover:after {
|
||||
content: '+';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
color: #eee;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
font-size: 24px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
cursor: pointer;
|
||||
line-height: 110px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
</style>
|
||||
8
src/components/Cropper/src/types.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import type Cropper from 'cropperjs'
|
||||
|
||||
export interface CropendResult {
|
||||
imgBase64: string
|
||||
imgInfo: Cropper.Data
|
||||
}
|
||||
|
||||
export type { Cropper }
|
||||
3
src/components/Descriptions/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import Descriptions from './src/Descriptions.vue'
|
||||
|
||||
export { Descriptions }
|
||||
155
src/components/Descriptions/src/Descriptions.vue
Normal file
@@ -0,0 +1,155 @@
|
||||
<script setup lang="ts">
|
||||
import { PropType } from 'vue'
|
||||
import dayjs from 'dayjs'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { DescriptionsSchema } from '@/types/descriptions'
|
||||
|
||||
const appStore = useAppStore()
|
||||
|
||||
const mobile = computed(() => appStore.getMobile)
|
||||
|
||||
const attrs = useAttrs()
|
||||
|
||||
const slots = useSlots()
|
||||
|
||||
const props = defineProps({
|
||||
title: propTypes.string.def(''),
|
||||
message: propTypes.string.def(''),
|
||||
collapse: propTypes.bool.def(true),
|
||||
columns: propTypes.number.def(1),
|
||||
schema: {
|
||||
type: Array as PropType<DescriptionsSchema[]>,
|
||||
default: () => []
|
||||
},
|
||||
data: {
|
||||
type: Object as PropType<any>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
const { getPrefixCls } = useDesign()
|
||||
|
||||
const prefixCls = getPrefixCls('descriptions')
|
||||
|
||||
const getBindValue = computed(() => {
|
||||
const delArr: string[] = ['title', 'message', 'collapse', 'schema', 'data', 'class']
|
||||
const obj = { ...attrs, ...props }
|
||||
for (const key in obj) {
|
||||
if (delArr.indexOf(key) !== -1) {
|
||||
delete obj[key]
|
||||
}
|
||||
}
|
||||
return obj
|
||||
})
|
||||
|
||||
const getBindItemValue = (item: DescriptionsSchema) => {
|
||||
const delArr: string[] = ['field']
|
||||
const obj = { ...item }
|
||||
for (const key in obj) {
|
||||
if (delArr.indexOf(key) !== -1) {
|
||||
delete obj[key]
|
||||
}
|
||||
}
|
||||
return obj
|
||||
}
|
||||
|
||||
// 折叠
|
||||
const show = ref(true)
|
||||
|
||||
const toggleClick = () => {
|
||||
if (props.collapse) {
|
||||
show.value = !unref(show)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
:class="[
|
||||
prefixCls,
|
||||
'bg-[var(--el-color-white)] dark:(bg-[var(--el-bg-color)] border-[var(--el-border-color)] border-1px)'
|
||||
]"
|
||||
>
|
||||
<div
|
||||
v-if="title"
|
||||
:class="[
|
||||
`${prefixCls}-header`,
|
||||
'h-50px flex justify-between items-center mb-10px border-bottom-1 border-solid border-[var(--tags-view-border-color)] px-10px cursor-pointer dark:border-[var(--el-border-color)]'
|
||||
]"
|
||||
@click="toggleClick"
|
||||
>
|
||||
<div :class="[`${prefixCls}-header__title`, 'relative font-18px font-bold ml-10px']">
|
||||
<div class="flex items-center">
|
||||
{{ title }}
|
||||
<ElTooltip v-if="message" :content="message" placement="right">
|
||||
<Icon icon="ep:warning" class="ml-5px" />
|
||||
</ElTooltip>
|
||||
</div>
|
||||
</div>
|
||||
<Icon v-if="collapse" :icon="show ? 'ep:arrow-down' : 'ep:arrow-up'" />
|
||||
</div>
|
||||
|
||||
<ElCollapseTransition>
|
||||
<div v-show="show" :class="[`${prefixCls}-content`, 'p-10px']">
|
||||
<ElDescriptions
|
||||
:column="props.columns"
|
||||
border
|
||||
:direction="mobile ? 'vertical' : 'horizontal'"
|
||||
v-bind="getBindValue"
|
||||
>
|
||||
<template v-if="slots['extra']" #extra>
|
||||
<slot name="extra"></slot>
|
||||
</template>
|
||||
<ElDescriptionsItem
|
||||
v-for="item in schema"
|
||||
:key="item.field"
|
||||
min-width="80"
|
||||
v-bind="getBindItemValue(item)"
|
||||
>
|
||||
<template #label>
|
||||
<slot :name="`${item.field}-label`" :label="item.label">{{ item.label }}</slot>
|
||||
</template>
|
||||
|
||||
<template #default>
|
||||
<slot v-if="item.dateFormat">
|
||||
{{
|
||||
data[item.field] !== null ? dayjs(data[item.field]).format(item.dateFormat) : ''
|
||||
}}
|
||||
</slot>
|
||||
<slot v-else-if="item.dictType">
|
||||
<DictTag :type="item.dictType" :value="data[item.field] + ''" />
|
||||
</slot>
|
||||
<slot v-else :name="item.field" :row="data">{{ data[item.field] }}</slot>
|
||||
</template>
|
||||
</ElDescriptionsItem>
|
||||
</ElDescriptions>
|
||||
</div>
|
||||
</ElCollapseTransition>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$prefix-cls: #{$namespace}-descriptions;
|
||||
|
||||
.#{$prefix-cls}-header {
|
||||
&__title {
|
||||
&::after {
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
left: -10px;
|
||||
width: 4px;
|
||||
height: 70%;
|
||||
background: var(--el-color-primary);
|
||||
content: '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.#{$prefix-cls}-content {
|
||||
:deep(.#{$elNamespace}-descriptions__cell) {
|
||||
width: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||