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 1/5] =?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 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 搜索
- 重置
-
+
+
+
+
- 导出
-
-
-
-
-
-
-
-
-
-
-
-
- {{ parseTime(scope.row.beginTime) + ' ~ ' + parseTime(scope.row.endTime) }}
-
-
-
-
- {{ scope.row.duration + ' 毫秒' }}
-
-
-
-
-
-
-
-
-
- 详细
-
-
-
-
-
-
-
-
-
+ @click="exportList('定时任务详情.xls')"
+ />
+
+
+ {{
+ dayjs(row.beginTime).format('YYYY-MM-DD HH:mm:ss') +
+ ' ~ ' +
+ dayjs(row.endTime).format('YYYY-MM-DD HH:mm:ss')
+ }}
+
+
+ {{ row.duration + ' 毫秒' }}
+
+
+
+
+
+
+
+
+
+
+ {{ row.retryInterval + '毫秒' }}
+
+
+ {{ row.monitorTimeout > 0 ? row.monitorTimeout + ' 毫秒' : '未开启' }}
+
+
+
+
+
+
+
-
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 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 搜索
- 重置
-
+
+
+
+
+
- 新增
-
-
+
+
- 导出
-
-
-
- 执行日志
-
-
-
-
-
-
-
-
-
-
- >
-
-
-
-
-
- 修改
- {{ scope.row.status === InfraJobStatusEnum.STOP ? '开启' : '暂停' }}
- 删除
- handleCommand(command, scope.row)"
- v-hasPermi="['infra:job:trigger', 'infra:job:query']"
- >
- 更多
-
-
-
- 执行一次
-
-
- 任务详细
-
-
- 调度日志
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ @click="exportList('定时任务.xls')"
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.retryInterval + '毫秒' }}
+
+
+ {{ row.monitorTimeout > 0 ? row.monitorTimeout + ' 毫秒' : '未开启' }}
+
+
+ {{ Array.from(nextTimes, (x) => parseTime(x)).join('; ') }}
+
+
+
+
+
+
+
+
+
+
-
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 2/5] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!84?=
=?UTF-8?q?=20:=20=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95=E6=89=80=E6=8F=90bu?=
=?UTF-8?q?g'?=
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 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
-
-
- {{
- dayjs(row.beginTime).format('YYYY-MM-DD HH:mm:ss') +
- ' ~ ' +
- dayjs(row.endTime).format('YYYY-MM-DD HH:mm:ss')
- }}
-
-
- {{ row.duration + ' 毫秒' }}
-
-
-
-
-
-
-
-
-
-
- {{ row.retryInterval + '毫秒' }}
-
-
- {{ row.monitorTimeout > 0 ? row.monitorTimeout + ' 毫秒' : '未开启' }}
-
-
-
-
-
-
-
+ >
+ 导出
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.beginTime) + ' ~ ' + parseTime(scope.row.endTime) }}
+
+
+
+
+ {{ scope.row.duration + ' 毫秒' }}
+
+
+
+
+
+
+
+
+
+ 详细
+
+
+
+
+
+
+
+
+
+
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 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
-
-
+ 新增
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ row.retryInterval + '毫秒' }}
-
-
- {{ row.monitorTimeout > 0 ? row.monitorTimeout + ' 毫秒' : '未开启' }}
-
-
- {{ Array.from(nextTimes, (x) => parseTime(x)).join('; ') }}
-
-
-
-
-
-
-
-
-
-
+ >
+ 导出
+
+
+
+ 执行日志
+
+
+
+
+
+
+
+
+
+
+ >
+
+
+
+
+
+ 修改
+ {{ scope.row.status === InfraJobStatusEnum.STOP ? '开启' : '暂停' }}
+ 删除
+ handleCommand(command, scope.row)"
+ v-hasPermi="['infra:job:trigger', 'infra:job:query']"
+ >
+ 更多
+
+
+
+ 执行一次
+
+
+ 任务详细
+
+
+ 调度日志
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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 3/5] 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 4/5] 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 5/5] =?UTF-8?q?fix:=20=E8=AE=BE=E7=BD=AE=20vite=20basePath?=
=?UTF-8?q?=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