t20-common-lib 0.9.14 → 0.10.0

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.
Files changed (41) hide show
  1. package/package.json +64 -86
  2. package/packages/branch-bank-select/index.js +8 -8
  3. package/packages/branch-bank-select/src/main.vue +179 -179
  4. package/packages/common-collapse/index.js +8 -8
  5. package/packages/common-collapse/src/main.vue +147 -147
  6. package/packages/form-page/index.js +8 -8
  7. package/packages/form-page/src/main.vue +55 -55
  8. package/packages/input-number/index.js +8 -0
  9. package/packages/input-number/src/main.vue +184 -0
  10. package/packages/main-page/index.js +8 -8
  11. package/packages/main-page/src/main.vue +43 -43
  12. package/packages/multi-currency-statistics/index.js +8 -8
  13. package/packages/multi-currency-statistics/src/main.vue +229 -229
  14. package/packages/page-header/index.js +8 -8
  15. package/packages/page-header/src/main.vue +95 -95
  16. package/packages/statis-card/index.js +8 -8
  17. package/packages/statis-card/src/main.vue +250 -250
  18. package/packages/tab-page/index.js +8 -8
  19. package/packages/tab-page/src/main.vue +101 -101
  20. package/packages/tab-pane/index.js +8 -8
  21. package/packages/tab-pane/src/main.vue +185 -185
  22. package/packages/table-page/index.js +8 -8
  23. package/packages/table-page/src/main.vue +42 -42
  24. package/packages/theme-chalk/src/common/element-variables.scss +1045 -1045
  25. package/packages/theme-chalk/src/common/normalize.scss +869 -869
  26. package/packages/theme-chalk/src/index.scss +8 -8
  27. package/src/api/common.js +20 -20
  28. package/src/i18n.json +4 -4
  29. package/src/index.js +75 -71
  30. package/src/store/index.js +25 -25
  31. package/src/store/modules/user.js +42 -42
  32. package/src/utils/asciiWidth.js +107 -107
  33. package/src/utils/common.js +12 -12
  34. package/src/utils/date.js +43 -43
  35. package/src/utils/exportFile.js +6 -6
  36. package/src/utils/i18n/cn2hk.json +1270 -1270
  37. package/src/utils/i18n/index.js +69 -69
  38. package/src/utils/repairElementUI.js +141 -141
  39. package/src/utils/tableCellUtils.js +54 -54
  40. package/src/utils/tableheaderFilterpanel.vue +257 -257
  41. package/style/index.css +25 -25
package/package.json CHANGED
@@ -1,86 +1,64 @@
1
- {
2
- "name": "t20-common-lib",
3
- "version": "0.9.14",
4
- "description": "T20",
5
- "private": false,
6
- "main": "dist/index.js",
7
- "module": "src/index.js",
8
- "style": "dist/styles/index.css",
9
- "files": [
10
- "src",
11
- "packages",
12
- "style"
13
- ],
14
- "scripts": {
15
- "serve": "vue-cli-service serve",
16
- "build": "vue-cli-service build",
17
- "lint": "vue-cli-service lint",
18
- "lib": "vue-cli-service build --target lib --name t20-common-lib --dest dist src/index.js",
19
- "docs:dev": "vuepress dev docs",
20
- "docs:build": "vuepress build docs",
21
- "prepublishOnly": "npm run lib && node ./scripts/record-version.js",
22
- "clean": "rimraf dist"
23
- },
24
- "keywords": [
25
- "vue",
26
- "element-ui",
27
- "t20-common-lib",
28
- "store"
29
- ],
30
- "author": "liuzongxi",
31
- "license": "MIT",
32
- "dependencies": {
33
- "core-js": "^2.6.12",
34
- "dayjs": "^1.11.18",
35
- "element-ui": "^2.15.13",
36
- "lodash-es": "^4.17.21",
37
- "normalize.css": "^8.0.1",
38
- "vue": "^2.6.14",
39
- "vue-server-renderer": "^2.6.14",
40
- "vuex": "^3.6.2"
41
- },
42
- "devDependencies": {
43
- "@babel/core": "^7.28.4",
44
- "@babel/preset-env": "^7.28.3",
45
- "@vue/babel-helper-vue-jsx-merge-props": "^1.4.0",
46
- "@vue/babel-preset-jsx": "^1.4.0",
47
- "@vue/cli-plugin-babel": "~4.5.19",
48
- "@vue/cli-plugin-eslint": "~4.5.19",
49
- "@vue/cli-service": "~4.5.19",
50
- "@vue/component-compiler-utils": "^3.3.0",
51
- "babel-eslint": "^10.1.0",
52
- "babel-loader": "^10.0.0",
53
- "babel-plugin-component": "^1.1.1",
54
- "browserify-fs": "^1.0.0",
55
- "cross-env": "^7.0.3",
56
- "eslint": "^6.7.2",
57
- "eslint-plugin-vue": "^6.2.2",
58
- "node-sass": "^4.14.1",
59
- "os-browserify": "^0.3.0",
60
- "path-browserify": "^1.0.1",
61
- "postcss-loader": "^3.0.0",
62
- "process": "^0.11.10",
63
- "rimraf": "^3.0.2",
64
- "sass-loader": "^8.0.2",
65
- "vue-template-compiler": "^2.6.14"
66
- },
67
- "eslintConfig": {
68
- "root": true,
69
- "env": {
70
- "node": true
71
- },
72
- "extends": [
73
- "plugin:vue/essential",
74
- "eslint:recommended"
75
- ],
76
- "parserOptions": {
77
- "parser": "babel-eslint"
78
- },
79
- "rules": {}
80
- },
81
- "browserslist": [
82
- "> 1%",
83
- "last 2 versions",
84
- "not dead"
85
- ]
86
- }
1
+ {
2
+ "name": "t20-common-lib",
3
+ "version": "0.10.0",
4
+ "description": "T20",
5
+ "private": false,
6
+ "main": "dist/index.js",
7
+ "module": "src/index.js",
8
+ "style": "dist/styles/index.css",
9
+ "files": [
10
+ "src",
11
+ "packages",
12
+ "style"
13
+ ],
14
+ "scripts": {
15
+ "prepublishOnly": "node ./scripts/record-version.js",
16
+ "clean": "rimraf dist"
17
+ },
18
+ "keywords": [
19
+ "t20-common-lib",
20
+ "store"
21
+ ],
22
+ "author": "liuzongxi",
23
+ "license": "MIT",
24
+ "dependencies": {
25
+ "core-js": "^2.6.12",
26
+ "dayjs": "^1.11.18",
27
+ "lodash-es": "^4.17.21",
28
+ "normalize.css": "^8.0.1"
29
+ },
30
+ "devDependencies": {
31
+ "@babel/core": "^7.28.4",
32
+ "@babel/preset-env": "^7.28.3",
33
+ "babel-eslint": "^10.1.0",
34
+ "babel-loader": "^10.0.0",
35
+ "browserify-fs": "^1.0.0",
36
+ "cross-env": "^7.0.3",
37
+ "eslint": "^6.7.2",
38
+ "os-browserify": "^0.3.0",
39
+ "path-browserify": "^1.0.1",
40
+ "postcss-loader": "^3.0.0",
41
+ "process": "^0.11.10",
42
+ "rimraf": "^3.0.2",
43
+ "sass": "^1.94.0",
44
+ "sass-loader": "^8.0.2"
45
+ },
46
+ "eslintConfig": {
47
+ "root": true,
48
+ "env": {
49
+ "node": true
50
+ },
51
+ "extends": [
52
+ "eslint:recommended"
53
+ ],
54
+ "parserOptions": {
55
+ "parser": "babel-eslint"
56
+ },
57
+ "rules": {}
58
+ },
59
+ "browserslist": [
60
+ "> 1%",
61
+ "last 2 versions",
62
+ "not dead"
63
+ ]
64
+ }
@@ -1,8 +1,8 @@
1
- import BranchBankSelect from './src/main';
2
-
3
- /* istanbul ignore next */
4
- BranchBankSelect.install = function(Vue) {
5
- Vue.component(BranchBankSelect.name, BranchBankSelect);
6
- };
7
-
8
- export default BranchBankSelect;
1
+ import BranchBankSelect from './src/main';
2
+
3
+ /* istanbul ignore next */
4
+ BranchBankSelect.install = function(Vue) {
5
+ Vue.component(BranchBankSelect.name, BranchBankSelect);
6
+ };
7
+
8
+ export default BranchBankSelect;
@@ -1,180 +1,180 @@
1
- <template>
2
- <el-select
3
- v-model="branchBankNo"
4
- v-select-lazy="lazyGet"
5
- :multiple="multiple"
6
- filterable
7
- clearable
8
- :filter-method="debouncedFilter"
9
- popper-class="branchBankSelect"
10
- @change="handleBranchChange"
11
- @focus="handleFocus"
12
- @clear="() => handleFilter('')"
13
- >
14
- <el-option
15
- v-for="item in branchBankList"
16
- :key="item.cnapsNo"
17
- :label="item.branchBankName"
18
- :value="item[valueKey]"
19
- >
20
- <slot name="option" :item="item">
21
- <div class="flex-column flex-c" style="height: 100%">
22
- <div style="line-height: 20px; font-weight: bold">
23
- {{ item.branchBankName }}
24
- </div>
25
- <div style="line-height: 20px">{{ item.cnapsNo }}</div>
26
- </div>
27
- </slot>
28
- </el-option>
29
- </el-select>
30
- </template>
31
-
32
- <script>
33
- import { debounce } from 'lodash-es';
34
-
35
- export default {
36
- name: "BranchBankSelect",
37
- directives: {
38
- 'select-lazy': {
39
- bind(el, binding) {
40
- const dropdown = el.querySelector('.el-select-dropdown__wrap');
41
- if (!dropdown) return;
42
-
43
- let maxMoveY = 0;
44
- dropdown.addEventListener('scroll', function () {
45
- if (this.scrollTop <= 20) {
46
- maxMoveY = 0;
47
- }
48
- if (this.scrollTop > maxMoveY + 60 && this.scrollTop + this.clientHeight > this.scrollHeight - 60) {
49
- maxMoveY = this.scrollTop;
50
- binding.value();
51
- }
52
- });
53
- }
54
- }
55
- },
56
- props: {
57
- value: {
58
- type: [String, Number, Array, Object],
59
- default: undefined
60
- },
61
- multiple: {
62
- type: Boolean,
63
- default: false,
64
- },
65
- bankCode: {
66
- type: [String, Number, Array],
67
- default: "",
68
- },
69
- valueKey: {
70
- type: String,
71
- default: "cnapsNo",
72
- },
73
- requestFn: {
74
- type: Function,
75
- required: true
76
- }
77
- },
78
- data() {
79
- return {
80
- branchBankNo: this.value,
81
- branchBankList: [],
82
- page: {
83
- current: 1,
84
- size: 20,
85
- key: "",
86
- hasMore: true,
87
- }
88
- };
89
- },
90
- watch: {
91
- value(newVal) {
92
- this.branchBankNo = newVal;
93
- },
94
- bankCode: {
95
- immediate: true,
96
- handler() {
97
- this.resetAndFetch();
98
- },
99
- },
100
- },
101
- created() {
102
- this.debouncedFilter = debounce(this.handleFilter, 300);
103
- },
104
- mounted() {
105
- this.fetchBranchData(true);
106
- },
107
- methods: {
108
- lazyGet() {
109
- if (this.page.hasMore) {
110
- this.page.current++;
111
- this.fetchBranchData();
112
- }
113
- },
114
- async fetchBranchData(isInitial = false) {
115
- if (!this.page.hasMore) return;
116
- if (typeof this.requestFn !== 'function') {
117
- console.error("requestFn prop must be a function.");
118
- return;
119
- }
120
-
121
- const params = {
122
- "page.size": this.page.size,
123
- "page.current": this.page.current,
124
- key: this.page.key,
125
- isDomestic: 1,
126
- };
127
-
128
- if (Array.isArray(this.bankCode) && this.bankCode.length > 0) {
129
- params.bankNoList = this.bankCode;
130
- } else if (this.bankCode) {
131
- params.bankNo = this.bankCode;
132
- }
133
-
134
- try {
135
- const { data = [] } = await this.requestFn(params);
136
- if (isInitial) {
137
- this.branchBankList = data;
138
- } else {
139
- this.branchBankList = this.branchBankList.concat(data);
140
- }
141
- this.page.hasMore = data.length === this.page.size;
142
- } catch (error) {
143
- console.error("Failed to fetch branch data:", error);
144
- }
145
- },
146
- handleFilter(val) {
147
- this.page.key = val;
148
- this.page.current = 1;
149
- this.page.hasMore = true;
150
- this.fetchBranchData(true);
151
- },
152
- resetAndFetch() {
153
- this.branchBankList = [];
154
- this.page.current = 1;
155
- this.page.key = "";
156
- this.page.hasMore = true;
157
- this.branchBankNo = this.multiple ? [] : "";
158
- this.fetchBranchData(true);
159
- },
160
- handleBranchChange(val) {
161
- this.$emit('input', val);
162
- this.$emit("canGetData", val);
163
- },
164
- handleFocus() {
165
- if (!this.page.key && this.branchBankList.length === 0) {
166
- this.handleFilter('');
167
- }
168
- }
169
- },
170
- };
171
- </script>
172
-
173
- <style lang="scss" scoped>
174
- .branchBankSelect {
175
- .el-select-dropdown__item {
176
- height: 52px !important;
177
- line-height: 52px !important;
178
- }
179
- }
1
+ <template>
2
+ <el-select
3
+ v-model="branchBankNo"
4
+ v-select-lazy="lazyGet"
5
+ :multiple="multiple"
6
+ filterable
7
+ clearable
8
+ :filter-method="debouncedFilter"
9
+ popper-class="branchBankSelect"
10
+ @change="handleBranchChange"
11
+ @focus="handleFocus"
12
+ @clear="() => handleFilter('')"
13
+ >
14
+ <el-option
15
+ v-for="item in branchBankList"
16
+ :key="item.cnapsNo"
17
+ :label="item.branchBankName"
18
+ :value="item[valueKey]"
19
+ >
20
+ <slot name="option" :item="item">
21
+ <div class="flex-column flex-c" style="height: 100%">
22
+ <div style="line-height: 20px; font-weight: bold">
23
+ {{ item.branchBankName }}
24
+ </div>
25
+ <div style="line-height: 20px">{{ item.cnapsNo }}</div>
26
+ </div>
27
+ </slot>
28
+ </el-option>
29
+ </el-select>
30
+ </template>
31
+
32
+ <script>
33
+ import { debounce } from 'lodash-es';
34
+
35
+ export default {
36
+ name: "BranchBankSelect",
37
+ directives: {
38
+ 'select-lazy': {
39
+ bind(el, binding) {
40
+ const dropdown = el.querySelector('.el-select-dropdown__wrap');
41
+ if (!dropdown) return;
42
+
43
+ let maxMoveY = 0;
44
+ dropdown.addEventListener('scroll', function () {
45
+ if (this.scrollTop <= 20) {
46
+ maxMoveY = 0;
47
+ }
48
+ if (this.scrollTop > maxMoveY + 60 && this.scrollTop + this.clientHeight > this.scrollHeight - 60) {
49
+ maxMoveY = this.scrollTop;
50
+ binding.value();
51
+ }
52
+ });
53
+ }
54
+ }
55
+ },
56
+ props: {
57
+ value: {
58
+ type: [String, Number, Array, Object],
59
+ default: undefined
60
+ },
61
+ multiple: {
62
+ type: Boolean,
63
+ default: false,
64
+ },
65
+ bankCode: {
66
+ type: [String, Number, Array],
67
+ default: "",
68
+ },
69
+ valueKey: {
70
+ type: String,
71
+ default: "cnapsNo",
72
+ },
73
+ requestFn: {
74
+ type: Function,
75
+ required: true
76
+ }
77
+ },
78
+ data() {
79
+ return {
80
+ branchBankNo: this.value,
81
+ branchBankList: [],
82
+ page: {
83
+ current: 1,
84
+ size: 20,
85
+ key: "",
86
+ hasMore: true,
87
+ }
88
+ };
89
+ },
90
+ watch: {
91
+ value(newVal) {
92
+ this.branchBankNo = newVal;
93
+ },
94
+ bankCode: {
95
+ immediate: true,
96
+ handler() {
97
+ this.resetAndFetch();
98
+ },
99
+ },
100
+ },
101
+ created() {
102
+ this.debouncedFilter = debounce(this.handleFilter, 300);
103
+ },
104
+ mounted() {
105
+ this.fetchBranchData(true);
106
+ },
107
+ methods: {
108
+ lazyGet() {
109
+ if (this.page.hasMore) {
110
+ this.page.current++;
111
+ this.fetchBranchData();
112
+ }
113
+ },
114
+ async fetchBranchData(isInitial = false) {
115
+ if (!this.page.hasMore) return;
116
+ if (typeof this.requestFn !== 'function') {
117
+ console.error("requestFn prop must be a function.");
118
+ return;
119
+ }
120
+
121
+ const params = {
122
+ "page.size": this.page.size,
123
+ "page.current": this.page.current,
124
+ key: this.page.key,
125
+ isDomestic: 1,
126
+ };
127
+
128
+ if (Array.isArray(this.bankCode) && this.bankCode.length > 0) {
129
+ params.bankNoList = this.bankCode;
130
+ } else if (this.bankCode) {
131
+ params.bankNo = this.bankCode;
132
+ }
133
+
134
+ try {
135
+ const { data = [] } = await this.requestFn(params);
136
+ if (isInitial) {
137
+ this.branchBankList = data;
138
+ } else {
139
+ this.branchBankList = this.branchBankList.concat(data);
140
+ }
141
+ this.page.hasMore = data.length === this.page.size;
142
+ } catch (error) {
143
+ console.error("Failed to fetch branch data:", error);
144
+ }
145
+ },
146
+ handleFilter(val) {
147
+ this.page.key = val;
148
+ this.page.current = 1;
149
+ this.page.hasMore = true;
150
+ this.fetchBranchData(true);
151
+ },
152
+ resetAndFetch() {
153
+ this.branchBankList = [];
154
+ this.page.current = 1;
155
+ this.page.key = "";
156
+ this.page.hasMore = true;
157
+ this.branchBankNo = this.multiple ? [] : "";
158
+ this.fetchBranchData(true);
159
+ },
160
+ handleBranchChange(val) {
161
+ this.$emit('input', val);
162
+ this.$emit("canGetData", val);
163
+ },
164
+ handleFocus() {
165
+ if (!this.page.key && this.branchBankList.length === 0) {
166
+ this.handleFilter('');
167
+ }
168
+ }
169
+ },
170
+ };
171
+ </script>
172
+
173
+ <style lang="scss" scoped>
174
+ .branchBankSelect {
175
+ .el-select-dropdown__item {
176
+ height: 52px !important;
177
+ line-height: 52px !important;
178
+ }
179
+ }
180
180
  </style>
@@ -1,8 +1,8 @@
1
- import CommonCollapse from './src/main';
2
-
3
- /* istanbul ignore next */
4
- CommonCollapse.install = function(Vue) {
5
- Vue.component(CommonCollapse.name, CommonCollapse);
6
- };
7
-
8
- export default CommonCollapse;
1
+ import CommonCollapse from './src/main';
2
+
3
+ /* istanbul ignore next */
4
+ CommonCollapse.install = function(Vue) {
5
+ Vue.component(CommonCollapse.name, CommonCollapse);
6
+ };
7
+
8
+ export default CommonCollapse;