18 lines
656 B
TypeScript
18 lines
656 B
TypeScript
import FcDesigner from '@form-create/designer'
|
|
import OaPostSelect from '@/components/oa-approval/OaPostSelect.vue'
|
|
import { postSelectDragRule } from '@/utils/oa-post-select-rule'
|
|
|
|
const FLAG = '__oaPostSelectConfigured'
|
|
|
|
export function setupOaPostSelect(formCreate?: { component?: (name: string, c: unknown) => void }) {
|
|
if ((FcDesigner as any)[FLAG]) return
|
|
FcDesigner.component('post', OaPostSelect)
|
|
if (typeof formCreate?.component === 'function') {
|
|
formCreate.component('post', OaPostSelect)
|
|
}
|
|
if (typeof FcDesigner.addDragRule === 'function') {
|
|
FcDesigner.addDragRule(postSelectDragRule)
|
|
}
|
|
;(FcDesigner as any)[FLAG] = true
|
|
}
|