组名称列表问题
This commit is contained in:
parent
10ab8975c6
commit
28dc25e9f9
@ -46,7 +46,7 @@ const examples = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const typeLabel = 'QL'
|
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 = () => {
|
const toggleExample = () => {
|
||||||
show.value = !show.value
|
show.value = !show.value
|
||||||
|
|||||||
@ -3,7 +3,6 @@ import { ref } from 'vue';
|
|||||||
import type { SelectOption } from 'naive-ui';
|
import type { SelectOption } from 'naive-ui';
|
||||||
import { NEllipsis } from 'naive-ui';
|
import { NEllipsis } from 'naive-ui';
|
||||||
import { $t } from '@/locales';
|
import { $t } from '@/locales';
|
||||||
import { translateOptions2 } from '@/utils/common';
|
|
||||||
import { fetchGetAllGroupNameList } from '@/service/api';
|
import { fetchGetAllGroupNameList } from '@/service/api';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@ -28,12 +27,14 @@ const emit = defineEmits<Emits>();
|
|||||||
|
|
||||||
/** 可选组列表 */
|
/** 可选组列表 */
|
||||||
const groupNameList = ref<string[]>([]);
|
const groupNameList = ref<string[]>([]);
|
||||||
|
const groups = ref();
|
||||||
|
|
||||||
async function getGroupNameList() {
|
async function getGroupNameList() {
|
||||||
const { data, error } = await fetchGetAllGroupNameList();
|
const res= await fetchGetAllGroupNameList();
|
||||||
if (!error) {
|
groups.value = res.data?.map(option => ({
|
||||||
groupNameList.value = data;
|
value: option.groupName,
|
||||||
}
|
label: option.groupNameCn
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleUpdate = (value: string) => {
|
const handleUpdate = (value: string) => {
|
||||||
@ -49,7 +50,7 @@ const renderLabel = (option: SelectOption) => <NEllipsis>{option.label}</NEllips
|
|||||||
<NSelect
|
<NSelect
|
||||||
v-model:value="model"
|
v-model:value="model"
|
||||||
:placeholder="$t('page.retryTask.form.groupName')"
|
:placeholder="$t('page.retryTask.form.groupName')"
|
||||||
:options="translateOptions2(groupNameList)"
|
:options="groups"
|
||||||
:disabled="props.disabled"
|
:disabled="props.disabled"
|
||||||
:clearable="props.clearable"
|
:clearable="props.clearable"
|
||||||
filterable
|
filterable
|
||||||
|
|||||||
@ -8,10 +8,11 @@ import {
|
|||||||
workFlowNodeStatusOptions
|
workFlowNodeStatusOptions
|
||||||
} from '@/constants/business';
|
} from '@/constants/business';
|
||||||
import { $t } from '@/locales';
|
import { $t } from '@/locales';
|
||||||
import { fetchGetAllGroupNameList, fetchGetNotifyConfigSystemTaskTypeList } from '@/service/api';
|
import { fetchGetNotifyConfigSystemTaskTypeList } from '@/service/api';
|
||||||
import { isNotNull, parseContent, stringToContent } from '@/utils/common';
|
import { isNotNull, parseContent, stringToContent } from '@/utils/common';
|
||||||
import { useWorkflowStore } from '@/store/modules/workflow';
|
import { useWorkflowStore } from '@/store/modules/workflow';
|
||||||
import EditableInput from '@/components/common/editable-input.vue';
|
import EditableInput from '@/components/common/editable-input.vue';
|
||||||
|
import SelectGroup from '@/components/common/select-group.vue';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'StartDrawer'
|
name: 'StartDrawer'
|
||||||
@ -106,15 +107,6 @@ const save = () => {
|
|||||||
.catch(() => window.$message?.warning('请检查表单信息'));
|
.catch(() => window.$message?.warning('请检查表单信息'));
|
||||||
};
|
};
|
||||||
|
|
||||||
const getGroupNameList = async () => {
|
|
||||||
const { data, error } = await fetchGetAllGroupNameList();
|
|
||||||
if (!error) {
|
|
||||||
groupNameList.value = data;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
getGroupNameList();
|
|
||||||
|
|
||||||
const typeChange = (value: number) => {
|
const typeChange = (value: number) => {
|
||||||
if (value === 3) {
|
if (value === 3) {
|
||||||
form.value.triggerInterval = '* * * * * ?';
|
form.value.triggerInterval = '* * * * * ?';
|
||||||
@ -148,19 +140,7 @@ const rules: Record<RuleKey, FormItemRule> = {
|
|||||||
</template>
|
</template>
|
||||||
<NForm ref="formRef" :model="form" :rules="rules" label-align="left" label-width="100px">
|
<NForm ref="formRef" :model="form" :rules="rules" label-align="left" label-width="100px">
|
||||||
<NFormItem path="groupName" label="组名称">
|
<NFormItem path="groupName" label="组名称">
|
||||||
<NSelect
|
<SelectGroup v-model:value="form.groupName" :disabled="store.type === 0 && isNotNull(store.id)" />
|
||||||
v-model:value="form.groupName"
|
|
||||||
placeholder="请选择组"
|
|
||||||
:disabled="store.type === 0 && isNotNull(store.id)"
|
|
||||||
:options="
|
|
||||||
groupNameList.map(groupName => {
|
|
||||||
return {
|
|
||||||
label: groupName,
|
|
||||||
value: groupName
|
|
||||||
};
|
|
||||||
})
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
<NGrid :cols="24" x-gap="20">
|
<NGrid :cols="24" x-gap="20">
|
||||||
<NGi :span="8">
|
<NGi :span="8">
|
||||||
|
|||||||
@ -9,11 +9,10 @@ export function fetchGetGroupConfigList(params?: Api.GroupConfig.GroupConfigSear
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function fetchGetAllGroupNameList(params?: Api.GroupConfig.GroupConfigSearchParams) {
|
export function fetchGetAllGroupNameList() {
|
||||||
return request<string[]>({
|
return request<Api.GroupConfig.GroupConfigList>({
|
||||||
url: '/group/all/group-name/list',
|
url: '/group/all/group-name/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -204,6 +204,11 @@ const executorCustomOptions = [
|
|||||||
|
|
||||||
type ScriptParams = {
|
type ScriptParams = {
|
||||||
method: string;
|
method: string;
|
||||||
|
downloadType: string;
|
||||||
|
userName: string;
|
||||||
|
password: string;
|
||||||
|
downloadPath: string;
|
||||||
|
downloadUrl: string;
|
||||||
scriptParams: string;
|
scriptParams: string;
|
||||||
charset: string;
|
charset: string;
|
||||||
};
|
};
|
||||||
@ -213,6 +218,11 @@ const scriptParams = reactive<ScriptParams>(createDefaultScriptParams());
|
|||||||
function createDefaultScriptParams() {
|
function createDefaultScriptParams() {
|
||||||
return {
|
return {
|
||||||
method: 'LOCAL_SCRIPT',
|
method: 'LOCAL_SCRIPT',
|
||||||
|
downloadType: 'FTP',
|
||||||
|
userName: '',
|
||||||
|
password: '',
|
||||||
|
downloadPath: '',
|
||||||
|
downloadUrl: '',
|
||||||
scriptParams: '',
|
scriptParams: '',
|
||||||
charset: ''
|
charset: ''
|
||||||
};
|
};
|
||||||
@ -472,6 +482,24 @@ const scriptMethodOptions = [
|
|||||||
value: 'LOCAL_SCRIPT'
|
value: 'LOCAL_SCRIPT'
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
const downloadTypeOptions = [
|
||||||
|
{
|
||||||
|
label: 'SFTP',
|
||||||
|
value: 'SFTP'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'FTP',
|
||||||
|
value: 'FTP'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'MINIO',
|
||||||
|
value: 'MINIO'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'S3',
|
||||||
|
value: 'S3'
|
||||||
|
}
|
||||||
|
];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -636,11 +664,26 @@ const scriptMethodOptions = [
|
|||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<NForm ref="customformRef" class="w-full" :model="scriptParams">
|
<NForm ref="customformRef" class="w-full" :model="scriptParams">
|
||||||
<NFormItem label="脚本类型啊啊啊啊啊啊啊啊啊啊啊啊啊啊">
|
<NFormItem label="脚本类型">
|
||||||
<NSelect v-model:value="scriptParams.method" :options="scriptMethodOptions" />
|
<NSelect v-model:value="scriptParams.method" :options="scriptMethodOptions" />
|
||||||
</NFormItem>
|
</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>
|
<template #label>
|
||||||
<div>
|
<div>
|
||||||
<span>脚本参数</span>
|
<span>脚本参数</span>
|
||||||
@ -648,7 +691,7 @@ const scriptMethodOptions = [
|
|||||||
<template #trigger>
|
<template #trigger>
|
||||||
<icon-ic-round-info class="text-icon ml-4px" />
|
<icon-ic-round-info class="text-icon ml-4px" />
|
||||||
</template>
|
</template>
|
||||||
需下载脚本-填写需下载脚本的httpurl<br />
|
需下载脚本-填写需下载脚本的路径<br />
|
||||||
本地脚本-填写客户端本地脚本路径<br />
|
本地脚本-填写客户端本地脚本路径<br />
|
||||||
脚本代码-填写脚本内容
|
脚本代码-填写脚本内容
|
||||||
</NTooltip>
|
</NTooltip>
|
||||||
@ -656,9 +699,8 @@ const scriptMethodOptions = [
|
|||||||
</template>
|
</template>
|
||||||
<CodeMirror v-model="scriptParams.scriptParams" lang="json" placeholder="需下载脚本-填写需下载脚本的httpurl<br />本地脚本-填写客户端本地脚本路径<br />脚本代码-填写脚本内容" />
|
<CodeMirror v-model="scriptParams.scriptParams" lang="json" placeholder="需下载脚本-填写需下载脚本的httpurl<br />本地脚本-填写客户端本地脚本路径<br />脚本代码-填写脚本内容" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
<NFormItem :show-label=false >
|
<NFormItem :show-label=false v-if="scriptParams.method=='SCRIPT_CODE'">
|
||||||
<NUpload
|
<NUpload
|
||||||
v-if="scriptParams.method=='SCRIPT_CODE'"
|
|
||||||
:default-upload="false"
|
:default-upload="false"
|
||||||
:show-file-list="false"
|
:show-file-list="false"
|
||||||
@change="handleFileUpload"
|
@change="handleFileUpload"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user