feat(oa): add initiator system field to condition branches
Allow __initiator__ contains matching in publish validation and the flow designer candidate list, excluding it from form useInCondition locks. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
3d88f52e2e
commit
22be6d8b36
7 files changed
+103
-23
No files matched your search
@@ -48,7 +48,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-if="isPersonField(rule.field)"
|
||||
v-if="isPersonLikeField(rule.field)"
|
||||
:model-value="personValueIds(rule.value)"
|
||||
multiple
|
||||
filterable
|
||||
@@ -152,8 +152,9 @@
|
||||
return props.candidates.find((c) => c.field === field)
|
||||
}
|
||||
|
||||
function isPersonField(field: string) {
|
||||
return meta(field)?.type === 'person'
|
||||
function isPersonLikeField(field: string) {
|
||||
const t = meta(field)?.type
|
||||
return t === 'person' || t === 'initiator'
|
||||
}
|
||||
|
||||
function personValueIds(v: unknown): string[] {
|
||||
@@ -163,7 +164,7 @@
|
||||
}
|
||||
|
||||
function defaultValueForType(type: string, opts?: ConditionCandidate['options']) {
|
||||
if (type === 'person') return [] as string[]
|
||||
if (type === 'person' || type === 'initiator') return [] as string[]
|
||||
return opts?.[0]?.value ?? ''
|
||||
}
|
||||
|
||||
@@ -285,13 +286,13 @@
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (props.candidates.some((c) => c.type === 'person')) {
|
||||
if (props.candidates.some((c) => c.type === 'person' || c.type === 'initiator')) {
|
||||
loadUsers()
|
||||
}
|
||||
})
|
||||
|
||||
watch(
|
||||
() => props.candidates.some((c) => c.type === 'person'),
|
||||
() => props.candidates.some((c) => c.type === 'person' || c.type === 'initiator'),
|
||||
(need) => {
|
||||
if (need && !userOptions.value.length) loadUsers()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user