app-default-meditview-layout.tsx 1.6 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
import { Prop,Component } from 'vue-property-decorator';
import { IPSAppDEMEditView } from "@ibiz/dynamic-model-api";
import { ModelTool } from "ibiz-core";
import { AppDefaultViewLayout } from "../app-default-view-layout/app-default-view-layout";

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

	/**
	 * 多编辑视图模型对象
	 *
	 * @type {IPSAppDEMEditView}
	 * @memberof AppDefaultMEditViewLayout
	 */
	@Prop() public declare viewInstance: IPSAppDEMEditView;

	/**
	 * 引擎初始化
	 *
	 * @param {*} [opts={}]
	 * @memberof AppDefaultMEditViewLayout
	 */
	public engineInit(opts: any = {}) {
		const controls: any[] = this.containerModel.getPSControls() || [];
        const mEditViewPanel = ModelTool.findPSControlByType('MULTIEDITVIEWPANEL', controls);
        if (mEditViewPanel) {
            let engineOpts = Object.assign({
                view: this,
                p2k: '0',
                isLoadDefault: this.viewInstance?.loadDefault,
                keyPSDEField: this.appDeCodeName.toLowerCase(),
                majorPSDEField: this.appDeMajorFieldName.toLowerCase(),
                opendata: (args: any[], fullargs?: any[], params?: any, $event?: any, xData?: any) => {
                    this.opendata(args, fullargs, params, $event, xData);
                },
                newdata: (args: any[], fullargs?: any[], params?: any, $event?: any, xData?: any) => {
                    this.newdata(args, fullargs, params, $event, xData);
                },
                meditviewpanel: (this.$refs[mEditViewPanel.name] as any).ctrl,
            }, opts);
            this.engine.init(engineOpts);
        }
	}
}