diff --git a/src/api/daemon/job.ts b/src/api/daemon/job.ts new file mode 100644 index 00000000..6985614d --- /dev/null +++ b/src/api/daemon/job.ts @@ -0,0 +1,60 @@ +import request from "/@/utils/request" + +export function fetchList(query?: Object) { + return request({ + url: '/admin/sys-job/page', + method: 'get', + params: query + }) +} + +export function addObj(obj?: Object) { + return request({ + url: '/admin/sys-job', + method: 'post', + data: obj + }) +} + +export function getObj(id?: string) { + return request({ + url: '/admin/sys-job/' + id, + method: 'get' + }) +} + +export function delObj(id?: string) { + return request({ + url: '/admin/sys-job/' + id, + method: 'delete' + }) +} + +export function putObj(obj?: Object) { + return request({ + url: '/admin/sys-job', + method: 'put', + data: obj + }) +} + +export function startJobRa(jobId:string) { + return request({ + url: '/admin/sys-job/start-job/' + jobId, + method: 'post' + }) +} + +export function runJobRa(jobId: string) { + return request({ + url: '/admin/sys-job/run-job/' + jobId, + method: 'post' + }) +} + +export function shutDownJobRa(jobId: string) { + return request({ + url: '/admin/sys-job/shutdown-job/' + jobId, + method: 'post' + }) +} diff --git a/src/components/Cron/index.ts b/src/components/Cron/index.ts new file mode 100644 index 00000000..f3296860 --- /dev/null +++ b/src/components/Cron/index.ts @@ -0,0 +1,4 @@ + +import Cron from './src/cron.vue' + +export default Cron diff --git a/src/components/Cron/src/cron.vue b/src/components/Cron/src/cron.vue new file mode 100644 index 00000000..137648dd --- /dev/null +++ b/src/components/Cron/src/cron.vue @@ -0,0 +1,634 @@ + + + diff --git a/src/components/Cron/src/language/en-US.ts b/src/components/Cron/src/language/en-US.ts new file mode 100644 index 00000000..25f7e6df --- /dev/null +++ b/src/components/Cron/src/language/en-US.ts @@ -0,0 +1,54 @@ +export default { + Seconds: { + name: 'Seconds', + every: 'Every second', + interval: ['Every', 'second(s) starting at second'], + specific: 'Specific second (choose one or many)', + cycle: ['Every second between second', 'and second'] + }, + Minutes: { + name: 'Minutes', + every: 'Every minute', + interval: ['Every', 'minute(s) starting at minute'], + specific: 'Specific minute (choose one or many)', + cycle: ['Every minute between minute', 'and minute'] + }, + Hours: { + name: 'Hours', + every: 'Every hour', + interval: ['Every', 'hour(s) starting at hour'], + specific: 'Specific hour (choose one or many)', + cycle: ['Every hour between hour', 'and hour'] + }, + Day: { + name: 'Day', + every: 'Every day', + intervalWeek: ['Every', 'day(s) starting on'], + intervalDay: ['Every', 'day(s) starting at the', 'of the month'], + specificWeek: 'Specific day of week (choose one or many)', + specificDay: 'Specific day of month (choose one or many)', + lastDay: 'On the last day of the month', + lastWeekday: 'On the last weekday of the month', + lastWeek: ['On the last', ' of the month'], + beforeEndMonth: ['day(s) before the end of the month'], + nearestWeekday: ['Nearest weekday (Monday to Friday) to the', 'of the month'], + someWeekday: ['On the', 'of the month'] + }, + Week: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + Month: { + name: 'Month', + every: 'Every month', + interval: ['Every', 'month(s) starting in'], + specific: 'Specific month (choose one or many)', + cycle: ['Every month between', 'and'] + }, + Year: { + name: 'Year', + every: 'Any year', + interval: ['Every', 'year(s) starting in'], + specific: 'Specific year (choose one or many)', + cycle: ['Every year between', 'and'] + }, + Save: 'Save', + Close: 'Close' +} diff --git a/src/components/Cron/src/language/index.ts b/src/components/Cron/src/language/index.ts new file mode 100644 index 00000000..bfdbc713 --- /dev/null +++ b/src/components/Cron/src/language/index.ts @@ -0,0 +1,7 @@ +import en from './en-US' +import cn from './zh-CN' + +export default { + 'en-US': en, + 'zh-CN': cn +} diff --git a/src/components/Cron/src/language/zh-CN.ts b/src/components/Cron/src/language/zh-CN.ts new file mode 100644 index 00000000..c51e2750 --- /dev/null +++ b/src/components/Cron/src/language/zh-CN.ts @@ -0,0 +1,54 @@ +export default { + Seconds: { + name: '秒', + every: '每一秒钟', + interval: ['每隔', '秒执行 从', '秒开始'], + specific: '具体秒数(可多选)', + cycle: ['周期从', '到', '秒'] + }, + Minutes: { + name: '分', + every: '每一分钟', + interval: ['每隔', '分执行 从', '分开始'], + specific: '具体分钟数(可多选)', + cycle: ['周期从', '到', '分'] + }, + Hours: { + name: '时', + every: '每一小时', + interval: ['每隔', '小时执行 从', '小时开始'], + specific: '具体小时数(可多选)', + cycle: ['周期从', '到', '小时'] + }, + Day: { + name: '天', + every: '每一天', + intervalWeek: ['每隔', '周执行 从', '开始'], + intervalDay: ['每隔', '天执行 从', '天开始'], + specificWeek: '具体星期几(可多选)', + specificDay: '具体天数(可多选)', + lastDay: '在这个月的最后一天', + lastWeekday: '在这个月的最后一个工作日', + lastWeek: ['在这个月的最后一个'], + beforeEndMonth: ['在本月底前', '天'], + nearestWeekday: ['最近的工作日(周一至周五)至本月', '日'], + someWeekday: ['在这个月的第', '个'] + }, + Week: ['天', '一', '二', '三', '四', '五', '六'].map(val => '星期' + val), + Month: { + name: '月', + every: '每一月', + interval: ['每隔', '月执行 从', '月开始'], + specific: '具体月数(可多选)', + cycle: ['从', '到', '月之间的每个月'] + }, + Year: { + name: '年', + every: '每一年', + interval: ['每隔', '年执行 从', '年开始'], + specific: '具体年份(可多选)', + cycle: ['从', '到', '年之间的每一年'] + }, + Save: '确定', + Close: '取消' +} diff --git a/src/views/daemon/job-manage/form.vue b/src/views/daemon/job-manage/form.vue new file mode 100644 index 00000000..96c6cfc7 --- /dev/null +++ b/src/views/daemon/job-manage/form.vue @@ -0,0 +1,188 @@ + + + diff --git a/src/views/daemon/job-manage/i18n/en.ts b/src/views/daemon/job-manage/i18n/en.ts new file mode 100644 index 00000000..bcaa26ee --- /dev/null +++ b/src/views/daemon/job-manage/i18n/en.ts @@ -0,0 +1,56 @@ +export default { + job: { + index: 'index', + importsysJobTip: 'import SysJob', + jobId: 'jobId', + jobName: 'jobName', + jobGroup: 'jobGroup', + jobOrder: 'jobOrder', + jobType: 'jobType', + executePath: 'executePath', + className: 'className', + methodName: 'methodName', + methodParamsValue: 'methodParamsValue', + cronExpression: 'cronExpression', + misfirePolicy: 'misfirePolicy', + jobTenantType: 'jobTenantType', + jobStatus: 'jobStatus', + jobExecuteStatus: 'jobExecuteStatus', + createBy: 'createBy', + createTime: 'createTime', + updateBy: 'updateBy', + updateTime: 'updateTime', + startTime: 'startTime', + previousTime: 'previousTime', + nextTime: 'nextTime', + tenantId: 'tenantId', + remark: 'remark', + jobMessage: 'jobMessage', + jobLogStatus: 'jobLogStatus', + executeTime: 'executeTime', + exceptionInfo: 'exceptionInfo', + inputjobIdTip: 'input jobId', + inputjobNameTip: 'input jobName', + inputjobGroupTip: 'input jobGroup', + inputjobOrderTip: 'input jobOrder', + inputjobTypeTip: 'input jobType', + inputexecutePathTip: 'input executePath', + inputclassNameTip: 'input className', + inputmethodNameTip: 'input methodName', + inputmethodParamsValueTip: 'input methodParamsValue', + inputcronExpressionTip: 'input cronExpression', + inputmisfirePolicyTip: 'input misfirePolicy', + inputjobTenantTypeTip: 'input jobTenantType', + inputjobStatusTip: 'input jobStatus', + inputjobExecuteStatusTip: 'input jobExecuteStatus', + inputcreateByTip: 'input createBy', + inputcreateTimeTip: 'input createTime', + inputupdateByTip: 'input updateBy', + inputupdateTimeTip: 'input updateTime', + inputstartTimeTip: 'input startTime', + inputpreviousTimeTip: 'input previousTime', + inputnextTimeTip: 'input nextTime', + inputtenantIdTip: 'input tenantId', + inputremarkTip: 'input remark', + } +} diff --git a/src/views/daemon/job-manage/i18n/zh-cn.ts b/src/views/daemon/job-manage/i18n/zh-cn.ts new file mode 100644 index 00000000..a8cca61f --- /dev/null +++ b/src/views/daemon/job-manage/i18n/zh-cn.ts @@ -0,0 +1,56 @@ +export default { + job: { + index: '序号', + importsysJobTip: '导入定时任务调度表', + jobId: '任务id', + jobName: '任务名称', + jobGroup: '任务组名', + jobOrder: '组内执行顺利', + jobType: '类型', + executePath: '执行路径', + className: '执行文件', + methodName: '执行方法', + methodParamsValue: '参数值', + cronExpression: 'cron表达式', + misfirePolicy: '错失执行策略', + jobTenantType: '1、多租户任务;2、非多租户任务', + jobStatus: '任务状态', + jobExecuteStatus: '执行状态', + createBy: '创建者', + createTime: '创建时间', + updateBy: '更新者', + updateTime: '更新时间', + startTime: '初次执行时间', + previousTime: '上次执行时间', + nextTime: '下次执行时间', + tenantId: '租户', + remark: '备注信息', + jobMessage: '日志信息', + jobLogStatus: '执行状态', + executeTime: '执行时间', + exceptionInfo: '异常信息', + inputjobIdTip: '请输入任务id', + inputjobNameTip: '请输入任务名称', + inputjobGroupTip: '请输入任务组名', + inputjobOrderTip: '请输入组内执行顺利', + inputjobTypeTip: '请输入类型', + inputexecutePathTip: '请输入执行路径', + inputclassNameTip: '请输入执行文件', + inputmethodNameTip: '请输入执行方法', + inputmethodParamsValueTip: '请输入参数值', + inputcronExpressionTip: '请输入cron表达式', + inputmisfirePolicyTip: '请输入错失执行策略', + inputjobTenantTypeTip: '请输入1、多租户任务;2、非多租户任务', + inputjobStatusTip: '请输入任务状态', + inputjobExecuteStatusTip: '请输入执行状态', + inputcreateByTip: '请输入创建者', + inputcreateTimeTip: '请输入创建时间', + inputupdateByTip: '请输入更新者', + inputupdateTimeTip: '请输入更新时间', + inputstartTimeTip: '请输入初次执行时间', + inputpreviousTimeTip: '请输入上次执行时间', + inputnextTimeTip: '请输入下次执行时间', + inputtenantIdTip: '请输入租户', + inputremarkTip: '请输入备注信息', + } +} diff --git a/src/views/daemon/job-manage/index.vue b/src/views/daemon/job-manage/index.vue new file mode 100644 index 00000000..fe340eb2 --- /dev/null +++ b/src/views/daemon/job-manage/index.vue @@ -0,0 +1,217 @@ + + + diff --git a/src/views/daemon/job-manage/job-log.vue b/src/views/daemon/job-manage/job-log.vue new file mode 100644 index 00000000..a419dedb --- /dev/null +++ b/src/views/daemon/job-manage/job-log.vue @@ -0,0 +1,74 @@ + + + + + diff --git a/src/views/gen/table/index.vue b/src/views/gen/table/index.vue index 9e688206..edc80d46 100644 --- a/src/views/gen/table/index.vue +++ b/src/views/gen/table/index.vue @@ -102,7 +102,8 @@ const state: BasicTableProps = reactive({ queryForm: { dsName: 'master' }, - pageList: fetchList + pageList: fetchList, + createdIsNeed: false }) // table hook @@ -117,6 +118,9 @@ const { onMounted(() => { list().then(res => { datasourceList.value = res.data + // 默认去第一个数据源 + state.queryForm.dsName = datasourceList.value[0].name + getDataList() }) })