fix: bug#10986

This commit is contained in:
xieyonghong 2023-03-25 23:12:14 +08:00
parent 1f16b4e827
commit 8c66b348a3
3 changed files with 4 additions and 6 deletions

View File

@ -23,7 +23,8 @@ const { data } = storeToRefs(sceneStore);
const actionRules = [{
validator(_: any, v?: BranchesThen[]) {
if (!v || (v && !v.length) || (v && v.length && !v[0].actions.length)) {
if (!v || (v && !v.length) || !v.some(item => item.actions && item.actions.length)) {
return Promise.reject('至少配置一个执行动作');
}
return Promise.resolve();

View File

@ -59,7 +59,7 @@ const rules = [{
const actionRules = [{
validator(_: any, v?: BranchesThen[]) {
if (!v || (v && !v.length)) {
if (!v || (v && !v.length) || !v.some(item => item.actions && item.actions.length)) {
return Promise.reject('至少配置一个执行动作');
}
return Promise.resolve();

View File

@ -13,11 +13,8 @@ export const handleParamsData = (data: any[], key: string = 'column'): any[] =>
export const thenRules = [{
validator(_: string, value: any) {
if (!value || (value && !value.length)) {
if (!value || (value && !value.length) || !v.some(item => item.actions && item.actions.length)) {
return Promise.reject('至少配置一个执行动作')
} else {
const isActions = value.some((item: any) => item.actions && item.actions.length)
return isActions ? Promise.resolve() : Promise.reject('至少配置一个执行动作');
}
return Promise.resolve();
}