import typesBill from '../components-control/typesBill.vue';
import { getUUID } from "./util/lib.js";
export default {
    execute(context, param) {
        console.log(11111, context, param)
        if (!param.billId || !param.viewName) {
            context.dom.$Message.info("请配置跳转页面的参数");
            return;
        }

        if (
            window.osConfig.appOpenMode &&
            window.osConfig.appOpenMode == "apploader"
        ) {
            GMS.$hideContainer.$portalAPI.emit(
                "open-new-page", //打开一个新的页签
                getUUID(),
                "runner-bill-form",
                {
                    templateName: context.selects[0][param.viewName],
                    id: context.selects[0][param.billId],
                    state: 'readOnly'
                },
                {
                    openWay: "FUNCTAB",
                    title: "单据详情",
                }
            );
        } else {
            GMS.$hideContainer.addComponent(typesBill, {}, function (c) {
                c.templateName = context.selects[0][param.viewName];
                c.billId = context.selects[0][param.billId];
                c.init = true;
                c.modal_visible = true;
                c.isReadOnly = true
            })
        }
    }
}
