From ba5985943bad95d977d5753ca6a6d26a77e12429 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Thu, 30 Mar 2023 16:04:46 +0800 Subject: [PATCH 1/4] =?UTF-8?q?update:=20=E8=A7=A3=E5=86=B3=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E9=81=AE=E7=BD=A9=E5=B1=82=E5=BC=B9=E7=AA=97=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E5=90=8E=EF=BC=8C=E9=A1=B5=E9=9D=A2=E5=B0=B1=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E4=B8=8D=E4=BA=86=E4=BA=86=E4=BC=9A=E4=B8=80=E7=9B=B4?= =?UTF-8?q?=E8=BD=AC=E5=9C=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/vite/index.ts | 1 + src/config/axios/service.ts | 22 ++++++++++------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/build/vite/index.ts b/build/vite/index.ts index dcec1aed..fa7e04e8 100644 --- a/build/vite/index.ts +++ b/build/vite/index.ts @@ -6,6 +6,7 @@ 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' 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')) } From 5459fadafd863e2e49b6fef5b7f1cd063dde7740 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Thu, 30 Mar 2023 16:13:43 +0800 Subject: [PATCH 2/4] update: @ts-ignore --- src/plugins/vxeTable/renderer/preview.tsx | 1 + src/store/modules/dict.ts | 1 + src/types/auto-components.d.ts | 1 + src/utils/tree.ts | 2 ++ 4 files changed, 5 insertions(+) diff --git a/src/plugins/vxeTable/renderer/preview.tsx b/src/plugins/vxeTable/renderer/preview.tsx index 3cb1270b..a737dd51 100644 --- a/src/plugins/vxeTable/renderer/preview.tsx +++ b/src/plugins/vxeTable/renderer/preview.tsx @@ -25,6 +25,7 @@ VXETable.renderer.add('XPreview', { ) } else { return ( + // @ts-ignore {row[column.field]} diff --git a/src/store/modules/dict.ts b/src/store/modules/dict.ts index 2d393e43..822547bf 100644 --- a/src/store/modules/dict.ts +++ b/src/store/modules/dict.ts @@ -1,5 +1,6 @@ import { defineStore } from 'pinia' import { store } from '../index' +// @ts-ignore import { DictDataVO } from '@/api/system/dict/types' import { CACHE_KEY, useCache } from '@/hooks/web/useCache' const { wsCache } = useCache('sessionStorage') diff --git a/src/types/auto-components.d.ts b/src/types/auto-components.d.ts index a04c98b3..2a42203d 100644 --- a/src/types/auto-components.d.ts +++ b/src/types/auto-components.d.ts @@ -70,6 +70,7 @@ declare module '@vue/runtime-core' { ElTabPane: typeof import('element-plus/es')['ElTabPane'] ElTabs: typeof import('element-plus/es')['ElTabs'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] + ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect'] ElUpload: typeof import('element-plus/es')['ElUpload'] Error: typeof import('./../components/Error/src/Error.vue')['default'] FlowCondition: typeof import('./../components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue')['default'] diff --git a/src/utils/tree.ts b/src/utils/tree.ts index 20f97a38..51a64bd1 100644 --- a/src/utils/tree.ts +++ b/src/utils/tree.ts @@ -265,6 +265,7 @@ export const handleTree = (data: any[], id?: string, parentId?: string, children } return tree } + /** * 构造树型结构数据 * @param {*} data 数据源 @@ -273,6 +274,7 @@ export const handleTree = (data: any[], id?: string, parentId?: string, children * @param {*} children 孩子节点字段 默认 'children' * @param {*} rootId 根Id 默认 0 */ +// @ts-ignore export const handleTree2 = (data, id, parentId, children, rootId) => { id = id || 'id' parentId = parentId || 'parentId' From dc1393411c5cc7d43d349ce720dca789e8f224b0 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Tue, 4 Apr 2023 11:19:58 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E4=BD=BF=E7=94=A8formatDate=E6=96=B9=E6=B3=95=E7=A7=BB?= =?UTF-8?q?=E9=99=A4parseTime=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../package/designer/ProcessViewer.vue | 58 +++---------------- src/layout/components/Message/src/Message.vue | 4 +- src/types/auto-components.d.ts | 7 --- src/utils/formatTime.ts | 50 +--------------- src/views/Profile/components/ProfileUser.vue | 4 +- .../detail/ProcessInstanceTaskList.vue | 6 +- src/views/infra/webSocket/index.vue | 4 +- .../mp/components/wx-material-select/main.vue | 8 +-- src/views/mp/components/wx-msg/main.vue | 6 +- .../notify/my/MyNotifyMessageDetail.vue | 4 +- 10 files changed, 26 insertions(+), 125 deletions(-) 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/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 @@