@smart100/spu-web-plugin 1.0.25-beta.2 → 1.0.25-beta.4
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/spu-web-plugin.mjs +48 -24
- package/package.json +1 -2
- package/src/map/index.ts +19 -12
- package/src/spuConfig.ts +20 -1
package/dist/spu-web-plugin.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var version = "1.0.25-beta.
|
|
1
|
+
var version = "1.0.25-beta.4";
|
|
2
2
|
|
|
3
3
|
/** Detect free variable `global` from Node.js. */
|
|
4
4
|
var freeGlobal$2 = typeof global == 'object' && global && global.Object === Object && global;
|
|
@@ -17779,7 +17779,8 @@ var getLocationByNative = /*#__PURE__*/function () {
|
|
|
17779
17779
|
district: res.district || '',
|
|
17780
17780
|
street: res.street || '',
|
|
17781
17781
|
number: res.number || '',
|
|
17782
|
-
detailaddr: res.detailaddr || ''
|
|
17782
|
+
detailaddr: res.detailaddr || '',
|
|
17783
|
+
citycode: res.citycode || ''
|
|
17783
17784
|
// poiid: res.poiid || '',
|
|
17784
17785
|
// poitypename: res.poitypename || '',
|
|
17785
17786
|
// poitypecode: res.poitypecode || '',
|
|
@@ -17888,6 +17889,7 @@ var getLocationByAMap = /*#__PURE__*/function () {
|
|
|
17888
17889
|
address: '',
|
|
17889
17890
|
// poiname: '',
|
|
17890
17891
|
regionid: '',
|
|
17892
|
+
citycode: '',
|
|
17891
17893
|
country: '',
|
|
17892
17894
|
province: '',
|
|
17893
17895
|
city: '',
|
|
@@ -17910,12 +17912,13 @@ var getLocationByAMap = /*#__PURE__*/function () {
|
|
|
17910
17912
|
if (addrssDetail) {
|
|
17911
17913
|
result.address = addrssDetail.addressDetail.address;
|
|
17912
17914
|
// result.poiname = addrssDetail.addressDetail.poiname
|
|
17913
|
-
result.regionid = addrssDetail.addressDetail.regionid;
|
|
17914
|
-
result.
|
|
17915
|
-
result.
|
|
17916
|
-
result.
|
|
17917
|
-
result.
|
|
17918
|
-
result.
|
|
17915
|
+
result.regionid = addrssDetail.addressDetail.regionid || '';
|
|
17916
|
+
result.citycode = addrssDetail.addressDetail.citycode || '';
|
|
17917
|
+
result.country = addrssDetail.addressDetail.country || '';
|
|
17918
|
+
result.province = addrssDetail.addressDetail.province || '';
|
|
17919
|
+
result.city = addrssDetail.addressDetail.city || '';
|
|
17920
|
+
result.district = addrssDetail.addressDetail.district || '';
|
|
17921
|
+
result.street = addrssDetail.addressDetail.street || '';
|
|
17919
17922
|
result.number = addrssDetail.addressDetail.number;
|
|
17920
17923
|
result.detailaddr = addrssDetail.addressDetail.detailaddr;
|
|
17921
17924
|
// result.poiid = addrssDetail.addressDetail.poiid
|
|
@@ -17977,6 +17980,7 @@ var getCityLocationByAMap = /*#__PURE__*/function () {
|
|
|
17977
17980
|
address: '',
|
|
17978
17981
|
// poiname: '',
|
|
17979
17982
|
regionid: '',
|
|
17983
|
+
citycode: '',
|
|
17980
17984
|
country: '',
|
|
17981
17985
|
province: '',
|
|
17982
17986
|
city: '',
|
|
@@ -18001,12 +18005,13 @@ var getCityLocationByAMap = /*#__PURE__*/function () {
|
|
|
18001
18005
|
if (addrssDetail) {
|
|
18002
18006
|
result.address = addrssDetail.addressDetail.address;
|
|
18003
18007
|
// result.poiname = addrssDetail.addressDetail.poiname
|
|
18004
|
-
result.regionid = addrssDetail.addressDetail.regionid;
|
|
18005
|
-
result.
|
|
18006
|
-
result.
|
|
18007
|
-
result.
|
|
18008
|
-
result.
|
|
18009
|
-
result.
|
|
18008
|
+
result.regionid = addrssDetail.addressDetail.regionid || '';
|
|
18009
|
+
result.citycode = addrssDetail.addressDetail.citycode || '';
|
|
18010
|
+
result.country = addrssDetail.addressDetail.country || '';
|
|
18011
|
+
result.province = addrssDetail.addressDetail.province || '';
|
|
18012
|
+
result.city = addrssDetail.addressDetail.city || '';
|
|
18013
|
+
result.district = addrssDetail.addressDetail.district || '';
|
|
18014
|
+
result.street = addrssDetail.addressDetail.street || '';
|
|
18010
18015
|
result.number = addrssDetail.addressDetail.number;
|
|
18011
18016
|
result.detailaddr = addrssDetail.addressDetail.detailaddr;
|
|
18012
18017
|
// result.poiid = addrssDetail.addressDetail.poiid
|
|
@@ -18145,6 +18150,7 @@ var getAddressDetailByAMap = /*#__PURE__*/function () {
|
|
|
18145
18150
|
address: address || '',
|
|
18146
18151
|
// poiname: poiname || '',
|
|
18147
18152
|
regionid: addressComponent.adcode || '',
|
|
18153
|
+
citycode: addressComponent.citycode || '',
|
|
18148
18154
|
country: country || '',
|
|
18149
18155
|
province: addressComponent.province || '',
|
|
18150
18156
|
city: addressComponent.city || '',
|
|
@@ -18768,6 +18774,8 @@ var getDistance = /*#__PURE__*/function () {
|
|
|
18768
18774
|
}();
|
|
18769
18775
|
|
|
18770
18776
|
var modulekey = '';
|
|
18777
|
+
var customerid = '';
|
|
18778
|
+
var customertype = '';
|
|
18771
18779
|
var SpuConfig = /*#__PURE__*/function () {
|
|
18772
18780
|
function SpuConfig() {
|
|
18773
18781
|
_classCallCheck$1(this, SpuConfig);
|
|
@@ -18779,40 +18787,54 @@ var SpuConfig = /*#__PURE__*/function () {
|
|
|
18779
18787
|
key: "getFun",
|
|
18780
18788
|
value: function () {
|
|
18781
18789
|
var _getFun = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1().mark(function _callee() {
|
|
18782
|
-
var res, _res$
|
|
18790
|
+
var _res$data, _res$data2, res, _res$data3, _res$data4;
|
|
18783
18791
|
return _regeneratorRuntime$1().wrap(function _callee$(_context) {
|
|
18784
18792
|
while (1) switch (_context.prev = _context.next) {
|
|
18785
18793
|
case 0:
|
|
18786
18794
|
if (this.isload) {
|
|
18787
|
-
_context.next =
|
|
18795
|
+
_context.next = 14;
|
|
18788
18796
|
break;
|
|
18789
18797
|
}
|
|
18790
18798
|
_context.prev = 1;
|
|
18791
18799
|
_context.next = 4;
|
|
18792
18800
|
return spuAxios.post('/lifecycle/getconfigdata', {
|
|
18793
18801
|
// modulekey: 'litheformspu'
|
|
18794
|
-
modulekey: modulekey
|
|
18802
|
+
modulekey: modulekey,
|
|
18803
|
+
customerid: customerid,
|
|
18804
|
+
customertype: customertype
|
|
18795
18805
|
});
|
|
18796
18806
|
case 4:
|
|
18797
18807
|
res = _context.sent;
|
|
18808
|
+
// TODO 9.3.3后 res.data中增加extend字段记录额外的数据,也需要返回,这里需要做一个兼容的数据格式
|
|
18809
|
+
if (!(res !== null && res !== void 0 && (_res$data = res.data) !== null && _res$data !== void 0 && _res$data.configs)) {
|
|
18810
|
+
res.data.configs = [];
|
|
18811
|
+
}
|
|
18812
|
+
if (res !== null && res !== void 0 && (_res$data2 = res.data) !== null && _res$data2 !== void 0 && _res$data2.extend) {
|
|
18813
|
+
res.data.configs.push({
|
|
18814
|
+
descr: 'getconfigdata接口的extend字段信息',
|
|
18815
|
+
dataid: '__system_getconfigdata_extend',
|
|
18816
|
+
type: 'json',
|
|
18817
|
+
context: JSON.stringify((res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.extend) || {})
|
|
18818
|
+
});
|
|
18819
|
+
}
|
|
18798
18820
|
// console.log(res)
|
|
18799
18821
|
// debugger
|
|
18800
18822
|
if (res.code === 200) {
|
|
18801
|
-
this.cache = (res === null || res === void 0 || (_res$
|
|
18823
|
+
this.cache = (res === null || res === void 0 || (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.configs) || [];
|
|
18802
18824
|
}
|
|
18803
|
-
_context.next =
|
|
18825
|
+
_context.next = 13;
|
|
18804
18826
|
break;
|
|
18805
|
-
case
|
|
18806
|
-
_context.prev =
|
|
18827
|
+
case 10:
|
|
18828
|
+
_context.prev = 10;
|
|
18807
18829
|
_context.t0 = _context["catch"](1);
|
|
18808
18830
|
console.error(_context.t0);
|
|
18809
|
-
case
|
|
18831
|
+
case 13:
|
|
18810
18832
|
this.isload = true;
|
|
18811
|
-
case
|
|
18833
|
+
case 14:
|
|
18812
18834
|
case "end":
|
|
18813
18835
|
return _context.stop();
|
|
18814
18836
|
}
|
|
18815
|
-
}, _callee, this, [[1,
|
|
18837
|
+
}, _callee, this, [[1, 10]]);
|
|
18816
18838
|
}));
|
|
18817
18839
|
function getFun() {
|
|
18818
18840
|
return _getFun.apply(this, arguments);
|
|
@@ -18875,6 +18897,8 @@ var SpuConfig = /*#__PURE__*/function () {
|
|
|
18875
18897
|
}();
|
|
18876
18898
|
function installSpuConfig(options) {
|
|
18877
18899
|
modulekey = options.modulekey;
|
|
18900
|
+
customerid = options.customerid;
|
|
18901
|
+
customertype = options.customertype;
|
|
18878
18902
|
}
|
|
18879
18903
|
var spuConfig = new SpuConfig();
|
|
18880
18904
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smart100/spu-web-plugin",
|
|
3
|
-
"version": "1.0.25-beta.
|
|
3
|
+
"version": "1.0.25-beta.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "npm run build:types && rollup -c -w",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
30
30
|
"@rollup/plugin-terser": "^0.4.4",
|
|
31
31
|
"@rollup/plugin-typescript": "^11.1.5",
|
|
32
|
-
"@rollup/rollup-darwin-x64": "^4.53.3",
|
|
33
32
|
"@types/crypto-js": "^4.2.2",
|
|
34
33
|
"@types/lodash-es": "^4.17.10",
|
|
35
34
|
"@types/node": "^20.8.10",
|
package/src/map/index.ts
CHANGED
|
@@ -49,6 +49,7 @@ const getLocationByNative = async (): Promise<Location> => {
|
|
|
49
49
|
street: res.street || '',
|
|
50
50
|
number: res.number || '',
|
|
51
51
|
detailaddr: res.detailaddr || '',
|
|
52
|
+
citycode: res.citycode || '',
|
|
52
53
|
// poiid: res.poiid || '',
|
|
53
54
|
// poitypename: res.poitypename || '',
|
|
54
55
|
// poitypecode: res.poitypecode || '',
|
|
@@ -216,6 +217,7 @@ const getLocationByAMap = async (): Promise<Location> => {
|
|
|
216
217
|
address: '',
|
|
217
218
|
// poiname: '',
|
|
218
219
|
regionid: '',
|
|
220
|
+
citycode: '',
|
|
219
221
|
country: '',
|
|
220
222
|
province: '',
|
|
221
223
|
city: '',
|
|
@@ -238,12 +240,13 @@ const getLocationByAMap = async (): Promise<Location> => {
|
|
|
238
240
|
if (addrssDetail) {
|
|
239
241
|
result.address = addrssDetail.addressDetail.address
|
|
240
242
|
// result.poiname = addrssDetail.addressDetail.poiname
|
|
241
|
-
result.regionid = addrssDetail.addressDetail.regionid
|
|
242
|
-
result.
|
|
243
|
-
result.
|
|
244
|
-
result.
|
|
245
|
-
result.
|
|
246
|
-
result.
|
|
243
|
+
result.regionid = addrssDetail.addressDetail.regionid || ''
|
|
244
|
+
result.citycode = addrssDetail.addressDetail.citycode || ''
|
|
245
|
+
result.country = addrssDetail.addressDetail.country || ''
|
|
246
|
+
result.province = addrssDetail.addressDetail.province || ''
|
|
247
|
+
result.city = addrssDetail.addressDetail.city || ''
|
|
248
|
+
result.district = addrssDetail.addressDetail.district || ''
|
|
249
|
+
result.street = addrssDetail.addressDetail.street || ''
|
|
247
250
|
result.number = addrssDetail.addressDetail.number
|
|
248
251
|
result.detailaddr = addrssDetail.addressDetail.detailaddr
|
|
249
252
|
// result.poiid = addrssDetail.addressDetail.poiid
|
|
@@ -292,6 +295,7 @@ const getCityLocationByAMap = async (): Promise<Location> => {
|
|
|
292
295
|
address: '',
|
|
293
296
|
// poiname: '',
|
|
294
297
|
regionid: '',
|
|
298
|
+
citycode: '',
|
|
295
299
|
country: '',
|
|
296
300
|
province: '',
|
|
297
301
|
city: '',
|
|
@@ -316,12 +320,13 @@ const getCityLocationByAMap = async (): Promise<Location> => {
|
|
|
316
320
|
if (addrssDetail) {
|
|
317
321
|
result.address = addrssDetail.addressDetail.address
|
|
318
322
|
// result.poiname = addrssDetail.addressDetail.poiname
|
|
319
|
-
result.regionid = addrssDetail.addressDetail.regionid
|
|
320
|
-
result.
|
|
321
|
-
result.
|
|
322
|
-
result.
|
|
323
|
-
result.
|
|
324
|
-
result.
|
|
323
|
+
result.regionid = addrssDetail.addressDetail.regionid || ''
|
|
324
|
+
result.citycode = addrssDetail.addressDetail.citycode || ''
|
|
325
|
+
result.country = addrssDetail.addressDetail.country || ''
|
|
326
|
+
result.province = addrssDetail.addressDetail.province || ''
|
|
327
|
+
result.city = addrssDetail.addressDetail.city || ''
|
|
328
|
+
result.district = addrssDetail.addressDetail.district || ''
|
|
329
|
+
result.street = addrssDetail.addressDetail.street || ''
|
|
325
330
|
result.number = addrssDetail.addressDetail.number
|
|
326
331
|
result.detailaddr = addrssDetail.addressDetail.detailaddr
|
|
327
332
|
// result.poiid = addrssDetail.addressDetail.poiid
|
|
@@ -383,6 +388,7 @@ interface IAddressDetail {
|
|
|
383
388
|
address: string
|
|
384
389
|
// poiname: string
|
|
385
390
|
regionid: string
|
|
391
|
+
citycode: string
|
|
386
392
|
country: string
|
|
387
393
|
province: string
|
|
388
394
|
city: string
|
|
@@ -469,6 +475,7 @@ const getAddressDetailByAMap = async (position: Location): Promise<IAddressDetai
|
|
|
469
475
|
address: address || '',
|
|
470
476
|
// poiname: poiname || '',
|
|
471
477
|
regionid: addressComponent.adcode || '',
|
|
478
|
+
citycode: addressComponent.citycode || '',
|
|
472
479
|
country: country || '',
|
|
473
480
|
province: addressComponent.province || '',
|
|
474
481
|
city: addressComponent.city || '',
|
package/src/spuConfig.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { spuAxios } from './axios'
|
|
|
2
2
|
import { cloneDeep } from 'lodash-es'
|
|
3
3
|
|
|
4
4
|
let modulekey = ''
|
|
5
|
+
let customerid = ''
|
|
6
|
+
let customertype = ''
|
|
5
7
|
|
|
6
8
|
class SpuConfig {
|
|
7
9
|
private isload = false
|
|
@@ -13,8 +15,23 @@ class SpuConfig {
|
|
|
13
15
|
try {
|
|
14
16
|
const res = await spuAxios.post('/lifecycle/getconfigdata', {
|
|
15
17
|
// modulekey: 'litheformspu'
|
|
16
|
-
modulekey: modulekey
|
|
18
|
+
modulekey: modulekey,
|
|
19
|
+
customerid: customerid,
|
|
20
|
+
customertype: customertype
|
|
17
21
|
})
|
|
22
|
+
|
|
23
|
+
// TODO 9.3.3后 res.data中增加extend字段记录额外的数据,也需要返回,这里需要做一个兼容的数据格式
|
|
24
|
+
if (!res?.data?.configs) {
|
|
25
|
+
res.data.configs = []
|
|
26
|
+
}
|
|
27
|
+
if (res?.data?.extend) {
|
|
28
|
+
res.data.configs.push({
|
|
29
|
+
descr: 'getconfigdata接口的extend字段信息',
|
|
30
|
+
dataid: '__system_getconfigdata_extend',
|
|
31
|
+
type: 'json',
|
|
32
|
+
context: JSON.stringify(res?.data?.extend || {})
|
|
33
|
+
})
|
|
34
|
+
}
|
|
18
35
|
// console.log(res)
|
|
19
36
|
// debugger
|
|
20
37
|
if (res.code === 200) {
|
|
@@ -99,6 +116,8 @@ class SpuConfig {
|
|
|
99
116
|
|
|
100
117
|
function installSpuConfig(options: any) {
|
|
101
118
|
modulekey = options.modulekey
|
|
119
|
+
customerid = options.customerid
|
|
120
|
+
customertype = options.customertype
|
|
102
121
|
}
|
|
103
122
|
|
|
104
123
|
const spuConfig = new SpuConfig()
|