t20-common-lib 0.9.10 → 0.9.12

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": "t20-common-lib",
3
- "version": "0.9.10",
3
+ "version": "0.9.12",
4
4
  "description": "T20",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -36,9 +36,9 @@
36
36
  -->
37
37
  <div class="content-item-val" @click="$emit('click', conItem)">
38
38
  <template v-if="hasAmountAndCount(conItem)">
39
- {{ formatAmount(conItem, 'value') }}<span class="content-item-unit">{{ formatAmount(conItem, 'unit') }}</span>
40
- <span class="divider-inline"> / </span>
41
39
  <span class="count-val">{{ conItem.count }}<span class="content-item-unit">{{ conItem.countUnit || conItem.unit || '笔' }}</span></span>
40
+ <span class="divider-inline"></span>
41
+ {{ formatAmount(conItem, 'value') }}<span class="content-item-unit">{{ formatAmount(conItem, 'unit') }}</span>
42
42
  </template>
43
43
  <template v-else-if="conItem.amountFormat">
44
44
  {{ formatAmount(conItem, 'value') }}<span class="content-item-unit">{{ formatAmount(conItem, 'unit') }}</span>
@@ -148,6 +148,11 @@ export default {
148
148
  formatAmount(item, type = 'value') {
149
149
  const amount = item.amount !== undefined && item.amount !== null ? item.amount : item.value;
150
150
  // 通过 this.$options.filters 调用组件内定义的过滤器
151
+ // 如果是请求单位并且调用方显式传了 unit 且标记了 amountFormat,优先返回该 unit(恢复原先逻辑)
152
+ if (type === 'unit' && item && item.amountFormat && item.unit) {
153
+ return item.unit;
154
+ }
155
+
151
156
  if (this.$options && this.$options.filters && typeof this.$options.filters.cardFormatAmount === 'function') {
152
157
  try {
153
158
  return this.$options.filters.cardFormatAmount(amount, type);
@@ -222,8 +227,7 @@ export default {
222
227
  }
223
228
 
224
229
  .count-val {
225
- font-size: 14px;
226
- vertical-align: middle;
230
+ font-size: 20px;
227
231
  }
228
232
 
229
233
  &-unit {