app-default-pickupview3-layout.tsx 1.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
import { AppDefaultViewLayout } from "../app-default-view-layout/app-default-view-layout";
import { Prop, Component } from 'vue-property-decorator';
import './app-default-pickupview3-layout.less';
import { IPSDEPickupViewPanel } from "@ibiz/dynamic-model-api";

@Component({})
export class AppDefaultPickupView3Layout extends AppDefaultViewLayout {

    /**
     * 视图引擎初始化
     * 
     * @memberof AppDefaultPickupView3Layout
     */
    public engineInit() {
        if (this.Environment && this.Environment.isPreviewMode) {
            return;
        }
        let pickupViewPanelModels: any[] = [];
        const controls: any[] = this.containerModel.getPSControls() || [];
        controls.forEach((control: any) => {
            if (control.controlType == 'PICKUPVIEWPANEL') {
                pickupViewPanelModels.push(control as IPSDEPickupViewPanel);
            }
        })
        this.engine.init({
            view: this,
            pickupViewPanelModels: pickupViewPanelModels,
            keyPSDEField: this.appDeCodeName.toLowerCase(),
            majorPSDEField: this.appDeMajorFieldName.toLowerCase(),
        });
    }

    /**
     * 绘制内容
     * 
     * @memberof AppDefaultPickupView3Layout
     */
    public renderContent() {
        let cardClass = {
            'view-card': true,
            'view-no-caption': true,
            'view-no-toolbar': true,
        };
        return (
            <card class={cardClass} disHover={true} bordered={false}>
                {this.$slots.topMessage}
                <div class='content-container pickup-view'>
                    {this.$slots.default}
                </div>
                {this.$slots.bottomMessage}
            </card>
        );
    }
}