feat(oa): add overtime kit form components and designer registration
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
684f152683
commit
b3d267e9ca
5 files changed
+299
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import FcDesigner from '@form-create/designer'
|
||||
import OaOvertimeKit from '@/components/oa-approval/OaOvertimeKit.vue'
|
||||
import { overtimeKitDragRule } from '@/utils/oa-overtime-kit-rule'
|
||||
|
||||
const FLAG = '__oaOvertimeKitConfigured'
|
||||
|
||||
export function setupOaOvertimeKit(formCreate?: { component?: (name: string, c: unknown) => void }) {
|
||||
if ((FcDesigner as any)[FLAG]) return
|
||||
|
||||
if (typeof FcDesigner.addMenu === 'function') {
|
||||
try {
|
||||
FcDesigner.addMenu({ name: 'kit', title: '套件', list: [] })
|
||||
} catch {
|
||||
/* kit menu may already exist */
|
||||
}
|
||||
}
|
||||
|
||||
FcDesigner.component('overtimeKit', OaOvertimeKit)
|
||||
if (typeof formCreate?.component === 'function') {
|
||||
formCreate.component('overtimeKit', OaOvertimeKit)
|
||||
}
|
||||
if (typeof FcDesigner.addDragRule === 'function') {
|
||||
FcDesigner.addDragRule(overtimeKitDragRule)
|
||||
}
|
||||
;(FcDesigner as any)[FLAG] = true
|
||||
}
|
||||
Reference in new issue
Block a user