gcs-ui-lib 1.2.16 → 1.2.18

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": "gcs-ui-lib",
3
- "version": "1.2.16",
3
+ "version": "1.2.18",
4
4
  "private": false,
5
5
  "main": "./lib/gcs-ui-lib.common.js",
6
6
  "scripts": {
@@ -32,6 +32,7 @@
32
32
  "element-ui": "^2.15.5",
33
33
  "axios": "^0.21.4",
34
34
  "vxe-table": "3.6.17",
35
+ "decimal.js": "^10.6.0",
35
36
  "vxe-utils": "2.0.1"
36
37
  },
37
38
  "peerDependencies": {},
@@ -0,0 +1,7 @@
1
+ import NstcLazyBank from './src/main'
2
+
3
+ NstcLazyBank.install = function(Vue) {
4
+ Vue.component(NstcLazyBank.name, NstcLazyBank)
5
+ }
6
+
7
+ export default NstcLazyBank
@@ -0,0 +1,23 @@
1
+ <template>
2
+ <div>
3
+ <NstcLazyBank v-model="bankNo"/>
4
+ </div>
5
+ </template>
6
+ <script>
7
+ import NstcLazyBank from "../main.vue";
8
+
9
+ export default {
10
+ name: 'LazyBankDemo',
11
+ components: {
12
+ NstcLazyBank
13
+ },
14
+ data() {
15
+ return {
16
+ bankNo: 'B1639'
17
+ }
18
+ }
19
+ }
20
+ </script>
21
+ <style scoped lang="scss">
22
+
23
+ </style>
@@ -0,0 +1,111 @@
1
+ <template>
2
+ <SelectLazy
3
+ v-model="bankNo"
4
+ :filter-method="filterFn"
5
+ @scroll-bottom="getNextList"
6
+ v-on="$listeners"
7
+ v-bind="$attrs"
8
+ :placeholder="$l('请选择')"
9
+ @change="handleChange"
10
+ >
11
+ <template v-loading="loading">
12
+ <el-option
13
+ v-for="item in bankList"
14
+ :key="item.bankNo"
15
+ :label="item['bankName']"
16
+ :value="item['bankNo']"
17
+ >
18
+ {{ item.bankName }}
19
+ </el-option>
20
+ </template>
21
+ </SelectLazy>
22
+ </template>
23
+ <script>
24
+ import {SelectLazy, axios, SelectLazy as CLSelectLazy} from "n20-common-lib";
25
+
26
+ export default {
27
+ name: "NstcLazyBank",
28
+ components: {
29
+ CLSelectLazy,
30
+ SelectLazy
31
+ },
32
+ props: {
33
+ value: {
34
+ type: [String, Array],
35
+ default: "",
36
+ },
37
+ moreParams: {
38
+ type: Object,
39
+ default: () => ({})
40
+ }
41
+ },
42
+ computed: {
43
+ bankNo: {
44
+ get() {
45
+ return this.value;
46
+ },
47
+ set(val) {
48
+ this.$emit("input", val);
49
+ },
50
+ }
51
+ },
52
+ data() {
53
+ return {
54
+ loading: false,
55
+ searchKey: '',
56
+ page: {
57
+ current: 1,
58
+ size: 20
59
+ },
60
+ bankList: [],
61
+ total: 100
62
+ }
63
+ },
64
+ mounted() {
65
+ this.getBanks(this.value)
66
+ },
67
+ methods: {
68
+ filterFn(val) {
69
+ this.page.current = 1;
70
+ this.searchKey = val;
71
+ this.getBanks()
72
+ },
73
+ async getNextList() {
74
+ if (this.total > this.bankList.length) {
75
+ this.page.current += 1;
76
+ this.getBanks();
77
+ }
78
+ },
79
+ getBanks(originKey = '') {
80
+ const params = {
81
+ 'page.current': this.page.current,
82
+ 'page.size': this.page.size,
83
+ searchKey: originKey || this.searchKey,
84
+ isEnable: 1,
85
+ ...this.moreParams
86
+ }
87
+ this.loading = true
88
+ axios.get('/api/nstc-mdm/1.0/bank', params, {loading: false}).then(res => {
89
+ if (this.page.current === 1) {
90
+ this.bankList = res.data || []
91
+ } else {
92
+ this.bankList = this.bankList.concat(res.data);
93
+ }
94
+ this.total = res.total;
95
+ }).catch(err => {
96
+ console.error(err)
97
+ }).finally(() => {
98
+ this.loading = false
99
+ })
100
+ },
101
+ handleChange(e) {
102
+ const bank = this.bankList.find(item => item.bankNo === e);
103
+ if (bank) {
104
+ this.$emit("change", bank);
105
+ } else {
106
+ this.$emit("clear");
107
+ }
108
+ }
109
+ }
110
+ }
111
+ </script>
@@ -5,7 +5,9 @@
5
5
  </div>
6
6
  </template>
7
7
  <script>
8
- import {StatisPopover, N} from 'n20-common-lib'
8
+ import {StatisPopover} from 'n20-common-lib'
9
+ import Decimal from 'decimal.js';
10
+ import {amountFormat} from "../../../src/utils/utils";
9
11
 
10
12
  export default {
11
13
  name: 'MultiCurrencyStatistics',
@@ -113,7 +115,12 @@ export default {
113
115
  //笔|条 数
114
116
  return coins.length
115
117
  }
116
- return coins.reduce((amount, item) => N.add(amount,item[c.key],2), 0)
118
+
119
+ return coins.reduce((amount, item) => {
120
+ const o1 = new Decimal(`${amount || 0}`)
121
+ const o2 = new Decimal(`${item[c.key] || 0}`)
122
+ return amountFormat(o1.plus(o2))
123
+ }, 0)
117
124
  })()
118
125
  }))
119
126
  }
package/src/index.js CHANGED
@@ -34,6 +34,7 @@ import NstcMergeAutoFillDetail from "../packages/MergeAutoFill/merge/mergeFillDe
34
34
  import NstcMergeAutoFillService from "../packages/MergeAutoFill/merge/merageFillService.vue";
35
35
  import NstcMergeAutoFillRuleHistory from "../packages/MergeAutoFill/merge/ExtendMergeHistory.vue";
36
36
  import NstcIntegerNumber from "../packages/IntegerInput/src/main.vue";
37
+ import NstcLazyBank from "../packages/LazyBank/src/main.vue";
37
38
 
38
39
  import "n20-common-lib/style/index.css";
39
40
  import i18n, {$l} from 'n20-common-lib/src/utils/i18n'
@@ -80,6 +81,7 @@ const components = [
80
81
  NstcMultiCurrencyStatistics,
81
82
  BankInstitutionDropdown,
82
83
  RiskEventTable,
84
+ NstcLazyBank,
83
85
  ...dynamicComponents, // 添加自动发现的组件
84
86
  ];
85
87
 
@@ -155,7 +157,8 @@ export {
155
157
  NstcConfigurableForm,
156
158
  NstcValidateQuota,
157
159
  NstcMultiCurrencyStatistics,
158
- BankInstitutionDropdown
160
+ BankInstitutionDropdown,
161
+ NstcLazyBank
159
162
  };
160
163
  export default {
161
164
  version: "1.0.0",
@@ -185,5 +188,6 @@ export default {
185
188
  NstcConfigurableForm,
186
189
  NstcValidateQuota,
187
190
  NstcMultiCurrencyStatistics,
188
- BankInstitutionDropdown
191
+ BankInstitutionDropdown,
192
+ NstcLazyBank
189
193
  };
@@ -68,6 +68,11 @@ export const routes = [{
68
68
  name: '银行',
69
69
  component: () => import('^/Bank/src/demo/index.vue')
70
70
  },
71
+ {
72
+ path: '/LazyBank',
73
+ name: '银行懒加载',
74
+ component: () => import('^/LazyBank/src/demo/index.vue')
75
+ },
71
76
  {
72
77
  path: '/BranchBank',
73
78
  name: '支行',