mxdraw 0.1.9 → 0.1.12

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.
Files changed (28) hide show
  1. package/dist/lib/MxModule/MxDbEntity/MxDbEntity.js +28 -0
  2. package/dist/lib/MxModule/MxDbImage/MxDbImage.js +2 -1
  3. package/dist/lib/MxModule/MxDbSVG/MxDbSVG.js +185 -41
  4. package/dist/lib/MxModule/MxDbSVGText/MxDbSVGText.js +3 -0
  5. package/dist/lib/MxModule/MxDrawObject/MxDrawObject.js +74 -2
  6. package/dist/lib/MxModule/MxFun/MxFun.js +51 -2
  7. package/dist/lib/MxModule/MxThreeJS/MxThreeJS.js +5 -1
  8. package/dist/lib/MxModule/MxThreeJS/MxThreeJS.mixin.js +15 -3
  9. package/dist/lib/MxModule/loadCoreCode/loadCoreCode.js +9 -10
  10. package/dist/lib/MxModule/loadCoreCode/mxUiData.js +317 -0
  11. package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +174 -55
  12. package/dist/lib/tools/dynamicImport/index.js +45 -1
  13. package/dist/mxdraw.es5.js +2 -2
  14. package/dist/mxdraw.es5.js.map +1 -1
  15. package/dist/mxdraw.umd.js +2 -2
  16. package/dist/mxdraw.umd.js.map +1 -1
  17. package/dist/types/MxModule/McGiWorldDraw/McGiWorldDraw.d.ts +1 -1
  18. package/dist/types/MxModule/MxDbEntity/MxDbEntity.d.ts +21 -0
  19. package/dist/types/MxModule/MxDbSVG/MxDbSVG.d.ts +8 -0
  20. package/dist/types/MxModule/MxDbSVGText/MxDbSVGText.d.ts +3 -0
  21. package/dist/types/MxModule/MxDrawObject/MxDrawObject.d.ts +12 -1
  22. package/dist/types/MxModule/MxFun/MxFun.d.ts +13 -1
  23. package/dist/types/MxModule/MxThreeJS/MxThreeJS.d.ts +1 -1
  24. package/dist/types/MxModule/loadCoreCode/mxUiData.d.ts +111 -0
  25. package/dist/types/tools/dynamicImport/index.d.ts +1 -0
  26. package/dist/types/types/MxDrawObject.d.ts +2 -1
  27. package/dist/types/types/MxFun.d.ts +2 -1
  28. package/package.json +1 -1
@@ -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();