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.
- package/es/add-and-take/index.js +13 -3
- package/es/adjust-baoe/index.js +3 -2
- package/es/index.js +171 -161
- package/es/insure-calculate/index.js +1 -0
- package/es/person-info/index.js +122 -146
- package/es/product-info/index.js +136 -152
- package/es/share-sheet/index.js +16 -4
- package/es/utils/index.js +144 -154
- package/lib/add-and-take/index.js +13 -3
- package/lib/adjust-baoe/index.js +3 -2
- package/lib/index.js +171 -161
- package/lib/insure-calculate/index.js +1 -0
- package/lib/person-info/index.js +122 -146
- package/lib/product-info/index.js +136 -152
- package/lib/share-sheet/index.js +16 -4
- package/lib/utils/index.js +144 -154
- 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 +48 -20
- package/packages/bxs-utils/planbook/person.ts +1 -1
- package/packages/bxs-utils/planbook/product.ts +70 -124
- 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/index.vue +6 -1
- package/packages/person-info/readme.md +149 -134
- package/packages/planbook-input/helper.js +9 -4
- package/packages/planbook-input/index.vue +5 -1
- package/packages/planbook-input/readme.md +143 -84
- package/packages/product-info/index.vue +12 -3
- package/packages/product-info/readme.md +130 -69
package/es/product-info/index.js
CHANGED
|
@@ -9045,7 +9045,7 @@ function getHuomianPeriodValue() {
|
|
|
9045
9045
|
* **将交费期间或者保险期间的值,转换成数值**
|
|
9046
9046
|
* @author Lizhao <lz@winbaoxian.com>
|
|
9047
9047
|
* @date 2022-04-25
|
|
9048
|
-
* @param {string} value 必传。需要转换的值
|
|
9048
|
+
* @param {string|number} value 必传。需要转换的值
|
|
9049
9049
|
* @param {number} age 0 可不传。被保人年龄
|
|
9050
9050
|
* @returns {number} 数值
|
|
9051
9051
|
* @example
|
|
@@ -9077,7 +9077,7 @@ function getNumberFromYear(value) {
|
|
|
9077
9077
|
* @author Lizhao <lz@winbaoxian.com>
|
|
9078
9078
|
* @date 2022-04-25
|
|
9079
9079
|
* @param {number} value 必传
|
|
9080
|
-
* @returns {string}
|
|
9080
|
+
* @returns {number|string} 满足条件时返回单位为万的字符串,否则返回原数值
|
|
9081
9081
|
* @example
|
|
9082
9082
|
* converUnit10000(1000)
|
|
9083
9083
|
* // returns 1000
|
|
@@ -9135,7 +9135,7 @@ function deepCopy(obj) {
|
|
|
9135
9135
|
* **根据生日算年龄**
|
|
9136
9136
|
* @author Lizhao <lz@winbaoxian.com>
|
|
9137
9137
|
* @date 2022-04-25
|
|
9138
|
-
* @param {Date|timestamp|dateStr} birth
|
|
9138
|
+
* @param {Date|timestamp|dateStr} birth 必传。时间字符串或时间戳
|
|
9139
9139
|
* @param {Date|timestamp|dateStr} cDate 可不传。指定时间,不传默认为当前时间
|
|
9140
9140
|
* @returns {number} 年龄
|
|
9141
9141
|
* @example
|
|
@@ -9181,7 +9181,9 @@ function getExpressionParamMap(personData, product, ins, options) {
|
|
|
9181
9181
|
// 通用信息
|
|
9182
9182
|
customVariable: null,
|
|
9183
9183
|
// 自定义变量
|
|
9184
|
-
cv: null
|
|
9184
|
+
cv: null,
|
|
9185
|
+
// 简写,自定义变量
|
|
9186
|
+
t: {} // 事件目标
|
|
9185
9187
|
};
|
|
9186
9188
|
if (personData) {
|
|
9187
9189
|
var insuredInfo = (personData.personOrderList || []).find(function (p) {
|
|
@@ -9229,8 +9231,13 @@ function getExpressionParamMap(personData, product, ins, options) {
|
|
|
9229
9231
|
});
|
|
9230
9232
|
}
|
|
9231
9233
|
}
|
|
9232
|
-
if (options
|
|
9233
|
-
|
|
9234
|
+
if (options) {
|
|
9235
|
+
if (options.planbookId) {
|
|
9236
|
+
map.planbookId = options.planbookId;
|
|
9237
|
+
}
|
|
9238
|
+
if (options.eventTarget) {
|
|
9239
|
+
map.t = options.eventTarget;
|
|
9240
|
+
}
|
|
9234
9241
|
}
|
|
9235
9242
|
if (ins && ins.customVariableExp) {
|
|
9236
9243
|
var exp = ins.customVariableExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'map.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'map.$2');
|
|
@@ -9261,11 +9268,12 @@ function executeElementRule(personData, product, ins, ele) {
|
|
|
9261
9268
|
}
|
|
9262
9269
|
if (['cmCommonSelect', 'cmCommonRadioBtn', 'cmCommonRadio', 'cmCommonCheckbox'].includes(ele.componentName)) {
|
|
9263
9270
|
if (ele.defaultValueExp) {
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
|
|
9267
|
-
|
|
9271
|
+
var _exp = ele.defaultValueExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
9272
|
+
var expValue = eval(_exp);
|
|
9273
|
+
if (!['', null, undefined].includes(expValue)) {
|
|
9274
|
+
newEleMap.value = expValue;
|
|
9268
9275
|
}
|
|
9276
|
+
consoleLogWhenEnable("".concat(ele.key, ": defaultValueExp"), _exp, newEleMap.value);
|
|
9269
9277
|
}
|
|
9270
9278
|
if (ele.underwriteExp) {
|
|
9271
9279
|
var _exp2 = ele.underwriteExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
@@ -9293,11 +9301,12 @@ function executeElementRule(personData, product, ins, ele) {
|
|
|
9293
9301
|
}
|
|
9294
9302
|
if (['cmCommonInput'].includes(ele.componentName)) {
|
|
9295
9303
|
if (ele.defaultValueExp) {
|
|
9296
|
-
|
|
9297
|
-
|
|
9298
|
-
|
|
9299
|
-
|
|
9304
|
+
var _exp3 = ele.defaultValueExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
9305
|
+
var _expValue = eval(_exp3);
|
|
9306
|
+
if (!['', null, undefined].includes(_expValue)) {
|
|
9307
|
+
newEleMap.value = _expValue;
|
|
9300
9308
|
}
|
|
9309
|
+
consoleLogWhenEnable("".concat(ele.key, ": defaultValueExp"), _exp3, newEleMap.value);
|
|
9301
9310
|
}
|
|
9302
9311
|
if (ele.minExp) {
|
|
9303
9312
|
var _exp4 = ele.minExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
@@ -9324,7 +9333,7 @@ function executeElementRule(personData, product, ins, ele) {
|
|
|
9324
9333
|
* @author Lizhao <lz@winbaoxian.com>
|
|
9325
9334
|
* @date 2022-04-26
|
|
9326
9335
|
* @param {IPbPersons} allPersonsData 必传。所有人员数据
|
|
9327
|
-
* @param {null|string} type 可不传。
|
|
9336
|
+
* @param {null|string|string[]} type 可不传。
|
|
9328
9337
|
* 不传,人员数据按原结构返回;
|
|
9329
9338
|
* 字符串,返回指定的人员数据;
|
|
9330
9339
|
* 数组,以数组形式,返回多个人员数据。
|
|
@@ -9693,10 +9702,10 @@ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t
|
|
|
9693
9702
|
* @author Lizhao <lz@winbaoxian.com>
|
|
9694
9703
|
* @date 2022-04-26
|
|
9695
9704
|
* @param {IPbProduct} prodData 必传。产品数据(单个)
|
|
9696
|
-
* @param {object}
|
|
9705
|
+
* @param {object} prodVerifyData 必传。产品校验条件(单个)
|
|
9697
9706
|
* @param {IPbPersons} personData 必传。人员信息,包括被保人、投保人、投保人配偶
|
|
9698
|
-
* @param {object} parmas
|
|
9699
|
-
* @returns {IPbProduct} 产品数据(单个)
|
|
9707
|
+
* @param {object} [parmas] 可不传。补充参数,目前只有 planbookId
|
|
9708
|
+
* @returns {Promise<IPbProduct>} 产品数据(单个)
|
|
9700
9709
|
*/
|
|
9701
9710
|
function productDataHandler(_x, _x2, _x3, _x4) {
|
|
9702
9711
|
return _productDataHandler.apply(this, arguments);
|
|
@@ -9704,6 +9713,7 @@ function productDataHandler(_x, _x2, _x3, _x4) {
|
|
|
9704
9713
|
|
|
9705
9714
|
/**
|
|
9706
9715
|
* **处理多被保人**
|
|
9716
|
+
* @ignore
|
|
9707
9717
|
* @author Lizhao <lz@winbaoxian.com>
|
|
9708
9718
|
* @date 2024-02-28
|
|
9709
9719
|
* @param {IPbPersons} personData 必传。人员信息,包括被保人、投保人、投保人配偶
|
|
@@ -9711,7 +9721,7 @@ function productDataHandler(_x, _x2, _x3, _x4) {
|
|
|
9711
9721
|
*/
|
|
9712
9722
|
function _productDataHandler() {
|
|
9713
9723
|
_productDataHandler = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(prodData, prodVerifyData, personData, parmas) {
|
|
9714
|
-
var productVerifyData, hasProduct, hasVerifyData, hasPersonData, personOrderList, _prodData$mulInsOrder3;
|
|
9724
|
+
var productVerifyData, _parmas$eventTarget, insuranceKey, elementKey, groupInsurance, groupInsuranceIdEle, subInsurances, hasProduct, hasVerifyData, hasPersonData, personOrderList, _prodData$mulInsOrder3;
|
|
9715
9725
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
9716
9726
|
while (1) switch (_context.prev = _context.next) {
|
|
9717
9727
|
case 0:
|
|
@@ -9738,6 +9748,29 @@ function _productDataHandler() {
|
|
|
9738
9748
|
case 3:
|
|
9739
9749
|
productVerifyData = prodVerifyData;
|
|
9740
9750
|
case 4:
|
|
9751
|
+
// 组合险种特殊处理:当用户点击组合险种的子险种选项时,将其他子险种的标题设置为未选中状态
|
|
9752
|
+
if (parmas && parmas.eventTarget) {
|
|
9753
|
+
_parmas$eventTarget = parmas.eventTarget, insuranceKey = _parmas$eventTarget.insuranceKey, elementKey = _parmas$eventTarget.elementKey;
|
|
9754
|
+
if (insuranceKey && elementKey === 'insuranceId') {
|
|
9755
|
+
groupInsurance = (prodData.mulInsOrderList || []).find(function (ins) {
|
|
9756
|
+
return ins.key === insuranceKey;
|
|
9757
|
+
});
|
|
9758
|
+
groupInsuranceIdEle = ((groupInsurance === null || groupInsurance === void 0 ? void 0 : groupInsurance.eleOrderList) || []).find(function (e) {
|
|
9759
|
+
return e.key === 'insuranceId';
|
|
9760
|
+
});
|
|
9761
|
+
subInsurances = (prodData.mulInsOrderList || []).filter(function (ins) {
|
|
9762
|
+
return ins.groupKey === insuranceKey;
|
|
9763
|
+
});
|
|
9764
|
+
subInsurances.forEach(function (ins) {
|
|
9765
|
+
var titleEle = (ins.eleOrderList || []).find(function (e) {
|
|
9766
|
+
return e.key === 'title';
|
|
9767
|
+
});
|
|
9768
|
+
if (titleEle && groupInsuranceIdEle && !Array.isArray(titleEle.value)) {
|
|
9769
|
+
titleEle.value = groupInsuranceIdEle.value === ins.key;
|
|
9770
|
+
}
|
|
9771
|
+
});
|
|
9772
|
+
}
|
|
9773
|
+
}
|
|
9741
9774
|
hasProduct = prodData.mulInsOrderList;
|
|
9742
9775
|
hasVerifyData = productVerifyData && Object.keys(productVerifyData).length;
|
|
9743
9776
|
hasPersonData = personData && personData.personOrderList;
|
|
@@ -10022,6 +10055,7 @@ function multipleInsuredHandler(personData) {
|
|
|
10022
10055
|
|
|
10023
10056
|
/**
|
|
10024
10057
|
* 请求返回当前产品、当前条件的费率数据
|
|
10058
|
+
* @ignore
|
|
10025
10059
|
* @author Lizhao <lz@winbaoxian.com>
|
|
10026
10060
|
* @date 2024-02-28
|
|
10027
10061
|
* @param {IPbProduct} prodData 必传。产品数据(单个)
|
|
@@ -10089,6 +10123,7 @@ function getSingleInsurancesVerifyData(prodData, personData) {
|
|
|
10089
10123
|
|
|
10090
10124
|
/**
|
|
10091
10125
|
* **多被保人,获取并缓存多个险种信息的费率信息**
|
|
10126
|
+
* @ignore
|
|
10092
10127
|
* @author Lizhao <lz@winbaoxian.com>
|
|
10093
10128
|
* @date 2023-12-28
|
|
10094
10129
|
* @param { any } params 必传。接口请求信息
|
|
@@ -10205,40 +10240,21 @@ function setCommonInfo(prodData) {
|
|
|
10205
10240
|
* @returns {IPbProduct} 产品数据(单个)
|
|
10206
10241
|
*/
|
|
10207
10242
|
function setGroupInsurance(prodData) {
|
|
10208
|
-
|
|
10209
|
-
|
|
10210
|
-
|
|
10211
|
-
var groupInsuranceList = prodData && prodData.mulInsOrderList && prodData.mulInsOrderList.filter(function (ins) {
|
|
10212
|
-
return !!ins.groupKey;
|
|
10213
|
-
});
|
|
10214
|
-
if (!groupInsuranceList || !groupInsuranceList.length) {
|
|
10215
|
-
return prodData;
|
|
10216
|
-
}
|
|
10217
|
-
var oldGroupInsList = prodData.mulInsOrderList.filter(function (ins) {
|
|
10218
|
-
return ins.isGroup;
|
|
10219
|
-
});
|
|
10220
|
-
var newGroupInsMap = {};
|
|
10221
|
-
//清空险种列表中的已有的险种组合
|
|
10222
|
-
prodData.mulInsOrderList = prodData.mulInsOrderList.filter(function (ins) {
|
|
10243
|
+
var mulInsOrderList = prodData && prodData.mulInsOrderList ? prodData.mulInsOrderList : [];
|
|
10244
|
+
// 清空险种列表中的已有的险种组合
|
|
10245
|
+
prodData.mulInsOrderList = mulInsOrderList.filter(function (ins) {
|
|
10223
10246
|
return !ins.isGroup;
|
|
10224
10247
|
});
|
|
10225
|
-
|
|
10226
|
-
|
|
10227
|
-
|
|
10228
|
-
|
|
10229
|
-
|
|
10230
|
-
|
|
10231
|
-
var
|
|
10232
|
-
|
|
10233
|
-
|
|
10234
|
-
|
|
10235
|
-
return e.key === 'title';
|
|
10236
|
-
});
|
|
10237
|
-
oldInsuranceIdEle = oldGroupIns.eleOrderList.find(function (e) {
|
|
10238
|
-
return e.key === 'insuranceId';
|
|
10239
|
-
});
|
|
10240
|
-
}
|
|
10241
|
-
if (ins.groupKey) {
|
|
10248
|
+
|
|
10249
|
+
// 多险种选一,或多险种选多。生成一个组合,如多个险种合成豁免险
|
|
10250
|
+
var groupInsuranceList = mulInsOrderList.filter(function (ins) {
|
|
10251
|
+
return !!ins.groupKey;
|
|
10252
|
+
});
|
|
10253
|
+
if (groupInsuranceList.length) {
|
|
10254
|
+
var newGroupInsMap = {};
|
|
10255
|
+
groupInsuranceList.filter(function (ins) {
|
|
10256
|
+
return ins.groupKey;
|
|
10257
|
+
}).forEach(function (ins) {
|
|
10242
10258
|
newGroupInsMap[ins.groupKey] = newGroupInsMap[ins.groupKey] || {
|
|
10243
10259
|
key: ins.groupKey,
|
|
10244
10260
|
name: ins.groupName,
|
|
@@ -10246,19 +10262,19 @@ function setGroupInsurance(prodData) {
|
|
|
10246
10262
|
isGroup: true,
|
|
10247
10263
|
eleOrderList: [{
|
|
10248
10264
|
key: 'title',
|
|
10249
|
-
value:
|
|
10265
|
+
value: false,
|
|
10250
10266
|
isDisabled: false,
|
|
10251
10267
|
componentName: 'cmCommonTitle',
|
|
10252
10268
|
labelName: ins.groupName
|
|
10253
10269
|
}, {
|
|
10254
10270
|
key: 'insuranceId',
|
|
10255
|
-
value:
|
|
10271
|
+
value: ins.isCheckbox ? [] : null,
|
|
10256
10272
|
componentName: ins.isCheckbox ? 'cmCommonCheckbox' : 'cmCommonRadio',
|
|
10257
10273
|
opts: []
|
|
10258
10274
|
}]
|
|
10259
10275
|
};
|
|
10260
10276
|
|
|
10261
|
-
//
|
|
10277
|
+
// 将子险种转换成险种组合的选项
|
|
10262
10278
|
var titleEle = ins.eleOrderList.find(function (e) {
|
|
10263
10279
|
return e.key === 'title';
|
|
10264
10280
|
});
|
|
@@ -10271,119 +10287,73 @@ function setGroupInsurance(prodData) {
|
|
|
10271
10287
|
desc: titleEle.labelName,
|
|
10272
10288
|
isDisabled: titleEle.isDisabled
|
|
10273
10289
|
});
|
|
10274
|
-
}
|
|
10275
|
-
});
|
|
10276
|
-
|
|
10277
|
-
// 处理组合险中的逻辑,并加入到产品险种列表中
|
|
10278
|
-
var _loop = function _loop(k) {
|
|
10279
|
-
var nGroupTitle = newGroupInsMap[k].eleOrderList.find(function (e) {
|
|
10280
|
-
return e.key === 'title';
|
|
10281
|
-
});
|
|
10282
|
-
var nGroupInsuranceId = newGroupInsMap[k].eleOrderList.find(function (e) {
|
|
10283
|
-
return e.key === 'insuranceId';
|
|
10284
10290
|
});
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
|
|
10291
|
-
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
}
|
|
10296
|
-
}
|
|
10297
|
-
var groupInsList = prodData.mulInsOrderList.filter(function (ins) {
|
|
10291
|
+
|
|
10292
|
+
// 处理组合险中的逻辑,并加入到产品险种列表中
|
|
10293
|
+
var _loop = function _loop(k) {
|
|
10294
|
+
var nGroupTitleEle = newGroupInsMap[k].eleOrderList.find(function (e) {
|
|
10295
|
+
return e.key === 'title';
|
|
10296
|
+
});
|
|
10297
|
+
var nGroupInsuranceIdEle = newGroupInsMap[k].eleOrderList.find(function (e) {
|
|
10298
|
+
return e.key === 'insuranceId';
|
|
10299
|
+
});
|
|
10300
|
+
var groupInsList = mulInsOrderList.filter(function (ins) {
|
|
10298
10301
|
return ins.groupKey == k;
|
|
10299
10302
|
});
|
|
10300
|
-
if (
|
|
10301
|
-
// 如果组合险中有一款是必选的,则整个组合险为选中状态
|
|
10302
|
-
if (groupInsList.some(function (ins) {
|
|
10303
|
-
var subTitle = ins.eleOrderList.find(function (e) {
|
|
10304
|
-
return e.key === 'title';
|
|
10305
|
-
});
|
|
10306
|
-
return ins.required && subTitle && !subTitle.isDisabled;
|
|
10307
|
-
})) {
|
|
10308
|
-
nGroupTitle.value = true;
|
|
10309
|
-
nGroupTitle.isDisabled = true;
|
|
10310
|
-
}
|
|
10311
|
-
|
|
10312
|
-
// 初始化时,设置组合险默认值
|
|
10303
|
+
if (nGroupTitleEle && nGroupInsuranceIdEle && groupInsList.length) {
|
|
10313
10304
|
var notDisabledInsurances = groupInsList.filter(function (ins) {
|
|
10314
|
-
var
|
|
10305
|
+
var titleEle = (ins.eleOrderList || []).find(function (e) {
|
|
10315
10306
|
return e.key === 'title';
|
|
10316
10307
|
});
|
|
10317
|
-
return
|
|
10308
|
+
return titleEle && !titleEle.isDisabled;
|
|
10318
10309
|
});
|
|
10319
|
-
var checkedInsurances = notDisabledInsurances.
|
|
10320
|
-
var
|
|
10321
|
-
return
|
|
10310
|
+
var checkedInsurances = notDisabledInsurances.filter(function (ins) {
|
|
10311
|
+
var titleEle = (ins.eleOrderList || []).find(function (ele) {
|
|
10312
|
+
return ele.key === 'title';
|
|
10322
10313
|
});
|
|
10323
|
-
return
|
|
10314
|
+
return titleEle && titleEle.value;
|
|
10324
10315
|
});
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
nGroupInsuranceId.value = checkedInsurances.key;
|
|
10328
|
-
nGroupTitle.value = true;
|
|
10329
|
-
} else if (nGroupTitle.value) {
|
|
10330
|
-
if (notDisabledInsurances[0]) {
|
|
10331
|
-
nGroupInsuranceId.value = notDisabledInsurances[0].key;
|
|
10332
|
-
}
|
|
10333
|
-
}
|
|
10334
|
-
}
|
|
10335
|
-
}
|
|
10336
|
-
}
|
|
10337
|
-
if (nGroupInsuranceId) {
|
|
10338
|
-
if (nGroupInsuranceId.value) {
|
|
10339
|
-
if (nGroupInsuranceId.value.constructor === Array) {
|
|
10340
|
-
if (nGroupInsuranceId.opts) {
|
|
10341
|
-
nGroupInsuranceId.opts = nGroupInsuranceId.opts.filter(function (opt) {
|
|
10342
|
-
return nGroupInsuranceId.value.indexOf(opt.val) !== -1 && !opt.isDisabled;
|
|
10343
|
-
});
|
|
10344
|
-
}
|
|
10345
|
-
} else {
|
|
10346
|
-
var opt = nGroupInsuranceId.opts.find(function (o) {
|
|
10347
|
-
return o.val === nGroupInsuranceId.value;
|
|
10348
|
-
});
|
|
10349
|
-
if (opt && opt.isDisabled) {
|
|
10350
|
-
nGroupInsuranceId.value = '';
|
|
10351
|
-
}
|
|
10352
|
-
}
|
|
10353
|
-
}
|
|
10354
|
-
if (nGroupInsuranceId.value) {
|
|
10355
|
-
var checkedIns = prodData.mulInsOrderList.find(function (ins) {
|
|
10356
|
-
return ins.key === nGroupInsuranceId.value;
|
|
10316
|
+
var hasRequiredIns = notDisabledInsurances.some(function (ins) {
|
|
10317
|
+
return ins.required;
|
|
10357
10318
|
});
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
|
|
10361
|
-
|
|
10362
|
-
|
|
10319
|
+
var checkedInsurance = checkedInsurances[0];
|
|
10320
|
+
// hasRequiredIns:如果组合险中有一款是必选的,则整个组合险为选中状态
|
|
10321
|
+
// 所有险种都不可选,则组合险不可修改且不选中。否则,组合险种可选
|
|
10322
|
+
nGroupTitleEle.value = hasRequiredIns || (nGroupInsuranceIdEle.opts || []).some(function (opt) {
|
|
10323
|
+
return !opt.isDisabled;
|
|
10324
|
+
});
|
|
10325
|
+
nGroupTitleEle.isDisabled = hasRequiredIns || (nGroupInsuranceIdEle.opts || []).every(function (opt) {
|
|
10326
|
+
return !!opt.isDisabled;
|
|
10327
|
+
});
|
|
10328
|
+
nGroupInsuranceIdEle.value = checkedInsurance ? checkedInsurance.key : null;
|
|
10329
|
+
|
|
10330
|
+
//将当前选中险种的部分数据复制到组合险中
|
|
10331
|
+
if (checkedInsurance) {
|
|
10332
|
+
// 定义组件险中的元素:自身eleOrderList + 所选险种的eleOrderList(不包含标题)
|
|
10333
|
+
var keys = ['code', 'groupKey', 'groupName', 'isFollowing', 'key', 'name', 'accountData', 'reduceBaofData', 'duplicateReduceBaofData'];
|
|
10334
|
+
for (var ck in checkedInsurance) {
|
|
10335
|
+
if (!keys.includes(ck)) {
|
|
10363
10336
|
if (ck === 'eleOrderList') {
|
|
10364
|
-
newGroupInsMap[k][ck] = newGroupInsMap[k][ck].concat(
|
|
10337
|
+
newGroupInsMap[k][ck] = newGroupInsMap[k][ck].concat(checkedInsurance[ck].filter(function (ele) {
|
|
10365
10338
|
return ele.key !== 'title';
|
|
10366
10339
|
}));
|
|
10367
10340
|
} else {
|
|
10368
|
-
newGroupInsMap[k][ck] =
|
|
10341
|
+
newGroupInsMap[k][ck] = checkedInsurance[ck];
|
|
10369
10342
|
}
|
|
10370
10343
|
}
|
|
10371
10344
|
}
|
|
10372
10345
|
}
|
|
10373
10346
|
}
|
|
10374
|
-
|
|
10375
|
-
|
|
10376
|
-
|
|
10377
|
-
if (
|
|
10378
|
-
index
|
|
10347
|
+
var index = mulInsOrderList.findLastIndex(function (ins) {
|
|
10348
|
+
return ins.groupKey === k;
|
|
10349
|
+
});
|
|
10350
|
+
if (index >= 0) {
|
|
10351
|
+
prodData.mulInsOrderList.splice(index + 1, 0, newGroupInsMap[k]);
|
|
10379
10352
|
}
|
|
10380
|
-
}
|
|
10381
|
-
|
|
10382
|
-
|
|
10353
|
+
};
|
|
10354
|
+
for (var k in newGroupInsMap) {
|
|
10355
|
+
_loop(k);
|
|
10383
10356
|
}
|
|
10384
|
-
};
|
|
10385
|
-
for (var k in newGroupInsMap) {
|
|
10386
|
-
_loop(k);
|
|
10387
10357
|
}
|
|
10388
10358
|
return prodData;
|
|
10389
10359
|
}
|
|
@@ -10658,7 +10628,7 @@ function convertProductData(prodData) {
|
|
|
10658
10628
|
if (insuranceData.title && !insuranceData.groupKey) {
|
|
10659
10629
|
if (insuranceData.isGroup) {
|
|
10660
10630
|
//组合险,则遍历其所选中的险种,并转换数据
|
|
10661
|
-
var insuranceId = insuranceData.insuranceId
|
|
10631
|
+
var insuranceId = Array.isArray(insuranceData.insuranceId) ? insuranceData.insuranceId : [insuranceData.insuranceId];
|
|
10662
10632
|
insuranceId.forEach(function (insId) {
|
|
10663
10633
|
var checkedIns = prodData.mulInsOrderList.find(function (p) {
|
|
10664
10634
|
return p.key === insId;
|
|
@@ -10877,7 +10847,7 @@ function createdProductDataToCalc(inputData) {
|
|
|
10877
10847
|
productForm.mulInsOrderList = productForm.mulInsOrderList.map(function (ins) {
|
|
10878
10848
|
var tempIns = {};
|
|
10879
10849
|
for (var _k2 in ins) {
|
|
10880
|
-
if (!['isFollowing', 'pPeriodDesc', 'baoeDesc', 'baofDesc', 'iDurationDesc', 'accountData', 'reduceBaofData', 'duplicateReduceBaofData', 'isCheckbox', 'groupKey', 'groupName'].includes(_k2)) {
|
|
10850
|
+
if (!['isFollowing', 'pPeriodDesc', 'baoeDesc', 'baofDesc', 'iDurationDesc', 'accountData', 'reduceBaofData', 'duplicateReduceBaofData', 'isCheckbox', 'groupKey', 'groupName', 'customVariableExp', 'calcResultExp', 'revalidateFlag'].includes(_k2)) {
|
|
10881
10851
|
tempIns[_k2] = ins[_k2];
|
|
10882
10852
|
}
|
|
10883
10853
|
}
|
|
@@ -11991,7 +11961,7 @@ var BxtProductInfo = (_dec = Component({
|
|
|
11991
11961
|
value: function () {
|
|
11992
11962
|
var _changeProduct = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(productData, options) {
|
|
11993
11963
|
var _this5 = this;
|
|
11994
|
-
var $listeners, inputData, verifyData, personData, groupKey, productKey, params, type, insData, eleData, planbookId, publicPbUuid, productVerifyData, errorMsg, hasRevalidateFlag;
|
|
11964
|
+
var $listeners, inputData, verifyData, personData, groupKey, productKey, params, type, insData, eleData, planbookId, publicPbUuid, productVerifyData, eventTarget, errorMsg, hasRevalidateFlag;
|
|
11995
11965
|
return _regeneratorRuntime.wrap(function (_context3) {
|
|
11996
11966
|
while (1) switch (_context3.prev = _context3.next) {
|
|
11997
11967
|
case 0:
|
|
@@ -12000,12 +11970,18 @@ var BxtProductInfo = (_dec = Component({
|
|
|
12000
11970
|
planbookId = get(params, 'planbookId');
|
|
12001
11971
|
publicPbUuid = get(params, 'publicPbUuid');
|
|
12002
11972
|
productVerifyData = get(verifyData, "[".concat(productKey, "]"));
|
|
11973
|
+
eventTarget = {
|
|
11974
|
+
insuranceKey: get(insData, 'key') || null,
|
|
11975
|
+
insuranceCode: get(insData, 'code') || null,
|
|
11976
|
+
elementKey: get(eleData, 'key') || null
|
|
11977
|
+
};
|
|
12003
11978
|
if (type === 'change') {
|
|
12004
11979
|
clearAddAndTakeAndAdjustBaoeData(productData);
|
|
12005
11980
|
}
|
|
12006
11981
|
_context3.next = 1;
|
|
12007
11982
|
return productDataHandler(productData, productVerifyData, personData, {
|
|
12008
|
-
planbookId: planbookId
|
|
11983
|
+
planbookId: planbookId,
|
|
11984
|
+
eventTarget: eventTarget
|
|
12009
11985
|
});
|
|
12010
11986
|
case 1:
|
|
12011
11987
|
if (type === 'change') {
|
|
@@ -12037,7 +12013,8 @@ var BxtProductInfo = (_dec = Component({
|
|
|
12037
12013
|
publicPbUuid: publicPbUuid,
|
|
12038
12014
|
groupKey: groupKey,
|
|
12039
12015
|
productKey: productKey,
|
|
12040
|
-
isIgnoreError: true
|
|
12016
|
+
isIgnoreError: true,
|
|
12017
|
+
eventTarget: eventTarget
|
|
12041
12018
|
}, resolve, reject);
|
|
12042
12019
|
}).catch(function (err) {
|
|
12043
12020
|
errorMsg = get(err, '[0].message') || get(err, 'message');
|
|
@@ -12045,7 +12022,8 @@ var BxtProductInfo = (_dec = Component({
|
|
|
12045
12022
|
case 2:
|
|
12046
12023
|
_context3.next = 3;
|
|
12047
12024
|
return productDataHandler(productData, productVerifyData, personData, {
|
|
12048
|
-
planbookId: planbookId
|
|
12025
|
+
planbookId: planbookId,
|
|
12026
|
+
eventTarget: eventTarget
|
|
12049
12027
|
});
|
|
12050
12028
|
case 3:
|
|
12051
12029
|
return _context3.abrupt("return", errorMsg);
|
|
@@ -12614,6 +12592,12 @@ var __vue_render__ = function __vue_render__() {
|
|
|
12614
12592
|
insData: ins,
|
|
12615
12593
|
eleData: ele
|
|
12616
12594
|
});
|
|
12595
|
+
},
|
|
12596
|
+
"clear": function clear($event) {
|
|
12597
|
+
return _vm.onChange({
|
|
12598
|
+
insData: ins,
|
|
12599
|
+
eleData: ele
|
|
12600
|
+
});
|
|
12617
12601
|
}
|
|
12618
12602
|
},
|
|
12619
12603
|
scopedSlots: _vm._u([!ele.isDisabled ? {
|
package/es/share-sheet/index.js
CHANGED
|
@@ -47,10 +47,21 @@ function _defineProperty(e, r, t) {
|
|
|
47
47
|
document && document.cookie && document.cookie.match('ENABLE_LIZHAO_DEBUG=1');
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
50
|
+
* **截取字符串到指定字数**
|
|
51
|
+
* - 中文字符(及非 `[0-9a-z.()]` 的字符)计为 1 个字符
|
|
52
|
+
* - 数字、小写字母及 `.()` 计为 0.5 个字符
|
|
53
|
+
* - 超出长度时,截取前 n-2 个字符并追加 `...`
|
|
54
|
+
* @author Lizhao <lz@winbaoxian.com>
|
|
55
|
+
* @date 2024-09-10
|
|
56
|
+
* @param {string} str 必传。需要截取的字符串
|
|
57
|
+
* @param {number} n 必传。最大字符数(需大于 2)
|
|
58
|
+
* @returns {string} 截取后的字符串
|
|
59
|
+
* @example
|
|
60
|
+
* textOverflowEllipsis('你好world', 4)
|
|
61
|
+
* // returns 你好...
|
|
62
|
+
*
|
|
63
|
+
* textOverflowEllipsis('hello world', 4)
|
|
64
|
+
* // returns hello world
|
|
54
65
|
*/
|
|
55
66
|
function textOverflowEllipsis(str, n) {
|
|
56
67
|
var text = String(str);
|
|
@@ -8499,6 +8510,7 @@ function getUrlParams(url) {
|
|
|
8499
8510
|
|
|
8500
8511
|
/**
|
|
8501
8512
|
* **多被保人,获取并缓存多个险种信息的费率信息**
|
|
8513
|
+
* @ignore
|
|
8502
8514
|
* @author Lizhao <lz@winbaoxian.com>
|
|
8503
8515
|
* @date 2023-12-28
|
|
8504
8516
|
* @param { any } params 必传。接口请求信息
|