import Layout from "@/layout";

const HomeRoutes = {
  path: "/systemSettings",
  component: Layout,
  name: "systemSettings",
  redirect: "/systemSettings/warningSet",
  //using el svg icon, the elSvgIcon first when at the same time using elSvgIcon and icon
  meta: {
    title: "系统配置",
    elSvgIcon: "Tools",
    breadcrumb: false,
    roles: ["system_settings_menu"],
  },
  children: [
    {
      path: "/systemSettings/securityPolicy",
      name: "SecurityPolicy",
      meta: { title: "登录策略", roles: ["login_strategy_page"] },
      component: () =>
        import("@/views/systemSettings/securityPolicy/index.vue"),
    },
    {
      path: "/systemSettings/securityPolicyedit",
      name: "SecurityPolicyedit",
      hidden: true,
      meta: { title: "安全策略编辑" },
      component: () =>
        import("@/views/systemSettings/securityPolicy/securityPolicyedit.vue"),
    },
    {
      path: "/systemSettings/warningSet",
      name: "WarningSet",
      meta: { title: "预警告警维护", roles: ["alert_alarm_settings_page"] },
      redirect: "/systemSettings/warningSet",
      component: {
        render: () => h(resolveComponent("router-view")),
      },
      children: [
        {
          path: "/systemSettings/warningSet",
          name: "WarningSet",
          hidden: true,
          component: () =>
            import("@/views/systemSettings/warningSet/index.vue"),
        },
        {
          path: "/systemSettings/warningEdit",
          name: "WarningEdit",
          hidden: true,
          meta: { title: "预警告警维护编辑" },
          component: () =>
            import("@/views/systemSettings/warningEdit/index.vue"),
        },
      ],
    },
    {
      path: "/systemSettings/log",
      name: "log",
      meta: { title: "日志管理", roles: ["log_management_page"] },
      component: () => import("@/views/systemSettings/log/index.vue"),
    },
    {
      path: "/systemSettings/serviceManagement",
      name: "ServiceManagement",
      meta: { roles: ["service_management_page"] },
      component: {
        render: () => h(resolveComponent("router-view")),
      },
      children: [
        {
          path: "/systemSettings/serviceManagement",
          name: "ServiceHome",
          meta: { title: "服务管理", roels: ["service_management_page"] },
          component: () =>
            import("@/views/systemSettings/serviceManagement/index.vue"),
        },
        {
          path: "/systemSettings/serviceTopology",
          name: "ServiceTopology",
          hidden: true,
          meta: { title: "服务拓扑", roles: ["slot_edit_page"] },
          component: () =>
            import(
              "@/views/systemSettings/serviceManagement/serviceTopology.vue"
            ),
        },
        {
          path: "/systemSettings/serviceEdit",
          name: "ServiceEdit",
          hidden: true,
          meta: { title: "服务编辑", roles: ["service_editor_page"] },
          component: () =>
            import("@/views/systemSettings/serviceManagement/serviceEdit.vue"),
        },
      ],
    },
    {
      path: "/systemSettings/queryTemplate",
      name: "QueryTemplate",
      meta: { title: "查询模板", roles: ["query_template_page"] },
      redirect: "/systemSettings/queryTemplate",
      component: {
        render: () => h(resolveComponent("router-view")),
      },
      children: [
        {
          path: "/systemSettings/queryTemplate",
          name: "QueryTemplate",
          hidden: true,
          component: () =>
            import("@/views/systemSettings/queryTemplate/index.vue"),
        },
        {
          path: "/systemSettings/queryTemplateAdd",
          name: "QueryTemplateAdd",
          hidden: true,
          meta: { title: "新增查询模板" },
          component: () =>
            import("@/views/systemSettings/queryTemplate/queryTemplateAdd.vue"),
        },
        {
          path: "/systemSettings/queryTemplateEdit",
          name: "QueryTemplateEdit",
          hidden: true,
          meta: { title: "编辑查询模板" },
          component: () =>
            import(
              "@/views/systemSettings/queryTemplate/queryTemplateEdit.vue"
            ),
        },
        {
          path: "/systemSettings/queryTemplateColumn",
          name: "QueryTemplateColumn",
          hidden: true,
          meta: {
            title: "查询模板设置",
            roles: ["query_template_column_settings_button"],
          },
          component: () =>
            import(
              "@/views/systemSettings/queryTemplate/queryTemplateColumn.vue"
            ),
        },
      ],
    },
    // {
    //   path: "/systemSettings/sourceservice",
    //   name: "Sourceservice",
    //   meta: { title: "源数据管理" },
    //   component: () => import("@/views/systemSettings/sourceservice/index.vue"),
    // },
    {
      path: "/systemSettings/sourceserviceEdit",
      name: "SourceserviceEdit",
      hidden: true,
      meta: { title: "编辑数据源管理" },
      component: () =>
        import("@/views/systemSettings/sourceserviceEdit/index.vue"),
    },
    {
      path: "/systemSettings/sourceTube",
      name: "SourceTube",
      meta: { title: "数据源管理", roles: ["data_source_management_page"] },
      component: () => import("@/views/systemSettings/sourceTube/index.vue"),
    },
    {
      path: "/systemSettings/protocolManagement",
      name: "ProtocolManagement",
      meta: { title: "协议管理", roles: ["agreement_management_page"] },
      component: () =>
        import("@/views/systemSettings/protocolManagement/index.vue"),
    },
    {
      path: "/systemSettings/datastructure",
      name: "Datastructure",
      meta: {
        title: "数据结构管理",
        roles: ["data_structure_management_page"],
      },
      redirect: "/systemSettings/datastructure",
      component: {
        render: () => h(resolveComponent("router-view")),
      },
      children: [
        {
          path: "/systemSettings/datastructure",
          hidden: true,
          name: "Datastructure",
          component: () =>
            import("@/views/systemSettings/datastructure/index.vue"),
        },
        {
          path: "/systemSettings/datastructureTerm",
          name: "DatastructureTerm",
          hidden: true,
          meta: { title: "数据项" },
          component: () =>
            import(
              "@/views/systemSettings/datastructure/datastructureTerm.vue"
            ),
        },
      ],
    },
    {
      path: "/systemSettings/messageTemplate",
      name: "MessageTemplate",
      meta: { title: "消息模板" },
      component: () =>
        import("@/views/systemSettings/messageTemplate/index.vue"),
    },
  ],
};

export default [HomeRoutes];
