组名称列表问题

This commit is contained in:
SGK\17962 2025-11-26 09:11:40 +08:00
parent 10ab8975c6
commit 28dc25e9f9
5 changed files with 60 additions and 38 deletions

View File

@ -46,7 +46,7 @@ const examples = {
}
const typeLabel = 'QL'
const exampleText = `// 查询语言示例\nfrom Employee e\nwhere e.salary > 10000\nand e.joinDate > '2020-01-01'\nselect e.name, e.position`
const exampleText = 'if (city ==1 and age>70 and sex==1) then {return 33;}'
const toggleExample = () => {
show.value = !show.value

View File

@ -3,7 +3,6 @@ import { ref } from 'vue';
import type { SelectOption } from 'naive-ui';
import { NEllipsis } from 'naive-ui';
import { $t } from '@/locales';
import { translateOptions2 } from '@/utils/common';
import { fetchGetAllGroupNameList } from '@/service/api';
defineOptions({
@ -28,12 +27,14 @@ const emit = defineEmits<Emits>();
/** 可选组列表 */
const groupNameList = ref<string[]>([]);
const groups = ref();
async function getGroupNameList() {
const { data, error } = await fetchGetAllGroupNameList();
if (!error) {
groupNameList.value = data;
}
const res= await fetchGetAllGroupNameList();
groups.value = res.data?.map(option => ({
value: option.groupName,
label: option.groupNameCn
}));
}
const handleUpdate = (value: string) => {
@ -49,7 +50,7 @@ const renderLabel = (option: SelectOption) => <NEllipsis>{option.label}</NEllips
<NSelect
v-model:value="model"
:placeholder="$t('page.retryTask.form.groupName')"
:options="translateOptions2(groupNameList)"
:options="groups"
:disabled="props.disabled"
:clearable="props.clearable"
filterable

View File

@ -8,10 +8,11 @@ import {
workFlowNodeStatusOptions
} from '@/constants/business';
import { $t } from '@/locales';
import { fetchGetAllGroupNameList, fetchGetNotifyConfigSystemTaskTypeList } from '@/service/api';
import { fetchGetNotifyConfigSystemTaskTypeList } from '@/service/api';
import { isNotNull, parseContent, stringToContent } from '@/utils/common';
import { useWorkflowStore } from '@/store/modules/workflow';
import EditableInput from '@/components/common/editable-input.vue';
import SelectGroup from '@/components/common/select-group.vue';
defineOptions({
name: 'StartDrawer'
@ -106,15 +107,6 @@ const save = () => {
.catch(() => window.$message?.warning('请检查表单信息'));
};
const getGroupNameList = async () => {
const { data, error } = await fetchGetAllGroupNameList();
if (!error) {
groupNameList.value = data;
}
};
getGroupNameList();
const typeChange = (value: number) => {
if (value === 3) {
form.value.triggerInterval = '* * * * * ?';
@ -148,19 +140,7 @@ const rules: Record<RuleKey, FormItemRule> = {
</template>
<NForm ref="formRef" :model="form" :rules="rules" label-align="left" label-width="100px">
<NFormItem path="groupName" label="组名称">
<NSelect
v-model:value="form.groupName"
placeholder="请选择组"
:disabled="store.type === 0 && isNotNull(store.id)"
:options="
groupNameList.map(groupName => {
return {
label: groupName,
value: groupName
};
})
"
/>
<SelectGroup v-model:value="form.groupName" :disabled="store.type === 0 && isNotNull(store.id)" />
</NFormItem>
<NGrid :cols="24" x-gap="20">
<NGi :span="8">

View File

@ -9,11 +9,10 @@ export function fetchGetGroupConfigList(params?: Api.GroupConfig.GroupConfigSear
});
}
export function fetchGetAllGroupNameList(params?: Api.GroupConfig.GroupConfigSearchParams) {
return request<string[]>({
export function fetchGetAllGroupNameList() {
return request<Api.GroupConfig.GroupConfigList>({
url: '/group/all/group-name/list',
method: 'get',
params
});
}

View File

@ -204,6 +204,11 @@ const executorCustomOptions = [
type ScriptParams = {
method: string;
downloadType: string;
userName: string;
password: string;
downloadPath: string;
downloadUrl: string;
scriptParams: string;
charset: string;
};
@ -213,6 +218,11 @@ const scriptParams = reactive<ScriptParams>(createDefaultScriptParams());
function createDefaultScriptParams() {
return {
method: 'LOCAL_SCRIPT',
downloadType: 'FTP',
userName: '',
password: '',
downloadPath: '',
downloadUrl: '',
scriptParams: '',
charset: ''
};
@ -472,6 +482,24 @@ const scriptMethodOptions = [
value: 'LOCAL_SCRIPT'
}
];
const downloadTypeOptions = [
{
label: 'SFTP',
value: 'SFTP'
},
{
label: 'FTP',
value: 'FTP'
},
{
label: 'MINIO',
value: 'MINIO'
},
{
label: 'S3',
value: 'S3'
}
];
</script>
<template>
@ -636,11 +664,26 @@ const scriptMethodOptions = [
</template>
<template v-else>
<NForm ref="customformRef" class="w-full" :model="scriptParams">
<NFormItem label="脚本类型啊啊啊啊啊啊啊啊啊啊啊啊啊啊">
<NFormItem label="脚本类型">
<NSelect v-model:value="scriptParams.method" :options="scriptMethodOptions" />
</NFormItem>
<NFormItem label="下载方式" v-if="scriptParams.method=='DOWNLOAD'">
<NSelect v-model:value="scriptParams.downloadType" :options="downloadTypeOptions" />
</NFormItem>
<NFormItem label="下载地址" v-if="scriptParams.method=='DOWNLOAD'">
<NInput v-model:value="scriptParams.downloadUrl" placeholder="请输入下载地址" />
</NFormItem>
<NFormItem label="用户名" v-if="scriptParams.method=='DOWNLOAD'">
<NInput v-model:value="scriptParams.userName" placeholder="请输入用户名" />
</NFormItem>
<NFormItem label="密码" v-if="scriptParams.method=='DOWNLOAD'">
<NInput v-model:value="scriptParams.password" placeholder="请输入密码" />
</NFormItem>
<NFormItem label="下载路径" v-if="scriptParams.method=='DOWNLOAD'">
<NInput v-model:value="scriptParams.downloadPath" placeholder="请输入下载路径" />
</NFormItem>
<NFormItem label="脚本参数啊啊啊啊啊啊啊" label-placement="top">
<NFormItem label="脚本参数" label-placement="top">
<template #label>
<div>
<span>脚本参数</span>
@ -648,7 +691,7 @@ const scriptMethodOptions = [
<template #trigger>
<icon-ic-round-info class="text-icon ml-4px" />
</template>
需下载脚本-填写需下载脚本的httpurl<br />
需下载脚本-填写需下载脚本的路径<br />
本地脚本-填写客户端本地脚本路径<br />
脚本代码-填写脚本内容
</NTooltip>
@ -656,9 +699,8 @@ const scriptMethodOptions = [
</template>
<CodeMirror v-model="scriptParams.scriptParams" lang="json" placeholder="需下载脚本-填写需下载脚本的httpurl<br />本地脚本-填写客户端本地脚本路径<br />脚本代码-填写脚本内容" />
</NFormItem>
<NFormItem :show-label=false >
<NFormItem :show-label=false v-if="scriptParams.method=='SCRIPT_CODE'">
<NUpload
v-if="scriptParams.method=='SCRIPT_CODE'"
:default-upload="false"
:show-file-list="false"
@change="handleFileUpload"