diff --git a/build/vite/index.ts b/build/vite/index.ts index dcec1aed..7d3aa5be 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({ + // 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 683d09eb..b7629029 100644 --- a/package.json +++ b/package.json @@ -122,6 +122,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/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue b/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue index a206c45b..a90d468e 100644 --- a/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue +++ b/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue @@ -280,7 +280,7 @@ const elementHover = (element) => { if (element.value.type === 'bpmn:StartEvent' && processInstance.value) { html = `
发起人:${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)}
` // html = `审批人:${task.assigneeUser.nickname}
//部门:${task.assigneeUser.deptName}
//结果:${getIntDictOptions( // DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, // task.result // )}
- //创建时间:${parseTime(task.createTime)}
` + //创建时间:${formatDate(task.createTime)}
` if (task.endTime) { - html += `结束时间:${parseTime(task.endTime)}
` + html += `结束时间:${formatDate(task.endTime)}
` } if (task.reason) { html += `审批建议:${task.reason}
` } } else if (element.value.type === 'bpmn:ServiceTask' && processInstance.value) { if (activity.startTime > 0) { - html = `创建时间:${parseTime(activity.startTime)}
` + html = `创建时间:${formatDate(activity.startTime)}
` } if (activity.endTime > 0) { - html += `结束时间:${parseTime(activity.endTime)}
` + html += `结束时间:${formatDate(activity.endTime)}
` } console.log(html) } else if (element.value.type === 'bpmn:EndEvent' && processInstance.value) { @@ -333,7 +333,7 @@ const elementHover = (element) => { // processInstance.value.result // )}` if (processInstance.value.endTime) { - html += `结束时间:${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 7109615b..afe75d8a 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 = '/' }) - .then(() => { - const { wsCache } = useCache() - resetRouter() // 重置静态路由表 - wsCache.clear() - removeToken() - isRelogin.show = false - window.location.href = '/' - }) - .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..d42a51c0 100644 --- a/src/layout/components/Message/src/Message.vue +++ b/src/layout/components/Message/src/Message.vue @@ -1,5 +1,5 @@