import typesBill from "../components-control/typesBill.vue";
import {getUUID} from './util/lib.js'
import {setQueryTag} from './util/queryTag.js';
export default {
  execute(context, param) {
    const uuid = getUUID();
    setQueryTag(context.currentDataQueryConditionSet,-1,param.viewName,uuid);//上张下张用 
    let templateName = null;
    if (Object.prototype.toString.call(param) === "[object Array]") {
      templateName = param[0];
    } else {
      templateName = param.viewName;
    }
    if (
      window.osConfig.appOpenMode &&
      window.osConfig.appOpenMode == "apploader"
    ) {
      GMS.$hideContainer.$portalAPI.emit(
        "open-new-page", //打开一个新的页签
        uuid,
        "runner-bill-form",
        {
          templateName: templateName,
          init: true,
          state: '',
        },
        {
          openWay: "FUNCTAB",
          title: param.displayName || "创建单据",
        }
      );
    }else{
      GMS.$hideContainer.addComponent(typesBill, {}, function (c) {
        c.templateName = templateName
        c.init = true;
        c.modal_visible = true;
        c.state = ''
      })
    }
  },
 
};