feat(sj_map_reduce): 任务项列列表新增任务名称字段

This commit is contained in:
xlsea 2024-06-24 10:45:03 +08:00
parent 14685a9afb
commit cac00f15b4
2 changed files with 29 additions and 3 deletions

View File

@ -1029,6 +1029,8 @@ declare namespace Api {
jobId: string;
/** 组名称 */
groupName: string;
/** 任务名称 */
taskName: string;
/** 地址 */
clientInfo: string;
/** 参数 */
@ -1065,7 +1067,7 @@ declare namespace Api {
/** jobTask list */
type JobTaskList = Common.PaginatingQueryRecord<JobTask>;
/** jobTask tree list */
type JobTaskTreeList = Common.PaginatingQueryRecord<JobTaskTree>;
type JobTaskTreeList = JobTask[];
}
/**

View File

@ -1,7 +1,9 @@
<script setup lang="tsx">
import type { DataTableRowKey } from 'naive-ui';
import { NButton, NCode, NPopover, NTag } from 'naive-ui';
import hljs from 'highlight.js/lib/core';
import json from 'highlight.js/lib/languages/json';
import { ref } from 'vue';
import { taskStatusRecord } from '@/constants/business';
import { $t } from '@/locales';
import { parseArgsJson } from '@/utils/common';
@ -27,6 +29,8 @@ interface Emits {
const emit = defineEmits<Emits>();
const expandedRowKeys = ref<DataTableRowKey[]>([]);
const { columns, data, loading, mobilePagination } = useTable({
apiFn: fetchGetJobTaskList,
apiParams: {
@ -44,7 +48,10 @@ const { columns, data, loading, mobilePagination } = useTable({
key: 'id',
title: $t('page.jobBatch.jobTask.id'),
align: 'left',
minWidth: 120
minWidth: 100,
ellipsis: {
tooltip: true
}
},
{
key: 'index',
@ -63,6 +70,12 @@ const { columns, data, loading, mobilePagination } = useTable({
align: 'left',
minWidth: 180
},
{
key: 'taskName',
title: $t('page.jobBatch.jobName'),
align: 'left',
minWidth: 180
},
{
key: 'taskStatus',
title: $t('page.jobBatch.jobTask.taskStatus'),
@ -158,7 +171,7 @@ const onLoad = (row: Record<string, any>) => {
parentId: row.id
})
.then(res => {
row.children = res.data?.data || [];
row.children = res.data || [];
resolve();
})
.catch(e => {
@ -166,6 +179,14 @@ const onLoad = (row: Record<string, any>) => {
});
});
};
const onExpandedRowKeys = (keys: DataTableRowKey[]) => {
expandedRowKeys.value = keys;
};
const onUpdatePage = (_: number) => {
expandedRowKeys.value = [];
};
</script>
<template>
@ -180,7 +201,10 @@ const onLoad = (row: Record<string, any>) => {
:indent="16"
:cascade="false"
allow-checking-not-loaded
:expanded-row-keys="expandedRowKeys"
class="sm:h-full"
@update:expanded-row-keys="onExpandedRowKeys"
@update:page="onUpdatePage"
@load="onLoad"
/>
</template>