gcs-ui-lib 1.2.18 → 1.2.20

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.18",
3
+ "version": "1.2.20",
4
4
  "private": false,
5
5
  "main": "./lib/gcs-ui-lib.common.js",
6
6
  "scripts": {
@@ -1,6 +1,20 @@
1
1
  <template>
2
2
  <div>
3
- <NstcLazyBank v-model="bankNo"/>
3
+ <h2>单选 回显值</h2>
4
+ <NstcLazyBank key="1" v-model="bankNo"/>
5
+ <br />
6
+ <h2>单选 没有回显值</h2>
7
+ <NstcLazyBank key="2" v-model="bankNo2"/>
8
+ <br />
9
+ <h2>多选 回显值</h2>
10
+ <NstcLazyBank key="3" multiple v-model="bankNos"/>
11
+ <!-- {{bankNos}}-->
12
+ <br />
13
+ <h2>多选 没有回显值</h2>
14
+ <NstcLazyBank key="4" multiple v-model="bankNos2"/>
15
+ <br />
16
+ <h2>其他参数</h2>
17
+ <NstcLazyBank key="5" multiple v-model="bankNos3" :more-params="{organizationType: 1,isEnable: 1,}"/>
4
18
  </div>
5
19
  </template>
6
20
  <script>
@@ -13,7 +27,11 @@ export default {
13
27
  },
14
28
  data() {
15
29
  return {
16
- bankNo: 'B1639'
30
+ bankNo: '00',
31
+ bankNo2: undefined,
32
+ bankNos: ['00', 'P1', '02', '166'],
33
+ bankNos2: [],
34
+ bankNos3: []
17
35
  }
18
36
  }
19
37
  }
@@ -5,6 +5,9 @@
5
5
  @scroll-bottom="getNextList"
6
6
  v-on="$listeners"
7
7
  v-bind="$attrs"
8
+ collapse-tags
9
+ clearable
10
+ filterable
8
11
  :placeholder="$l('请选择')"
9
12
  @change="handleChange"
10
13
  >
@@ -21,7 +24,9 @@
21
24
  </SelectLazy>
22
25
  </template>
23
26
  <script>
24
- import {SelectLazy, axios, SelectLazy as CLSelectLazy} from "n20-common-lib";
27
+ import { getBankData } from "@/api/common.js";
28
+ import {SelectLazy, SelectLazy as CLSelectLazy} from "n20-common-lib";
29
+ import {delistToSame} from "../../../src/utils/index";
25
30
 
26
31
  export default {
27
32
  name: "NstcLazyBank",
@@ -36,7 +41,9 @@ export default {
36
41
  },
37
42
  moreParams: {
38
43
  type: Object,
39
- default: () => ({})
44
+ default: () => ({
45
+ isEnable: 1,
46
+ })
40
47
  }
41
48
  },
42
49
  computed: {
@@ -61,8 +68,11 @@ export default {
61
68
  total: 100
62
69
  }
63
70
  },
64
- mounted() {
65
- this.getBanks(this.value)
71
+ async mounted() {
72
+ if (this.value){
73
+ await this.getBanks(this.value)
74
+ }
75
+ await this.getBanks()
66
76
  },
67
77
  methods: {
68
78
  filterFn(val) {
@@ -77,20 +87,23 @@ export default {
77
87
  }
78
88
  },
79
89
  getBanks(originKey = '') {
90
+ const isArray = Array.isArray(originKey);
80
91
  const params = {
81
92
  'page.current': this.page.current,
82
93
  'page.size': this.page.size,
83
- searchKey: originKey || this.searchKey,
94
+ [isArray ? 'bankNoList': 'searchKey']: isArray ? originKey.join(','): originKey || this.searchKey,
84
95
  isEnable: 1,
85
- ...this.moreParams
96
+ ...this.moreParams,
86
97
  }
87
98
  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 || []
99
+ getBankData(params, false).then(res => {
100
+ console.log(res)
101
+ if (this.page.current === 1 && !originKey) {
102
+ this.bankList = res.list || []
91
103
  } else {
92
- this.bankList = this.bankList.concat(res.data);
104
+ this.bankList = this.bankList.concat(res.list);
93
105
  }
106
+ this.bankList = delistToSame(this.bankList, 'bankNo');
94
107
  this.total = res.total;
95
108
  }).catch(err => {
96
109
  console.error(err)