Merge branch 'refs/heads/dev_map_reduce' into preview

This commit is contained in:
xlsea 2024-07-08 09:22:49 +08:00
commit 87d20bea22
8 changed files with 75 additions and 21 deletions

View File

@ -69,9 +69,9 @@ const handleUpdateType = (index: number) => {
<template>
<NDynamicInput v-model:value="content" item-style="margin-bottom: 0;" :on-create="onCreate" #="{ index }">
<NGrid :x-gap="16">
<NGrid>
<NFormItemGi
:span="8"
:span="7"
ignore-path-change
:show-label="false"
:rule="dynamicInputRule"
@ -79,9 +79,9 @@ const handleUpdateType = (index: number) => {
>
<NInput v-model:value="content[index].key" placeholder="key" @keydown.enter.prevent />
</NFormItemGi>
<NGi :span="1" class="h-34px lh-34px">=</NGi>
<NGi :span="2" class="h-34px text-center lh-34px">=</NGi>
<NFormItemGi
:span="8"
:span="7"
ignore-path-change
:show-label="false"
:rule="dynamicInputRule"
@ -109,8 +109,14 @@ const handleUpdateType = (index: number) => {
@keydown.enter.prevent
/>
</NFormItemGi>
<NFormItemGi :span="3" class="w-130px" ignore-path-change :show-label="false" :path="`${path}[${index}].type`">
<div :span="1" class="h-34px lh-34px">(</div>
<NFormItemGi
:span="3"
class="ml-12px w-115px"
ignore-path-change
:show-label="false"
:path="`${path}[${index}].type`"
>
<div class="h-34px lh-34px">(</div>
<NSelect
v-model:value="content[index].type"
class="mx-3px"
@ -119,7 +125,7 @@ const handleUpdateType = (index: number) => {
@keydown.enter.prevent
@update:value="handleUpdateType(index)"
/>
<div :span="1" class="h-34px lh-34px">)</div>
<div class="h-34px lh-34px">)</div>
</NFormItemGi>
</NGrid>
</NDynamicInput>

View File

@ -304,6 +304,10 @@ const SnailLogComponent = defineComponent({
</NDropdown>
</div>
</template>
<div v-if="logList.length === 0" class="h-full flex-center">
<NEmpty v-if="logList.length === 0 && finished" />
<NSpin v-if="logList.length === 0 && !finished" />
</div>
<SnailLogComponent />
</NDrawerContent>
</NDrawer>
@ -344,6 +348,10 @@ const SnailLogComponent = defineComponent({
</NTooltip>
</div>
</template>
<div v-if="logList.length === 0" class="h-full flex-center">
<NEmpty v-if="logList.length === 0 && finished" />
<NSpin v-if="logList.length === 0 && !finished" />
</div>
<SnailLogComponent />
</NCard>
</template>
@ -353,6 +361,7 @@ const SnailLogComponent = defineComponent({
padding: 0;
.virtual-list {
height: calc(100vh - 101px);
max-height: calc(100vh - 101px);
}

View File

@ -65,7 +65,12 @@ watch(
<CronInput v-if="backOff === 3" v-model="cron" :lang="app.locale" />
<NInputGroup v-else-if="backOff === 2 || backOff === 4">
<NInputNumber v-model:value="interval" :placeholder="$t('page.retryScene.form.triggerInterval')" clearable />
<NInputNumber
v-model:value="interval"
:min="10"
:placeholder="$t('page.retryScene.form.triggerInterval')"
clearable
/>
<NInputGroupLabel>{{ $t('common.second') }}</NInputGroupLabel>
</NInputGroup>
</template>

View File

@ -72,25 +72,30 @@ const save = () => {
.catch(() => window.$message?.warning('请检查表单信息'));
};
const nodeExpressionFeedback = ref('');
const checkNodeExpression = async () => {
if (!form.value.decision?.nodeExpression) {
return Promise.reject(new Error('请填写条件表达式'));
nodeExpressionFeedback.value = '请填写条件表达式';
return;
}
const { error, data } = await fetchCheckNodeExpression(form.value.decision!);
if (!error) {
if (data.key !== 1) {
return Promise.reject(data.value ?? '请检查条件表达式');
nodeExpressionFeedback.value = data.value || '请检查条件表达式';
return;
}
} else {
return Promise.reject(new Error('接口请求失败'));
nodeExpressionFeedback.value = '接口请求失败';
return;
}
return Promise.resolve();
nodeExpressionFeedback.value = '';
};
const rules: FormRules = {
decision: {
expressionType: [{ required: true, message: '请选择表达式类型', trigger: 'change', type: 'number' }],
nodeExpression: [{ required: true, validator: checkNodeExpression, trigger: 'blur' }]
nodeExpression: [{ required: true, message: '请填写条件表达式', trigger: 'blur' }]
}
};
</script>
@ -132,12 +137,24 @@ const rules: FormRules = {
</NSpace>
</NRadioGroup>
</NFormItem>
<NFormItem path="decision.nodeExpression" label="条件表达式">
<NFormItem
path="decision.nodeExpression"
label="条件表达式"
validation-status="error"
:feedback="nodeExpressionFeedback"
>
<CodeMirror v-model="form.decision!.nodeExpression" placeholder="请输入条件表达式" />
</NFormItem>
<NFormItem path="decision.checkContents" label="模拟上下文">
<NFormItem
path="decision.checkContents"
label="模拟上下文"
:show-feedback="form.decision?.checkContents && form.decision.checkContents.length === 0"
>
<DynamicInput v-model:value="form.decision!.checkContents!" path="decision.checkContents" />
</NFormItem>
<NFormItem :show-label="false" :show-feedback="false">
<NButton type="primary" ghost block @click="checkNodeExpression">校验条件表达式</NButton>
</NFormItem>
</NForm>
<template #footer>

View File

@ -210,7 +210,7 @@ const rules: Record<RuleKey, FormItemRule> = {
</NFormItem>
</NGi>
</NGrid>
<NFormItem path="wfContext" label="工作流上下文">
<NFormItem path="wfContext" label="工作流上下文" :show-feedback="false">
<DynamicInput v-model:value="form.wfContexts!" path="wfContexts" />
</NFormItem>
<NFormItem path="workflowStatus" label="节点状态">

View File

@ -59,4 +59,9 @@ const visible = defineModel<boolean>('visible', {
</DetailDrawer>
</template>
<style scoped></style>
<style scoped>
:deep(.virtual-list) {
height: calc(100vh - 166px) !important;
max-height: calc(100vh - 166px) !important;
}
</style>

View File

@ -115,4 +115,9 @@ onBeforeUnmount(() => {
</OperateDrawer>
</template>
<style scoped></style>
<style scoped>
:deep(.virtual-list) {
height: calc(100vh - 166px) !important;
max-height: calc(100vh - 166px) !important;
}
</style>

View File

@ -185,9 +185,16 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
<n-divider vertical />
<NButton text type="error" ghost size="small" onClick={() => execute(row.id!)}>
{$t('common.execute')}
</NButton>
<NPopconfirm onPositiveClick={() => execute(row.id!)}>
{{
default: () => $t('common.confirmExecute'),
trigger: () => (
<NButton type="error" text ghost size="small">
{$t('common.execute')}
</NButton>
)
}}
</NPopconfirm>
<n-divider vertical />