@cpzxrobot/sdk 1.2.50 → 1.2.52
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/index.js +41 -16
- package/index.ts +20 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
@@ -392,22 +415,24 @@ class Cpzxrobot {
|
|
|
392
415
|
}
|
|
393
416
|
this.resolveReady(this.axios);
|
|
394
417
|
});
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
418
|
+
//@ts-ignore
|
|
419
|
+
Promise.resolve().then(() => __importStar(require('https://www.cpzxrobot.com/webc/factory-selector.js'))).then(() => {
|
|
420
|
+
//insert cpzxrobot_factory_selector into body
|
|
421
|
+
const div = document.createElement('cpzxrobot-factory-selector');
|
|
422
|
+
div.setAttribute('selector-style', 'float-button');
|
|
423
|
+
document.body.appendChild(div);
|
|
424
|
+
//register onUnitChanged and onFactoryChanged on div
|
|
425
|
+
div.addEventListener('unitChanged', function (e) {
|
|
426
|
+
// @ts-ignore
|
|
427
|
+
window._notifyUnitChanged(e.detail);
|
|
428
|
+
});
|
|
429
|
+
div.addEventListener('factoryChanged', function (e) {
|
|
430
|
+
// @ts-ignore
|
|
431
|
+
window._notifyFactoryChanged(e.detail);
|
|
432
|
+
});
|
|
433
|
+
})
|
|
434
|
+
.catch(err => {
|
|
435
|
+
console.error('Failed to load factory-selector module:', err);
|
|
411
436
|
});
|
|
412
437
|
return;
|
|
413
438
|
}
|
package/index.ts
CHANGED
|
@@ -443,23 +443,26 @@ export class Cpzxrobot {
|
|
|
443
443
|
}
|
|
444
444
|
this.resolveReady(this.axios);
|
|
445
445
|
});
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
446
|
+
//@ts-ignore
|
|
447
|
+
import('https://www.cpzxrobot.com/webc/factory-selector.js')
|
|
448
|
+
.then(() => {
|
|
449
|
+
//insert cpzxrobot_factory_selector into body
|
|
450
|
+
const div = document.createElement('cpzxrobot-factory-selector');
|
|
451
|
+
div.setAttribute('selector-style', 'float-button');
|
|
452
|
+
document.body.appendChild(div);
|
|
453
|
+
//register onUnitChanged and onFactoryChanged on div
|
|
454
|
+
div.addEventListener('unitChanged', function (e) {
|
|
455
|
+
// @ts-ignore
|
|
456
|
+
window._notifyUnitChanged(e.detail);
|
|
457
|
+
});
|
|
458
|
+
div.addEventListener('factoryChanged', function (e) {
|
|
459
|
+
// @ts-ignore
|
|
460
|
+
window._notifyFactoryChanged(e.detail);
|
|
461
|
+
});
|
|
462
|
+
})
|
|
463
|
+
.catch(err => {
|
|
464
|
+
console.error('Failed to load factory-selector module:', err);
|
|
465
|
+
});
|
|
463
466
|
return;
|
|
464
467
|
} else {
|
|
465
468
|
//if url has access_token and app_code, use it
|