style: 调度任务多语言
This commit is contained in:
@@ -101,45 +101,45 @@ let tableState: TabeStateType = reactive({
|
||||
/**表格字段列 */
|
||||
let tableColumns: ColumnsType = [
|
||||
{
|
||||
title: '任务编号',
|
||||
title: t('common.rowId'),
|
||||
dataIndex: 'jobId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '任务名称',
|
||||
title: t('views.monitor.job.jobName'),
|
||||
dataIndex: 'jobName',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '任务组名',
|
||||
title: t('views.monitor.job.jobGroup'),
|
||||
dataIndex: 'jobGroup',
|
||||
key: 'jobGroup',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '调用目标',
|
||||
title: t('views.monitor.job.invokeTarget'),
|
||||
dataIndex: 'invokeTarget',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: 'cron表达式',
|
||||
title: t('views.monitor.job.cronExpression'),
|
||||
dataIndex: 'cronExpression',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
title: t('views.monitor.job.status'),
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '记录日志',
|
||||
title: t('views.monitor.job.saveLog'),
|
||||
dataIndex: 'saveLog',
|
||||
key: 'saveLog',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
title: t('common.operate'),
|
||||
key: 'jobId',
|
||||
align: 'center',
|
||||
},
|
||||
@@ -163,7 +163,8 @@ let tablePagination = reactive({
|
||||
showSizeChanger: true,
|
||||
/**数据总数 */
|
||||
total: 0,
|
||||
showTotal: (total: number) => `总共 ${total} 条`,
|
||||
showTotal: (total: number) =>
|
||||
t('common.tablePaginationTotal', { total: total }),
|
||||
onChange: (page: number, pageSize: number) => {
|
||||
tablePagination.current = page;
|
||||
tablePagination.pageSize = pageSize;
|
||||
@@ -235,7 +236,7 @@ const modalStateFrom = Form.useForm(
|
||||
required: true,
|
||||
min: 2,
|
||||
max: 20,
|
||||
message: '请正确输入任务名称,限2-20个字符',
|
||||
message: t('views.monitor.job.jobNamePlease'),
|
||||
},
|
||||
],
|
||||
invokeTarget: [
|
||||
@@ -243,14 +244,14 @@ const modalStateFrom = Form.useForm(
|
||||
required: true,
|
||||
min: 2,
|
||||
max: 20,
|
||||
message: '请正确输入调用目标,限2-20个字符',
|
||||
message: t('views.monitor.job.invokeTargetPlease'),
|
||||
},
|
||||
],
|
||||
cronExpression: [
|
||||
{
|
||||
required: true,
|
||||
min: 6,
|
||||
message: '请输入或生成cron执行表达式',
|
||||
message: t('views.monitor.job.cronExpressionPlease'),
|
||||
},
|
||||
],
|
||||
})
|
||||
@@ -262,7 +263,7 @@ const modalStateFrom = Form.useForm(
|
||||
*/
|
||||
function fnModalVisibleByVive(jobId: string | number) {
|
||||
if (!jobId) {
|
||||
message.error(`任务记录存在错误`, 2);
|
||||
message.error(t('views.monitor.job.tipRowErr'), 2);
|
||||
return;
|
||||
}
|
||||
if (modalState.confirmLoading) return;
|
||||
@@ -273,10 +274,10 @@ function fnModalVisibleByVive(jobId: string | number) {
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
modalState.from = Object.assign(modalState.from, res.data);
|
||||
modalState.title = '任务信息';
|
||||
modalState.title = t('views.monitor.job.viewJob');
|
||||
modalState.visibleByView = true;
|
||||
} else {
|
||||
message.error(`获取任务信息失败`, 2);
|
||||
message.error(t('views.monitor.job.viewInfoErr'), 2);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -288,7 +289,7 @@ function fnModalVisibleByVive(jobId: string | number) {
|
||||
function fnModalVisibleByEdit(jobId?: string | number) {
|
||||
if (!jobId) {
|
||||
modalStateFrom.resetFields();
|
||||
modalState.title = '添加任务';
|
||||
modalState.title = t('views.monitor.job.addJob');
|
||||
modalState.visibleByEdit = true;
|
||||
} else {
|
||||
if (modalState.confirmLoading) return;
|
||||
@@ -299,10 +300,10 @@ function fnModalVisibleByEdit(jobId?: string | number) {
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
modalState.from = Object.assign(modalState.from, res.data);
|
||||
modalState.title = '修改任务';
|
||||
modalState.title = t('views.monitor.job.editJob');
|
||||
modalState.visibleByEdit = true;
|
||||
} else {
|
||||
message.error(`获取任务信息失败`, 2);
|
||||
message.error(t('views.monitor.job.viewInfoErr'), 2);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -325,13 +326,13 @@ function fnModalOk() {
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `${modalState.title}成功`,
|
||||
content: t('common.msgSuccess', { msg: modalState.title }),
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
modalState.visibleByEdit = false;
|
||||
modalStateFrom.resetFields();
|
||||
fnGetList();
|
||||
fnGetList(1);
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
@@ -345,7 +346,7 @@ function fnModalOk() {
|
||||
});
|
||||
})
|
||||
.catch(e => {
|
||||
message.error(`请正确填写 ${e.errorFields.length} 处必填信息!`, 2);
|
||||
message.error(t('common.errorFields', { num: e.errorFields.length }), 3);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -374,17 +375,20 @@ function fnModalCron(opt: boolean, cronStr?: string) {
|
||||
* @param row 任务信息对象
|
||||
*/
|
||||
function fnRecordStatus(row: Record<string, string>) {
|
||||
const text = row.status === '1' ? '开启' : '关闭';
|
||||
const text =
|
||||
row.status === '1'
|
||||
? t('views.monitor.job.status1')
|
||||
: t('views.monitor.job.status0');
|
||||
Modal.confirm({
|
||||
title: t('common.tipTitle'),
|
||||
content: `确定要${text} ${row.jobName} 任务吗?`,
|
||||
content: t('views.monitor.job.statusChange', { text, num: row.jobName }),
|
||||
onOk() {
|
||||
const key = 'changeJobStatus';
|
||||
message.loading({ content: t('common.loading'), key });
|
||||
changeJobStatus(row.jobId, row.status).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `${row.jobName} ${text}成功`,
|
||||
content: t('common.msgSuccess', { msg: `${row.jobName} ${text}` }),
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
@@ -411,14 +415,14 @@ function fnRecordStatus(row: Record<string, string>) {
|
||||
function fnRecordRunOne(row: Record<string, string>) {
|
||||
Modal.confirm({
|
||||
title: t('common.tipTitle'),
|
||||
content: `确定要立即执行一次 【${row.jobName}】 任务吗?`,
|
||||
content: t('views.monitor.job.runOneTip', { num: row.jobName }),
|
||||
onOk() {
|
||||
const key = 'runJob';
|
||||
message.loading({ content: t('common.loading'), key });
|
||||
runJob(row.jobId).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `${row.jobName} 执行成功`,
|
||||
content: t('views.monitor.job.runOneOk', { num: row.jobName }),
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
@@ -444,14 +448,14 @@ function fnRecordDelete(jobId: string = '0') {
|
||||
}
|
||||
Modal.confirm({
|
||||
title: t('common.tipTitle'),
|
||||
content: `确认删除定时任务编号为 【${jobId}】 任务吗?`,
|
||||
content: t('views.monitor.job.runOneTip', { num: jobId }),
|
||||
onOk() {
|
||||
const key = 'delJob';
|
||||
message.loading({ content: t('common.loading'), key });
|
||||
delJob(jobId).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `删除成功`,
|
||||
content: t('views.monitor.job.delOk'),
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
@@ -474,14 +478,14 @@ function fnRecordDelete(jobId: string = '0') {
|
||||
function fnResetQueueJob() {
|
||||
Modal.confirm({
|
||||
title: t('common.tipTitle'),
|
||||
content: `确定要重置并刷新调度任务吗?`,
|
||||
content: t('views.monitor.job.resetTip'),
|
||||
onOk() {
|
||||
const key = 'resetQueueJob';
|
||||
message.loading({ content: t('common.loading'), key });
|
||||
resetQueueJob().then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `重置成功`,
|
||||
content: t('views.monitor.job.resetOk'),
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
@@ -501,14 +505,14 @@ function fnResetQueueJob() {
|
||||
function fnExportList() {
|
||||
Modal.confirm({
|
||||
title: t('common.tipTitle'),
|
||||
content: `确认根据搜索条件导出xlsx表格文件吗?`,
|
||||
content: t('views.monitor.job.exportTip'),
|
||||
onOk() {
|
||||
const key = 'exportJob';
|
||||
message.loading({ content: t('common.loading'), key });
|
||||
exportJob(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `已完成导出`,
|
||||
content: t('views.monitor.job.exportOk'),
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
@@ -583,31 +587,34 @@ onMounted(() => {
|
||||
<a-form :model="queryParams" name="queryParams" layout="horizontal">
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item label="任务名称" name="jobName">
|
||||
<a-form-item :label="t('views.monitor.job.jobName')" name="jobName">
|
||||
<a-input
|
||||
v-model:value="queryParams.jobName"
|
||||
allow-clear
|
||||
placeholder="请输入任务名称"
|
||||
:placeholder="t('views.monitor.job.jobNamePlease')"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item label="任务组名" name="jobGroup">
|
||||
<a-form-item
|
||||
:label="t('views.monitor.job.jobGroup')"
|
||||
name="jobGroup"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="queryParams.jobGroup"
|
||||
allow-clear
|
||||
placeholder="请选择菜单状态"
|
||||
:placeholder="t('common.selectPlease')"
|
||||
:options="dict.sysJobGroup"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item label="任务状态" name="status">
|
||||
<a-form-item :label="t('views.monitor.job.status')" name="status">
|
||||
<a-select
|
||||
v-model:value="queryParams.status"
|
||||
allow-clear
|
||||
placeholder="请选择任务状态"
|
||||
:placeholder="t('common.selectPlease')"
|
||||
:options="dict.sysJobStatus"
|
||||
>
|
||||
</a-select>
|
||||
@@ -618,12 +625,12 @@ onMounted(() => {
|
||||
<a-space :size="8">
|
||||
<a-button type="primary" @click.prevent="fnGetList(1)">
|
||||
<template #icon><SearchOutlined /></template>
|
||||
搜索</a-button
|
||||
>
|
||||
{{ t('common.search') }}
|
||||
</a-button>
|
||||
<a-button type="default" @click.prevent="fnQueryReset">
|
||||
<template #icon><ClearOutlined /></template>
|
||||
重置</a-button
|
||||
>
|
||||
{{ t('common.reset') }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -641,7 +648,7 @@ onMounted(() => {
|
||||
v-perms:has="['monitor:job:add']"
|
||||
>
|
||||
<template #icon><PlusOutlined /></template>
|
||||
新建
|
||||
{{ t('common.addText') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="default"
|
||||
@@ -651,7 +658,7 @@ onMounted(() => {
|
||||
v-perms:has="['monitor:job:remove']"
|
||||
>
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
删除
|
||||
{{ t('common.deleteText') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="dashed"
|
||||
@@ -659,7 +666,7 @@ onMounted(() => {
|
||||
v-perms:has="['monitor:job:export']"
|
||||
>
|
||||
<template #icon><ExportOutlined /></template>
|
||||
导出
|
||||
{{ t('common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="default"
|
||||
@@ -667,7 +674,7 @@ onMounted(() => {
|
||||
v-perms:has="['monitor:job:query']"
|
||||
>
|
||||
<template #icon><ContainerOutlined /></template>
|
||||
日志
|
||||
{{ t('views.monitor.job.jobLog') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="dashed"
|
||||
@@ -676,7 +683,7 @@ onMounted(() => {
|
||||
v-perms:has="['monitor:job:remove']"
|
||||
>
|
||||
<template #icon><SyncOutlined /></template>
|
||||
重置队列
|
||||
{{ t('views.monitor.job.resetQueue') }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
@@ -685,31 +692,31 @@ onMounted(() => {
|
||||
<template #extra>
|
||||
<a-space :size="8" align="center">
|
||||
<a-tooltip>
|
||||
<template #title>搜索栏</template>
|
||||
<template #title>{{ t('common.searchBarText') }}</template>
|
||||
<a-switch
|
||||
v-model:checked="tableState.seached"
|
||||
checked-children="显"
|
||||
un-checked-children="隐"
|
||||
:checked-children="t('common.switch.show')"
|
||||
:un-checked-children="t('common.switch.hide')"
|
||||
size="small"
|
||||
/>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>表格斑马纹</template>
|
||||
<template #title>{{ t('common.tableStripedText') }}</template>
|
||||
<a-switch
|
||||
v-model:checked="tableState.striped"
|
||||
checked-children="开"
|
||||
un-checked-children="关"
|
||||
:checked-children="t('common.switch.open')"
|
||||
:un-checked-children="t('common.switch.shut')"
|
||||
size="small"
|
||||
/>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>刷新</template>
|
||||
<template #title>{{ t('common.reloadText') }}</template>
|
||||
<a-button type="text" @click.prevent="fnGetList()">
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="topRight">
|
||||
<template #title>密度</template>
|
||||
<template #title>{{ t('common.sizeText') }}</template>
|
||||
<a-dropdown placement="bottomRight" trigger="click">
|
||||
<a-button type="text">
|
||||
<template #icon><ColumnHeightOutlined /></template>
|
||||
@@ -719,9 +726,15 @@ onMounted(() => {
|
||||
:selected-keys="[tableState.size as string]"
|
||||
@click="fnTableSize"
|
||||
>
|
||||
<a-menu-item key="default">默认</a-menu-item>
|
||||
<a-menu-item key="middle">中等</a-menu-item>
|
||||
<a-menu-item key="small">紧凑</a-menu-item>
|
||||
<a-menu-item key="default">
|
||||
{{ t('common.size.default') }}
|
||||
</a-menu-item>
|
||||
<a-menu-item key="middle">
|
||||
{{ t('common.size.middle') }}
|
||||
</a-menu-item>
|
||||
<a-menu-item key="small">
|
||||
{{ t('common.size.small') }}
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
@@ -755,9 +768,9 @@ onMounted(() => {
|
||||
v-if="hasPermissions(['monitor:job:changeStatus'])"
|
||||
v-model:checked="record.status"
|
||||
checked-value="1"
|
||||
checked-children="正常"
|
||||
:checked-children="t('views.monitor.job.status01')"
|
||||
un-checked-value="0"
|
||||
un-checked-children="暂停"
|
||||
:un-checked-children="t('views.monitor.job.status00')"
|
||||
size="small"
|
||||
@change="fnRecordStatus(record)"
|
||||
/>
|
||||
@@ -773,7 +786,7 @@ onMounted(() => {
|
||||
<template v-if="column.key === 'jobId'">
|
||||
<a-space :size="8" align="center">
|
||||
<a-tooltip>
|
||||
<template #title>查看详情</template>
|
||||
<template #title>{{ t('common.viewText') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnModalVisibleByVive(record.jobId)"
|
||||
@@ -783,7 +796,7 @@ onMounted(() => {
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>编辑</template>
|
||||
<template #title>{{ t('common.editText') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnModalVisibleByEdit(record.jobId)"
|
||||
@@ -793,7 +806,7 @@ onMounted(() => {
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>删除</template>
|
||||
<template #title>{{ t('common.deleteText') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnRecordDelete(record.jobId)"
|
||||
@@ -803,7 +816,7 @@ onMounted(() => {
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>执行一次</template>
|
||||
<template #title>{{ t('views.monitor.job.runOne') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnRecordRunOne(record)"
|
||||
@@ -813,7 +826,7 @@ onMounted(() => {
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>任务日志</template>
|
||||
<template #title>{{ t('views.monitor.job.jobLog') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnJobLogView(record.jobId)"
|
||||
@@ -838,34 +851,53 @@ onMounted(() => {
|
||||
<a-form layout="horizontal">
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="任务名称" name="jobName">
|
||||
<a-form-item :label="t('views.monitor.job.jobName')" name="jobName">
|
||||
{{ modalState.from.jobName }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="6" :xs="24">
|
||||
<a-form-item label="出错策略" name="misfirePolicy">
|
||||
<a-form-item
|
||||
:label="t('views.monitor.job.misfirePolicy')"
|
||||
name="misfirePolicy"
|
||||
>
|
||||
{{
|
||||
['立即执行', '执行一次', '放弃执行'][
|
||||
+modalState.from.misfirePolicy - 1
|
||||
]
|
||||
[
|
||||
t('views.monitor.job.misfirePolicy1'),
|
||||
t('views.monitor.job.misfirePolicy2'),
|
||||
t('views.monitor.job.misfirePolicy3'),
|
||||
][+modalState.from.misfirePolicy - 1]
|
||||
}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="6" :xs="24">
|
||||
<a-form-item label="是否并发" name="concurrent">
|
||||
{{ ['禁止', '允许'][+modalState.from.concurrent] }}
|
||||
<a-form-item
|
||||
:label="t('views.monitor.job.concurrent')"
|
||||
name="concurrent"
|
||||
>
|
||||
{{
|
||||
[
|
||||
t('views.monitor.job.concurrent0'),
|
||||
t('views.monitor.job.concurrent1'),
|
||||
][+modalState.from.concurrent]
|
||||
}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="调用目标" name="invokeTarget">
|
||||
<a-form-item
|
||||
:label="t('views.monitor.job.invokeTarget')"
|
||||
name="invokeTarget"
|
||||
>
|
||||
{{ modalState.from.invokeTarget }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="6" :xs="24">
|
||||
<a-form-item label="任务组名" name="jobGroup">
|
||||
<a-form-item
|
||||
:label="t('views.monitor.job.jobGroup')"
|
||||
name="jobGroup"
|
||||
>
|
||||
<DictTag
|
||||
:options="dict.sysJobGroup"
|
||||
:value="modalState.from.jobGroup"
|
||||
@@ -873,22 +905,30 @@ onMounted(() => {
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="6" :xs="24">
|
||||
<a-form-item label="任务状态" name="status">
|
||||
{{ ['暂停', '正常'][+modalState.from.status] }}
|
||||
<a-form-item :label="t('views.monitor.job.status')" name="status">
|
||||
{{
|
||||
[
|
||||
t('views.monitor.job.status00'),
|
||||
t('views.monitor.job.status01'),
|
||||
][+modalState.from.status]
|
||||
}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="cron表达式" name="cronExpression">
|
||||
<a-form-item
|
||||
:label="t('views.monitor.job.cronExpression')"
|
||||
name="cronExpression"
|
||||
>
|
||||
<a-tag color="default">
|
||||
{{ modalState.from.cronExpression }}
|
||||
</a-tag>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="记录日志" name="status">
|
||||
<a-form-item :label="t('views.monitor.job.saveLog')" name="saveLog">
|
||||
<DictTag
|
||||
:options="dict.sysJobSaveLog"
|
||||
:value="modalState.from.saveLog"
|
||||
@@ -897,22 +937,30 @@ onMounted(() => {
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item label="创建时间" name="createTime">
|
||||
<a-form-item
|
||||
:label="t('views.monitor.job.createTime')"
|
||||
name="createTime"
|
||||
>
|
||||
<span v-if="+modalState.from.createTime > 0">
|
||||
{{ parseDateToStr(+modalState.from.createTime) }}
|
||||
</span>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="传入参数" name="targetParams">
|
||||
<a-form-item
|
||||
:label="t('views.monitor.job.targetParams')"
|
||||
name="targetParams"
|
||||
>
|
||||
{{ modalState.from.targetParams }}
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="备注说明" name="remark">
|
||||
<a-form-item :label="t('views.monitor.job.remark')" name="remark">
|
||||
{{ modalState.from.remark }}
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<template #footer>
|
||||
<a-button key="cancel" @click="fnModalCancel">关闭</a-button>
|
||||
<a-button key="cancel" @click="fnModalCancel">
|
||||
{{ t('common.close') }}
|
||||
</a-button>
|
||||
</template>
|
||||
</a-modal>
|
||||
|
||||
@@ -931,41 +979,57 @@ onMounted(() => {
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
label="任务名称"
|
||||
:label="t('views.monitor.job.jobName')"
|
||||
name="jobName"
|
||||
v-bind="modalStateFrom.validateInfos.jobName"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="modalState.from.jobName"
|
||||
allow-clear
|
||||
placeholder="请输入任务名称"
|
||||
:placeholder="t('views.monitor.job.jobNamePlease')"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="6" :xs="24">
|
||||
<a-form-item label="执行策略" name="misfirePolicy">
|
||||
<a-form-item
|
||||
:label="t('views.monitor.job.misfirePolicy')"
|
||||
name="misfirePolicy"
|
||||
>
|
||||
<a-select
|
||||
:disabled="true"
|
||||
v-model:value="modalState.from.misfirePolicy"
|
||||
default-value="3"
|
||||
placeholder="出错策略"
|
||||
:placeholder="t('common.selectPlease')"
|
||||
>
|
||||
<a-select-option key="1" value="1">立即执行</a-select-option>
|
||||
<a-select-option key="2" value="2">执行一次</a-select-option>
|
||||
<a-select-option key="3" value="3">放弃执行</a-select-option>
|
||||
<a-select-option key="1" value="1">
|
||||
{{ t('views.monitor.job.misfirePolicy1') }}
|
||||
</a-select-option>
|
||||
<a-select-option key="2" value="2">
|
||||
{{ t('views.monitor.job.misfirePolicy2') }}
|
||||
</a-select-option>
|
||||
<a-select-option key="3" value="3">
|
||||
{{ t('views.monitor.job.misfirePolicy3') }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="6" :xs="24">
|
||||
<a-form-item label="是否并发" name="concurrent">
|
||||
<a-form-item
|
||||
:label="t('views.monitor.job.concurrent')"
|
||||
name="concurrent"
|
||||
>
|
||||
<a-select
|
||||
:disabled="true"
|
||||
v-model:value="modalState.from.concurrent"
|
||||
default-value="0"
|
||||
placeholder="是否并发"
|
||||
:placeholder="t('common.selectPlease')"
|
||||
>
|
||||
<a-select-option key="1" value="1">允许</a-select-option>
|
||||
<a-select-option key="0" value="0">禁止</a-select-option>
|
||||
<a-select-option key="1" value="1">
|
||||
{{ t('views.monitor.job.concurrent1') }}
|
||||
</a-select-option>
|
||||
<a-select-option key="0" value="0">
|
||||
{{ t('views.monitor.job.concurrent0') }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -974,23 +1038,19 @@ onMounted(() => {
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
label="调用目标"
|
||||
:label="t('views.monitor.job.invokeTarget')"
|
||||
name="invokeTarget"
|
||||
v-bind="modalStateFrom.validateInfos.invokeTarget"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="modalState.from.invokeTarget"
|
||||
allow-clear
|
||||
placeholder="请输入调用目标"
|
||||
:placeholder="t('views.monitor.job.invokeTargetPlease')"
|
||||
>
|
||||
<template #prefix>
|
||||
<a-tooltip placement="topLeft">
|
||||
<template #title>
|
||||
<div>
|
||||
Processor调用示例:simple <br />
|
||||
定义任务处理器示例:src\modules\monitor\processor <br />
|
||||
参数说明:支持预设传入参数,在处理器中进行序列化处理参数
|
||||
</div>
|
||||
<div>{{ t('views.monitor.job.invokeTargetTip') }}</div>
|
||||
</template>
|
||||
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
|
||||
</a-tooltip>
|
||||
@@ -999,22 +1059,25 @@ onMounted(() => {
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="6" :xs="24">
|
||||
<a-form-item label="任务组名" name="jobGroup">
|
||||
<a-form-item
|
||||
:label="t('views.monitor.job.jobGroup')"
|
||||
name="jobGroup"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="modalState.from.jobGroup"
|
||||
default-value="DEFAULT"
|
||||
placeholder="任务组名"
|
||||
:placeholder="t('common.selectPlease')"
|
||||
:options="dict.sysJobGroup"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="6" :xs="24">
|
||||
<a-form-item label="任务状态" name="status">
|
||||
<a-form-item :label="t('views.monitor.job.status')" name="status">
|
||||
<a-select
|
||||
v-model:value="modalState.from.status"
|
||||
default-value="0"
|
||||
placeholder="任务状态"
|
||||
:placeholder="t('common.selectPlease')"
|
||||
:options="dict.sysJobStatus"
|
||||
>
|
||||
</a-select>
|
||||
@@ -1025,7 +1088,7 @@ onMounted(() => {
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="18" :md="18" :xs="24">
|
||||
<a-form-item
|
||||
label="cron表达式"
|
||||
:label="t('views.monitor.job.cronExpression')"
|
||||
name="cronExpression"
|
||||
:label-col="{ span: 4 }"
|
||||
v-bind="modalStateFrom.validateInfos.cronExpression"
|
||||
@@ -1033,14 +1096,14 @@ onMounted(() => {
|
||||
<a-input
|
||||
v-model:value="modalState.from.cronExpression"
|
||||
allow-clear
|
||||
placeholder="请输入或生成cron执行表达式"
|
||||
:placeholder="t('views.monitor.job.cronExpressionPlease')"
|
||||
>
|
||||
<template #prefix>
|
||||
<a-tooltip placement="topLeft">
|
||||
<template #title>
|
||||
<div>
|
||||
表达式示例:0/20 * * * * ? <br />
|
||||
示例说明:每20秒执行任务
|
||||
{{ t('views.monitor.job.cronExpressionTip') }}<br />
|
||||
{{ t('views.monitor.job.cronExpressionTip1') }}
|
||||
</div>
|
||||
</template>
|
||||
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
|
||||
@@ -1053,18 +1116,18 @@ onMounted(() => {
|
||||
@click.prevent="fnModalCron(true)"
|
||||
>
|
||||
<template #icon><FieldTimeOutlined /></template>
|
||||
生成表达式
|
||||
{{ t('views.monitor.job.cronExpressionNew') }}
|
||||
</a-button>
|
||||
</template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="6" :xs="24">
|
||||
<a-form-item label="记录日志" name="saveLog">
|
||||
<a-form-item :label="t('views.monitor.job.saveLog')" name="saveLog">
|
||||
<a-select
|
||||
v-model:value="modalState.from.saveLog"
|
||||
default-value="0"
|
||||
placeholder="记录日志"
|
||||
:placeholder="t('common.selectPlease')"
|
||||
:options="dict.sysJobSaveLog"
|
||||
>
|
||||
</a-select>
|
||||
@@ -1073,7 +1136,7 @@ onMounted(() => {
|
||||
</a-row>
|
||||
|
||||
<a-form-item
|
||||
label="传入参数"
|
||||
:label="t('views.monitor.job.targetParams')"
|
||||
name="targetParams"
|
||||
:label-col="{ span: 4 }"
|
||||
>
|
||||
@@ -1081,17 +1144,20 @@ onMounted(() => {
|
||||
v-model:value="modalState.from.targetParams"
|
||||
:auto-size="{ minRows: 2, maxRows: 6 }"
|
||||
:maxlength="400"
|
||||
placeholder="调用目标传入参数,仅支持json字符串"
|
||||
:placeholder="t('views.monitor.job.targetParamsPlease')"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="备注说明" name="remark" :label-col="{ span: 4 }">
|
||||
<a-form-item
|
||||
:label="t('views.monitor.job.remark')"
|
||||
name="remark"
|
||||
:label-col="{ span: 4 }"
|
||||
>
|
||||
<a-textarea
|
||||
v-model:value="modalState.from.remark"
|
||||
:auto-size="{ minRows: 2, maxRows: 6 }"
|
||||
:maxlength="400"
|
||||
:show-count="true"
|
||||
placeholder="可输入任务说明"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
|
||||
@@ -313,7 +313,7 @@ function fnModalOk() {
|
||||
});
|
||||
modalState.visibleByEdit = false;
|
||||
modalStateFrom.resetFields();
|
||||
fnGetList();
|
||||
fnGetList(1);
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
@@ -432,10 +432,13 @@ function fnRefreshCache() {
|
||||
});
|
||||
}
|
||||
|
||||
/**查询参数配置列表 */
|
||||
function fnGetList() {
|
||||
/**查询参数配置列表, pageNum初始页数 */
|
||||
function fnGetList(pageNum?: number) {
|
||||
if (tableState.loading) return;
|
||||
tableState.loading = true;
|
||||
if (pageNum) {
|
||||
queryParams.pageNum = pageNum;
|
||||
}
|
||||
if (!queryRangePicker.value) {
|
||||
queryRangePicker.value = ['', ''];
|
||||
}
|
||||
@@ -531,7 +534,7 @@ onMounted(() => {
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item>
|
||||
<a-space :size="8">
|
||||
<a-button type="primary" @click.prevent="fnGetList">
|
||||
<a-button type="primary" @click.prevent="fnGetList(1)">
|
||||
<template #icon><SearchOutlined /></template>
|
||||
{{ t('common.search') }}
|
||||
</a-button>
|
||||
@@ -611,7 +614,7 @@ onMounted(() => {
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>{{ t('common.reloadText') }}</template>
|
||||
<a-button type="text" @click.prevent="fnGetList">
|
||||
<a-button type="text" @click.prevent="fnGetList()">
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
|
||||
Reference in New Issue
Block a user