diff --git a/src/pages-bpm/processInstance/create/index.vue b/src/pages-bpm/processInstance/create/index.vue index a64ad6d..4865827 100644 --- a/src/pages-bpm/processInstance/create/index.vue +++ b/src/pages-bpm/processInstance/create/index.vue @@ -55,11 +55,14 @@ class="flex items-center border-b border-[#f5f5f5] p-24rpx last:border-b-0" @click="handleSelect(definition)" > - 移动端路径映射 + * - key: PC 端路径 (formCustomCreatePath / formCustomViewPath) + * - value: 移动端路径 + * 原因是:目前暂时没有 mobile 端的自定义表单字段,所以暂时需要硬编码映射关系 + */ +const PC_TO_MOBILE_PATH_MAP: Record = { + // OA 请假 + '/bpm/oa/leave/create': '/pages-bpm/oa/leave/create/index', + '/bpm/oa/leave/detail': '/pages-bpm/oa/leave/detail/index', +} + +/** + * 根据 PC 端路径获取移动端的跳转路径 + * @param pcPath PC 端的表单路径 + * @returns 移动端的跳转路径,如果没有映射则返回 undefined + */ +export function getMobileFormCustomPath(pcPath: string | undefined): string | undefined { + if (!pcPath) { + return undefined + } + return PC_TO_MOBILE_PATH_MAP[pcPath] +}