bxs-tools-ui 3.2.0-1 → 3.2.0-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/add-and-take/index.js +13 -3
- package/es/adjust-baoe/index.js +2 -1
- package/es/index.js +130 -88
- package/es/insure-calculate/index.js +1 -0
- package/es/person-info/index.js +32 -16
- package/es/product-info/index.js +102 -80
- package/es/share-sheet/index.js +16 -4
- package/es/utils/index.js +60 -24
- package/lib/add-and-take/index.js +13 -3
- package/lib/adjust-baoe/index.js +2 -1
- package/lib/index.js +130 -88
- package/lib/insure-calculate/index.js +1 -0
- package/lib/person-info/index.js +32 -16
- package/lib/product-info/index.js +102 -80
- package/lib/share-sheet/index.js +16 -4
- package/lib/utils/index.js +60 -24
- package/package.json +1 -4
- package/packages/add-and-take/readme.md +162 -256
- package/packages/adjust-baoe/readme.md +118 -83
- package/packages/business-card/readme.md +91 -28
- package/packages/bxs-utils/planbook/common.ts +40 -18
- package/packages/bxs-utils/planbook/person.ts +1 -1
- package/packages/bxs-utils/planbook/product.ts +14 -5
- package/packages/bxs-utils/readme.md +407 -425
- package/packages/canvas-poster/readme.md +123 -83
- package/packages/index.ts +1 -1
- package/packages/insure-calculate/readme.md +185 -129
- package/packages/person-info/readme.md +149 -134
- package/packages/planbook-input/readme.md +143 -84
- package/packages/product-info/index.vue +27 -29
- package/packages/product-info/readme.md +130 -69
package/es/add-and-take/index.js
CHANGED
|
@@ -8624,11 +8624,20 @@ var PURPOSE_OPTIONS = [{
|
|
|
8624
8624
|
document && document.cookie && document.cookie.match('ENABLE_LIZHAO_DEBUG=1');
|
|
8625
8625
|
|
|
8626
8626
|
/**
|
|
8627
|
-
*
|
|
8627
|
+
* **将数值转换为千分位格式的字符串**
|
|
8628
8628
|
* @author Lizhao <lz@winbaoxian.com>
|
|
8629
8629
|
* @date 2024-09-10
|
|
8630
|
-
* @param {
|
|
8631
|
-
* @returns
|
|
8630
|
+
* @param {number|string} n 必传。需要转换的数值
|
|
8631
|
+
* @returns {string} 千分位字符串;空值返回空字符串;非数值返回原值
|
|
8632
|
+
* @example
|
|
8633
|
+
* formatNumberToThousand(1234567)
|
|
8634
|
+
* // returns '1,234,567'
|
|
8635
|
+
*
|
|
8636
|
+
* formatNumberToThousand(0)
|
|
8637
|
+
* // returns '0'
|
|
8638
|
+
*
|
|
8639
|
+
* formatNumberToThousand(null)
|
|
8640
|
+
* // returns ''
|
|
8632
8641
|
*/
|
|
8633
8642
|
function formatNumberToThousand(n) {
|
|
8634
8643
|
if (n !== 0 && !n) {
|
|
@@ -8643,6 +8652,7 @@ function formatNumberToThousand(n) {
|
|
|
8643
8652
|
|
|
8644
8653
|
/**
|
|
8645
8654
|
* **多被保人,获取并缓存多个险种信息的费率信息**
|
|
8655
|
+
* @ignore
|
|
8646
8656
|
* @author Lizhao <lz@winbaoxian.com>
|
|
8647
8657
|
* @date 2023-12-28
|
|
8648
8658
|
* @param { any } params 必传。接口请求信息
|
package/es/adjust-baoe/index.js
CHANGED
|
@@ -565,7 +565,7 @@ function deepCopy(obj) {
|
|
|
565
565
|
* @author Lizhao <lz@winbaoxian.com>
|
|
566
566
|
* @date 2022-04-26
|
|
567
567
|
* @param {IPbPersons} allPersonsData 必传。所有人员数据
|
|
568
|
-
* @param {null|string} type 可不传。
|
|
568
|
+
* @param {null|string|string[]} type 可不传。
|
|
569
569
|
* 不传,人员数据按原结构返回;
|
|
570
570
|
* 字符串,返回指定的人员数据;
|
|
571
571
|
* 数组,以数组形式,返回多个人员数据。
|
|
@@ -9047,6 +9047,7 @@ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t
|
|
|
9047
9047
|
|
|
9048
9048
|
/**
|
|
9049
9049
|
* **多被保人,获取并缓存多个险种信息的费率信息**
|
|
9050
|
+
* @ignore
|
|
9050
9051
|
* @author Lizhao <lz@winbaoxian.com>
|
|
9051
9052
|
* @date 2023-12-28
|
|
9052
9053
|
* @param { any } params 必传。接口请求信息
|
package/es/index.js
CHANGED
|
@@ -8754,7 +8754,7 @@ function getHuomianPeriodValue() {
|
|
|
8754
8754
|
* **将交费期间或者保险期间的值,转换成数值**
|
|
8755
8755
|
* @author Lizhao <lz@winbaoxian.com>
|
|
8756
8756
|
* @date 2022-04-25
|
|
8757
|
-
* @param {string} value 必传。需要转换的值
|
|
8757
|
+
* @param {string|number} value 必传。需要转换的值
|
|
8758
8758
|
* @param {number} age 0 可不传。被保人年龄
|
|
8759
8759
|
* @returns {number} 数值
|
|
8760
8760
|
* @example
|
|
@@ -8786,7 +8786,7 @@ function getNumberFromYear(value) {
|
|
|
8786
8786
|
* @author Lizhao <lz@winbaoxian.com>
|
|
8787
8787
|
* @date 2022-04-25
|
|
8788
8788
|
* @param {number} value 必传
|
|
8789
|
-
* @returns {string}
|
|
8789
|
+
* @returns {number|string} 满足条件时返回单位为万的字符串,否则返回原数值
|
|
8790
8790
|
* @example
|
|
8791
8791
|
* converUnit10000(1000)
|
|
8792
8792
|
* // returns 1000
|
|
@@ -8844,7 +8844,7 @@ function deepCopy(obj) {
|
|
|
8844
8844
|
* **根据生日算年龄**
|
|
8845
8845
|
* @author Lizhao <lz@winbaoxian.com>
|
|
8846
8846
|
* @date 2022-04-25
|
|
8847
|
-
* @param {Date|timestamp|dateStr} birth
|
|
8847
|
+
* @param {Date|timestamp|dateStr} birth 必传。时间字符串或时间戳
|
|
8848
8848
|
* @param {Date|timestamp|dateStr} cDate 可不传。指定时间,不传默认为当前时间
|
|
8849
8849
|
* @returns {number} 年龄
|
|
8850
8850
|
* @example
|
|
@@ -8868,11 +8868,20 @@ function getAgeFromBirth(birth, cDate) {
|
|
|
8868
8868
|
}
|
|
8869
8869
|
|
|
8870
8870
|
/**
|
|
8871
|
-
*
|
|
8871
|
+
* **将数值转换为千分位格式的字符串**
|
|
8872
8872
|
* @author Lizhao <lz@winbaoxian.com>
|
|
8873
8873
|
* @date 2024-09-10
|
|
8874
|
-
* @param {
|
|
8875
|
-
* @returns
|
|
8874
|
+
* @param {number|string} n 必传。需要转换的数值
|
|
8875
|
+
* @returns {string} 千分位字符串;空值返回空字符串;非数值返回原值
|
|
8876
|
+
* @example
|
|
8877
|
+
* formatNumberToThousand(1234567)
|
|
8878
|
+
* // returns '1,234,567'
|
|
8879
|
+
*
|
|
8880
|
+
* formatNumberToThousand(0)
|
|
8881
|
+
* // returns '0'
|
|
8882
|
+
*
|
|
8883
|
+
* formatNumberToThousand(null)
|
|
8884
|
+
* // returns ''
|
|
8876
8885
|
*/
|
|
8877
8886
|
function formatNumberToThousand(n) {
|
|
8878
8887
|
if (n !== 0 && !n) {
|
|
@@ -8886,10 +8895,21 @@ function formatNumberToThousand(n) {
|
|
|
8886
8895
|
}
|
|
8887
8896
|
|
|
8888
8897
|
/**
|
|
8889
|
-
*
|
|
8890
|
-
*
|
|
8891
|
-
*
|
|
8892
|
-
*
|
|
8898
|
+
* **截取字符串到指定字数**
|
|
8899
|
+
* - 中文字符(及非 `[0-9a-z.()]` 的字符)计为 1 个字符
|
|
8900
|
+
* - 数字、小写字母及 `.()` 计为 0.5 个字符
|
|
8901
|
+
* - 超出长度时,截取前 n-2 个字符并追加 `...`
|
|
8902
|
+
* @author Lizhao <lz@winbaoxian.com>
|
|
8903
|
+
* @date 2024-09-10
|
|
8904
|
+
* @param {string} str 必传。需要截取的字符串
|
|
8905
|
+
* @param {number} n 必传。最大字符数(需大于 2)
|
|
8906
|
+
* @returns {string} 截取后的字符串
|
|
8907
|
+
* @example
|
|
8908
|
+
* textOverflowEllipsis('你好world', 4)
|
|
8909
|
+
* // returns 你好...
|
|
8910
|
+
*
|
|
8911
|
+
* textOverflowEllipsis('hello world', 4)
|
|
8912
|
+
* // returns hello world
|
|
8893
8913
|
*/
|
|
8894
8914
|
function textOverflowEllipsis(str, n) {
|
|
8895
8915
|
var text = String(str);
|
|
@@ -9014,11 +9034,12 @@ function executeElementRule(personData, product, ins, ele) {
|
|
|
9014
9034
|
}
|
|
9015
9035
|
if (['cmCommonSelect', 'cmCommonRadioBtn', 'cmCommonRadio', 'cmCommonCheckbox'].includes(ele.componentName)) {
|
|
9016
9036
|
if (ele.defaultValueExp) {
|
|
9017
|
-
|
|
9018
|
-
|
|
9019
|
-
|
|
9020
|
-
|
|
9037
|
+
var _exp = ele.defaultValueExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
9038
|
+
var expValue = eval(_exp);
|
|
9039
|
+
if (!['', null, undefined].includes(expValue)) {
|
|
9040
|
+
newEleMap.value = expValue;
|
|
9021
9041
|
}
|
|
9042
|
+
consoleLogWhenEnable("".concat(ele.key, ": defaultValueExp"), _exp, newEleMap.value);
|
|
9022
9043
|
}
|
|
9023
9044
|
if (ele.underwriteExp) {
|
|
9024
9045
|
var _exp2 = ele.underwriteExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
@@ -9046,11 +9067,12 @@ function executeElementRule(personData, product, ins, ele) {
|
|
|
9046
9067
|
}
|
|
9047
9068
|
if (['cmCommonInput'].includes(ele.componentName)) {
|
|
9048
9069
|
if (ele.defaultValueExp) {
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9052
|
-
|
|
9070
|
+
var _exp3 = ele.defaultValueExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
9071
|
+
var _expValue = eval(_exp3);
|
|
9072
|
+
if (!['', null, undefined].includes(_expValue)) {
|
|
9073
|
+
newEleMap.value = _expValue;
|
|
9053
9074
|
}
|
|
9075
|
+
consoleLogWhenEnable("".concat(ele.key, ": defaultValueExp"), _exp3, newEleMap.value);
|
|
9054
9076
|
}
|
|
9055
9077
|
if (ele.minExp) {
|
|
9056
9078
|
var _exp4 = ele.minExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
@@ -9447,7 +9469,7 @@ function setPersonAgeOptions(personData) {
|
|
|
9447
9469
|
* @author Lizhao <lz@winbaoxian.com>
|
|
9448
9470
|
* @date 2022-04-26
|
|
9449
9471
|
* @param {IPbPersons} allPersonsData 必传。所有人员数据
|
|
9450
|
-
* @param {null|string} type 可不传。
|
|
9472
|
+
* @param {null|string|string[]} type 可不传。
|
|
9451
9473
|
* 不传,人员数据按原结构返回;
|
|
9452
9474
|
* 字符串,返回指定的人员数据;
|
|
9453
9475
|
* 数组,以数组形式,返回多个人员数据。
|
|
@@ -9968,10 +9990,10 @@ function initProductData(prodData) {
|
|
|
9968
9990
|
* @author Lizhao <lz@winbaoxian.com>
|
|
9969
9991
|
* @date 2022-04-26
|
|
9970
9992
|
* @param {IPbProduct} prodData 必传。产品数据(单个)
|
|
9971
|
-
* @param {object}
|
|
9993
|
+
* @param {object} prodVerifyData 必传。产品校验条件(单个)
|
|
9972
9994
|
* @param {IPbPersons} personData 必传。人员信息,包括被保人、投保人、投保人配偶
|
|
9973
|
-
* @param {object} parmas
|
|
9974
|
-
* @returns {IPbProduct} 产品数据(单个)
|
|
9995
|
+
* @param {object} [parmas] 可不传。补充参数,目前只有 planbookId
|
|
9996
|
+
* @returns {Promise<IPbProduct>} 产品数据(单个)
|
|
9975
9997
|
*/
|
|
9976
9998
|
function productDataHandler(_x, _x2, _x3, _x4) {
|
|
9977
9999
|
return _productDataHandler.apply(this, arguments);
|
|
@@ -9979,6 +10001,7 @@ function productDataHandler(_x, _x2, _x3, _x4) {
|
|
|
9979
10001
|
|
|
9980
10002
|
/**
|
|
9981
10003
|
* **处理多被保人**
|
|
10004
|
+
* @ignore
|
|
9982
10005
|
* @author Lizhao <lz@winbaoxian.com>
|
|
9983
10006
|
* @date 2024-02-28
|
|
9984
10007
|
* @param {IPbPersons} personData 必传。人员信息,包括被保人、投保人、投保人配偶
|
|
@@ -10030,7 +10053,7 @@ function _productDataHandler() {
|
|
|
10030
10053
|
var titleEle = (ins.eleOrderList || []).find(function (e) {
|
|
10031
10054
|
return e.key === 'title';
|
|
10032
10055
|
});
|
|
10033
|
-
if (titleEle && groupInsuranceIdEle && !Array.isArray(
|
|
10056
|
+
if (titleEle && groupInsuranceIdEle && !Array.isArray(groupInsuranceIdEle.value)) {
|
|
10034
10057
|
titleEle.value = groupInsuranceIdEle.value === ins.key;
|
|
10035
10058
|
}
|
|
10036
10059
|
});
|
|
@@ -10320,6 +10343,7 @@ function multipleInsuredHandler(personData) {
|
|
|
10320
10343
|
|
|
10321
10344
|
/**
|
|
10322
10345
|
* 请求返回当前产品、当前条件的费率数据
|
|
10346
|
+
* @ignore
|
|
10323
10347
|
* @author Lizhao <lz@winbaoxian.com>
|
|
10324
10348
|
* @date 2024-02-28
|
|
10325
10349
|
* @param {IPbProduct} prodData 必传。产品数据(单个)
|
|
@@ -10387,6 +10411,7 @@ function getSingleInsurancesVerifyData(prodData, personData) {
|
|
|
10387
10411
|
|
|
10388
10412
|
/**
|
|
10389
10413
|
* **多被保人,获取并缓存多个险种信息的费率信息**
|
|
10414
|
+
* @ignore
|
|
10390
10415
|
* @author Lizhao <lz@winbaoxian.com>
|
|
10391
10416
|
* @date 2023-12-28
|
|
10392
10417
|
* @param { any } params 必传。接口请求信息
|
|
@@ -10554,6 +10579,14 @@ function setGroupInsurance(prodData) {
|
|
|
10554
10579
|
|
|
10555
10580
|
// 处理组合险中的逻辑,并加入到产品险种列表中
|
|
10556
10581
|
var _loop = function _loop(k) {
|
|
10582
|
+
var _oldGroupInsurance$el;
|
|
10583
|
+
var oldGroupInsurance = mulInsOrderList.find(function (ins) {
|
|
10584
|
+
return ins.key === k;
|
|
10585
|
+
});
|
|
10586
|
+
var oldGroupTitleElement = oldGroupInsurance ? (_oldGroupInsurance$el = oldGroupInsurance.eleOrderList) === null || _oldGroupInsurance$el === void 0 ? void 0 : _oldGroupInsurance$el.find(function (e) {
|
|
10587
|
+
return e.key === 'title';
|
|
10588
|
+
}) : null;
|
|
10589
|
+
var oldGroupTitleValue = oldGroupTitleElement ? oldGroupTitleElement.value : null;
|
|
10557
10590
|
var nGroupTitleEle = newGroupInsMap[k].eleOrderList.find(function (e) {
|
|
10558
10591
|
return e.key === 'title';
|
|
10559
10592
|
});
|
|
@@ -10582,9 +10615,12 @@ function setGroupInsurance(prodData) {
|
|
|
10582
10615
|
var checkedInsurance = checkedInsurances[0];
|
|
10583
10616
|
// hasRequiredIns:如果组合险中有一款是必选的,则整个组合险为选中状态
|
|
10584
10617
|
// 所有险种都不可选,则组合险不可修改且不选中。否则,组合险种可选
|
|
10585
|
-
nGroupTitleEle.value =
|
|
10618
|
+
nGroupTitleEle.value = oldGroupTitleValue === false ? oldGroupTitleValue : (nGroupInsuranceIdEle.opts || []).some(function (opt) {
|
|
10586
10619
|
return !opt.isDisabled;
|
|
10587
10620
|
});
|
|
10621
|
+
if (hasRequiredIns) {
|
|
10622
|
+
nGroupTitleEle.value = hasRequiredIns;
|
|
10623
|
+
}
|
|
10588
10624
|
nGroupTitleEle.isDisabled = hasRequiredIns || (nGroupInsuranceIdEle.opts || []).every(function (opt) {
|
|
10589
10625
|
return !!opt.isDisabled;
|
|
10590
10626
|
});
|
|
@@ -46950,12 +46986,6 @@ var BxtProductInfo = (_dec = Component({
|
|
|
46950
46986
|
if (!['title'].includes(eleData.key)) {
|
|
46951
46987
|
this.requiestRecommendValues();
|
|
46952
46988
|
}
|
|
46953
|
-
setTimeout(function () {
|
|
46954
|
-
var refInsuranceForm = get$3(_this4.$refs, "insuranceForm".concat(insData.key, "[0]"));
|
|
46955
|
-
if (refInsuranceForm) {
|
|
46956
|
-
refInsuranceForm.validate(eleData.key);
|
|
46957
|
-
}
|
|
46958
|
-
}, 300);
|
|
46959
46989
|
this.$nextTick(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
46960
46990
|
var errorMsg;
|
|
46961
46991
|
return _regeneratorRuntime.wrap(function (_context2) {
|
|
@@ -46987,11 +47017,11 @@ var BxtProductInfo = (_dec = Component({
|
|
|
46987
47017
|
}, {
|
|
46988
47018
|
key: "changeProduct",
|
|
46989
47019
|
value: function () {
|
|
46990
|
-
var _changeProduct = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
47020
|
+
var _changeProduct = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(productData, options) {
|
|
46991
47021
|
var _this5 = this;
|
|
46992
|
-
var $listeners, inputData, verifyData, personData, groupKey, productKey, params, type, insData, eleData, planbookId, publicPbUuid, productVerifyData, eventTarget, errorMsg
|
|
46993
|
-
return _regeneratorRuntime.wrap(function (
|
|
46994
|
-
while (1) switch (
|
|
47022
|
+
var $listeners, inputData, verifyData, personData, groupKey, productKey, params, type, insData, eleData, planbookId, publicPbUuid, productVerifyData, eventTarget, errorMsg;
|
|
47023
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
47024
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
46995
47025
|
case 0:
|
|
46996
47026
|
$listeners = this.$listeners, inputData = this.inputData, verifyData = this.verifyData, personData = this.personData, groupKey = this.groupKey, productKey = this.productKey, params = this.params;
|
|
46997
47027
|
type = options.type, insData = options.insData, eleData = options.eleData;
|
|
@@ -47006,7 +47036,7 @@ var BxtProductInfo = (_dec = Component({
|
|
|
47006
47036
|
if (type === 'change') {
|
|
47007
47037
|
clearAddAndTakeAndAdjustBaoeData(productData);
|
|
47008
47038
|
}
|
|
47009
|
-
|
|
47039
|
+
_context4.next = 1;
|
|
47010
47040
|
return productDataHandler(productData, productVerifyData, personData, {
|
|
47011
47041
|
planbookId: planbookId,
|
|
47012
47042
|
eventTarget: eventTarget
|
|
@@ -47024,42 +47054,54 @@ var BxtProductInfo = (_dec = Component({
|
|
|
47024
47054
|
eleData: eleData
|
|
47025
47055
|
});
|
|
47026
47056
|
if (errorMsg) {
|
|
47027
|
-
|
|
47028
|
-
break;
|
|
47029
|
-
}
|
|
47030
|
-
hasRevalidateFlag = (get$3(productData, 'mulInsOrderList') || []).some(function (ins) {
|
|
47031
|
-
return ins.revalidateFlag;
|
|
47032
|
-
});
|
|
47033
|
-
if (!(hasRevalidateFlag && $listeners.reCalculate)) {
|
|
47034
|
-
_context3.next = 3;
|
|
47057
|
+
_context4.next = 2;
|
|
47035
47058
|
break;
|
|
47036
47059
|
}
|
|
47037
|
-
|
|
47038
|
-
return
|
|
47039
|
-
|
|
47040
|
-
|
|
47041
|
-
|
|
47042
|
-
|
|
47043
|
-
|
|
47044
|
-
|
|
47045
|
-
|
|
47046
|
-
|
|
47047
|
-
|
|
47048
|
-
|
|
47049
|
-
|
|
47060
|
+
_context4.next = 2;
|
|
47061
|
+
return this.validate().then(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
47062
|
+
var hasRevalidateFlag;
|
|
47063
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
47064
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
47065
|
+
case 0:
|
|
47066
|
+
hasRevalidateFlag = (get$3(productData, 'mulInsOrderList') || []).some(function (ins) {
|
|
47067
|
+
return ins.revalidateFlag;
|
|
47068
|
+
});
|
|
47069
|
+
if (!(hasRevalidateFlag && $listeners.reCalculate)) {
|
|
47070
|
+
_context3.next = 2;
|
|
47071
|
+
break;
|
|
47072
|
+
}
|
|
47073
|
+
_context3.next = 1;
|
|
47074
|
+
return new Promise(function (resolve, reject) {
|
|
47075
|
+
_this5.$emit('reCalculate', inputData, {
|
|
47076
|
+
planbookId: planbookId,
|
|
47077
|
+
publicPbUuid: publicPbUuid,
|
|
47078
|
+
groupKey: groupKey,
|
|
47079
|
+
productKey: productKey,
|
|
47080
|
+
isIgnoreError: true,
|
|
47081
|
+
eventTarget: eventTarget
|
|
47082
|
+
}, resolve, reject);
|
|
47083
|
+
}).catch(function (err) {
|
|
47084
|
+
errorMsg = get$3(err, '[0].message') || get$3(err, 'message');
|
|
47085
|
+
});
|
|
47086
|
+
case 1:
|
|
47087
|
+
_context3.next = 2;
|
|
47088
|
+
return productDataHandler(productData, productVerifyData, personData, {
|
|
47089
|
+
planbookId: planbookId,
|
|
47090
|
+
eventTarget: eventTarget
|
|
47091
|
+
});
|
|
47092
|
+
case 2:
|
|
47093
|
+
case "end":
|
|
47094
|
+
return _context3.stop();
|
|
47095
|
+
}
|
|
47096
|
+
}, _callee3);
|
|
47097
|
+
}))).catch(function () {});
|
|
47050
47098
|
case 2:
|
|
47051
|
-
|
|
47052
|
-
return productDataHandler(productData, productVerifyData, personData, {
|
|
47053
|
-
planbookId: planbookId,
|
|
47054
|
-
eventTarget: eventTarget
|
|
47055
|
-
});
|
|
47099
|
+
return _context4.abrupt("return", errorMsg);
|
|
47056
47100
|
case 3:
|
|
47057
|
-
return _context3.abrupt("return", errorMsg);
|
|
47058
|
-
case 4:
|
|
47059
47101
|
case "end":
|
|
47060
|
-
return
|
|
47102
|
+
return _context4.stop();
|
|
47061
47103
|
}
|
|
47062
|
-
},
|
|
47104
|
+
}, _callee4, this);
|
|
47063
47105
|
}));
|
|
47064
47106
|
function changeProduct(_x, _x2) {
|
|
47065
47107
|
return _changeProduct.apply(this, arguments);
|
|
@@ -47194,16 +47236,16 @@ var BxtProductInfo = (_dec = Component({
|
|
|
47194
47236
|
}, {
|
|
47195
47237
|
key: "validate",
|
|
47196
47238
|
value: function () {
|
|
47197
|
-
var _validate = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
47239
|
+
var _validate = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
47198
47240
|
var $refs, filterInsuranceList, insKeys;
|
|
47199
|
-
return _regeneratorRuntime.wrap(function (
|
|
47200
|
-
while (1) switch (
|
|
47241
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
47242
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
47201
47243
|
case 0:
|
|
47202
47244
|
$refs = this.$refs, filterInsuranceList = this.filterInsuranceList;
|
|
47203
47245
|
insKeys = filterInsuranceList.map(function (ins) {
|
|
47204
47246
|
return ins.key;
|
|
47205
47247
|
});
|
|
47206
|
-
return
|
|
47248
|
+
return _context5.abrupt("return", new Promise(function (resolve, reject) {
|
|
47207
47249
|
setTimeout(function () {
|
|
47208
47250
|
var promises = [];
|
|
47209
47251
|
var _iterator = _createForOfIteratorHelper(insKeys),
|
|
@@ -47230,9 +47272,9 @@ var BxtProductInfo = (_dec = Component({
|
|
|
47230
47272
|
}));
|
|
47231
47273
|
case 1:
|
|
47232
47274
|
case "end":
|
|
47233
|
-
return
|
|
47275
|
+
return _context5.stop();
|
|
47234
47276
|
}
|
|
47235
|
-
},
|
|
47277
|
+
}, _callee5, this);
|
|
47236
47278
|
}));
|
|
47237
47279
|
function validate() {
|
|
47238
47280
|
return _validate.apply(this, arguments);
|
|
@@ -47261,27 +47303,27 @@ var BxtProductInfo = (_dec = Component({
|
|
|
47261
47303
|
}, {
|
|
47262
47304
|
key: "requiestRecommendValues",
|
|
47263
47305
|
value: function () {
|
|
47264
|
-
var _requiestRecommendValues = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
47306
|
+
var _requiestRecommendValues = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
47265
47307
|
var self, showRecommendValue, recommendValuesCache, inputData, groupData, productData, url, calcData, reqParams, calcInputData, calcProductData;
|
|
47266
|
-
return _regeneratorRuntime.wrap(function (
|
|
47267
|
-
while (1) switch (
|
|
47308
|
+
return _regeneratorRuntime.wrap(function (_context6) {
|
|
47309
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
47268
47310
|
case 0:
|
|
47269
47311
|
self = this;
|
|
47270
47312
|
showRecommendValue = self.showRecommendValue, recommendValuesCache = self.recommendValuesCache, inputData = self.inputData, groupData = self.groupData, productData = self.productData;
|
|
47271
47313
|
if (showRecommendValue) {
|
|
47272
|
-
|
|
47314
|
+
_context6.next = 1;
|
|
47273
47315
|
break;
|
|
47274
47316
|
}
|
|
47275
|
-
return
|
|
47317
|
+
return _context6.abrupt("return");
|
|
47276
47318
|
case 1:
|
|
47277
47319
|
url = "".concat(PLANBOOK_API_HOSTNAME, "/planBook/input/calculate/recommend");
|
|
47278
|
-
|
|
47320
|
+
_context6.next = 2;
|
|
47279
47321
|
return createdProductDataToCalc(inputData, {
|
|
47280
47322
|
groupKey: groupData.key,
|
|
47281
47323
|
productKey: productData.key
|
|
47282
47324
|
}).catch(function () {});
|
|
47283
47325
|
case 2:
|
|
47284
|
-
calcData =
|
|
47326
|
+
calcData = _context6.sent;
|
|
47285
47327
|
reqParams = [];
|
|
47286
47328
|
calcInputData = calcData && JSON.parse(calcData.jd);
|
|
47287
47329
|
calcProductData = calcInputData && calcInputData.productGroupList[0].prodOrderList[0];
|
|
@@ -47295,13 +47337,13 @@ var BxtProductInfo = (_dec = Component({
|
|
|
47295
47337
|
});
|
|
47296
47338
|
}
|
|
47297
47339
|
if (!recommendValuesCache[JSON.stringify(reqParams)]) {
|
|
47298
|
-
|
|
47340
|
+
_context6.next = 3;
|
|
47299
47341
|
break;
|
|
47300
47342
|
}
|
|
47301
47343
|
self.recommendValues = recommendValuesCache[JSON.stringify(reqParams)];
|
|
47302
|
-
return
|
|
47344
|
+
return _context6.abrupt("return");
|
|
47303
47345
|
case 3:
|
|
47304
|
-
return
|
|
47346
|
+
return _context6.abrupt("return", fetch(url, {
|
|
47305
47347
|
method: 'POST',
|
|
47306
47348
|
credentials: 'include',
|
|
47307
47349
|
headers: {
|
|
@@ -47311,10 +47353,10 @@ var BxtProductInfo = (_dec = Component({
|
|
|
47311
47353
|
body: JSON.stringify(reqParams)
|
|
47312
47354
|
}).then(function (response) {
|
|
47313
47355
|
return response.json();
|
|
47314
|
-
}).then(function (
|
|
47315
|
-
var success =
|
|
47316
|
-
data =
|
|
47317
|
-
info =
|
|
47356
|
+
}).then(function (_ref4) {
|
|
47357
|
+
var success = _ref4.success,
|
|
47358
|
+
data = _ref4.data,
|
|
47359
|
+
info = _ref4.info;
|
|
47318
47360
|
if (!success || !data) {
|
|
47319
47361
|
self.$toast(info);
|
|
47320
47362
|
return Promise.reject();
|
|
@@ -47355,9 +47397,9 @@ var BxtProductInfo = (_dec = Component({
|
|
|
47355
47397
|
}));
|
|
47356
47398
|
case 4:
|
|
47357
47399
|
case "end":
|
|
47358
|
-
return
|
|
47400
|
+
return _context6.stop();
|
|
47359
47401
|
}
|
|
47360
|
-
},
|
|
47402
|
+
}, _callee6, this);
|
|
47361
47403
|
}));
|
|
47362
47404
|
function requiestRecommendValues() {
|
|
47363
47405
|
return _requiestRecommendValues.apply(this, arguments);
|
|
@@ -48310,7 +48352,7 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
48310
48352
|
install(window.Vue);
|
|
48311
48353
|
}
|
|
48312
48354
|
const index = {
|
|
48313
|
-
version: '3.2.0-
|
|
48355
|
+
version: '3.2.0-3',
|
|
48314
48356
|
install: install
|
|
48315
48357
|
};
|
|
48316
48358
|
|
|
@@ -37353,6 +37353,7 @@ document && document.cookie && document.cookie.match('ENABLE_LIZHAO_DEBUG=1');
|
|
|
37353
37353
|
|
|
37354
37354
|
/**
|
|
37355
37355
|
* **多被保人,获取并缓存多个险种信息的费率信息**
|
|
37356
|
+
* @ignore
|
|
37356
37357
|
* @author Lizhao <lz@winbaoxian.com>
|
|
37357
37358
|
* @date 2023-12-28
|
|
37358
37359
|
* @param { any } params 必传。接口请求信息
|
package/es/person-info/index.js
CHANGED
|
@@ -1041,7 +1041,7 @@ function getHuomianPeriodValue() {
|
|
|
1041
1041
|
* @author Lizhao <lz@winbaoxian.com>
|
|
1042
1042
|
* @date 2022-04-25
|
|
1043
1043
|
* @param {number} value 必传
|
|
1044
|
-
* @returns {string}
|
|
1044
|
+
* @returns {number|string} 满足条件时返回单位为万的字符串,否则返回原数值
|
|
1045
1045
|
* @example
|
|
1046
1046
|
* converUnit10000(1000)
|
|
1047
1047
|
* // returns 1000
|
|
@@ -1099,7 +1099,7 @@ function deepCopy(obj) {
|
|
|
1099
1099
|
* **根据生日算年龄**
|
|
1100
1100
|
* @author Lizhao <lz@winbaoxian.com>
|
|
1101
1101
|
* @date 2022-04-25
|
|
1102
|
-
* @param {Date|timestamp|dateStr} birth
|
|
1102
|
+
* @param {Date|timestamp|dateStr} birth 必传。时间字符串或时间戳
|
|
1103
1103
|
* @param {Date|timestamp|dateStr} cDate 可不传。指定时间,不传默认为当前时间
|
|
1104
1104
|
* @returns {number} 年龄
|
|
1105
1105
|
* @example
|
|
@@ -1232,11 +1232,12 @@ function executeElementRule(personData, product, ins, ele) {
|
|
|
1232
1232
|
}
|
|
1233
1233
|
if (['cmCommonSelect', 'cmCommonRadioBtn', 'cmCommonRadio', 'cmCommonCheckbox'].includes(ele.componentName)) {
|
|
1234
1234
|
if (ele.defaultValueExp) {
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1235
|
+
var _exp = ele.defaultValueExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1236
|
+
var expValue = eval(_exp);
|
|
1237
|
+
if (!['', null, undefined].includes(expValue)) {
|
|
1238
|
+
newEleMap.value = expValue;
|
|
1239
1239
|
}
|
|
1240
|
+
consoleLogWhenEnable("".concat(ele.key, ": defaultValueExp"), _exp, newEleMap.value);
|
|
1240
1241
|
}
|
|
1241
1242
|
if (ele.underwriteExp) {
|
|
1242
1243
|
var _exp2 = ele.underwriteExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
@@ -1264,11 +1265,12 @@ function executeElementRule(personData, product, ins, ele) {
|
|
|
1264
1265
|
}
|
|
1265
1266
|
if (['cmCommonInput'].includes(ele.componentName)) {
|
|
1266
1267
|
if (ele.defaultValueExp) {
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1268
|
+
var _exp3 = ele.defaultValueExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1269
|
+
var _expValue = eval(_exp3);
|
|
1270
|
+
if (!['', null, undefined].includes(_expValue)) {
|
|
1271
|
+
newEleMap.value = _expValue;
|
|
1271
1272
|
}
|
|
1273
|
+
consoleLogWhenEnable("".concat(ele.key, ": defaultValueExp"), _exp3, newEleMap.value);
|
|
1272
1274
|
}
|
|
1273
1275
|
if (ele.minExp) {
|
|
1274
1276
|
var _exp4 = ele.minExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
@@ -1438,7 +1440,7 @@ function setPersonAgeOptions(personData) {
|
|
|
1438
1440
|
* @author Lizhao <lz@winbaoxian.com>
|
|
1439
1441
|
* @date 2022-04-26
|
|
1440
1442
|
* @param {IPbPersons} allPersonsData 必传。所有人员数据
|
|
1441
|
-
* @param {null|string} type 可不传。
|
|
1443
|
+
* @param {null|string|string[]} type 可不传。
|
|
1442
1444
|
* 不传,人员数据按原结构返回;
|
|
1443
1445
|
* 字符串,返回指定的人员数据;
|
|
1444
1446
|
* 数组,以数组形式,返回多个人员数据。
|
|
@@ -9726,10 +9728,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
9726
9728
|
* @author Lizhao <lz@winbaoxian.com>
|
|
9727
9729
|
* @date 2022-04-26
|
|
9728
9730
|
* @param {IPbProduct} prodData 必传。产品数据(单个)
|
|
9729
|
-
* @param {object}
|
|
9731
|
+
* @param {object} prodVerifyData 必传。产品校验条件(单个)
|
|
9730
9732
|
* @param {IPbPersons} personData 必传。人员信息,包括被保人、投保人、投保人配偶
|
|
9731
|
-
* @param {object} parmas
|
|
9732
|
-
* @returns {IPbProduct} 产品数据(单个)
|
|
9733
|
+
* @param {object} [parmas] 可不传。补充参数,目前只有 planbookId
|
|
9734
|
+
* @returns {Promise<IPbProduct>} 产品数据(单个)
|
|
9733
9735
|
*/
|
|
9734
9736
|
function productDataHandler(_x, _x2, _x3, _x4) {
|
|
9735
9737
|
return _productDataHandler.apply(this, arguments);
|
|
@@ -9737,6 +9739,7 @@ function productDataHandler(_x, _x2, _x3, _x4) {
|
|
|
9737
9739
|
|
|
9738
9740
|
/**
|
|
9739
9741
|
* **处理多被保人**
|
|
9742
|
+
* @ignore
|
|
9740
9743
|
* @author Lizhao <lz@winbaoxian.com>
|
|
9741
9744
|
* @date 2024-02-28
|
|
9742
9745
|
* @param {IPbPersons} personData 必传。人员信息,包括被保人、投保人、投保人配偶
|
|
@@ -9788,7 +9791,7 @@ function _productDataHandler() {
|
|
|
9788
9791
|
var titleEle = (ins.eleOrderList || []).find(function (e) {
|
|
9789
9792
|
return e.key === 'title';
|
|
9790
9793
|
});
|
|
9791
|
-
if (titleEle && groupInsuranceIdEle && !Array.isArray(
|
|
9794
|
+
if (titleEle && groupInsuranceIdEle && !Array.isArray(groupInsuranceIdEle.value)) {
|
|
9792
9795
|
titleEle.value = groupInsuranceIdEle.value === ins.key;
|
|
9793
9796
|
}
|
|
9794
9797
|
});
|
|
@@ -10078,6 +10081,7 @@ function multipleInsuredHandler(personData) {
|
|
|
10078
10081
|
|
|
10079
10082
|
/**
|
|
10080
10083
|
* 请求返回当前产品、当前条件的费率数据
|
|
10084
|
+
* @ignore
|
|
10081
10085
|
* @author Lizhao <lz@winbaoxian.com>
|
|
10082
10086
|
* @date 2024-02-28
|
|
10083
10087
|
* @param {IPbProduct} prodData 必传。产品数据(单个)
|
|
@@ -10145,6 +10149,7 @@ function getSingleInsurancesVerifyData(prodData, personData) {
|
|
|
10145
10149
|
|
|
10146
10150
|
/**
|
|
10147
10151
|
* **多被保人,获取并缓存多个险种信息的费率信息**
|
|
10152
|
+
* @ignore
|
|
10148
10153
|
* @author Lizhao <lz@winbaoxian.com>
|
|
10149
10154
|
* @date 2023-12-28
|
|
10150
10155
|
* @param { any } params 必传。接口请求信息
|
|
@@ -10312,6 +10317,14 @@ function setGroupInsurance(prodData) {
|
|
|
10312
10317
|
|
|
10313
10318
|
// 处理组合险中的逻辑,并加入到产品险种列表中
|
|
10314
10319
|
var _loop = function _loop(k) {
|
|
10320
|
+
var _oldGroupInsurance$el;
|
|
10321
|
+
var oldGroupInsurance = mulInsOrderList.find(function (ins) {
|
|
10322
|
+
return ins.key === k;
|
|
10323
|
+
});
|
|
10324
|
+
var oldGroupTitleElement = oldGroupInsurance ? (_oldGroupInsurance$el = oldGroupInsurance.eleOrderList) === null || _oldGroupInsurance$el === void 0 ? void 0 : _oldGroupInsurance$el.find(function (e) {
|
|
10325
|
+
return e.key === 'title';
|
|
10326
|
+
}) : null;
|
|
10327
|
+
var oldGroupTitleValue = oldGroupTitleElement ? oldGroupTitleElement.value : null;
|
|
10315
10328
|
var nGroupTitleEle = newGroupInsMap[k].eleOrderList.find(function (e) {
|
|
10316
10329
|
return e.key === 'title';
|
|
10317
10330
|
});
|
|
@@ -10340,9 +10353,12 @@ function setGroupInsurance(prodData) {
|
|
|
10340
10353
|
var checkedInsurance = checkedInsurances[0];
|
|
10341
10354
|
// hasRequiredIns:如果组合险中有一款是必选的,则整个组合险为选中状态
|
|
10342
10355
|
// 所有险种都不可选,则组合险不可修改且不选中。否则,组合险种可选
|
|
10343
|
-
nGroupTitleEle.value =
|
|
10356
|
+
nGroupTitleEle.value = oldGroupTitleValue === false ? oldGroupTitleValue : (nGroupInsuranceIdEle.opts || []).some(function (opt) {
|
|
10344
10357
|
return !opt.isDisabled;
|
|
10345
10358
|
});
|
|
10359
|
+
if (hasRequiredIns) {
|
|
10360
|
+
nGroupTitleEle.value = hasRequiredIns;
|
|
10361
|
+
}
|
|
10346
10362
|
nGroupTitleEle.isDisabled = hasRequiredIns || (nGroupInsuranceIdEle.opts || []).every(function (opt) {
|
|
10347
10363
|
return !!opt.isDisabled;
|
|
10348
10364
|
});
|