bxs-tools-ui 3.2.0-0 → 3.2.0-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/es/add-and-take/index.js +13 -3
  2. package/es/adjust-baoe/index.js +3 -2
  3. package/es/index.js +171 -161
  4. package/es/insure-calculate/index.js +1 -0
  5. package/es/person-info/index.js +122 -146
  6. package/es/product-info/index.js +136 -152
  7. package/es/share-sheet/index.js +16 -4
  8. package/es/utils/index.js +144 -154
  9. package/lib/add-and-take/index.js +13 -3
  10. package/lib/adjust-baoe/index.js +3 -2
  11. package/lib/index.js +171 -161
  12. package/lib/insure-calculate/index.js +1 -0
  13. package/lib/person-info/index.js +122 -146
  14. package/lib/product-info/index.js +136 -152
  15. package/lib/share-sheet/index.js +16 -4
  16. package/lib/utils/index.js +144 -154
  17. package/package.json +1 -4
  18. package/packages/add-and-take/readme.md +162 -256
  19. package/packages/adjust-baoe/readme.md +118 -83
  20. package/packages/business-card/readme.md +91 -28
  21. package/packages/bxs-utils/planbook/common.ts +48 -20
  22. package/packages/bxs-utils/planbook/person.ts +1 -1
  23. package/packages/bxs-utils/planbook/product.ts +70 -124
  24. package/packages/bxs-utils/readme.md +407 -425
  25. package/packages/canvas-poster/readme.md +123 -83
  26. package/packages/index.ts +1 -1
  27. package/packages/insure-calculate/readme.md +185 -129
  28. package/packages/person-info/index.vue +6 -1
  29. package/packages/person-info/readme.md +149 -134
  30. package/packages/planbook-input/helper.js +9 -4
  31. package/packages/planbook-input/index.vue +5 -1
  32. package/packages/planbook-input/readme.md +143 -84
  33. package/packages/product-info/index.vue +12 -3
  34. package/packages/product-info/readme.md +130 -69
@@ -9042,7 +9042,7 @@
9042
9042
  * **将交费期间或者保险期间的值,转换成数值**
9043
9043
  * @author Lizhao <lz@winbaoxian.com>
9044
9044
  * @date 2022-04-25
9045
- * @param {string} value 必传。需要转换的值
9045
+ * @param {string|number} value 必传。需要转换的值
9046
9046
  * @param {number} age 0 可不传。被保人年龄
9047
9047
  * @returns {number} 数值
9048
9048
  * @example
@@ -9074,7 +9074,7 @@
9074
9074
  * @author Lizhao <lz@winbaoxian.com>
9075
9075
  * @date 2022-04-25
9076
9076
  * @param {number} value 必传
9077
- * @returns {string} 单位为万的字符串
9077
+ * @returns {number|string} 满足条件时返回单位为万的字符串,否则返回原数值
9078
9078
  * @example
9079
9079
  * converUnit10000(1000)
9080
9080
  * // returns 1000
@@ -9132,7 +9132,7 @@
9132
9132
  * **根据生日算年龄**
9133
9133
  * @author Lizhao <lz@winbaoxian.com>
9134
9134
  * @date 2022-04-25
9135
- * @param {Date|timestamp|dateStr} birth 必传。时间字符串或时间翟
9135
+ * @param {Date|timestamp|dateStr} birth 必传。时间字符串或时间戳
9136
9136
  * @param {Date|timestamp|dateStr} cDate 可不传。指定时间,不传默认为当前时间
9137
9137
  * @returns {number} 年龄
9138
9138
  * @example
@@ -9178,7 +9178,9 @@
9178
9178
  // 通用信息
9179
9179
  customVariable: null,
9180
9180
  // 自定义变量
9181
- cv: null // 简写,自定义变量
9181
+ cv: null,
9182
+ // 简写,自定义变量
9183
+ t: {} // 事件目标
9182
9184
  };
9183
9185
  if (personData) {
9184
9186
  var insuredInfo = (personData.personOrderList || []).find(function (p) {
@@ -9226,8 +9228,13 @@
9226
9228
  });
9227
9229
  }
9228
9230
  }
9229
- if (options && options.planbookId) {
9230
- map.planbookId = options.planbookId;
9231
+ if (options) {
9232
+ if (options.planbookId) {
9233
+ map.planbookId = options.planbookId;
9234
+ }
9235
+ if (options.eventTarget) {
9236
+ map.t = options.eventTarget;
9237
+ }
9231
9238
  }
9232
9239
  if (ins && ins.customVariableExp) {
9233
9240
  var exp = ins.customVariableExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'map.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'map.$2');
@@ -9258,11 +9265,12 @@
9258
9265
  }
9259
9266
  if (['cmCommonSelect', 'cmCommonRadioBtn', 'cmCommonRadio', 'cmCommonCheckbox'].includes(ele.componentName)) {
9260
9267
  if (ele.defaultValueExp) {
9261
- if (ele.value !== 0 && !ele.value) {
9262
- var _exp = ele.defaultValueExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
9263
- newEleMap.value = eval(_exp);
9264
- consoleLogWhenEnable("".concat(ele.key, ": defaultValueExp"), _exp, newEleMap.value);
9268
+ var _exp = ele.defaultValueExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
9269
+ var expValue = eval(_exp);
9270
+ if (!['', null, undefined].includes(expValue)) {
9271
+ newEleMap.value = expValue;
9265
9272
  }
9273
+ consoleLogWhenEnable("".concat(ele.key, ": defaultValueExp"), _exp, newEleMap.value);
9266
9274
  }
9267
9275
  if (ele.underwriteExp) {
9268
9276
  var _exp2 = ele.underwriteExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
@@ -9290,11 +9298,12 @@
9290
9298
  }
9291
9299
  if (['cmCommonInput'].includes(ele.componentName)) {
9292
9300
  if (ele.defaultValueExp) {
9293
- if (!ele.value) {
9294
- var _exp3 = ele.defaultValueExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
9295
- newEleMap.value = eval(_exp3);
9296
- consoleLogWhenEnable("".concat(ele.key, ": defaultValueExp"), _exp3, newEleMap.value);
9301
+ var _exp3 = ele.defaultValueExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
9302
+ var _expValue = eval(_exp3);
9303
+ if (!['', null, undefined].includes(_expValue)) {
9304
+ newEleMap.value = _expValue;
9297
9305
  }
9306
+ consoleLogWhenEnable("".concat(ele.key, ": defaultValueExp"), _exp3, newEleMap.value);
9298
9307
  }
9299
9308
  if (ele.minExp) {
9300
9309
  var _exp4 = ele.minExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
@@ -9321,7 +9330,7 @@
9321
9330
  * @author Lizhao <lz@winbaoxian.com>
9322
9331
  * @date 2022-04-26
9323
9332
  * @param {IPbPersons} allPersonsData 必传。所有人员数据
9324
- * @param {null|string} type 可不传。
9333
+ * @param {null|string|string[]} type 可不传。
9325
9334
  * 不传,人员数据按原结构返回;
9326
9335
  * 字符串,返回指定的人员数据;
9327
9336
  * 数组,以数组形式,返回多个人员数据。
@@ -9690,10 +9699,10 @@
9690
9699
  * @author Lizhao <lz@winbaoxian.com>
9691
9700
  * @date 2022-04-26
9692
9701
  * @param {IPbProduct} prodData 必传。产品数据(单个)
9693
- * @param {object} productVerifyData 必传。产品校验条件(单个)
9702
+ * @param {object} prodVerifyData 必传。产品校验条件(单个)
9694
9703
  * @param {IPbPersons} personData 必传。人员信息,包括被保人、投保人、投保人配偶
9695
- * @param {object} parmas 补充参数,目前只有 planbookId
9696
- * @returns {IPbProduct} 产品数据(单个)
9704
+ * @param {object} [parmas] 可不传。补充参数,目前只有 planbookId
9705
+ * @returns {Promise<IPbProduct>} 产品数据(单个)
9697
9706
  */
9698
9707
  function productDataHandler(_x, _x2, _x3, _x4) {
9699
9708
  return _productDataHandler.apply(this, arguments);
@@ -9701,6 +9710,7 @@
9701
9710
 
9702
9711
  /**
9703
9712
  * **处理多被保人**
9713
+ * @ignore
9704
9714
  * @author Lizhao <lz@winbaoxian.com>
9705
9715
  * @date 2024-02-28
9706
9716
  * @param {IPbPersons} personData 必传。人员信息,包括被保人、投保人、投保人配偶
@@ -9708,7 +9718,7 @@
9708
9718
  */
9709
9719
  function _productDataHandler() {
9710
9720
  _productDataHandler = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(prodData, prodVerifyData, personData, parmas) {
9711
- var productVerifyData, hasProduct, hasVerifyData, hasPersonData, personOrderList, _prodData$mulInsOrder3;
9721
+ var productVerifyData, _parmas$eventTarget, insuranceKey, elementKey, groupInsurance, groupInsuranceIdEle, subInsurances, hasProduct, hasVerifyData, hasPersonData, personOrderList, _prodData$mulInsOrder3;
9712
9722
  return _regeneratorRuntime.wrap(function (_context) {
9713
9723
  while (1) switch (_context.prev = _context.next) {
9714
9724
  case 0:
@@ -9735,6 +9745,29 @@
9735
9745
  case 3:
9736
9746
  productVerifyData = prodVerifyData;
9737
9747
  case 4:
9748
+ // 组合险种特殊处理:当用户点击组合险种的子险种选项时,将其他子险种的标题设置为未选中状态
9749
+ if (parmas && parmas.eventTarget) {
9750
+ _parmas$eventTarget = parmas.eventTarget, insuranceKey = _parmas$eventTarget.insuranceKey, elementKey = _parmas$eventTarget.elementKey;
9751
+ if (insuranceKey && elementKey === 'insuranceId') {
9752
+ groupInsurance = (prodData.mulInsOrderList || []).find(function (ins) {
9753
+ return ins.key === insuranceKey;
9754
+ });
9755
+ groupInsuranceIdEle = ((groupInsurance === null || groupInsurance === void 0 ? void 0 : groupInsurance.eleOrderList) || []).find(function (e) {
9756
+ return e.key === 'insuranceId';
9757
+ });
9758
+ subInsurances = (prodData.mulInsOrderList || []).filter(function (ins) {
9759
+ return ins.groupKey === insuranceKey;
9760
+ });
9761
+ subInsurances.forEach(function (ins) {
9762
+ var titleEle = (ins.eleOrderList || []).find(function (e) {
9763
+ return e.key === 'title';
9764
+ });
9765
+ if (titleEle && groupInsuranceIdEle && !Array.isArray(titleEle.value)) {
9766
+ titleEle.value = groupInsuranceIdEle.value === ins.key;
9767
+ }
9768
+ });
9769
+ }
9770
+ }
9738
9771
  hasProduct = prodData.mulInsOrderList;
9739
9772
  hasVerifyData = productVerifyData && Object.keys(productVerifyData).length;
9740
9773
  hasPersonData = personData && personData.personOrderList;
@@ -10019,6 +10052,7 @@
10019
10052
 
10020
10053
  /**
10021
10054
  * 请求返回当前产品、当前条件的费率数据
10055
+ * @ignore
10022
10056
  * @author Lizhao <lz@winbaoxian.com>
10023
10057
  * @date 2024-02-28
10024
10058
  * @param {IPbProduct} prodData 必传。产品数据(单个)
@@ -10086,6 +10120,7 @@
10086
10120
 
10087
10121
  /**
10088
10122
  * **多被保人,获取并缓存多个险种信息的费率信息**
10123
+ * @ignore
10089
10124
  * @author Lizhao <lz@winbaoxian.com>
10090
10125
  * @date 2023-12-28
10091
10126
  * @param { any } params 必传。接口请求信息
@@ -10202,40 +10237,21 @@
10202
10237
  * @returns {IPbProduct} 产品数据(单个)
10203
10238
  */
10204
10239
  function setGroupInsurance(prodData) {
10205
- if (!prodData.mulInsOrderList) {
10206
- return prodData;
10207
- }
10208
- var groupInsuranceList = prodData && prodData.mulInsOrderList && prodData.mulInsOrderList.filter(function (ins) {
10209
- return !!ins.groupKey;
10210
- });
10211
- if (!groupInsuranceList || !groupInsuranceList.length) {
10212
- return prodData;
10213
- }
10214
- var oldGroupInsList = prodData.mulInsOrderList.filter(function (ins) {
10215
- return ins.isGroup;
10216
- });
10217
- var newGroupInsMap = {};
10218
- //清空险种列表中的已有的险种组合
10219
- prodData.mulInsOrderList = prodData.mulInsOrderList.filter(function (ins) {
10240
+ var mulInsOrderList = prodData && prodData.mulInsOrderList ? prodData.mulInsOrderList : [];
10241
+ // 清空险种列表中的已有的险种组合
10242
+ prodData.mulInsOrderList = mulInsOrderList.filter(function (ins) {
10220
10243
  return !ins.isGroup;
10221
10244
  });
10222
- groupInsuranceList.forEach(function (ins) {
10223
- //多险种选一,或多险种选多。生成一个组合,如多个险种合成豁免险
10224
- // ins.isCheckbox = true
10225
- var oldGroupIns = oldGroupInsList.find(function (gIns) {
10226
- return gIns.key === ins.groupKey;
10227
- });
10228
- var oldTitleEle = {};
10229
- var oldInsuranceIdEle = {};
10230
- if (oldGroupIns && oldGroupIns.eleOrderList) {
10231
- oldTitleEle = oldGroupIns.eleOrderList.find(function (e) {
10232
- return e.key === 'title';
10233
- });
10234
- oldInsuranceIdEle = oldGroupIns.eleOrderList.find(function (e) {
10235
- return e.key === 'insuranceId';
10236
- });
10237
- }
10238
- if (ins.groupKey) {
10245
+
10246
+ // 多险种选一,或多险种选多。生成一个组合,如多个险种合成豁免险
10247
+ var groupInsuranceList = mulInsOrderList.filter(function (ins) {
10248
+ return !!ins.groupKey;
10249
+ });
10250
+ if (groupInsuranceList.length) {
10251
+ var newGroupInsMap = {};
10252
+ groupInsuranceList.filter(function (ins) {
10253
+ return ins.groupKey;
10254
+ }).forEach(function (ins) {
10239
10255
  newGroupInsMap[ins.groupKey] = newGroupInsMap[ins.groupKey] || {
10240
10256
  key: ins.groupKey,
10241
10257
  name: ins.groupName,
@@ -10243,19 +10259,19 @@
10243
10259
  isGroup: true,
10244
10260
  eleOrderList: [{
10245
10261
  key: 'title',
10246
- value: oldTitleEle && oldTitleEle.value || false,
10262
+ value: false,
10247
10263
  isDisabled: false,
10248
10264
  componentName: 'cmCommonTitle',
10249
10265
  labelName: ins.groupName
10250
10266
  }, {
10251
10267
  key: 'insuranceId',
10252
- value: oldInsuranceIdEle && oldInsuranceIdEle.value || (ins.isCheckbox ? [] : ''),
10268
+ value: ins.isCheckbox ? [] : null,
10253
10269
  componentName: ins.isCheckbox ? 'cmCommonCheckbox' : 'cmCommonRadio',
10254
10270
  opts: []
10255
10271
  }]
10256
10272
  };
10257
10273
 
10258
- // 当险种转换成险种组合的选项
10274
+ // 将子险种转换成险种组合的选项
10259
10275
  var titleEle = ins.eleOrderList.find(function (e) {
10260
10276
  return e.key === 'title';
10261
10277
  });
@@ -10268,119 +10284,73 @@
10268
10284
  desc: titleEle.labelName,
10269
10285
  isDisabled: titleEle.isDisabled
10270
10286
  });
10271
- }
10272
- });
10273
-
10274
- // 处理组合险中的逻辑,并加入到产品险种列表中
10275
- var _loop = function _loop(k) {
10276
- var nGroupTitle = newGroupInsMap[k].eleOrderList.find(function (e) {
10277
- return e.key === 'title';
10278
- });
10279
- var nGroupInsuranceId = newGroupInsMap[k].eleOrderList.find(function (e) {
10280
- return e.key === 'insuranceId';
10281
10287
  });
10282
- if (nGroupTitle && nGroupInsuranceId) {
10283
- if (nGroupInsuranceId.opts && nGroupInsuranceId.opts.length) {
10284
- // 所有险种都不可选,则组合险不可修改且不选中。否则,组合险种可选
10285
- if (nGroupInsuranceId.opts.every(function (opt) {
10286
- return !!opt.isDisabled;
10287
- })) {
10288
- nGroupTitle.value = false;
10289
- nGroupTitle.isDisabled = true;
10290
- } else {
10291
- nGroupTitle.isDisabled = false;
10292
- }
10293
- }
10294
- var groupInsList = prodData.mulInsOrderList.filter(function (ins) {
10288
+
10289
+ // 处理组合险中的逻辑,并加入到产品险种列表中
10290
+ var _loop = function _loop(k) {
10291
+ var nGroupTitleEle = newGroupInsMap[k].eleOrderList.find(function (e) {
10292
+ return e.key === 'title';
10293
+ });
10294
+ var nGroupInsuranceIdEle = newGroupInsMap[k].eleOrderList.find(function (e) {
10295
+ return e.key === 'insuranceId';
10296
+ });
10297
+ var groupInsList = mulInsOrderList.filter(function (ins) {
10295
10298
  return ins.groupKey == k;
10296
10299
  });
10297
- if (groupInsList && groupInsList.length) {
10298
- // 如果组合险中有一款是必选的,则整个组合险为选中状态
10299
- if (groupInsList.some(function (ins) {
10300
- var subTitle = ins.eleOrderList.find(function (e) {
10301
- return e.key === 'title';
10302
- });
10303
- return ins.required && subTitle && !subTitle.isDisabled;
10304
- })) {
10305
- nGroupTitle.value = true;
10306
- nGroupTitle.isDisabled = true;
10307
- }
10308
-
10309
- // 初始化时,设置组合险默认值
10300
+ if (nGroupTitleEle && nGroupInsuranceIdEle && groupInsList.length) {
10310
10301
  var notDisabledInsurances = groupInsList.filter(function (ins) {
10311
- var subTitle = ins.eleOrderList.find(function (e) {
10302
+ var titleEle = (ins.eleOrderList || []).find(function (e) {
10312
10303
  return e.key === 'title';
10313
10304
  });
10314
- return subTitle && !subTitle.isDisabled;
10305
+ return titleEle && !titleEle.isDisabled;
10315
10306
  });
10316
- var checkedInsurances = notDisabledInsurances.find(function (ins) {
10317
- var subTitle = ins.eleOrderList.find(function (e) {
10318
- return e.key === 'title';
10307
+ var checkedInsurances = notDisabledInsurances.filter(function (ins) {
10308
+ var titleEle = (ins.eleOrderList || []).find(function (ele) {
10309
+ return ele.key === 'title';
10319
10310
  });
10320
- return subTitle && subTitle.value;
10311
+ return titleEle && titleEle.value;
10321
10312
  });
10322
- if (!nGroupInsuranceId.value) {
10323
- if (checkedInsurances) {
10324
- nGroupInsuranceId.value = checkedInsurances.key;
10325
- nGroupTitle.value = true;
10326
- } else if (nGroupTitle.value) {
10327
- if (notDisabledInsurances[0]) {
10328
- nGroupInsuranceId.value = notDisabledInsurances[0].key;
10329
- }
10330
- }
10331
- }
10332
- }
10333
- }
10334
- if (nGroupInsuranceId) {
10335
- if (nGroupInsuranceId.value) {
10336
- if (nGroupInsuranceId.value.constructor === Array) {
10337
- if (nGroupInsuranceId.opts) {
10338
- nGroupInsuranceId.opts = nGroupInsuranceId.opts.filter(function (opt) {
10339
- return nGroupInsuranceId.value.indexOf(opt.val) !== -1 && !opt.isDisabled;
10340
- });
10341
- }
10342
- } else {
10343
- var opt = nGroupInsuranceId.opts.find(function (o) {
10344
- return o.val === nGroupInsuranceId.value;
10345
- });
10346
- if (opt && opt.isDisabled) {
10347
- nGroupInsuranceId.value = '';
10348
- }
10349
- }
10350
- }
10351
- if (nGroupInsuranceId.value) {
10352
- var checkedIns = prodData.mulInsOrderList.find(function (ins) {
10353
- return ins.key === nGroupInsuranceId.value;
10313
+ var hasRequiredIns = notDisabledInsurances.some(function (ins) {
10314
+ return ins.required;
10354
10315
  });
10355
- if (checkedIns) {
10356
- //将当前选中险种的部分数据复制到组合险中
10357
- for (var ck in checkedIns) {
10358
- if (!['code', 'groupKey', 'groupName', 'isFollowing', 'key', 'name', 'accountData', 'reduceBaofData', 'duplicateReduceBaofData'].includes(ck)) {
10359
- // 定义组件险中的元素:自身eleOrderList + 所选险种的eleOrderList(不包含标题)
10316
+ var checkedInsurance = checkedInsurances[0];
10317
+ // hasRequiredIns:如果组合险中有一款是必选的,则整个组合险为选中状态
10318
+ // 所有险种都不可选,则组合险不可修改且不选中。否则,组合险种可选
10319
+ nGroupTitleEle.value = hasRequiredIns || (nGroupInsuranceIdEle.opts || []).some(function (opt) {
10320
+ return !opt.isDisabled;
10321
+ });
10322
+ nGroupTitleEle.isDisabled = hasRequiredIns || (nGroupInsuranceIdEle.opts || []).every(function (opt) {
10323
+ return !!opt.isDisabled;
10324
+ });
10325
+ nGroupInsuranceIdEle.value = checkedInsurance ? checkedInsurance.key : null;
10326
+
10327
+ //将当前选中险种的部分数据复制到组合险中
10328
+ if (checkedInsurance) {
10329
+ // 定义组件险中的元素:自身eleOrderList + 所选险种的eleOrderList(不包含标题)
10330
+ var keys = ['code', 'groupKey', 'groupName', 'isFollowing', 'key', 'name', 'accountData', 'reduceBaofData', 'duplicateReduceBaofData'];
10331
+ for (var ck in checkedInsurance) {
10332
+ if (!keys.includes(ck)) {
10360
10333
  if (ck === 'eleOrderList') {
10361
- newGroupInsMap[k][ck] = newGroupInsMap[k][ck].concat(checkedIns[ck].filter(function (ele) {
10334
+ newGroupInsMap[k][ck] = newGroupInsMap[k][ck].concat(checkedInsurance[ck].filter(function (ele) {
10362
10335
  return ele.key !== 'title';
10363
10336
  }));
10364
10337
  } else {
10365
- newGroupInsMap[k][ck] = checkedIns[ck];
10338
+ newGroupInsMap[k][ck] = checkedInsurance[ck];
10366
10339
  }
10367
10340
  }
10368
10341
  }
10369
10342
  }
10370
10343
  }
10371
- }
10372
- var index = -1;
10373
- prodData.mulInsOrderList.forEach(function (ins, i) {
10374
- if (ins.groupKey === k) {
10375
- index = i;
10344
+ var index = mulInsOrderList.findLastIndex(function (ins) {
10345
+ return ins.groupKey === k;
10346
+ });
10347
+ if (index >= 0) {
10348
+ prodData.mulInsOrderList.splice(index + 1, 0, newGroupInsMap[k]);
10376
10349
  }
10377
- });
10378
- if (index >= 0) {
10379
- prodData.mulInsOrderList.splice(index + 1, 0, newGroupInsMap[k]);
10350
+ };
10351
+ for (var k in newGroupInsMap) {
10352
+ _loop(k);
10380
10353
  }
10381
- };
10382
- for (var k in newGroupInsMap) {
10383
- _loop(k);
10384
10354
  }
10385
10355
  return prodData;
10386
10356
  }
@@ -10655,7 +10625,7 @@
10655
10625
  if (insuranceData.title && !insuranceData.groupKey) {
10656
10626
  if (insuranceData.isGroup) {
10657
10627
  //组合险,则遍历其所选中的险种,并转换数据
10658
- var insuranceId = insuranceData.insuranceId.constructor == Array ? insuranceData.insuranceId : [insuranceData.insuranceId];
10628
+ var insuranceId = Array.isArray(insuranceData.insuranceId) ? insuranceData.insuranceId : [insuranceData.insuranceId];
10659
10629
  insuranceId.forEach(function (insId) {
10660
10630
  var checkedIns = prodData.mulInsOrderList.find(function (p) {
10661
10631
  return p.key === insId;
@@ -10874,7 +10844,7 @@
10874
10844
  productForm.mulInsOrderList = productForm.mulInsOrderList.map(function (ins) {
10875
10845
  var tempIns = {};
10876
10846
  for (var _k2 in ins) {
10877
- if (!['isFollowing', 'pPeriodDesc', 'baoeDesc', 'baofDesc', 'iDurationDesc', 'accountData', 'reduceBaofData', 'duplicateReduceBaofData', 'isCheckbox', 'groupKey', 'groupName'].includes(_k2)) {
10847
+ if (!['isFollowing', 'pPeriodDesc', 'baoeDesc', 'baofDesc', 'iDurationDesc', 'accountData', 'reduceBaofData', 'duplicateReduceBaofData', 'isCheckbox', 'groupKey', 'groupName', 'customVariableExp', 'calcResultExp', 'revalidateFlag'].includes(_k2)) {
10878
10848
  tempIns[_k2] = ins[_k2];
10879
10849
  }
10880
10850
  }
@@ -11988,7 +11958,7 @@
11988
11958
  value: function () {
11989
11959
  var _changeProduct = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(productData, options) {
11990
11960
  var _this5 = this;
11991
- var $listeners, inputData, verifyData, personData, groupKey, productKey, params, type, insData, eleData, planbookId, publicPbUuid, productVerifyData, errorMsg, hasRevalidateFlag;
11961
+ var $listeners, inputData, verifyData, personData, groupKey, productKey, params, type, insData, eleData, planbookId, publicPbUuid, productVerifyData, eventTarget, errorMsg, hasRevalidateFlag;
11992
11962
  return _regeneratorRuntime.wrap(function (_context3) {
11993
11963
  while (1) switch (_context3.prev = _context3.next) {
11994
11964
  case 0:
@@ -11997,12 +11967,18 @@
11997
11967
  planbookId = lodash.get(params, 'planbookId');
11998
11968
  publicPbUuid = lodash.get(params, 'publicPbUuid');
11999
11969
  productVerifyData = lodash.get(verifyData, "[".concat(productKey, "]"));
11970
+ eventTarget = {
11971
+ insuranceKey: lodash.get(insData, 'key') || null,
11972
+ insuranceCode: lodash.get(insData, 'code') || null,
11973
+ elementKey: lodash.get(eleData, 'key') || null
11974
+ };
12000
11975
  if (type === 'change') {
12001
11976
  clearAddAndTakeAndAdjustBaoeData(productData);
12002
11977
  }
12003
11978
  _context3.next = 1;
12004
11979
  return productDataHandler(productData, productVerifyData, personData, {
12005
- planbookId: planbookId
11980
+ planbookId: planbookId,
11981
+ eventTarget: eventTarget
12006
11982
  });
12007
11983
  case 1:
12008
11984
  if (type === 'change') {
@@ -12034,7 +12010,8 @@
12034
12010
  publicPbUuid: publicPbUuid,
12035
12011
  groupKey: groupKey,
12036
12012
  productKey: productKey,
12037
- isIgnoreError: true
12013
+ isIgnoreError: true,
12014
+ eventTarget: eventTarget
12038
12015
  }, resolve, reject);
12039
12016
  }).catch(function (err) {
12040
12017
  errorMsg = lodash.get(err, '[0].message') || lodash.get(err, 'message');
@@ -12042,7 +12019,8 @@
12042
12019
  case 2:
12043
12020
  _context3.next = 3;
12044
12021
  return productDataHandler(productData, productVerifyData, personData, {
12045
- planbookId: planbookId
12022
+ planbookId: planbookId,
12023
+ eventTarget: eventTarget
12046
12024
  });
12047
12025
  case 3:
12048
12026
  return _context3.abrupt("return", errorMsg);
@@ -12611,6 +12589,12 @@
12611
12589
  insData: ins,
12612
12590
  eleData: ele
12613
12591
  });
12592
+ },
12593
+ "clear": function clear($event) {
12594
+ return _vm.onChange({
12595
+ insData: ins,
12596
+ eleData: ele
12597
+ });
12614
12598
  }
12615
12599
  },
12616
12600
  scopedSlots: _vm._u([!ele.isDisabled ? {
@@ -42,10 +42,21 @@
42
42
  document && document.cookie && document.cookie.match('ENABLE_LIZHAO_DEBUG=1');
43
43
 
44
44
  /**
45
- * 截取指定字数字符串
46
- * @param str
47
- * @param n
48
- * @returns
45
+ * **截取字符串到指定字数**
46
+ * - 中文字符(及非 `[0-9a-z.()]` 的字符)计为 1 个字符
47
+ * - 数字、小写字母及 `.()` 计为 0.5 个字符
48
+ * - 超出长度时,截取前 n-2 个字符并追加 `...`
49
+ * @author Lizhao <lz@winbaoxian.com>
50
+ * @date 2024-09-10
51
+ * @param {string} str 必传。需要截取的字符串
52
+ * @param {number} n 必传。最大字符数(需大于 2)
53
+ * @returns {string} 截取后的字符串
54
+ * @example
55
+ * textOverflowEllipsis('你好world', 4)
56
+ * // returns 你好...
57
+ *
58
+ * textOverflowEllipsis('hello world', 4)
59
+ * // returns hello world
49
60
  */
50
61
  function textOverflowEllipsis(str, n) {
51
62
  var text = String(str);
@@ -8494,6 +8505,7 @@
8494
8505
 
8495
8506
  /**
8496
8507
  * **多被保人,获取并缓存多个险种信息的费率信息**
8508
+ * @ignore
8497
8509
  * @author Lizhao <lz@winbaoxian.com>
8498
8510
  * @date 2023-12-28
8499
8511
  * @param { any } params 必传。接口请求信息