mxdraw 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/MxModule/McEdGetPointWorldDrawObject/McEdGetPointWorldDrawObjectClass.js +1 -128
- package/dist/lib/MxModule/McEdGetPointWorldDrawObject/index.js +1 -5
- package/dist/lib/MxModule/McGeVector3d/McGeVector3d.js +1 -2
- package/dist/lib/MxModule/McGeVector3d/index.js +1 -3
- package/dist/lib/MxModule/McGiWorldDraw/McGiWorldDraw.js +1 -2
- package/dist/lib/MxModule/McGiWorldDraw/index.js +1 -2
- package/dist/lib/MxModule/McGiWorldDrawType/McGiWorldDrawType.js +1 -19
- package/dist/lib/MxModule/McGiWorldDrawType/index.js +1 -4
- package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/MrxDbgUiPrBaseReturn.js +1 -31
- package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/index.js +1 -5
- package/dist/lib/MxModule/MrxDbgUiPrPoint/MrxDbgUiPrPointClass.js +1 -150
- package/dist/lib/MxModule/MrxDbgUiPrPoint/index.js +1 -5
- package/dist/lib/MxModule/MxDbAlignedDimension/MxDbAlignedDimension.js +1 -213
- package/dist/lib/MxModule/MxDbAlignedDimension/index.js +1 -5
- package/dist/lib/MxModule/MxDbEntity/MxDbEntity.js +1 -241
- package/dist/lib/MxModule/MxDbEntity/index.js +1 -5
- package/dist/lib/MxModule/MxDbImage/MxDbImage.js +1 -160
- package/dist/lib/MxModule/MxDbImage/index.js +1 -5
- package/dist/lib/MxModule/MxDbLine/MxDbLine.js +1 -94
- package/dist/lib/MxModule/MxDbLine/index.js +1 -5
- package/dist/lib/MxModule/MxDbRect/MxDbRect.js +1 -273
- package/dist/lib/MxModule/MxDbRect/index.js +1 -4
- package/dist/lib/MxModule/MxDbSVG/MxDbSVG.js +1 -369
- package/dist/lib/MxModule/MxDbSVG/index.js +1 -5
- package/dist/lib/MxModule/MxDbSVGText/MxDbSVGText.js +1 -21
- package/dist/lib/MxModule/MxDbSVGText/index.js +1 -5
- package/dist/lib/MxModule/MxDrawObject/MxDrawObject.js +1 -754
- package/dist/lib/MxModule/MxDrawObject/index.js +1 -5
- package/dist/lib/MxModule/MxFilters/MxFilters.js +1 -201
- package/dist/lib/MxModule/MxFilters/index.js +1 -4
- package/dist/lib/MxModule/MxFun/MxFun.js +1 -630
- package/dist/lib/MxModule/MxFun/index.js +1 -9
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.js +1 -283
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.mixin.js +1 -146
- package/dist/lib/MxModule/MxThreeJS/SVGLoader.js +1 -1862
- package/dist/lib/MxModule/MxThreeJS/index.js +1 -7
- package/dist/lib/MxModule/MxType/MxType.js +1 -27
- package/dist/lib/MxModule/MxType/index.js +1 -4
- package/dist/lib/MxModule/Mxassembly/Mxassembly.js +1 -18
- package/dist/lib/MxModule/Mxassembly/index.js +1 -9
- package/dist/lib/MxModule/loadCoreCode/index.js +1 -5
- package/dist/lib/MxModule/loadCoreCode/loadCoreCode.js +1 -125
- package/dist/lib/MxModule/loadCoreCode/mxUiData.js +1 -317
- package/dist/lib/MxModule/loadCoreCode/mxcadassembly_es5.js +1 -1519
- package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +1 -7361
- package/dist/lib/MxModule/store/PubsubClass.js +1 -40
- package/dist/lib/MxModule/store/StoreClass.js +1 -73
- package/dist/lib/MxModule/store/index.js +1 -16
- package/dist/lib/MxModule/store/store.js +1 -25
- package/dist/lib/MxModule/useCanvasResizeListener/index.js +1 -5
- package/dist/lib/MxModule/useCanvasResizeListener/useCanvasResizeListener.js +1 -95
- package/dist/lib/doc.js +1 -38
- package/dist/lib/mxdraw.js +1 -64
- package/dist/lib/tools/algorithm/math.js +1 -16
- package/dist/lib/tools/algorithm/random.js +1 -13
- package/dist/lib/tools/dom/create.js +1 -47
- package/dist/lib/tools/dynamicImport/index.js +1 -186
- package/dist/lib/tools/formatting/index.js +1 -20
- package/dist/lib/tools/proxy/index.js +1 -17
- package/dist/lib/tools/three/index.js +1 -124
- package/dist/lib/types/McEdGetPointWorldDrawObject.js +1 -2
- package/dist/lib/types/MrxDbgUiPrPoint.js +1 -2
- package/dist/lib/types/MxCADObject.js +1 -2
- package/dist/lib/types/MxDrawObject.js +1 -2
- package/dist/lib/types/MxFun.js +1 -2
- package/dist/lib/types/Mxassembly.js +1 -2
- package/dist/mxdraw.es5.js +1 -45
- package/dist/mxdraw.umd.js +1 -45
- package/dist/types/MxModule/MxFun/MxFun.d.ts +18 -1
- package/dist/types/MxModule/store/index.d.ts +2 -7
- package/dist/types/mxdraw.d.ts +1 -4
- package/package.json +6 -5
- package/dist/mxdraw.es5.js.map +0 -1
- package/dist/mxdraw.umd.js.map +0 -1
|
@@ -1,7 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var MxThreeJS_mixin_1 = require("./MxThreeJS.mixin");
|
|
4
|
-
var MxThreeJS_1 = require("./MxThreeJS");
|
|
5
|
-
var MxThreeJS = new MxThreeJS_1.default();
|
|
6
|
-
(0, MxThreeJS_mixin_1.default)(MxThreeJS);
|
|
7
|
-
exports.default = MxThreeJS;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var MxThreeJS_mixin_1=require("./MxThreeJS.mixin"),MxThreeJS_1=require("./MxThreeJS"),MxThreeJS=new MxThreeJS_1.default;(0,MxThreeJS_mixin_1.default)(MxThreeJS),exports.default=MxThreeJS;
|
|
@@ -1,27 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/** @module MxType*/
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
/**
|
|
5
|
-
* 动态绘制类型
|
|
6
|
-
* @example ```typescript
|
|
7
|
-
|
|
8
|
-
* ```
|
|
9
|
-
*/
|
|
10
|
-
var MxCloneType;
|
|
11
|
-
(function (MxCloneType) {
|
|
12
|
-
/** 正常Clone */
|
|
13
|
-
MxCloneType[MxCloneType["kClone"] = 1] = "kClone";
|
|
14
|
-
/** 动态拖动Clone */
|
|
15
|
-
MxCloneType[MxCloneType["kDragClone"] = 2] = "kDragClone";
|
|
16
|
-
})(MxCloneType || (MxCloneType = {}));
|
|
17
|
-
var MxCloneType2;
|
|
18
|
-
(function (MxCloneType2) {
|
|
19
|
-
/** 正常Clone */
|
|
20
|
-
MxCloneType2[MxCloneType2["kClone"] = 1] = "kClone";
|
|
21
|
-
/** 动态拖动Clone */
|
|
22
|
-
MxCloneType2[MxCloneType2["kDragClone"] = 2] = "kDragClone";
|
|
23
|
-
})(MxCloneType2 || (MxCloneType2 = {}));
|
|
24
|
-
exports.default = {
|
|
25
|
-
MxCloneType: MxCloneType,
|
|
26
|
-
MxCloneType2: MxCloneType2
|
|
27
|
-
};
|
|
1
|
+
"use strict";var MxCloneType,MxCloneType2;Object.defineProperty(exports,"__esModule",{value:!0}),function(e){e[e.kClone=1]="kClone",e[e.kDragClone=2]="kDragClone"}(MxCloneType||(MxCloneType={})),function(e){e[e.kClone=1]="kClone",e[e.kDragClone=2]="kDragClone"}(MxCloneType2||(MxCloneType2={})),exports.default={MxCloneType:MxCloneType,MxCloneType2:MxCloneType2};
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var MxType_1 = require("./MxType");
|
|
4
|
-
exports.default = MxType_1.default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var MxType_1=require("./MxType");exports.default=MxType_1.default;
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var store_1 = require("../store/store");
|
|
4
|
-
/**
|
|
5
|
-
* Mxassembly 模块
|
|
6
|
-
* 导出库时已实例化,只需要调用实例方法 例如:
|
|
7
|
-
* ```typescript
|
|
8
|
-
* ```
|
|
9
|
-
*/
|
|
10
|
-
var Mxassembly = /** @class */ (function () {
|
|
11
|
-
function Mxassembly() {
|
|
12
|
-
}
|
|
13
|
-
Mxassembly.prototype.NewMcGeVector3d = function () {
|
|
14
|
-
return new store_1.default.state.Mxassembly.McGeVector3d();
|
|
15
|
-
};
|
|
16
|
-
return Mxassembly;
|
|
17
|
-
}());
|
|
18
|
-
exports.default = Mxassembly;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var store_1=require("../store/store"),Mxassembly=function(){function e(){}return e.prototype.NewMcGeVector3d=function(){return new store_1.default.state.Mxassembly.McGeVector3d},e}();exports.default=Mxassembly;
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var Mxassembly_1 = require("./Mxassembly");
|
|
4
|
-
// import store from '../store/_index'
|
|
5
|
-
// import loadCoreCode from '../loadCoreCode'
|
|
6
|
-
// if (!store.state.MxFUn) {
|
|
7
|
-
// loadCoreCode()
|
|
8
|
-
// }
|
|
9
|
-
exports.default = new Mxassembly_1.default();
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Mxassembly_1=require("./Mxassembly");exports.default=new Mxassembly_1.default;
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/** @module loadCoreCode */
|
|
4
|
-
var loadCoreCode_1 = require("./loadCoreCode");
|
|
5
|
-
exports.default = loadCoreCode_1.default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var loadCoreCode_1=require("./loadCoreCode");exports.default=loadCoreCode_1.default;
|
|
@@ -1,125 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
/** @module loadCoreCode */
|
|
40
|
-
var dynamicImport_1 = require("../../tools/dynamicImport");
|
|
41
|
-
var store_1 = require("../store/store");
|
|
42
|
-
var mxfun_es5_js_1 = require("./mxfun.es5.js");
|
|
43
|
-
var mxcadassembly_es5_js_1 = require("./mxcadassembly_es5.js");
|
|
44
|
-
function rxInitMxEntity() {
|
|
45
|
-
/*
|
|
46
|
-
new MxDbImage().rxInit()
|
|
47
|
-
new MxDbSVG().rxInit()
|
|
48
|
-
new MxDbAlignedDimension().rxInit()
|
|
49
|
-
new MxDbLine().rxInit()
|
|
50
|
-
new MxDbRect().rxInit()
|
|
51
|
-
*/
|
|
52
|
-
;
|
|
53
|
-
store_1.default.state.MxFun.initDynamicCreate(dynamicImport_1.dynamicCreateMxObject);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* 加载MxDraw库的核心代码 才能使用Mx的其他模块
|
|
57
|
-
* @returns Promise<{@link MxFun}>
|
|
58
|
-
* @example
|
|
59
|
-
* ```
|
|
60
|
-
* Mx.loadCoreCode().then(()=> console.log("加载完成", Mx.MxFun))
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
function loadCoreCode() {
|
|
64
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
-
var _this = this;
|
|
66
|
-
return __generator(this, function (_a) {
|
|
67
|
-
return [2 /*return*/, new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () {
|
|
68
|
-
var _a, _b, e_1;
|
|
69
|
-
return __generator(this, function (_c) {
|
|
70
|
-
switch (_c.label) {
|
|
71
|
-
case 0:
|
|
72
|
-
_c.trys.push([0, 2, , 3]);
|
|
73
|
-
if (store_1.default.state.MxFun) {
|
|
74
|
-
console.error('内部已调用loadCoreCode, 无需重复调用!');
|
|
75
|
-
return [2 /*return*/, rej({
|
|
76
|
-
code: 'error',
|
|
77
|
-
msg: '内部已调用loadCoreCode, 无需重复调用'
|
|
78
|
-
})];
|
|
79
|
-
}
|
|
80
|
-
_a = window;
|
|
81
|
-
_b = window;
|
|
82
|
-
return [4 /*yield*/, (0, dynamicImport_1.dynamicImport)('jquery')];
|
|
83
|
-
case 1:
|
|
84
|
-
_a.$ = _b.jQuery = _c.sent();
|
|
85
|
-
window.MxDocumentReady = undefined;
|
|
86
|
-
window.MxUiMain = function (requireFun) {
|
|
87
|
-
var MxFun = requireFun('./MxFun').MxFun;
|
|
88
|
-
store_1.default.commit('setMxFun', MxFun);
|
|
89
|
-
store_1.default.events.emit('MxUiMain', requireFun);
|
|
90
|
-
window.MxUiMain = undefined;
|
|
91
|
-
};
|
|
92
|
-
// 与MxMain有冲突(执行顺序有问题)
|
|
93
|
-
// window.MxDocumentReady = (requireFun: (path: string) => RequireFunReturnObjectType, mxinit: () => void) => {
|
|
94
|
-
// store.events.emit("MxDocumentReady", requireFun, mxinit)
|
|
95
|
-
// mxinit()
|
|
96
|
-
// }
|
|
97
|
-
window.MxMain = function (requireFun) {
|
|
98
|
-
store_1.default.events.emit('MxMain', requireFun);
|
|
99
|
-
window.MxMain = undefined;
|
|
100
|
-
rxInitMxEntity();
|
|
101
|
-
res();
|
|
102
|
-
return 0;
|
|
103
|
-
};
|
|
104
|
-
(0, mxcadassembly_es5_js_1.default)().then(function (mxassembly) {
|
|
105
|
-
//console.log(mxassembly);
|
|
106
|
-
store_1.default.commit('setMxassembly', mxassembly);
|
|
107
|
-
});
|
|
108
|
-
// 加载mxfun.min.js,mxfun()相当直接模拟了mxfun.min.js的加载。
|
|
109
|
-
(0, mxfun_es5_js_1.default)();
|
|
110
|
-
return [3 /*break*/, 3];
|
|
111
|
-
case 2:
|
|
112
|
-
e_1 = _c.sent();
|
|
113
|
-
rej({
|
|
114
|
-
code: 'error',
|
|
115
|
-
msg: e_1
|
|
116
|
-
});
|
|
117
|
-
return [3 /*break*/, 3];
|
|
118
|
-
case 3: return [2 /*return*/];
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
}); })];
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
exports.default = loadCoreCode;
|
|
1
|
+
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,u)}s((r=r.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(exports,"__esModule",{value:!0});var dynamicImport_1=require("../../tools/dynamicImport"),store_1=require("../store/store"),mxfun_es5_js_1=require("./mxfun.es5.js"),mxcadassembly_es5_js_1=require("./mxcadassembly_es5.js");function rxInitMxEntity(){store_1.default.state.MxFun.initDynamicCreate(dynamicImport_1.dynamicCreateMxObject)}function loadCoreCode(){return __awaiter(this,void 0,void 0,function(){var e=this;return __generator(this,function(t){return[2,new Promise(function(t,n){return __awaiter(e,void 0,void 0,function(){var e,r,o;return __generator(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),store_1.default.state.MxFun?(console.error("内部已调用loadCoreCode, 无需重复调用!"),[2,n({code:"error",msg:"内部已调用loadCoreCode, 无需重复调用"})]):(e=window,r=window,[4,(0,dynamicImport_1.dynamicImport)("jquery")]);case 1:return e.$=r.jQuery=i.sent(),window.MxDocumentReady=void 0,window.MxUiMain=function(e){var t=e("./MxFun").MxFun;store_1.default.commit("setMxFun",t),store_1.default.events.emit("MxUiMain",e),window.MxUiMain=void 0},window.MxMain=function(e){return store_1.default.events.emit("MxMain",e),window.MxMain=void 0,rxInitMxEntity(),t(),0},(0,mxcadassembly_es5_js_1.default)().then(function(e){store_1.default.commit("setMxassembly",e)}),(0,mxfun_es5_js_1.default)(),[3,3];case 2:return o=i.sent(),n({code:"error",msg:o}),[3,3];case 3:return[2]}})})})]})})}exports.default=loadCoreCode;
|
|
@@ -1,317 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MxVueInterface = void 0;
|
|
4
|
-
var store_1 = require("../store/store");
|
|
5
|
-
var MxVueComandLine = /** @class */ (function () {
|
|
6
|
-
function MxVueComandLine() {
|
|
7
|
-
var _this = this;
|
|
8
|
-
// 命令行
|
|
9
|
-
this.msCmdText = '';
|
|
10
|
-
this.msCmdDisplay = '';
|
|
11
|
-
this.msCmdTip = '';
|
|
12
|
-
this.mUpDisplayFun = undefined;
|
|
13
|
-
this.mxFunObject = undefined;
|
|
14
|
-
// 命令行更新
|
|
15
|
-
this.mountUpDisplayFun = function (fun) {
|
|
16
|
-
_this.mUpDisplayFun = fun;
|
|
17
|
-
};
|
|
18
|
-
this.setCmdText = function (str) {
|
|
19
|
-
console.log(str);
|
|
20
|
-
_this.msCmdText = str;
|
|
21
|
-
};
|
|
22
|
-
this.getCmdText = function () {
|
|
23
|
-
return _this.msCmdText;
|
|
24
|
-
};
|
|
25
|
-
this.getCmdDisplay = function () {
|
|
26
|
-
return _this.msCmdDisplay;
|
|
27
|
-
};
|
|
28
|
-
this.setCmdDisplay = function (str) {
|
|
29
|
-
// console.log(str)
|
|
30
|
-
_this.msCmdDisplay = str;
|
|
31
|
-
store_1.default.commit('setMsCmdDisplay', _this.msCmdDisplay);
|
|
32
|
-
};
|
|
33
|
-
this.addCmdDisplay = function (str) {
|
|
34
|
-
if (_this.msCmdDisplay.length > 1024) {
|
|
35
|
-
_this.msCmdDisplay = _this.msCmdDisplay.substring(_this.msCmdDisplay.length - 1024, _this.msCmdDisplay.length);
|
|
36
|
-
_this.msCmdDisplay = _this.msCmdDisplay + str;
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
_this.msCmdDisplay = _this.msCmdDisplay + str;
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
this.setCmdTip = function (str) {
|
|
43
|
-
_this.msCmdTip = str;
|
|
44
|
-
};
|
|
45
|
-
this.getCmdTip = function () {
|
|
46
|
-
return _this.msCmdTip;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
MxVueComandLine.prototype.upDisplay = function () {
|
|
50
|
-
var _a = this, msCmdTip = _a.msCmdTip, msCmdDisplay = _a.msCmdDisplay, msCmdText = _a.msCmdText;
|
|
51
|
-
if (this.mUpDisplayFun == undefined) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
this.mUpDisplayFun({
|
|
55
|
-
msCmdTip: msCmdTip,
|
|
56
|
-
msCmdDisplay: msCmdDisplay,
|
|
57
|
-
msCmdText: msCmdText
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
return MxVueComandLine;
|
|
61
|
-
}());
|
|
62
|
-
var MxInputType = {
|
|
63
|
-
kNoInput: 0,
|
|
64
|
-
kXYCoordInput: 1,
|
|
65
|
-
kDistanceInput: 2,
|
|
66
|
-
kDynTip: 3
|
|
67
|
-
};
|
|
68
|
-
var MxInputPostionType = {
|
|
69
|
-
kRelative: 0,
|
|
70
|
-
kAbsolutely: 1 // 绝对位置,指定位置。
|
|
71
|
-
};
|
|
72
|
-
var MxDynamicInput = /** @class */ (function () {
|
|
73
|
-
function MxDynamicInput() {
|
|
74
|
-
var _this = this;
|
|
75
|
-
this.mType = MxInputType.kNoInput;
|
|
76
|
-
this.mPos = [0, 0];
|
|
77
|
-
this.mTip = '';
|
|
78
|
-
this.mValue1 = '';
|
|
79
|
-
this.mValue1Pos = [0, 0];
|
|
80
|
-
this.mValue2 = '';
|
|
81
|
-
this.mValue2Pos = [0, 0];
|
|
82
|
-
this.misShow = false;
|
|
83
|
-
this.mOnKeydownEvent = undefined;
|
|
84
|
-
this.mFocusValue = '';
|
|
85
|
-
this.setFocusValue = function (value) {
|
|
86
|
-
_this.mFocusValue = value;
|
|
87
|
-
};
|
|
88
|
-
this.getFocusValue = function () {
|
|
89
|
-
return _this.mFocusValue;
|
|
90
|
-
};
|
|
91
|
-
this.mountKeydownEvent = function (fun) {
|
|
92
|
-
_this.mOnKeydownEvent = fun;
|
|
93
|
-
};
|
|
94
|
-
this.onKeydown = function (keyCode) {
|
|
95
|
-
if (_this.mOnKeydownEvent == undefined) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
_this.mOnKeydownEvent(keyCode);
|
|
99
|
-
};
|
|
100
|
-
this.setType = function (type) {
|
|
101
|
-
_this.mType = type;
|
|
102
|
-
};
|
|
103
|
-
this.getType = function () {
|
|
104
|
-
return _this.mType;
|
|
105
|
-
};
|
|
106
|
-
this.isShow = function () {
|
|
107
|
-
return _this.misShow;
|
|
108
|
-
};
|
|
109
|
-
this.setPos = function (pos) {
|
|
110
|
-
_this.mPos = pos;
|
|
111
|
-
};
|
|
112
|
-
this.setTip = function (tip) {
|
|
113
|
-
_this.mTip = tip;
|
|
114
|
-
};
|
|
115
|
-
this.setValue1 = function (val) {
|
|
116
|
-
_this.mValue1 = val;
|
|
117
|
-
};
|
|
118
|
-
this.getValue1 = function () {
|
|
119
|
-
return _this.mValue1;
|
|
120
|
-
};
|
|
121
|
-
this.setValue1Pos = function (pos) {
|
|
122
|
-
_this.mValue1Pos = pos;
|
|
123
|
-
};
|
|
124
|
-
this.setValue2 = function (val) {
|
|
125
|
-
_this.mValue2 = val;
|
|
126
|
-
};
|
|
127
|
-
this.getValue2 = function () {
|
|
128
|
-
return _this.mValue2;
|
|
129
|
-
};
|
|
130
|
-
this.setValue2Pos = function (pos) {
|
|
131
|
-
_this.mValue2Pos = pos;
|
|
132
|
-
};
|
|
133
|
-
this.setShow = function (isShow) {
|
|
134
|
-
_this.misShow = isShow;
|
|
135
|
-
};
|
|
136
|
-
this.getData = function () {
|
|
137
|
-
if (!_this.misShow) {
|
|
138
|
-
return undefined;
|
|
139
|
-
}
|
|
140
|
-
var ret = {
|
|
141
|
-
list: [
|
|
142
|
-
{ value: '', readonly: true },
|
|
143
|
-
{ value: '', readonly: false },
|
|
144
|
-
{ value: '', readonly: false }
|
|
145
|
-
],
|
|
146
|
-
pos: _this.mPos,
|
|
147
|
-
postype: MxInputPostionType.kRelative
|
|
148
|
-
};
|
|
149
|
-
if (_this.mType == MxInputType.kNoInput) {
|
|
150
|
-
return undefined;
|
|
151
|
-
}
|
|
152
|
-
else if (_this.mType == MxInputType.kXYCoordInput) {
|
|
153
|
-
ret.list[0].show = true;
|
|
154
|
-
ret.list[0].value = _this.mTip;
|
|
155
|
-
ret.list[0].readonly = true;
|
|
156
|
-
ret.list[1].show = true;
|
|
157
|
-
ret.list[1].value = _this.mValue1;
|
|
158
|
-
ret.list[1].readonly = false;
|
|
159
|
-
ret.list[2].show = true;
|
|
160
|
-
ret.list[2].value = _this.mValue2;
|
|
161
|
-
ret.list[2].readonly = false;
|
|
162
|
-
}
|
|
163
|
-
else if (_this.mType == MxInputType.kDistanceInput) {
|
|
164
|
-
ret.list[0].show = true;
|
|
165
|
-
ret.list[0].value = _this.mTip;
|
|
166
|
-
ret.list[0].readonly = true;
|
|
167
|
-
ret.list[1].show = true;
|
|
168
|
-
ret.list[1].value = _this.mValue1;
|
|
169
|
-
ret.list[1].readonly = false;
|
|
170
|
-
ret.list[1].pos = _this.mValue1Pos;
|
|
171
|
-
ret.list[2].show = true;
|
|
172
|
-
ret.list[2].value = _this.mValue2;
|
|
173
|
-
ret.list[2].readonly = true;
|
|
174
|
-
ret.list[2].pos = _this.mValue2Pos;
|
|
175
|
-
ret.postype = MxInputPostionType.kAbsolutely;
|
|
176
|
-
}
|
|
177
|
-
else if (_this.mType == MxInputType.kDynTip) {
|
|
178
|
-
ret.list[0].show = true;
|
|
179
|
-
ret.list[0].value = _this.mTip;
|
|
180
|
-
ret.list[0].readonly = true;
|
|
181
|
-
ret.list[1].show = false;
|
|
182
|
-
ret.list[2].show = false;
|
|
183
|
-
}
|
|
184
|
-
else {
|
|
185
|
-
ret = undefined;
|
|
186
|
-
}
|
|
187
|
-
return ret;
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
return MxDynamicInput;
|
|
191
|
-
}());
|
|
192
|
-
var CursorType = {
|
|
193
|
-
kNormal: 'cursor3',
|
|
194
|
-
kRect: 'cursor1',
|
|
195
|
-
kCross: 'cursor2'
|
|
196
|
-
};
|
|
197
|
-
var MxVueInterface = /** @class */ (function () {
|
|
198
|
-
function MxVueInterface() {
|
|
199
|
-
var _this = this;
|
|
200
|
-
this.mSetCoordFun = undefined;
|
|
201
|
-
this.mUpdateCursorFun = undefined;
|
|
202
|
-
this.mOnKeydownEvent = undefined;
|
|
203
|
-
this.mCursorType = CursorType.kNormal;
|
|
204
|
-
this.mComandLine = new MxVueComandLine();
|
|
205
|
-
this.mdynamicInput = new MxDynamicInput();
|
|
206
|
-
this.mMxEvents = {};
|
|
207
|
-
this.mountSetCoordFun = function (fun) {
|
|
208
|
-
_this.mSetCoordFun = fun;
|
|
209
|
-
};
|
|
210
|
-
this.mountUpdateCursorFun = function (fun) {
|
|
211
|
-
_this.mUpdateCursorFun = fun;
|
|
212
|
-
};
|
|
213
|
-
this.mountKeydownEvent = function (fun) {
|
|
214
|
-
_this.mOnKeydownEvent = fun;
|
|
215
|
-
};
|
|
216
|
-
this.onKeydown = function (keyCode) {
|
|
217
|
-
if (_this.mOnKeydownEvent == undefined) {
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
_this.mOnKeydownEvent(keyCode);
|
|
221
|
-
};
|
|
222
|
-
this.setTipCoord = function (str) {
|
|
223
|
-
store_1.default.commit('setTipCoord', str);
|
|
224
|
-
if (_this.mSetCoordFun == undefined) {
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
_this.mSetCoordFun(str);
|
|
228
|
-
};
|
|
229
|
-
this.getCursorType = function () {
|
|
230
|
-
return _this.mCursorType;
|
|
231
|
-
};
|
|
232
|
-
this.setCursorType = function (curtype) {
|
|
233
|
-
if (typeof curtype == 'number') {
|
|
234
|
-
switch (curtype) {
|
|
235
|
-
case 0: {
|
|
236
|
-
_this.mCursorType = CursorType.kNormal;
|
|
237
|
-
break;
|
|
238
|
-
}
|
|
239
|
-
case 1: {
|
|
240
|
-
_this.mCursorType = CursorType.kRect;
|
|
241
|
-
break;
|
|
242
|
-
}
|
|
243
|
-
case 2: {
|
|
244
|
-
_this.mCursorType = CursorType.kCross;
|
|
245
|
-
break;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
else {
|
|
250
|
-
_this.mCursorType = curtype;
|
|
251
|
-
}
|
|
252
|
-
if (_this.mUpdateCursorFun == undefined) {
|
|
253
|
-
return;
|
|
254
|
-
}
|
|
255
|
-
_this.mUpdateCursorFun();
|
|
256
|
-
};
|
|
257
|
-
this.getTitle = function () {
|
|
258
|
-
return _this.mTitle;
|
|
259
|
-
};
|
|
260
|
-
this.getTopButtonBarData = function () {
|
|
261
|
-
return _this.mTopButtonBarData;
|
|
262
|
-
};
|
|
263
|
-
this.getMenuBarData = function () {
|
|
264
|
-
return _this.mMenuBarData;
|
|
265
|
-
};
|
|
266
|
-
this.getRighButtonBarData = function () {
|
|
267
|
-
return _this.mRighButtonBarData;
|
|
268
|
-
};
|
|
269
|
-
this.getLeftButtonBarData = function () {
|
|
270
|
-
return _this.mLeftButtonBarData;
|
|
271
|
-
};
|
|
272
|
-
this.getTitleButtonBarData = function () {
|
|
273
|
-
return _this.mTitleButtonBarData;
|
|
274
|
-
};
|
|
275
|
-
this.getLayerComboxData = function () {
|
|
276
|
-
return _this.mLayerComboxData;
|
|
277
|
-
};
|
|
278
|
-
this.getColorComboxData = function () {
|
|
279
|
-
return _this.mColorComboxData;
|
|
280
|
-
};
|
|
281
|
-
this.getLinetypeComboxData = function () {
|
|
282
|
-
return _this.mLinetypeComboxData;
|
|
283
|
-
};
|
|
284
|
-
this.getFooterData = function () {
|
|
285
|
-
return _this.mFooterData;
|
|
286
|
-
};
|
|
287
|
-
this.sendStringToExecute = function (sCmd) {
|
|
288
|
-
_this.mxFunObject.sendStringToExecute(sCmd);
|
|
289
|
-
};
|
|
290
|
-
this.getCmdLine = function () {
|
|
291
|
-
return _this.mComandLine;
|
|
292
|
-
};
|
|
293
|
-
this.getDynamicInput = function () {
|
|
294
|
-
return _this.mdynamicInput;
|
|
295
|
-
};
|
|
296
|
-
this.init = function (mxFun) {
|
|
297
|
-
_this.mxFunObject = mxFun;
|
|
298
|
-
};
|
|
299
|
-
this.OnMxEvent = function (event) {
|
|
300
|
-
var eventName = event.name;
|
|
301
|
-
if (eventName == undefined) {
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
var call = _this.mMxEvents[eventName];
|
|
305
|
-
if (call == undefined) {
|
|
306
|
-
return;
|
|
307
|
-
}
|
|
308
|
-
call(event.param);
|
|
309
|
-
};
|
|
310
|
-
this.mountMxEvent = function (name, call) {
|
|
311
|
-
_this.mMxEvents[name] = call;
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
|
-
return MxVueInterface;
|
|
315
|
-
}());
|
|
316
|
-
exports.MxVueInterface = MxVueInterface;
|
|
317
|
-
exports.default = new MxVueInterface();
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MxVueInterface=void 0;var MxVueComandLine=function(){function t(){var t=this;this.msCmdText="",this.msCmdDisplay="",this.msCmdTip="",this.mUpDisplayFun=void 0,this.mxFunObject=void 0,this.mountUpDisplayFun=function(n){t.mUpDisplayFun=n},this.setCmdText=function(n){t.msCmdText=n},this.getCmdText=function(){return t.msCmdText},this.getCmdDisplay=function(){return t.msCmdDisplay},this.setCmdDisplay=function(n){t.msCmdDisplay=n},this.addCmdDisplay=function(n){t.msCmdDisplay.length>1024?(t.msCmdDisplay=t.msCmdDisplay.substring(t.msCmdDisplay.length-1024,t.msCmdDisplay.length),t.msCmdDisplay=t.msCmdDisplay+n):t.msCmdDisplay=t.msCmdDisplay+n},this.setCmdTip=function(n){t.msCmdTip=n},this.getCmdTip=function(){return t.msCmdTip}}return t.prototype.upDisplay=function(){var t=this.msCmdTip,n=this.msCmdDisplay,e=this.msCmdText;void 0!=this.mUpDisplayFun&&this.mUpDisplayFun({msCmdTip:t,msCmdDisplay:n,msCmdText:e})},t}(),MxInputType={kNoInput:0,kXYCoordInput:1,kDistanceInput:2,kDynTip:3},MxInputPostionType={kRelative:0,kAbsolutely:1},MxDynamicInput=function(){return function(){var t=this;this.mType=MxInputType.kNoInput,this.mPos=[0,0],this.mTip="",this.mValue1="",this.mValue1Pos=[0,0],this.mValue2="",this.mValue2Pos=[0,0],this.misShow=!1,this.mOnKeydownEvent=void 0,this.mFocusValue="",this.setFocusValue=function(n){t.mFocusValue=n},this.getFocusValue=function(){return t.mFocusValue},this.mountKeydownEvent=function(n){t.mOnKeydownEvent=n},this.onKeydown=function(n){void 0!=t.mOnKeydownEvent&&t.mOnKeydownEvent(n)},this.setType=function(n){t.mType=n},this.getType=function(){return t.mType},this.isShow=function(){return t.misShow},this.setPos=function(n){t.mPos=n},this.setTip=function(n){t.mTip=n},this.setValue1=function(n){t.mValue1=n},this.getValue1=function(){return t.mValue1},this.setValue1Pos=function(n){t.mValue1Pos=n},this.setValue2=function(n){t.mValue2=n},this.getValue2=function(){return t.mValue2},this.setValue2Pos=function(n){t.mValue2Pos=n},this.setShow=function(n){t.misShow=n},this.getData=function(){if(t.misShow){var n={list:[{value:"",readonly:!0},{value:"",readonly:!1},{value:"",readonly:!1}],pos:t.mPos,postype:MxInputPostionType.kRelative};if(t.mType!=MxInputType.kNoInput)return t.mType==MxInputType.kXYCoordInput?(n.list[0].show=!0,n.list[0].value=t.mTip,n.list[0].readonly=!0,n.list[1].show=!0,n.list[1].value=t.mValue1,n.list[1].readonly=!1,n.list[2].show=!0,n.list[2].value=t.mValue2,n.list[2].readonly=!1):t.mType==MxInputType.kDistanceInput?(n.list[0].show=!0,n.list[0].value=t.mTip,n.list[0].readonly=!0,n.list[1].show=!0,n.list[1].value=t.mValue1,n.list[1].readonly=!1,n.list[1].pos=t.mValue1Pos,n.list[2].show=!0,n.list[2].value=t.mValue2,n.list[2].readonly=!0,n.list[2].pos=t.mValue2Pos,n.postype=MxInputPostionType.kAbsolutely):t.mType==MxInputType.kDynTip?(n.list[0].show=!0,n.list[0].value=t.mTip,n.list[0].readonly=!0,n.list[1].show=!1,n.list[2].show=!1):n=void 0,n}}}}(),CursorType={kNormal:"cursor3",kRect:"cursor1",kCross:"cursor2"},MxVueInterface=function(){return function(){var t=this;this.mSetCoordFun=void 0,this.mUpdateCursorFun=void 0,this.mOnKeydownEvent=void 0,this.mCursorType=CursorType.kNormal,this.mComandLine=new MxVueComandLine,this.mdynamicInput=new MxDynamicInput,this.mMxEvents={},this.mountSetCoordFun=function(n){t.mSetCoordFun=n},this.mountUpdateCursorFun=function(n){t.mUpdateCursorFun=n},this.mountKeydownEvent=function(n){t.mOnKeydownEvent=n},this.onKeydown=function(n){void 0!=t.mOnKeydownEvent&&t.mOnKeydownEvent(n)},this.setTipCoord=function(n){void 0!=t.mSetCoordFun&&t.mSetCoordFun(n)},this.getCursorType=function(){return t.mCursorType},this.setCursorType=function(n){if("number"==typeof n)switch(n){case 0:t.mCursorType=CursorType.kNormal;break;case 1:t.mCursorType=CursorType.kRect;break;case 2:t.mCursorType=CursorType.kCross}else t.mCursorType=n;void 0!=t.mUpdateCursorFun&&t.mUpdateCursorFun()},this.getTitle=function(){return t.mTitle},this.getTopButtonBarData=function(){return t.mTopButtonBarData},this.getMenuBarData=function(){return t.mMenuBarData},this.getRighButtonBarData=function(){return t.mRighButtonBarData},this.getLeftButtonBarData=function(){return t.mLeftButtonBarData},this.getTitleButtonBarData=function(){return t.mTitleButtonBarData},this.getLayerComboxData=function(){return t.mLayerComboxData},this.getColorComboxData=function(){return t.mColorComboxData},this.getLinetypeComboxData=function(){return t.mLinetypeComboxData},this.getFooterData=function(){return t.mFooterData},this.sendStringToExecute=function(n){t.mxFunObject.sendStringToExecute(n)},this.getCmdLine=function(){return t.mComandLine},this.getDynamicInput=function(){return t.mdynamicInput},this.init=function(n){t.mxFunObject=n},this.OnMxEvent=function(n){var e=n.name;if(void 0!=e){var i=t.mMxEvents[e];void 0!=i&&i(n.param)}},this.mountMxEvent=function(n,e){t.mMxEvents[n]=e}}}();exports.MxVueInterface=MxVueInterface,exports.default=new MxVueInterface;
|