@indfnd/common-mobile-pro 1.0.59 → 1.0.60

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.
@@ -59701,6 +59701,20 @@ module.exports = __webpack_require__.p + "styles/images/userBack.bd9562afd8fa0c2
59701
59701
 
59702
59702
  /***/ }),
59703
59703
 
59704
+ /***/ 4379:
59705
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
59706
+
59707
+ module.exports = __webpack_require__.p + "styles/images/loading.a5f1bccebe1c4d3c1b04f30f7b6d5b07.png";
59708
+
59709
+ /***/ }),
59710
+
59711
+ /***/ 2654:
59712
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
59713
+
59714
+ module.exports = __webpack_require__.p + "styles/images/two.c28c4fd0ff6e152043fb9d086051a8e6.png";
59715
+
59716
+ /***/ }),
59717
+
59704
59718
  /***/ 51177:
59705
59719
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
59706
59720
 
@@ -77935,7 +77949,7 @@ __webpack_require__.r(__webpack_exports__);
77935
77949
 
77936
77950
  /***/ }),
77937
77951
 
77938
- /***/ 66151:
77952
+ /***/ 96554:
77939
77953
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
77940
77954
 
77941
77955
  "use strict";
@@ -77945,7 +77959,7 @@ __webpack_require__.r(__webpack_exports__);
77945
77959
 
77946
77960
  /***/ }),
77947
77961
 
77948
- /***/ 30809:
77962
+ /***/ 86293:
77949
77963
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
77950
77964
 
77951
77965
  "use strict";
@@ -80678,37 +80692,37 @@ if(false) {}
80678
80692
 
80679
80693
  /***/ }),
80680
80694
 
80681
- /***/ 71906:
80695
+ /***/ 35023:
80682
80696
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
80683
80697
 
80684
80698
  // style-loader: Adds some css to the DOM by adding a <style> tag
80685
80699
 
80686
80700
  // load the styles
80687
- var content = __webpack_require__(66151);
80701
+ var content = __webpack_require__(96554);
80688
80702
  if(content.__esModule) content = content.default;
80689
80703
  if(typeof content === 'string') content = [[module.id, content, '']];
80690
80704
  if(content.locals) module.exports = content.locals;
80691
80705
  // add the styles to the DOM
80692
80706
  var add = (__webpack_require__(70534)["default"])
80693
- var update = add("edde205c", content, false, {});
80707
+ var update = add("5233618d", content, false, {});
80694
80708
  // Hot Module Replacement
80695
80709
  if(false) {}
80696
80710
 
80697
80711
  /***/ }),
80698
80712
 
80699
- /***/ 66376:
80713
+ /***/ 14772:
80700
80714
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
80701
80715
 
80702
80716
  // style-loader: Adds some css to the DOM by adding a <style> tag
80703
80717
 
80704
80718
  // load the styles
80705
- var content = __webpack_require__(30809);
80719
+ var content = __webpack_require__(86293);
80706
80720
  if(content.__esModule) content = content.default;
80707
80721
  if(typeof content === 'string') content = [[module.id, content, '']];
80708
80722
  if(content.locals) module.exports = content.locals;
80709
80723
  // add the styles to the DOM
80710
80724
  var add = (__webpack_require__(70534)["default"])
80711
- var update = add("63b680fc", content, false, {});
80725
+ var update = add("0265dedc", content, false, {});
80712
80726
  // Hot Module Replacement
80713
80727
  if(false) {}
80714
80728
 
@@ -163469,73 +163483,160 @@ var packages_date_range_src_component = (0,packages_componentNormalizer["default
163469
163483
 
163470
163484
  /* harmony default export */ const packages_date_range = (packages_date_range_src);
163471
163485
 
163472
- ;// ./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/lib/index.js??vue-loader-options!../lambo-design-mobile/packages/loading/src/index.vue?vue&type=template&id=360896fa&scoped=true
163473
- var packages_srcvue_type_template_id_360896fa_scoped_true_render = function render() {
163486
+ ;// ./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/lib/index.js??vue-loader-options!../lambo-design-mobile/packages/loading/src/index.vue?vue&type=template&id=7d3c8ead&scoped=true
163487
+ var packages_srcvue_type_template_id_7d3c8ead_scoped_true_render = function render() {
163474
163488
  var _vm = this,
163475
163489
  _c = _vm._self._c
163476
163490
  return _c(
163477
- "div",
163478
- { staticClass: "loading-components" },
163491
+ "teleport",
163492
+ { attrs: { to: "body" } },
163479
163493
  [
163480
- _c("van-overlay", {
163481
- staticStyle: { width: "100vw", height: "100vh" },
163482
- attrs: { show: _vm.showLoading },
163483
- }),
163484
- _vm._v(" "),
163485
- _vm.showLoading
163486
- ? _c(
163487
- "div",
163488
- { staticClass: "loading" },
163489
- [
163490
- _c(
163491
- "van-loading",
163494
+ _c(
163495
+ "van-overlay",
163496
+ { style: { zIndex: 9999 }, attrs: { show: _vm.showLoading } },
163497
+ [
163498
+ _vm.isFullScreenLoading
163499
+ ? _c(
163500
+ "div",
163492
163501
  {
163493
- attrs: {
163494
- size: "24px",
163495
- vertical: "",
163496
- color: "#eee",
163497
- overlay: true,
163498
- forbidClick: true,
163502
+ staticClass: "ind-loading-wrapper-global",
163503
+ on: {
163504
+ click: function ($event) {
163505
+ $event.stopPropagation()
163506
+ },
163499
163507
  },
163500
163508
  },
163501
- [_vm._v("加载中...")]
163509
+ [
163510
+ _c("img", {
163511
+ staticStyle: { height: "100%", width: "100%" },
163512
+ attrs: {
163513
+ src: _vm.getOssFileUrl(_vm.globalLoading),
163514
+ alt: "",
163515
+ },
163516
+ }),
163517
+ _vm._v(" "),
163518
+ _c("div", { staticClass: "ind-loading-wrapper-text" }, [
163519
+ _vm._v(
163520
+ "\n " +
163521
+ _vm._s(_vm.text || "系统加载中...") +
163522
+ "\n "
163523
+ ),
163524
+ ]),
163525
+ ]
163526
+ )
163527
+ : _c(
163528
+ "div",
163529
+ {
163530
+ staticClass: "ind-loading-wrapper-local",
163531
+ on: {
163532
+ click: function ($event) {
163533
+ $event.stopPropagation()
163534
+ },
163535
+ },
163536
+ },
163537
+ [
163538
+ _c("div", { staticClass: "ind-loading-block ind-vcenter" }, [
163539
+ _c("div", { staticClass: "ind-loading-block-center" }, [
163540
+ _c("img", {
163541
+ attrs: {
163542
+ src: _vm.getOssFileUrl(_vm.localLoading),
163543
+ alt: "",
163544
+ },
163545
+ }),
163546
+ _vm._v(" "),
163547
+ _c("div", { staticClass: "ind-loading-block-text" }, [
163548
+ _vm._v(_vm._s(_vm.text || "加载中...")),
163549
+ ]),
163550
+ ]),
163551
+ ]),
163552
+ ]
163502
163553
  ),
163503
- ],
163504
- 1
163505
- )
163506
- : _vm._e(),
163554
+ ]
163555
+ ),
163507
163556
  ],
163508
163557
  1
163509
163558
  )
163510
163559
  }
163511
- var packages_srcvue_type_template_id_360896fa_scoped_true_staticRenderFns = []
163512
- packages_srcvue_type_template_id_360896fa_scoped_true_render._withStripped = true
163560
+ var packages_srcvue_type_template_id_7d3c8ead_scoped_true_staticRenderFns = []
163561
+ packages_srcvue_type_template_id_7d3c8ead_scoped_true_render._withStripped = true
163513
163562
 
163514
163563
 
163515
- ;// ../lambo-design-mobile/packages/loading/src/index.vue?vue&type=template&id=360896fa&scoped=true
163564
+ ;// ../lambo-design-mobile/packages/loading/src/index.vue?vue&type=template&id=7d3c8ead&scoped=true
163516
163565
 
163566
+ // EXTERNAL MODULE: ../lambo-design-mobile/packages/loading/src/loading.png
163567
+ var packages_src_loading = __webpack_require__(4379);
163568
+ var packages_loading_default = /*#__PURE__*/__webpack_require__.n(packages_src_loading);
163569
+ // EXTERNAL MODULE: ../lambo-design-mobile/packages/loading/src/two.png
163570
+ var packages_two = __webpack_require__(2654);
163571
+ var packages_two_default = /*#__PURE__*/__webpack_require__.n(packages_two);
163517
163572
  ;// ./node_modules/vue-loader/lib/index.js??vue-loader-options!../lambo-design-mobile/packages/loading/src/index.vue?vue&type=script&lang=js
163518
163573
 
163519
163574
 
163575
+
163576
+
163520
163577
  /* harmony default export */ const packages_loading_srcvue_type_script_lang_js_0 = ({
163521
- name:'loading',
163522
- components:{
163523
- vanOverlay:packages_Overlay,
163524
- vanLoading:packages_Loading
163525
- },
163526
- props:{
163578
+ props: {
163527
163579
  showLoading: {
163528
163580
  type: Boolean,
163529
- default: true
163581
+ default: true,
163530
163582
  },
163531
- }
163583
+ isFullScreenLoading: {
163584
+ type: Boolean,
163585
+ default: false,
163586
+ },
163587
+ text: String,
163588
+ },
163589
+ data() {
163590
+ return {
163591
+ loadingLocal: (packages_loading_default()),
163592
+ loadingGlobal: (packages_two_default()),
163593
+ };
163594
+ },
163595
+ computed: {
163596
+ globalLoading() {
163597
+ return this.$config.systemDefaultConfig.globalLoading;
163598
+ },
163599
+ localLoading() {
163600
+ return this.$config.systemDefaultConfig.localLoading;
163601
+ },
163602
+ },
163603
+ watch: {
163604
+ isFullScreenLoading: {
163605
+ handler(newVal) {
163606
+ console.log('isFullScreenLoading changed to:', newVal);
163607
+ // 使用$nextTick确保DOM更新后执行
163608
+ this.$nextTick(() => {
163609
+ // 强制重新渲染组件
163610
+ this.$forceUpdate();
163611
+ });
163612
+ },
163613
+ immediate: true,
163614
+ deep: true,
163615
+ },
163616
+ showLoading() {
163617
+ console.log('showLoading changed to:', this.$config);
163618
+ },
163619
+ },
163620
+
163621
+ methods: {
163622
+ // 添加一个方法用于外部调用以改变状态
163623
+ setLoadingType(isFullScreen) {
163624
+ this.$emit('update:isFullScreenLoading', isFullScreen);
163625
+ },
163626
+ getOssFileUrl(fileId) {
163627
+ if (fileId) {
163628
+ return `/user-manage-server/oss/file/get/${fileId}`;
163629
+ }
163630
+ return this.isFullScreenLoading ? './two.png' : './loading.png';
163631
+ },
163632
+ },
163532
163633
  });
163533
163634
 
163534
163635
  ;// ../lambo-design-mobile/packages/loading/src/index.vue?vue&type=script&lang=js
163535
163636
  /* harmony default export */ const packages_packages_loading_srcvue_type_script_lang_js = (packages_loading_srcvue_type_script_lang_js_0);
163536
- // EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js!./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-3.use[1]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-3.use[2]!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-3.use[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!../lambo-design-mobile/packages/loading/src/index.vue?vue&type=style&index=0&id=360896fa&prod&lang=less&scoped=true
163537
- var packages_srcvue_type_style_index_0_id_360896fa_prod_lang_less_scoped_true = __webpack_require__(66376);
163538
- ;// ../lambo-design-mobile/packages/loading/src/index.vue?vue&type=style&index=0&id=360896fa&prod&lang=less&scoped=true
163637
+ // EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js!./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-3.use[1]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-3.use[2]!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-3.use[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!../lambo-design-mobile/packages/loading/src/index.vue?vue&type=style&index=0&id=7d3c8ead&prod&lang=less&scoped=true
163638
+ var packages_srcvue_type_style_index_0_id_7d3c8ead_prod_lang_less_scoped_true = __webpack_require__(14772);
163639
+ ;// ../lambo-design-mobile/packages/loading/src/index.vue?vue&type=style&index=0&id=7d3c8ead&prod&lang=less&scoped=true
163539
163640
 
163540
163641
  ;// ../lambo-design-mobile/packages/loading/src/index.vue
163541
163642
 
@@ -163548,11 +163649,11 @@ var packages_srcvue_type_style_index_0_id_360896fa_prod_lang_less_scoped_true =
163548
163649
 
163549
163650
  var packages_loading_src_component = (0,packages_componentNormalizer["default"])(
163550
163651
  packages_packages_loading_srcvue_type_script_lang_js,
163551
- packages_srcvue_type_template_id_360896fa_scoped_true_render,
163552
- packages_srcvue_type_template_id_360896fa_scoped_true_staticRenderFns,
163652
+ packages_srcvue_type_template_id_7d3c8ead_scoped_true_render,
163653
+ packages_srcvue_type_template_id_7d3c8ead_scoped_true_staticRenderFns,
163553
163654
  false,
163554
163655
  null,
163555
- "360896fa",
163656
+ "7d3c8ead",
163556
163657
  null
163557
163658
 
163558
163659
  )
@@ -164398,396 +164499,457 @@ class packages_YunTuAdapter {
164398
164499
 
164399
164500
 
164400
164501
  class packages_WeComAdapter {
164401
- constructor(_options) {
164402
- this.corpId = _options.weComId; // 保存 appId 以便在 getInitInfo 中使用
164403
- // if(!window.wx){
164404
- // // const script = document.createElement('script')
164405
- // // script.src = "//wwcdn.weixin.qq.com/node/open/js/wecom-jssdk-1.3.1.js"
164406
- // // document.head.appendChild(script)
164407
- // const script = document.createElement('script');
164408
- // script.src = "//res.wx.qq.com/open/js/jweixin-1.2.0.js";
164409
- // document.head.appendChild(script);
164410
- // const script1 = document.createElement('script');
164411
- // script1.src = "https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js";
164412
- // document.head.appendChild(script1);
164413
- // }
164414
- // this.init( _options)
164415
- function loadScript(src) {
164416
- return new Promise((resolve, reject) => {
164417
- const script = document.createElement('script');
164418
- script.src = src;
164419
- script.onload = () => resolve(script);
164420
- script.onerror = () => reject(new Error('Failed to load script'));
164421
- document.head.appendChild(script);
164422
- });
164423
- }
164424
-
164425
- loadScript('//res.wx.qq.com/open/js/jweixin-1.2.0.js')
164426
- .then(script => {
164427
- console.log('Script loaded');
164428
- this.init(_options);
164429
- })
164430
- .catch(err => console.error(err));
164502
+ constructor(_options) {
164503
+ this.corpId = _options.weComId; // 保存 appId 以便在 getInitInfo 中使用
164504
+ // if(!window.wx){
164505
+ // // const script = document.createElement('script')
164506
+ // // script.src = "//wwcdn.weixin.qq.com/node/open/js/wecom-jssdk-1.3.1.js"
164507
+ // // document.head.appendChild(script)
164508
+ // const script = document.createElement('script');
164509
+ // script.src = "//res.wx.qq.com/open/js/jweixin-1.2.0.js";
164510
+ // document.head.appendChild(script);
164511
+ // const script1 = document.createElement('script');
164512
+ // script1.src = "https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js";
164513
+ // document.head.appendChild(script1);
164514
+ // }
164515
+ // this.init( _options)
164516
+ function loadScript(src) {
164517
+ return new Promise((resolve, reject) => {
164518
+ const script = document.createElement('script');
164519
+ script.src = src;
164520
+ script.onload = () => resolve(script);
164521
+ script.onerror = () => reject(new Error('Failed to load script'));
164522
+ document.head.appendChild(script);
164523
+ });
164431
164524
  }
164432
164525
 
164433
-
164434
- async init(options) {
164435
- const currentUrl = encodeURIComponent(window.location.href.split('#')[0]);
164436
- packages_utils_ajax.request({
164437
- url: packages_config_config.upmsServerContext + '/manage/ibpWxCpBaseinfo/gtJsTicket?corpId=' + options.weComId + "&agentId=" + options.agentId + "&url=" + currentUrl,
164438
- method: 'get'
164439
- }).then((resp) => {
164440
- if (resp.data.code === 1) {
164441
- const {data} = resp.data
164442
- wx.config({
164443
- beta: true,
164444
- // debug: true,
164445
- appId: data.corpId, // 必填,企业微信的corpid,必须与当前登录的企业一致
164446
- // agentid: '1000065', // 必填,企业微信的应用id (e.g. 1000247)
164447
- timestamp: data.timestamp, // 必填,生成签名的时间戳
164448
- nonceStr: data.noncestr, // 必填,生成签名的随机串
164449
- signature: data.signature,// 必填,签名,见附录-JS-SDK使用权限签名算法
164450
- jsApiList: ['getLocation', 'scanQRCode', 'chooseImage', 'openLocation', 'getLocalImgData'], // 必填,传入需要使用的接口名称
164451
- success(res) {
164452
- console.log("ready...")
164453
- },
164454
- fail(res) {
164455
- if (res.errMsg.indexOf('function not exist') > -1) {
164456
- alert('版本过低请升级')
164457
- }
164458
- }
164459
- });
164460
-
164461
- wx.error(function (res) {
164462
- console.error(res)
164463
- });
164464
- wx.ready(function () {
164465
- console.log("ready.....")
164466
- // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
164467
- });
164468
- wx.checkJsApi({
164469
- jsApiList: ['getLocation', 'scanQRCode', 'chooseImage', 'openLocation', 'getLocalImgData'], // 需要检测的JS接口列表
164470
- success(res) {
164471
- // 以键值对的形式返回,可用的api值true,不可用为false
164472
- // 如:{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"}
164473
- }
164474
- });
164475
-
164476
-
164477
- }
164478
-
164479
- }).catch((err) => {
164480
- console.error(err)
164526
+ let self = this
164527
+ function initJsSdk() {
164528
+ loadScript('//res.wx.qq.com/open/js/jweixin-1.2.0.js')
164529
+ .then((script) => {
164530
+ console.log('Script loaded');
164531
+ self.init(_options);
164481
164532
  })
164533
+ .catch((err) => console.error(err));
164482
164534
  }
164483
164535
 
164484
- async getLocation(options) {
164485
- return new Promise((resolve, reject) => {
164486
- wx.ready(async () => {
164487
- // 解决在 URL 变化时,由于 wx.config 和 wx.ready 的异步特性导致的微信接口调用使用旧配置、签名失效或调用失败的问题
164488
- // 新增重试机制检查接口可用性
164489
- let retryInterval;
164490
- try {
164491
- await new Promise((retryResolve, retryReject) => {
164492
- let retryCount = 0;
164493
- const maxRetries = 30; // 最大重试次数 (30*100ms=3秒超时)
164494
- retryInterval = setInterval(async () => {
164495
- if (retryCount++ >= maxRetries) {
164496
- clearInterval(retryInterval);
164497
- retryReject(new Error("JS-SDK接口初始化超时"));
164498
- return;
164499
- }
164536
+ const ua = navigator.userAgent;
164537
+ const isiOS = /iPhone|iPad|iPod/i.test(ua);
164538
+ const isMiniProgramUA = /miniProgram/i.test(ua);
164539
+ const isiOSMiniProgramUA = isiOS && isMiniProgramUA;
164500
164540
 
164501
- // 检查getLocation接口是否可用
164502
- wx.checkJsApi({
164503
- jsApiList: ["getLocation"],
164504
- success: (res) => {
164505
- if (res.checkResult.getLocation === true) {
164506
- clearInterval(retryInterval);
164507
- retryResolve();
164508
- }
164509
- },
164510
- fail: () => {/* 失败不计入重试,继续轮询 */
164511
- }
164512
- });
164513
- }, 100); // 每100ms检查一次
164514
- });
164515
- } catch (error) {
164516
- reject(new Error(`接口初始化失败: ${error.message}`));
164517
- return;
164518
- }
164541
+ // iOS 使用的是 WKWebview,其 JavaScript 注入时机与 UIWebview 不同,存在更严格的同步性要求。
164542
+ // 如果在你调用 wx.config 时,微信的 JS 桥还没有完全注入到当前 Webview 中,初始化就会失败。
164543
+ if (isiOSMiniProgramUA) {
164544
+ setTimeout(() => {
164545
+ initJsSdk();
164546
+ }, 1000);
164547
+ } else {
164548
+ initJsSdk();
164549
+ }
164550
+ }
164519
164551
 
164520
- // 检查 options.type,如果为空或者不含有 'wgs84' 或 'bd09',则设置为 'gcj02'
164521
- let locationType = options.type;
164522
- if (!options.type || (options.type !== 'wgs84' && options.type !== 'bd09')) {
164523
- locationType = 'gcj02';
164524
- }
164552
+ async init(options) {
164553
+ // 在iOS小程序的webview中,currentUrl不能使用动态的,要使用小程序首次打开webview的URL,通过参数传进来
164554
+ const currentUrl = encodeURIComponent(window.location.href.split('#')[0]);
164555
+ packages_utils_ajax
164556
+ .request({
164557
+ url:
164558
+ packages_config_config.upmsServerContext +
164559
+ '/manage/ibpWxCpBaseinfo/gtJsTicket?corpId=' +
164560
+ options.weComId +
164561
+ '&agentId=' +
164562
+ options.agentId +
164563
+ '&url=' +
164564
+ (options.currentUrl || currentUrl),
164565
+ method: 'get',
164566
+ })
164567
+ .then((resp) => {
164568
+ if (resp.data.code === 1) {
164569
+ const { data } = resp.data;
164570
+ wx.config({
164571
+ beta: true,
164572
+ // debug: true,
164573
+ appId: data.corpId, // 必填,企业微信的corpid,必须与当前登录的企业一致
164574
+ // agentid: '1000065', // 必填,企业微信的应用id (e.g. 1000247)
164575
+ timestamp: data.timestamp, // 必填,生成签名的时间戳
164576
+ nonceStr: data.noncestr, // 必填,生成签名的随机串
164577
+ signature: data.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
164578
+ jsApiList: [
164579
+ 'getLocation',
164580
+ 'scanQRCode',
164581
+ 'chooseImage',
164582
+ 'openLocation',
164583
+ 'getLocalImgData',
164584
+ ], // 必填,传入需要使用的接口名称
164585
+ success(res) {
164586
+ console.log('ready...');
164587
+ },
164588
+ fail(res) {
164589
+ if (res.errMsg.indexOf('function not exist') > -1) {
164590
+ alert('版本过低请升级');
164591
+ }
164592
+ },
164593
+ });
164525
164594
 
164526
- const fetchLocation = (type) => {
164527
- return new Promise((resolve, reject) => {
164528
- wx.getLocation({
164529
- ...options,
164530
- type,
164531
- success: location => {
164532
- const unifiedLocation = {
164533
- latitude: location.latitude || location.lat || null, // 统一纬度属性
164534
- longitude: location.longitude || location.lng || null, // 统一经度属性
164535
- accuracy: location.accuracy || null // 精确度,如果有的话
164536
- };
164595
+ wx.error(function (res) {
164596
+ console.error(res);
164597
+ });
164598
+ wx.ready(function () {
164599
+ console.log('ready.....');
164600
+ // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
164601
+ });
164602
+ wx.checkJsApi({
164603
+ jsApiList: [
164604
+ 'getLocation',
164605
+ 'scanQRCode',
164606
+ 'chooseImage',
164607
+ 'openLocation',
164608
+ 'getLocalImgData',
164609
+ ], // 需要检测的JS接口列表
164610
+ success(res) {
164611
+ // 以键值对的形式返回,可用的api值true,不可用为false
164612
+ // 如:{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"}
164613
+ },
164614
+ });
164615
+ }
164616
+ })
164617
+ .catch((err) => {
164618
+ console.error(err);
164619
+ });
164620
+ }
164537
164621
 
164538
- if (!unifiedLocation.latitude || !unifiedLocation.longitude) {
164539
- return reject(new Error('Invalid location data'));
164540
- }
164622
+ async getLocation(options) {
164623
+ return new Promise((resolve, reject) => {
164624
+ wx.ready(async () => {
164625
+ // 解决在 URL 变化时,由于 wx.config 和 wx.ready 的异步特性导致的微信接口调用使用旧配置、签名失效或调用失败的问题
164626
+ // 新增重试机制检查接口可用性
164627
+ let retryInterval;
164628
+ try {
164629
+ await new Promise((retryResolve, retryReject) => {
164630
+ let retryCount = 0;
164631
+ const maxRetries = 30; // 最大重试次数 (30*100ms=3秒超时)
164632
+ retryInterval = setInterval(async () => {
164633
+ if (retryCount++ >= maxRetries) {
164634
+ clearInterval(retryInterval);
164635
+ retryReject(new Error('JS-SDK接口初始化超时'));
164636
+ return;
164637
+ }
164541
164638
 
164542
- resolve(unifiedLocation);
164543
- },
164544
- fail: err => {
164545
- console.error("getLocation failed:", err);
164546
- reject(err);
164547
- }
164548
- });
164549
- });
164639
+ // 检查getLocation接口是否可用
164640
+ wx.checkJsApi({
164641
+ jsApiList: ['getLocation'],
164642
+ success: (res) => {
164643
+ if (res.checkResult.getLocation === true) {
164644
+ clearInterval(retryInterval);
164645
+ retryResolve();
164646
+ }
164647
+ },
164648
+ fail: () => {
164649
+ /* 失败不计入重试,继续轮询 */
164650
+ },
164651
+ });
164652
+ }, 100); // 每100ms检查一次
164653
+ });
164654
+ } catch (error) {
164655
+ reject(new Error(`接口初始化失败: ${error.message}`));
164656
+ return;
164657
+ }
164658
+
164659
+ // 检查 options.type,如果为空或者不含有 'wgs84' 或 'bd09',则设置为 'gcj02'
164660
+ let locationType = options.type;
164661
+ if (
164662
+ !options.type ||
164663
+ (options.type !== 'wgs84' && options.type !== 'bd09')
164664
+ ) {
164665
+ locationType = 'gcj02';
164666
+ }
164667
+
164668
+ const fetchLocation = (type) => {
164669
+ return new Promise((resolve, reject) => {
164670
+ wx.getLocation({
164671
+ ...options,
164672
+ type,
164673
+ success: (location) => {
164674
+ const unifiedLocation = {
164675
+ latitude: location.latitude || location.lat || null, // 统一纬度属性
164676
+ longitude: location.longitude || location.lng || null, // 统一经度属性
164677
+ accuracy: location.accuracy || null, // 精确度,如果有的话
164550
164678
  };
164551
164679
 
164552
- if (locationType === 'bd09') {
164553
- // 先获取 gcj02 坐标
164554
- fetchLocation('gcj02').then(unifiedLocation => {
164555
- // 将 gcj02 坐标转换为 bd09
164556
- const [bd09Lng, bd09Lat] = coordtransform.gcj02tobd09(unifiedLocation.longitude, unifiedLocation.latitude);
164557
- unifiedLocation.longitude = bd09Lng;
164558
- unifiedLocation.latitude = bd09Lat;
164559
- resolve(unifiedLocation);
164560
- }).catch(err => {
164561
- reject(err);
164562
- });
164563
- } else {
164564
- fetchLocation(locationType).then(resolve).catch(reject);
164680
+ if (!unifiedLocation.latitude || !unifiedLocation.longitude) {
164681
+ return reject(new Error('Invalid location data'));
164565
164682
  }
164566
- });
164567
- });
164568
- }
164569
164683
 
164570
- async openLocation(options) {
164571
- return new Promise((resolve, reject) => {
164572
- wx.ready(() => {
164573
- wx.openLocation({
164574
- latitude: options.latitude,
164575
- longitude: options.longitude,
164576
- name: options.name || '',
164577
- address: options.address || '',
164578
- scale: options.scale || 1,
164579
- infoUrl: options.infoUrl || '',
164580
- success: () => {
164581
- console.log("openLocation success");
164582
- resolve();
164583
- },
164584
- fail: err => {
164585
- console.error("openLocation failed:", err);
164586
- reject(err);
164587
- }
164588
- });
164684
+ resolve(unifiedLocation);
164685
+ },
164686
+ fail: (err) => {
164687
+ console.error('getLocation failed:', err);
164688
+ reject(err);
164689
+ },
164589
164690
  });
164590
- });
164591
- }
164691
+ });
164692
+ };
164592
164693
 
164593
- async scanCode(options) {
164594
- return new Promise((resolve, reject) => {
164595
- wx.ready(() => {
164596
- wx.scanQRCode({
164597
- ...options,
164598
- needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果
164599
- success: (res) => {
164600
- console.log("scanQRCode success:", res);
164601
- resolve(res); // 当needResult 为 1 时,扫码返回的结果
164602
- },
164603
- fail: (err) => {
164604
- console.error("scanQRCode failed:", err);
164605
- reject(err);
164606
- }
164607
- });
164694
+ if (locationType === 'bd09') {
164695
+ // 先获取 gcj02 坐标
164696
+ fetchLocation('gcj02')
164697
+ .then((unifiedLocation) => {
164698
+ // 将 gcj02 坐标转换为 bd09
164699
+ const [bd09Lng, bd09Lat] = coordtransform.gcj02tobd09(
164700
+ unifiedLocation.longitude,
164701
+ unifiedLocation.latitude
164702
+ );
164703
+ unifiedLocation.longitude = bd09Lng;
164704
+ unifiedLocation.latitude = bd09Lat;
164705
+ resolve(unifiedLocation);
164706
+ })
164707
+ .catch((err) => {
164708
+ reject(err);
164608
164709
  });
164609
- });
164610
- }
164710
+ } else {
164711
+ fetchLocation(locationType).then(resolve).catch(reject);
164712
+ }
164713
+ });
164714
+ });
164715
+ }
164611
164716
 
164612
- async takePhoto(options) {
164613
- return new Promise((resolve, reject) => {
164614
- wx.ready(() => {
164615
- wx.chooseImage({
164616
- ...options,
164617
- // count: 1, // 默认9,设置为1表示只选择一张图片
164618
- // sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
164619
- // sourceType: ['camera','album'], // 可以指定来源是相册还是相机,默认二者都有
164620
- success: async (res) => {
164621
- const imageInfo = res.localIds[0]; // 返回选定照片的第一个本地ID
164622
- const results = {};
164717
+ async openLocation(options) {
164718
+ return new Promise((resolve, reject) => {
164719
+ wx.ready(() => {
164720
+ wx.openLocation({
164721
+ latitude: options.latitude,
164722
+ longitude: options.longitude,
164723
+ name: options.name || '',
164724
+ address: options.address || '',
164725
+ scale: options.scale || 1,
164726
+ infoUrl: options.infoUrl || '',
164727
+ success: () => {
164728
+ console.log('openLocation success');
164729
+ resolve();
164730
+ },
164731
+ fail: (err) => {
164732
+ console.error('openLocation failed:', err);
164733
+ reject(err);
164734
+ },
164735
+ });
164736
+ });
164737
+ });
164738
+ }
164623
164739
 
164624
- // 检查 outputType 是否为空或不包含 'info', 'data', 'oss' 中的任意一个值
164625
- if (!options.outputType || !['info', 'data', 'oss'].some(type => options.outputType.includes(type))) {
164626
- options.outputType = ['info', 'data', 'oss'];
164627
- }
164740
+ async scanCode(options) {
164741
+ return new Promise((resolve, reject) => {
164742
+ wx.ready(() => {
164743
+ wx.scanQRCode({
164744
+ ...options,
164745
+ needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果
164746
+ success: (res) => {
164747
+ console.log('scanQRCode success:', res);
164748
+ resolve(res); // 当needResult 为 1 时,扫码返回的结果
164749
+ },
164750
+ fail: (err) => {
164751
+ console.error('scanQRCode failed:', err);
164752
+ reject(err);
164753
+ },
164754
+ });
164755
+ });
164756
+ });
164757
+ }
164628
164758
 
164629
- if (options.outputType.includes('info')) {
164630
- results.imageInfo = imageInfo;
164631
- }
164759
+ async takePhoto(options) {
164760
+ return new Promise((resolve, reject) => {
164761
+ wx.ready(() => {
164762
+ wx.chooseImage({
164763
+ ...options,
164764
+ // count: 1, // 默认9,设置为1表示只选择一张图片
164765
+ // sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
164766
+ // sourceType: ['camera','album'], // 可以指定来源是相册还是相机,默认二者都有
164767
+ success: async (res) => {
164768
+ const imageInfo = res.localIds[0]; // 返回选定照片的第一个本地ID
164769
+ const results = {};
164770
+
164771
+ // 检查 outputType 是否为空或不包含 'info', 'data', 'oss' 中的任意一个值
164772
+ if (
164773
+ !options.outputType ||
164774
+ !['info', 'data', 'oss'].some((type) =>
164775
+ options.outputType.includes(type)
164776
+ )
164777
+ ) {
164778
+ options.outputType = ['info', 'data', 'oss'];
164779
+ }
164632
164780
 
164633
- if (options.outputType.includes('data')) {
164634
- await new Promise((resolve, reject) => {
164635
- wx.getLocalImgData({
164636
- localId: imageInfo,
164637
- success: (dataRes) => {
164638
- results.imageData = dataRes.localData;
164639
- resolve();
164640
- },
164641
- fail: (err) => {
164642
- console.error("getLocalImgData failed:", err);
164643
- reject(err);
164644
- }
164645
- });
164646
- });
164647
- }
164781
+ if (options.outputType.includes('info')) {
164782
+ results.imageInfo = imageInfo;
164783
+ }
164648
164784
 
164649
- if (options.outputType.includes('oss')) {
164650
- await new Promise((resolve, reject) => {
164651
- wx.getLocalImgData({
164652
- localId: imageInfo,
164653
- success: (dataRes) => {
164654
- const fileName = new Date().getTime() + '.png';
164655
- let file;
164656
- if (options.method == 'file') {
164657
- file = this.dataURLtoFile(dataRes.localData, fileName);
164658
- } else {
164659
- file = this.dataUrltoBlob(dataRes.localData, fileName);
164660
- }
164661
- this.uploadToOSS(file, options).then((ossResult) => {
164662
- results.imageOss = ossResult;
164663
- resolve();
164664
- }).catch((err) => {
164665
- console.error("uploadToOSS failed:", err);
164666
- reject(err);
164667
- });
164668
- },
164669
- fail: (err) => {
164670
- console.error("getLocalImgData failed:", err);
164671
- reject(err);
164672
- }
164673
- });
164674
- });
164675
- }
164785
+ if (options.outputType.includes('data')) {
164786
+ await new Promise((resolve, reject) => {
164787
+ wx.getLocalImgData({
164788
+ localId: imageInfo,
164789
+ success: (dataRes) => {
164790
+ results.imageData = dataRes.localData;
164791
+ resolve();
164792
+ },
164793
+ fail: (err) => {
164794
+ console.error('getLocalImgData failed:', err);
164795
+ reject(err);
164796
+ },
164797
+ });
164798
+ });
164799
+ }
164676
164800
 
164677
- resolve(results);
164678
- },
164679
- fail: (err) => {
164680
- console.error("chooseImage failed:", err);
164681
- reject(err);
164801
+ if (options.outputType.includes('oss')) {
164802
+ await new Promise((resolve, reject) => {
164803
+ wx.getLocalImgData({
164804
+ localId: imageInfo,
164805
+ success: (dataRes) => {
164806
+ const fileName = new Date().getTime() + '.png';
164807
+ let file;
164808
+ if (options.method == 'file') {
164809
+ file = this.dataURLtoFile(dataRes.localData, fileName);
164810
+ } else {
164811
+ file = this.dataUrltoBlob(dataRes.localData, fileName);
164682
164812
  }
164813
+ this.uploadToOSS(file, options)
164814
+ .then((ossResult) => {
164815
+ results.imageOss = ossResult;
164816
+ resolve();
164817
+ })
164818
+ .catch((err) => {
164819
+ console.error('uploadToOSS failed:', err);
164820
+ reject(err);
164821
+ });
164822
+ },
164823
+ fail: (err) => {
164824
+ console.error('getLocalImgData failed:', err);
164825
+ reject(err);
164826
+ },
164683
164827
  });
164684
- });
164685
- });
164686
- }
164687
-
164688
-
164828
+ });
164829
+ }
164689
164830
 
164690
- dataURLtoFile(dataurl, filename) {
164691
- const arr = dataurl.split(',');
164692
- const mime = arr[0].match(/:(.*?);/)[1];
164693
- const bstr = atob(arr[1]);
164694
- let n = bstr.length;
164695
- const u8arr = new Uint8Array(n);
164696
- while (n--) {
164697
- u8arr[n] = bstr.charCodeAt(n);
164698
- }
164699
- return new File([u8arr], filename, {type: mime});
164700
- }
164831
+ resolve(results);
164832
+ },
164833
+ fail: (err) => {
164834
+ console.error('chooseImage failed:', err);
164835
+ reject(err);
164836
+ },
164837
+ });
164838
+ });
164839
+ });
164840
+ }
164701
164841
 
164702
- dataUrltoBlob(dataurl, filename) {
164703
- const arr = dataurl.split(',');
164704
- const mime = arr[0].match(/:(.*?);/)[1];
164705
- console.log('base64^^^^^', arr[1])
164706
- console.log('mime is ^^^^^^^', mime)
164707
- return this.base64ToBlob(arr[1], mime)
164842
+ dataURLtoFile(dataurl, filename) {
164843
+ const arr = dataurl.split(',');
164844
+ const mime = arr[0].match(/:(.*?);/)[1];
164845
+ const bstr = atob(arr[1]);
164846
+ let n = bstr.length;
164847
+ const u8arr = new Uint8Array(n);
164848
+ while (n--) {
164849
+ u8arr[n] = bstr.charCodeAt(n);
164708
164850
  }
164851
+ return new File([u8arr], filename, { type: mime });
164852
+ }
164709
164853
 
164710
- base64ToBlob(base64Data, contentType) {
164711
- contentType = contentType || ''
164712
- const sliceSize = 1024
164713
- const byteCharacters = atob(base64Data)
164714
- const bytesLength = byteCharacters.length
164715
- const slicesCount = Math.ceil(bytesLength / sliceSize)
164716
- const byteArrays = new Array(slicesCount)
164717
-
164718
- for (let sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
164719
- const begin = sliceIndex * sliceSize
164720
- const end = Math.min(begin + sliceSize, bytesLength)
164854
+ dataUrltoBlob(dataurl, filename) {
164855
+ const arr = dataurl.split(',');
164856
+ const mime = arr[0].match(/:(.*?);/)[1];
164857
+ console.log('base64^^^^^', arr[1]);
164858
+ console.log('mime is ^^^^^^^', mime);
164859
+ return this.base64ToBlob(arr[1], mime);
164860
+ }
164721
164861
 
164722
- const bytes = new Array(end - begin)
164723
- for (let offset = begin, i = 0; offset < end; ++i, ++offset) {
164724
- bytes[i] = byteCharacters[offset].charCodeAt(0)
164725
- }
164726
- byteArrays[sliceIndex] = new Uint8Array(bytes)
164727
- }
164728
- return new Blob(byteArrays, {type: contentType})
164862
+ base64ToBlob(base64Data, contentType) {
164863
+ contentType = contentType || '';
164864
+ const sliceSize = 1024;
164865
+ const byteCharacters = atob(base64Data);
164866
+ const bytesLength = byteCharacters.length;
164867
+ const slicesCount = Math.ceil(bytesLength / sliceSize);
164868
+ const byteArrays = new Array(slicesCount);
164869
+
164870
+ for (let sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
164871
+ const begin = sliceIndex * sliceSize;
164872
+ const end = Math.min(begin + sliceSize, bytesLength);
164873
+
164874
+ const bytes = new Array(end - begin);
164875
+ for (let offset = begin, i = 0; offset < end; ++i, ++offset) {
164876
+ bytes[i] = byteCharacters[offset].charCodeAt(0);
164877
+ }
164878
+ byteArrays[sliceIndex] = new Uint8Array(bytes);
164729
164879
  }
164880
+ return new Blob(byteArrays, { type: contentType });
164881
+ }
164730
164882
 
164731
- uploadToOSS(file, options) {
164732
- if (options.method == "file") {
164733
- return new Promise((resolve, reject) => {
164734
- const formData = new FormData();
164735
- formData.append('file', file);
164736
- packages_utils_ajax.post(options.ossServerContext + options.ossImgPutUrl, formData, {payload: true}).then(response => {
164737
- if (response.data.code === 1) {
164738
- const result = response.data.data;
164739
- if (result.length > 0) {
164740
- resolve(result[0]);
164741
- } else {
164742
- reject(new Error('No fileId returned'));
164743
- }
164744
- } else {
164745
- reject(new Error('Upload failed'));
164746
- }
164747
- }).catch(error => {
164748
- reject(error);
164749
- });
164750
- });
164751
- }
164752
- else{
164753
- return new Promise((resolve, reject) => {
164754
- let formData = new FormData()
164755
- console.log('upload to oss file is ^^^^', file)
164756
- formData.append('file', file, file.name || (new Date().getTime() + '.png'))
164757
- for (var value of formData.values()) {
164758
- console.log('upload to oss data is ^^^^', value)
164759
- }
164760
- packages_utils_ajax({
164761
- method: 'post',
164762
- url: options.ossServerContext + options.ossImgPutUrl,
164763
- headers: {'Content-Type': 'multipart/form-data'},
164764
- data: formData,
164765
- payload: true,
164766
- }).then(response => {
164767
- if (response.data.code == 1) {
164768
- const result = response.data.data
164769
- if (result.length > 0) {
164770
- resolve(result[0])
164771
- } else {
164772
- reject(new Error('No fileId returned'))
164773
- }
164774
- } else {
164775
- reject(new Error('Upload failed'))
164776
- }
164777
- }).catch(err => {
164778
- reject(err)
164779
- })
164780
- })
164781
- }
164883
+ uploadToOSS(file, options) {
164884
+ if (options.method == 'file') {
164885
+ return new Promise((resolve, reject) => {
164886
+ const formData = new FormData();
164887
+ formData.append('file', file);
164888
+ packages_utils_ajax
164889
+ .post(options.ossServerContext + options.ossImgPutUrl, formData, {
164890
+ payload: true,
164891
+ })
164892
+ .then((response) => {
164893
+ if (response.data.code === 1) {
164894
+ const result = response.data.data;
164895
+ if (result.length > 0) {
164896
+ resolve(result[0]);
164897
+ } else {
164898
+ reject(new Error('No fileId returned'));
164899
+ }
164900
+ } else {
164901
+ reject(new Error('Upload failed'));
164902
+ }
164903
+ })
164904
+ .catch((error) => {
164905
+ reject(error);
164906
+ });
164907
+ });
164908
+ } else {
164909
+ return new Promise((resolve, reject) => {
164910
+ let formData = new FormData();
164911
+ console.log('upload to oss file is ^^^^', file);
164912
+ formData.append(
164913
+ 'file',
164914
+ file,
164915
+ file.name || new Date().getTime() + '.png'
164916
+ );
164917
+ for (var value of formData.values()) {
164918
+ console.log('upload to oss data is ^^^^', value);
164919
+ }
164920
+ packages_utils_ajax({
164921
+ method: 'post',
164922
+ url: options.ossServerContext + options.ossImgPutUrl,
164923
+ headers: { 'Content-Type': 'multipart/form-data' },
164924
+ data: formData,
164925
+ payload: true,
164926
+ })
164927
+ .then((response) => {
164928
+ if (response.data.code == 1) {
164929
+ const result = response.data.data;
164930
+ if (result.length > 0) {
164931
+ resolve(result[0]);
164932
+ } else {
164933
+ reject(new Error('No fileId returned'));
164934
+ }
164935
+ } else {
164936
+ reject(new Error('Upload failed'));
164937
+ }
164938
+ })
164939
+ .catch((err) => {
164940
+ reject(err);
164941
+ });
164942
+ });
164782
164943
  }
164944
+ }
164783
164945
 
164784
- async getPlatform(options = {}) {
164785
- // 获取初始化信息
164786
- return {
164787
- appId: this.corpId,
164788
- platform: 'WeCom'
164789
- };
164790
- }
164946
+ async getPlatform(options = {}) {
164947
+ // 获取初始化信息
164948
+ return {
164949
+ appId: this.corpId,
164950
+ platform: 'WeCom',
164951
+ };
164952
+ }
164791
164953
  }
164792
164954
 
164793
164955
  /* harmony default export */ const packages_sdk_WeComAdapter = (packages_WeComAdapter);
@@ -165924,8 +166086,8 @@ var packages_empty_state_component = (0,packages_componentNormalizer["default"])
165924
166086
  ;// ../lambo-design-mobile/packages/empty-state/index.js
165925
166087
 
165926
166088
  /* harmony default export */ const packages_packages_empty_state = (packages_empty_state_0);
165927
- ;// ./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/lib/index.js??vue-loader-options!../lambo-design-mobile/packages/list-page/src/list-page.vue?vue&type=template&id=391c70b8&scoped=true
165928
- var packages_list_pagevue_type_template_id_391c70b8_scoped_true_render = function render() {
166089
+ ;// ./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/lib/index.js??vue-loader-options!../lambo-design-mobile/packages/list-page/src/list-page.vue?vue&type=template&id=20af5a96&scoped=true
166090
+ var packages_list_pagevue_type_template_id_20af5a96_scoped_true_render = function render() {
165929
166091
  var _vm = this,
165930
166092
  _c = _vm._self._c
165931
166093
  return _c(
@@ -165999,6 +166161,8 @@ var packages_list_pagevue_type_template_id_391c70b8_scoped_true_render = functio
165999
166161
  : _vm._e(),
166000
166162
  ]),
166001
166163
  _vm._v(" "),
166164
+ _vm._t("tip"),
166165
+ _vm._v(" "),
166002
166166
  _c(
166003
166167
  "van-pull-refresh",
166004
166168
  {
@@ -166167,14 +166331,14 @@ var packages_list_pagevue_type_template_id_391c70b8_scoped_true_render = functio
166167
166331
  )
166168
166332
  : _vm._e(),
166169
166333
  ],
166170
- 1
166334
+ 2
166171
166335
  )
166172
166336
  }
166173
- var packages_list_pagevue_type_template_id_391c70b8_scoped_true_staticRenderFns = []
166174
- packages_list_pagevue_type_template_id_391c70b8_scoped_true_render._withStripped = true
166337
+ var packages_list_pagevue_type_template_id_20af5a96_scoped_true_staticRenderFns = []
166338
+ packages_list_pagevue_type_template_id_20af5a96_scoped_true_render._withStripped = true
166175
166339
 
166176
166340
 
166177
- ;// ../lambo-design-mobile/packages/list-page/src/list-page.vue?vue&type=template&id=391c70b8&scoped=true
166341
+ ;// ../lambo-design-mobile/packages/list-page/src/list-page.vue?vue&type=template&id=20af5a96&scoped=true
166178
166342
 
166179
166343
  ;// ./node_modules/vue-loader/lib/index.js??vue-loader-options!../lambo-design-mobile/packages/list-page/src/list-page.vue?vue&type=script&lang=js
166180
166344
 
@@ -166506,9 +166670,9 @@ packages_list_pagevue_type_template_id_391c70b8_scoped_true_render._withStripped
166506
166670
 
166507
166671
  ;// ../lambo-design-mobile/packages/list-page/src/list-page.vue?vue&type=script&lang=js
166508
166672
  /* harmony default export */ const packages_src_list_pagevue_type_script_lang_js = (packages_list_pagevue_type_script_lang_js);
166509
- // EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js!./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-3.use[1]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-3.use[2]!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-3.use[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!../lambo-design-mobile/packages/list-page/src/list-page.vue?vue&type=style&index=0&id=391c70b8&prod&scoped=true&lang=less
166510
- var packages_list_pagevue_type_style_index_0_id_391c70b8_prod_scoped_true_lang_less = __webpack_require__(71906);
166511
- ;// ../lambo-design-mobile/packages/list-page/src/list-page.vue?vue&type=style&index=0&id=391c70b8&prod&scoped=true&lang=less
166673
+ // EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js!./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-3.use[1]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-3.use[2]!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-3.use[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!../lambo-design-mobile/packages/list-page/src/list-page.vue?vue&type=style&index=0&id=20af5a96&prod&scoped=true&lang=less
166674
+ var packages_list_pagevue_type_style_index_0_id_20af5a96_prod_scoped_true_lang_less = __webpack_require__(35023);
166675
+ ;// ../lambo-design-mobile/packages/list-page/src/list-page.vue?vue&type=style&index=0&id=20af5a96&prod&scoped=true&lang=less
166512
166676
 
166513
166677
  ;// ../lambo-design-mobile/packages/list-page/src/list-page.vue
166514
166678
 
@@ -166521,11 +166685,11 @@ var packages_list_pagevue_type_style_index_0_id_391c70b8_prod_scoped_true_lang_l
166521
166685
 
166522
166686
  var packages_list_page_component = (0,packages_componentNormalizer["default"])(
166523
166687
  packages_src_list_pagevue_type_script_lang_js,
166524
- packages_list_pagevue_type_template_id_391c70b8_scoped_true_render,
166525
- packages_list_pagevue_type_template_id_391c70b8_scoped_true_staticRenderFns,
166688
+ packages_list_pagevue_type_template_id_20af5a96_scoped_true_render,
166689
+ packages_list_pagevue_type_template_id_20af5a96_scoped_true_staticRenderFns,
166526
166690
  false,
166527
166691
  null,
166528
- "391c70b8",
166692
+ "20af5a96",
166529
166693
  null
166530
166694
 
166531
166695
  )
@@ -167516,8 +167680,8 @@ var packages_dynamic_form_component = (0,packages_componentNormalizer["default"]
167516
167680
 
167517
167681
  /* harmony default export */ const packages_packages_dynamic_form = (packages_dynamic_form_0);
167518
167682
 
167519
- ;// ./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/lib/index.js??vue-loader-options!../lambo-design-mobile/packages/dynamic-load-list/src/dynamic-load-list.vue?vue&type=template&id=6f42886c
167520
- var packages_dynamic_load_listvue_type_template_id_6f42886c_render = function render() {
167683
+ ;// ./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/lib/index.js??vue-loader-options!../lambo-design-mobile/packages/dynamic-load-list/src/dynamic-load-list.vue?vue&type=template&id=2ff67df8
167684
+ var packages_dynamic_load_listvue_type_template_id_2ff67df8_render = function render() {
167521
167685
  var _vm = this,
167522
167686
  _c = _vm._self._c
167523
167687
  return _vm.dataUrl
@@ -167565,6 +167729,13 @@ var packages_dynamic_load_listvue_type_template_id_6f42886c_render = function re
167565
167729
  },
167566
167730
  proxy: true,
167567
167731
  },
167732
+ {
167733
+ key: "tip",
167734
+ fn: function () {
167735
+ return [_vm._t("tip")]
167736
+ },
167737
+ proxy: true,
167738
+ },
167568
167739
  {
167569
167740
  key: "row",
167570
167741
  fn: function ({ item, isBatching, reload, checkboxName }) {
@@ -167685,11 +167856,11 @@ var packages_dynamic_load_listvue_type_template_id_6f42886c_render = function re
167685
167856
  })
167686
167857
  : _vm._e()
167687
167858
  }
167688
- var packages_dynamic_load_listvue_type_template_id_6f42886c_staticRenderFns = []
167689
- packages_dynamic_load_listvue_type_template_id_6f42886c_render._withStripped = true
167859
+ var packages_dynamic_load_listvue_type_template_id_2ff67df8_staticRenderFns = []
167860
+ packages_dynamic_load_listvue_type_template_id_2ff67df8_render._withStripped = true
167690
167861
 
167691
167862
 
167692
- ;// ../lambo-design-mobile/packages/dynamic-load-list/src/dynamic-load-list.vue?vue&type=template&id=6f42886c
167863
+ ;// ../lambo-design-mobile/packages/dynamic-load-list/src/dynamic-load-list.vue?vue&type=template&id=2ff67df8
167693
167864
 
167694
167865
  ;// ./node_modules/vue-loader/lib/index.js??vue-loader-options!../lambo-design-mobile/packages/dynamic-load-list/src/dynamic-load-list.vue?vue&type=script&lang=js
167695
167866
 
@@ -168088,8 +168259,8 @@ packages_dynamic_load_listvue_type_template_id_6f42886c_render._withStripped = t
168088
168259
  ;
168089
168260
  var packages_dynamic_load_list_component = (0,packages_componentNormalizer["default"])(
168090
168261
  packages_src_dynamic_load_listvue_type_script_lang_js,
168091
- packages_dynamic_load_listvue_type_template_id_6f42886c_render,
168092
- packages_dynamic_load_listvue_type_template_id_6f42886c_staticRenderFns,
168262
+ packages_dynamic_load_listvue_type_template_id_2ff67df8_render,
168263
+ packages_dynamic_load_listvue_type_template_id_2ff67df8_staticRenderFns,
168093
168264
  false,
168094
168265
  null,
168095
168266
  null,
@@ -175311,312 +175482,312 @@ packages_select_panelvue_type_template_id_27313ad5_render._withStripped = true
175311
175482
  ;// ./packages/components/tree-select/select-panel.vue?vue&type=template&id=27313ad5
175312
175483
 
175313
175484
  ;// ./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/components/tree-select/select-panel.vue?vue&type=script&lang=js
175314
-
175315
- // import { listComTreeApi, listItemTreeApi } from "@indfnd/utils";
175316
-
175317
-
175318
- // callback如果返回true,停止下钻
175319
- function packages_deepEach(parentNode, list, callback) {
175320
- if (Array.isArray(list) && list.length) {
175321
- packages_lodash_lodash_default().forEach(list, (node, idx) => {
175322
- let breakDeep = false;
175323
- if (typeof callback === "function") {
175324
- try {
175325
- const callbackResult = callback(node, parentNode, idx);
175326
- if (typeof callbackResult === "boolean") {
175327
- breakDeep = callbackResult;
175328
- }
175329
- } catch (error) {
175330
- console.error(error);
175331
- }
175332
- }
175333
- if (!breakDeep) {
175334
- packages_deepEach(node, node.children, callback);
175335
- }
175336
- });
175337
- }
175338
- }
175339
-
175340
- /* harmony default export */ const packages_select_panelvue_type_script_lang_js = ({
175341
- props: {
175342
- title: String, // 标题提示信息
175343
- show: Boolean, // 是否展现
175344
- value: Array, // 选中的值 使用v-model操作
175345
-
175346
- type: String, // 默认提供的几种选择场景 com:全部地市 comTree:树形全部地市 item:全部卷烟 itemTree:树形全部卷烟 brand:全部品牌
175347
- multiple: Boolean, // 是否多选
175348
- options: Array, // 可选择项
175349
-
175350
- // 不使用默认提供的选择场景,自定制使用的接口和列定义等信息
175351
- dataApi: Function, // 数据来源定义,即IndTable的数据来源
175352
- searchParams: Object, // 参数
175353
- columns: Array, // 列定义 即IndTable的列定义
175354
- rowKey: String, // 主键
175355
- defaultVisible: Boolean, // 默认弹出,好像不会触发 opened 事件
175356
-
175357
- showHeader: {
175358
- type: Boolean,
175359
- default: false,
175360
- },
175361
- },
175362
- data() {
175363
- return {
175364
- loading: false,
175365
- searchVal: "", // 模糊查询条件
175366
-
175367
- rows: [], // 数据
175368
- selectRowKey: "", // 主键
175369
- selectDataApi: null, // 表格数据来源
175370
- columnsData: [], // 列定义
175371
-
175372
- dataInited: false, // 避免重复请求数据
175373
-
175374
- dataLen: 0, // 数据行数
175375
- allCheck: false, // 是否权限,根据选中的值而变化
175376
- selectedRows: [], // 当前选中数据
175377
- };
175378
- },
175379
- created() {
175380
- this.initConfig();
175381
- console.log("searchParams", this.searchParams);
175382
- // window.selectInst = this
175383
- // // 防止反复添加钩子
175384
- // if (!this.$router.selectPanelGuardHasAppend) {
175385
- // this.$router.beforeEach((to, from, next) => {
175386
- // console.log('beforEach at selectPanel')
175387
- // // 当前面板打开状态,不允许跳转,先关闭当前面板
175388
- // // TODO 这里存的是首次绑定事件的时候的this实例,后面新增的实例就不再触发了
175389
- // // 1、当前组件不加入keepalive,这可能带来性能问题
175390
- // // 2、当前活跃组件加入window对象,如果弹多层的话,这可能会丢失中间的实例(window里的这个实例,获取到的永远是false了)
175391
- // console.log(window.selectInst, 'this.show', window.selectInst.show)
175392
-
175393
- // // 系统还有别的beforeEach在运行,这里的next逻辑不确定是否可行,会不会相互影响冲突
175394
- // // 已知 beforeEach会注册钩子函数到router实例,调用是链式调用
175395
- // // 那么,next是会相互影响的啊,所以这个组件里逻辑,是不是应该挪到router.guard下面呢
175396
- // if (window.selectInst.show) {
175397
- // this.$emit('update:show', false)
175398
- // next(false)
175399
- // } else {
175400
- // next(to)
175401
- // }
175402
- // })
175403
- // this.$router.selectPanelGuardHasAppend = true
175404
- // }
175405
- },
175406
- activited() {
175407
- if (this.show) {
175408
- window.selectInst = this;
175409
- }
175410
- },
175411
- watch: {
175412
- show() {
175413
- window.selectInst = this;
175414
- },
175415
- type() {
175416
- this.initConfig();
175417
- },
175418
- multiple() {
175419
- this.initConfig();
175420
- },
175421
- searchVal() {
175422
- this.doSearch();
175423
- },
175424
- dataApi() {
175425
- this.initConfig();
175426
- },
175427
- value: {
175428
- handler: function () {
175429
- this.setSelected();
175430
- },
175431
- deep: true,
175432
- },
175433
- },
175434
- computed: {
175435
- isTree() {
175436
- return packages_lodash_lodash_default().some(this.columnsData, (d) => {
175437
- return d.tree == true;
175438
- });
175439
- },
175440
- },
175441
- methods: {
175442
- setLength(data) {
175443
- if (this.isTree) {
175444
- let dataTmp = data?.data || data;
175445
- let leafNodes = [];
175446
- packages_deepEach({}, dataTmp, (d, p, idx) => {
175447
- if (!d?.children?.length) {
175448
- leafNodes.push(d);
175449
- }
175450
- });
175451
- this.dataLen = leafNodes?.length || 0;
175452
- } else {
175453
- this.dataLen = data?.length || data?.data?.length;
175454
- }
175455
- },
175456
- toggleCheckAll() {
175457
- if (this.allCheck) {
175458
- // TODO 取消选中
175459
- this.$refs.table.deselectAll();
175460
- } else {
175461
- // TODO 全选
175462
- this.$refs.table.gridApi.selectAllFiltered();
175463
- }
175464
- },
175465
- // 多选的场景,都能选择,单选只能选叶子节点
175466
- isRowSelectable(params) {
175467
- return (
175468
- this.multiple ||
175469
- (!this.multiple &&
175470
- !(params.data.children && params.data.children.length))
175471
- );
175472
- },
175473
- // 根据传参初始化配置
175474
- async initConfig() {
175475
- this.dataInited = false; // 初始化为false,如果参数变化,也重置为false
175476
- if (!this.type) {
175477
- this.selectDataApi = this.dataApi;
175478
- this.columnsData = this.columns;
175479
- this.selectRowKey = this.rowKey;
175480
-
175481
- if (this.defaultVisible || this.show) {
175482
- this.getTableData();
175483
- }
175484
- return;
175485
- }
175486
-
175487
- // const apiEnum = {
175488
- // comTree: listComTreeApi,
175489
- // itemTree: listItemTreeApi,
175490
- // }
175491
- this.selectDataApi = undefined;
175492
-
175493
- const columnEnum = {
175494
- comTree: [
175495
- {
175496
- headerName: "商业公司",
175497
- minWidth: 200,
175498
- flex: 1,
175499
- field: "title",
175500
- align: "left",
175501
- tree: true,
175502
- showDisabledCheckboxes: true,
175503
- cellClass: this.multiple ? "" : "ind-radio",
175504
- cellRendererParams: {
175505
- checkbox: true,
175506
- suppressCount: true,
175507
- },
175508
- },
175509
- ],
175510
- itemTree: [
175511
- {
175512
- headerName: "卷烟规格",
175513
- minWidth: 200,
175514
- flex: 1,
175515
- field: "title",
175516
- align: "left",
175517
- tree: true,
175518
- showDisabledCheckboxes: true,
175519
- cellClass: this.multiple ? "" : "ind-radio",
175520
- cellRendererParams: {
175521
- checkbox: true,
175522
- suppressCount: true,
175523
- },
175524
- },
175525
- ],
175526
- };
175527
- this.columnsData = columnEnum[this.type];
175528
-
175529
- const rowKeyEnum = {
175530
- comTree: "id",
175531
- itemTree: "id",
175532
- };
175533
- this.selectRowKey = rowKeyEnum[this.type];
175534
-
175535
- if (this.defaultVisible) {
175536
- this.getTableData();
175537
- }
175538
- },
175539
- doSearch: packages_lodash_lodash_default().debounce(function () {
175540
- this.$refs.table.gridApi.setQuickFilter(this.searchVal);
175541
- this.getFilteredData();
175542
- }, 5),
175543
- cancel() {
175544
- this.$emit("update:show", false);
175545
- },
175546
- confirm() {
175547
- let selectedRows = this.$refs.table?.getSelection();
175548
- this.$emit("input", selectedRows);
175549
- this.$emit("update:show", false);
175550
- },
175551
- getFilteredData() {
175552
- var filteredRows = [];
175553
- this.$refs.table.gridApi.forEachNodeAfterFilterAndSort(function (node) {
175554
- filteredRows.push(node.data);
175555
- });
175556
-
175557
- if (this.isTree) {
175558
- let leafNodes = [];
175559
- packages_lodash_lodash_default().forEach(filteredRows, (node) => {
175560
- if (node.children.length === 0) {
175561
- leafNodes.push(node);
175562
- }
175563
- });
175564
- this.dataLen = leafNodes?.length || 0;
175565
- } else {
175566
- this.dataLen =
175567
- filteredRows?.length || filteredRows?.filteredRows?.length;
175568
- }
175569
- },
175570
- getTableData() {
175571
- console.log("getTableData", this.dataInited);
175572
- if (this.dataInited) {
175573
- setTimeout(() => {
175574
- this.setSelected();
175575
- }, 5);
175576
- return;
175577
- }
175578
- setTimeout(() => {
175579
- this.dataInited = true;
175580
- this.$refs?.table?.tableRefresh();
175581
- this.setSelected();
175582
- }, 5);
175583
- },
175584
- onSelectChange(selectedRows) {
175585
- if (!this.multiple) {
175586
- // 单选的场景需要处理,不允许反选,不允许选择多个
175587
- let preLen = this.selectedRows.length;
175588
- let curLen = selectedRows.length;
175589
- if (preLen === 1 && curLen === 0) {
175590
- // 这是反选,调用api选中之前选中的数据
175591
- this.$refs?.table?.setSelection(this.selectedRows, true);
175592
- return;
175593
- } else if (preLen === 1 && curLen === 2) {
175594
- // 这是多选,调用选中之前选中的数据
175595
- let selectedRowsClone = packages_lodash_lodash_default().cloneDeep(selectedRows);
175596
- packages_lodash_lodash_default().remove(selectedRowsClone, (d) => {
175597
- return packages_lodash_lodash_default().some(this.selectedRows, (dd) => {
175598
- return dd[this.rowKey || "id"] == d[this.rowKey || "id"];
175599
- });
175600
- });
175601
- this.$refs?.table?.setSelection(selectedRowsClone, true);
175602
- return;
175603
- }
175604
- }
175605
- if (this.isTree) {
175606
- this.selectedRows = packages_lodash_lodash_default().filter(selectedRows, (d) => {
175607
- return !d?.children?.length;
175608
- });
175609
- } else {
175610
- this.selectedRows = selectedRows;
175611
- }
175612
- this.allCheck = this.selectedRows.length == this.dataLen;
175613
- },
175614
- async setSelected() {
175615
- await this.$nextTick();
175616
- this.$refs?.table?.setSelection(this.value, !this.multiple);
175617
- },
175618
- },
175619
- });
175485
+
175486
+ // import { listComTreeApi, listItemTreeApi } from "@indfnd/utils";
175487
+
175488
+
175489
+ // callback如果返回true,停止下钻
175490
+ function packages_deepEach(parentNode, list, callback) {
175491
+ if (Array.isArray(list) && list.length) {
175492
+ packages_lodash_lodash_default().forEach(list, (node, idx) => {
175493
+ let breakDeep = false;
175494
+ if (typeof callback === "function") {
175495
+ try {
175496
+ const callbackResult = callback(node, parentNode, idx);
175497
+ if (typeof callbackResult === "boolean") {
175498
+ breakDeep = callbackResult;
175499
+ }
175500
+ } catch (error) {
175501
+ console.error(error);
175502
+ }
175503
+ }
175504
+ if (!breakDeep) {
175505
+ packages_deepEach(node, node.children, callback);
175506
+ }
175507
+ });
175508
+ }
175509
+ }
175510
+
175511
+ /* harmony default export */ const packages_select_panelvue_type_script_lang_js = ({
175512
+ props: {
175513
+ title: String, // 标题提示信息
175514
+ show: Boolean, // 是否展现
175515
+ value: Array, // 选中的值 使用v-model操作
175516
+
175517
+ type: String, // 默认提供的几种选择场景 com:全部地市 comTree:树形全部地市 item:全部卷烟 itemTree:树形全部卷烟 brand:全部品牌
175518
+ multiple: Boolean, // 是否多选
175519
+ options: Array, // 可选择项
175520
+
175521
+ // 不使用默认提供的选择场景,自定制使用的接口和列定义等信息
175522
+ dataApi: Function, // 数据来源定义,即IndTable的数据来源
175523
+ searchParams: Object, // 参数
175524
+ columns: Array, // 列定义 即IndTable的列定义
175525
+ rowKey: String, // 主键
175526
+ defaultVisible: Boolean, // 默认弹出,好像不会触发 opened 事件
175527
+
175528
+ showHeader: {
175529
+ type: Boolean,
175530
+ default: false,
175531
+ },
175532
+ },
175533
+ data() {
175534
+ return {
175535
+ loading: false,
175536
+ searchVal: "", // 模糊查询条件
175537
+
175538
+ rows: [], // 数据
175539
+ selectRowKey: "", // 主键
175540
+ selectDataApi: null, // 表格数据来源
175541
+ columnsData: [], // 列定义
175542
+
175543
+ dataInited: false, // 避免重复请求数据
175544
+
175545
+ dataLen: 0, // 数据行数
175546
+ allCheck: false, // 是否权限,根据选中的值而变化
175547
+ selectedRows: [], // 当前选中数据
175548
+ };
175549
+ },
175550
+ created() {
175551
+ this.initConfig();
175552
+ console.log("searchParams", this.searchParams);
175553
+ // window.selectInst = this
175554
+ // // 防止反复添加钩子
175555
+ // if (!this.$router.selectPanelGuardHasAppend) {
175556
+ // this.$router.beforeEach((to, from, next) => {
175557
+ // console.log('beforEach at selectPanel')
175558
+ // // 当前面板打开状态,不允许跳转,先关闭当前面板
175559
+ // // TODO 这里存的是首次绑定事件的时候的this实例,后面新增的实例就不再触发了
175560
+ // // 1、当前组件不加入keepalive,这可能带来性能问题
175561
+ // // 2、当前活跃组件加入window对象,如果弹多层的话,这可能会丢失中间的实例(window里的这个实例,获取到的永远是false了)
175562
+ // console.log(window.selectInst, 'this.show', window.selectInst.show)
175563
+
175564
+ // // 系统还有别的beforeEach在运行,这里的next逻辑不确定是否可行,会不会相互影响冲突
175565
+ // // 已知 beforeEach会注册钩子函数到router实例,调用是链式调用
175566
+ // // 那么,next是会相互影响的啊,所以这个组件里逻辑,是不是应该挪到router.guard下面呢
175567
+ // if (window.selectInst.show) {
175568
+ // this.$emit('update:show', false)
175569
+ // next(false)
175570
+ // } else {
175571
+ // next(to)
175572
+ // }
175573
+ // })
175574
+ // this.$router.selectPanelGuardHasAppend = true
175575
+ // }
175576
+ },
175577
+ activited() {
175578
+ if (this.show) {
175579
+ window.selectInst = this;
175580
+ }
175581
+ },
175582
+ watch: {
175583
+ show() {
175584
+ window.selectInst = this;
175585
+ },
175586
+ type() {
175587
+ this.initConfig();
175588
+ },
175589
+ multiple() {
175590
+ this.initConfig();
175591
+ },
175592
+ searchVal() {
175593
+ this.doSearch();
175594
+ },
175595
+ dataApi() {
175596
+ this.initConfig();
175597
+ },
175598
+ value: {
175599
+ handler: function () {
175600
+ this.setSelected();
175601
+ },
175602
+ deep: true,
175603
+ },
175604
+ },
175605
+ computed: {
175606
+ isTree() {
175607
+ return packages_lodash_lodash_default().some(this.columnsData, (d) => {
175608
+ return d.tree == true;
175609
+ });
175610
+ },
175611
+ },
175612
+ methods: {
175613
+ setLength(data) {
175614
+ if (this.isTree) {
175615
+ let dataTmp = data?.data || data;
175616
+ let leafNodes = [];
175617
+ packages_deepEach({}, dataTmp, (d, p, idx) => {
175618
+ if (!d?.children?.length) {
175619
+ leafNodes.push(d);
175620
+ }
175621
+ });
175622
+ this.dataLen = leafNodes?.length || 0;
175623
+ } else {
175624
+ this.dataLen = data?.length || data?.data?.length;
175625
+ }
175626
+ },
175627
+ toggleCheckAll() {
175628
+ if (this.allCheck) {
175629
+ // TODO 取消选中
175630
+ this.$refs.table.deselectAll();
175631
+ } else {
175632
+ // TODO 全选
175633
+ this.$refs.table.gridApi.selectAllFiltered();
175634
+ }
175635
+ },
175636
+ // 多选的场景,都能选择,单选只能选叶子节点
175637
+ isRowSelectable(params) {
175638
+ return (
175639
+ this.multiple ||
175640
+ (!this.multiple &&
175641
+ !(params.data.children && params.data.children.length))
175642
+ );
175643
+ },
175644
+ // 根据传参初始化配置
175645
+ async initConfig() {
175646
+ this.dataInited = false; // 初始化为false,如果参数变化,也重置为false
175647
+ if (!this.type) {
175648
+ this.selectDataApi = this.dataApi;
175649
+ this.columnsData = this.columns;
175650
+ this.selectRowKey = this.rowKey;
175651
+
175652
+ if (this.defaultVisible || this.show) {
175653
+ this.getTableData();
175654
+ }
175655
+ return;
175656
+ }
175657
+
175658
+ // const apiEnum = {
175659
+ // comTree: listComTreeApi,
175660
+ // itemTree: listItemTreeApi,
175661
+ // }
175662
+ this.selectDataApi = undefined;
175663
+
175664
+ const columnEnum = {
175665
+ comTree: [
175666
+ {
175667
+ headerName: "商业公司",
175668
+ minWidth: 200,
175669
+ flex: 1,
175670
+ field: "title",
175671
+ align: "left",
175672
+ tree: true,
175673
+ showDisabledCheckboxes: true,
175674
+ cellClass: this.multiple ? "" : "ind-radio",
175675
+ cellRendererParams: {
175676
+ checkbox: true,
175677
+ suppressCount: true,
175678
+ },
175679
+ },
175680
+ ],
175681
+ itemTree: [
175682
+ {
175683
+ headerName: "卷烟规格",
175684
+ minWidth: 200,
175685
+ flex: 1,
175686
+ field: "title",
175687
+ align: "left",
175688
+ tree: true,
175689
+ showDisabledCheckboxes: true,
175690
+ cellClass: this.multiple ? "" : "ind-radio",
175691
+ cellRendererParams: {
175692
+ checkbox: true,
175693
+ suppressCount: true,
175694
+ },
175695
+ },
175696
+ ],
175697
+ };
175698
+ this.columnsData = columnEnum[this.type];
175699
+
175700
+ const rowKeyEnum = {
175701
+ comTree: "id",
175702
+ itemTree: "id",
175703
+ };
175704
+ this.selectRowKey = rowKeyEnum[this.type];
175705
+
175706
+ if (this.defaultVisible) {
175707
+ this.getTableData();
175708
+ }
175709
+ },
175710
+ doSearch: packages_lodash_lodash_default().debounce(function () {
175711
+ this.$refs.table.gridApi.setQuickFilter(this.searchVal);
175712
+ this.getFilteredData();
175713
+ }, 5),
175714
+ cancel() {
175715
+ this.$emit("update:show", false);
175716
+ },
175717
+ confirm() {
175718
+ let selectedRows = this.$refs.table?.getSelection();
175719
+ this.$emit("input", selectedRows);
175720
+ this.$emit("update:show", false);
175721
+ },
175722
+ getFilteredData() {
175723
+ var filteredRows = [];
175724
+ this.$refs.table.gridApi.forEachNodeAfterFilterAndSort(function (node) {
175725
+ filteredRows.push(node.data);
175726
+ });
175727
+
175728
+ if (this.isTree) {
175729
+ let leafNodes = [];
175730
+ packages_lodash_lodash_default().forEach(filteredRows, (node) => {
175731
+ if (node.children.length === 0) {
175732
+ leafNodes.push(node);
175733
+ }
175734
+ });
175735
+ this.dataLen = leafNodes?.length || 0;
175736
+ } else {
175737
+ this.dataLen =
175738
+ filteredRows?.length || filteredRows?.filteredRows?.length;
175739
+ }
175740
+ },
175741
+ getTableData() {
175742
+ console.log("getTableData", this.dataInited);
175743
+ if (this.dataInited) {
175744
+ setTimeout(() => {
175745
+ this.setSelected();
175746
+ }, 5);
175747
+ return;
175748
+ }
175749
+ setTimeout(() => {
175750
+ this.dataInited = true;
175751
+ this.$refs?.table?.tableRefresh();
175752
+ this.setSelected();
175753
+ }, 5);
175754
+ },
175755
+ onSelectChange(selectedRows) {
175756
+ if (!this.multiple) {
175757
+ // 单选的场景需要处理,不允许反选,不允许选择多个
175758
+ let preLen = this.selectedRows.length;
175759
+ let curLen = selectedRows.length;
175760
+ if (preLen === 1 && curLen === 0) {
175761
+ // 这是反选,调用api选中之前选中的数据
175762
+ this.$refs?.table?.setSelection(this.selectedRows, true);
175763
+ return;
175764
+ } else if (preLen === 1 && curLen === 2) {
175765
+ // 这是多选,调用选中之前选中的数据
175766
+ let selectedRowsClone = packages_lodash_lodash_default().cloneDeep(selectedRows);
175767
+ packages_lodash_lodash_default().remove(selectedRowsClone, (d) => {
175768
+ return packages_lodash_lodash_default().some(this.selectedRows, (dd) => {
175769
+ return dd[this.rowKey || "id"] == d[this.rowKey || "id"];
175770
+ });
175771
+ });
175772
+ this.$refs?.table?.setSelection(selectedRowsClone, true);
175773
+ return;
175774
+ }
175775
+ }
175776
+ if (this.isTree) {
175777
+ this.selectedRows = packages_lodash_lodash_default().filter(selectedRows, (d) => {
175778
+ return !d?.children?.length;
175779
+ });
175780
+ } else {
175781
+ this.selectedRows = selectedRows;
175782
+ }
175783
+ this.allCheck = this.selectedRows.length == this.dataLen;
175784
+ },
175785
+ async setSelected() {
175786
+ await this.$nextTick();
175787
+ this.$refs?.table?.setSelection(this.value, !this.multiple);
175788
+ },
175789
+ },
175790
+ });
175620
175791
 
175621
175792
  ;// ./packages/components/tree-select/select-panel.vue?vue&type=script&lang=js
175622
175793
  /* harmony default export */ const packages_tree_select_select_panelvue_type_script_lang_js = (packages_select_panelvue_type_script_lang_js);
@@ -177375,31 +177546,31 @@ packages_headervue_type_template_id_0921de1c_render._withStripped = true
177375
177546
  ;// ./packages/components/common-table/components/header.vue?vue&type=template&id=0921de1c
177376
177547
 
177377
177548
  ;// ./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/components/common-table/components/header.vue?vue&type=script&lang=js
177378
-
177379
- /* harmony default export */ const packages_headervue_type_script_lang_js = ({
177380
- name: 'LsvTableHeader',
177381
- data() {
177382
- return {
177383
- sort: '',
177384
- }
177385
- },
177386
- methods: {
177387
- setSort() {
177388
- let sortEnum = ['asc', 'desc', undefined]
177389
- let index = sortEnum.indexOf(this.sort)
177390
- if (index + 1 > 3) {
177391
- index = -1
177392
- }
177393
- this.sort = sortEnum[index + 1]
177394
- this.params.outSortChanged({
177395
- order: this.sort,
177396
- sort: this.params.column.colId,
177397
- })
177398
- // 如果用下面这个方法会导致重复排序,数据顺序不对,因此这里直接调用表格中的排序方法进行数据处理
177399
- // this.params.setSort(this.sort);
177400
- },
177401
- },
177402
- });
177549
+
177550
+ /* harmony default export */ const packages_headervue_type_script_lang_js = ({
177551
+ name: 'LsvTableHeader',
177552
+ data() {
177553
+ return {
177554
+ sort: '',
177555
+ }
177556
+ },
177557
+ methods: {
177558
+ setSort() {
177559
+ let sortEnum = ['asc', 'desc', undefined]
177560
+ let index = sortEnum.indexOf(this.sort)
177561
+ if (index + 1 > 3) {
177562
+ index = -1
177563
+ }
177564
+ this.sort = sortEnum[index + 1]
177565
+ this.params.outSortChanged({
177566
+ order: this.sort,
177567
+ sort: this.params.column.colId,
177568
+ })
177569
+ // 如果用下面这个方法会导致重复排序,数据顺序不对,因此这里直接调用表格中的排序方法进行数据处理
177570
+ // this.params.setSort(this.sort);
177571
+ },
177572
+ },
177573
+ });
177403
177574
 
177404
177575
  ;// ./packages/components/common-table/components/header.vue?vue&type=script&lang=js
177405
177576
  /* harmony default export */ const packages_components_headervue_type_script_lang_js = (packages_headervue_type_script_lang_js);
@@ -177424,306 +177595,306 @@ var packages_header_component = (0,packages_componentNormalizer["default"])(
177424
177595
 
177425
177596
  /* harmony default export */ const packages_header = (packages_header_component.exports);
177426
177597
  ;// ./packages/components/common-table/enums.js
177427
- /**
177428
- * 用来存放默认枚举
177429
- */
177430
-
177431
- const packages_defaultUnitEnum = [
177432
- {
177433
- K: 'X_YY',
177434
- V: '箱/亿元',
177435
- },
177436
- {
177437
- K: 'WX_YY',
177438
- V: '万箱/亿元',
177439
- },
177440
- {
177441
- K: 'X_WY',
177442
- V: '箱/万元',
177443
- },
177444
- {
177445
- K: 'WZ_WY',
177446
- V: '万支/万元',
177447
- },
177448
- {
177449
- K: 'Z_WY',
177450
- V: '支/万元',
177451
- },
177452
- ]
177453
-
177454
- const packages_columnUnitNameEnum = {
177455
- X: '箱',
177456
- WX: '万箱',
177457
- WZ: '万支',
177458
- Z: '支',
177459
- YY: '亿元',
177460
- WY: '万元',
177461
- }
177462
-
177463
- const packages_columnUnitScaleEnum = {
177464
- X: 0,
177465
- Z: 0,
177466
- WX: 0,
177467
- WZ: 0,
177468
- YY: 2,
177469
- WY: 0,
177470
- }
177598
+ /**
177599
+ * 用来存放默认枚举
177600
+ */
177601
+
177602
+ const packages_defaultUnitEnum = [
177603
+ {
177604
+ K: 'X_YY',
177605
+ V: '箱/亿元',
177606
+ },
177607
+ {
177608
+ K: 'WX_YY',
177609
+ V: '万箱/亿元',
177610
+ },
177611
+ {
177612
+ K: 'X_WY',
177613
+ V: '箱/万元',
177614
+ },
177615
+ {
177616
+ K: 'WZ_WY',
177617
+ V: '万支/万元',
177618
+ },
177619
+ {
177620
+ K: 'Z_WY',
177621
+ V: '支/万元',
177622
+ },
177623
+ ]
177624
+
177625
+ const packages_columnUnitNameEnum = {
177626
+ X: '箱',
177627
+ WX: '万箱',
177628
+ WZ: '万支',
177629
+ Z: '支',
177630
+ YY: '亿元',
177631
+ WY: '万元',
177632
+ }
177633
+
177634
+ const packages_columnUnitScaleEnum = {
177635
+ X: 0,
177636
+ Z: 0,
177637
+ WX: 0,
177638
+ WZ: 0,
177639
+ YY: 2,
177640
+ WY: 0,
177641
+ }
177471
177642
 
177472
177643
  ;// ./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/components/common-table/index.vue?vue&type=script&lang=js
177473
-
177474
-
177475
-
177476
-
177477
- /* harmony default export */ const packages_common_tablevue_type_script_lang_js = ({
177478
- name: "CommonTable",
177479
- components: {
177480
- CustomTableHeader: packages_header,
177481
- },
177482
- props: {
177483
- stdConfig: {
177484
- type: Object,
177485
- default: () => {
177486
- return {};
177487
- },
177488
- },
177489
- stdFormDataRight: {
177490
- type: Object,
177491
- default: () => {
177492
- return {};
177493
- },
177494
- },
177495
- data: {
177496
- type: Array,
177497
- default: () => {
177498
- return [];
177499
- },
177500
- },
177501
- tableColumns: {
177502
- type: Array,
177503
- default: () => {
177504
- return [];
177505
- },
177506
- },
177507
- theme: String,
177508
- noSortLine: Number,
177509
- panelLoading: Boolean,
177510
- },
177511
-
177512
- watch: {
177513
- stdConfig: {
177514
- handler(val) {
177515
- this.unitValue = this.stdConfig.unitValue;
177516
- this.tableHeight =
177517
- this.stdConfig.tableHeight || window.innerHeight - 154;
177518
- this.$nextTick(() => {
177519
- this.handlerSetColumnName(this.unitParam);
177520
- });
177521
- },
177522
- deep: true,
177523
- immediate: true,
177524
- },
177525
- stdFormDataRight: {
177526
- handler(val) {
177527
- // 根据Vue的watch方法原理,在一个对象的watch中改变另一个对象的值,不会触发另一个对象的watch方法,因此这里将赋值放入下一个tick中处理
177528
- this.$nextTick(() => {
177529
- this.formDataRight = _.cloneDeep(this.stdFormDataRight);
177530
- });
177531
- },
177532
- deep: true,
177533
- immediate: true,
177534
- },
177535
- tableColumns: {
177536
- handler(val) {
177537
- this.columns = _.cloneDeep(this.tableColumns);
177538
- console.log(val);
177539
- },
177540
- deep: true,
177541
- immediate: true,
177542
- },
177543
- data: {
177544
- handler(val) {
177545
- this.tableData = val;
177546
- this.initValue = _.cloneDeep(val);
177547
- this.$nextTick(() => {
177548
- this.handlerInitDealUnit();
177549
- });
177550
- },
177551
- deep: true,
177552
- },
177553
- formDataRight: {
177554
- handler(val) {
177555
- this.formData = {
177556
- ...val,
177557
- };
177558
- },
177559
- deep: true,
177560
- immediate: false,
177561
- },
177562
- formData: {
177563
- handler(val) {
177564
- this.handlerDealUnit();
177565
- },
177566
- deep: true,
177567
- },
177568
- panelLoading: {
177569
- handler(val) {
177570
- this.loading = val;
177571
- },
177572
- },
177573
- },
177574
- data() {
177575
- return {
177576
- initValue: [], // 定义初始化数组,用于弥补LamboNTable组件排序bug,取消排序时赋值
177577
- loading: false,
177578
- uuid: "", // 行点击标识
177579
- tableHeight: 0,
177580
- formDataRight: {},
177581
- columns: [],
177582
- tableData: [],
177583
- clickCount: 0, // 判断是否为双击事件
177584
- clickTime: 0, // 双击事件计时器
177585
- formData: {},
177586
- //单位切换
177587
- unitFormKey: "unit", // 控制单位转换的字段
177588
- unitParam: {
177589
- amt: "WY",
177590
- qty: "WZ",
177591
- },
177592
- };
177593
- },
177594
- methods: {
177595
- handlerSortChange(sortParams) {
177596
- if (sortParams.order === undefined) {
177597
- this.tableData = _.cloneDeep(this.initValue);
177598
- this.$nextTick(() => {
177599
- this.handlerInitDealUnit();
177600
- });
177601
- }
177602
- },
177603
- handlerDealUnit() {
177604
- if (this.data.length > 0) {
177605
- let curUnitValue = this.formData[this.unitFormKey];
177606
- let oldUnit = _.cloneDeep(this.unitParam);
177607
- let newUnit = {
177608
- qty: curUnitValue.split("_")[0],
177609
- amt: curUnitValue.split("_")[1] ? curUnitValue.split("_")[1] : "",
177610
- };
177611
- this.$refs.table.toggleRowUnitIfNeeded(oldUnit, newUnit);
177612
- this.unitParam = newUnit;
177613
- this.handlerSetColumnName(newUnit);
177614
- }
177615
- },
177616
- handlerInitDealUnit() {
177617
- if (this.data.length > 0) {
177618
- let curUnitValue = this.formData[this.unitFormKey || "unit"];
177619
- let newUnit = {
177620
- qty: curUnitValue.split("_")[0],
177621
- amt: curUnitValue.split("_")[1] ? curUnitValue.split("_")[1] : "",
177622
- };
177623
- this.$refs.table.toggleRowUnitIfNeeded(
177624
- {
177625
- amt: "WY",
177626
- qty: "WZ",
177627
- },
177628
- newUnit
177629
- );
177630
- this.unitParam = newUnit;
177631
- this.handlerSetColumnName(newUnit);
177632
- }
177633
- },
177634
- handlerSetColumnName(newUnit) {
177635
- let newTableColumns = _.cloneDeep(this.tableColumns);
177636
- // this.handlerSetDeepColumnName(newTableColumns, newUnit)
177637
- this.columns = newTableColumns;
177638
- if (typeof this.stdConfig["resetTableColumn"] === "function") {
177639
- this.columns = this.stdConfig["resetTableColumn"](this.columns);
177640
- }
177641
- },
177642
- handlerSetDeepColumnName(newTableColumns, newUnit) {
177643
- newTableColumns.forEach((item) => {
177644
- if (item.children && item.children.length > 0) {
177645
- this.handlerSetDeepColumnName(item.children, newUnit);
177646
- }
177647
- // 处理数据单位转换和其他等等
177648
- item.valueFormatter = (params) => {
177649
- let value;
177650
- if (item.isRowSwitchUnit) {
177651
- value = isNaN(params.value)
177652
- ? ""
177653
- : parseFloat(params.value).toFixed(
177654
- packages_columnUnitScaleEnum[newUnit[item.rowSwitchUnitType]]
177655
- );
177656
- } else if (
177657
- item.cellRendererParams &&
177658
- item.cellRendererParams.customScale
177659
- ) {
177660
- value = isNaN(params.value)
177661
- ? ""
177662
- : parseFloat(params.value).toFixed(
177663
- item.cellRendererParams.customScale
177664
- );
177665
- }
177666
- return value == "NaN" ? "" : value;
177667
- };
177668
-
177669
- let unitName = "";
177670
- if (item.isRowSwitchUnit) {
177671
- unitName = packages_columnUnitNameEnum[newUnit[item.rowSwitchUnitType]];
177672
- } else if (item.unitName) {
177673
- unitName = item.unitName;
177674
- }
177675
- if (unitName != "") {
177676
- item.headerComponent = "CustomTableHeader";
177677
- item.headerComponentParams = {
177678
- title: item.title,
177679
- unitName: unitName,
177680
- sortable: item.sortable,
177681
- isNoUnit: item.isNoUnit,
177682
- outSortChanged: this.$refs.table.outSortChanged,
177683
- };
177684
- item.title =
177685
- item.title + (item.isNoUnit ? unitName : "(" + unitName + ")");
177686
- }
177687
- });
177688
- },
177689
- handlerRowClick(event) {
177690
- let data = event.data;
177691
- // 行点击事件
177692
- // 点击行会触发两次,我尼玛,这里处理下
177693
- // 经过研究发现行点击方法非常不稳定,所以这里改为通过cellClicked方法处理
177694
- if (this.uuid != data["uuid"]) {
177695
- this.$emit("on-row-click-change", [data]);
177696
- this.uuid = data["uuid"];
177697
- }
177698
- this.onRowDoubleClicked(data);
177699
- },
177700
- onRowDoubleClicked(data) {
177701
- let nowTime = new Date().getTime();
177702
- if (nowTime - this.clickTime > 300) {
177703
- this.clickCount = 0;
177704
- }
177705
- if (this.clickCount == 0) {
177706
- this.clickTime = new Date().getTime();
177707
- this.clickCount++;
177708
- } else if (this.clickCount == 3) {
177709
- if (nowTime - this.clickTime < 300) {
177710
- this.$emit("on-row-double-click", data);
177711
- }
177712
- this.clickCount = 0;
177713
- this.clickTime = 0;
177714
- } else {
177715
- this.clickCount++;
177716
- }
177717
- },
177718
- /*** 下面这些方法用于外部操作 */
177719
- // 用于外部操作tableColumns
177720
- handlerTableColumnsCallBack(methodName) {
177721
- if (typeof this.stdConfig[methodName] === "function") {
177722
- this.columns = this.stdConfig[methodName](this.columns);
177723
- }
177724
- },
177725
- },
177726
- });
177644
+
177645
+
177646
+
177647
+
177648
+ /* harmony default export */ const packages_common_tablevue_type_script_lang_js = ({
177649
+ name: "CommonTable",
177650
+ components: {
177651
+ CustomTableHeader: packages_header,
177652
+ },
177653
+ props: {
177654
+ stdConfig: {
177655
+ type: Object,
177656
+ default: () => {
177657
+ return {};
177658
+ },
177659
+ },
177660
+ stdFormDataRight: {
177661
+ type: Object,
177662
+ default: () => {
177663
+ return {};
177664
+ },
177665
+ },
177666
+ data: {
177667
+ type: Array,
177668
+ default: () => {
177669
+ return [];
177670
+ },
177671
+ },
177672
+ tableColumns: {
177673
+ type: Array,
177674
+ default: () => {
177675
+ return [];
177676
+ },
177677
+ },
177678
+ theme: String,
177679
+ noSortLine: Number,
177680
+ panelLoading: Boolean,
177681
+ },
177682
+
177683
+ watch: {
177684
+ stdConfig: {
177685
+ handler(val) {
177686
+ this.unitValue = this.stdConfig.unitValue;
177687
+ this.tableHeight =
177688
+ this.stdConfig.tableHeight || window.innerHeight - 154;
177689
+ this.$nextTick(() => {
177690
+ this.handlerSetColumnName(this.unitParam);
177691
+ });
177692
+ },
177693
+ deep: true,
177694
+ immediate: true,
177695
+ },
177696
+ stdFormDataRight: {
177697
+ handler(val) {
177698
+ // 根据Vue的watch方法原理,在一个对象的watch中改变另一个对象的值,不会触发另一个对象的watch方法,因此这里将赋值放入下一个tick中处理
177699
+ this.$nextTick(() => {
177700
+ this.formDataRight = _.cloneDeep(this.stdFormDataRight);
177701
+ });
177702
+ },
177703
+ deep: true,
177704
+ immediate: true,
177705
+ },
177706
+ tableColumns: {
177707
+ handler(val) {
177708
+ this.columns = _.cloneDeep(this.tableColumns);
177709
+ console.log(val);
177710
+ },
177711
+ deep: true,
177712
+ immediate: true,
177713
+ },
177714
+ data: {
177715
+ handler(val) {
177716
+ this.tableData = val;
177717
+ this.initValue = _.cloneDeep(val);
177718
+ this.$nextTick(() => {
177719
+ this.handlerInitDealUnit();
177720
+ });
177721
+ },
177722
+ deep: true,
177723
+ },
177724
+ formDataRight: {
177725
+ handler(val) {
177726
+ this.formData = {
177727
+ ...val,
177728
+ };
177729
+ },
177730
+ deep: true,
177731
+ immediate: false,
177732
+ },
177733
+ formData: {
177734
+ handler(val) {
177735
+ this.handlerDealUnit();
177736
+ },
177737
+ deep: true,
177738
+ },
177739
+ panelLoading: {
177740
+ handler(val) {
177741
+ this.loading = val;
177742
+ },
177743
+ },
177744
+ },
177745
+ data() {
177746
+ return {
177747
+ initValue: [], // 定义初始化数组,用于弥补LamboNTable组件排序bug,取消排序时赋值
177748
+ loading: false,
177749
+ uuid: "", // 行点击标识
177750
+ tableHeight: 0,
177751
+ formDataRight: {},
177752
+ columns: [],
177753
+ tableData: [],
177754
+ clickCount: 0, // 判断是否为双击事件
177755
+ clickTime: 0, // 双击事件计时器
177756
+ formData: {},
177757
+ //单位切换
177758
+ unitFormKey: "unit", // 控制单位转换的字段
177759
+ unitParam: {
177760
+ amt: "WY",
177761
+ qty: "WZ",
177762
+ },
177763
+ };
177764
+ },
177765
+ methods: {
177766
+ handlerSortChange(sortParams) {
177767
+ if (sortParams.order === undefined) {
177768
+ this.tableData = _.cloneDeep(this.initValue);
177769
+ this.$nextTick(() => {
177770
+ this.handlerInitDealUnit();
177771
+ });
177772
+ }
177773
+ },
177774
+ handlerDealUnit() {
177775
+ if (this.data.length > 0) {
177776
+ let curUnitValue = this.formData[this.unitFormKey];
177777
+ let oldUnit = _.cloneDeep(this.unitParam);
177778
+ let newUnit = {
177779
+ qty: curUnitValue.split("_")[0],
177780
+ amt: curUnitValue.split("_")[1] ? curUnitValue.split("_")[1] : "",
177781
+ };
177782
+ this.$refs.table.toggleRowUnitIfNeeded(oldUnit, newUnit);
177783
+ this.unitParam = newUnit;
177784
+ this.handlerSetColumnName(newUnit);
177785
+ }
177786
+ },
177787
+ handlerInitDealUnit() {
177788
+ if (this.data.length > 0) {
177789
+ let curUnitValue = this.formData[this.unitFormKey || "unit"];
177790
+ let newUnit = {
177791
+ qty: curUnitValue.split("_")[0],
177792
+ amt: curUnitValue.split("_")[1] ? curUnitValue.split("_")[1] : "",
177793
+ };
177794
+ this.$refs.table.toggleRowUnitIfNeeded(
177795
+ {
177796
+ amt: "WY",
177797
+ qty: "WZ",
177798
+ },
177799
+ newUnit
177800
+ );
177801
+ this.unitParam = newUnit;
177802
+ this.handlerSetColumnName(newUnit);
177803
+ }
177804
+ },
177805
+ handlerSetColumnName(newUnit) {
177806
+ let newTableColumns = _.cloneDeep(this.tableColumns);
177807
+ // this.handlerSetDeepColumnName(newTableColumns, newUnit)
177808
+ this.columns = newTableColumns;
177809
+ if (typeof this.stdConfig["resetTableColumn"] === "function") {
177810
+ this.columns = this.stdConfig["resetTableColumn"](this.columns);
177811
+ }
177812
+ },
177813
+ handlerSetDeepColumnName(newTableColumns, newUnit) {
177814
+ newTableColumns.forEach((item) => {
177815
+ if (item.children && item.children.length > 0) {
177816
+ this.handlerSetDeepColumnName(item.children, newUnit);
177817
+ }
177818
+ // 处理数据单位转换和其他等等
177819
+ item.valueFormatter = (params) => {
177820
+ let value;
177821
+ if (item.isRowSwitchUnit) {
177822
+ value = isNaN(params.value)
177823
+ ? ""
177824
+ : parseFloat(params.value).toFixed(
177825
+ packages_columnUnitScaleEnum[newUnit[item.rowSwitchUnitType]]
177826
+ );
177827
+ } else if (
177828
+ item.cellRendererParams &&
177829
+ item.cellRendererParams.customScale
177830
+ ) {
177831
+ value = isNaN(params.value)
177832
+ ? ""
177833
+ : parseFloat(params.value).toFixed(
177834
+ item.cellRendererParams.customScale
177835
+ );
177836
+ }
177837
+ return value == "NaN" ? "" : value;
177838
+ };
177839
+
177840
+ let unitName = "";
177841
+ if (item.isRowSwitchUnit) {
177842
+ unitName = packages_columnUnitNameEnum[newUnit[item.rowSwitchUnitType]];
177843
+ } else if (item.unitName) {
177844
+ unitName = item.unitName;
177845
+ }
177846
+ if (unitName != "") {
177847
+ item.headerComponent = "CustomTableHeader";
177848
+ item.headerComponentParams = {
177849
+ title: item.title,
177850
+ unitName: unitName,
177851
+ sortable: item.sortable,
177852
+ isNoUnit: item.isNoUnit,
177853
+ outSortChanged: this.$refs.table.outSortChanged,
177854
+ };
177855
+ item.title =
177856
+ item.title + (item.isNoUnit ? unitName : "(" + unitName + ")");
177857
+ }
177858
+ });
177859
+ },
177860
+ handlerRowClick(event) {
177861
+ let data = event.data;
177862
+ // 行点击事件
177863
+ // 点击行会触发两次,我尼玛,这里处理下
177864
+ // 经过研究发现行点击方法非常不稳定,所以这里改为通过cellClicked方法处理
177865
+ if (this.uuid != data["uuid"]) {
177866
+ this.$emit("on-row-click-change", [data]);
177867
+ this.uuid = data["uuid"];
177868
+ }
177869
+ this.onRowDoubleClicked(data);
177870
+ },
177871
+ onRowDoubleClicked(data) {
177872
+ let nowTime = new Date().getTime();
177873
+ if (nowTime - this.clickTime > 300) {
177874
+ this.clickCount = 0;
177875
+ }
177876
+ if (this.clickCount == 0) {
177877
+ this.clickTime = new Date().getTime();
177878
+ this.clickCount++;
177879
+ } else if (this.clickCount == 3) {
177880
+ if (nowTime - this.clickTime < 300) {
177881
+ this.$emit("on-row-double-click", data);
177882
+ }
177883
+ this.clickCount = 0;
177884
+ this.clickTime = 0;
177885
+ } else {
177886
+ this.clickCount++;
177887
+ }
177888
+ },
177889
+ /*** 下面这些方法用于外部操作 */
177890
+ // 用于外部操作tableColumns
177891
+ handlerTableColumnsCallBack(methodName) {
177892
+ if (typeof this.stdConfig[methodName] === "function") {
177893
+ this.columns = this.stdConfig[methodName](this.columns);
177894
+ }
177895
+ },
177896
+ },
177897
+ });
177727
177898
 
177728
177899
  ;// ./packages/components/common-table/index.vue?vue&type=script&lang=js
177729
177900
  /* harmony default export */ const packages_components_common_tablevue_type_script_lang_js = (packages_common_tablevue_type_script_lang_js);
@@ -186567,6 +186738,20 @@ const packages_install = function (Vue, { theme = "", config: customConfig = {}
186567
186738
  });
186568
186739
  }
186569
186740
 
186741
+ packages_instance
186742
+ .get(
186743
+ `/user-manage-server/manage/appSetting/qryAppSettingNew?offset=0&limit=20&settingType=11&deviceType=11`
186744
+ )
186745
+ .then((data) => {
186746
+ let ret = JSON.parse(data.data?.rows?.[0].settingInfo);
186747
+ console.log(`🤡😝 ... install ... ret:`, ret);
186748
+ Vue.prototype.$config = packages_lodash_lodash_default().merge(
186749
+ {},
186750
+ Vue.prototype.$config || {},
186751
+ ret || {}
186752
+ );
186753
+ });
186754
+
186570
186755
  const assignConfig = Object.assign({}, packages_shared_config_config, customConfig);
186571
186756
  packages_registerConfig(assignConfig);
186572
186757
  Vue.prototype.$config = assignConfig;