t20-common-lib 0.10.5 → 0.10.7

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.10.5",
3
+ "version": "0.10.7",
4
4
  "description": "T20",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -97,21 +97,23 @@ export default {
97
97
  const coins = selectedList.filter(item => {
98
98
  return item.currencyName === statistic.title
99
99
  })
100
-
100
+
101
+ const statisChildList = this.config.filter(c => !c.currencyType || c.currencyType === 'origin')
101
102
  if (coins.length) {
102
103
  const statis = [
103
104
  {
104
105
  type: this.$l('已选合计'), //已选合计
105
- list: this.config.map(c => ({
106
- label: c.label,
107
- value: (() => {
108
- if (c.label === this.$l('笔数')) {
109
- //笔|条
110
- return coins.length
111
- }
112
- return coins.reduce((amount, item) => amount + item[c.key], 0)
113
- })()
114
- }))
106
+ list: statisChildList.map(c => {
107
+ return {
108
+ label: c.label,
109
+ value: (() => {
110
+ if (c.label === this.$l('笔数')) {
111
+ //笔|条
112
+ return coins.length
113
+ }
114
+ return coins.reduce((amount, item) => amount + item[c.key], 0)
115
+ })()
116
+ }})
115
117
  }
116
118
  ]
117
119
  this.selectStatistics.push({...statistic, statis})
@@ -165,19 +167,24 @@ export default {
165
167
  const allStatistics = []
166
168
  const selectedStatistics = []
167
169
  let defaultCurrencyName = this.$l('人民币')
170
+ let defaultCurrencyNo = 'CNY'
168
171
  if (this.$store && this.$store.state && this.$store.state.user && this.$store.state.user.defaultCurrencyName) {
169
172
  defaultCurrencyName = this.$store.state.user.defaultCurrencyName
173
+ defaultCurrencyNo = this.$store.state.user.defaultCurrencyNo
170
174
  }
171
175
  this.views.forEach(item => {
176
+ const statisChildList = item.currencyNo !== defaultCurrencyNo ? this.config : this.config.filter(c => !c.currencyType || c.currencyType === 'origin')
172
177
  allStatistics.push({
173
178
  title: item.currencyName,
174
179
  currencyNo: item.currencyNo,
175
180
  statis: [
176
181
  {
177
182
  type: this.$l('全部合计'), //全部合计
178
- list: this.config.map((c, i) => {
183
+ list: statisChildList.map(c => {
179
184
  let label = c.label
180
- if (i !== 0) {
185
+ if (item.currencyNo === defaultCurrencyNo) {
186
+ label = c.label + this.$l('(原币)')
187
+ } else if (c.key) {
181
188
  label = c.currencyType === 'origin' ? `${c.label}(${this.$l('原币')})` : `${c.label}(${this.$l('折')}${this.$l(defaultCurrencyName)})`
182
189
  }
183
190
  return {
@@ -194,7 +201,7 @@ export default {
194
201
  statis: [
195
202
  {
196
203
  type: this.$l('已选合计'), //已选合计
197
- list: this.config.map(c => ({label: c.label, value: 0}))
204
+ list: (this.config.filter(c => !c.currencyType || c.currencyType === 'origin')).map(c => ({label: c.label, value: 0}))
198
205
  }
199
206
  ]
200
207
  })