{"record":{"id":"950b69b060d09ccb","repo":"jeecgboot/JeecgBoot","slug":"id-950b69","errorCode":null,"errorMessage":"地址错误, 配置ID不存在!","messagePattern":"地址错误, 配置ID不存在!","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"jeecgboot-vue3/src/views/super/online/cgform/auto/erp/OnlCgformErpList.vue","lineNumber":277,"sourceCode":"    if (selectedKeys.value.length > 0) {\n      // 【TV360X-2701】选中的数据在当前页数据中不存在就清空选中\n      selectedKeys.value = selectedKeys.value.filter((key) => value.some((item) => item['jeecg_row_key'] === key));\n    }\n    // update-begin--author:liaozhiyang---date:20250722---for：【issues/8575】erp默认选中第一个及没选中主表时子表不查询\n    if (pagination.value.current == 1 && selectedKeys.value.length === 0) {\n      setTimeout(() => {\n        const tableTbodyElem = document.querySelector('.ant-table-wrapper .ant-table-tbody');\n        tableTbodyElem?.querySelector('.ant-table-row')?.click();\n      }, 100);\n    }\n    // update-end--author:liaozhiyang---date:20250722---for：【issues/8575】erp默认选中第一个及没选中主表时子表不查询\n  });\n\n  // 判断 若ID不存在就终止后续逻辑\n  if (!ID.value) {\n    $message.warning('地址错误, 配置ID不存在!');\n    // update-end--author:liaozhiyang---date:20230825---for：【QQYUN-6326】部分代码找不到引用\n    throw new Error('地址错误, 配置ID不存在!');\n    // update-end--author:liaozhiyang---date:20230825---for：【QQYUN-6326】部分代码找不到引用\n\n  }\n  // 处理增强\n  let { initCgEnhanceJs } = useEnhance(onlineTableContext);\n  // 处理列表button\n  const {\n    buttonSwitch,\n    cgLinkButtonList,\n    cgBIBtnMap,\n    getQueryButtonCfg,\n    getResetButtonCfg,\n    getFormConfirmButtonCfg,\n    cgTopButtonList,\n    importUrl,\n    registerModal,\n    handleAdd,\n    handleEdit,","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/jeecgboot/JeecgBoot/blob/96fb33f5ec68516da0b0147da06b2eb0419e063a/jeecgboot-vue3/src/views/super/online/cgform/auto/erp/OnlCgformErpList.vue#L259-L295","documentation":"Setup guard in the ERP-style (one-to-many master/child) online list. `ID` is the form code from `params.code ?? ''`; if empty it warns and throws to abort rendering, because the ERP list must load both master and child column configs keyed by that code.","triggerScenarios":"The ERP list route was opened WITHOUT the `code` param: direct navigation with no `?code=...`, a stale bookmark, a menu entry whose path/query omits `code`, or a redirect that stripped the query string.","commonSituations":"Bookmark to the ERP list missing `code`; backend menu config lost the code path variable; manual URL entry forgetting `code`; qiankun/sub-app handoff dropped the param.","solutions":["Open the ERP list via the proper menu entry carrying `code`; confirm the URL has `code=<formCode>`.","For a custom ERP menu, include the online form code in the route path/query.","In dev, append `?code=<yourFormCode>`.","Add a router guard that redirects when `code` is missing instead of throwing at setup."],"exampleFix":"// before\nif (!ID.value) {\n  $message.warning('地址错误, 配置ID不存在!');\n  throw new Error('地址错误, 配置ID不存在!');\n}\n\n// after — router-level guard + redirect\nrouter.beforeEach((to) => {\n  if (to.meta?.isErpList && !to.query.code) {\n    return { name: 'ExceptionPage', query: { status: '404' } };\n  }\n  return true;\n});","handlingStrategy":"validation","validationCode":"// before rendering the ERP list, confirm the route carries the online form code\nconst code = route.query.code as string | undefined;\nif (!code) {\n  router.replace({ name: 'ExceptionPage', query: { status: '404', reason: 'missing-code' } });\n}","typeGuard":"const hasFormCode = (c: unknown): c is string => typeof c === 'string' && c.trim().length > 0;","tryCatchPattern":null,"preventionTips":["Launch ERP lists via the menu entry carrying `code`.","Add a router.beforeEach guard for ERP-list routes requiring `code`.","Keep ERP menu config in sync with the required param.","Assert the URL contains a code in e2e tests."],"tags":["vue3","online-cgform","erp","routing","config","setup-guard","typescript"],"backgroundTag":null,"analyzedSha":"96fb33f5ec68516da0b0147da06b2eb0419e063a","analyzedAt":"2026-08-14T00:04:16.786Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}