Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /www/wwwroot/dev.zhalaotie.com/wp-includes/wp-db.php on line 3215

Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /www/wwwroot/dev.zhalaotie.com/wp-includes/wp-db.php on line 3215
Angular Framework 前端分页 – 扎老铁
Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /www/wwwroot/dev.zhalaotie.com/wp-includes/wp-db.php on line 3215

Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /www/wwwroot/dev.zhalaotie.com/wp-includes/wp-db.php on line 3215
Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /www/wwwroot/dev.zhalaotie.com/wp-includes/wp-db.php on line 3215
class="post-52843 post type-post status-publish format-standard has-post-thumbnail hentry">

Angular Framework 前端分页

export class PaginationResult<TItem, TOther> {
  items: PaginationList<TItem>;
  /**
   * 数据总数
   */
  total: number;
  skipCount: number;
  takeCount: number;

  other: TOther;

  constructor(...items: TItem[]) {
    // super(...items);
    this.items = new PaginationList<TItem>(...items);
  }
}
import {Component} from '@angular/core';
import {ComponentBase} from '../../../../core/BaseController';
import {IocInject} from '../../../../core/ioc-inject';
import {SceneStorage} from '../../../service/component';
import {DeviceProjectContextProvider} from '../../../service/DeviceProjectContextProvider';
import {ControlBuilderFactory} from '../../../../core/components/factory';
import {DataLoadHelper, PaginationList} from '../../../../core/components/core';
import {DeviceStatusCount} from '../../../model/core';
import {Observable} from 'rxjs/Observable';
import {Subject} from 'rxjs/Subject';


@Component({
  selector: 'scene-list',
  templateUrl: 'component.html',
  styleUrls: ['scene-list.scss'],
})
export class SceneListComponent extends ComponentBase {

  projectId: string;

  /**
   * 根据项目编号查询项目信息,项目信息包括场景 list 信息
   * @type {DataLoaderListBuilder<{scenes: Scene[]; deciceCount: number}, TCustom>}
   */
  sceneListLoader = this.afb.list(
    query => query.from((f) => this.sceneStorage.list(f)),
    filter => filter.custom(() => ({
      projectId: this.projectId,
      customFilterProp1: this.customFilterProp1,
      customFilterProp2: 0,
      customFilterProp3: new Date().toTimeString(),
    })).pagination({skipCount: 0, takeCount: 15})
  );

  constructor(public ioc: IocInject, private afb: ControlBuilderFactory, private sceneStorage: SceneStorage, public projectProvider: DeviceProjectContextProvider) {
    super(ioc);
  }


  onInit() {
    super.onInit();

    this.setNavigationCategory(this.lKey("Scene List"));

    let projectId = this.projectId = this.navParams.get('projectId') == null ? '1' : this.navParams.get('projectId');


    {
      //获取设备状态统计数量
      let ld = this.deviceStatusCountLoader;
      ld.setLoader(() => {
        return this.sceneStorage.getDeviceStatusCount(this.projectId,this.listType);
      });
      // ld.subscribe();
      ld.load();
        this.loadheaderDataCountInterval = setInterval(() => {
            if (!localStorage.getItem('deviceStatusCountLoader.disable')) {
                ld.load();
                //this.sceneListLoader();
                return;
            }
        }, 2000);
    }

    {
      // 更新查询条件(全量)
      setInterval(() => {
        this.customFilterProp1 = new Date().toString();
        this.sceneListLoader().filter.custom.refresh();
      }, 5000);
      //

      // 模拟更新查询条件(部分更新)
      let prop2 = 1;
      setInterval(() => {
        prop2++;
        this.sceneListLoader().filter.custom.patch({customFilterProp2: prop2});
      }, 3000);


      this.sceneStorage.list().subscribe(x => {
        x[0].devices.length.toString();
        x[0].comPortName.toString();
      });
      

    }



  }

  ngOnDestroy(){
    super.ngOnDestroy();

    {
      let ld = this.sceneListLoader;
      if(ld)ld().ngOnDestroy();
    }

  }


}
 <tbody *ngIf="sceneListLoader().items">
        <tr *ngFor="let item of sceneListLoader().items" [navigationLink]="['/iot/scene/item']"  navigationCategory="Scene" i18n-navigationCategory="the navigationCategory"   [navigationTitle]="item.name" [queryParams]="{ id:item.id,comPortName:item.comPortName||'',projectId:projectId }"  >
          <td>{{item.seq}}</td>
          <td>{{item.name}}</td>
          <td>{{item.comPortName}}</td>
          <td>{{item.deviceCount}}</td>
          <td class="nh-alertnum-td">
            <div class="nh-alertnum-yuanxing-div" *ngIf="!(item.alertCount==0)">
              <p class="text-center nh-alertnum-p">{{item.alertCount}}</p>
            </div>
          </td>
          <!-- <td class="nh-seticon-td">
            <div class="nh-seticon-img-container">
              <a  [navigationLink]="['/iot/scene/item']"  navigationCategory="Scene" i18n-navigationCategory="the navigationCategory"  [navigationTitle]="item.name" [queryParams]="{ id:item.id,comPortName:item.comPortName||'',showType:'OnorOff' }" >
                <img class="img-responsive" src="{{url.asset('assets/images/controlIcon2.png')}}" />
              </a>
            </div>
          </td> -->
          <td>{{ item.modifiedAt|ReplaceT |friendlydate}}</td>
        </tr>

</tbody>

 

后端写法:

发表评论

电子邮件地址不会被公开。