mxdraw 0.1.10 → 0.1.11
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/MxDbSVG/MxDbSVG.js +7 -3
- package/dist/lib/MxModule/MxDrawObject/MxDrawObject.js +74 -2
- package/dist/lib/MxModule/MxFun/MxFun.js +3 -2
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.js +5 -1
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.mixin.js +13 -1
- package/dist/lib/MxModule/loadCoreCode/loadCoreCode.js +9 -10
- package/dist/lib/MxModule/loadCoreCode/mxUiData.js +317 -0
- package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +170 -51
- package/dist/lib/tools/dynamicImport/index.js +45 -1
- package/dist/mxdraw.es5.js +2 -2
- package/dist/mxdraw.es5.js.map +1 -1
- package/dist/mxdraw.umd.js +2 -2
- package/dist/mxdraw.umd.js.map +1 -1
- package/dist/types/MxModule/MxDbSVG/MxDbSVG.d.ts +1 -0
- package/dist/types/MxModule/MxDrawObject/MxDrawObject.d.ts +12 -1
- package/dist/types/MxModule/MxFun/MxFun.d.ts +1 -1
- package/dist/types/MxModule/MxThreeJS/MxThreeJS.d.ts +1 -1
- package/dist/types/MxModule/loadCoreCode/mxUiData.d.ts +111 -0
- package/dist/types/tools/dynamicImport/index.d.ts +1 -0
- package/dist/types/types/MxDrawObject.d.ts +2 -1
- package/dist/types/types/MxFun.d.ts +2 -1
- package/package.json +1 -1
|
@@ -45,6 +45,7 @@ var MxDbSVG = /** @class */ (function (_super) {
|
|
|
45
45
|
_this.svgBoxSize = null;
|
|
46
46
|
// 固定尺寸,图片和文字大小,取屏幕像素绘图单位。
|
|
47
47
|
_this.fixedSize = false;
|
|
48
|
+
_this.useSvgColor = false;
|
|
48
49
|
return _this;
|
|
49
50
|
}
|
|
50
51
|
MxDbSVG.prototype.worldDraw = function (pWorldDraw) {
|
|
@@ -120,12 +121,13 @@ var MxDbSVG = /** @class */ (function (_super) {
|
|
|
120
121
|
obj.scale.z = obj.scale.x;
|
|
121
122
|
obj.rotateZ(myThis_1.svgRotate);
|
|
122
123
|
myThis_1.isSvgDirtyLocation = true;
|
|
123
|
-
var color_1 = new THREE.Color(
|
|
124
|
+
var color_1 = new THREE.Color(pWorldDraw.getColor());
|
|
124
125
|
obj.traverse(function (child) {
|
|
125
126
|
if (child.material) {
|
|
126
127
|
child.material = child.material.clone();
|
|
127
128
|
child.material.transparent = true;
|
|
128
|
-
|
|
129
|
+
if (!myThis_1.useSvgColor)
|
|
130
|
+
child.material.color = color_1;
|
|
129
131
|
}
|
|
130
132
|
});
|
|
131
133
|
//this.svgPos.multiply
|
|
@@ -157,7 +159,7 @@ var MxDbSVG = /** @class */ (function (_super) {
|
|
|
157
159
|
return this.svgPath;
|
|
158
160
|
};
|
|
159
161
|
MxDbSVG.prototype.setSvgPostion = function (pos) {
|
|
160
|
-
this.svgPos = pos;
|
|
162
|
+
this.svgPos = pos.clone();
|
|
161
163
|
this.isSvgDirtyLocation = true;
|
|
162
164
|
};
|
|
163
165
|
MxDbSVG.prototype.getSvgPostion = function () {
|
|
@@ -248,6 +250,7 @@ var MxDbSVG = /** @class */ (function (_super) {
|
|
|
248
250
|
_this.aryText.push(copyTxt);
|
|
249
251
|
});
|
|
250
252
|
this.svgRotate = obj['svgRotate'];
|
|
253
|
+
this.useSvgColor = obj['useSvgColor'];
|
|
251
254
|
return true;
|
|
252
255
|
};
|
|
253
256
|
MxDbSVG.prototype.dwgOut = function (obj) {
|
|
@@ -262,6 +265,7 @@ var MxDbSVG = /** @class */ (function (_super) {
|
|
|
262
265
|
obj['txts'] = this.aryText;
|
|
263
266
|
obj['fixedSize'] = this.fixedSize;
|
|
264
267
|
obj['svgRotate'] = this.svgRotate;
|
|
268
|
+
obj['useSvgColor'] = this.useSvgColor;
|
|
265
269
|
return obj;
|
|
266
270
|
};
|
|
267
271
|
MxDbSVG.prototype.create = function () {
|
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/** @module MxDrawObject */
|
|
3
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
13
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
14
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
15
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
16
|
+
function step(op) {
|
|
17
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
18
|
+
while (_) try {
|
|
19
|
+
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;
|
|
20
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
21
|
+
switch (op[0]) {
|
|
22
|
+
case 0: case 1: t = op; break;
|
|
23
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
24
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
25
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
26
|
+
default:
|
|
27
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
28
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
29
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
30
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
31
|
+
if (t[2]) _.ops.pop();
|
|
32
|
+
_.trys.pop(); continue;
|
|
33
|
+
}
|
|
34
|
+
op = body.call(thisArg, _);
|
|
35
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
36
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
37
|
+
}
|
|
38
|
+
};
|
|
3
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
var MxThreeJS_1 = require("../MxThreeJS");
|
|
4
41
|
/**
|
|
5
42
|
* 引入mxdraw库不会挂载MxDrawObject 只能在以下特定函数中获取
|
|
6
43
|
* @function
|
|
@@ -661,8 +698,30 @@ var MxDrawObject = /** @class */ (function () {
|
|
|
661
698
|
*
|
|
662
699
|
* ```
|
|
663
700
|
*/
|
|
664
|
-
MxDrawObject.prototype.loadMxEntityFromJson = function (dataString) {
|
|
665
|
-
|
|
701
|
+
MxDrawObject.prototype.loadMxEntityFromJson = function (dataString, aryPreloadSVG) {
|
|
702
|
+
if (aryPreloadSVG === void 0) { aryPreloadSVG = null; }
|
|
703
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
704
|
+
var iLen, i;
|
|
705
|
+
return __generator(this, function (_a) {
|
|
706
|
+
switch (_a.label) {
|
|
707
|
+
case 0:
|
|
708
|
+
if (!aryPreloadSVG) return [3 /*break*/, 4];
|
|
709
|
+
iLen = aryPreloadSVG.length;
|
|
710
|
+
i = 0;
|
|
711
|
+
_a.label = 1;
|
|
712
|
+
case 1:
|
|
713
|
+
if (!(i < iLen)) return [3 /*break*/, 4];
|
|
714
|
+
return [4 /*yield*/, MxThreeJS_1.default.loadSVG(aryPreloadSVG[i])];
|
|
715
|
+
case 2:
|
|
716
|
+
_a.sent();
|
|
717
|
+
_a.label = 3;
|
|
718
|
+
case 3:
|
|
719
|
+
i++;
|
|
720
|
+
return [3 /*break*/, 1];
|
|
721
|
+
case 4: return [2 /*return*/, this._mxdrawObj.loadMxEntityFromJson(dataString)];
|
|
722
|
+
}
|
|
723
|
+
});
|
|
724
|
+
});
|
|
666
725
|
};
|
|
667
726
|
/**
|
|
668
727
|
* 删除所有对MxEntity
|
|
@@ -677,6 +736,19 @@ var MxDrawObject = /** @class */ (function () {
|
|
|
677
736
|
MxDrawObject.prototype.eraseAllMxEntity = function () {
|
|
678
737
|
return this._mxdrawObj.eraseAllMxEntity();
|
|
679
738
|
};
|
|
739
|
+
/**
|
|
740
|
+
* 把该控件对象,设置成当前控件.
|
|
741
|
+
* @param
|
|
742
|
+
* @returns
|
|
743
|
+
* @example
|
|
744
|
+
* ```typescript
|
|
745
|
+
*
|
|
746
|
+
*
|
|
747
|
+
* ```
|
|
748
|
+
*/
|
|
749
|
+
MxDrawObject.prototype.makeCurrent = function () {
|
|
750
|
+
this._mxdrawObj.makeCurrent();
|
|
751
|
+
};
|
|
680
752
|
return MxDrawObject;
|
|
681
753
|
}());
|
|
682
754
|
exports.default = MxDrawObject;
|
|
@@ -561,8 +561,9 @@ var MxFun = /** @class */ (function () {
|
|
|
561
561
|
* ``` typescript
|
|
562
562
|
* ```
|
|
563
563
|
*/
|
|
564
|
-
MxFun.prototype.openFile = function (sFile) {
|
|
565
|
-
|
|
564
|
+
MxFun.prototype.openFile = function (sFile, useWebsocket) {
|
|
565
|
+
if (useWebsocket === void 0) { useWebsocket = false; }
|
|
566
|
+
return store_1.default.state.MxFun.openFile(sFile, useWebsocket);
|
|
566
567
|
};
|
|
567
568
|
/**
|
|
568
569
|
* 添加一个MxDbEntity实体到当前绘图对象上。
|
|
@@ -273,7 +273,11 @@ var MxThreeJS = /** @class */ (function () {
|
|
|
273
273
|
* })
|
|
274
274
|
* ```
|
|
275
275
|
*/
|
|
276
|
-
MxThreeJS.prototype.loadSVG = function (url, color, callResult) {
|
|
276
|
+
MxThreeJS.prototype.loadSVG = function (url, color, callResult) {
|
|
277
|
+
return new Promise(function (resolve) {
|
|
278
|
+
resolve(null);
|
|
279
|
+
});
|
|
280
|
+
};
|
|
277
281
|
return MxThreeJS;
|
|
278
282
|
}());
|
|
279
283
|
exports.default = MxThreeJS;
|
|
@@ -128,7 +128,19 @@ function default_1(MxThreeJS) {
|
|
|
128
128
|
});
|
|
129
129
|
};
|
|
130
130
|
MxThreeJS.loadSVG = function (url, color, callResult) {
|
|
131
|
-
|
|
131
|
+
if (callResult) {
|
|
132
|
+
mxThreeJsBuffer.loadSVG(url, color, callResult);
|
|
133
|
+
return new Promise(function (resolve) {
|
|
134
|
+
resolve(null);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
return new Promise(function (resolve) {
|
|
139
|
+
mxThreeJsBuffer.loadSVG(url, color, function (threeobj) {
|
|
140
|
+
resolve(threeobj);
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
}
|
|
132
144
|
};
|
|
133
145
|
}
|
|
134
146
|
exports.default = default_1;
|
|
@@ -41,17 +41,16 @@ var dynamicImport_1 = require("../../tools/dynamicImport");
|
|
|
41
41
|
var store_1 = require("../store/store");
|
|
42
42
|
var mxfun_es5_js_1 = require("./mxfun.es5.js");
|
|
43
43
|
var mxcadassembly_es5_js_1 = require("./mxcadassembly_es5.js");
|
|
44
|
-
var MxDbImage_1 = require("../MxDbImage");
|
|
45
|
-
var MxDbSVG_1 = require("../MxDbSVG");
|
|
46
|
-
var MxDbAlignedDimension_1 = require("../MxDbAlignedDimension");
|
|
47
|
-
var MxDbLine_1 = require("../MxDbLine");
|
|
48
|
-
var MxDbRect_1 = require("../MxDbRect");
|
|
49
44
|
function rxInitMxEntity() {
|
|
50
|
-
|
|
51
|
-
new
|
|
52
|
-
new
|
|
53
|
-
new
|
|
54
|
-
new
|
|
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);
|
|
55
54
|
}
|
|
56
55
|
/**
|
|
57
56
|
* 加载MxDraw库的核心代码 才能使用Mx的其他模块
|
|
@@ -0,0 +1,317 @@
|
|
|
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();
|