antd-management-fast-framework 1.11.19 → 1.11.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/es/utils/constants.d.ts +22 -0
- package/es/utils/constants.js +48 -1
- package/es/utils/tools.js +12 -0
- package/package.json +1 -1
package/es/utils/constants.d.ts
CHANGED
|
@@ -75,18 +75,40 @@ export namespace formNameCollection {
|
|
|
75
75
|
export { helper_1 as helper };
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* 转换集合
|
|
80
|
+
*/
|
|
78
81
|
export const convertCollection: {
|
|
82
|
+
/**
|
|
83
|
+
* 数字
|
|
84
|
+
*/
|
|
79
85
|
number: string;
|
|
86
|
+
/**
|
|
87
|
+
* 日期 date
|
|
88
|
+
*/
|
|
80
89
|
datetime: string;
|
|
90
|
+
/**
|
|
91
|
+
* 字符串
|
|
92
|
+
*/
|
|
81
93
|
string: string;
|
|
94
|
+
/**
|
|
95
|
+
* moment日期
|
|
96
|
+
*/
|
|
82
97
|
moment: string;
|
|
98
|
+
/**
|
|
99
|
+
* 金额
|
|
100
|
+
*/
|
|
83
101
|
money: string;
|
|
102
|
+
/**
|
|
103
|
+
* 数组
|
|
104
|
+
*/
|
|
84
105
|
array: string;
|
|
85
106
|
};
|
|
86
107
|
export namespace formatCollection {
|
|
87
108
|
export const money: string;
|
|
88
109
|
export const datetime: string;
|
|
89
110
|
export const chineseMoney: string;
|
|
111
|
+
export const percentage: string;
|
|
90
112
|
}
|
|
91
113
|
export namespace menuType {
|
|
92
114
|
export const divider: string;
|
package/es/utils/constants.js
CHANGED
|
@@ -104,20 +104,67 @@ var formNameCollection = {
|
|
|
104
104
|
helper: ''
|
|
105
105
|
}
|
|
106
106
|
};
|
|
107
|
+
/**
|
|
108
|
+
* 转换集合
|
|
109
|
+
*/
|
|
110
|
+
|
|
107
111
|
exports.formNameCollection = formNameCollection;
|
|
108
112
|
var convertCollection = {
|
|
113
|
+
/**
|
|
114
|
+
* 数字
|
|
115
|
+
*/
|
|
109
116
|
number: 'number',
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* 日期 date
|
|
120
|
+
*/
|
|
110
121
|
datetime: 'datetime',
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* 字符串
|
|
125
|
+
*/
|
|
111
126
|
string: 'string',
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* moment日期
|
|
130
|
+
*/
|
|
112
131
|
moment: 'moment',
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* 金额
|
|
135
|
+
*/
|
|
113
136
|
money: 'money',
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* 数组
|
|
140
|
+
*/
|
|
114
141
|
array: 'array'
|
|
115
142
|
};
|
|
143
|
+
/**
|
|
144
|
+
* 格式化集合
|
|
145
|
+
*/
|
|
146
|
+
|
|
116
147
|
exports.convertCollection = convertCollection;
|
|
117
148
|
var formatCollection = {
|
|
149
|
+
/**
|
|
150
|
+
* 金额 ¥ 0.00
|
|
151
|
+
*/
|
|
118
152
|
money: 'money',
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* 格式化日期 YYYY-MM-DD hh:mm:ss
|
|
156
|
+
*/
|
|
119
157
|
datetime: 'datetime',
|
|
120
|
-
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* 中文金额
|
|
161
|
+
*/
|
|
162
|
+
chineseMoney: 'chineseMoney',
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* 百分比
|
|
166
|
+
*/
|
|
167
|
+
percentage: 'percentage'
|
|
121
168
|
};
|
|
122
169
|
exports.formatCollection = formatCollection;
|
|
123
170
|
var menuType = {
|
package/es/utils/tools.js
CHANGED
|
@@ -171,6 +171,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
171
171
|
|
|
172
172
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
173
173
|
|
|
174
|
+
function _readOnlyError(name) { throw new TypeError("\"" + name + "\" is read-only"); }
|
|
175
|
+
|
|
174
176
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
175
177
|
|
|
176
178
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -1077,6 +1079,16 @@ function getValueByKey(_ref14) {
|
|
|
1077
1079
|
result = formatMoneyToChinese(v);
|
|
1078
1080
|
break;
|
|
1079
1081
|
|
|
1082
|
+
case _constants.formatCollection.percentage:
|
|
1083
|
+
var d = 0;
|
|
1084
|
+
|
|
1085
|
+
if (!isMoney(v)) {
|
|
1086
|
+
roundToTarget(v * 100, 1), _readOnlyError("d");
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
result = "".concat(d, "%");
|
|
1090
|
+
break;
|
|
1091
|
+
|
|
1080
1092
|
default:
|
|
1081
1093
|
result = v;
|
|
1082
1094
|
break;
|