Register type=dept on main app and oa-fc-host, with PC tree-select and
narrow drawer pickers storing {id,name} path snapshots; format dept values
in print and related-summary flatten.
Co-authored-by: Cursor <cursoragent@cursor.com>
18 lines
656 B
TypeScript
18 lines
656 B
TypeScript
import FcDesigner from '@form-create/designer'
|
|
import OaDeptSelect from '@/components/oa-approval/OaDeptSelect.vue'
|
|
import { deptSelectDragRule } from '@/utils/oa-dept-select-rule'
|
|
|
|
const FLAG = '__oaDeptSelectConfigured'
|
|
|
|
export function setupOaDeptSelect(formCreate?: { component?: (name: string, c: unknown) => void }) {
|
|
if ((FcDesigner as any)[FLAG]) return
|
|
FcDesigner.component('dept', OaDeptSelect)
|
|
if (typeof formCreate?.component === 'function') {
|
|
formCreate.component('dept', OaDeptSelect)
|
|
}
|
|
if (typeof FcDesigner.addDragRule === 'function') {
|
|
FcDesigner.addDragRule(deptSelectDragRule)
|
|
}
|
|
;(FcDesigner as any)[FLAG] = true
|
|
}
|