import { AppLayoutService } from '../../../app-service';
import { WfDynaExpGridViewBase } from '../../../view/wfdynaexpgridview-base';

/**
 * 应用实体工作流动态导航表格视图基类
 *
 * @export
 * @class AppWfDynaExpGridViewBase
 * @extends {WfDynaExpGridViewBase}
 */
export class AppWfDynaExpGridViewBase extends WfDynaExpGridViewBase {
  /**
   * 工作流动态表格导航视图渲染
   *
   * @memberof AppWfDynaExpGridViewBase
   */
  render(h: any) {
    if (!this.viewIsLoaded) {
      return null;
    }
    const targetViewLayoutComponent: any = AppLayoutService.getLayoutComponent(`${this.viewInstance.viewType}-${this.viewInstance.viewStyle}`);
    return h(
      targetViewLayoutComponent,
      {
        props: { viewInstance: this.viewInstance, model: this.model, modelService: this.modelService, viewparams: this.viewparams, context: this.context },
      },
      [this.renderQuickSearch(), this.renderToolBar(), this.renderMainContent()],
    );
  }
}
