import routerService from '@/common/services/router-service'
import flowService from '@/webflow/flow-service'
import asyncComponent from '@/common/services/async-component'

// 风险准则表单
routerService.routeInFrame('risk-criteria-form', {
  component: './riskCriteria/risk-criteria-form.vue',
})

// 风险准则列表
routerService.routeInFrame('risk-criteria-list', {
  component: './riskCriteria/risk-criteria-list.vue',
})

// 风险-风险措施列表
routerService.routeInFrame('risk-event-list', {
  component: './risklib/event/risk-event-list.vue',
})

// 风险措施表单
routerService.routeInFrame('risk-event-form', {
  component: './risklib/event/risk-event-form.vue',
})

// 风险树分类
routerService.routeInFrame('risk-category-list', {
  component: './risklib/category/risk-category-list.vue',
})

// 内控矩阵版本列表
routerService.routeInFrame('risk-version-list', {
  component: './risklib/version/risk-version-list.vue',
})
// 配置在合规的-风险导航-begin
// 风险-风险措施列表
routerService.routeInFrame('risk-event-list/cpm', {
  component: './risklib/event/risk-event-list.vue',
})
// 内控矩阵版本列表
routerService.routeInFrame('risk-version-list/cpm', {
  component: './risklib/version/risk-version-list.vue',
})
// 风险准则列表
routerService.routeInFrame('risk-criteria-list/cpm', {
  component: './riskCriteria/risk-criteria-list.vue',
})
// 配置在合规的-风险导航-end
// 风控任务
flowService.addFlowForm('vue:risk/task/dutie/riskDutie', './task/risk-tasks-form.vue')

//  风控任务列表
routerService.routeInFrame('risk-tasks-list', {
  component: './task/risk-tasks-list.vue',
})

// 风险识别
flowService.addFlowForm(
  'vue:risk/task/identify/riskIdentify',
  './task/riskIdentification/risk-identification-form.vue'
)
//  风险识别子表新建
routerService.routeInFrame('risk-identification-event-add-form', {
  component: './task/riskIdentification/components/risk-identification-event-add-form.vue',
})
//  风险识别子表修改
routerService.routeInFrame('risk-identification-event-update-form', {
  component: './task/riskIdentification/components/risk-identification-event-update-form.vue',
})
// 风控任务
routerService.route('/risk-tasks/', {
  component: './task/risk-tasks-work.vue',
  children: [
    {
      path: 'risk-identification-list',
      components: {
        rightfrm: asyncComponent(() =>
          import('./task/riskIdentification/risk-identification-list.vue')
        ),
      },
    },
    // 风险评估
    {
      path: 'risk-assessment-list',
      components: {
        rightfrm: asyncComponent(() => import('./task/riskassessment/risk-assessment-list.vue')),
      },
    },
    // 风险图谱
    {
      path: 'risk-assessment-map',
      components: {
        rightfrm: asyncComponent(() => import('./task/riskMap/risk-assessment-map.vue')),
      },
    },
    // 风险应对
    {
      path: 'risk-response-list',
      components: {
        rightfrm: asyncComponent(() => import('./task/riskResponse/risk-response-list.vue')),
      },
    },
    // 风险任务报告
    {
      path: 'risk-task-report-list',
      components: {
        rightfrm: asyncComponent(() => import('./task/taskreport/risk-task-report-list.vue')),
      },
    },
    // 评价人员
    {
      path: 'risk-eventuser-list',
      component: asyncComponent(() => import('./task/user/risk-eventuser-list.vue')),
    },
    // 任务概况
    {
      path: 'risk-task-overview',
      component: asyncComponent(() => import('./task/overview/risk-task-overview.vue')),
    },
  ],
})

// 风险任务报告
flowService.addFlowForm(
  'vue:risk/task/taskreport/riskTaskReport',
  './task/taskreport/risk-task-report-form.vue'
)

// 任务概况穿透列表
routerService.route('/risk-task-overview-list', {
  component: './task/overview/risk-task-overview-list.vue',
})

// 风险图谱穿透列表
routerService.route('/risk-assessment-map-list', {
  component: './task/riskMap/risk-assessment-map-list.vue',
})

//  风险识别子表新建
routerService.routeInFrame('risk-task-overview-test', {
  component: './task/overview/risk-task-overview.vue',
})
//  风险识别子表新建
routerService.routeInFrame('risk-assessment-map-test', {
  component: './task/riskMap/risk-assessment-map.vue',
})
// 风险评估
flowService.addFlowForm(
  'vue:risk/task/assessment/riskAssessment',
  './task/riskassessment/risk-assessment-form.vue'
)

// 风险报告列表
routerService.routeInFrame('risk-report-list', {
  component: './report/risk-report-list.vue',
})
// 风险报告审批单
flowService.addFlowForm('vue:risk/report/riskReport', './report/risk-report-form.vue')

// 风险评估
flowService.addFlowForm(
  'vue:risk/task/response/riskResponse',
  './task/riskResponse/risk-response-form.vue'
)

// 风险案例库
routerService.routeInFrame('risk-case-list', {
  component: './riskcase/risk-case-list.vue',
})
// 风险案例库审批单
flowService.addFlowForm('vue:risk/riskcase/riskCase', './riskcase/risk-case-form.vue')

// 风险损失事件列表
routerService.routeInFrame('risk-loss-event-list', {
  component: './riskLossEvent/risk-loss-event-list.vue',
})

// 风险损失事件
flowService.addFlowForm(
  'vue:risk/lossEvent/riskLossEvent',
  './riskLossEvent/risk-loss-event-form.vue'
)

// 统计
routerService.routeInFrame('risk-loss-event-statistics', {
  component: './statistics/risk-loss-event-statistics.vue',
})

routerService.routeInFrame('risk-loss-event-mxlist', {
  component: './statistics/risk-loss-event-list.vue',
})
