bxs-tools-ui 1.2.0 → 1.2.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.
@@ -1,19 +1,25 @@
1
1
  <template>
2
2
  <div class="bxt-item-age-birthday" @click="openPicker()">
3
- <span
4
- class="bxt-item-button bxt-item-button__birthday"
5
- :data-stat-id="`${personData.key}_birthday`"
6
- @click.stop="openPicker('birthday')"
7
- >
8
- <em :class="[birthdayData.value ? '' : 'disabled']">{{
9
- birthdayData.value ? birthdayData.value : '生日(选填)'
10
- }}</em>
11
- <i class="iconfont icon-arrow_down"></i>
12
- </span>
13
- <span class="bxt-item-button bxt-item-button__age">
14
- <em :class="[valueDesc ? '' : 'disabled']">{{ valueDesc || eleData.placeholder }}</em>
15
- <i class="iconfont icon-arrow_down"></i>
16
- </span>
3
+ <p class="bxt-item-age-birthday-wrapper">
4
+ <span
5
+ class="bxt-item__birthday"
6
+ :data-stat-id="`${personData.key}_birthday`"
7
+ @click.stop="openPicker('birthday')"
8
+ >
9
+ <em v-if="birthdayData.value">
10
+ {{ birthdayData.value }}
11
+ </em>
12
+ <em v-else>
13
+ <i>生日</i>
14
+ <i>(选填)</i>
15
+ </em>
16
+ </span>
17
+ <span class="bxt-item__age">
18
+ <em :class="[valueDesc ? '' : 'disabled']">
19
+ {{ valueDesc || eleData.placeholder }}
20
+ </em>
21
+ </span>
22
+ </p>
17
23
  </div>
18
24
  </template>
19
25
  <script lang="ts">
@@ -119,38 +125,61 @@ export default class BxtAgeBirthdayItem extends Vue {
119
125
  }
120
126
  </script>
121
127
  <style lang="postcss">
122
- @import 'base.css';
128
+ @import 'color.css';
123
129
 
124
130
  .bxt-item-age-birthday {
125
- & .bxt-item-button {
131
+ & .bxt-item-age-birthday-wrapper {
126
132
  position: relative;
127
133
  display: inline-block;
128
- min-width: 60px;
129
- height: 25px;
134
+ height: 27px;
130
135
  line-height: 25px;
131
- padding: 0 24px 0 9px;
132
136
  text-align: center;
133
137
  border: 1px solid var(--color-text-disabled);
134
138
  border-radius: 100px;
135
139
  font-size: 13px;
136
140
  box-sizing: border-box;
137
141
 
138
- &.bxt-item-button__age {
139
- margin-left: 10px;
140
- }
142
+ & .bxt-item__birthday,
143
+ & .bxt-item__age {
144
+ position: relative;
145
+ display: inline-block;
146
+ width: 100px;
147
+ text-align: center;
148
+ font-size: 13px;
149
+ box-sizing: border-box;
150
+
151
+ & em {
152
+ & i {
153
+ font-style: normal;
154
+ }
141
155
 
142
- & em.disabled {
143
- color: var(--color-text-disabled);
156
+ & i:nth-child(2) {
157
+ margin-left: 5px;
158
+ font-size: 12px;
159
+ color: var(--color-text-disabled);
160
+ transform: scale(0.8334);
161
+ }
162
+ }
163
+
164
+ & em.disabled {
165
+ color: var(--color-text-disabled);
166
+ }
144
167
  }
145
168
 
146
- & i {
147
- position: absolute;
148
- top: 50%;
149
- right: 9px;
150
- transform: translateY(-50%) scale(0.8);
151
- font-size: 12px;
152
- color: inherit;
169
+ & .bxt-item__age {
170
+ width: 80px;
153
171
  }
154
172
  }
173
+
174
+ & .bxt-item-age-birthday-wrapper::after {
175
+ position: absolute;
176
+ left: 100px;
177
+ top: 50%;
178
+ transform: translateY(-50%);
179
+ width: 1px;
180
+ height: 60%;
181
+ content: ' ';
182
+ border-left: 1px solid var(--color-text-disabled);
183
+ }
155
184
  }
156
185
  </style>
@@ -92,12 +92,16 @@ export default class BxtSelectItem extends Vue {
92
92
  }
93
93
  </script>
94
94
  <style lang="postcss">
95
+ @import 'color.css';
96
+
95
97
  .bxt-item-select {
96
98
  & .bx-input {
97
99
  & .bx-input-value {
98
100
  & .bx-input-body {
99
101
  & .bx-input-control {
100
102
  text-align: right;
103
+ color: var(--color-text-primary) !important;
104
+ -webkit-text-fill-color: var(--color-text-primary) !important;
101
105
  }
102
106
  }
103
107
  }
@@ -23,7 +23,7 @@
23
23
  width: 18rem;
24
24
  padding: 15px 0;
25
25
  line-height: normal;
26
- font-size: 15px;
26
+ font-size: 17px;
27
27
  font-weight: bold;
28
28
  vertical-align: middle;
29
29
 
@@ -32,11 +32,14 @@
32
32
  }
33
33
 
34
34
  & .bxt-title-code {
35
- margin-right: 10px;
36
- padding: 1px 4px;
35
+ margin-right: 5px;
36
+ padding: 0 2px;
37
37
  border-radius: 0.25rem;
38
38
  color: #ff703e;
39
39
  border: 1px solid #ff703e;
40
+ font-size: 12px;
41
+ transform: scale(0.8334);
42
+ transform-origin: left center;
40
43
  }
41
44
 
42
45
  & .bxt-titile-content--disabled {
@@ -35,6 +35,17 @@
35
35
  & input {
36
36
  text-align: right;
37
37
  }
38
+
39
+ & .bx-input-icon {
40
+ & .bx-icon,
41
+ & .icon-edit2 {
42
+ color: var(--color-text-minor) !important;
43
+ }
44
+ }
45
+
46
+ & .bxt-titile-content {
47
+ font-size: 15px;
48
+ }
38
49
  }
39
50
  }
40
51
 
@@ -77,7 +88,9 @@
77
88
  border-radius: 4px;
78
89
  color: #ff703e;
79
90
  border: 1px solid #ff703e;
80
- font-size: 14px;
91
+ font-size: 12px;
92
+ transform: scale(0.8334);
93
+ transform-origin: left center;
81
94
  vertical-align: middle;
82
95
  }
83
96
 
@@ -103,6 +116,43 @@
103
116
  }
104
117
  }
105
118
  }
119
+
120
+ & .bxt-ins-unit-tips {
121
+ display: inline-block;
122
+ position: absolute;
123
+ top: 60%;
124
+ right: 55px;
125
+ margin-top: 11px;
126
+ line-height: normal;
127
+
128
+ & em {
129
+ position: absolute;
130
+ top: -3px;
131
+ left: 50%;
132
+ display: inline-block;
133
+ width: 6px;
134
+ height: 6px;
135
+ background: #666;
136
+ transform: translateX(-50%) rotate(45deg);
137
+ content: ' ';
138
+ }
139
+
140
+ & span {
141
+ position: relative;
142
+ display: inline-block;
143
+ padding: 1px 12px;
144
+ line-height: normal;
145
+ background: #666;
146
+ color: #fff;
147
+ font-size: 12px;
148
+ border-radius: 4px;
149
+ }
150
+ }
151
+ }
152
+
153
+ & .bx-form-item__unit {
154
+ position: relative;
155
+ z-index: 1;
106
156
  }
107
157
 
108
158
  & .bxt-form-item-label-note {
@@ -31,6 +31,9 @@
31
31
  <template v-if="['cmCommonInput'].includes(ele.componentName)">
32
32
  <bxs-form-item
33
33
  v-show="isInsuranceChecked(ins) && !ele.isHide"
34
+ :class="{
35
+ 'bx-form-item__unit': activeInputKey === ins.key + ele.key && numberUnitStr
36
+ }"
34
37
  :key="ins.key + ele.key"
35
38
  :prop="ele.key"
36
39
  :label="ele.labelName"
@@ -42,6 +45,7 @@
42
45
  autosize
43
46
  type="text"
44
47
  border
48
+ autocomplete="off"
45
49
  :placeholder="ele.placeholder"
46
50
  v-model.number="ele.value"
47
51
  :disabled="!!ele.isDisabled"
@@ -51,9 +55,21 @@
51
55
  prefix: 'icon',
52
56
  name: 'edit2 iconfont'
53
57
  }"
58
+ @focus="
59
+ activeInputKey = ins.key + ele.key;
60
+ numberUnitStr = getAmountUnit(ele);
61
+ "
62
+ @blur="activeInputKey = ''"
63
+ @input="numberUnitStr = getAmountUnit(ele)"
54
64
  @change="change({ insData: ins, eleData: ele, type: 'change' })"
55
65
  @click-icon="onClickIcon(`id_${ins.key}_${ele.key}`)"
56
66
  />
67
+ <div v-if="activeInputKey === ins.key + ele.key && numberUnitStr" class="bxt-ins-unit-tips">
68
+ <em />
69
+ <span>
70
+ {{ numberUnitStr }}
71
+ </span>
72
+ </div>
57
73
  </bxs-form-item>
58
74
  </template>
59
75
  <template v-if="['cmCommonRadioBtn'].includes(ele.componentName)">
@@ -142,7 +158,7 @@
142
158
  :title="ele.label"
143
159
  :options="ele.opts.filter(o => !o.isHide && !o.isDisabled && !o.isInvalid)"
144
160
  :disabled="isDisabled(ele)"
145
- right-icon="arrow-right"
161
+ :right-icon="isDisabled(ele) ? '' : 'arrow-right'"
146
162
  @change="change({ insData: ins, eleData: ele, type: 'change' })"
147
163
  />
148
164
  </bxs-form-item>
@@ -178,6 +194,9 @@ import 'bxs-ui-vue/esm/index.css';
178
194
  }
179
195
  })
180
196
  export default class BxtProductInfo extends Vue {
197
+ activeInputKey = '';
198
+ numberUnitStr = '';
199
+
181
200
  @Prop({
182
201
  default: () => ({})
183
202
  })
@@ -344,6 +363,23 @@ export default class BxtProductInfo extends Vue {
344
363
  }
345
364
  return '当前投保人不能加该险种,<em>修改</em>投保人信息后选择';
346
365
  }
366
+ getAmountUnit(ele) {
367
+ let digits = isNaN(ele.value * 1) ? 0 : Math.floor(Math.log10(ele.value) + 1);
368
+ switch (digits) {
369
+ case 5:
370
+ return '万';
371
+ case 6:
372
+ return '十万';
373
+ case 7:
374
+ return '百万';
375
+ case 8:
376
+ return '千万';
377
+ case 9:
378
+ return '亿';
379
+ default:
380
+ return '';
381
+ }
382
+ }
347
383
  async validate() {
348
384
  let insKeys: any = this.filterInsuranceList.map(ins => ins.key);
349
385
  let validateInfo: any = [];