// 自动生成的文件，请勿修改
import routerService from '@/common/services/router-service'
import asyncComponent from '@/common/services/async-component'
// 无流程表单处理
routerService.route('/sd-webform', {
  component: asyncComponent(() => import('@/webform/sd-webform-panel.vue')),
  name: 'sd-webform',
  beforeEnter: (to, from, next) => {
    let ext = ''
    if (to.query.id === '' && window.opener) {
      const url = window.opener.location.href
      if (window.opener.location.href.indexOf('projectId') > -1) {
        ext =
          ext +
          '&' +
          window.opener.location.href.substring(
            window.opener.location.href.indexOf('projectId'),
            window.opener.location.href.length
          )
      }
    }
    // 如果是你自己的pageId,就跳转自己的路由
    if (to.query.pageId === 'onl:9070cde23a0744afa40c336151ff98a6') {
      // 问题确认单明细
      next('/cpm-confirm-detail?id=' + to.query.id + '&pageId=' + to.query.pageId + ext)
    } else if (to.query.pageId === 'onl:ca825b6d37934250930d62432206a006') {
      // 问题整改清单录入
      next('/cpm-improve-rect?id=' + to.query.id + '&pageId=' + to.query.pageId)
    } else if (to.query.pageId === 'onl:fc3a6ec83d164005857f7950c10ab8d3') {
      // 领导专题学习
      next('/cpm-leader-study?id=' + to.query.id + '&pageId=' + to.query.pageId)
    } else if (to.query.pageId === 'onl:677acf0ee768413cba44be4b08a72c78') {
      // 委员会专题纪要
      next('/cpm-committee?id=' + to.query.id + '&pageId=' + to.query.pageId)
    } else if (to.query.pageId === 'onl:b3c79eb4c0494bcc882be518dc30b8c8') {
      // 服务记录评价
      next('/law-record-eval?id=' + to.query.id + '&pageId=' + to.query.pageId)
    } else if (to.query.pageId === 'onl:a1ec7c3068a3467a817d914237727dd8') {
      // 案例库
      next('/case-library-form?pageId=' + to.query.pageId)
    } else if (to.query.pageId === 'onl:f4c933794f074029917fa0c87e05f12f') {
      // 规则引擎-合同Demo
      next('/rules-demo-contract?id=' + to.query.id + '&pageId=' + to.query.pageId)
    } else if (to.query.pageId === 'onl:81ab7f8295c047da87deee689d16c166') {
      // 案件执行程序配置
      next('/case-execute-procedure?id=' + to.query.id + '&pageId=' + to.query.pageId)
    }
    next()
  },
})
console.warn('路由 sd-webform 不符合命名规则，应该以 iam 开头')