🔨 添加执行用户条件.
This commit is contained in:
@@ -56,6 +56,9 @@ public class ExecJobQueryRequest extends PageRequest {
|
|||||||
@Schema(description = "任务状态")
|
@Schema(description = "任务状态")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "执行用户id")
|
||||||
|
private Long execUserId;
|
||||||
|
|
||||||
@Schema(description = "是否查询最近执行任务")
|
@Schema(description = "是否查询最近执行任务")
|
||||||
private Boolean queryRecentLog;
|
private Boolean queryRecentLog;
|
||||||
|
|
||||||
|
|||||||
@@ -408,6 +408,7 @@ public class ExecJobServiceImpl implements ExecJobService {
|
|||||||
.like(ExecJobDO::getName, request.getName())
|
.like(ExecJobDO::getName, request.getName())
|
||||||
.like(ExecJobDO::getCommand, request.getCommand())
|
.like(ExecJobDO::getCommand, request.getCommand())
|
||||||
.eq(ExecJobDO::getStatus, request.getStatus())
|
.eq(ExecJobDO::getStatus, request.getStatus())
|
||||||
|
.eq(ExecJobDO::getExecUserId, request.getExecUserId())
|
||||||
.orderByDesc(ExecJobDO::getId);
|
.orderByDesc(ExecJobDO::getId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ export interface ExecJobQueryRequest extends Pagination {
|
|||||||
name?: string;
|
name?: string;
|
||||||
command?: string;
|
command?: string;
|
||||||
status?: number;
|
status?: number;
|
||||||
|
execUserId?: number;
|
||||||
queryRecentLog?: boolean;
|
queryRecentLog?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<a-card class="general-card table-search-card">
|
<a-card class="general-card table-search-card">
|
||||||
<query-header :model="formModel"
|
<query-header :model="formModel"
|
||||||
label-align="left"
|
label-align="left"
|
||||||
:itemOptions="{ 4: { span: 2 } }"
|
:itemOptions="{ 5: { span: 2 } }"
|
||||||
@submit="fetchTableData"
|
@submit="fetchTableData"
|
||||||
@reset="fetchTableData"
|
@reset="fetchTableData"
|
||||||
@keyup.enter="() => fetchTableData()">
|
@keyup.enter="() => fetchTableData()">
|
||||||
@@ -33,6 +33,12 @@
|
|||||||
allow-clear
|
allow-clear
|
||||||
hide-button />
|
hide-button />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
<!-- 执行用户 -->
|
||||||
|
<a-form-item field="userId" label="执行用户">
|
||||||
|
<user-selector v-model="formModel.userId"
|
||||||
|
placeholder="请选择执行用户"
|
||||||
|
allow-clear />
|
||||||
|
</a-form-item>
|
||||||
<!-- 执行时间 -->
|
<!-- 执行时间 -->
|
||||||
<a-form-item field="startTimeRange" label="执行时间">
|
<a-form-item field="startTimeRange" label="执行时间">
|
||||||
<a-range-picker v-model="formModel.startTimeRange"
|
<a-range-picker v-model="formModel.startTimeRange"
|
||||||
@@ -219,7 +225,8 @@
|
|||||||
deleteExecJobLog,
|
deleteExecJobLog,
|
||||||
getExecJobHostLogList,
|
getExecJobHostLogList,
|
||||||
getExecJobLogPage,
|
getExecJobLogPage,
|
||||||
getExecJobLogStatus
|
getExecJobLogStatus,
|
||||||
|
interruptExecJob,
|
||||||
} from '@/api/exec/exec-job-log';
|
} from '@/api/exec/exec-job-log';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
@@ -228,8 +235,8 @@
|
|||||||
import { useExpandable, useTablePagination, useRowSelection } from '@/hooks/table';
|
import { useExpandable, useTablePagination, useRowSelection } from '@/hooks/table';
|
||||||
import { useDictStore } from '@/store';
|
import { useDictStore } from '@/store';
|
||||||
import { dateFormat, formatDuration } from '@/utils';
|
import { dateFormat, formatDuration } from '@/utils';
|
||||||
import { interruptExecJob } from '@/api/exec/exec-job-log';
|
|
||||||
import ExecJobHostLogTable from './exec-job-host-log-table.vue';
|
import ExecJobHostLogTable from './exec-job-host-log-table.vue';
|
||||||
|
import UserSelector from '@/components/user/user/selector/index.vue';
|
||||||
|
|
||||||
const emits = defineEmits(['viewCommand', 'viewParams', 'viewLog', 'openClear']);
|
const emits = defineEmits(['viewCommand', 'viewParams', 'viewLog', 'openClear']);
|
||||||
|
|
||||||
@@ -241,13 +248,14 @@
|
|||||||
|
|
||||||
const pullIntervalId = ref();
|
const pullIntervalId = ref();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const selectedKeys = ref<number[]>([]);
|
const selectedKeys = ref<Array<number>>([]);
|
||||||
const tableRenderData = ref<ExecLogQueryResponse[]>([]);
|
const tableRenderData = ref<Array<ExecLogQueryResponse>>([]);
|
||||||
const formModel = reactive<ExecLogQueryRequest>({
|
const formModel = reactive<ExecLogQueryRequest>({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
description: undefined,
|
description: undefined,
|
||||||
command: undefined,
|
command: undefined,
|
||||||
status: undefined,
|
status: undefined,
|
||||||
|
userId: undefined,
|
||||||
startTimeRange: undefined,
|
startTimeRange: undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ const columns = [
|
|||||||
dataIndex: 'command',
|
dataIndex: 'command',
|
||||||
slotName: 'command',
|
slotName: 'command',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
ellipsis: true,
|
|
||||||
minWidth: 238,
|
minWidth: 238,
|
||||||
}, {
|
}, {
|
||||||
title: '执行用户',
|
title: '执行用户',
|
||||||
|
|||||||
@@ -32,6 +32,12 @@
|
|||||||
placeholder="请选择状态"
|
placeholder="请选择状态"
|
||||||
allow-clear />
|
allow-clear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
<!-- 执行用户 -->
|
||||||
|
<a-form-item field="execUserId" label="执行用户">
|
||||||
|
<user-selector v-model="formModel.execUserId"
|
||||||
|
placeholder="请选择执行用户"
|
||||||
|
allow-clear />
|
||||||
|
</a-form-item>
|
||||||
</query-header>
|
</query-header>
|
||||||
</a-card>
|
</a-card>
|
||||||
<!-- 表格 -->
|
<!-- 表格 -->
|
||||||
@@ -209,26 +215,30 @@
|
|||||||
import columns from '../types/table.columns';
|
import columns from '../types/table.columns';
|
||||||
import { ExecJobStatus, execJobStatusKey, execStatusKey } from '../types/const';
|
import { ExecJobStatus, execJobStatusKey, execStatusKey } from '../types/const';
|
||||||
import { useTablePagination, useRowSelection } from '@/hooks/table';
|
import { useTablePagination, useRowSelection } from '@/hooks/table';
|
||||||
import { useDictStore } from '@/store';
|
import { useDictStore, useUserStore } from '@/store';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
import { copy } from '@/hooks/copy';
|
import { copy } from '@/hooks/copy';
|
||||||
import { dateFormat } from '@/utils';
|
import { dateFormat } from '@/utils';
|
||||||
|
import UserSelector from '@/components/user/user/selector/index.vue';
|
||||||
|
|
||||||
const emits = defineEmits(['openAdd', 'openUpdate', 'openDetail', 'updateExecUser', 'testCron']);
|
const emits = defineEmits(['openAdd', 'openUpdate', 'openDetail', 'updateExecUser', 'testCron']);
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
const pagination = useTablePagination();
|
const pagination = useTablePagination();
|
||||||
const rowSelection = useRowSelection();
|
const rowSelection = useRowSelection();
|
||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
const { hasPermission } = usePermission();
|
const { hasPermission } = usePermission();
|
||||||
const { toOptions, getDictValue } = useDictStore();
|
const { toOptions, getDictValue } = useDictStore();
|
||||||
|
|
||||||
const selectedKeys = ref<number[]>([]);
|
const selectedKeys = ref<Array<number>>([]);
|
||||||
const tableRenderData = ref<ExecJobQueryResponse[]>([]);
|
const tableRenderData = ref<Array<ExecJobQueryResponse>>([]);
|
||||||
const formModel = reactive<ExecJobQueryRequest>({
|
const formModel = reactive<ExecJobQueryRequest>({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
name: undefined,
|
name: undefined,
|
||||||
command: undefined,
|
command: undefined,
|
||||||
status: undefined,
|
status: undefined,
|
||||||
queryRecentLog: true
|
execUserId: undefined,
|
||||||
|
queryRecentLog: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
// 删除当前行
|
// 删除当前行
|
||||||
@@ -317,6 +327,12 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
// 当前用户
|
||||||
|
const action = route.query.action as string;
|
||||||
|
if (action === 'self') {
|
||||||
|
formModel.execUserId = useUserStore().id;
|
||||||
|
}
|
||||||
|
// 查询
|
||||||
fetchTableData();
|
fetchTableData();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
@updated="() => table.reload()"
|
@updated="() => table.reload()"
|
||||||
@open-host="(e) => hostModal.open(e)"
|
@open-host="(e) => hostModal.open(e)"
|
||||||
@open-template="() => templateModal.open()"
|
@open-template="() => templateModal.open()"
|
||||||
@test-cron="openNextCron"
|
@gen-cron="(e) => genModal.open(e)"
|
||||||
@gen-cron="(e) => genModal.open(e)" />
|
@test-cron="openNextCron" />
|
||||||
<!-- 任务详情模态框 -->
|
<!-- 任务详情模态框 -->
|
||||||
<exec-job-detail-drawer ref="detail" />
|
<exec-job-detail-drawer ref="detail" />
|
||||||
<!-- 修改执行用户模态框 -->
|
<!-- 修改执行用户模态框 -->
|
||||||
|
|||||||
Reference in New Issue
Block a user