yanchengPowerSupply/node_modules/mxdraw/dist/lib/tools/dynamicImport/index.js

1 line
3.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var __awaiter=this&&this.__awaiter||function(e,t,o,i){return new(o||(o=Promise))(function(r,a){function n(e){try{m(i.next(e))}catch(e){a(e)}}function c(e){try{m(i.throw(e))}catch(e){a(e)}}function m(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(n,c)}m((i=i.apply(e,t||[])).next())})};export function dynamicImport(e){return __awaiter(this,void 0,void 0,function*(){let t;switch(e){case"jquery":t=yield dynamicImportJquery();break;case"element-resize-event-polyfill":t=yield dynamicImportResize()}return t})};function dynamicImportResize(){return __awaiter(this,void 0,void 0,function*(){try{const e=yield import("element-resize-event-polyfill");return e.default?e.default:e}catch(e){console.log("import动态导入element-resize-event-polyfill失败",e)}})}function dynamicImportJquery(){return __awaiter(this,void 0,void 0,function*(){try{const e=yield import("jquery");return e.default?e.default:e}catch(e){console.log("import动态导入jquery失败",e)}})}let _mapDynamicCreate=null;function intiDynamicCreateMxObject(){_mapDynamicCreate||((_mapDynamicCreate={}).MxDbArea=(()=>import("../../MxModule/MxDbArea")),_mapDynamicCreate.MxDbLeadTag=(()=>import("../../MxModule/MxDbLeadTag")),_mapDynamicCreate.MxDbCoord=(()=>import("../../MxModule/MxDbCoord")),_mapDynamicCreate.MxDb2LineAngularDimension=(()=>import("../../MxModule/MxDb2LineAngularDimension")),_mapDynamicCreate.Mx3PointArc=(()=>import("../../MxModule/Mx3PointArc")),_mapDynamicCreate.MxDbAnyLine=(()=>import("../../MxModule/MxDbAnyLine")),_mapDynamicCreate.MxDbCloudLine=(()=>import("../../MxModule/MxDbCloudLine")),_mapDynamicCreate.MxDbLeadComment=(()=>import("../../MxModule/MxDbLeadComment")),_mapDynamicCreate.MxDbRectBoxLeadComment=(()=>import("../../MxModule/MxDbRectBoxLeadComment")),_mapDynamicCreate.MxDbEllipse=(()=>import("../../MxModule/MxDbEllipse")),_mapDynamicCreate.MxDbText=(()=>import("../../MxModule/MxDbText")),_mapDynamicCreate.MxDbRegularPolygon=(()=>import("../../MxModule/MxDbRegularPolygon")),_mapDynamicCreate.MxDbHatch=(()=>import("../../MxModule/MxDbHatch")),_mapDynamicCreate.MxDbHatch=(()=>import("../../MxModule/MxDbHatch")))}export function dynamicCreateMxObject(e){return __awaiter(this,void 0,void 0,function*(){let t;switch(intiDynamicCreateMxObject(),e){case"MxDbSVG":try{t=yield import("../../MxModule/MxDbSVG")}catch(t){console.log("import"+e+"error",t)}break;case"MxDbImage":try{t=yield import("../../MxModule/MxDbImage")}catch(t){console.log("import"+e+"error",t)}break;case"MxDbRect":try{t=yield import("../../MxModule/MxDbRect")}catch(t){console.log("import"+e+"error",t)}break;case"MxDbSVGText":try{t=yield import("../../MxModule/MxDbSVGText")}catch(t){console.log("import"+e+"error",t)}break;case"MxDbPolyline":try{t=yield import("../../MxModule/MxDbPolyline")}catch(t){console.log("import"+e+"error",t)}break;case"MxDbAlignedDimension":try{t=yield import("../../MxModule/MxDbAlignedDimension")}catch(t){console.log("import"+e+"error",t)}}if(!t&&_mapDynamicCreate[e])try{t=yield _mapDynamicCreate[e]()}catch(t){console.log("import"+e+"error",t)}return t?t.default?t.default:t:(console.log("mx dynmac load:"+e+" failed"),null)})};