index.ts 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. import type { RouteType, SignContext, SignFlow } from './types'
  2. import { useFwdFlow } from './useFwdFlow'
  3. import { useJyrsFlow } from './useJyrsFlow'
  4. import { useAqjcFlow } from './useAqjcFlow'
  5. import { useZxxxFlow } from './useZxxxFlow'
  6. import { useRecordTesterFlow } from './useRecordTesterFlow'
  7. import { useSuggestionFlow } from './useSuggestionFlow'
  8. export type { RouteType, SignContext, SignFlow } from './types'
  9. export { titleTextMap, businessTypeMap } from './types'
  10. /**
  11. * 根据签字文件类型创建对应的流程。
  12. * 未知类型返回 null,由调用方提示错误。
  13. */
  14. export const createSignFlow = (type: RouteType, ctx: SignContext): SignFlow | null => {
  15. switch (type) {
  16. case 'FWD':
  17. return useFwdFlow(ctx)
  18. case 'JYRS':
  19. return useJyrsFlow(ctx)
  20. case 'AQJC':
  21. return useAqjcFlow(ctx)
  22. case 'ZXXX':
  23. return useZxxxFlow(ctx)
  24. case 'RECORD_TESTER':
  25. return useRecordTesterFlow(ctx)
  26. case 'SUGGUESTION':
  27. return useSuggestionFlow(ctx)
  28. default:
  29. return null
  30. }
  31. }