Prechádzať zdrojové kódy

feat(oa): whitelist dept and ownerDept for condition participation

Co-authored-by: Cursor <cursoragent@cursor.com>
zlwu 2 mesiacov pred
rodič
commit
f874447ae2

+ 10 - 1
web-admin/src/components/oa-approval/oa-condition-fields.ts

@@ -6,6 +6,8 @@ export const CONDITION_ELIGIBLE_TYPES = new Set([
   'money',
   'person',
   'ownerPerson',
+  'dept',
+  'ownerDept',
   'post',
   'radio',
   'select',
@@ -33,7 +35,14 @@ export interface ConditionCandidate {
 }
 
 export function opsForFieldType(type: string): Array<{ value: ConditionOp; label: string }> {
-  if (type === 'person' || type === 'ownerPerson' || type === 'post' || type === 'initiator') {
+  if (
+    type === 'person' ||
+    type === 'ownerPerson' ||
+    type === 'dept' ||
+    type === 'ownerDept' ||
+    type === 'post' ||
+    type === 'initiator'
+  ) {
     return [{ value: 'contains', label: '包含' }]
   }
   // 单选/下拉为离散选项,仅等于/不等于;输入框常填数字参与区间比较,与数字/金额/日期同套运算符