// 自动生成的文件，请勿修改
import routerService from '@/common/services/router-service'
import asyncComponent from '@/common/services/async-component'
// 应用中心
routerService.routeInFrame('sd-application-center', {
  component:asyncComponent(
    () => import(/* webpackChunkName: "src-application-manage" */ './sd-application-center.vue')
  ),
})

// 应用菜单管理
routerService.routeInFrame('sd-application-menu', {
  component:asyncComponent(
    () => import(/* webpackChunkName: "src-application-manage" */ './sd-application-menu.vue')
  ),
})

// 应用管理
const children = [
  // 表单管理
  {
    path: 'sd-form-manage',
    component: asyncComponent(() =>
      import(/* webpackChunkName: "sd-form-manage" */ './sd-form-manage.vue')
    ),
  },
  // 流程管理
  {
    path: 'sd-flow-design-manage',
    component: asyncComponent(() =>
      import(
        /* webpackChunkName: "sd-flow-design-manage" */ '@/flow-design/sd-flow-design-manage.vue'
      )
    ),
  },
  // 业务类型
  {
    path: 'sd-app-ywlx-manage',
    component: asyncComponent(() =>
      import(/* webpackChunkName: "sd-app-ywlx-manage" */ '@/business-type/sd-app-ywlx-manage.vue')
    ),
  },
  // 导航管理
  {
    path: 'sd-menu-manage',
    component: asyncComponent(() =>
      import(/* webpackChunkName: "sd-menu-manage" */ './sd-menu-manage.vue')
    ),
  },
  // 权限设置
  {
    path: 'sd-permission-setting',
    component: asyncComponent(() =>
      import(/* webpackChunkName: "sd-permission-setting" */ './sd-permission-setting.vue')
    ),
  },
  // 数据字典
  {
    path: 'sd-data-dictionary',
    component: asyncComponent(() =>
      import(/* webpackChunkName: "sd-data-dictionary" */ './sd-data-dictionary.vue')
    ),
  },
  // 编号设置
  {
    path: 'sd-bh-manage',
    component: asyncComponent(() =>
      import(/* webpackChunkName: "sd-bh-manage" */ '@/system-manage/sd-autobh-list.vue')
    ),
  },
  // 模板管理
  {
    path: 'sd-mould-manage',
    component: asyncComponent(() =>
      import(/* webpackChunkName: "sd-bh-manage" */ './sd-mould-manage.vue')
    ),
  },
]
const applicationTabKey = (route) => {
  return `sd-application-manage_${route.query.appId}`
}
routerService.routeInFrame('sd-application-manage', {
  meta: {
    // 使用getTabKey，且加上应用id，便于不同应用打开不同的tab页
    getTabKey: applicationTabKey,
  },
  component:asyncComponent(
    () => import(/* webpackChunkName: "src-application-manage" */ './sd-application-manage.vue')
  ),
  props: (route) => ({ ...route.query }),
  children: children.map((item) => {
    const { meta, props, ...reset } = item
    const newMeta = meta ? { ...meta } : {}
    // 与父路由保持一个tab页（避免产生新的tab页）
    newMeta.getTabKey = applicationTabKey
    return {
      ...reset,
      meta: newMeta,
      props: (route) => ({
        ...route.query,
        ...(props?.(route) || {}),
      }),
    }
  }),
})

routerService.routeInFrame('sd-business-list', {
  component:asyncComponent(
    () => import(/* webpackChunkName: "src-application-manage" */ './sd-business-list.vue')
  ),
  props: (route) => ({
    customValues: route.query.customValues,
    formListId: route.query.formListId,
    moduleId: route.query.moduleId,
  }),
})
routerService.routeInFrame('sd-task-search', {
  component:asyncComponent(
    () => import(/* webpackChunkName: "src-application-manage" */ './sd-task-search.vue')
  ),
})
routerService.routeInFrame('sd-business-statis', {
  component:asyncComponent(
    () => import(/* webpackChunkName: "src-application-manage" */ './sd-business-statis.vue')
  ),
})
routerService.routeInFrame('sd-task-list', {
  component:asyncComponent(
    () => import(/* webpackChunkName: "src-application-manage" */ './sd-task-list.vue')
  ),
  props: (route) => ({
    customValues: route.query.customValues,
    formListId: route.query.formListId,
    moduleId: route.query.moduleId,
  }),
})
