@smart100/spu-web-plugin 0.0.31 → 0.0.33

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.
@@ -708,7 +708,7 @@ function _toPropertyKey$1(arg) {
708
708
  return typeof key === "symbol" ? key : String(key);
709
709
  }
710
710
 
711
- var version = "0.0.31";
711
+ var version = "0.0.33";
712
712
 
713
713
  /** Detect free variable `global` from Node.js. */
714
714
  var freeGlobal$2 = typeof global == 'object' && global && global.Object === Object && global;
@@ -12106,6 +12106,7 @@ var WxworksuiteBaseOpendata = /*#__PURE__*/function (_LitElement) {
12106
12106
  _this.type = ''; // userName | departmentName
12107
12107
  _this.mode = 'close'; // open | close
12108
12108
  _this._isCanUseWxworkSuite = true;
12109
+ _this._isRealOpenid = true;
12109
12110
  _this._topWWOpenData = null;
12110
12111
  return _this;
12111
12112
  }
@@ -12119,37 +12120,12 @@ var WxworksuiteBaseOpendata = /*#__PURE__*/function (_LitElement) {
12119
12120
  key: "connectedCallback",
12120
12121
  value: function () {
12121
12122
  var _connectedCallback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
12122
- var _this2 = this;
12123
12123
  return _regeneratorRuntime().wrap(function _callee$(_context) {
12124
12124
  while (1) switch (_context.prev = _context.next) {
12125
12125
  case 0:
12126
12126
  _get(_getPrototypeOf(WxworksuiteBaseOpendata.prototype), "connectedCallback", this).call(this);
12127
12127
  // console.log('connectedCallback')
12128
- jssdk.init().then(function (_ref) {
12129
- var topWWOpenData = _ref.topWWOpenData;
12130
- _this2._isCanUseWxworkSuite = true;
12131
- if (_this2.wwopendataRef) {
12132
- if (topWWOpenData) {
12133
- _this2._topWWOpenData = topWWOpenData;
12134
- topWWOpenData.bind(_this2.wwopendataRef);
12135
- // topWWOpenData.on('update', (event: any) => {
12136
- // const openid = event.detail.element.getAttribute('openid')
12137
- // console.log('渲染数据发生变更', event, openid)
12138
- // if (this.type === 'departmentName') {
12139
- // console.log('渲染数据发生变更', event)
12140
- // console.log('渲染数据发生变更', openid)
12141
- // }
12142
- // })
12143
- topWWOpenData.on('error', function (event) {
12144
- // console.error('获取数据失败', event)
12145
- _this2._isCanUseWxworkSuite = false;
12146
- });
12147
- }
12148
- }
12149
- })["catch"](function (err) {
12150
- // console.error('jssdk.init() fail', err)
12151
- _this2._isCanUseWxworkSuite = false;
12152
- });
12128
+ this._deal();
12153
12129
  case 2:
12154
12130
  case "end":
12155
12131
  return _context.stop();
@@ -12166,10 +12142,8 @@ var WxworksuiteBaseOpendata = /*#__PURE__*/function (_LitElement) {
12166
12142
  value: function updated(changedProperties) {
12167
12143
  // 页面在浏览器,在 iOS,Mac,Android 上面的企业微信都表现正常,但是在 windows 企业微信下,会偶发不能渲染通讯录控件内容
12168
12144
  // 解答:由于 企业微信的 windows 客户端浏览器内核不支持 customElements,每次更新了 open-data 元素后,需要用 bind 或者 bindAll 接口对目标元素进行一次更新,这样才能保证 open-data 元素实时渲染正确的数据。遇到上面的情况,请检查一下页面代码,看看有没有可能出现时序问题:先执行了 bind,然后才渲染出对应的 open-data 元素
12169
- if (changedProperties.has('openid')) {
12170
- if (this.wwopendataRef && this._isCanUseWxworkSuite && this._topWWOpenData) {
12171
- this._topWWOpenData.bind(this.wwopendataRef);
12172
- }
12145
+ if (changedProperties.has('openid') || changedProperties.has('type')) {
12146
+ this._deal();
12173
12147
  }
12174
12148
  }
12175
12149
  // private test (e: Event) {
@@ -12182,6 +12156,45 @@ var WxworksuiteBaseOpendata = /*#__PURE__*/function (_LitElement) {
12182
12156
  // console.log(value)
12183
12157
  // this._isCanUseWxworkSuite = !this._isCanUseWxworkSuite
12184
12158
  // }
12159
+ }, {
12160
+ key: "_deal",
12161
+ value: function _deal() {
12162
+ var _this2 = this;
12163
+ if (this.type === 'userName') {
12164
+ this._isRealOpenid = this.openid.length >= 32 && !/[\u4e00-\u9fa5]/g.test(this.openid);
12165
+ } else if (this.type === 'departmentName') {
12166
+ this._isRealOpenid = Number.isInteger(Number(this.openid));
12167
+ }
12168
+ jssdk.init().then(function (_ref) {
12169
+ var topWWOpenData = _ref.topWWOpenData;
12170
+ _this2._isCanUseWxworkSuite = true;
12171
+ setTimeout(function () {
12172
+ if (_this2.wwopendataRef) {
12173
+ if (topWWOpenData) {
12174
+ _this2._topWWOpenData = topWWOpenData;
12175
+ topWWOpenData.bind(_this2.wwopendataRef);
12176
+ // topWWOpenData.on('update', (event: any) => {
12177
+ // const openid = event.detail.element.getAttribute('openid')
12178
+ // console.log('渲染数据发生变更', event, openid)
12179
+ // if (this.type === 'departmentName') {
12180
+ // console.log('渲染数据发生变更', event)
12181
+ // console.log('渲染数据发生变更', openid)
12182
+ // }
12183
+ // })
12184
+ topWWOpenData.on('error', function (event) {
12185
+ // console.error('获取数据失败', event)
12186
+ _this2._isCanUseWxworkSuite = false;
12187
+ _this2._topWWOpenData = null;
12188
+ });
12189
+ }
12190
+ }
12191
+ }, 0);
12192
+ })["catch"](function (err) {
12193
+ // console.error('jssdk.init() fail', err)
12194
+ _this2._isCanUseWxworkSuite = false;
12195
+ _this2._topWWOpenData = null;
12196
+ });
12197
+ }
12185
12198
  }, {
12186
12199
  key: "getValue",
12187
12200
  value: function getValue() {
@@ -12217,7 +12230,7 @@ var WxworksuiteBaseOpendata = /*#__PURE__*/function (_LitElement) {
12217
12230
  // <button @click="${this.test}">test</button>
12218
12231
  // ${this._isCanUseWxworkSuite ? html`<ww-open-data type="${this.type}" openid="${this.openid}" mode="${this.mode}" />` : this.openid}
12219
12232
  // ${ this._isCanUseWxworkSuite ? html`true` : 'false' }
12220
- return x(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n ", "\n "])), this._isCanUseWxworkSuite ? x(_templateObject2$5 || (_templateObject2$5 = _taggedTemplateLiteral(["<ww-open-data type=\"", "\" openid=\"", "\" mode=\"", "\" />"])), this.type, this.openid, this.mode) : this.openid);
12233
+ return x(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n ", "\n "])), this._isCanUseWxworkSuite && this._isRealOpenid ? x(_templateObject2$5 || (_templateObject2$5 = _taggedTemplateLiteral(["<ww-open-data type=\"", "\" openid=\"", "\" mode=\"", "\" />"])), this.type, this.openid, this.mode) : this.openid);
12221
12234
  }
12222
12235
  }], [{
12223
12236
  key: "register",
@@ -12242,6 +12255,7 @@ __decorate([n$1({
12242
12255
  type: String
12243
12256
  })], WxworksuiteBaseOpendata.prototype, "mode", void 0);
12244
12257
  __decorate([r$1()], WxworksuiteBaseOpendata.prototype, "_isCanUseWxworkSuite", void 0);
12258
+ __decorate([r$1()], WxworksuiteBaseOpendata.prototype, "_isRealOpenid", void 0);
12245
12259
  __decorate([r$1()], WxworksuiteBaseOpendata.prototype, "_topWWOpenData", void 0);
12246
12260
 
12247
12261
  /**
@@ -12518,7 +12532,7 @@ var WxworksuiteTree = /*#__PURE__*/function (_LitElement) {
12518
12532
  // 判断是否开启企微通信录支持,默认不开启
12519
12533
  _this.iswwopendata = false;
12520
12534
  // 控制通信录转移类型
12521
- _this.wwopendatatype = ''; // userName | departmentName | expression
12535
+ _this.wwopendatatype = ''; // userName | departmentName | expression | ''
12522
12536
  _this.valuekey = 'id'; // 默认id 也可定义别的属性值比如 codepath(被定义的属性值必须唯一)
12523
12537
  _this.ismulselect = false;
12524
12538
  _this.displaytype = 'mobile'; // web | mobile
@@ -12574,9 +12588,25 @@ var WxworksuiteTree = /*#__PURE__*/function (_LitElement) {
12574
12588
  } else {
12575
12589
  _this._searchlist = _this._list.filter(function (item) {
12576
12590
  if (_this.wwopendatatype !== 'expression') {
12577
- return searchOptions.some(function (item2) {
12578
- return item2.id.toString() === item.name.toString();
12579
- });
12591
+ if (_this.wwopendatatype === 'userName') {
12592
+ var isRealOpenid = item.name.length >= 32 && !/[\u4e00-\u9fa5]/g.test(item.name);
12593
+ if (isRealOpenid) {
12594
+ return searchOptions.some(function (item2) {
12595
+ return item2.id.toString() === item.name.toString();
12596
+ });
12597
+ } else {
12598
+ return item.name.indexOf(_this._searchvalue) !== -1;
12599
+ }
12600
+ } else if (_this.wwopendatatype === 'departmentName') {
12601
+ var _isRealOpenid = Number.isInteger(Number(item.name));
12602
+ if (_isRealOpenid) {
12603
+ return searchOptions.some(function (item2) {
12604
+ return item2.id.toString() === item.name.toString();
12605
+ });
12606
+ } else {
12607
+ return item.name.indexOf(_this._searchvalue) !== -1;
12608
+ }
12609
+ }
12580
12610
  } else {
12581
12611
  // return searchOptions.some((item2: any) => item.name.toString().indexOf(item2.id.toString()) !== -1)
12582
12612
  var arr = getExpressionArr(item.name);
@@ -13268,10 +13298,11 @@ var WxworksuiteOrganizationpickMobile = /*#__PURE__*/function (_LitElement) {
13268
13298
  function WxworksuiteOrganizationpickMobile() {
13269
13299
  var _this;
13270
13300
  _classCallCheck(this, WxworksuiteOrganizationpickMobile);
13271
- _this = _super.call(this);
13301
+ _this = _super.apply(this, arguments);
13272
13302
  _this.displaytype = 'mobile';
13273
13303
  _this.ismulselect = false;
13274
13304
  _this.issearch = true;
13305
+ _this.userule = true;
13275
13306
  _this.searchplaceholder = '请输入关键字搜索';
13276
13307
  // normal 父子有关联 共同取值 半选不取
13277
13308
  // individual 父子无关联 各自独立取值
@@ -13284,26 +13315,51 @@ var WxworksuiteOrganizationpickMobile = /*#__PURE__*/function (_LitElement) {
13284
13315
  // disable 不能选非末级节点 只能选末级节点 暂不实现
13285
13316
  _this.singleselectmode = 'normal';
13286
13317
  _this._expandicon = 'organization';
13318
+ _this._isWxworkSuiteTenant = true;
13287
13319
  _this._list = [];
13288
- normalAxios$1.post('/api/teapi/dy-biz/100000000000000000/110000000000000000', {
13289
- pl_orgstruct: {
13290
- status: '1'
13291
- }
13292
- }).then(function (res) {
13293
- var _res$data;
13294
- // console.log(res)
13295
- var list = (res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.pl_orgstruct) || [];
13296
- list.forEach(function (item) {
13297
- item.name = item.orgname;
13298
- // item.name = '1'
13299
- item.id = item.orgstructid;
13300
- item.pid = item.parentorgstructid;
13301
- });
13302
- _this._list = list;
13303
- });
13304
13320
  return _this;
13305
13321
  }
13306
13322
  _createClass(WxworksuiteOrganizationpickMobile, [{
13323
+ key: "connectedCallback",
13324
+ value: function connectedCallback() {
13325
+ var _this2 = this;
13326
+ _get(_getPrototypeOf(WxworksuiteOrganizationpickMobile.prototype), "connectedCallback", this).call(this);
13327
+ // axios.post('/api/teapi/dy-biz/100000000000000000/110000000000000000', {
13328
+ // pl_orgstruct: {
13329
+ // status: '1'
13330
+ // }
13331
+ // }).then((res: any) => {
13332
+ // // console.log(res)
13333
+ // const list = res?.data?.pl_orgstruct || []
13334
+ // list.forEach((item: any) => {
13335
+ // item.name = item.orgname
13336
+ // // item.name = '1'
13337
+ // item.id = item.orgstructid
13338
+ // item.pid = item.parentorgstructid
13339
+ // })
13340
+ // this._list = list
13341
+ // })
13342
+ normalAxios$1.post('/api/system/v1.0/org/page', {
13343
+ showchild: true,
13344
+ orgstructtypeid: 1,
13345
+ useRule: this.userule,
13346
+ pageindex: 1,
13347
+ pagesize: 99999,
13348
+ getAllStatus: false // 是否获取全部数据(即包含禁用)
13349
+ }).then(function (res) {
13350
+ var _res$data;
13351
+ // console.log(res)
13352
+ var list = (res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 || (_res$data = _res$data.data) === null || _res$data === void 0 ? void 0 : _res$data.list) || [];
13353
+ list.forEach(function (item) {
13354
+ item.name = item.orgname;
13355
+ // item.name = '1'
13356
+ item.id = item.orgstructid;
13357
+ item.pid = item.parentorgstructid;
13358
+ });
13359
+ _this2._list = list;
13360
+ });
13361
+ }
13362
+ }, {
13307
13363
  key: "treeRef",
13308
13364
  get: function get() {
13309
13365
  var _this$renderRoot$quer, _this$renderRoot;
@@ -13371,7 +13427,7 @@ var WxworksuiteOrganizationpickMobile = /*#__PURE__*/function (_LitElement) {
13371
13427
  }, {
13372
13428
  key: "render",
13373
13429
  value: function render() {
13374
- return x(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n <wxworksuite-tree\n wwopendatatype=\"departmentName\"\n displaytype=\"", "\"\n expandicon=\"", "\"\n searchplaceholder=\"", "\"\n .issearch=\"", "\"\n .iswwopendata=\"", "\"\n .list=\"", "\"\n .ismulselect=\"", "\"\n singleselectmode=\"", "\"\n mulselectmode=\"", "\"\n @select=\"", "\"\n @check=\"", "\"\n ></wxworksuite-tree>\n "])), this.displaytype, this._expandicon, this.searchplaceholder, this.issearch, true, this._list, this.ismulselect, this.singleselectmode, this.mulselectmode, this._handleSelect, this._handleCheck);
13430
+ return x(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n <wxworksuite-tree\n wwopendatatype=\"", "\"\n displaytype=\"", "\"\n expandicon=\"", "\"\n searchplaceholder=\"", "\"\n .issearch=\"", "\"\n .iswwopendata=\"", "\"\n .list=\"", "\"\n .ismulselect=\"", "\"\n singleselectmode=\"", "\"\n mulselectmode=\"", "\"\n @select=\"", "\"\n @check=\"", "\"\n ></wxworksuite-tree>\n "])), this._isWxworkSuiteTenant ? 'departmentName' : '', this.displaytype, this._expandicon, this.searchplaceholder, this.issearch, this._isWxworkSuiteTenant, this._list, this.ismulselect, this.singleselectmode, this.mulselectmode, this._handleSelect, this._handleCheck);
13375
13431
  }
13376
13432
  }], [{
13377
13433
  key: "register",
@@ -13395,6 +13451,9 @@ __decorate([n$1({
13395
13451
  __decorate([n$1({
13396
13452
  type: Boolean
13397
13453
  })], WxworksuiteOrganizationpickMobile.prototype, "issearch", void 0);
13454
+ __decorate([n$1({
13455
+ type: Boolean
13456
+ })], WxworksuiteOrganizationpickMobile.prototype, "userule", void 0);
13398
13457
  __decorate([n$1({
13399
13458
  type: String
13400
13459
  })], WxworksuiteOrganizationpickMobile.prototype, "searchplaceholder", void 0);
@@ -13405,6 +13464,7 @@ __decorate([n$1({
13405
13464
  type: String
13406
13465
  })], WxworksuiteOrganizationpickMobile.prototype, "singleselectmode", void 0);
13407
13466
  __decorate([r$1()], WxworksuiteOrganizationpickMobile.prototype, "_expandicon", void 0);
13467
+ __decorate([r$1()], WxworksuiteOrganizationpickMobile.prototype, "_isWxworkSuiteTenant", void 0);
13408
13468
  __decorate([r$1()], WxworksuiteOrganizationpickMobile.prototype, "_list", void 0);
13409
13469
 
13410
13470
  var _class$2;
@@ -13443,10 +13503,11 @@ var WxworksuiteMemberpickMobile = /*#__PURE__*/function (_LitElement) {
13443
13503
  function WxworksuiteMemberpickMobile() {
13444
13504
  var _this;
13445
13505
  _classCallCheck(this, WxworksuiteMemberpickMobile);
13446
- _this = _super.call(this);
13506
+ _this = _super.apply(this, arguments);
13447
13507
  _this.displaytype = 'mobile';
13448
13508
  _this.ismulselect = false;
13449
13509
  _this.issearch = true;
13510
+ _this.userule = true;
13450
13511
  _this.searchplaceholder = '请输入关键字搜索';
13451
13512
  // normal 父子有关联 共同取值 半选不取
13452
13513
  // individual 父子无关联 各自独立取值
@@ -13458,32 +13519,72 @@ var WxworksuiteMemberpickMobile = /*#__PURE__*/function (_LitElement) {
13458
13519
  // normal 正常选中取值
13459
13520
  // disable 不能选非末级节点 只能选末级节点 暂不实现
13460
13521
  _this.singleselectmode = 'normal';
13522
+ _this._isWxworkSuiteTenant = true;
13461
13523
  _this._list = [];
13462
- normalAxios$1.post('/api/teapi/dy-biz/1032470355689738336/1273067686762516579', {
13463
- member: {
13464
- searchkey: '',
13465
- orglimit: '',
13466
- orgstructid: '',
13467
- email: '',
13468
- includechild: '1'
13469
- }
13470
- }).then(function (res) {
13471
- var _res$data;
13472
- // console.log(res)
13473
- var list = (res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.member) || [];
13474
- list.forEach(function (item, index) {
13475
- item.name = "__$$wwopendata(".concat(item.userinfoname, ", userName)(").concat(item.positionname, ")");
13476
- // item.name = `__$$wwopendata(${item.userinfoname}, userName)(${item.positionname})__$$wwopendata(哈哈+${index}, departmentName)`
13477
- item.id = item.memberid;
13478
- item.pid = '';
13479
- item.iswwopendata = true;
13480
- item.wwopendatatype = 'expression';
13481
- });
13482
- _this._list = list;
13483
- });
13484
13524
  return _this;
13485
13525
  }
13486
13526
  _createClass(WxworksuiteMemberpickMobile, [{
13527
+ key: "connectedCallback",
13528
+ value: function connectedCallback() {
13529
+ var _this2 = this;
13530
+ _get(_getPrototypeOf(WxworksuiteMemberpickMobile.prototype), "connectedCallback", this).call(this);
13531
+ // axios.post('/api/teapi/dy-biz/1032470355689738336/1273067686762516579', {
13532
+ // member: {
13533
+ // searchkey: '',
13534
+ // orglimit: '',
13535
+ // orgstructid: '',
13536
+ // email: '',
13537
+ // includechild: '1'
13538
+ // }
13539
+ // }).then((res: any) => {
13540
+ // // console.log(res)
13541
+ // const list = res?.data?.member || []
13542
+ // list.forEach((item: any, index: number) => {
13543
+ // item.name = `__$$wwopendata(${item.userinfoname}, userName)(${item.positionname})`
13544
+ // // item.name = `__$$wwopendata(${item.userinfoname}, userName)(${item.positionname})__$$wwopendata(哈哈+${index}, departmentName)`
13545
+ // item.id = item.memberid
13546
+ // item.pid = ''
13547
+ // item.iswwopendata = true
13548
+ // item.wwopendatatype = 'expression'
13549
+ // })
13550
+ // this._list = list
13551
+ // })
13552
+ // console.log('issearch', this.issearch)
13553
+ // console.log('userule', this.userule)
13554
+ // debugger
13555
+ this._isWxworkSuiteTenant = isWxworkSuiteTenant();
13556
+ // debugger
13557
+ normalAxios$1.post('/api/system/v1.0/member/getMemberList', {
13558
+ name: '',
13559
+ phoneNumber: '',
13560
+ saleAreaCodePath: '',
13561
+ positionName: '',
13562
+ pageindex: 1,
13563
+ pagesize: 99999,
13564
+ notUseRule: !this.userule,
13565
+ appcode: 'sales',
13566
+ belongDistributorId: ''
13567
+ }).then(function (res) {
13568
+ var _res$data;
13569
+ // console.log(res)
13570
+ // debugger
13571
+ var list = (res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 || (_res$data = _res$data.data) === null || _res$data === void 0 ? void 0 : _res$data.list) || [];
13572
+ list.forEach(function (item, index) {
13573
+ item.id = item.memberId;
13574
+ item.pid = '';
13575
+ if (_this2._isWxworkSuiteTenant) {
13576
+ item.name = "__$$wwopendata(".concat(item.userName, ", userName)(").concat(item.positionName, ")");
13577
+ // item.name = `__$$wwopendata(${item.userName}, userName)(${item.positionName})__$$wwopendata(哈哈+${index}, departmentName)`
13578
+ item.iswwopendata = true;
13579
+ item.wwopendatatype = 'expression';
13580
+ } else {
13581
+ item.name = "".concat(item.userName, "(").concat(item.positionName, ")");
13582
+ }
13583
+ });
13584
+ _this2._list = list;
13585
+ });
13586
+ }
13587
+ }, {
13487
13588
  key: "treeRef",
13488
13589
  get: function get() {
13489
13590
  var _this$renderRoot$quer, _this$renderRoot;
@@ -13551,7 +13652,7 @@ var WxworksuiteMemberpickMobile = /*#__PURE__*/function (_LitElement) {
13551
13652
  }, {
13552
13653
  key: "render",
13553
13654
  value: function render() {
13554
- return x(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n <wxworksuite-tree\n wwopendatatype=\"expression\"\n displaytype=\"", "\"\n expandicon=\"normal\"\n searchplaceholder=\"", "\"\n .issearch=\"", "\"\n .iswwopendata=\"", "\"\n .list=\"", "\"\n .ismulselect=\"", "\"\n singleselectmode=\"", "\"\n mulselectmode=\"", "\"\n @select=\"", "\"\n @check=\"", "\"\n ></wxworksuite-tree>\n "])), this.displaytype, this.searchplaceholder, this.issearch, true, this._list, this.ismulselect, this.singleselectmode, this.mulselectmode, this._handleSelect, this._handleCheck);
13655
+ return x(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n <wxworksuite-tree\n wwopendatatype=\"", "\"\n displaytype=\"", "\"\n expandicon=\"normal\"\n searchplaceholder=\"", "\"\n .issearch=\"", "\"\n .iswwopendata=\"", "\"\n .list=\"", "\"\n .ismulselect=\"", "\"\n singleselectmode=\"", "\"\n mulselectmode=\"", "\"\n @select=\"", "\"\n @check=\"", "\"\n ></wxworksuite-tree>\n "])), this._isWxworkSuiteTenant ? 'expression' : '', this.displaytype, this.searchplaceholder, this.issearch, this._isWxworkSuiteTenant, this._list, this.ismulselect, this.singleselectmode, this.mulselectmode, this._handleSelect, this._handleCheck);
13555
13656
  }
13556
13657
  }], [{
13557
13658
  key: "register",
@@ -13575,6 +13676,9 @@ __decorate([n$1({
13575
13676
  __decorate([n$1({
13576
13677
  type: Boolean
13577
13678
  })], WxworksuiteMemberpickMobile.prototype, "issearch", void 0);
13679
+ __decorate([n$1({
13680
+ type: Boolean
13681
+ })], WxworksuiteMemberpickMobile.prototype, "userule", void 0);
13578
13682
  __decorate([n$1({
13579
13683
  type: String
13580
13684
  })], WxworksuiteMemberpickMobile.prototype, "searchplaceholder", void 0);
@@ -13584,6 +13688,7 @@ __decorate([n$1({
13584
13688
  __decorate([n$1({
13585
13689
  type: String
13586
13690
  })], WxworksuiteMemberpickMobile.prototype, "singleselectmode", void 0);
13691
+ __decorate([r$1()], WxworksuiteMemberpickMobile.prototype, "_isWxworkSuiteTenant", void 0);
13587
13692
  __decorate([r$1()], WxworksuiteMemberpickMobile.prototype, "_list", void 0);
13588
13693
 
13589
13694
  var _class;
@@ -59353,7 +59458,7 @@ var getIndextagSync = function getIndextagSync(params) {
59353
59458
  var initApaasSpuTrack = function initApaasSpuTrack() {
59354
59459
  setTimeout(function () {
59355
59460
  var _window, _window2;
59356
- if (ApaasSpuTrack && !window.apaasSpuTrack && !((_window = window) !== null && _window !== void 0 && (_window = _window.aPaaS) !== null && _window !== void 0 && _window.getWebInitParams) && !((_window2 = window) !== null && _window2 !== void 0 && (_window2 = _window2.Module) !== null && _window2 !== void 0 && _window2.getIndextagSync)) {
59461
+ if (ApaasSpuTrack && !window.apaasSpuTrack && !((_window = window) !== null && _window !== void 0 && (_window = _window.aPaaS) !== null && _window !== void 0 && _window.getWebInitParams) && !((_window2 = window) !== null && _window2 !== void 0 && (_window2 = _window2.Module) !== null && _window2 !== void 0 && _window2.getIndextagSync) && login.checkLogin() && getUser()) {
59357
59462
  window.aPaaS = {
59358
59463
  getWebInitParams: getWebInitParams
59359
59464
  };
@@ -59437,10 +59542,10 @@ var initApaasSpuTrack = function initApaasSpuTrack() {
59437
59542
  apaasSpuTrack.start();
59438
59543
  });
59439
59544
  }
59440
- }, 2500);
59545
+ }, 3000);
59441
59546
  };
59442
59547
  var apaasSpuTrackSendLog = function apaasSpuTrackSendLog(data) {
59443
- var end = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
59548
+ var isnotretry = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
59444
59549
  if (window.apaasSpuTrack) {
59445
59550
  var logtime = Date.now().toString();
59446
59551
  var baselog = cloneDeep$1(_objectSpread2$1(_objectSpread2$1({}, window.apaasSpuTrack.baseLog), {}, {
@@ -59467,7 +59572,7 @@ var apaasSpuTrackSendLog = function apaasSpuTrackSendLog(data) {
59467
59572
  // debugger
59468
59573
  window.apaasSpuTrack.addLogToQueue(mergedata, true);
59469
59574
  } else {
59470
- if (!end) {
59575
+ if (!isnotretry) {
59471
59576
  console.warn('window.apaasSpuTrack 不存在,导出日志延迟3秒后再次发送。');
59472
59577
  setTimeout(function () {
59473
59578
  apaasSpuTrackSendLog(data, true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smart100/spu-web-plugin",
3
- "version": "0.0.31",
3
+ "version": "0.0.33",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "dev": "npm run build:types && rollup -c -w",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@amap/amap-jsapi-loader": "^1.0.1",
41
- "@smart100/wxworksuite-plugin": "^0.0.10",
41
+ "@smart100/wxworksuite-plugin": "^0.0.12",
42
42
  "axios": "^1.6.0",
43
43
  "co": "^4.6.0",
44
44
  "dayjs": "^1.11.10",
@@ -1,5 +1,6 @@
1
1
  import { globalOptions, getUser, Module } from './index'
2
2
  import { cloneDeep, merge } from 'lodash-es'
3
+ import login from './login'
3
4
 
4
5
  // @ts-ignore
5
6
  import ApaasSpuTrack from './package/apaas-track/apaas-spu/index.umd.js'
@@ -55,7 +56,7 @@ const getIndextagSync = (params: any) => {
55
56
  // 兼容开启SPU日志
56
57
  const initApaasSpuTrack = () => {
57
58
  setTimeout(() => {
58
- if (ApaasSpuTrack && !window.apaasSpuTrack && !window?.aPaaS?.getWebInitParams && !window?.Module?.getIndextagSync) {
59
+ if (ApaasSpuTrack && !window.apaasSpuTrack && !window?.aPaaS?.getWebInitParams && !window?.Module?.getIndextagSync && login.checkLogin() && getUser()) {
59
60
  window.aPaaS = {
60
61
  getWebInitParams
61
62
  }
@@ -147,10 +148,10 @@ const initApaasSpuTrack = () => {
147
148
  apaasSpuTrack.start()
148
149
  })
149
150
  }
150
- }, 2500)
151
+ }, 3000)
151
152
  }
152
153
 
153
- const apaasSpuTrackSendLog = (data: any, end: boolean = false) => {
154
+ const apaasSpuTrackSendLog = (data: any, isnotretry: boolean = false) => {
154
155
  if (window.apaasSpuTrack) {
155
156
  const logtime = Date.now().toString()
156
157
  const baselog = cloneDeep({
@@ -178,7 +179,7 @@ const apaasSpuTrackSendLog = (data: any, end: boolean = false) => {
178
179
  // debugger
179
180
  window.apaasSpuTrack.addLogToQueue(mergedata, true)
180
181
  } else {
181
- if (!end) {
182
+ if (!isnotretry) {
182
183
  console.warn('window.apaasSpuTrack 不存在,导出日志延迟3秒后再次发送。')
183
184
  setTimeout(() => {
184
185
  apaasSpuTrackSendLog(data, true)