gcs-ui-lib 1.2.15 → 1.2.17

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.15",
3
+ "version": "1.2.17",
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}`)
121
+ const o2 = new Decimal(`${item[c.key]}`)
122
+ return amountFormat(o1.plus(o2))
123
+ }, 0)
117
124
  })()
118
125
  }))
119
126
  }
@@ -573,7 +573,7 @@ export default {
573
573
  });
574
574
  },
575
575
  setChange(list) {
576
- const index = list.findIndex((res) => res.isNew && !res.children);
576
+ const index = list.findIndex((res) => !res.children);
577
577
  if (index !== -1) return this.$message.warning(`新增字段必须包含子级!`);
578
578
  let dto = {
579
579
  approvalType: "6",
@@ -736,7 +736,7 @@ export default {
736
736
  ...this.pageObj,
737
737
  // conditions,
738
738
  typeCodes: this.appNo === 'CTMS'
739
- ? (this.searchObj.typeCodes?.length ? this.searchObj.typeCodes : specialCodes)
739
+ ? (this.searchObj.typeCodes.length ? this.searchObj.typeCodes : specialCodes)
740
740
  : this.searchObj.typeCodes,
741
741
  };
742
742
  delete params.states;
@@ -1,69 +1,84 @@
1
- import { axios } from 'n20-common-lib'
1
+ import { axios } from "n20-common-lib";
2
2
 
3
3
  export default {
4
4
  data() {
5
5
  return {
6
- eyeView: false
7
- }
6
+ eyeView: false,
7
+ };
8
8
  },
9
9
  methods: {
10
10
  // 排序
11
- sortMethod({ data, column, property, order }) {
11
+ sortMethod({ data, sortList }) {
12
+ //兼容预算的高版本
13
+ if (!sortList || sortList.length === 0) return;
14
+ let { field, order } = sortList[0];
12
15
  data.sort((a, b) => {
13
16
  // 处理字段为空的情况,确保空值始终排在最后
14
- const aValue = a[property]
15
- const bValue = b[property]
17
+ const aValue = a[field];
18
+ const bValue = b[field];
16
19
 
17
20
  // 统一比较逻辑
18
21
  const compare = (v1, v2) => {
19
- if (typeof v1 === 'string' && typeof v2 === 'string') {
20
- return v1.localeCompare(v2)
22
+ if (typeof v1 === "string" && typeof v2 === "string") {
23
+ return v1.localeCompare(v2);
21
24
  } else {
22
- return v1 - v2
25
+ return v1 - v2;
23
26
  }
24
- }
27
+ };
25
28
  // 处理空值,确保空值始终排在最后
26
- if (aValue === 0 || aValue === null) return order === 'asc' ? 1 : -1
27
- if (bValue === 0 || bValue === null) return order === 'asc' ? -1 : 1
29
+ if (aValue === 0 || aValue === null) return order === "asc" ? 1 : -1;
30
+ if (bValue === 0 || bValue === null) return order === "asc" ? -1 : 1;
28
31
  // 根据排序顺序返回结果
29
- return order === 'desc' ? compare(bValue, aValue) : compare(aValue, bValue)
30
- })
32
+ return order === "desc"
33
+ ? compare(bValue, aValue)
34
+ : compare(aValue, bValue);
35
+ });
31
36
  },
32
37
  getDynamicColumn(typeCode = undefined, approvalType) {
33
- axios.get(`/bems/activiti/actNsSortColumn/querySortColumn/${typeCode}/${approvalType}`).then(({ data }) => {
34
- this.checkColumns =
35
- data && data.sortColumn && data.sortColumn.length > 0 ? JSON.parse(data.sortColumn) : this.originColumn
36
- })
38
+ axios
39
+ .get(
40
+ `/bems/activiti/actNsSortColumn/querySortColumn/${typeCode}/${approvalType}`
41
+ )
42
+ .then(({ data }) => {
43
+ this.checkColumns =
44
+ data && data.sortColumn && data.sortColumn.length > 0
45
+ ? JSON.parse(data.sortColumn)
46
+ : this.originColumn;
47
+ });
37
48
  },
38
49
  saveDynamicColumn(data) {
39
50
  axios.post(`/bems/activiti/actNsSortColumn/saveOrUpDateColumn`, data, {
40
- noMsg: true
41
- })
42
- this.dialogVisible = false
51
+ noMsg: true,
52
+ });
53
+ this.dialogVisible = false;
43
54
  },
44
55
  /**
45
56
  * 查看业务状态
46
57
  */
47
58
  async seeBussStatus() {
48
59
  if (!this.eyeView) {
49
- this.eyeView = true
50
- let dto = (this.tableDate||[]).map((res) => {
60
+ this.eyeView = true;
61
+ let dto = (this.tableDate || []).map((res) => {
51
62
  return {
52
63
  businessId: res.businessId,
53
- typeCode: res.typeCode
54
- }
55
- })
64
+ typeCode: res.typeCode,
65
+ };
66
+ });
56
67
  let dtos = {
57
- dtos: dto
58
- }
59
- const { data, code } = await this.$axios.post(`/api/settlement-order/api/position/order/work/flow`, dtos)
68
+ dtos: dto,
69
+ };
70
+ const { data, code } = await this.$axios.post(
71
+ `/api/settlement-order/api/position/order/work/flow`,
72
+ dtos
73
+ );
60
74
  if (code === 200) {
61
- this.tableDate = (this.tableDate||[]).map((res) => {
62
- res[`${res.businessId}${res.typeCode}`] = data[`${res.businessId}${res.typeCode}`]
63
- return res
64
- })
75
+ this.tableDate = (this.tableDate || []).map((res) => {
76
+ res[`${res.businessId}${res.typeCode}`] =
77
+ data[`${res.businessId}${res.typeCode}`];
78
+ return res;
79
+ });
65
80
  }
66
81
  }
67
- }
68
- }
69
- }
82
+ },
83
+ },
84
+ };
package/src/App.vue CHANGED
@@ -7,7 +7,7 @@
7
7
  <el-container>
8
8
  <el-header>组件演示</el-header>
9
9
  <el-main>
10
- <router-view />
10
+ <router-view style="height: calc(100% - 60px);"/>
11
11
  </el-main>
12
12
  </el-container>
13
13
  </el-container>
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: '支行',