bxs-tools-ui 1.0.21 → 1.0.25
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/lib/business-card/index.js +2 -2
- package/lib/bxs-utils/index.js +4 -3
- package/lib/canvas-poster/index.js +2 -2
- package/lib/index.css +2 -2
- package/lib/index.js +101 -115
- package/lib/insure-calculate/index.css +1 -1
- package/lib/insure-calculate/index.js +31 -61
- package/lib/person-info/index.css +1 -1
- package/lib/person-info/index.js +45 -21
- package/lib/product-info/index.css +1 -1
- package/lib/product-info/index.js +19 -24
- package/package.json +5 -15
- package/packages/business-card/demo/index.vue +2 -8
- package/packages/business-card/index.vue +6 -28
- package/packages/bxs-utils/planbook/common.js +2 -4
- package/packages/bxs-utils/planbook/insurance.js +16 -62
- package/packages/bxs-utils/planbook/person.js +22 -74
- package/packages/bxs-utils/planbook/product.js +65 -233
- package/packages/bxs-utils/trade/insureCalculate.js +11 -43
- package/packages/canvas-poster/demo/index.vue +2 -7
- package/packages/canvas-poster/index.vue +5 -37
- package/packages/components/form-item/select-item.vue +5 -17
- package/packages/components/form-item/title-item.vue +3 -8
- package/packages/insure-calculate/demo/index.vue +1 -4
- package/packages/insure-calculate/index.vue +52 -183
- package/packages/person-info/index.vue +35 -21
- package/packages/planbook-input/components/footer.vue +1 -2
- package/packages/planbook-input/components/product-table.vue +7 -17
- package/packages/planbook-input/helper.js +19 -75
- package/packages/planbook-input/index.vue +8 -28
- package/packages/product-info/demo/index.vue +2 -12
- package/packages/product-info/index.vue +8 -31
- package/src/js/md5Token.js +6 -8
- package/src/js/request.js +11 -9
- package/src/js/utils.js +3 -7
|
@@ -14,10 +14,7 @@ const baseURL = (() => {
|
|
|
14
14
|
env = 'https://insurance2a-api.wyins.net';
|
|
15
15
|
} else if (location.hostname.search(/pbf\.winbaoxian\.cn/) !== -1) {
|
|
16
16
|
env = '//insurance2a-api.wyins.net.cn';
|
|
17
|
-
} else if (
|
|
18
|
-
location.hostname.search(/127\.0\.0\.1|192\.168|localhost|0\.0\.0\.0/) !==
|
|
19
|
-
-1
|
|
20
|
-
) {
|
|
17
|
+
} else if (location.hostname.search(/127\.0\.0\.1|192\.168|localhost|0\.0\.0\.0/) !== -1) {
|
|
21
18
|
env = '//insurance2a-api.wyins.net.cn';
|
|
22
19
|
}
|
|
23
20
|
return env;
|
|
@@ -114,14 +111,9 @@ function translatePlanData(widgets, currentData, planParams) {
|
|
|
114
111
|
let current;
|
|
115
112
|
// 增加current字段,保存current_data的数据
|
|
116
113
|
if (item.duty) {
|
|
117
|
-
current = currentData.find(
|
|
118
|
-
it =>
|
|
119
|
-
it.k === item.key && it.risk === item.riskCode && item.duty === it.d
|
|
120
|
-
);
|
|
114
|
+
current = currentData.find(it => it.k === item.key && it.risk === item.riskCode && item.duty === it.d);
|
|
121
115
|
} else {
|
|
122
|
-
current = currentData.find(
|
|
123
|
-
it => it.k === item.key && it.risk === item.riskCode
|
|
124
|
-
);
|
|
116
|
+
current = currentData.find(it => it.k === item.key && it.risk === item.riskCode);
|
|
125
117
|
}
|
|
126
118
|
if (planParams) {
|
|
127
119
|
// 被保人生日 / 年龄
|
|
@@ -183,10 +175,7 @@ function translatePlanData(widgets, currentData, planParams) {
|
|
|
183
175
|
// }
|
|
184
176
|
if (planParams.detail_relation && item.key === 'detail_relation') {
|
|
185
177
|
// 条件检索
|
|
186
|
-
if (
|
|
187
|
-
planParams.detail_relation === '-1' ||
|
|
188
|
-
planParams.detail_relation === -1
|
|
189
|
-
) {
|
|
178
|
+
if (planParams.detail_relation === '-1' || planParams.detail_relation === -1) {
|
|
190
179
|
// 非本人
|
|
191
180
|
const temp = [];
|
|
192
181
|
item.opts[item.key].forEach(i => {
|
|
@@ -211,10 +200,7 @@ function translatePlanData(widgets, currentData, planParams) {
|
|
|
211
200
|
}
|
|
212
201
|
}
|
|
213
202
|
// 投保人出生日期
|
|
214
|
-
if (
|
|
215
|
-
planParams.detail_applicant_age &&
|
|
216
|
-
item.key === 'detail_applicant_age'
|
|
217
|
-
) {
|
|
203
|
+
if (planParams.detail_applicant_age && item.key === 'detail_applicant_age') {
|
|
218
204
|
if (/-/.test(planParams.detail_applicant_age)) {
|
|
219
205
|
// 被保人生日
|
|
220
206
|
item.type = 'v-text';
|
|
@@ -233,10 +219,7 @@ function translatePlanData(widgets, currentData, planParams) {
|
|
|
233
219
|
}
|
|
234
220
|
}
|
|
235
221
|
// 投保人性别
|
|
236
|
-
if (
|
|
237
|
-
planParams.detail_applicant_sex &&
|
|
238
|
-
item.key === 'detail_applicant_sex'
|
|
239
|
-
) {
|
|
222
|
+
if (planParams.detail_applicant_sex && item.key === 'detail_applicant_sex') {
|
|
240
223
|
item.type = 'v-text';
|
|
241
224
|
item.name = planParams.detail_applicant_sex === '1' ? '男' : '女';
|
|
242
225
|
current.v = planParams.detail_applicant_sex;
|
|
@@ -270,18 +253,12 @@ function tranlateCurrentData(currentData, planParams) {
|
|
|
270
253
|
}
|
|
271
254
|
// 投被保人关系
|
|
272
255
|
if (planParams.detail_relation && item.k === 'detail_relation') {
|
|
273
|
-
if (
|
|
274
|
-
planParams.detail_relation != -1 ||
|
|
275
|
-
planParams.detail_relation != '-1'
|
|
276
|
-
) {
|
|
256
|
+
if (planParams.detail_relation != -1 || planParams.detail_relation != '-1') {
|
|
277
257
|
current.v = planParams.detail_relation;
|
|
278
258
|
}
|
|
279
259
|
}
|
|
280
260
|
// 投保人出生日期
|
|
281
|
-
if (
|
|
282
|
-
planParams.detail_applicant_age &&
|
|
283
|
-
item.k === 'detail_applicant_age'
|
|
284
|
-
) {
|
|
261
|
+
if (planParams.detail_applicant_age && item.k === 'detail_applicant_age') {
|
|
285
262
|
if (/-/.test(planParams.detail_applicant_age)) {
|
|
286
263
|
// 被保人生日
|
|
287
264
|
current.v = planParams.detail_applicant_age;
|
|
@@ -295,10 +272,7 @@ function tranlateCurrentData(currentData, planParams) {
|
|
|
295
272
|
}
|
|
296
273
|
}
|
|
297
274
|
// 投保人性别
|
|
298
|
-
if (
|
|
299
|
-
planParams.detail_applicant_sex &&
|
|
300
|
-
item.k === 'detail_applicant_sex'
|
|
301
|
-
) {
|
|
275
|
+
if (planParams.detail_applicant_sex && item.k === 'detail_applicant_sex') {
|
|
302
276
|
current.v = planParams.detail_applicant_sex;
|
|
303
277
|
}
|
|
304
278
|
}
|
|
@@ -336,10 +310,7 @@ export function insureCalculate(urlParams, postParams, planParams) {
|
|
|
336
310
|
}
|
|
337
311
|
}
|
|
338
312
|
if (hasPlanParams(planParams) && postParams.current_data) {
|
|
339
|
-
postParams.current_data = tranlateCurrentData(
|
|
340
|
-
postParams.current_data,
|
|
341
|
-
planParams
|
|
342
|
-
);
|
|
313
|
+
postParams.current_data = tranlateCurrentData(postParams.current_data, planParams);
|
|
343
314
|
}
|
|
344
315
|
return new Promise((resolve, reject) => {
|
|
345
316
|
fetch({
|
|
@@ -426,10 +397,7 @@ export function checkInsureCalculateIn(urlParams, postParams, planParams) {
|
|
|
426
397
|
}
|
|
427
398
|
}
|
|
428
399
|
if (hasPlanParams(planParams) && postParams.current_data) {
|
|
429
|
-
postParams.current_data = tranlateCurrentData(
|
|
430
|
-
postParams.current_data,
|
|
431
|
-
planParams
|
|
432
|
-
);
|
|
400
|
+
postParams.current_data = tranlateCurrentData(postParams.current_data, planParams);
|
|
433
401
|
}
|
|
434
402
|
return new Promise((resolve, reject) => {
|
|
435
403
|
fetch({
|
|
@@ -8,11 +8,7 @@
|
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
10
|
<div>
|
|
11
|
-
<CanvasPoster
|
|
12
|
-
:poster-data="posterData"
|
|
13
|
-
:canvas-width="window.innerWidth"
|
|
14
|
-
:canvas-height="window.innerHeight"
|
|
15
|
-
/>
|
|
11
|
+
<CanvasPoster :poster-data="posterData" :canvas-width="window.innerWidth" :canvas-height="window.innerHeight" />
|
|
16
12
|
</div>
|
|
17
13
|
</template>
|
|
18
14
|
<script lang="ts">
|
|
@@ -89,8 +85,7 @@ export default class CanvasPosterDemo extends Vue {
|
|
|
89
85
|
},
|
|
90
86
|
{
|
|
91
87
|
type: 'image',
|
|
92
|
-
url:
|
|
93
|
-
'https://media.winbaoxian.com/autoUpload/planbook/QR_code_845accfa76b4bd0.jpeg',
|
|
88
|
+
url: 'https://media.winbaoxian.com/autoUpload/planbook/QR_code_845accfa76b4bd0.jpeg',
|
|
94
89
|
point: [window.innerWidth - 115, window.innerHeight - 115],
|
|
95
90
|
width: 100,
|
|
96
91
|
height: 100,
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="bxt-canvas-poster">
|
|
3
|
-
<canvas
|
|
4
|
-
id="canvasPoster"
|
|
5
|
-
:width="canvasWidth"
|
|
6
|
-
:height="canvasHeight"
|
|
7
|
-
@click.stop=""
|
|
8
|
-
class="bxt-canvas"
|
|
9
|
-
>
|
|
3
|
+
<canvas id="canvasPoster" :width="canvasWidth" :height="canvasHeight" @click.stop="" class="bxt-canvas">
|
|
10
4
|
<slot></slot>
|
|
11
5
|
</canvas>
|
|
12
6
|
</div>
|
|
@@ -69,31 +63,12 @@ export default class CanvasPoster extends Vue {
|
|
|
69
63
|
image.onload = () => {
|
|
70
64
|
if (radius) {
|
|
71
65
|
ctx.save();
|
|
72
|
-
this.roundRect(
|
|
73
|
-
ctx,
|
|
74
|
-
point[0],
|
|
75
|
-
point[1],
|
|
76
|
-
width || image.width,
|
|
77
|
-
height || image.height,
|
|
78
|
-
radius
|
|
79
|
-
);
|
|
66
|
+
this.roundRect(ctx, point[0], point[1], width || image.width, height || image.height, radius);
|
|
80
67
|
ctx.clip();
|
|
81
|
-
ctx.drawImage(
|
|
82
|
-
image,
|
|
83
|
-
point[0],
|
|
84
|
-
point[1],
|
|
85
|
-
width || image.width,
|
|
86
|
-
height || image.height
|
|
87
|
-
);
|
|
68
|
+
ctx.drawImage(image, point[0], point[1], width || image.width, height || image.height);
|
|
88
69
|
ctx.restore();
|
|
89
70
|
} else {
|
|
90
|
-
ctx.drawImage(
|
|
91
|
-
image,
|
|
92
|
-
point[0],
|
|
93
|
-
point[1],
|
|
94
|
-
width || image.width,
|
|
95
|
-
height || image.height
|
|
96
|
-
);
|
|
71
|
+
ctx.drawImage(image, point[0], point[1], width || image.width, height || image.height);
|
|
97
72
|
}
|
|
98
73
|
resolve();
|
|
99
74
|
};
|
|
@@ -170,14 +145,7 @@ export default class CanvasPoster extends Vue {
|
|
|
170
145
|
}
|
|
171
146
|
}
|
|
172
147
|
|
|
173
|
-
drawRect({
|
|
174
|
-
type,
|
|
175
|
-
color,
|
|
176
|
-
point = [0, 0],
|
|
177
|
-
width = window.innerWidth,
|
|
178
|
-
height = window.innerHeight,
|
|
179
|
-
radius
|
|
180
|
-
}) {
|
|
148
|
+
drawRect({ type, color, point = [0, 0], width = window.innerWidth, height = window.innerHeight, radius }) {
|
|
181
149
|
return new Promise((resolve: any) => {
|
|
182
150
|
const canvas: any = document.getElementById('canvasPoster');
|
|
183
151
|
if (canvas.getContext) {
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Description:
|
|
3
|
-
* @Author: lizhao
|
|
4
|
-
* @Date: 2020-11-13 17:53:09
|
|
5
|
-
* @LastEditors: lizhao
|
|
6
|
-
* @LastEditTime: 2020-12-03 17:01:36
|
|
7
|
-
* @FilePath: /bxs-tools-ui/packages/components/form-item/select-item.vue
|
|
8
|
-
-->
|
|
9
1
|
<template>
|
|
10
2
|
<div class="bxt-item-select" @click="openPicker">
|
|
11
|
-
<bxs-input readonly v-bind="inputAttrs" v-model="valueDesc" />
|
|
3
|
+
<bxs-input readonly v-bind="inputAttrs" v-model="valueDesc" @click-icon="$emit('clickIcon', eleData)" />
|
|
12
4
|
</div>
|
|
13
5
|
</template>
|
|
14
6
|
<script lang="ts">
|
|
@@ -25,7 +17,7 @@ Vue.use(DatetimePicker);
|
|
|
25
17
|
}
|
|
26
18
|
})
|
|
27
19
|
export default class BxtSelectItem extends Vue {
|
|
28
|
-
@Model('
|
|
20
|
+
@Model('input', {})
|
|
29
21
|
value!: String | Number;
|
|
30
22
|
|
|
31
23
|
@Prop({
|
|
@@ -60,9 +52,7 @@ export default class BxtSelectItem extends Vue {
|
|
|
60
52
|
let valueDesc: String | Number = '';
|
|
61
53
|
if (this.eleData) {
|
|
62
54
|
if (this.eleData.componentName === 'cmCommonSelect') {
|
|
63
|
-
let currentOption: any = this.options.find(
|
|
64
|
-
(o: any): any => o.val == this.value
|
|
65
|
-
);
|
|
55
|
+
let currentOption: any = this.options.find((o: any): any => o.val == this.value);
|
|
66
56
|
if (currentOption && currentOption.desc) {
|
|
67
57
|
valueDesc = currentOption.desc;
|
|
68
58
|
}
|
|
@@ -85,7 +75,7 @@ export default class BxtSelectItem extends Vue {
|
|
|
85
75
|
);
|
|
86
76
|
}
|
|
87
77
|
onChange(val) {
|
|
88
|
-
this.$emit('
|
|
78
|
+
this.$emit('input', val);
|
|
89
79
|
this.$emit('change', val);
|
|
90
80
|
}
|
|
91
81
|
openPicker(): any {
|
|
@@ -95,9 +85,7 @@ export default class BxtSelectItem extends Vue {
|
|
|
95
85
|
}
|
|
96
86
|
|
|
97
87
|
if (self.eleData && self.eleData.componentName === 'cmCommonDate') {
|
|
98
|
-
let defaultValue = self.value
|
|
99
|
-
? new Date(self.value)
|
|
100
|
-
: self.eleData.defaulValue || new Date();
|
|
88
|
+
let defaultValue = self.value ? new Date(self.value) : self.eleData.defaulValue || new Date();
|
|
101
89
|
self.$datetime({
|
|
102
90
|
value: defaultValue,
|
|
103
91
|
type: 'date',
|
|
@@ -4,12 +4,7 @@
|
|
|
4
4
|
<span v-if="code" class="bxt-title-code">{{ code }}</span>
|
|
5
5
|
<span>{{ label }}</span>
|
|
6
6
|
</label>
|
|
7
|
-
<bxs-checkbox
|
|
8
|
-
class="item-title-checkbox"
|
|
9
|
-
:disabled="disabled"
|
|
10
|
-
v-model="currentValue"
|
|
11
|
-
@change="onchange"
|
|
12
|
-
/>
|
|
7
|
+
<bxs-checkbox class="item-title-checkbox" :disabled="disabled" v-model="currentValue" @change="onchange" />
|
|
13
8
|
</div>
|
|
14
9
|
</template>
|
|
15
10
|
<script lang="ts">
|
|
@@ -24,7 +19,7 @@ import { Checkbox } from 'bxs-ui-vue';
|
|
|
24
19
|
})
|
|
25
20
|
export default class BxtTitleItem extends Vue {
|
|
26
21
|
currentValue: boolean = false;
|
|
27
|
-
@Model('
|
|
22
|
+
@Model('input', {})
|
|
28
23
|
value!: boolean;
|
|
29
24
|
|
|
30
25
|
@Prop({
|
|
@@ -58,7 +53,7 @@ export default class BxtTitleItem extends Vue {
|
|
|
58
53
|
this.currentValue = this.value;
|
|
59
54
|
}
|
|
60
55
|
onchange(val) {
|
|
61
|
-
this.$emit('
|
|
56
|
+
this.$emit('input', val);
|
|
62
57
|
this.$emit('change', val);
|
|
63
58
|
}
|
|
64
59
|
}
|
|
@@ -16,10 +16,7 @@
|
|
|
16
16
|
import { Component, Vue } from 'vue-property-decorator';
|
|
17
17
|
import InsureCalculate from '../index.vue';
|
|
18
18
|
|
|
19
|
-
import {
|
|
20
|
-
insureCalculate,
|
|
21
|
-
checkInsureCalculate
|
|
22
|
-
} from 'packages/bxs-utils/index.js';
|
|
19
|
+
import { insureCalculate, checkInsureCalculate } from 'packages/bxs-utils/index.js';
|
|
23
20
|
|
|
24
21
|
@Component({
|
|
25
22
|
components: {
|