import { CreateElement } from 'vue';
import { throttle } from '@ibizstudio/runtime';
import { PickupView3Base } from '../../../view/pickupview3-base';
import { AppLayoutService } from '../../../app-service';
import { IPSDEPickupViewPanel } from '@ibizstudio/runtime';
export class AppPickupView3Base extends PickupView3Base {
/**
* 渲染选择视图按钮
*
* @memberof PickupViewBase
*/
renderPickButton() {
if (this.isShowButton) {
return (
);
}
}
renderPickupViewPanel(panel: IPSDEPickupViewPanel) {
let { targetCtrlParam, targetCtrlEvent, targetCtrlName } = this.computeTargetCtrlData(panel);
return this.$createElement(targetCtrlName, { props: targetCtrlParam, ref: panel.name, on: targetCtrlEvent });
}
renderPickupViewPanelTab(panel: IPSDEPickupViewPanel, tabName: string) {
const name = panel.name || panel.codeName;
return (
{this.renderPickupViewPanel(panel)}
);
}
renderMainContent() {
const tabName = `${this.appDeCodeName}_${this.viewInstance.viewType}_${this.viewInstance.name}`;
return (
throttle(this.tabPanelClick, [$event], this)}>
{this.pickupViewPanelModels.map((panel: IPSDEPickupViewPanel) => {
return this.renderPickupViewPanelTab(panel, tabName);
})}
);
}
/**
* 数据视图渲染
*
* @memberof AppPickupViewBase
*/
render(h: CreateElement) {
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.renderTopMessage(), this.renderBodyMessage(), this.renderToolBar(), this.renderMainContent(), this.renderPickButton(), this.renderBottomMessage()],
);
}
}