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

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

import {TabsPage} from './tabs.page';
import {EnvHomePage} from '../env-home/env-home.page';
import {WtModule} from '../../components/wt/wt.module';
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-anal',
              loadChildren: '../../envCtrl/env-anal/env-anal.module#EnvAnalPageModule',
              // component: EnvAnalPage,
          },
          {
              path: 'tab-alarm',
              loadChildren: '../../envCtrl/env-alarm/env-alarm.module#EnvAlarmPageModule',
              // component: EnvAlarmPage,
          },
          {
              path: 'tab-cfg',
              loadChildren: '../../envCtrl/env-cfg/env-cfg.module#EnvCfgPageModule',
              // component: EnvCfgPage,
          },
          {
              path: '',
              redirectTo: 'tab-home',
          },
      ],
  },
];

@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 {}
