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

View File

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