bxs-tools-ui 3.2.0 → 3.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.
Files changed (148) hide show
  1. package/README.md +20 -20
  2. package/es/add-and-take/index.css +1 -1
  3. package/es/add-and-take/index.js +283 -64
  4. package/es/adjust-baoe/index.css +1 -1
  5. package/es/adjust-baoe/index.js +444 -195
  6. package/es/business-card/index.css +1 -1
  7. package/es/business-card/index.js +1 -0
  8. package/es/canvas-poster/index.css +1 -1
  9. package/es/canvas-poster/index.js +1 -0
  10. package/es/index.css +1 -1
  11. package/es/index.js +936 -824
  12. package/es/insure-calculate/index.css +1 -1
  13. package/es/insure-calculate/index.js +438 -265
  14. package/es/person-info/index.css +1 -1
  15. package/es/person-info/index.js +296 -1370
  16. package/es/product-info/index.css +1 -1
  17. package/es/product-info/index.js +644 -548
  18. package/es/share-sheet/index.css +1 -1
  19. package/es/share-sheet/index.js +313 -21
  20. package/es/utils/index.js +530 -429
  21. package/lib/add-and-take/index.css +1 -1
  22. package/lib/add-and-take/index.js +283 -64
  23. package/lib/adjust-baoe/index.css +1 -1
  24. package/lib/adjust-baoe/index.js +441 -194
  25. package/lib/business-card/index.css +1 -1
  26. package/lib/business-card/index.js +1 -0
  27. package/lib/canvas-poster/index.css +1 -1
  28. package/lib/canvas-poster/index.js +1 -0
  29. package/lib/index.css +1 -1
  30. package/lib/index.js +939 -826
  31. package/lib/insure-calculate/index.css +1 -1
  32. package/lib/insure-calculate/index.js +438 -268
  33. package/lib/person-info/index.css +1 -1
  34. package/lib/person-info/index.js +295 -1372
  35. package/lib/product-info/index.css +1 -1
  36. package/lib/product-info/index.js +645 -550
  37. package/lib/share-sheet/index.css +1 -1
  38. package/lib/share-sheet/index.js +313 -25
  39. package/lib/utils/index.js +531 -433
  40. package/package.json +9 -7
  41. package/packages/add-and-take/components/interest-form.less +144 -0
  42. package/packages/add-and-take/components/interest-form.vue +179 -179
  43. package/packages/add-and-take/components/interest-items.less +87 -0
  44. package/packages/add-and-take/components/interest-items.vue +67 -80
  45. package/packages/add-and-take/components/interest-table.less +111 -0
  46. package/packages/add-and-take/components/interest-table.vue +31 -31
  47. package/packages/add-and-take/constant.ts +2 -2
  48. package/packages/add-and-take/demo/index.vue +89 -86
  49. package/packages/add-and-take/handler.ts +52 -57
  50. package/packages/add-and-take/index.less +69 -0
  51. package/packages/add-and-take/index.vue +156 -156
  52. package/packages/add-and-take/readme.md +87 -98
  53. package/packages/adjust-baoe/demo/index.vue +37 -47
  54. package/packages/adjust-baoe/index.less +125 -0
  55. package/packages/adjust-baoe/index.vue +134 -147
  56. package/packages/adjust-baoe/readme.md +35 -45
  57. package/packages/business-card/demo/index.vue +7 -7
  58. package/packages/business-card/index.less +100 -0
  59. package/packages/business-card/index.vue +18 -21
  60. package/packages/business-card/readme.md +46 -53
  61. package/packages/bxs-utils/demo/index.vue +2 -2
  62. package/packages/bxs-utils/index.ts +5 -5
  63. package/packages/bxs-utils/planbook/common.ts +56 -92
  64. package/packages/bxs-utils/planbook/index.ts +4 -4
  65. package/packages/bxs-utils/planbook/insurance.ts +137 -127
  66. package/packages/bxs-utils/planbook/person.ts +143 -147
  67. package/packages/bxs-utils/planbook/product.ts +473 -509
  68. package/packages/bxs-utils/readme.md +94 -84
  69. package/packages/bxs-utils/trade/index.js +1 -1
  70. package/packages/bxs-utils/trade/insureCalculate.js +91 -204
  71. package/packages/canvas-poster/demo/index.vue +9 -13
  72. package/packages/canvas-poster/index.less +5 -0
  73. package/packages/canvas-poster/index.vue +68 -79
  74. package/packages/canvas-poster/readme.md +106 -109
  75. package/packages/index.ts +1 -1
  76. package/packages/insure-calculate/demo/index.vue +20 -20
  77. package/packages/insure-calculate/index.less +366 -0
  78. package/packages/insure-calculate/index.vue +305 -329
  79. package/packages/insure-calculate/readme.md +99 -106
  80. package/packages/person-info/crm-popup.vue +81 -80
  81. package/packages/person-info/demo/index.vue +25 -37
  82. package/packages/person-info/index-inline.less +11 -0
  83. package/packages/person-info/index.vue +53 -83
  84. package/packages/person-info/readme.md +109 -115
  85. package/packages/planbook-input/components/footer.less +54 -0
  86. package/packages/planbook-input/components/footer.vue +8 -64
  87. package/packages/planbook-input/components/handler.js +33 -44
  88. package/packages/planbook-input/components/product-table.less +235 -0
  89. package/packages/planbook-input/components/product-table.vue +114 -108
  90. package/packages/planbook-input/demo/index.vue +3 -3
  91. package/packages/planbook-input/helper.js +852 -465
  92. package/packages/planbook-input/index.less +30 -0
  93. package/packages/planbook-input/index.vue +86 -103
  94. package/packages/planbook-input/readme.md +72 -90
  95. package/packages/product-info/demo/constant.js +1 -1
  96. package/packages/product-info/demo/index.vue +31 -43
  97. package/packages/product-info/index.less +271 -0
  98. package/packages/product-info/index.vue +198 -210
  99. package/packages/product-info/readme.md +72 -75
  100. package/packages/share-sheet/constant.js +4 -4
  101. package/packages/share-sheet/demo/index.vue +10 -10
  102. package/packages/share-sheet/handler.js +14 -14
  103. package/packages/share-sheet/index.less +201 -0
  104. package/packages/share-sheet/index.vue +39 -39
  105. package/packages/share-sheet/readme.md +121 -127
  106. package/src/api/add-and-take.js +45 -0
  107. package/src/api/adjust-baoe.js +16 -0
  108. package/src/api/index.js +6 -0
  109. package/src/api/planbook.js +93 -0
  110. package/src/api/request.js +211 -0
  111. package/src/api/trade.js +56 -0
  112. package/src/api/user.js +18 -0
  113. package/src/components/common/common-age-birthday.less +66 -0
  114. package/src/components/common/common-age-birthday.vue +27 -95
  115. package/src/components/common/common-popup.less +81 -0
  116. package/src/components/common/common-popup.vue +12 -96
  117. package/src/components/common/common-radio.less +75 -0
  118. package/src/components/common/common-radio.vue +13 -91
  119. package/src/components/common/common-select.less +13 -0
  120. package/src/components/common/common-select.vue +21 -38
  121. package/src/components/common/common-title.less +115 -0
  122. package/src/components/common/common-title.vue +24 -24
  123. package/src/js/loading.js +6 -6
  124. package/src/js/md5Token.js +38 -44
  125. package/src/js/utils.js +45 -53
  126. package/src/js/variables.js +47 -25
  127. package/src/style/base.less +18 -0
  128. package/src/style/color.less +40 -0
  129. package/src/style/variables.less +21 -42
  130. package/packages/add-and-take/api.ts +0 -70
  131. package/packages/add-and-take/components/interest-form.css +0 -146
  132. package/packages/add-and-take/components/interest-items.css +0 -87
  133. package/packages/add-and-take/components/interest-table.css +0 -113
  134. package/packages/add-and-take/index.css +0 -70
  135. package/packages/adjust-baoe/index.css +0 -123
  136. package/packages/business-card/index.css +0 -101
  137. package/packages/canvas-poster/index.css +0 -5
  138. package/packages/insure-calculate/index.css +0 -368
  139. package/packages/planbook-input/api.js +0 -29
  140. package/packages/planbook-input/components/product-table.css +0 -236
  141. package/packages/planbook-input/index.css +0 -31
  142. package/packages/product-info/index.css +0 -264
  143. package/packages/share-sheet/index.css +0 -203
  144. package/src/components/common/common-title.css +0 -116
  145. package/src/js/request.js +0 -64
  146. package/src/style/apply.css +0 -25
  147. package/src/style/base.css +0 -36
  148. package/src/style/color.css +0 -74
@@ -83,15 +83,14 @@
83
83
  </div>
84
84
  </template>
85
85
  <script lang="ts">
86
- import QS from 'qs';
87
- import { Vue, Component, Prop, Watch } from 'vue-property-decorator';
88
- import cloneDeep from 'lodash/cloneDeep';
89
- import { Toast } from 'vant';
90
- import { convertPersonData, convertProductData } from 'packages/bxs-utils/planbook/index';
91
- import { PLANBOOK_API_HOSTNAME } from '@src/js/variables.js';
92
- import './index.css';
86
+ import { Vue, Component, Prop, Watch } from 'vue-property-decorator'
87
+ import cloneDeep from 'lodash/cloneDeep'
88
+ import { Toast } from 'vant'
89
+ import { validateAdjustBaoe } from '../../src/api/adjust-baoe.js'
90
+ import { convertPersonData, convertProductData } from 'packages/bxs-utils/planbook/index'
91
+ import './index.less'
93
92
 
94
- Vue.use(Toast);
93
+ Vue.use(Toast)
95
94
  @Component({})
96
95
  export default class AdjustBaoe extends Vue {
97
96
  @Prop({
@@ -99,50 +98,50 @@ export default class AdjustBaoe extends Vue {
99
98
  default: () => ({}),
100
99
  required: true
101
100
  })
102
- inputData: any;
101
+ inputData: any
103
102
  @Prop({
104
103
  type: Object,
105
104
  default: () => ({})
106
105
  })
107
- params: any;
106
+ params: any
108
107
  @Prop({
109
108
  type: String,
110
109
  default: () => 'Table',
111
110
  validator: value => {
112
- return ['Table', 'Form'].includes(value);
111
+ return ['Table', 'Form'].includes(value)
113
112
  }
114
113
  })
115
- submoduleName: any;
114
+ submoduleName: any
116
115
  @Prop({
117
116
  type: Boolean,
118
117
  default: true
119
118
  })
120
- footer: boolean;
119
+ footer: boolean
121
120
 
122
- hasAdjustBaoe = false;
123
- subName = 'Table';
124
- defaultAdjustRecord = null;
125
- adjustBaoeInsTitles = {};
126
- adjustBaoeData = null;
127
- formData = null;
121
+ hasAdjustBaoe = false
122
+ subName = 'Table'
123
+ defaultAdjustRecord = null
124
+ adjustBaoeInsTitles = {}
125
+ adjustBaoeData = null
126
+ formData = null
128
127
 
129
128
  get personData() {
130
- return this.inputData && this.inputData.personData;
129
+ return this.inputData && this.inputData.personData
131
130
  }
132
131
  get insurerInfo() {
133
- return convertPersonData(this.personData, 'insuredInfo');
132
+ return convertPersonData(this.personData, 'insuredInfo')
134
133
  }
135
134
  get groupData() {
136
- return this.inputData && this.inputData.productGroupList.find(g => g.key === this.params.groupKey);
135
+ return this.inputData && this.inputData.productGroupList.find(g => g.key === this.params.groupKey)
137
136
  }
138
137
  get productData() {
139
- return this.groupData && this.groupData.prodOrderList.find(p => p.key === this.params.productKey);
138
+ return this.groupData && this.groupData.prodOrderList.find(p => p.key === this.params.productKey)
140
139
  }
141
140
 
142
141
  get adjustBaoeTable() {
143
- const { insurerInfo, productData, defaultAdjustRecord, adjustBaoeInsTitles, adjustBaoeData } = this;
142
+ const { insurerInfo, productData, defaultAdjustRecord, adjustBaoeInsTitles, adjustBaoeData } = this
144
143
  if (!(productData && productData.mulInsOrderList && productData.mulInsOrderList.length)) {
145
- return null;
144
+ return null
146
145
  }
147
146
  const options = [
148
147
  {
@@ -150,18 +149,18 @@ export default class AdjustBaoe extends Vue {
150
149
  age: '年龄',
151
150
  ...adjustBaoeInsTitles
152
151
  }
153
- ];
154
- let adjustRecord = null;
152
+ ]
153
+ let adjustRecord = null
155
154
  for (let k = insurerInfo.age + 1; k <= 105; k++) {
156
155
  if (adjustBaoeData && adjustBaoeData.length) {
157
156
  if (adjustRecord) {
158
- const currentAdjustBaoeData = adjustBaoeData.find(ad => ad.age > adjustRecord.age);
157
+ const currentAdjustBaoeData = adjustBaoeData.find(ad => ad.age > adjustRecord.age)
159
158
  if (currentAdjustBaoeData && k === Number(currentAdjustBaoeData.age)) {
160
- adjustRecord = currentAdjustBaoeData;
159
+ adjustRecord = currentAdjustBaoeData
161
160
  }
162
161
  } else {
163
162
  if (k >= adjustBaoeData[0].age) {
164
- adjustRecord = adjustBaoeData[0];
163
+ adjustRecord = adjustBaoeData[0]
165
164
  }
166
165
  }
167
166
  }
@@ -169,128 +168,116 @@ export default class AdjustBaoe extends Vue {
169
168
  ...(adjustRecord || defaultAdjustRecord),
170
169
  year: options.length,
171
170
  age: k
172
- });
171
+ })
173
172
  }
174
- return options;
173
+ return options
175
174
  }
176
175
 
177
176
  @Watch('subName', {})
178
177
  watchMName(val: Boolean) {
179
- this.$emit('update:submoduleName', val);
178
+ this.$emit('update:submoduleName', val)
180
179
  }
181
180
 
182
181
  created() {
183
- this.hasAdjustBaoe = this.productData.mulInsOrderList.some(ins => !!ins.adjustBaoe);
182
+ this.hasAdjustBaoe = this.productData.mulInsOrderList.some(ins => !!ins.adjustBaoe)
184
183
  if (!this.hasAdjustBaoe) {
185
- this.$toast('缺少调整保额的配置');
186
- return;
184
+ this.$toast('缺少调整保额的配置')
185
+ return
187
186
  }
188
187
  if (this.submoduleName) {
189
- this.subName = this.submoduleName;
188
+ this.subName = this.submoduleName
190
189
  }
191
- this.defaultAdjustRecord = this.genAdjustRecord(this.productData.mulInsOrderList);
192
- this.adjustBaoeInsTitles = this.getAdjustBaoeInsTitles(this.productData.mulInsOrderList, this.defaultAdjustRecord);
193
- this.adjustBaoeData = this.productData.adjustBaoeData;
190
+ this.defaultAdjustRecord = this.genAdjustRecord(this.productData.mulInsOrderList)
191
+ this.adjustBaoeInsTitles = this.getAdjustBaoeInsTitles(this.productData.mulInsOrderList, this.defaultAdjustRecord)
192
+ this.adjustBaoeData = this.productData.adjustBaoeData
194
193
  }
195
194
  genAdjustRecord(insList) {
196
195
  if (!insList) {
197
- return null;
196
+ return null
198
197
  }
199
- const adjustRecord = {};
198
+ const adjustRecord = {}
200
199
  insList.map((ins, idx, arr) => {
201
- const titleUi = ins.eleOrderList.find(e => e.key === 'title');
200
+ const titleUi = ins.eleOrderList.find(e => e.key === 'title')
202
201
  if (!(ins.adjustBaoe && !ins.groupKey && titleUi && titleUi.value)) {
203
- return;
202
+ return
204
203
  }
205
- let groupChecked;
204
+ let groupChecked
206
205
  if (ins.isGroup) {
207
206
  groupChecked = arr.find(groupIns => {
208
- const insuranceIdUi = ins.eleOrderList.find(e => e.key === 'insuranceId');
209
- return insuranceIdUi && groupIns.key == insuranceIdUi.value;
210
- });
207
+ const insuranceIdUi = ins.eleOrderList.find(e => e.key === 'insuranceId')
208
+ return insuranceIdUi && groupIns.key == insuranceIdUi.value
209
+ })
211
210
  }
212
- const adjustKey = `baoe_${(groupChecked || ins).code || (groupChecked || ins).key}`;
213
- const baoeUi = ins.eleOrderList.find(e => e.key === 'baoe');
214
- adjustRecord[adjustKey] = baoeUi && baoeUi.value ? baoeUi.value : 0;
215
- });
216
- return adjustRecord;
211
+ const adjustKey = `baoe_${(groupChecked || ins).code || (groupChecked || ins).key}`
212
+ const baoeUi = ins.eleOrderList.find(e => e.key === 'baoe')
213
+ adjustRecord[adjustKey] = baoeUi && baoeUi.value ? baoeUi.value : 0
214
+ })
215
+ return adjustRecord
217
216
  }
218
217
  getAdjustBaoeInsTitles(insList, adjustRecord) {
219
- const adjustData = {};
218
+ const adjustData = {}
220
219
  for (let k in adjustRecord) {
221
- const insData = insList.find(ins => ins[ins.code ? 'code' : 'key'] == k.replace(/baoe_/, ''));
220
+ const insData = insList.find(ins => ins[ins.code ? 'code' : 'key'] == k.replace(/baoe_/, ''))
222
221
  if (insData) {
223
- adjustData[k] = /(\(|\()([^\(\(]+)(\)|\))$/.exec(insData.name) ? /(\(|\()([^\(\(]+)(\)|\))$/.exec(insData.name)[2] : insData.name;
222
+ adjustData[k] = /(\(|\()([^\(\(]+)(\)|\))$/.exec(insData.name) ? /(\(|\()([^\(\(]+)(\)|\))$/.exec(insData.name)[2] : insData.name
224
223
  }
225
224
  }
226
- return adjustData;
225
+ return adjustData
227
226
  }
228
227
  isModifyValue(adjust, key) {
229
- return this.adjustBaoeData && this.adjustBaoeData.some(ad => ad.age === adjust.age && ad[key] !== this.defaultAdjustRecord[key]);
228
+ return this.adjustBaoeData && this.adjustBaoeData.some(ad => ad.age === adjust.age && ad[key] !== this.defaultAdjustRecord[key])
230
229
  }
231
230
 
232
231
  checkAdjustBaoe() {
233
- const { params, personData, productData } = this;
234
- const cloneProductData = convertProductData(cloneDeep(productData));
235
- const cloneAdjustBaoeData = cloneDeep(this.adjustBaoeData);
236
- this.updateData(this.formData);
232
+ const { params, personData, productData } = this
233
+ const cloneProductData = convertProductData(cloneDeep(productData))
234
+ const cloneAdjustBaoeData = cloneDeep(this.adjustBaoeData)
235
+ this.updateData(this.formData)
237
236
  if (!this.adjustBaoeData) {
238
- return Promise.resolve();
237
+ return Promise.resolve()
239
238
  }
240
- const deleteProdKeys = ['hadChoice', 'hide', 'totalBaof', 'insShowArr', 'autoImport', 'accountData', 'adjustBaoeData'];
239
+ const deleteProdKeys = ['hadChoice', 'hide', 'totalBaof', 'insShowArr', 'autoImport', 'accountData', 'adjustBaoeData']
241
240
  deleteProdKeys.forEach(ele => {
242
- delete cloneProductData[ele];
243
- });
241
+ delete cloneProductData[ele]
242
+ })
244
243
  cloneProductData.mulInsOrderList?.forEach(ins => {
245
- const deleteInsKeys = ['isFollowing', 'pPeriodDesc', 'baoeDesc', 'baofDesc', 'iDurationDesc', 'isCheckbox', 'groupKey', 'groupName'];
244
+ const deleteInsKeys = ['isFollowing', 'pPeriodDesc', 'baoeDesc', 'baofDesc', 'iDurationDesc', 'isCheckbox', 'groupKey', 'groupName']
246
245
  deleteInsKeys.forEach(ele => {
247
- delete ins[ele];
248
- });
249
- });
250
- const url = `${PLANBOOK_API_HOSTNAME}/planBook/${params.publicPbUuid ? 'public' : 'V2'}/validateAccount/-1/low`;
251
- return fetch(url, {
252
- method: 'POST',
253
- credentials: 'include',
254
- headers: {
255
- Accept: 'application/json, text/plain, */*',
256
- 'Content-Type': 'application/x-www-form-urlencoded'
257
- },
258
- body: QS.stringify({
259
- jd: JSON.stringify({
260
- insuranceTypeId: params.planbookId * 1,
261
- publicPbUuid: params.publicPbUuid,
262
- personData: {
263
- personOrderList: convertPersonData(
264
- personData,
265
- personData.personOrderList.map(p => p.key)
266
- )
267
- },
268
- productGroupList: [
269
- {
270
- key: params.groupKey,
271
- prodOrderList: [
272
- {
273
- ...cloneProductData,
274
- adjustBaoeData: this.adjustBaoeData
275
- }
276
- ]
277
- }
278
- ]
279
- })
246
+ delete ins[ele]
280
247
  })
281
248
  })
282
- .then(response => response.json())
283
- .then(({ success, data, info }: any) => {
284
- if (!success || !data || data === -1) {
285
- this.adjustBaoeData = cloneAdjustBaoeData;
286
- this.$toast(info);
287
- return Promise.reject();
288
- }
289
- return Promise.resolve(data);
290
- })
291
- .catch(err => {
292
- console.log(err);
293
- });
249
+ return validateAdjustBaoe(
250
+ {
251
+ insuranceTypeId: params.planbookId * 1,
252
+ publicPbUuid: params.publicPbUuid,
253
+ personData: {
254
+ personOrderList: convertPersonData(
255
+ personData,
256
+ personData.personOrderList.map(p => p.key)
257
+ )
258
+ },
259
+ productGroupList: [
260
+ {
261
+ key: params.groupKey,
262
+ prodOrderList: [
263
+ {
264
+ ...cloneProductData,
265
+ adjustBaoeData: this.adjustBaoeData
266
+ }
267
+ ]
268
+ }
269
+ ]
270
+ },
271
+ {
272
+ publicPbUuid: params.publicPbUuid
273
+ }
274
+ ).catch(err => {
275
+ this.adjustBaoeData = cloneAdjustBaoeData
276
+ if (err) {
277
+ this.$toast(err)
278
+ }
279
+ console.log(err)
280
+ })
294
281
  }
295
282
  updateData(values) {
296
283
  if (
@@ -298,88 +285,88 @@ export default class AdjustBaoe extends Vue {
298
285
  .filter(key => key.match('new') && values[key])
299
286
  .every(key => values[key] === values[key.replace('new', '')])
300
287
  ) {
301
- return;
288
+ return
302
289
  }
303
- const temp = {};
290
+ const temp = {}
304
291
  for (let k in values) {
305
292
  if (!k.match('new')) {
306
- temp[k] = values[`new${k}`] || values[k];
293
+ temp[k] = values[`new${k}`] || values[k]
307
294
  }
308
295
  }
309
296
  if (!this.adjustBaoeData) {
310
- this.adjustBaoeData = [temp];
311
- return;
297
+ this.adjustBaoeData = [temp]
298
+ return
312
299
  }
313
- const index = this.adjustBaoeData.findIndex(a => a.age === temp.age);
300
+ const index = this.adjustBaoeData.findIndex(a => a.age === temp.age)
314
301
  if (index > -1) {
315
- this.adjustBaoeData.splice(index, 1, temp);
302
+ this.adjustBaoeData.splice(index, 1, temp)
316
303
  } else {
317
- this.adjustBaoeData.push(temp);
304
+ this.adjustBaoeData.push(temp)
318
305
  }
319
- this.adjustBaoeData = this.adjustBaoeData.sort((a, b) => a.age - b.age);
306
+ this.adjustBaoeData = this.adjustBaoeData.sort((a, b) => a.age - b.age)
320
307
  }
321
308
  onClickEditIcon(id) {
322
- const inputDom: any = document.querySelector(`#${id}`);
323
- inputDom.focus();
309
+ const inputDom: any = document.querySelector(`#${id}`)
310
+ inputDom.focus()
324
311
  }
325
312
  onClickToForm(item, index) {
326
313
  if (index === 0) {
327
- return;
314
+ return
328
315
  }
329
- const temp = { ...item };
330
- delete temp.year;
316
+ const temp = { ...item }
317
+ delete temp.year
331
318
  for (let k in temp) {
332
319
  if (!['age'].includes(k)) {
333
- temp[`new${k}`] = null;
320
+ temp[`new${k}`] = null
334
321
  }
335
322
  }
336
- this.formData = temp;
337
- this.goToForm();
323
+ this.formData = temp
324
+ this.goToForm()
338
325
  }
339
326
 
340
327
  goToTable() {
341
- this.subName = 'Table';
328
+ this.subName = 'Table'
342
329
  }
343
330
  goToForm() {
344
- this.subName = 'Form';
331
+ this.subName = 'Form'
345
332
  }
346
333
  tableConfirm() {
347
- return this.$emit('confirm', this.adjustBaoeData, this);
334
+ return this.$emit('confirm', this.adjustBaoeData, this)
348
335
  }
349
336
  formConfirm() {
350
- const refForm: any = this.$refs.Form;
337
+ const refForm: any = this.$refs.Form
351
338
  return refForm
352
339
  .validate()
353
340
  .then(() => {
354
341
  this.checkAdjustBaoe().then(
355
342
  () => {
356
- this.goToTable();
343
+ this.goToTable()
357
344
  },
358
345
  err => {
359
- this.$toast('调整保额:Error');
360
- console.log(err);
346
+ this.$toast('调整保额:Error')
347
+ console.log(err)
361
348
  }
362
- );
349
+ )
363
350
  })
364
351
  .catch(err => {
365
- console.log(err);
366
- });
352
+ console.log(err)
353
+ })
367
354
  }
368
355
  confirm() {
369
356
  if (this.subName === 'Form') {
370
- this.formConfirm();
371
- return Promise.reject();
357
+ this.formConfirm()
358
+ return Promise.reject()
372
359
  }
373
- this.tableConfirm();
374
- return Promise.resolve(this.adjustBaoeData);
360
+ this.tableConfirm()
361
+ return Promise.resolve(this.adjustBaoeData)
375
362
  }
376
363
  closeKeyBoard() {
377
- const activeElement: any = document.activeElement;
364
+ const activeElement: any = document.activeElement
378
365
  if (!activeElement) {
379
- return false;
366
+ return false
380
367
  }
381
- activeElement.blur();
382
- return false;
368
+ activeElement.blur()
369
+ return false
383
370
  }
384
371
  }
385
372
  </script>
@@ -28,16 +28,7 @@ export default {
28
28
 
29
29
  ```html
30
30
  <template>
31
- <CommonPopup
32
- v-model="isShowAdjustBaoe"
33
- title="调整保额"
34
- height="90%"
35
- closeable
36
- position="bottom"
37
- get-container="body"
38
- :showFooter="false"
39
- :z-index="100"
40
- >
31
+ <CommonPopup v-model="isShowAdjustBaoe" title="调整保额" height="90%" closeable position="bottom" get-container="body" :showFooter="false" :z-index="100">
41
32
  <AdjustBaoe
42
33
  v-if="isShowAdjustBaoe"
43
34
  ref="AdjustBaoe"
@@ -73,21 +64,21 @@ export default {
73
64
  </template>
74
65
 
75
66
  <script>
76
- import { AdjustBaoe } from 'bxs-tools-ui';
77
-
78
- export default {
79
- components: { AdjustBaoe },
80
- data() {
81
- return {
82
- submoduleName: 'Table'
83
- };
84
- },
85
- methods: {
86
- onConfirm(adjustBaoeData, inst) {
87
- console.log(adjustBaoeData);
67
+ import { AdjustBaoe } from 'bxs-tools-ui';
68
+
69
+ export default {
70
+ components: { AdjustBaoe },
71
+ data() {
72
+ return {
73
+ submoduleName: 'Table'
74
+ };
75
+ },
76
+ methods: {
77
+ onConfirm(adjustBaoeData, inst) {
78
+ console.log(adjustBaoeData);
79
+ }
88
80
  }
89
- }
90
- };
81
+ };
91
82
  </script>
92
83
  ```
93
84
 
@@ -109,37 +100,36 @@ export default {
109
100
 
110
101
  ### Attributes
111
102
 
112
- | 参数 | 说明 | 类型 | 默认值 | 备注 |
113
- | --- | --- | --- | --- | --- |
114
- | `inputData` | 必传,计划书数据,需符合计划书数据结构 | Object | `{}` | — |
115
- | `params` | 必传,需有 `groupKey` / `productKey` 才能正常定位产品 | Object | `{}` | 见 Params 对象 |
116
- | `submoduleName` | 可选,当前子模块名称,支持 `.sync` 双向绑定 | String | `Table` | `Table` / `Form` |
117
- | `footer` | 可选,是否显示底部按钮 | Boolean | `true` | — |
118
-
103
+ | 参数 | 说明 | 类型 | 默认值 | 备注 |
104
+ | --------------- | ----------------------------------------------------- | ------- | ------- | ---------------- |
105
+ | `inputData` | 必传,计划书数据,需符合计划书数据结构 | Object | `{}` | — |
106
+ | `params` | 必传,需有 `groupKey` / `productKey` 才能正常定位产品 | Object | `{}` | 见 Params 对象 |
107
+ | `submoduleName` | 可选,当前子模块名称,支持 `.sync` 双向绑定 | String | `Table` | `Table` / `Form` |
108
+ | `footer` | 可选,是否显示底部按钮 | Boolean | `true` | — |
119
109
 
120
110
  #### Params 对象
121
111
 
122
- | 参数 | 说明 | 类型 |
123
- | --- | --- | --- |
124
- | `planbookId` | 计划书 ID | Number |
125
- | `groupKey` | 产品组的 key | String / Number |
126
- | `productKey` | 产品的 key | Number |
127
- | `publicPbUuid` | 公开计划书的 uuid;传入时调用 public 接口进行保额校验 | String |
112
+ | 参数 | 说明 | 类型 |
113
+ | -------------- | ----------------------------------------------------- | --------------- |
114
+ | `planbookId` | 计划书 ID | Number |
115
+ | `groupKey` | 产品组的 key | String / Number |
116
+ | `productKey` | 产品的 key | Number |
117
+ | `publicPbUuid` | 公开计划书的 uuid;传入时调用 public 接口进行保额校验 | String |
128
118
 
129
119
  ---
130
120
 
131
121
  ### Methods
132
122
 
133
- | 方法名 | 说明 | 参数 |
134
- | --- | --- | --- |
135
- | `goToTable` | 从 Form 子模块返回 Table 子模块 | — |
136
- | `confirm` | 自动触发 Table / Form 的确定事件;当前为 Table 时返回调整保额数据 | — |
123
+ | 方法名 | 说明 | 参数 |
124
+ | ----------- | ----------------------------------------------------------------- | ---- |
125
+ | `goToTable` | 从 Form 子模块返回 Table 子模块 | — |
126
+ | `confirm` | 自动触发 Table / Form 的确定事件;当前为 Table 时返回调整保额数据 | — |
137
127
 
138
128
  ---
139
129
 
140
130
  ### Events
141
131
 
142
- | 事件名 | 说明 | 回调参数 |
143
- | --- | --- | --- |
144
- | `confirm` | 确定事件;`footer` 为 `true` 时,Table 子模块底部确定按钮的回调(Form 子模块的确定不触发此事件,仅切回 Table) | `Function(adjustBaoeData, 模块实例)` |
145
- | `update:submoduleName` | 子模块切换时触发,配合 `:submoduleName.sync` 使用 | 当前子模块名称(`'Table'` / `'Form'`) |
132
+ | 事件名 | 说明 | 回调参数 |
133
+ | ---------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
134
+ | `confirm` | 确定事件;`footer` 为 `true` 时,Table 子模块底部确定按钮的回调(Form 子模块的确定不触发此事件,仅切回 Table) | `Function(adjustBaoeData, 模块实例)` |
135
+ | `update:submoduleName` | 子模块切换时触发,配合 `:submoduleName.sync` 使用 | 当前子模块名称(`'Table'` / `'Form'`) |
@@ -4,9 +4,9 @@
4
4
  </div>
5
5
  </template>
6
6
  <script lang="ts">
7
- import Vue from 'vue';
8
- import { Component } from 'vue-property-decorator';
9
- import BusinessCard from '../index.vue';
7
+ import Vue from 'vue'
8
+ import { Component } from 'vue-property-decorator'
9
+ import BusinessCard from '../index.vue'
10
10
 
11
11
  @Component({
12
12
  components: {
@@ -20,20 +20,20 @@ export default class BusinessCardDemo extends Vue {
20
20
  rank: '代理人代理人',
21
21
  rankIcon: '//media.winbaoxian.com/autoUpload/activity/diamond_362dcf9f4453ded.png',
22
22
  mobile: '13023690000'
23
- };
23
+ }
24
24
  buttonData = {
25
25
  tx: '编辑名片11'
26
26
  // bg: '#0dd',
27
27
  // color: '#d0d'
28
- };
28
+ }
29
29
 
30
30
  created() {}
31
31
 
32
32
  avatarHandler() {
33
- console.log('avatarHandler');
33
+ console.log('avatarHandler')
34
34
  }
35
35
  buttonHandler() {
36
- console.log('buttonHandler');
36
+ console.log('buttonHandler')
37
37
  }
38
38
  }
39
39
  </script>