feat(oa): add owner person/dept fields with initiator defaults

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-07-30 17:54:48 +08:00
1 parent 3b46b10604
commit 4ebc2dbe82
18 files changed
+791 -15

No files matched your search

@@ -0,0 +1,45 @@
<!-- FormCreate:归属部门(默认当前登录人主部门;allowModify 控制可否改选) -->
<template>
<OaDeptSelect
:model-value="modelValue"
:disabled="effectiveDisabled"
:multiple="false"
:form-create-inject="formCreateInject"
@update:model-value="onUpdate"
@change="onChange"
/>
</template>
<script setup lang="ts">
import { computed } from 'vue'
import OaDeptSelect from '@/components/oa-approval/OaDeptSelect.vue'
import type { OaDeptValueItem } from '@/utils/oa-dept-value'
defineOptions({ name: 'ownerDept' })
const props = withDefaults(
defineProps<{
modelValue?: unknown
disabled?: boolean
/** 是否允许改选;默认 false(只读展示默认值) */
allowModify?: boolean
formCreateInject?: Record<string, unknown>
}>(),
{ allowModify: false }
)
const emit = defineEmits<{
(e: 'update:modelValue', v: OaDeptValueItem | OaDeptValueItem[] | null): void
(e: 'change', v: OaDeptValueItem | OaDeptValueItem[] | null): void
}>()
const effectiveDisabled = computed(() => !!props.disabled || !props.allowModify)
function onUpdate(v: OaDeptValueItem | OaDeptValueItem[] | null) {
emit('update:modelValue', v)
}
function onChange(v: OaDeptValueItem | OaDeptValueItem[] | null) {
emit('change', v)
}
</script>