From c4fc9ee565a3f64cdc56722b98ad61657adc2379 Mon Sep 17 00:00:00 2001 From: gexinzhineng/gxzn27 <1348660141@qq.com> Date: Fri, 31 Mar 2023 16:40:26 +0800 Subject: [PATCH 01/16] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9B=B8=E5=BA=94bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 - src/views/bpm/form/formEditor.vue | 27 +- src/views/infra/build/index.vue | 27 +- .../infra/codegen/components/Preview.vue | 4 +- src/views/infra/config/config.data.ts | 3 +- src/views/infra/config/index.vue | 22 +- src/views/infra/fileList/index.vue | 43 +- src/views/infra/job/JobLog.vue | 236 +++------ src/views/infra/job/JobLogView.vue | 74 --- src/views/infra/job/form.vue | 172 ------ src/views/infra/job/index.vue | 490 +++++++++--------- src/views/infra/job/job.data.ts | 70 +++ src/views/infra/job/jobLog.data.ts | 76 +++ src/views/infra/job/utils.ts | 44 -- src/views/infra/job/view.vue | 89 ---- src/views/system/notice/index.vue | 271 +++++----- src/views/system/notice/notice.data.ts | 59 +++ src/views/system/user/user.data.ts | 12 +- 18 files changed, 730 insertions(+), 992 deletions(-) delete mode 100644 src/views/infra/job/JobLogView.vue delete mode 100644 src/views/infra/job/form.vue create mode 100644 src/views/infra/job/job.data.ts create mode 100644 src/views/infra/job/jobLog.data.ts delete mode 100644 src/views/infra/job/utils.ts delete mode 100644 src/views/infra/job/view.vue create mode 100644 src/views/system/notice/notice.data.ts diff --git a/.gitignore b/.gitignore index 3efc9c52..0b05e6a6 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,3 @@ dist-ssr /dist* *-lock.* pnpm-debug - -.idea -.history \ No newline at end of file diff --git a/src/views/bpm/form/formEditor.vue b/src/views/bpm/form/formEditor.vue index 989ea56e..418a75e8 100644 --- a/src/views/bpm/form/formEditor.vue +++ b/src/views/bpm/form/formEditor.vue @@ -133,15 +133,24 @@ const openModel = (title: string) => { } /** 复制 **/ const copy = async (text: string) => { - const { copy, copied, isSupported } = useClipboard({ source: text }) - if (!isSupported) { - message.error(t('common.copyError')) - } else { - await copy() - if (unref(copied)) { - message.success(t('common.copySuccess')) - } - } + // const { copy, copied, isSupported } = useClipboard({ source: JSON.stringify(text) }) + // if (!isSupported.value) { + // message.error(t('common.copyError')) + // } else { + // await copy() + // if (unref(copied.value)) { + // message.success(t('common.copySuccess')) + // } + // } + let url = JSON.stringify(text) + let oInput = document.createElement('textarea') + oInput.value = url + document.body.appendChild(oInput) + oInput.select() // 选择对象; + // console.log(oInput.value) + document.execCommand('Copy') // 执行浏览器复制命令 + message.success(t('common.copySuccess')) + oInput.remove() } // ========== 初始化 ========== onMounted(() => { diff --git a/src/views/infra/build/index.vue b/src/views/infra/build/index.vue index 6f577e95..b3af638b 100644 --- a/src/views/infra/build/index.vue +++ b/src/views/infra/build/index.vue @@ -77,15 +77,24 @@ const showTemplate = () => { /** 复制 **/ const copy = async (text: string) => { - const { copy, copied, isSupported } = useClipboard({ source: text }) - if (!isSupported) { - message.error(t('common.copyError')) - } else { - await copy() - if (unref(copied)) { - message.success(t('common.copySuccess')) - } - } + // const { copy, copied, isSupported } = useClipboard({ source: JSON.stringify(text) }) + // if (!isSupported.value) { + // message.error(t('common.copyError')) + // } else { + // await copy() + // if (unref(copied.value)) { + // message.success(t('common.copySuccess')) + // } + // } + let url = JSON.stringify(text) + let oInput = document.createElement('textarea') + oInput.value = url + document.body.appendChild(oInput) + oInput.select() // 选择对象; + // console.log(oInput.value) + document.execCommand('Copy') // 执行浏览器复制命令 + message.success(t('common.copySuccess')) + oInput.remove() } const makeTemplate = () => { diff --git a/src/views/infra/codegen/components/Preview.vue b/src/views/infra/codegen/components/Preview.vue index 2d9482ff..6a6246a8 100644 --- a/src/views/infra/codegen/components/Preview.vue +++ b/src/views/infra/codegen/components/Preview.vue @@ -130,11 +130,11 @@ const handleFiles = (datas: CodegenPreviewVO[]) => { /** 复制 **/ const copy = async (text: string) => { const { copy, copied, isSupported } = useClipboard({ source: text }) - if (!isSupported) { + if (!isSupported.value) { message.error(t('common.copyError')) } else { await copy() - if (unref(copied)) { + if (unref(copied.value)) { message.success(t('common.copySuccess')) } } diff --git a/src/views/infra/config/config.data.ts b/src/views/infra/config/config.data.ts index 41acfa15..635745a5 100644 --- a/src/views/infra/config/config.data.ts +++ b/src/views/infra/config/config.data.ts @@ -6,7 +6,8 @@ export const rules = reactive({ category: [required], name: [required], key: [required], - value: [required] + value: [required], + visible: [{ required: true, message: '请选择是否可见', trigger: 'change' }] }) // CrudSchema diff --git a/src/views/infra/config/index.vue b/src/views/infra/config/index.vue index b2bc8a8b..ddf9eeba 100644 --- a/src/views/infra/config/index.vue +++ b/src/views/infra/config/index.vue @@ -93,8 +93,8 @@ const message = useMessage() // 消息弹窗 // 列表相关的变量 const [registerTable, { reload, deleteData, exportList }] = useXTable({ allSchemas: allSchemas, - getListApi: ConfigApi.getConfigPageApi, - deleteApi: ConfigApi.deleteConfigApi, + getListApi: ConfigApi.getConfigPage, + deleteApi: ConfigApi.deleteConfig, exportListApi: ConfigApi.exportConfigApi }) @@ -127,14 +127,6 @@ const handleCreate = async () => { }, 2 ) - unref(formRef)?.addSchema( - { - field: 'value', - label: '参数键值', - component: 'Input' - }, - 3 - ) } } @@ -142,17 +134,15 @@ const handleCreate = async () => { const handleUpdate = async (rowId: number) => { setDialogTile('update') // 设置数据 - const res = await ConfigApi.getConfigApi(rowId) + const res = await ConfigApi.getConfig(rowId) unref(formRef)?.delSchema('key') - unref(formRef)?.delSchema('value') - unref(formRef)?.setValues(res) } // 详情操作 const handleDetail = async (rowId: number) => { setDialogTile('detail') - const res = await ConfigApi.getConfigApi(rowId) + const res = await ConfigApi.getConfig(rowId) detailData.value = res } @@ -167,10 +157,10 @@ const submitForm = async () => { try { const data = unref(formRef)?.formModel as ConfigApi.ConfigVO if (actionType.value === 'create') { - await ConfigApi.createConfigApi(data) + await ConfigApi.createConfig(data) message.success(t('common.createSuccess')) } else { - await ConfigApi.updateConfigApi(data) + await ConfigApi.updateConfig(data) message.success(t('common.updateSuccess')) } dialogVisible.value = false diff --git a/src/views/infra/fileList/index.vue b/src/views/infra/fileList/index.vue index b9bfb815..2309d05c 100644 --- a/src/views/infra/fileList/index.vue +++ b/src/views/infra/fileList/index.vue @@ -59,6 +59,7 @@ :on-exceed="handleExceed" :on-success="handleFileSuccess" :on-error="excelUploadError" + :on-change="handleFileChange" :before-remove="beforeRemove" :auto-upload="false" accept=".jpg, .png, .gif" @@ -83,7 +84,7 @@ diff --git a/src/views/infra/job/JobLog.vue b/src/views/infra/job/JobLog.vue index daa20046..1771bbd7 100644 --- a/src/views/infra/job/JobLog.vue +++ b/src/views/infra/job/JobLog.vue @@ -1,179 +1,77 @@ - diff --git a/src/views/infra/job/JobLogView.vue b/src/views/infra/job/JobLogView.vue deleted file mode 100644 index c66e0d80..00000000 --- a/src/views/infra/job/JobLogView.vue +++ /dev/null @@ -1,74 +0,0 @@ - - diff --git a/src/views/infra/job/form.vue b/src/views/infra/job/form.vue deleted file mode 100644 index 24488fd7..00000000 --- a/src/views/infra/job/form.vue +++ /dev/null @@ -1,172 +0,0 @@ - - diff --git a/src/views/infra/job/index.vue b/src/views/infra/job/index.vue index 702b31fe..613f84c4 100644 --- a/src/views/infra/job/index.vue +++ b/src/views/infra/job/index.vue @@ -1,175 +1,243 @@ - diff --git a/src/views/infra/job/job.data.ts b/src/views/infra/job/job.data.ts new file mode 100644 index 00000000..1ca4a564 --- /dev/null +++ b/src/views/infra/job/job.data.ts @@ -0,0 +1,70 @@ +import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' +const { t } = useI18n() // 国际化 +// 表单校验 + +export const rules = reactive({ + name: [required], + handlerName: [required], + cronExpression: [required], + retryCount: [required], + retryInterval: [required] +}) +// CrudSchema +const crudSchemas = reactive({ + primaryKey: 'id', + primaryType: 'id', + primaryTitle: '任务编号', + action: true, + actionWidth: '280px', + columns: [ + { + title: '任务名称', + field: 'name', + isSearch: true + }, + { + title: t('common.status'), + field: 'status', + dictType: DICT_TYPE.INFRA_JOB_STATUS, + dictClass: 'number', + isForm: false, + isSearch: true + }, + { + title: '处理器的名字', + field: 'handlerName', + isSearch: true + }, + { + title: '处理器的参数', + field: 'handlerParam', + isTable: false + }, + { + title: 'CRON 表达式', + field: 'cronExpression' + }, + { + title: '后续执行时间', + field: 'nextTimes', + isTable: false, + isForm: false + }, + { + title: '重试次数', + field: 'retryCount', + isTable: false + }, + { + title: '重试间隔', + field: 'retryInterval', + isTable: false + }, + { + title: '监控超时时间', + field: 'monitorTimeout', + isTable: false + } + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/infra/job/jobLog.data.ts b/src/views/infra/job/jobLog.data.ts new file mode 100644 index 00000000..563c097c --- /dev/null +++ b/src/views/infra/job/jobLog.data.ts @@ -0,0 +1,76 @@ +import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' +// 国际化 + +const { t } = useI18n() +// CrudSchema +const crudSchemas = reactive({ + primaryKey: 'id', + primaryType: 'id', + primaryTitle: '日志编号', + action: true, + columns: [ + { + title: '任务编号', + field: 'jobId', + isSearch: true + }, + { + title: '处理器的名字', + field: 'handlerName', + isSearch: true + }, + { + title: '处理器的参数', + field: 'handlerParam' + }, + { + title: '第几次执行', + field: 'executeIndex' + }, + { + title: '开始执行时间', + field: 'beginTime', + formatter: 'formatDate', + table: { + slots: { + default: 'beginTime_default' + } + }, + search: { + show: true, + itemRender: { + name: 'XDataPicker' + } + } + }, + { + title: '结束执行时间', + field: 'endTime', + formatter: 'formatDate', + isTable: false, + search: { + show: true, + itemRender: { + name: 'XDataPicker' + } + } + }, + { + title: '执行时长', + field: 'duration', + table: { + slots: { + default: 'duration_default' + } + } + }, + { + title: t('common.status'), + field: 'status', + dictType: DICT_TYPE.INFRA_JOB_LOG_STATUS, + dictClass: 'number', + isSearch: true + } + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/infra/job/utils.ts b/src/views/infra/job/utils.ts deleted file mode 100644 index a3774f22..00000000 --- a/src/views/infra/job/utils.ts +++ /dev/null @@ -1,44 +0,0 @@ -export 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 -} diff --git a/src/views/infra/job/view.vue b/src/views/infra/job/view.vue deleted file mode 100644 index d195e0e3..00000000 --- a/src/views/infra/job/view.vue +++ /dev/null @@ -1,89 +0,0 @@ - - diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue index 8add0eab..aceadbba 100644 --- a/src/views/system/notice/index.vue +++ b/src/views/system/notice/index.vue @@ -1,159 +1,148 @@ - diff --git a/src/views/system/notice/notice.data.ts b/src/views/system/notice/notice.data.ts new file mode 100644 index 00000000..7a72a723 --- /dev/null +++ b/src/views/system/notice/notice.data.ts @@ -0,0 +1,59 @@ +import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' +const { t } = useI18n() // 国际化 + +// 表单校验 +export const rules = reactive({ + title: [required], + type: [required] +}) + +// CrudSchema +const crudSchemas = reactive({ + primaryKey: 'id', + primaryType: 'seq', + action: true, + columns: [ + { + title: '公告标题', + field: 'title', + isSearch: true + }, + { + title: '公告类型', + field: 'type', + dictType: DICT_TYPE.SYSTEM_NOTICE_TYPE, + dictClass: 'number' + }, + { + title: t('common.status'), + field: 'status', + dictType: DICT_TYPE.COMMON_STATUS, + dictClass: 'number', + isSearch: true + }, + { + title: '公告内容', + field: 'content', + table: { + type: 'html' + }, + form: { + component: 'Editor', + colProps: { + span: 24 + }, + componentProps: { + valueHtml: '' + } + }, + isTable: false + }, + { + title: t('common.createTime'), + field: 'createTime', + formatter: 'formatDate', + isForm: false + } + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/system/user/user.data.ts b/src/views/system/user/user.data.ts index 7f7384eb..2ea4d268 100644 --- a/src/views/system/user/user.data.ts +++ b/src/views/system/user/user.data.ts @@ -28,7 +28,7 @@ export const rules = reactive({ } ], status: [required], - postIds: [{ required: true, message: '请选择岗位', trigger: ['blur', 'change'] }], + postIds: [required], mobile: [ required, { @@ -86,11 +86,6 @@ const crudSchemas = reactive({ field: 'deptId', isTable: false }, - { - title: '岗位', - field: 'postIds', - isTable: false - }, { title: t('common.status'), field: 'status', @@ -103,6 +98,11 @@ const crudSchemas = reactive({ } } }, + { + title: '岗位', + field: 'postIds', + isTable: false + }, { title: '最后登录时间', field: 'loginDate', From c964ca78ee0bb85958d44fd2f5b81c16a0f5c3f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=8B=E9=81=93=E6=BA=90=E7=A0=81?= Date: Sun, 2 Apr 2023 14:48:43 +0000 Subject: [PATCH 02/16] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!8?= =?UTF-8?q?4=20:=20=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95=E6=89=80=E6=8F=90b?= =?UTF-8?q?ug'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 + src/views/bpm/form/formEditor.vue | 27 +- src/views/infra/build/index.vue | 27 +- .../infra/codegen/components/Preview.vue | 4 +- src/views/infra/config/config.data.ts | 3 +- src/views/infra/config/index.vue | 22 +- src/views/infra/fileList/index.vue | 43 +- src/views/infra/job/JobLog.vue | 236 ++++++--- src/views/infra/job/JobLogView.vue | 74 +++ src/views/infra/job/form.vue | 172 ++++++ src/views/infra/job/index.vue | 490 +++++++++--------- src/views/infra/job/job.data.ts | 70 --- src/views/infra/job/jobLog.data.ts | 76 --- src/views/infra/job/utils.ts | 44 ++ src/views/infra/job/view.vue | 89 ++++ src/views/system/notice/index.vue | 269 +++++----- src/views/system/notice/notice.data.ts | 59 --- src/views/system/user/user.data.ts | 12 +- 18 files changed, 991 insertions(+), 729 deletions(-) create mode 100644 src/views/infra/job/JobLogView.vue create mode 100644 src/views/infra/job/form.vue delete mode 100644 src/views/infra/job/job.data.ts delete mode 100644 src/views/infra/job/jobLog.data.ts create mode 100644 src/views/infra/job/utils.ts create mode 100644 src/views/infra/job/view.vue delete mode 100644 src/views/system/notice/notice.data.ts diff --git a/.gitignore b/.gitignore index 0b05e6a6..3efc9c52 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,6 @@ dist-ssr /dist* *-lock.* pnpm-debug + +.idea +.history \ No newline at end of file diff --git a/src/views/bpm/form/formEditor.vue b/src/views/bpm/form/formEditor.vue index 418a75e8..989ea56e 100644 --- a/src/views/bpm/form/formEditor.vue +++ b/src/views/bpm/form/formEditor.vue @@ -133,24 +133,15 @@ const openModel = (title: string) => { } /** 复制 **/ const copy = async (text: string) => { - // const { copy, copied, isSupported } = useClipboard({ source: JSON.stringify(text) }) - // if (!isSupported.value) { - // message.error(t('common.copyError')) - // } else { - // await copy() - // if (unref(copied.value)) { - // message.success(t('common.copySuccess')) - // } - // } - let url = JSON.stringify(text) - let oInput = document.createElement('textarea') - oInput.value = url - document.body.appendChild(oInput) - oInput.select() // 选择对象; - // console.log(oInput.value) - document.execCommand('Copy') // 执行浏览器复制命令 - message.success(t('common.copySuccess')) - oInput.remove() + const { copy, copied, isSupported } = useClipboard({ source: text }) + if (!isSupported) { + message.error(t('common.copyError')) + } else { + await copy() + if (unref(copied)) { + message.success(t('common.copySuccess')) + } + } } // ========== 初始化 ========== onMounted(() => { diff --git a/src/views/infra/build/index.vue b/src/views/infra/build/index.vue index b3af638b..6f577e95 100644 --- a/src/views/infra/build/index.vue +++ b/src/views/infra/build/index.vue @@ -77,24 +77,15 @@ const showTemplate = () => { /** 复制 **/ const copy = async (text: string) => { - // const { copy, copied, isSupported } = useClipboard({ source: JSON.stringify(text) }) - // if (!isSupported.value) { - // message.error(t('common.copyError')) - // } else { - // await copy() - // if (unref(copied.value)) { - // message.success(t('common.copySuccess')) - // } - // } - let url = JSON.stringify(text) - let oInput = document.createElement('textarea') - oInput.value = url - document.body.appendChild(oInput) - oInput.select() // 选择对象; - // console.log(oInput.value) - document.execCommand('Copy') // 执行浏览器复制命令 - message.success(t('common.copySuccess')) - oInput.remove() + const { copy, copied, isSupported } = useClipboard({ source: text }) + if (!isSupported) { + message.error(t('common.copyError')) + } else { + await copy() + if (unref(copied)) { + message.success(t('common.copySuccess')) + } + } } const makeTemplate = () => { diff --git a/src/views/infra/codegen/components/Preview.vue b/src/views/infra/codegen/components/Preview.vue index 6a6246a8..2d9482ff 100644 --- a/src/views/infra/codegen/components/Preview.vue +++ b/src/views/infra/codegen/components/Preview.vue @@ -130,11 +130,11 @@ const handleFiles = (datas: CodegenPreviewVO[]) => { /** 复制 **/ const copy = async (text: string) => { const { copy, copied, isSupported } = useClipboard({ source: text }) - if (!isSupported.value) { + if (!isSupported) { message.error(t('common.copyError')) } else { await copy() - if (unref(copied.value)) { + if (unref(copied)) { message.success(t('common.copySuccess')) } } diff --git a/src/views/infra/config/config.data.ts b/src/views/infra/config/config.data.ts index 635745a5..41acfa15 100644 --- a/src/views/infra/config/config.data.ts +++ b/src/views/infra/config/config.data.ts @@ -6,8 +6,7 @@ export const rules = reactive({ category: [required], name: [required], key: [required], - value: [required], - visible: [{ required: true, message: '请选择是否可见', trigger: 'change' }] + value: [required] }) // CrudSchema diff --git a/src/views/infra/config/index.vue b/src/views/infra/config/index.vue index ddf9eeba..b2bc8a8b 100644 --- a/src/views/infra/config/index.vue +++ b/src/views/infra/config/index.vue @@ -93,8 +93,8 @@ const message = useMessage() // 消息弹窗 // 列表相关的变量 const [registerTable, { reload, deleteData, exportList }] = useXTable({ allSchemas: allSchemas, - getListApi: ConfigApi.getConfigPage, - deleteApi: ConfigApi.deleteConfig, + getListApi: ConfigApi.getConfigPageApi, + deleteApi: ConfigApi.deleteConfigApi, exportListApi: ConfigApi.exportConfigApi }) @@ -127,6 +127,14 @@ const handleCreate = async () => { }, 2 ) + unref(formRef)?.addSchema( + { + field: 'value', + label: '参数键值', + component: 'Input' + }, + 3 + ) } } @@ -134,15 +142,17 @@ const handleCreate = async () => { const handleUpdate = async (rowId: number) => { setDialogTile('update') // 设置数据 - const res = await ConfigApi.getConfig(rowId) + const res = await ConfigApi.getConfigApi(rowId) unref(formRef)?.delSchema('key') + unref(formRef)?.delSchema('value') + unref(formRef)?.setValues(res) } // 详情操作 const handleDetail = async (rowId: number) => { setDialogTile('detail') - const res = await ConfigApi.getConfig(rowId) + const res = await ConfigApi.getConfigApi(rowId) detailData.value = res } @@ -157,10 +167,10 @@ const submitForm = async () => { try { const data = unref(formRef)?.formModel as ConfigApi.ConfigVO if (actionType.value === 'create') { - await ConfigApi.createConfig(data) + await ConfigApi.createConfigApi(data) message.success(t('common.createSuccess')) } else { - await ConfigApi.updateConfig(data) + await ConfigApi.updateConfigApi(data) message.success(t('common.updateSuccess')) } dialogVisible.value = false diff --git a/src/views/infra/fileList/index.vue b/src/views/infra/fileList/index.vue index 2309d05c..b9bfb815 100644 --- a/src/views/infra/fileList/index.vue +++ b/src/views/infra/fileList/index.vue @@ -59,7 +59,6 @@ :on-exceed="handleExceed" :on-success="handleFileSuccess" :on-error="excelUploadError" - :on-change="handleFileChange" :before-remove="beforeRemove" :auto-upload="false" accept=".jpg, .png, .gif" @@ -84,7 +83,7 @@ diff --git a/src/views/infra/job/JobLog.vue b/src/views/infra/job/JobLog.vue index 1771bbd7..daa20046 100644 --- a/src/views/infra/job/JobLog.vue +++ b/src/views/infra/job/JobLog.vue @@ -1,77 +1,179 @@ + diff --git a/src/views/infra/job/JobLogView.vue b/src/views/infra/job/JobLogView.vue new file mode 100644 index 00000000..c66e0d80 --- /dev/null +++ b/src/views/infra/job/JobLogView.vue @@ -0,0 +1,74 @@ + + diff --git a/src/views/infra/job/form.vue b/src/views/infra/job/form.vue new file mode 100644 index 00000000..24488fd7 --- /dev/null +++ b/src/views/infra/job/form.vue @@ -0,0 +1,172 @@ + + diff --git a/src/views/infra/job/index.vue b/src/views/infra/job/index.vue index 613f84c4..702b31fe 100644 --- a/src/views/infra/job/index.vue +++ b/src/views/infra/job/index.vue @@ -1,243 +1,175 @@ + diff --git a/src/views/infra/job/job.data.ts b/src/views/infra/job/job.data.ts deleted file mode 100644 index 1ca4a564..00000000 --- a/src/views/infra/job/job.data.ts +++ /dev/null @@ -1,70 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' -const { t } = useI18n() // 国际化 -// 表单校验 - -export const rules = reactive({ - name: [required], - handlerName: [required], - cronExpression: [required], - retryCount: [required], - retryInterval: [required] -}) -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: 'id', - primaryTitle: '任务编号', - action: true, - actionWidth: '280px', - columns: [ - { - title: '任务名称', - field: 'name', - isSearch: true - }, - { - title: t('common.status'), - field: 'status', - dictType: DICT_TYPE.INFRA_JOB_STATUS, - dictClass: 'number', - isForm: false, - isSearch: true - }, - { - title: '处理器的名字', - field: 'handlerName', - isSearch: true - }, - { - title: '处理器的参数', - field: 'handlerParam', - isTable: false - }, - { - title: 'CRON 表达式', - field: 'cronExpression' - }, - { - title: '后续执行时间', - field: 'nextTimes', - isTable: false, - isForm: false - }, - { - title: '重试次数', - field: 'retryCount', - isTable: false - }, - { - title: '重试间隔', - field: 'retryInterval', - isTable: false - }, - { - title: '监控超时时间', - field: 'monitorTimeout', - isTable: false - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/infra/job/jobLog.data.ts b/src/views/infra/job/jobLog.data.ts deleted file mode 100644 index 563c097c..00000000 --- a/src/views/infra/job/jobLog.data.ts +++ /dev/null @@ -1,76 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' -// 国际化 - -const { t } = useI18n() -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: 'id', - primaryTitle: '日志编号', - action: true, - columns: [ - { - title: '任务编号', - field: 'jobId', - isSearch: true - }, - { - title: '处理器的名字', - field: 'handlerName', - isSearch: true - }, - { - title: '处理器的参数', - field: 'handlerParam' - }, - { - title: '第几次执行', - field: 'executeIndex' - }, - { - title: '开始执行时间', - field: 'beginTime', - formatter: 'formatDate', - table: { - slots: { - default: 'beginTime_default' - } - }, - search: { - show: true, - itemRender: { - name: 'XDataPicker' - } - } - }, - { - title: '结束执行时间', - field: 'endTime', - formatter: 'formatDate', - isTable: false, - search: { - show: true, - itemRender: { - name: 'XDataPicker' - } - } - }, - { - title: '执行时长', - field: 'duration', - table: { - slots: { - default: 'duration_default' - } - } - }, - { - title: t('common.status'), - field: 'status', - dictType: DICT_TYPE.INFRA_JOB_LOG_STATUS, - dictClass: 'number', - isSearch: true - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/infra/job/utils.ts b/src/views/infra/job/utils.ts new file mode 100644 index 00000000..a3774f22 --- /dev/null +++ b/src/views/infra/job/utils.ts @@ -0,0 +1,44 @@ +export 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 +} diff --git a/src/views/infra/job/view.vue b/src/views/infra/job/view.vue new file mode 100644 index 00000000..d195e0e3 --- /dev/null +++ b/src/views/infra/job/view.vue @@ -0,0 +1,89 @@ + + diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue index aceadbba..8add0eab 100644 --- a/src/views/system/notice/index.vue +++ b/src/views/system/notice/index.vue @@ -1,148 +1,159 @@ - diff --git a/src/views/system/notice/notice.data.ts b/src/views/system/notice/notice.data.ts deleted file mode 100644 index 7a72a723..00000000 --- a/src/views/system/notice/notice.data.ts +++ /dev/null @@ -1,59 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' -const { t } = useI18n() // 国际化 - -// 表单校验 -export const rules = reactive({ - title: [required], - type: [required] -}) - -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: 'seq', - action: true, - columns: [ - { - title: '公告标题', - field: 'title', - isSearch: true - }, - { - title: '公告类型', - field: 'type', - dictType: DICT_TYPE.SYSTEM_NOTICE_TYPE, - dictClass: 'number' - }, - { - title: t('common.status'), - field: 'status', - dictType: DICT_TYPE.COMMON_STATUS, - dictClass: 'number', - isSearch: true - }, - { - title: '公告内容', - field: 'content', - table: { - type: 'html' - }, - form: { - component: 'Editor', - colProps: { - span: 24 - }, - componentProps: { - valueHtml: '' - } - }, - isTable: false - }, - { - title: t('common.createTime'), - field: 'createTime', - formatter: 'formatDate', - isForm: false - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/system/user/user.data.ts b/src/views/system/user/user.data.ts index 2ea4d268..7f7384eb 100644 --- a/src/views/system/user/user.data.ts +++ b/src/views/system/user/user.data.ts @@ -28,7 +28,7 @@ export const rules = reactive({ } ], status: [required], - postIds: [required], + postIds: [{ required: true, message: '请选择岗位', trigger: ['blur', 'change'] }], mobile: [ required, { @@ -86,6 +86,11 @@ const crudSchemas = reactive({ field: 'deptId', isTable: false }, + { + title: '岗位', + field: 'postIds', + isTable: false + }, { title: t('common.status'), field: 'status', @@ -98,11 +103,6 @@ const crudSchemas = reactive({ } } }, - { - title: '岗位', - field: 'postIds', - isTable: false - }, { title: '最后登录时间', field: 'loginDate', From 89f28ab03ef2b6fc8410ec92888481173a596e4f Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 3 Apr 2023 02:53:39 +0000 Subject: [PATCH 03/16] chore: nodejs v 16.0.0 Signed-off-by: xingyu --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 683d09eb..9d65c6ea 100644 --- a/package.json +++ b/package.json @@ -128,7 +128,7 @@ "windicss": "^3.5.6" }, "engines": { - "node": ">=16.18.0" + "node": ">=16.0.0" }, "license": "MIT", "repository": { From 094c3fe13f7b6592ca8fda3af5fb05afa4df0e6b Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 3 Apr 2023 03:03:34 +0000 Subject: [PATCH 04/16] docs: add nodejs pnpm version Signed-off-by: xingyu --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b3e9cc78..ea6214cc 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ ## 🐶 新手必读 +* nodejs > 16.0.0 && pnpm > 7.30.0 * 演示地址: * 启动文档: * 视频教程: From d0d6a13285693455326e436e215f472073a97615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E5=85=89=E7=A5=96?= <2931170625@qq.com> Date: Mon, 3 Apr 2023 14:29:46 +0800 Subject: [PATCH 05/16] =?UTF-8?q?fix:=20=E8=AE=BE=E7=BD=AE=20vite=20basePa?= =?UTF-8?q?th=20=E5=90=8E=EF=BC=8C=E9=87=8D=E6=96=B0=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E8=B7=AF=E7=94=B1=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/axios/service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/axios/service.ts b/src/config/axios/service.ts index 7109615b..4ec38a68 100644 --- a/src/config/axios/service.ts +++ b/src/config/axios/service.ts @@ -229,7 +229,7 @@ const handleAuthorized = () => { wsCache.clear() removeToken() isRelogin.show = false - window.location.href = '/' + window.location.href = import.meta.env.VITE_BASE_PATH }) .catch(() => { isRelogin.show = false From e0f9a74e78c46a054921c87f80dd9813209da968 Mon Sep 17 00:00:00 2001 From: Chika Date: Tue, 4 Apr 2023 09:26:13 +0800 Subject: [PATCH 06/16] =?UTF-8?q?VUE3=E9=87=8D=E6=9E=84=E6=94=B9=E9=80=A0-?= =?UTF-8?q?=E6=B5=81=E7=A8=8B-=E5=B7=B2=E5=8A=9E=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/bpm/task/done/Taskdetail.vue | 47 ++++++++ src/views/bpm/task/done/done.data.ts | 52 -------- src/views/bpm/task/done/index.vue | 159 ++++++++++++++++++++++--- 3 files changed, 187 insertions(+), 71 deletions(-) create mode 100644 src/views/bpm/task/done/Taskdetail.vue delete mode 100644 src/views/bpm/task/done/done.data.ts diff --git a/src/views/bpm/task/done/Taskdetail.vue b/src/views/bpm/task/done/Taskdetail.vue new file mode 100644 index 00000000..cef57cb7 --- /dev/null +++ b/src/views/bpm/task/done/Taskdetail.vue @@ -0,0 +1,47 @@ + + 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({ - primaryKey: 'id', - primaryType: null, - action: true, - columns: [ - { - title: '任务编号', - field: 'id', - table: { - width: 320 - } - }, - { - title: '任务名称', - field: 'name', - isSearch: true - }, - { - title: '所属流程', - field: 'processInstance.name' - }, - { - title: '流程发起人', - field: 'processInstance.startUserNickname' - }, - { - title: t('common.status'), - field: 'result', - dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, - dictClass: 'number', - isSearch: true - }, - { - title: '原因', - field: 'reason' - }, - { - title: t('common.createTime'), - field: 'createTime', - formatter: 'formatDate', - table: { - width: 180 - } - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/bpm/task/done/index.vue b/src/views/bpm/task/done/index.vue index da05549a..735f4edc 100644 --- a/src/views/bpm/task/done/index.vue +++ b/src/views/bpm/task/done/index.vue @@ -1,30 +1,147 @@ - From 900b51db86eb924358ee6d0c305c3e8ccaa6bdae Mon Sep 17 00:00:00 2001 From: Chika Date: Tue, 4 Apr 2023 09:28:09 +0800 Subject: [PATCH 07/16] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B5=81=E7=A8=8B-?= =?UTF-8?q?=E5=B7=B2=E5=8A=9E=E4=BB=BB=E5=8A=A1=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/modules/remaining.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 2dc9522d..92625cdc 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -317,6 +317,18 @@ const remainingRouter: AppRouteRecordRaw[] = [ title: '查看 OA 请假', activeMenu: 'bpm/oa/leave/detail' } + }, + { + path: '/bpm/task/done', + component: () => import('@/views/bpm/task/done/index.vue'), + name: 'TaskDone', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '已办任务', + activeMenu: 'bpm/task/done/index' + } } ] }, From c1e760da6dfdbc0e1bcc04b5a758948e1a428ad3 Mon Sep 17 00:00:00 2001 From: Chika Date: Tue, 4 Apr 2023 09:29:54 +0800 Subject: [PATCH 08/16] =?UTF-8?q?=E6=B5=81=E7=A8=8B-=E5=B7=B2=E5=8A=9E?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=B7=AF=E7=94=B1=E4=B8=AD=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=AF=A6=E6=83=85Model?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/bpm/task/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) 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 }) +} From bb88e3d77c22fe122367db90c921ced5b0aeaf6a Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 5 Apr 2023 00:12:12 +0800 Subject: [PATCH 09/16] =?UTF-8?q?REVIEW=20=E5=B7=B2=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E7=9A=84=E4=BB=BB=E5=8A=A1=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/vite/index.ts | 2 +- package.json | 1 + src/router/modules/remaining.ts | 12 --- .../done/{Taskdetail.vue => TaskDetail.vue} | 10 +- src/views/bpm/task/done/index.vue | 101 +++++++----------- 5 files changed, 49 insertions(+), 77 deletions(-) rename src/views/bpm/task/done/{Taskdetail.vue => TaskDetail.vue} (84%) diff --git a/build/vite/index.ts b/build/vite/index.ts index 7d3aa5be..0e721ce9 100644 --- a/build/vite/index.ts +++ b/build/vite/index.ts @@ -98,7 +98,7 @@ export function createVitePlugins() { deleteOriginFile: false //压缩后是否删除源文件 }), ViteEjsPlugin(), - topLevelAwait({ + 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 diff --git a/package.json b/package.json index b7629029..6309ddc9 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", diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 92625cdc..2dc9522d 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -317,18 +317,6 @@ const remainingRouter: AppRouteRecordRaw[] = [ title: '查看 OA 请假', activeMenu: 'bpm/oa/leave/detail' } - }, - { - path: '/bpm/task/done', - component: () => import('@/views/bpm/task/done/index.vue'), - name: 'TaskDone', - meta: { - noCache: true, - hidden: true, - canTo: true, - title: '已办任务', - activeMenu: 'bpm/task/done/index' - } } ] }, diff --git a/src/views/bpm/task/done/Taskdetail.vue b/src/views/bpm/task/done/TaskDetail.vue similarity index 84% rename from src/views/bpm/task/done/Taskdetail.vue rename to src/views/bpm/task/done/TaskDetail.vue index cef57cb7..4c293c17 100644 --- a/src/views/bpm/task/done/Taskdetail.vue +++ b/src/views/bpm/task/done/TaskDetail.vue @@ -1,5 +1,5 @@ diff --git a/src/views/bpm/task/done/index.vue b/src/views/bpm/task/done/index.vue index 735f4edc..75ba0fef 100644 --- a/src/views/bpm/task/done/index.vue +++ b/src/views/bpm/task/done/index.vue @@ -14,36 +14,30 @@ placeholder="请输入任务名称" clearable @keyup.enter="handleQuery" + class="!w-240px" /> - - - - + + 搜索 重置 - - 导出 - + - + @@ -63,8 +57,8 @@ /> @@ -76,46 +70,28 @@ @pagination="getList" /> + - + + diff --git a/src/components/Verifition/src/Verify/VerifyPoints.vue b/src/components/Verifition/src/Verify/VerifyPoints.vue index 8eeb83f6..0e1fade7 100644 --- a/src/components/Verifition/src/Verify/VerifyPoints.vue +++ b/src/components/Verifition/src/Verify/VerifyPoints.vue @@ -64,7 +64,7 @@ * */ import { resetSize } from './../utils/util' import { aesEncrypt } from './../utils/ase' -import { getCodeApi, reqCheckApi } from '@/api/login' +import { getCode, reqCheck } from '@/api/login' import { onMounted, reactive, ref, nextTick, toRefs, getCurrentInstance } from 'vue' const props = defineProps({ @@ -170,7 +170,7 @@ const canvasClick = (e) => { : JSON.stringify(checkPosArr), token: backToken.value } - reqCheckApi(data).then((res) => { + reqCheck(data).then((res) => { if (res.repCode == '0000') { barAreaColor.value = '#4cae4c' barAreaBorderColor.value = '#5cb85c' @@ -227,7 +227,7 @@ const getPictrue = async () => { let data = { captchaType: captchaType.value } - const res = await getCodeApi(data) + const res = await getCode(data) if (res.repCode == '0000') { pointBackImgBase.value = res.repData.originalImageBase64 backToken.value = res.repData.token diff --git a/src/components/Verifition/src/Verify/VerifySlide.vue b/src/components/Verifition/src/Verify/VerifySlide.vue index 6b6108df..3961b129 100644 --- a/src/components/Verifition/src/Verify/VerifySlide.vue +++ b/src/components/Verifition/src/Verify/VerifySlide.vue @@ -78,7 +78,7 @@ * */ import { aesEncrypt } from './../utils/ase' import { resetSize } from './../utils/util' -import { getCodeApi, reqCheckApi } from '@/api/login' +import { getCode, reqCheck } from '@/api/login' const props = defineProps({ captchaType: { @@ -286,7 +286,7 @@ const end = () => { : JSON.stringify({ x: moveLeftDistance, y: 5.0 }), token: backToken.value } - reqCheckApi(data).then((res) => { + reqCheck(data).then((res) => { if (res.repCode == '0000') { moveBlockBackgroundColor.value = '#5cb85c' leftBarBorderColor.value = '#5cb85c' @@ -301,7 +301,7 @@ const end = () => { }, 1500) } passFlag.value = true - tipWords.value = `${((endMovetime.value - startMoveTime.value) / 1000).toFixed(2)}s + tipWords.value = `${((endMovetime.value - startMoveTime.value) / 1000).toFixed(2)}s ${t('captcha.success')}` var captchaVerification = secretKey.value ? aesEncrypt( @@ -363,7 +363,7 @@ const getPictrue = async () => { let data = { captchaType: captchaType.value } - const res = await getCodeApi(data) + const res = await getCode(data) if (res.repCode == '0000') { backImgBase.value = res.repData.originalImageBase64 blockBackImgBase.value = res.repData.jigsawImageBase64 diff --git a/src/layout/components/Message/src/Message.vue b/src/layout/components/Message/src/Message.vue index d42a51c0..d968eb6f 100644 --- a/src/layout/components/Message/src/Message.vue +++ b/src/layout/components/Message/src/Message.vue @@ -9,14 +9,14 @@ const list = ref([]) // 消息列表 // 获得消息列表 const getList = async () => { - list.value = await NotifyMessageApi.getUnreadNotifyMessageListApi() + list.value = await NotifyMessageApi.getUnreadNotifyMessageList() // 强制设置 unreadCount 为 0,避免小红点因为轮询太慢,不消除 unreadCount.value = 0 } // 获得未读消息数 const getUnreadCount = async () => { - NotifyMessageApi.getUnreadNotifyMessageCountApi().then((data) => { + NotifyMessageApi.getUnreadNotifyMessageCount().then((data) => { unreadCount.value = data }) } diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 6f46f1ab..7c5742c4 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -297,8 +297,7 @@ export default { typeCreate: '字典类型新增', typeUpdate: '字典类型编辑', dataCreate: '字典数据新增', - dataUpdate: '字典数据编辑', - fileUpload: '上传文件' + dataUpdate: '字典数据编辑' }, dialog: { dialog: '弹窗', diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 2dc9522d..671ca353 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -115,7 +115,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ children: [ { path: 'type/data/:dictType', - component: () => import('@/views/system/dict/data.vue'), + component: () => import('@/views/system/dict/data/index.vue'), name: 'data', meta: { title: '字典数据', @@ -123,7 +123,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ hidden: true, canTo: true, icon: '', - activeMenu: 'system/dict/data' + activeMenu: '/system/dict' } } ] diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index 491bafdc..9d3b8dda 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -3,7 +3,7 @@ import { store } from '../index' import { cloneDeep } from 'lodash-es' import remainingRouter from '@/router/modules/remaining' import { generateRoute, flatMultiLevelRoutes } from '@/utils/routerHelper' -import { getAsyncRoutesApi } from '@/api/login' +import { getAsyncRoutes } from '@/api/login' import { CACHE_KEY, useCache } from '@/hooks/web/useCache' const { wsCache } = useCache() @@ -38,7 +38,7 @@ export const usePermissionStore = defineStore('permission', { if (wsCache.get(CACHE_KEY.ROLE_ROUTERS)) { res = wsCache.get(CACHE_KEY.ROLE_ROUTERS) as AppCustomRouteRecordRaw[] } else { - res = await getAsyncRoutesApi() + res = await getAsyncRoutes() wsCache.set(CACHE_KEY.ROLE_ROUTERS, res) } const routerMap: AppRouteRecordRaw[] = generateRoute(res as AppCustomRouteRecordRaw[]) diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 16ff3902..99c11c2e 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -2,7 +2,7 @@ import { store } from '../index' import { defineStore } from 'pinia' import { getAccessToken, removeToken } from '@/utils/auth' import { CACHE_KEY, useCache } from '@/hooks/web/useCache' -import { getInfoApi, loginOutApi } from '@/api/login' +import { getInfo, loginOut } from '@/api/login' const { wsCache } = useCache() @@ -51,7 +51,7 @@ export const useUserStore = defineStore('admin-user', { } let userInfo = wsCache.get(CACHE_KEY.USER) if (!userInfo) { - userInfo = await getInfoApi() + userInfo = await getInfo() } this.permissions = userInfo.permissions this.roles = userInfo.roles @@ -60,7 +60,7 @@ export const useUserStore = defineStore('admin-user', { wsCache.set(CACHE_KEY.USER, userInfo) }, async loginOut() { - await loginOutApi() + await loginOut() removeToken() wsCache.clear() this.resetState() diff --git a/src/types/auto-components.d.ts b/src/types/auto-components.d.ts index 8851767a..8b5de138 100644 --- a/src/types/auto-components.d.ts +++ b/src/types/auto-components.d.ts @@ -21,8 +21,10 @@ declare module '@vue/runtime-core' { Descriptions: typeof import('./../components/Descriptions/src/Descriptions.vue')['default'] Dialog: typeof import('./../components/Dialog/src/Dialog.vue')['default'] DictTag: typeof import('./../components/DictTag/src/DictTag.vue')['default'] + DocAlert: typeof import('./../components/DocAlert/index.vue')['default'] Echart: typeof import('./../components/Echart/src/Echart.vue')['default'] Editor: typeof import('./../components/Editor/src/Editor.vue')['default'] + ElAlert: typeof import('element-plus/es')['ElAlert'] ElAutoResizer: typeof import('element-plus/es')['ElAutoResizer'] ElAvatar: typeof import('element-plus/es')['ElAvatar'] ElBadge: typeof import('element-plus/es')['ElBadge'] diff --git a/src/views/Login/components/LoginForm.vue b/src/views/Login/components/LoginForm.vue index 1e41b994..9d9d20ce 100644 --- a/src/views/Login/components/LoginForm.vue +++ b/src/views/Login/components/LoginForm.vue @@ -195,7 +195,7 @@ const getCode = async () => { //获取租户ID const getTenantId = async () => { if (loginData.tenantEnable === 'true') { - const res = await LoginApi.getTenantIdByNameApi(loginData.loginForm.tenantName) + const res = await LoginApi.getTenantIdByName(loginData.loginForm.tenantName) authUtil.setTenantId(res) } } @@ -222,7 +222,7 @@ const handleLogin = async (params) => { return } loginData.loginForm.captchaVerification = params.captchaVerification - const res = await LoginApi.loginApi(loginData.loginForm) + const res = await LoginApi.login(loginData.loginForm) if (!res) { return } @@ -259,7 +259,7 @@ const doSocialLogin = async (type: number) => { loginLoading.value = true if (loginData.tenantEnable === 'true') { await message.prompt('请输入租户名称', t('common.reminder')).then(async ({ value }) => { - const res = await LoginApi.getTenantIdByNameApi(value) + const res = await LoginApi.getTenantIdByName(value) authUtil.setTenantId(res) }) } @@ -267,7 +267,7 @@ const doSocialLogin = async (type: number) => { const redirectUri = location.origin + '/social-login?type=' + type + '&redirect=' + (redirect.value || '/') // 进行跳转 - const res = await LoginApi.socialAuthRedirectApi(type, encodeURIComponent(redirectUri)) + const res = await LoginApi.socialAuthRedirect(type, encodeURIComponent(redirectUri)) window.location.href = res } } diff --git a/src/views/Login/components/MobileForm.vue b/src/views/Login/components/MobileForm.vue index 0aa1e035..3a0ab686 100644 --- a/src/views/Login/components/MobileForm.vue +++ b/src/views/Login/components/MobileForm.vue @@ -98,7 +98,7 @@ import { useIcon } from '@/hooks/web/useIcon' import { setTenantId, setToken } from '@/utils/auth' import { usePermissionStore } from '@/store/modules/permission' -import { getTenantIdByNameApi, sendSmsCodeApi, smsLoginApi } from '@/api/login' +import { getTenantIdByName, sendSmsCode, smsLogin } from '@/api/login' import LoginFormTitle from './LoginFormTitle.vue' import { useLoginState, LoginStateEnum, useFormValid } from './useLogin' @@ -149,7 +149,7 @@ const redirect = ref('') const getSmsCode = async () => { await getTenantId() smsVO.smsCode.mobile = loginData.loginForm.mobileNumber - await sendSmsCodeApi(smsVO.smsCode).then(async () => { + await sendSmsCode(smsVO.smsCode).then(async () => { message.success(t('login.SmsSendMsg')) // 设置倒计时 mobileCodeTimer.value = 60 @@ -173,7 +173,7 @@ watch( // 获取租户 ID const getTenantId = async () => { if (loginData.tenantEnable === 'true') { - const res = await getTenantIdByNameApi(loginData.loginForm.tenantName) + const res = await getTenantIdByName(loginData.loginForm.tenantName) setTenantId(res) } } @@ -185,7 +185,7 @@ const signIn = async () => { loginLoading.value = true smsVO.loginSms.mobile = loginData.loginForm.mobileNumber smsVO.loginSms.code = loginData.loginForm.code - await smsLoginApi(smsVO.loginSms) + await smsLogin(smsVO.loginSms) .then(async (res) => { setToken(res?.token) if (!redirect.value) { diff --git a/src/views/Profile/components/BasicInfo.vue b/src/views/Profile/components/BasicInfo.vue index ccb7d6f3..f5e9da72 100644 --- a/src/views/Profile/components/BasicInfo.vue +++ b/src/views/Profile/components/BasicInfo.vue @@ -17,8 +17,8 @@ import { ElMessage } from 'element-plus' import { FormSchema } from '@/types/form' import type { FormExpose } from '@/components/Form' import { - getUserProfileApi, - updateUserProfileApi, + getUserProfile, + updateUserProfile, UserProfileUpdateReqVO } from '@/api/system/user/profile' @@ -73,14 +73,14 @@ const submit = () => { elForm.validate(async (valid) => { if (valid) { const data = unref(formRef)?.formModel as UserProfileUpdateReqVO - await updateUserProfileApi(data) + await updateUserProfile(data) ElMessage.success(t('common.updateSuccess')) await init() } }) } const init = async () => { - const res = await getUserProfileApi() + const res = await getUserProfile() unref(formRef)?.setValues(res) } onMounted(async () => { diff --git a/src/views/Profile/components/ProfileUser.vue b/src/views/Profile/components/ProfileUser.vue index 4e4de722..8657bc75 100644 --- a/src/views/Profile/components/ProfileUser.vue +++ b/src/views/Profile/components/ProfileUser.vue @@ -43,12 +43,12 @@ import { formatDate } from '@/utils/formatTime' import UserAvatar from './UserAvatar.vue' -import { getUserProfileApi, ProfileVO } from '@/api/system/user/profile' +import { getUserProfile, ProfileVO } from '@/api/system/user/profile' const { t } = useI18n() const userInfo = ref() const getUserInfo = async () => { - const users = await getUserProfileApi() + const users = await getUserProfile() userInfo.value = users } onMounted(async () => { diff --git a/src/views/Profile/components/ResetPwd.vue b/src/views/Profile/components/ResetPwd.vue index 0b37807f..0d6f9cc4 100644 --- a/src/views/Profile/components/ResetPwd.vue +++ b/src/views/Profile/components/ResetPwd.vue @@ -19,7 +19,7 @@ import type { FormRules, FormInstance } from 'element-plus' import { InputPassword } from '@/components/InputPassword' -import { updateUserPwdApi } from '@/api/system/user/profile' +import { updateUserPassword } from '@/api/system/user/profile' const { t } = useI18n() const message = useMessage() @@ -56,7 +56,7 @@ const submit = (formEl: FormInstance | undefined) => { if (!formEl) return formEl.validate(async (valid) => { if (valid) { - await updateUserPwdApi(password.oldPassword, password.newPassword) + await updateUserPassword(password.oldPassword, password.newPassword) message.success(t('common.updateSuccess')) } }) diff --git a/src/views/Profile/components/UserAvatar.vue b/src/views/Profile/components/UserAvatar.vue index 81259410..50a14d81 100644 --- a/src/views/Profile/components/UserAvatar.vue +++ b/src/views/Profile/components/UserAvatar.vue @@ -12,7 +12,7 @@ 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/pay/refund/index.vue b/src/views/pay/refund/index.vue index 6b7b3d46..9deea53b 100644 --- a/src/views/pay/refund/index.vue +++ b/src/views/pay/refund/index.vue @@ -42,8 +42,8 @@ const { t } = useI18n() // 国际化 // 列表相关的变量 const [registerTable, { exportList }] = useXTable({ allSchemas: allSchemas, - getListApi: RefundApi.getRefundPageApi, - exportListApi: RefundApi.exportRefundApi + getListApi: RefundApi.getRefundPage, + exportListApi: RefundApi.exportRefund }) // ========== CRUD 相关 ========== @@ -53,7 +53,7 @@ const detailData = ref() // 详情 Ref // 详情操作 const handleDetail = async (rowId: number) => { // 设置数据 - detailData.value = RefundApi.getRefundApi(rowId) + detailData.value = RefundApi.getRefund(rowId) dialogVisible.value = true } diff --git a/src/views/system/area/form.vue b/src/views/system/area/AreaForm.vue similarity index 94% rename from src/views/system/area/form.vue rename to src/views/system/area/AreaForm.vue index 8e1604e5..c0a51494 100644 --- a/src/views/system/area/form.vue +++ b/src/views/system/area/AreaForm.vue @@ -36,11 +36,11 @@ const formRules = reactive({ const formRef = ref() // 表单 Ref /** 打开弹窗 */ -const openModal = async () => { +const open = async () => { dialogVisible.value = true resetForm() } -defineExpose({ openModal }) // 提供 openModal 方法,用于打开弹窗 +defineExpose({ open }) // 提供 open 方法,用于打开弹窗 /** 提交表单 */ const submitForm = async () => { diff --git a/src/views/system/area/index.vue b/src/views/system/area/index.vue index d84c769f..a31fd10d 100644 --- a/src/views/system/area/index.vue +++ b/src/views/system/area/index.vue @@ -1,13 +1,15 @@ - + - + diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index 43e3a0bf..79b2aed6 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -1,6 +1,6 @@ - diff --git a/src/views/system/mail/log/index.vue b/src/views/system/mail/log/index.vue index 5373b71d..9ca2b9e8 100644 --- a/src/views/system/mail/log/index.vue +++ b/src/views/system/mail/log/index.vue @@ -1,11 +1,13 @@ - + - + diff --git a/src/views/system/operatelog/index.vue b/src/views/system/operatelog/index.vue index c5713be1..6be32969 100644 --- a/src/views/system/operatelog/index.vue +++ b/src/views/system/operatelog/index.vue @@ -1,5 +1,7 @@ diff --git a/src/views/system/mail/account/account.data.ts b/src/views/system/mail/account/account.data.ts index d1683bf2..eaa0673a 100644 --- a/src/views/system/mail/account/account.data.ts +++ b/src/views/system/mail/account/account.data.ts @@ -61,12 +61,16 @@ const crudSchemas = reactive([ label: '创建时间', field: 'createTime', isForm: false, - formatter: dateFormatter + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + } }, { label: '操作', field: 'action', - isForm: false + isForm: false, + isDetail: false } ]) export const { allSchemas } = useCrudSchemas(crudSchemas) diff --git a/src/views/system/mail/account/index.vue b/src/views/system/mail/account/index.vue index c9e40765..878d7d9e 100644 --- a/src/views/system/mail/account/index.vue +++ b/src/views/system/mail/account/index.vue @@ -39,6 +39,14 @@ > 编辑 + + 详情 + + + diff --git a/src/views/bpm/task/todo/todo.data.ts b/src/views/bpm/task/todo/todo.data.ts deleted file mode 100644 index 419a80fe..00000000 --- a/src/views/bpm/task/todo/todo.data.ts +++ /dev/null @@ -1,58 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' - -const { t } = useI18n() // 国际化 - -// crudSchemas -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: null, - action: true, - searchSpan: 8, - columns: [ - { - title: '任务编号', - field: 'id', - table: { - width: 320 - } - }, - { - title: '任务名称', - field: 'name', - isSearch: true - }, - { - title: '所属流程', - field: 'processInstance.name' - }, - { - title: '流程发起人', - field: 'processInstance.startUserNickname' - }, - { - title: t('common.createTime'), - field: 'createTime', - formatter: 'formatDate', - table: { - width: 180 - }, - isSearch: true, - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - }, - { - title: '任务状态', - field: 'suspensionState', - table: { - slots: { - default: 'suspensionState_default' - } - } - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) From d0bc7f081423747c0d09a498a4e5870828af5311 Mon Sep 17 00:00:00 2001 From: Chika Date: Thu, 6 Apr 2023 16:13:18 +0800 Subject: [PATCH 13/16] =?UTF-8?q?VUE3=E3=80=90=E6=B5=81=E7=A8=8B=E7=AE=A1?= =?UTF-8?q?=E7=90=86-=E6=88=91=E7=9A=84=E6=B5=81=E7=A8=8B=E3=80=91elment-p?= =?UTF-8?q?lus=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/modules/remaining.ts | 12 ++ src/views/bpm/processInstance/index.vue | 243 +++++++++++++++++++----- 2 files changed, 211 insertions(+), 44 deletions(-) diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 99543361..45da96b8 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -341,6 +341,18 @@ const remainingRouter: AppRouteRecordRaw[] = [ title: '代办任务', activeMenu: 'bpm/task/todo/index' } + }, + { + path: '/bpm/processInstance', + component: () => import('@/views/bpm/processInstance/index.vue'), + name: 'processInstance', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '流程办理', + activeMenu: 'bpm/processInstance/index' + } } ] }, diff --git a/src/views/bpm/processInstance/index.vue b/src/views/bpm/processInstance/index.vue index 0d153cfb..9f43d087 100644 --- a/src/views/bpm/processInstance/index.vue +++ b/src/views/bpm/processInstance/index.vue @@ -1,64 +1,215 @@ From dbf51ff89c90de6f1f9db8fd45c26b07787418c7 Mon Sep 17 00:00:00 2001 From: Chika Date: Thu, 6 Apr 2023 16:15:48 +0800 Subject: [PATCH 14/16] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=88=91=E7=9A=84?= =?UTF-8?q?=E6=B5=81=E7=A8=8Bprocess.data.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/bpm/processInstance/process.data.ts | 94 ------------------- 1 file changed, 94 deletions(-) delete mode 100644 src/views/bpm/processInstance/process.data.ts diff --git a/src/views/bpm/processInstance/process.data.ts b/src/views/bpm/processInstance/process.data.ts deleted file mode 100644 index 317e143d..00000000 --- a/src/views/bpm/processInstance/process.data.ts +++ /dev/null @@ -1,94 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' - -const { t } = useI18n() // 国际化 - -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: null, - primaryTitle: '编号', - action: true, - actionWidth: '200px', - columns: [ - { - title: '编号', - field: 'id', - table: { - width: 320 - } - }, - { - title: '流程名', - field: 'name', - isSearch: true - }, - { - title: '所属流程', - field: 'processDefinitionId', - isSearch: true, - isTable: false - }, - { - title: '流程分类', - field: 'category', - dictType: DICT_TYPE.BPM_MODEL_CATEGORY, - dictClass: 'number', - isSearch: true, - table: { - slots: { - default: 'category_default' - } - } - }, - { - title: '当前审批任务', - field: 'tasks', - table: { - width: 140, - slots: { - default: 'tasks_default' - } - } - }, - { - title: t('common.status'), - field: 'status', - dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS, - dictClass: 'number', - isSearch: true - }, - { - title: '结果', - field: 'result', - dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, - dictClass: 'number', - isSearch: true - }, - { - title: '提交时间', - field: 'createTime', - formatter: 'formatDate', - table: { - width: 180 - }, - isForm: false, - isSearch: true, - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - }, - { - title: '结束时间', - field: 'endTime', - formatter: 'formatDate', - table: { - width: 180 - }, - isForm: false - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) From 87ac04d9a737f4c1f9f2215b2ce59d87b64eb300 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 6 Apr 2023 19:49:58 +0800 Subject: [PATCH 15/16] =?UTF-8?q?Redis=20=E8=8F=9C=E5=8D=95=E7=9A=84?= =?UTF-8?q?=E9=87=8D=E6=9E=84=EF=BC=8C=E7=A7=BB=E9=99=A4=E5=AF=B9=20key=20?= =?UTF-8?q?=E7=9A=84=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 3 + src/api/infra/redis/index.ts | 36 ----------- src/api/infra/redis/types.ts | 9 --- src/main.ts | 2 + src/plugins/tongji/index.ts | 23 +++++++ src/utils/dict.ts | 1 - src/views/infra/redis/index.vue | 110 ++------------------------------ 7 files changed, 34 insertions(+), 150 deletions(-) create mode 100644 src/plugins/tongji/index.ts diff --git a/.env b/.env index 5f2334a3..a77d490d 100644 --- a/.env +++ b/.env @@ -15,3 +15,6 @@ VITE_APP_CAPTCHA_ENABLE=true # 验证码的开关 VITE_APP_CAPTCHA_ENABLE=true + +# 百度统计 +VITE_APP_BAIDU_CODE = a1ff8825baa73c3a78eb96aa40325abc diff --git a/src/api/infra/redis/index.ts b/src/api/infra/redis/index.ts index 9856fa64..f27be77f 100644 --- a/src/api/infra/redis/index.ts +++ b/src/api/infra/redis/index.ts @@ -6,39 +6,3 @@ import request from '@/config/axios' export const getCache = () => { return request.get({ url: '/infra/redis/get-monitor-info' }) } - -// 获取模块 -export const getKeyDefineList = () => { - return request.get({ url: '/infra/redis/get-key-define-list' }) -} - -/** - * 获取redis key列表 - */ -export const getKeyList = (keyTemplate: string) => { - return request.get({ - url: '/infra/redis/get-key-list', - params: { - keyTemplate - } - }) -} - -// 获取缓存内容 -export const getKeyValue = (key: string) => { - return request.get({ url: '/infra/redis/get-key-value?key=' + key }) -} - -// 根据键名删除缓存 -export const deleteKey = (key: string) => { - return request.delete({ url: '/infra/redis/delete-key?key=' + key }) -} - -export const deleteKeys = (keyTemplate: string) => { - return request.delete({ - url: '/infra/redis/delete-keys?', - params: { - keyTemplate - } - }) -} diff --git a/src/api/infra/redis/types.ts b/src/api/infra/redis/types.ts index 2342e543..548bfe96 100644 --- a/src/api/infra/redis/types.ts +++ b/src/api/infra/redis/types.ts @@ -174,12 +174,3 @@ export interface RedisCommandStatsVO { calls: number usec: number } - -export interface RedisKeyInfo { - keyTemplate: string - keyType: string - valueType: string - timeoutType: number - timeout: number - memo: string -} diff --git a/src/main.ts b/src/main.ts index b3a9da16..f24560b5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -52,6 +52,8 @@ import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css' import hljs from 'highlight.js' //导入代码高亮文件 import 'highlight.js/styles/github.css' //导入代码高亮样式 新版 +import '@/plugins/tongji' // 百度统计 + import Logger from '@/utils/Logger' // 本地开发模式 全局引入 element-plus 样式,加快第一次进入速度 diff --git a/src/plugins/tongji/index.ts b/src/plugins/tongji/index.ts new file mode 100644 index 00000000..ec261a16 --- /dev/null +++ b/src/plugins/tongji/index.ts @@ -0,0 +1,23 @@ +import router from '@/router' + +// 用于 router push +window._hmt = window._hmt || [] +// HM_ID +const HM_ID = import.meta.env.VITE_APP_BAIDU_CODE +;(function () { + // 有值的时候,才开启 + if (!HM_ID) { + return + } + const hm = document.createElement('script') + hm.src = 'https://hm.baidu.com/hm.js?' + HM_ID + const s = document.getElementsByTagName('script')[0] + s.parentNode.insertBefore(hm, s) +})() + +router.afterEach(function (to) { + if (!HM_ID) { + return + } + _hmt.push(['_trackPageview', to.fullPath]) +}) diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 05c70dad..d1d84242 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -112,7 +112,6 @@ export enum DICT_TYPE { // ========== INFRA 模块 ========== INFRA_BOOLEAN_STRING = 'infra_boolean_string', - INFRA_REDIS_TIMEOUT_TYPE = 'infra_redis_timeout_type', INFRA_JOB_STATUS = 'infra_job_status', INFRA_JOB_LOG_STATUS = 'infra_job_log_status', INFRA_API_ERROR_LOG_PROCESS_STATUS = 'infra_api_error_log_process_status', diff --git a/src/views/infra/redis/index.vue b/src/views/infra/redis/index.vue index 30d3cf65..1fd1a120 100644 --- a/src/views/infra/redis/index.vue +++ b/src/views/infra/redis/index.vue @@ -4,6 +4,7 @@ + @@ -47,106 +48,33 @@ +
+
- - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - {{ cacheForm.key }} - {{ cacheForm.value }} - - - - - -