diff --git a/.env b/.env
index 6307b2d7..5f2334a3 100644
--- a/.env
+++ b/.env
@@ -13,3 +13,5 @@ VITE_APP_TENANT_ENABLE=true
# 验证码的开关
VITE_APP_CAPTCHA_ENABLE=true
+# 验证码的开关
+VITE_APP_CAPTCHA_ENABLE=true
diff --git a/build/vite/index.ts b/build/vite/index.ts
index dcec1aed..0e721ce9 100644
--- a/build/vite/index.ts
+++ b/build/vite/index.ts
@@ -6,11 +6,13 @@ import progress from 'vite-plugin-progress'
import EslintPlugin from 'vite-plugin-eslint'
import PurgeIcons from 'vite-plugin-purge-icons'
import { ViteEjsPlugin } from 'vite-plugin-ejs'
+// @ts-ignore
import ElementPlus from 'unplugin-element-plus/vite'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import viteCompression from 'vite-plugin-compression'
+import topLevelAwait from 'vite-plugin-top-level-await'
import vueSetupExtend from 'vite-plugin-vue-setup-extend'
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
@@ -95,6 +97,12 @@ export function createVitePlugins() {
ext: '.gz', // 生成的压缩包后缀
deleteOriginFile: false //压缩后是否删除源文件
}),
- ViteEjsPlugin()
+ ViteEjsPlugin(),
+ topLevelAwait({ // https://juejin.cn/post/7152191742513512485
+ // The export name of top-level await promise for each chunk module
+ promiseExportName: '__tla',
+ // The function to generate import names of top-level await promise in each chunk module
+ promiseImportName: (i) => `__tla_${i}`
+ })
]
}
diff --git a/package.json b/package.json
index 9d65c6ea..8fd1a0eb 100644
--- a/package.json
+++ b/package.json
@@ -13,6 +13,7 @@
"build:dev": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode dev",
"build:test": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode test",
"build:static": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode static",
+ "build:front": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode front",
"serve:pro": "vite preview --mode pro",
"serve:dev": "vite preview --mode dev",
"serve:test": "vite preview --mode test",
@@ -122,6 +123,7 @@
"vite-plugin-progress": "^0.0.6",
"vite-plugin-purge-icons": "^0.9.2",
"vite-plugin-svg-icons": "^2.0.1",
+ "vite-plugin-top-level-await": "^1.3.0",
"vite-plugin-vue-setup-extend": "^0.4.0",
"vite-plugin-windicss": "^1.8.10",
"vue-tsc": "^1.2.0",
diff --git a/src/api/bpm/leave/index.ts b/src/api/bpm/leave/index.ts
index ff6d86a0..d4e1be73 100644
--- a/src/api/bpm/leave/index.ts
+++ b/src/api/bpm/leave/index.ts
@@ -12,16 +12,16 @@ export type LeaveVO = {
}
// 创建请假申请
-export const createLeaveApi = async (data: LeaveVO) => {
+export const createLeave = async (data: LeaveVO) => {
return await request.post({ url: '/bpm/oa/leave/create', data: data })
}
// 获得请假申请
-export const getLeaveApi = async (id: number) => {
+export const getLeave = async (id: number) => {
return await request.get({ url: '/bpm/oa/leave/get?id=' + id })
}
// 获得请假申请分页
-export const getLeavePageApi = async (params) => {
+export const getLeavePage = async (params) => {
return await request.get({ url: '/bpm/oa/leave/page', params })
}
diff --git a/src/api/bpm/processInstance/index.ts b/src/api/bpm/processInstance/index.ts
index 95591ae3..10cd3bc8 100644
--- a/src/api/bpm/processInstance/index.ts
+++ b/src/api/bpm/processInstance/index.ts
@@ -20,15 +20,15 @@ export type ProcessInstanceVO = {
endTime: string
}
-export const getMyProcessInstancePageApi = async (params) => {
+export const getMyProcessInstancePage = async (params) => {
return await request.get({ url: '/bpm/process-instance/my-page', params })
}
-export const createProcessInstanceApi = async (data) => {
+export const createProcessInstance = async (data) => {
return await request.post({ url: '/bpm/process-instance/create', data: data })
}
-export const cancelProcessInstanceApi = async (id: number, reason: string) => {
+export const cancelProcessInstance = async (id: number, reason: string) => {
const data = {
id: id,
reason: reason
@@ -36,6 +36,6 @@ export const cancelProcessInstanceApi = async (id: number, reason: string) => {
return await request.delete({ url: '/bpm/process-instance/cancel', data: data })
}
-export const getProcessInstanceApi = async (id: number) => {
+export const getProcessInstance = async (id: number) => {
return await request.get({ url: '/bpm/process-instance/get?id=' + id })
}
diff --git a/src/api/bpm/task/index.ts b/src/api/bpm/task/index.ts
index d214d175..f6763720 100644
--- a/src/api/bpm/task/index.ts
+++ b/src/api/bpm/task/index.ts
@@ -1,5 +1,9 @@
import request from '@/config/axios'
+export type TaskVO = {
+ id: number
+}
+
export const getTodoTaskPage = async (params) => {
return await request.get({ url: '/bpm/task/todo-page', params })
}
@@ -32,3 +36,8 @@ export const getTaskListByProcessInstanceId = async (processInstanceId) => {
url: '/bpm/task/list-by-process-instance-id?processInstanceId=' + processInstanceId
})
}
+
+// 导出任务
+export const exportTask = async (params) => {
+ return await request.download({ url: '/bpm/task/export', params })
+}
diff --git a/src/api/infra/config/index.ts b/src/api/infra/config/index.ts
index 07fb52fd..5ef59f33 100644
--- a/src/api/infra/config/index.ts
+++ b/src/api/infra/config/index.ts
@@ -43,6 +43,6 @@ export const deleteConfig = (id: number) => {
}
// 导出参数
-export const exportConfigApi = (params) => {
+export const exportConfig = (params) => {
return request.download({ url: '/infra/config/export', params })
}
diff --git a/src/api/infra/dbDoc/index.ts b/src/api/infra/dbDoc/index.ts
index 11bce473..1a1a36b4 100644
--- a/src/api/infra/dbDoc/index.ts
+++ b/src/api/infra/dbDoc/index.ts
@@ -1,16 +1,16 @@
import request from '@/config/axios'
// 导出Html
-export const exportHtmlApi = () => {
+export const exportHtml = () => {
return request.download({ url: '/infra/db-doc/export-html' })
}
// 导出Word
-export const exportWordApi = () => {
+export const exportWord = () => {
return request.download({ url: '/infra/db-doc/export-word' })
}
// 导出Markdown
-export const exportMarkdownApi = () => {
+export const exportMarkdown = () => {
return request.download({ url: '/infra/db-doc/export-markdown' })
}
diff --git a/src/api/infra/job/index.ts b/src/api/infra/job/index.ts
index c1398d07..033b2cbe 100644
--- a/src/api/infra/job/index.ts
+++ b/src/api/infra/job/index.ts
@@ -53,7 +53,7 @@ export const updateJobStatus = (id: number, status: number) => {
}
// 定时任务立即执行一次
-export const runJobApi = (id: number) => {
+export const runJob = (id: number) => {
return request.put({ url: '/infra/job/trigger?id=' + id })
}
diff --git a/src/api/infra/redis/index.ts b/src/api/infra/redis/index.ts
index 1214a1da..9856fa64 100644
--- a/src/api/infra/redis/index.ts
+++ b/src/api/infra/redis/index.ts
@@ -3,17 +3,19 @@ import request from '@/config/axios'
/**
* 获取redis 监控信息
*/
-export const getCacheApi = () => {
+export const getCache = () => {
return request.get({ url: '/infra/redis/get-monitor-info' })
}
+
// 获取模块
-export const getKeyDefineListApi = () => {
+export const getKeyDefineList = () => {
return request.get({ url: '/infra/redis/get-key-define-list' })
}
+
/**
* 获取redis key列表
*/
-export const getKeyListApi = (keyTemplate: string) => {
+export const getKeyList = (keyTemplate: string) => {
return request.get({
url: '/infra/redis/get-key-list',
params: {
@@ -21,17 +23,18 @@ export const getKeyListApi = (keyTemplate: string) => {
}
})
}
+
// 获取缓存内容
-export const getKeyValueApi = (key: string) => {
+export const getKeyValue = (key: string) => {
return request.get({ url: '/infra/redis/get-key-value?key=' + key })
}
// 根据键名删除缓存
-export const deleteKeyApi = (key: string) => {
+export const deleteKey = (key: string) => {
return request.delete({ url: '/infra/redis/delete-key?key=' + key })
}
-export const deleteKeysApi = (keyTemplate: string) => {
+export const deleteKeys = (keyTemplate: string) => {
return request.delete({
url: '/infra/redis/delete-keys?',
params: {
diff --git a/src/api/login/index.ts b/src/api/login/index.ts
index 0c895663..2255e3cf 100644
--- a/src/api/login/index.ts
+++ b/src/api/login/index.ts
@@ -17,7 +17,7 @@ export interface SmsLoginVO {
}
// 登录
-export const loginApi = (data: UserLoginVO) => {
+export const login = (data: UserLoginVO) => {
return request.post({ url: '/system/auth/login', data })
}
@@ -27,47 +27,47 @@ export const refreshToken = () => {
}
// 使用租户名,获得租户编号
-export const getTenantIdByNameApi = (name: string) => {
+export const getTenantIdByName = (name: string) => {
return request.get({ url: '/system/tenant/get-id-by-name?name=' + name })
}
// 登出
-export const loginOutApi = () => {
+export const loginOut = () => {
return request.post({ url: '/system/auth/logout' })
}
// 获取用户权限信息
-export const getInfoApi = () => {
+export const getInfo = () => {
return request.get({ url: '/system/auth/get-permission-info' })
}
// 路由
-export const getAsyncRoutesApi = () => {
+export const getAsyncRoutes = () => {
return request.get({ url: '/system/auth/list-menus' })
}
//获取登录验证码
-export const sendSmsCodeApi = (data: SmsCodeVO) => {
+export const sendSmsCode = (data: SmsCodeVO) => {
return request.post({ url: '/system/auth/send-sms-code', data })
}
// 短信验证码登录
-export const smsLoginApi = (data: SmsLoginVO) => {
+export const smsLogin = (data: SmsLoginVO) => {
return request.post({ url: '/system/auth/sms-login', data })
}
// 社交授权的跳转
-export const socialAuthRedirectApi = (type: number, redirectUri: string) => {
+export const socialAuthRedirect = (type: number, redirectUri: string) => {
return request.get({
url: '/system/auth/social-auth-redirect?type=' + type + '&redirectUri=' + redirectUri
})
}
-// 获取验证图片 以及token
-export const getCodeApi = (data) => {
+// 获取验证图片以及 token
+export const getCode = (data) => {
return request.postOriginal({ url: 'system/captcha/get', data })
}
// 滑动或者点选验证
-export const reqCheckApi = (data) => {
+export const reqCheck = (data) => {
return request.postOriginal({ url: 'system/captcha/check', data })
}
diff --git a/src/api/pay/app/index.ts b/src/api/pay/app/index.ts
index 348185c8..c19eb99b 100644
--- a/src/api/pay/app/index.ts
+++ b/src/api/pay/app/index.ts
@@ -38,41 +38,41 @@ export interface AppUpdateStatusReqVO {
}
// 查询列表支付应用
-export const getAppPageApi = (params: AppPageReqVO) => {
+export const getAppPage = (params: AppPageReqVO) => {
return request.get({ url: '/pay/app/page', params })
}
// 查询详情支付应用
-export const getAppApi = (id: number) => {
+export const getApp = (id: number) => {
return request.get({ url: '/pay/app/get?id=' + id })
}
// 新增支付应用
-export const createAppApi = (data: AppVO) => {
+export const createApp = (data: AppVO) => {
return request.post({ url: '/pay/app/create', data })
}
// 修改支付应用
-export const updateAppApi = (data: AppVO) => {
+export const updateApp = (data: AppVO) => {
return request.put({ url: '/pay/app/update', data })
}
// 支付应用信息状态修改
-export const changeAppStatusApi = (data: AppUpdateStatusReqVO) => {
+export const changeAppStatus = (data: AppUpdateStatusReqVO) => {
return request.put({ url: '/pay/app/update-status', data: data })
}
// 删除支付应用
-export const deleteAppApi = (id: number) => {
+export const deleteApp = (id: number) => {
return request.delete({ url: '/pay/app/delete?id=' + id })
}
// 导出支付应用
-export const exportAppApi = (params: AppExportReqVO) => {
+export const exportApp = (params: AppExportReqVO) => {
return request.download({ url: '/pay/app/export-excel', params })
}
// 根据商ID称搜索应用列表
-export const getAppListByMerchantIdApi = (merchantId: number) => {
+export const getAppListByMerchantId = (merchantId: number) => {
return request.get({ url: '/pay/app/list-merchant-id', params: { merchantId: merchantId } })
}
diff --git a/src/api/pay/channel/index.ts b/src/api/pay/channel/index.ts
index a6da9eb8..b030357e 100644
--- a/src/api/pay/channel/index.ts
+++ b/src/api/pay/channel/index.ts
@@ -12,35 +12,13 @@ export interface ChannelVO {
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) => {
+export const getChannelPage = (params: PageParam) => {
return request.get({ url: '/pay/channel/page', params })
}
// 查询详情支付渠道
-export const getChannelApi = (merchantId: number, appId: string, code: string) => {
+export const getChannel = (merchantId: number, appId: string, code: string) => {
const params = {
merchantId: merchantId,
appId: appId,
@@ -50,21 +28,21 @@ export const getChannelApi = (merchantId: number, appId: string, code: string) =
}
// 新增支付渠道
-export const createChannelApi = (data: ChannelVO) => {
+export const createChannel = (data: ChannelVO) => {
return request.post({ url: '/pay/channel/create', data })
}
// 修改支付渠道
-export const updateChannelApi = (data: ChannelVO) => {
+export const updateChannel = (data: ChannelVO) => {
return request.put({ url: '/pay/channel/update', data })
}
// 删除支付渠道
-export const deleteChannelApi = (id: number) => {
+export const deleteChannel = (id: number) => {
return request.delete({ url: '/pay/channel/delete?id=' + id })
}
// 导出支付渠道
-export const exportChannelApi = (params: ChannelExportReqVO) => {
+export const exportChannel = (params) => {
return request.download({ url: '/pay/channel/export-excel', params })
}
diff --git a/src/api/pay/order/index.ts b/src/api/pay/order/index.ts
index 53e35aa9..6088c172 100644
--- a/src/api/pay/order/index.ts
+++ b/src/api/pay/order/index.ts
@@ -79,31 +79,31 @@ export interface OrderExportReqVO {
}
// 查询列表支付订单
-export const getOrderPageApi = async (params: OrderPageReqVO) => {
+export const getOrderPage = async (params: OrderPageReqVO) => {
return await request.get({ url: '/pay/order/page', params })
}
// 查询详情支付订单
-export const getOrderApi = async (id: number) => {
+export const getOrder = async (id: number) => {
return await request.get({ url: '/pay/order/get?id=' + id })
}
// 新增支付订单
-export const createOrderApi = async (data: OrderVO) => {
+export const createOrder = async (data: OrderVO) => {
return await request.post({ url: '/pay/order/create', data })
}
// 修改支付订单
-export const updateOrderApi = async (data: OrderVO) => {
+export const updateOrder = async (data: OrderVO) => {
return await request.put({ url: '/pay/order/update', data })
}
// 删除支付订单
-export const deleteOrderApi = async (id: number) => {
+export const deleteOrder = async (id: number) => {
return await request.delete({ url: '/pay/order/delete?id=' + id })
}
// 导出支付订单
-export const exportOrderApi = async (params: OrderExportReqVO) => {
+export const exportOrder = async (params: OrderExportReqVO) => {
return await request.download({ url: '/pay/order/export-excel', params })
}
diff --git a/src/api/pay/refund/index.ts b/src/api/pay/refund/index.ts
index cd68a144..4b587f22 100644
--- a/src/api/pay/refund/index.ts
+++ b/src/api/pay/refund/index.ts
@@ -86,31 +86,31 @@ export interface PayRefundExportReqVO {
}
// 查询列表退款订单
-export const getRefundPageApi = (params: RefundPageReqVO) => {
+export const getRefundPage = (params: RefundPageReqVO) => {
return request.get({ url: '/pay/refund/page', params })
}
// 查询详情退款订单
-export const getRefundApi = (id: number) => {
+export const getRefund = (id: number) => {
return request.get({ url: '/pay/refund/get?id=' + id })
}
// 新增退款订单
-export const createRefundApi = (data: RefundVO) => {
+export const createRefund = (data: RefundVO) => {
return request.post({ url: '/pay/refund/create', data })
}
// 修改退款订单
-export const updateRefundApi = (data: RefundVO) => {
+export const updateRefund = (data: RefundVO) => {
return request.put({ url: '/pay/refund/update', data })
}
// 删除退款订单
-export const deleteRefundApi = (id: number) => {
+export const deleteRefund = (id: number) => {
return request.delete({ url: '/pay/refund/delete?id=' + id })
}
// 导出退款订单
-export const exportRefundApi = (params: PayRefundExportReqVO) => {
+export const exportRefund = (params: PayRefundExportReqVO) => {
return request.download({ url: '/pay/refund/export-excel', params })
}
diff --git a/src/api/system/dept/index.ts b/src/api/system/dept/index.ts
index e9c31fd7..d995f13d 100644
--- a/src/api/system/dept/index.ts
+++ b/src/api/system/dept/index.ts
@@ -12,37 +12,32 @@ export interface DeptVO {
createTime: Date
}
-export interface DeptPageReqVO {
- name?: string
- status?: number
-}
-
// 查询部门(精简)列表
export const getSimpleDeptList = async (): Promise 发起人:${processInstance.value.startUser.nickname} 部门:${processInstance.value.startUser.deptName} 创建时间:${parseTime(processInstance.value.createTime)}`
+ 创建时间:${formatDate(processInstance.value.createTime)}`
} else if (element.value.type === 'bpmn:UserTask') {
// debugger
let task = taskList.value.find((m) => m.id === activity.taskId) // 找到活动对应的 taskId
@@ -297,26 +297,26 @@ const elementHover = (element) => {
html = ` 审批人:${task.assigneeUser.nickname} 部门:${task.assigneeUser.deptName} 结果:${dataResult} 创建时间:${parseTime(task.createTime)} 创建时间:${formatDate(task.createTime)} 审批人:${task.assigneeUser.nickname} 部门:${task.assigneeUser.deptName} 结果:${getIntDictOptions(
// DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT,
// task.result
// )} 创建时间:${parseTime(task.createTime)} 创建时间:${formatDate(task.createTime)} 结束时间:${parseTime(task.endTime)} 结束时间:${formatDate(task.endTime)} 审批建议:${task.reason} 创建时间:${parseTime(activity.startTime)} 创建时间:${formatDate(activity.startTime)} 结束时间:${parseTime(activity.endTime)} 结束时间:${formatDate(activity.endTime)}
结束时间:${parseTime(processInstance.value.endTime)}
` + html += `结束时间:${formatDate(processInstance.value.endTime)}
` } } console.log(html, 'html111111111111111') @@ -348,50 +348,6 @@ const elementOut = (element) => { toRaw(overlays.value).remove({ element }) elementOverlayIds.value[element.id] = null } -const parseTime = (time) => { - if (!time) { - return null - } - const format = '{y}-{m}-{d} {h}:{i}:{s}' - let date - if (typeof time === 'object') { - date = time - } else { - if (typeof time === 'string' && /^[0-9]+$/.test(time)) { - time = parseInt(time) - } else if (typeof time === 'string') { - time = time - .replace(new RegExp(/-/gm), '/') - .replace('T', ' ') - .replace(new RegExp(/\.[\d]{3}/gm), '') - } - if (typeof time === 'number' && time.toString().length === 10) { - time = time * 1000 - } - date = new Date(time) - } - const formatObj = { - y: date.getFullYear(), - m: date.getMonth() + 1, - d: date.getDate(), - h: date.getHours(), - i: date.getMinutes(), - s: date.getSeconds(), - a: date.getDay() - } - const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { - let value = formatObj[key] - // Note: getDay() returns 0 on Sunday - if (key === 'a') { - return ['日', '一', '二', '三', '四', '五', '六'][value] - } - if (result.length > 0 && value < 10) { - value = '0' + value - } - return value || 0 - }) - return time_str -} onMounted(() => { xml.value = props.value diff --git a/src/config/axios/service.ts b/src/config/axios/service.ts index 4ec38a68..fb205a6b 100644 --- a/src/config/axios/service.ts +++ b/src/config/axios/service.ts @@ -219,21 +219,19 @@ const handleAuthorized = () => { if (!isRelogin.show) { isRelogin.show = true ElMessageBox.confirm(t('sys.api.timeoutMessage'), t('common.confirmTitle'), { + showCancelButton: false, + closeOnClickModal: false, + showClose: false, confirmButtonText: t('login.relogin'), - cancelButtonText: t('common.cancel'), type: 'warning' + }).then(() => { + const { wsCache } = useCache() + resetRouter() // 重置静态路由表 + wsCache.clear() + removeToken() + isRelogin.show = false + window.location.href = import.meta.env.VITE_BASE_PATH }) - .then(() => { - const { wsCache } = useCache() - resetRouter() // 重置静态路由表 - wsCache.clear() - removeToken() - isRelogin.show = false - window.location.href = import.meta.env.VITE_BASE_PATH - }) - .catch(() => { - isRelogin.show = false - }) } return Promise.reject(t('sys.api.timeoutMessage')) } diff --git a/src/layout/components/Message/src/Message.vue b/src/layout/components/Message/src/Message.vue index 4ac85860..d968eb6f 100644 --- a/src/layout/components/Message/src/Message.vue +++ b/src/layout/components/Message/src/Message.vue @@ -1,5 +1,5 @@ diff --git a/src/views/Profile/components/UserSocial.vue b/src/views/Profile/components/UserSocial.vue index 35cce076..da88d993 100644 --- a/src/views/Profile/components/UserSocial.vue +++ b/src/views/Profile/components/UserSocial.vue @@ -23,7 +23,7 @@ diff --git a/src/views/bpm/task/done/done.data.ts b/src/views/bpm/task/done/done.data.ts deleted file mode 100644 index 5944671f..00000000 --- a/src/views/bpm/task/done/done.data.ts +++ /dev/null @@ -1,52 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' - -const { t } = useI18n() // 国际化 - -// crudSchemas -const crudSchemas = reactive