import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';

import { IonicModule } from '@ionic/angular';

import { TabsPage } from './tabs.page';
import {EnvHomePage} from '../env-home/env-home.page';
import {EnvAnalPage} from '../env-anal/env-anal.page';
import {EnvDetailPage} from '../env-detail/env-detail.page';
import {EnvAlarmPage} from '../env-alarm/env-alarm.page';
import {EnvCfgPage} from '../env-cfg/env-cfg.page';
import {KanbanComponent} from '../../components/kanban/kanban.component';
import {AppModule} from '../../app.module';
import {WtModule} from '../../components/wt/wt.module';
import {EnvFanPage} from '../env-fan/env-fan.page';
import {EnvShowerPage} from '../env-shower/env-shower.page';
import {EnvLightPage} from '../env-light/env-light.page';
import {EnvWaterchannelPage} from '../env-waterchannel/env-waterchannel.page';
import {NgxEchartsModule} from 'ngx-echarts';
import {NgxDatatableModule} from '@swimlane/ngx-datatable';

const routes: Routes = [
  {
    path: '',
    component: TabsPage,
      children: [
          {
              path: 'tab-home',
              component: EnvHomePage
          },
          // {
          //     path: 'tab-detail',
          //     component: EnvDetailPage
          // },
          {
              path: 'tab-anal',
              component: EnvAnalPage
          },
          {
              path: 'tab-alarm',
              component: EnvAlarmPage
          },
          {
              path: 'tab-cfg',
              component: EnvCfgPage
          },
          {
              path: '',
              redirectTo: '/tabs/tab-home',
              pathMatch: 'full'
          },
          // {
          //     path: 'tab-2-fan',
          //     redirectTo: '/tabs/tab-detail/tab-2-fan',
          //     pathMatch: 'full'
          // },
          // {
          //     path: 'tab-2-fan',
          //     redirectTo: '/tabs/tab-detail/tab-2-fan',
          //     pathMatch: 'full'
          // },
          // {
          //     path: 'tab-2-shower',
          //     redirectTo: '/tabs/tab-detail/tab-2-shower',
          //     pathMatch: 'full'
          // },
          // {
          //     path: 'tab-2-light',
          //     redirectTo: '/tabs/tab-detail/tab-2-light',
          //     pathMatch: 'full'
          // },
          // {
          //     path: 'tab-2-channel',
          //     redirectTo: '/tabs/tab-detail/tab-2-channel',
          //     pathMatch: 'full'
          // },
      ]
  },
    // {
    //     path: 'tab-detail',
    //     component: EnvDetailPage,
    //     children:[
    //         {
    //             path: 'tab-2-fan',
    //             component: EnvFanPage
    //         },
    //         {
    //             path: 'tab-2-shower',
    //             component: EnvShowerPage
    //         },
    //         {
    //             path: 'tab-2-light',
    //             component: EnvLightPage
    //         },
    //         {
    //             path: 'tab-2-channel',
    //             component: EnvWaterchannelPage
    //         },
    //         {
    //             path: '',
    //             redirectTo: 'tab-2-fan',
    //         },
    //     ],
    //
    // }
];

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    IonicModule,
    NgxEchartsModule,
    NgxDatatableModule,
    WtModule,
    RouterModule.forChild(routes),
  ],
  declarations: [TabsPage,
      EnvHomePage,
      EnvAnalPage,
      EnvAlarmPage,
      EnvCfgPage,
      //EnvDetailPage,
      // EnvFanPage,
      // EnvShowerPage,
      // EnvLightPage,
      // EnvWaterchannelPage,
      ]
})
export class TabsPageModule {}
