bxs-tools-ui 2.0.2 → 2.0.3-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bxs-tools-ui",
3
- "version": "2.0.2",
3
+ "version": "2.0.3-0",
4
4
  "description": "微易前端业务组件",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -43,23 +43,22 @@
43
43
  "author": "lizh",
44
44
  "license": "ISC",
45
45
  "devDependencies": {
46
- "@babel/core": "^7.5.5",
46
+ "@babel/core": "^7.16.0",
47
47
  "@babel/plugin-proposal-class-properties": "^7.10.4",
48
48
  "@babel/plugin-proposal-object-rest-spread": "^7.20.7",
49
49
  "@babel/plugin-transform-runtime": "^7.12.1",
50
- "@babel/preset-env": "^7.5.5",
50
+ "@babel/preset-env": "^7.16.0",
51
51
  "@babel/preset-typescript": "^7.10.4",
52
52
  "@commitlint/cli": "^19.3.0",
53
53
  "@commitlint/config-conventional": "^19.2.2",
54
54
  "@commitlint/parse": "^19.0.3",
55
55
  "@types/vue": "^2.0.0",
56
- "@typescript-eslint/eslint-plugin": "^4.7.0",
57
- "@typescript-eslint/parser": "^4.7.0",
56
+ "@typescript-eslint/eslint-plugin": "^2.34.0",
57
+ "@typescript-eslint/parser": "^2.34.0",
58
58
  "@vant/doc": "^2.3.6",
59
59
  "@vant/touch-emulator": "^1.0.0",
60
60
  "@vue/eslint-config-typescript": "^5.0.1",
61
61
  "autoprefixer": "^9.6.1",
62
- "awesome-typescript-loader": "^5.2.1",
63
62
  "babel-loader": "^8.0.6",
64
63
  "babel-plugin-component": "^1.1.1",
65
64
  "babel-plugin-transform-runtime": "^6.23.0",
@@ -68,7 +67,7 @@
68
67
  "crypto": "^1.0.1",
69
68
  "crypto-js": "^3.1.9-1",
70
69
  "css-loader": "^3.1.0",
71
- "eslint": "^6.5.1",
70
+ "eslint": "^6.8.0",
72
71
  "eslint-config-prettier": "^6.15.0",
73
72
  "eslint-friendly-formatter": "^4.0.1",
74
73
  "eslint-loader": "^4.0.2",
@@ -101,7 +100,7 @@
101
100
  "tslint": "^5.20.1",
102
101
  "tslint-config-standard": "^9.0.0",
103
102
  "tslint-loader": "^3.5.4",
104
- "typescript": "^3.7.4",
103
+ "typescript": "^4.5.0",
105
104
  "vconsole": "^3.15.0",
106
105
  "vue": "^2.6.12",
107
106
  "vue-json-tree": "^0.4.3",
@@ -112,7 +111,7 @@
112
111
  "webpack": "^4.38.0",
113
112
  "webpack-bundle-analyzer": "^4.1.0",
114
113
  "webpack-cli": "^3.3.11",
115
- "webpack-dev-server": "^3.7.2"
114
+ "webpack-dev-server": "^3.11.2"
116
115
  },
117
116
  "dependencies": {
118
117
  "axios": "^0.20.0",
@@ -131,6 +131,10 @@ export function insuranceDataHandler(insData : IProdInsurance, productData : IPb
131
131
  * @returns {object} 元素的校验规则
132
132
  */
133
133
  export function initElementValidateRules(ele : IInsElement, productData? : IPbProduct) : any {
134
+ const mulInsOrderList = productData && productData.mulInsOrderList ? productData.mulInsOrderList : [];
135
+ const insurance0 = mulInsOrderList && mulInsOrderList.length ? mulInsOrderList.find(ins => ins.key !== 'common') : null;
136
+ const insurance0Name = insurance0 && insurance0.name ? insurance0.name : '';
137
+ const isPensionInsurance = insurance0Name.match(/个养|个人养老/)
134
138
  let rules : any = [];
135
139
  // 必填及正则校验
136
140
  if (['cmCommonInput'].indexOf(String(ele.componentName)) !== -1) {
@@ -161,6 +165,10 @@ export function initElementValidateRules(ele : IInsElement, productData? : IPbPr
161
165
  message = `请输入${converUnit10000(min)}~${converUnit10000(max)}之间的数值`;
162
166
  } else if (!min) {
163
167
  message = `请输入不大于${converUnit10000(max)}的数值`;
168
+ // 个人养老险,保费的最大金额限制,提示文案改成:“个人养老金,最高保费${max}元”。From hyw
169
+ if (isPensionInsurance && ele.key === 'baof') {
170
+ message = `个人养老金,最高保费${converUnit10000(max)}元`;
171
+ }
164
172
  } else if (!max) {
165
173
  message = `请输入不小于${converUnit10000(min)}的数值`;
166
174
  }
@@ -191,16 +199,15 @@ export function initElementValidateRules(ele : IInsElement, productData? : IPbPr
191
199
  ele.compareItem &&
192
200
  ele.compareItem.length &&
193
201
  ele.compareItem.length >= 3 &&
194
- productData &&
195
- productData.mulInsOrderList
202
+ mulInsOrderList
196
203
  ) {
197
204
  const item1 = ele.compareItem[0].match(/(.{1,})\.(.{1,})/);
198
205
  const item2 = ele.compareItem[2].match(/(.{1,})\.(.{1,})/);
199
206
  let insurance1, insurance2, insTitle1, insTitle2, itemValue1, itemValue2;
200
207
  if (item1 && item2) {
201
208
  // 查找对应的险种
202
- insurance1 = productData.mulInsOrderList.find(ins => ins.key + '' === item1[1]);
203
- insurance2 = productData.mulInsOrderList.find(ins => ins.key + '' === item2[1]);
209
+ insurance1 = mulInsOrderList.find(ins => ins.key + '' === item1[1]);
210
+ insurance2 = mulInsOrderList.find(ins => ins.key + '' === item2[1]);
204
211
  }
205
212
  if (insurance1 && insurance1.eleOrderList) {
206
213
  // 险种选中时,获取险种对应元素的值
@@ -6,14 +6,7 @@
6
6
  {{ productData.titleName }}
7
7
  </p>
8
8
  <div class="bxt-product-header-btn">
9
- <van-button
10
- v-if="isShowDeleteBtn()"
11
- type="danger"
12
- size="mini"
13
- plain
14
- style="width: 50px; border-radius: 50px;"
15
- @click="deleteProduct"
16
- >
9
+ <van-button v-if="isShowDeleteBtn()" type="danger" size="mini" plain style="width: 50px; border-radius: 50px;" @click="deleteProduct">
17
10
  删除
18
11
  </van-button>
19
12
  <van-button type="info" size="mini" style="width: 50px; border-radius: 50px;" @click="modify">
@@ -21,10 +14,7 @@
21
14
  </van-button>
22
15
  </div>
23
16
  </header>
24
- <div
25
- :class="['bxt-product-body', `bxt-product-id-${productData.key}`]"
26
- v-if="productData.hadChoice && productData.insShowArr"
27
- >
17
+ <div :class="['bxt-product-body', `bxt-product-id-${productData.key}`]" v-if="productData.hadChoice && productData.insShowArr">
28
18
  <h5 class="bxt-product-baof">首年保费:{{ productData.totalBaof }}</h5>
29
19
  <table class="bxt-product-table" @click="modify">
30
20
  <template v-for="tr in productData.insShowArr">
@@ -118,22 +108,14 @@
118
108
  </table>
119
109
  </div>
120
110
  </div>
121
- <CommonPopup
122
- v-model="popupConf.prodVisible"
123
- :title="popupConf.title"
124
- round
125
- closeable
126
- position="bottom"
127
- :z-index="100"
128
- @confirm="confirm(productData)"
129
- >
111
+ <CommonPopup v-model="popupConf.prodVisible" :title="popupConf.title" round closeable position="bottom" :z-index="100" @confirm="confirm(productData)">
130
112
  <ProductInfo
131
113
  ref="productInfo"
132
114
  :input-data="inputData"
133
115
  :verify-data="verifyData"
134
116
  :group-key="params.groupKey"
135
117
  :product-key="params.productKey"
136
- :showRecommendValue="false"
118
+ :showRecommendValue="true"
137
119
  :params="{
138
120
  allowCustomResult: true,
139
121
  planbookId: params.planbookId
@@ -293,10 +275,7 @@ export default class BxtProductTable extends Vue {
293
275
  addAndTakeTitleMap = ADD_AND_TAKE_TITLE_MAP;
294
276
 
295
277
  isShowDeleteBtn() {
296
- let index =
297
- this.groupData &&
298
- this.groupData.prodOrderList &&
299
- this.groupData.prodOrderList.findIndex(p => p.key === this.params.productKey);
278
+ let index = this.groupData && this.groupData.prodOrderList && this.groupData.prodOrderList.findIndex(p => p.key === this.params.productKey);
300
279
  return this.productData.hadChoice && !this.productData.required && index >= this.groupData.defNum;
301
280
  }
302
281
  closeProductSheet() {
@@ -514,9 +493,7 @@ export default class BxtProductTable extends Vue {
514
493
  if (!insData) {
515
494
  return '';
516
495
  }
517
- return /(\(|\()([^\(\(]+)(\)|\))$/.exec(insData.name)
518
- ? /(\(|\()([^\(\(]+)(\)|\))$/.exec(insData.name)[2]
519
- : insData.name;
496
+ return /(\(|\()([^\(\(]+)(\)|\))$/.exec(insData.name) ? /(\(|\()([^\(\(]+)(\)|\))$/.exec(insData.name)[2] : insData.name;
520
497
  }
521
498
  }
522
499
  </script>
@@ -18,11 +18,7 @@
18
18
  :ref="`insuranceForm${ins.key}`"
19
19
  :rules="ins.rules || {}"
20
20
  :key="ins.key"
21
- :class="[
22
- 'bxt-product-info-form',
23
- `bxt-product-insurance-id-${ins.key}`,
24
- isNextInsuranceFollow(ins) ? 'bxt-product-info-form-follow' : ''
25
- ]"
21
+ :class="['bxt-product-info-form', `bxt-product-insurance-id-${ins.key}`, isNextInsuranceFollow(ins) ? 'bxt-product-info-form-follow' : '']"
26
22
  :model="productForm[ins.key]"
27
23
  :is-content-vertical-alignment="true"
28
24
  @submit.native.prevent="closeKeyBoard()"
@@ -111,11 +107,7 @@
111
107
  :rules="ele.rules"
112
108
  :ignoreValidate="isIgnoreValidate(ins, ele)"
113
109
  >
114
- <bxs-radio-group
115
- v-model="ele.value"
116
- :disabled="ele.isDisabled"
117
- @change="onChange({ insData: ins, eleData: ele })"
118
- >
110
+ <bxs-radio-group v-model="ele.value" :disabled="ele.isDisabled" @change="onChange({ insData: ins, eleData: ele })">
119
111
  <template v-for="opt in ele.opts.filter(o => !o.isHide && !o.isDisabled && !o.isInvalid)">
120
112
  <bxs-radio
121
113
  :key="opt.val"
@@ -140,11 +132,7 @@
140
132
  :rules="ele.rules"
141
133
  :ignoreValidate="isIgnoreValidate(ins, ele)"
142
134
  >
143
- <bxs-radio-group
144
- v-model="ele.value"
145
- :disabled="ele.isDisabled"
146
- @change="onChange({ insData: ins, eleData: ele })"
147
- >
135
+ <bxs-radio-group v-model="ele.value" :disabled="ele.isDisabled" @change="onChange({ insData: ins, eleData: ele })">
148
136
  <template v-for="opt in ele.opts">
149
137
  <bxs-radio
150
138
  :id="`${productData.key}_${ins.key}_${ele.key}_${opt.val}`"
@@ -155,15 +143,10 @@
155
143
  >
156
144
  <div class="bxt-ins-form-radio-content">
157
145
  <span v-if="opt.code" class="bxt-ins-form-radio--code">{{ opt.code }}</span>
158
- <span
159
- class="bxt-ins-form-radio--tx"
160
- :class="[genInsuranceHmTag(opt) ? 'bxt-ins-form-radio--width' : '']"
161
- >
146
+ <span class="bxt-ins-form-radio--tx" :class="[genInsuranceHmTag(opt) ? 'bxt-ins-form-radio--width' : '']">
162
147
  {{ opt.desc }}
163
148
  </span>
164
- <span v-if="genInsuranceHmTag(opt)" class="bxt-ins-form-radio--tag">{{
165
- genInsuranceHmTag(opt)
166
- }}</span>
149
+ <span v-if="genInsuranceHmTag(opt)" class="bxt-ins-form-radio--tag">{{ genInsuranceHmTag(opt) }}</span>
167
150
  </div>
168
151
  </bxs-radio>
169
152
  </template>
@@ -274,18 +257,10 @@ export default class BxtProductInfo extends Vue {
274
257
  return this.inputData && this.inputData.personData;
275
258
  }
276
259
  get groupData() {
277
- return (
278
- this.inputData &&
279
- this.inputData.productGroupList &&
280
- this.inputData.productGroupList.find(g => g.key === this.groupKey)
281
- );
260
+ return this.inputData && this.inputData.productGroupList && this.inputData.productGroupList.find(g => g.key === this.groupKey);
282
261
  }
283
262
  get productData() {
284
- return (
285
- this.groupData &&
286
- this.groupData.prodOrderList &&
287
- this.groupData.prodOrderList.find(p => p.key === this.productKey)
288
- );
263
+ return this.groupData && this.groupData.prodOrderList && this.groupData.prodOrderList.find(p => p.key === this.productKey);
289
264
  }
290
265
  get productForm() {
291
266
  let productForm: any = {};
@@ -426,8 +401,7 @@ export default class BxtProductInfo extends Vue {
426
401
  const personOrderList = this.inputData.personData.personOrderList;
427
402
  const applicationInfo = personOrderList.find(p => p.key === 'applicantInfo');
428
403
  const applicationTitle = applicationInfo && applicationInfo.eleOrderList.find(e => e.key === 'title');
429
- const applicationSame =
430
- applicationInfo && applicationInfo.eleOrderList.find(e => e.key === 'applicantAndInsuredSame');
404
+ const applicationSame = applicationInfo && applicationInfo.eleOrderList.find(e => e.key === 'applicantAndInsuredSame');
431
405
  if (!(['touHuomian', 'shuangHuomian'].includes(insurance.huomian) && element.isDisabled)) {
432
406
  return '';
433
407
  }
@@ -490,7 +464,8 @@ export default class BxtProductInfo extends Vue {
490
464
  return this.recommendValues && this.recommendValues[insurance.isGroup ? insurance.insuranceId : insurance.key];
491
465
  }
492
466
  async requiestRecommendValues() {
493
- const { showRecommendValue, recommendValuesCache, inputData, groupData, productData } = this;
467
+ const self = this;
468
+ const { showRecommendValue, recommendValuesCache, inputData, groupData, productData } = self;
494
469
  if (!showRecommendValue) {
495
470
  return;
496
471
  }
@@ -515,7 +490,7 @@ export default class BxtProductInfo extends Vue {
515
490
  }
516
491
 
517
492
  if (recommendValuesCache[JSON.stringify(reqParams)]) {
518
- this.recommendValues = recommendValuesCache[JSON.stringify(reqParams)];
493
+ self.recommendValues = recommendValuesCache[JSON.stringify(reqParams)];
519
494
  return;
520
495
  }
521
496
 
@@ -531,14 +506,35 @@ export default class BxtProductInfo extends Vue {
531
506
  .then(response => response.json())
532
507
  .then(({ success, data, info }: any) => {
533
508
  if (!success || !data) {
534
- this.$toast(info);
509
+ self.$toast(info);
535
510
  return Promise.reject();
536
511
  }
537
- this.recommendValues = data.reduce((obj, ele) => {
538
- obj[ele.insuranceId] = ele.valueList;
539
- return obj;
512
+ let recommendValues = data.reduce((obj, ele) => {
513
+ return Object.assign(obj, {
514
+ [ele.insuranceId]: ele.valueList
515
+ });
540
516
  }, {});
541
- recommendValuesCache[JSON.stringify(reqParams)] = this.recommendValues;
517
+
518
+ // 推荐金额,根据最小值和最大值进行过滤。From hyw
519
+ const mulInsOrderList = productData && productData.mulInsOrderList ? productData.mulInsOrderList : [];
520
+ mulInsOrderList
521
+ .filter(ins => ins.eleOrderList && ins.eleOrderList.length)
522
+ .filter(ins => recommendValues[ins.key])
523
+ .map(ins => {
524
+ const calMethod = ins.calMethod || ins.feeType || ins.feeBaseType;
525
+ const key = calMethod === 'baof2baoe' ? 'baof' : 'baoe';
526
+ const ele = ins.eleOrderList.find(ele => ele.key === key);
527
+ if (ele) {
528
+ if (ele.min && !isNaN(Number(ele.min))) {
529
+ recommendValues[ins.key] = (recommendValues[ins.key] || []).filter(v => v >= ele.min);
530
+ }
531
+ if (ele.max && !isNaN(Number(ele.max))) {
532
+ recommendValues[ins.key] = (recommendValues[ins.key] || []).filter(v => v <= ele.max);
533
+ }
534
+ }
535
+ });
536
+ self.recommendValues = recommendValues;
537
+ recommendValuesCache[JSON.stringify(reqParams)] = recommendValues;
542
538
  })
543
539
  .catch(error => {
544
540
  console.log(error);
@@ -40,6 +40,7 @@ footer {
40
40
  :root {
41
41
  --zIndex: 100;
42
42
  --noWrap: {
43
+ display: inline-block;
43
44
  width: 100%;
44
45
  white-space: nowrap;
45
46
  overflow: hidden;