feat(sj_1.1.0-beta1): 优化定时任务和工作流批次任务名称显示优化
This commit is contained in:
parent
35e63abcb6
commit
829f5ed956
@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue';
|
||||
import type { SelectOption } from 'naive-ui';
|
||||
import SelectGroup from '@/components/common/select-group.vue';
|
||||
import TaskBatchStatus from '@/components/common/task-batch-status.vue';
|
||||
import DatetimeRange from '@/components/common/datetime-range.vue';
|
||||
@ -57,9 +58,13 @@ watch(
|
||||
function translateOptions(options: Api.Job.Job[]) {
|
||||
return options.map(option => ({
|
||||
value: option.id,
|
||||
label: `${option.jobName}(${option.id})`
|
||||
label: option.jobName
|
||||
}));
|
||||
}
|
||||
|
||||
function renderLabel(option: SelectOption) {
|
||||
return [option.label as string, `(${option.value})`];
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -71,12 +76,11 @@ function translateOptions(options: Api.Job.Job[]) {
|
||||
<NAutoComplete
|
||||
v-model:value="keywords"
|
||||
:placeholder="$t('page.jobBatch.form.jobName')"
|
||||
value-field="id"
|
||||
label-field="workflowName"
|
||||
:options="translateOptions(jobList)"
|
||||
:empty-visible="noSearchFlag"
|
||||
clearable
|
||||
filterable
|
||||
:render-label="renderLabel"
|
||||
@select="handleSelect"
|
||||
/>
|
||||
</NFormItemGi>
|
||||
|
@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue';
|
||||
import type { SelectOption } from 'naive-ui';
|
||||
import { $t } from '@/locales';
|
||||
import SelectGroup from '@/components/common/select-group.vue';
|
||||
import TaskBatchStatus from '@/components/common/task-batch-status.vue';
|
||||
@ -56,9 +57,13 @@ watch(
|
||||
function translateOptions(options: Api.Workflow.Workflow[]) {
|
||||
return options.map(option => ({
|
||||
value: option.id,
|
||||
label: `${option.workflowName}(${option.id})`
|
||||
label: option.workflowName
|
||||
}));
|
||||
}
|
||||
|
||||
function renderLabel(option: SelectOption) {
|
||||
return [option.label as string, `(${option.value})`];
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -80,6 +85,7 @@ function translateOptions(options: Api.Workflow.Workflow[]) {
|
||||
:empty-visible="noSearchFlag"
|
||||
clearable
|
||||
filterable
|
||||
:render-label="renderLabel"
|
||||
@select="handleSelect"
|
||||
/>
|
||||
</NFormItemGi>
|
||||
|
Loading…
Reference in New Issue
Block a user