@ibiz/model-location
简介
@ibiz/model-location 是IBiz前端团队根据业务需要,封装的模型DebugApp打开界面中转控制器,在IBiz R7前端动态模板项目中可用。
安装
npm i @ibiz/model-location
或
yarn add @ibiz/model-location
快速开始
// 挂载
import { install } from '@ibiz/model-location';
import { applyPolyfills, defineCustomElements } from '@ibiz/model-location/loader';
export const AppComponents = {
install(v: any, opt: any) {
applyPolyfills().then(() => defineCustomElements(window));
install({
// 模型调试应用地址
debugAppUrl: __webpack_public_path__ + './assets/www/index.html?origin=' + encodeURIComponent(location.origin),
// 动态配置工具地址
dynamicConfigToolUrl: Environment.dynamicConfigToolUrl + encodeURIComponent(location.origin),
});
......
},
}
import { modelTransferC } from '@ibiz/model-location';
// 打开模型导览界面
modelTransferC.open(
e, // 鼠标点击事件源
this.viewInstance.getPSModelService(), // 视图模型服务
this.viewInstance, // 视图实例
this.context, // 上下文
this.viewparams, // 视图参数
);
// 关闭模型导览界面
modelTransferC.dismiss();
// 隐藏模型导览界面
modelTransferC.hidden();