bxs-tools-ui 3.1.2 → 3.2.0-0
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 +2 -4
- package/es/adjust-baoe/index.js +2 -4
- package/es/index.css +1 -1
- package/es/index.js +264 -66
- package/es/insure-calculate/index.js +2 -4
- package/es/person-info/index.js +185 -21
- package/es/product-info/index.js +244 -43
- package/es/share-sheet/index.css +1 -1
- package/es/share-sheet/index.js +4 -11
- package/es/utils/index.js +191 -25
- package/lib/add-and-take/index.js +2 -4
- package/lib/adjust-baoe/index.js +2 -4
- package/lib/index.css +1 -1
- package/lib/index.js +264 -66
- package/lib/insure-calculate/index.js +2 -4
- package/lib/person-info/index.js +185 -21
- package/lib/product-info/index.js +244 -43
- package/lib/share-sheet/index.css +1 -1
- package/lib/share-sheet/index.js +4 -11
- package/lib/utils/index.js +194 -24
- package/package.json +1 -1
- package/packages/add-and-take/demo/index.vue +2 -2
- package/packages/bxs-utils/planbook/common.ts +144 -0
- package/packages/bxs-utils/planbook/index.ts +1 -4
- package/packages/bxs-utils/planbook/person.ts +2 -4
- package/packages/bxs-utils/planbook/product.ts +21 -20
- package/packages/index.ts +1 -1
- package/packages/planbook-input/components/product-table.vue +8 -9
- package/packages/planbook-input/helper.js +134 -11
- package/packages/planbook-input/index.vue +39 -9
- package/packages/product-info/index.vue +42 -8
- package/packages/share-sheet/index.css +1 -3
- package/packages/share-sheet/index.vue +2 -5
- package/packages/share-sheet/readme.md +99 -61
package/lib/person-info/index.js
CHANGED
|
@@ -943,6 +943,14 @@
|
|
|
943
943
|
});
|
|
944
944
|
}
|
|
945
945
|
|
|
946
|
+
var enableLizhaoDebug = document && document.cookie && document.cookie.match('ENABLE_LIZHAO_DEBUG=1');
|
|
947
|
+
function consoleLogWhenEnable() {
|
|
948
|
+
if (enableLizhaoDebug) {
|
|
949
|
+
var _console;
|
|
950
|
+
(_console = console).log.apply(_console, arguments);
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
|
|
946
954
|
/**
|
|
947
955
|
* **将对象下的 eleOrderList 数组中的子元素下的 value,转换为 key-value 键值对**
|
|
948
956
|
* @author Lizhao <lz@winbaoxian.com>
|
|
@@ -1112,6 +1120,167 @@
|
|
|
1112
1120
|
}
|
|
1113
1121
|
return age;
|
|
1114
1122
|
}
|
|
1123
|
+
function getExpressionParamMap(personData, product, ins, options) {
|
|
1124
|
+
var map = {
|
|
1125
|
+
planbookId: null,
|
|
1126
|
+
// 计划书id
|
|
1127
|
+
productId: null,
|
|
1128
|
+
// 产品id
|
|
1129
|
+
insured: {},
|
|
1130
|
+
// 被保人
|
|
1131
|
+
insured2: {},
|
|
1132
|
+
// 第二被保人
|
|
1133
|
+
applicant: {},
|
|
1134
|
+
// 投保人
|
|
1135
|
+
recipient: {},
|
|
1136
|
+
// 收件人
|
|
1137
|
+
p: {},
|
|
1138
|
+
// 当前产品
|
|
1139
|
+
m: {},
|
|
1140
|
+
// 主险
|
|
1141
|
+
me: {},
|
|
1142
|
+
// 当前险种
|
|
1143
|
+
common: {},
|
|
1144
|
+
// 通用信息
|
|
1145
|
+
customVariable: null,
|
|
1146
|
+
// 自定义变量
|
|
1147
|
+
cv: null // 简写,自定义变量
|
|
1148
|
+
};
|
|
1149
|
+
if (personData) {
|
|
1150
|
+
var insuredInfo = (personData.personOrderList || []).find(function (p) {
|
|
1151
|
+
return p.key === 'insuredInfo';
|
|
1152
|
+
});
|
|
1153
|
+
var insured2Info = (personData.personOrderList || []).find(function (p) {
|
|
1154
|
+
return p.key === 'insured2Info';
|
|
1155
|
+
});
|
|
1156
|
+
var applicantInfo = (personData.personOrderList || []).find(function (p) {
|
|
1157
|
+
return p.key === 'applicantInfo';
|
|
1158
|
+
});
|
|
1159
|
+
var recipientInfo = personData !== null && personData !== void 0 && personData.recipientInfo ? personData.recipientInfo : null;
|
|
1160
|
+
map.insured = insuredInfo ? convertEleOrderListToObj(insuredInfo) : {};
|
|
1161
|
+
map.insured2 = insured2Info ? convertEleOrderListToObj(insured2Info) : {};
|
|
1162
|
+
map.applicant = applicantInfo ? convertEleOrderListToObj(applicantInfo) : {};
|
|
1163
|
+
map.recipient = recipientInfo ? convertEleOrderListToObj(recipientInfo) : {};
|
|
1164
|
+
}
|
|
1165
|
+
if (ins) {
|
|
1166
|
+
map.me = ins ? convertEleOrderListToObj(ins) : {};
|
|
1167
|
+
map["i".concat(ins.key)] = ins;
|
|
1168
|
+
}
|
|
1169
|
+
if (product) {
|
|
1170
|
+
map.productId = product.key;
|
|
1171
|
+
Object.keys(product).filter(function (k) {
|
|
1172
|
+
return !['mulInsOrderList'].includes(k);
|
|
1173
|
+
}).forEach(function (k) {
|
|
1174
|
+
map.p[k] = product[k];
|
|
1175
|
+
});
|
|
1176
|
+
if (Array.isArray(product.mulInsOrderList)) {
|
|
1177
|
+
var common = product.mulInsOrderList.find(function (item) {
|
|
1178
|
+
return item.key === 'common';
|
|
1179
|
+
});
|
|
1180
|
+
var insuranceList = product.mulInsOrderList.filter(function (item) {
|
|
1181
|
+
return !['common'].includes(item.key);
|
|
1182
|
+
}).map(function (item) {
|
|
1183
|
+
return convertEleOrderListToObj(item);
|
|
1184
|
+
});
|
|
1185
|
+
map.m = insuranceList[0] ? insuranceList[0] : {};
|
|
1186
|
+
map.me = ins && ins.key ? insuranceList.find(function (e) {
|
|
1187
|
+
return e.key === ins.key;
|
|
1188
|
+
}) || {} : {};
|
|
1189
|
+
map.common = common ? convertEleOrderListToObj(common) : {};
|
|
1190
|
+
insuranceList.forEach(function (item) {
|
|
1191
|
+
map["i".concat(item.key)] = item;
|
|
1192
|
+
});
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
if (options && options.planbookId) {
|
|
1196
|
+
map.planbookId = options.planbookId;
|
|
1197
|
+
}
|
|
1198
|
+
if (ins && ins.customVariableExp) {
|
|
1199
|
+
var exp = ins.customVariableExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'map.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'map.$2');
|
|
1200
|
+
map.customVariable = eval(exp);
|
|
1201
|
+
map.cv = map.customVariable;
|
|
1202
|
+
}
|
|
1203
|
+
return map;
|
|
1204
|
+
}
|
|
1205
|
+
function executeElementRule(personData, product, ins, ele) {
|
|
1206
|
+
var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
1207
|
+
var paramMap = getExpressionParamMap(personData, product, ins, options);
|
|
1208
|
+
var newEleMap = {};
|
|
1209
|
+
if (paramMap) {
|
|
1210
|
+
if (['cmCommonTitle'].includes(ele.componentName)) {
|
|
1211
|
+
if (ele.underwriteExp) {
|
|
1212
|
+
var exp = ele.underwriteExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1213
|
+
var evalValue = eval(exp);
|
|
1214
|
+
if (Array.isArray(evalValue)) {
|
|
1215
|
+
if ([0, 1].includes(evalValue[0])) {
|
|
1216
|
+
newEleMap.value = evalValue[0] === 1;
|
|
1217
|
+
}
|
|
1218
|
+
if ([0, 1].includes(evalValue[1])) {
|
|
1219
|
+
newEleMap.isDisabled = evalValue[1] === 0;
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
consoleLogWhenEnable("".concat(ele.key, ": underwriteExp"), exp, evalValue);
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
if (['cmCommonSelect', 'cmCommonRadioBtn', 'cmCommonRadio', 'cmCommonCheckbox'].includes(ele.componentName)) {
|
|
1226
|
+
if (ele.defaultValueExp) {
|
|
1227
|
+
if (ele.value !== 0 && !ele.value) {
|
|
1228
|
+
var _exp = ele.defaultValueExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1229
|
+
newEleMap.value = eval(_exp);
|
|
1230
|
+
consoleLogWhenEnable("".concat(ele.key, ": defaultValueExp"), _exp, newEleMap.value);
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
if (ele.underwriteExp) {
|
|
1234
|
+
var _exp2 = ele.underwriteExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1235
|
+
var _evalValue = eval(_exp2);
|
|
1236
|
+
if (Array.isArray(_evalValue) && Array.isArray(ele.opts)) {
|
|
1237
|
+
if (_evalValue.length === 2) {
|
|
1238
|
+
newEleMap.opts = (ele.opts || []).filter(function (o) {
|
|
1239
|
+
return o.val >= _evalValue[0] && o.val <= _evalValue[1];
|
|
1240
|
+
});
|
|
1241
|
+
} else {
|
|
1242
|
+
newEleMap.opts = (ele.opts || []).filter(function (o) {
|
|
1243
|
+
return _evalValue.includes(o.val);
|
|
1244
|
+
});
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
if (Array.isArray(newEleMap.opts)) {
|
|
1248
|
+
if (newEleMap.opts.length && !newEleMap.opts.some(function (o) {
|
|
1249
|
+
return o.val === ele.value;
|
|
1250
|
+
})) {
|
|
1251
|
+
newEleMap.value = newEleMap.opts[0].val;
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
consoleLogWhenEnable("".concat(ele.key, ": underwriteExp"), _exp2, _evalValue);
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
if (['cmCommonInput'].includes(ele.componentName)) {
|
|
1258
|
+
if (ele.defaultValueExp) {
|
|
1259
|
+
if (!ele.value) {
|
|
1260
|
+
var _exp3 = ele.defaultValueExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1261
|
+
newEleMap.value = eval(_exp3);
|
|
1262
|
+
consoleLogWhenEnable("".concat(ele.key, ": defaultValueExp"), _exp3, newEleMap.value);
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
if (ele.minExp) {
|
|
1266
|
+
var _exp4 = ele.minExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1267
|
+
newEleMap.min = eval(_exp4);
|
|
1268
|
+
consoleLogWhenEnable("".concat(ele.key, ": minExp"), _exp4, newEleMap.min);
|
|
1269
|
+
}
|
|
1270
|
+
if (ele.maxExp) {
|
|
1271
|
+
var _exp5 = ele.maxExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1272
|
+
newEleMap.max = eval(_exp5);
|
|
1273
|
+
consoleLogWhenEnable("".concat(ele.key, ": maxExp"), _exp5, newEleMap.max);
|
|
1274
|
+
}
|
|
1275
|
+
if (ele.multiExp) {
|
|
1276
|
+
var _exp6 = ele.multiExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1277
|
+
newEleMap.multi = eval(_exp6);
|
|
1278
|
+
consoleLogWhenEnable("".concat(ele.key, ": multiExp"), _exp6, newEleMap.multi);
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
return newEleMap;
|
|
1283
|
+
}
|
|
1115
1284
|
|
|
1116
1285
|
/**
|
|
1117
1286
|
* **处理人员数据**
|
|
@@ -9608,8 +9777,8 @@
|
|
|
9608
9777
|
insuranceDataHandler(ins, prodData);
|
|
9609
9778
|
var insuranceVerifyData = productVerifyData[ins.key];
|
|
9610
9779
|
if (!insuranceVerifyData) {
|
|
9611
|
-
if (
|
|
9612
|
-
|
|
9780
|
+
if (ins.key !== 'common') {
|
|
9781
|
+
consoleLogWhenEnable("".concat(prodData.titleName, "-").concat(prodData.key, " -> ").concat(ins.name, "-").concat(ins.key, ": \u5F53\u524D\u9669\u79CD\u6CA1\u6709\u8D39\u7387\u8868"));
|
|
9613
9782
|
}
|
|
9614
9783
|
return;
|
|
9615
9784
|
}
|
|
@@ -9661,9 +9830,7 @@
|
|
|
9661
9830
|
if (isNotAllowSelect) {
|
|
9662
9831
|
eleTitle.isDisabled = true;
|
|
9663
9832
|
eleTitle.value = false;
|
|
9664
|
-
|
|
9665
|
-
console.log(curCondition ? "".concat(eleTitle.labelName, "-").concat(ins.key, ": \u8D39\u7387\u5B58\u5728\uFF01\u4F46\u6295\u4FDD\u4EBA\u672A\u9009\u4E2D\u6216\u6295\u88AB\u4FDD\u4EBA\u4E3A\u540C\u4E00\u4EBA\uFF0C\u8BE5\u8C41\u514D\u9669\uFF08\u4E0D\u80FD\u9644\u52A0\u5230\u88AB\u4FDD\u4EBA\uFF09\u4E0D\u53EF\u9009") : "".concat(eleTitle.labelName, "-").concat(ins.key, ": \u8D39\u7387\u4E0D\u5B58\u5728\uFF01"));
|
|
9666
|
-
}
|
|
9833
|
+
consoleLogWhenEnable(curCondition ? "".concat(eleTitle.labelName, "-").concat(ins.key, ": \u8D39\u7387\u5B58\u5728\uFF01\u4F46\u6295\u4FDD\u4EBA\u672A\u9009\u4E2D\u6216\u6295\u88AB\u4FDD\u4EBA\u4E3A\u540C\u4E00\u4EBA\uFF0C\u8BE5\u8C41\u514D\u9669\uFF08\u4E0D\u80FD\u9644\u52A0\u5230\u88AB\u4FDD\u4EBA\uFF09\u4E0D\u53EF\u9009") : "".concat(eleTitle.labelName, "-").concat(ins.key, ": \u8D39\u7387\u4E0D\u5B58\u5728\uFF01"));
|
|
9667
9834
|
} else {
|
|
9668
9835
|
// 存在费率,险种可选
|
|
9669
9836
|
eleTitle.isDisabled = false;
|
|
@@ -9671,9 +9838,7 @@
|
|
|
9671
9838
|
if (ins.required && (!ins.groupKey || ins.isCheckbox)) {
|
|
9672
9839
|
eleTitle.value = true;
|
|
9673
9840
|
eleTitle.isDisabled = true;
|
|
9674
|
-
|
|
9675
|
-
console.log("".concat(eleTitle.labelName, "-").concat(ins.key, ": \u8D39\u7387\u5B58\u5728\uFF0C\u9669\u79CD\u4E3A\u5FC5\u9009\u9669\u4E14(\u4E3A\u975E\u7EC4\u5408\u9669\u6216\u4E3A\u591A\u9009\u4E00\u9669\u79CD)"));
|
|
9676
|
-
}
|
|
9841
|
+
consoleLogWhenEnable("".concat(eleTitle.labelName, "-").concat(ins.key, ": \u8D39\u7387\u5B58\u5728\uFF0C\u9669\u79CD\u4E3A\u5FC5\u9009\u9669\u4E14(\u4E3A\u975E\u7EC4\u5408\u9669\u6216\u4E3A\u591A\u9009\u4E00\u9669\u79CD)"));
|
|
9677
9842
|
}
|
|
9678
9843
|
}
|
|
9679
9844
|
if (!curCondition) {
|
|
@@ -9692,9 +9857,7 @@
|
|
|
9692
9857
|
});
|
|
9693
9858
|
}
|
|
9694
9859
|
if (!eleData) {
|
|
9695
|
-
|
|
9696
|
-
console.log("".concat(ins.name, " - ").concat(curCondition && curCondition.key, "\u5143\u7D20\u4E0D\u5B58\u5728\uFF1A"));
|
|
9697
|
-
}
|
|
9860
|
+
consoleLogWhenEnable("".concat(ins.name, " - ").concat(curCondition && curCondition.key, "\u5143\u7D20\u4E0D\u5B58\u5728\uFF1A"));
|
|
9698
9861
|
curCondition = null;
|
|
9699
9862
|
return 0; // break
|
|
9700
9863
|
}
|
|
@@ -9723,9 +9886,7 @@
|
|
|
9723
9886
|
eleData.value = refEleData.value;
|
|
9724
9887
|
}
|
|
9725
9888
|
} else {
|
|
9726
|
-
|
|
9727
|
-
console.log("".concat(ins.name, "-").concat(ins.key, "\uFF1A\u5173\u8054\u9669\u79CD").concat(ins.refInsuranceId, "\u4E0D\u5B58\u5728"));
|
|
9728
|
-
}
|
|
9889
|
+
consoleLogWhenEnable("".concat(ins.name, "-").concat(ins.key, "\uFF1A\u5173\u8054\u9669\u79CD").concat(ins.refInsuranceId, "\u4E0D\u5B58\u5728"));
|
|
9729
9890
|
}
|
|
9730
9891
|
} else {
|
|
9731
9892
|
var backupOpts = eleData.opts && eleData.opts.length ? eleData.opts.slice(0) : [];
|
|
@@ -9794,9 +9955,7 @@
|
|
|
9794
9955
|
if (!curCondition) {
|
|
9795
9956
|
eleTitle.isDisabled = true;
|
|
9796
9957
|
eleTitle.value = false;
|
|
9797
|
-
|
|
9798
|
-
console.log("".concat(eleTitle.labelName, "-").concat(ins.key, ": \u8D39\u7387\u4E0D\u5B58\u5728\uFF01"));
|
|
9799
|
-
}
|
|
9958
|
+
consoleLogWhenEnable("".concat(eleTitle.labelName, "-").concat(ins.key, ": \u8D39\u7387\u4E0D\u5B58\u5728\uFF01"));
|
|
9800
9959
|
}
|
|
9801
9960
|
|
|
9802
9961
|
// 如果当前元素是隐藏的且不可修改,则过滤上一元素的选项,即,删除上一元素中不包含当前元素值的选项。
|
|
@@ -9833,6 +9992,15 @@
|
|
|
9833
9992
|
_ret = _loop2();
|
|
9834
9993
|
if (_ret === 0) break;
|
|
9835
9994
|
} while (curCondition && curCondition.key && curCondition[curCondition.key]);
|
|
9995
|
+
if (Array.isArray(ins.eleOrderList)) {
|
|
9996
|
+
ins.eleOrderList.forEach(function (ele) {
|
|
9997
|
+
var newEleMap = executeElementRule(personData, prodData, ins, ele, parmas);
|
|
9998
|
+
for (var k in newEleMap) {
|
|
9999
|
+
ele[k] = newEleMap[k];
|
|
10000
|
+
}
|
|
10001
|
+
});
|
|
10002
|
+
insuranceDataHandler(ins, prodData);
|
|
10003
|
+
}
|
|
9836
10004
|
});
|
|
9837
10005
|
}
|
|
9838
10006
|
setGroupInsurance(prodData);
|
|
@@ -10332,10 +10500,6 @@
|
|
|
10332
10500
|
return productData;
|
|
10333
10501
|
}
|
|
10334
10502
|
|
|
10335
|
-
if (document && document.cookie && document.cookie.match('LIZHAO_DEBUG_CONSOLE_FLAG=1')) {
|
|
10336
|
-
window.DEBUG_TEMP_CONSOLE_FLAG = true;
|
|
10337
|
-
}
|
|
10338
|
-
|
|
10339
10503
|
function showLoading() {
|
|
10340
10504
|
if (IS_CPPOC_HOST) {
|
|
10341
10505
|
_Toast.loading({
|