feat(oa): add owner person/dept fields with initiator defaults
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
3b46b10604
commit
4ebc2dbe82
18 files changed
+791
-15
No files matched your search
@@ -172,7 +172,7 @@
|
||||
|
||||
function isPersonLikeField(field: string) {
|
||||
const t = meta(field)?.type
|
||||
return t === 'person' || t === 'initiator'
|
||||
return t === 'person' || t === 'ownerPerson' || t === 'initiator'
|
||||
}
|
||||
|
||||
function isPostField(field: string) {
|
||||
@@ -186,7 +186,9 @@
|
||||
}
|
||||
|
||||
function defaultValueForType(type: string, opts?: ConditionCandidate['options']) {
|
||||
if (type === 'person' || type === 'post' || type === 'initiator') return [] as string[]
|
||||
if (type === 'person' || type === 'ownerPerson' || type === 'post' || type === 'initiator') {
|
||||
return [] as string[]
|
||||
}
|
||||
return opts?.[0]?.value ?? ''
|
||||
}
|
||||
|
||||
@@ -335,7 +337,7 @@
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (props.candidates.some((c) => c.type === 'person' || c.type === 'initiator')) {
|
||||
if (props.candidates.some((c) => c.type === 'person' || c.type === 'ownerPerson' || c.type === 'initiator')) {
|
||||
loadUsers()
|
||||
}
|
||||
if (props.candidates.some((c) => c.type === 'post')) {
|
||||
@@ -344,7 +346,10 @@
|
||||
})
|
||||
|
||||
watch(
|
||||
() => props.candidates.some((c) => c.type === 'person' || c.type === 'initiator'),
|
||||
() =>
|
||||
props.candidates.some(
|
||||
(c) => c.type === 'person' || c.type === 'ownerPerson' || c.type === 'initiator'
|
||||
),
|
||||
(need) => {
|
||||
if (need && !userOptions.value.length) loadUsers()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user