@zcrkey/js-utils 0.0.11 → 0.0.15

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.
@@ -1,130 +0,0 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- var CrStorage = /*#__PURE__*/function () {
8
- function CrStorage() {
9
- _classCallCheck(this, CrStorage);
10
- }
11
- _createClass(CrStorage, null, [{
12
- key: "setLocalItem",
13
- value:
14
- /**
15
- * 设置本地存储
16
- * @param key
17
- * @param data
18
- */
19
- function setLocalItem(key, data) {
20
- try {
21
- localStorage.setItem(key, JSON.stringify(data));
22
- } catch (error) {
23
- console.warn("setLocalItem:".concat(key, ":").concat(error));
24
- }
25
- }
26
-
27
- /**
28
- * 获取本地存储
29
- * @param key
30
- * @returns
31
- */
32
- }, {
33
- key: "getLocalItem",
34
- value: function getLocalItem(key) {
35
- var str = localStorage.getItem(key);
36
- if (str) {
37
- if (str === 'undefined') {
38
- return null;
39
- }
40
- try {
41
- return JSON.parse(str);
42
- } catch (error) {
43
- console.warn("getLocalItem:".concat(key, ":").concat(error));
44
- return null;
45
- }
46
- } else {
47
- return null;
48
- }
49
- }
50
-
51
- /**
52
- * 清除某个本地存储
53
- * @param key
54
- */
55
- }, {
56
- key: "removeLocalItem",
57
- value: function removeLocalItem(key) {
58
- localStorage.removeItem(key);
59
- }
60
-
61
- /**
62
- * 清除所有本地存储
63
- */
64
- }, {
65
- key: "clearLocal",
66
- value: function clearLocal() {
67
- localStorage.clear();
68
- }
69
-
70
- /**
71
- * 设置会话存储
72
- * @param key
73
- * @param data
74
- */
75
- }, {
76
- key: "setSessionItem",
77
- value: function setSessionItem(key, data) {
78
- try {
79
- sessionStorage.setItem(key, JSON.stringify(data));
80
- } catch (error) {
81
- console.warn("setSessionItem:".concat(key, ":").concat(error));
82
- }
83
- }
84
-
85
- /**
86
- * 获取会话存储
87
- * @param key
88
- * @returns
89
- */
90
- }, {
91
- key: "getSessionItem",
92
- value: function getSessionItem(key) {
93
- var str = sessionStorage.getItem(key);
94
- if (str) {
95
- if (str === 'undefined') {
96
- return null;
97
- }
98
- try {
99
- return JSON.parse(str);
100
- } catch (error) {
101
- console.warn("getSessionItem:".concat(key, ":").concat(error));
102
- return null;
103
- }
104
- } else {
105
- return null;
106
- }
107
- }
108
-
109
- /**
110
- * 清除某个会话存储
111
- * @param key
112
- */
113
- }, {
114
- key: "removeSessionItem",
115
- value: function removeSessionItem(key) {
116
- sessionStorage.removeItem(key);
117
- }
118
-
119
- /**
120
- * 清除所有会话存储
121
- */
122
- }, {
123
- key: "clearSession",
124
- value: function clearSession() {
125
- sessionStorage.clear();
126
- }
127
- }]);
128
- return CrStorage;
129
- }();
130
- export { CrStorage as default };
package/dist/esm/tree.js DELETED
@@ -1,214 +0,0 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
3
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
5
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
7
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
8
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
12
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
13
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
16
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
17
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
18
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
19
- import { cloneDeep as _cloneDeep, find as _find, get as _get, keyBy as _keyBy } from 'lodash';
20
- import CrUtil from "./util";
21
- var CrTreeUtil = /*#__PURE__*/function () {
22
- function CrTreeUtil() {
23
- _classCallCheck(this, CrTreeUtil);
24
- }
25
- _createClass(CrTreeUtil, null, [{
26
- key: "listToTree",
27
- value:
28
- /**
29
- * 列表数据转树形数据
30
- * @param list
31
- * @param options
32
- * @param options.idField 默认值 id
33
- * @param options.parentIdField 默认值 parentId
34
- * @param options.childrenField 默认值 children
35
- * @param options.isCloneDeep 是否需要深拷贝, 默认值为 true
36
- * @param options.getData 处理数据
37
- * @returns
38
- */
39
- function listToTree(list, options) {
40
- var _ref = options || {},
41
- _ref$idField = _ref.idField,
42
- idField = _ref$idField === void 0 ? 'id' : _ref$idField,
43
- _ref$parentIdField = _ref.parentIdField,
44
- parentIdField = _ref$parentIdField === void 0 ? 'parentId' : _ref$parentIdField,
45
- _ref$childrenField = _ref.childrenField,
46
- childrenField = _ref$childrenField === void 0 ? 'children' : _ref$childrenField,
47
- _ref$isCloneDeep = _ref.isCloneDeep,
48
- isCloneDeep = _ref$isCloneDeep === void 0 ? true : _ref$isCloneDeep,
49
- _ref$getData = _ref.getData,
50
- getData = _ref$getData === void 0 ? function (item) {
51
- return item;
52
- } : _ref$getData;
53
- var listData = isCloneDeep ? _cloneDeep(list) : list;
54
- var treeData = [];
55
- var nodeMap = new Map();
56
- var _iterator = _createForOfIteratorHelper(listData),
57
- _step;
58
- try {
59
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
60
- var _item = _step.value;
61
- var id = _item[idField];
62
- var node = _objectSpread(_objectSpread({}, getData(_item)), {}, {
63
- __origin_id: id,
64
- __origin_pid: _item[parentIdField]
65
- });
66
- nodeMap.set(id, node);
67
- }
68
- } catch (err) {
69
- _iterator.e(err);
70
- } finally {
71
- _iterator.f();
72
- }
73
- var _iterator2 = _createForOfIteratorHelper(nodeMap.values()),
74
- _step2;
75
- try {
76
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
77
- var _node = _step2.value;
78
- var parentId = _node.__origin_pid;
79
- if (parentId === undefined || parentId === null || parentId === 0 || !nodeMap.has(parentId)) {
80
- treeData.push(_node);
81
- } else {
82
- var parentNode = nodeMap.get(parentId);
83
- if (!parentNode[childrenField]) {
84
- parentNode[childrenField] = [];
85
- }
86
- parentNode[childrenField].push(_node);
87
- }
88
- }
89
- } catch (err) {
90
- _iterator2.e(err);
91
- } finally {
92
- _iterator2.f();
93
- }
94
- var clean = function clean(nodes) {
95
- var _iterator3 = _createForOfIteratorHelper(nodes),
96
- _step3;
97
- try {
98
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
99
- var node = _step3.value;
100
- delete node.__origin_id;
101
- delete node.__origin_pid;
102
- if (node[childrenField]) {
103
- clean(node[childrenField]);
104
- }
105
- }
106
- } catch (err) {
107
- _iterator3.e(err);
108
- } finally {
109
- _iterator3.f();
110
- }
111
- };
112
- clean(treeData);
113
- return treeData;
114
- }
115
-
116
- /**
117
- * 树形数据转列表数据
118
- * @param tree
119
- * @param options
120
- * @param options.idField 默认值 id
121
- * @param options.parentIdField 默认值 parentId
122
- * @param options.childrenField 默认值 children
123
- * @param options.rootParentValue 根节点的父值,默认值 null
124
- * @returns
125
- */
126
- }, {
127
- key: "treeToList",
128
- value: function treeToList(tree, options) {
129
- var _ref2 = options || {},
130
- _ref2$idField = _ref2.idField,
131
- idField = _ref2$idField === void 0 ? 'id' : _ref2$idField,
132
- _ref2$parentIdField = _ref2.parentIdField,
133
- parentIdField = _ref2$parentIdField === void 0 ? 'parentId' : _ref2$parentIdField,
134
- _ref2$childrenField = _ref2.childrenField,
135
- childrenField = _ref2$childrenField === void 0 ? 'children' : _ref2$childrenField,
136
- _ref2$rootParentValue = _ref2.rootParentValue,
137
- rootParentValue = _ref2$rootParentValue === void 0 ? null : _ref2$rootParentValue;
138
- var result = [];
139
- var originQueue = _cloneDeep(_toConsumableArray(tree));
140
- var queue = originQueue.map(function (node) {
141
- return {
142
- node: node,
143
- parentId: rootParentValue
144
- };
145
- });
146
- var _loop = function _loop() {
147
- var _ref3 = queue.shift(),
148
- node = _ref3.node,
149
- parentId = _ref3.parentId;
150
- if (!node || !CrUtil.isObject(node)) {
151
- return 1; // continue
152
- }
153
- var children = node[childrenField];
154
- var nodeId = node[idField];
155
- var _ = node[childrenField],
156
- rest = _objectWithoutProperties(node, [childrenField].map(_toPropertyKey));
157
- var flatNode = _objectSpread(_objectSpread({}, rest), {}, _defineProperty({}, parentIdField, parentId));
158
- result.push(flatNode);
159
- if (children && CrUtil.isArray(children) && children.length > 0) {
160
- var childQueue = children.map(function (childNode) {
161
- return {
162
- node: childNode,
163
- parentId: nodeId
164
- };
165
- });
166
- queue.push.apply(queue, _toConsumableArray(childQueue));
167
- }
168
- };
169
- while (queue.length) {
170
- if (_loop()) continue;
171
- }
172
- return result;
173
- }
174
-
175
- /**
176
- * 获取扁平化父数据(包含自身)
177
- * @param listData
178
- * @param value
179
- * @param settings
180
- * @param settings.valueField 默认值 value
181
- * @param settings.idField 默认值 id
182
- * @param settings.parentIdField 默认值 parentId
183
- * @param settings.getData 过滤数据
184
- */
185
- }, {
186
- key: "getFlatParentDatas",
187
- value: function getFlatParentDatas(listData, value, settings) {
188
- if (!Array.isArray(listData) || listData.length === 0 || value == null) {
189
- return [];
190
- }
191
- var options = Object.assign({
192
- valueField: 'value',
193
- idField: 'id',
194
- parentIdField: 'parentId',
195
- getData: function getData(item) {
196
- return item;
197
- }
198
- }, settings);
199
- var nodeMap = _keyBy(listData, options.valueField);
200
- var result = [];
201
- var visited = new Set();
202
- var current = nodeMap[value];
203
- while (current && !visited.has(_get(current, options.idField))) {
204
- visited.add(_get(current, options.idField));
205
- result.unshift(options.getData(current));
206
- var parentId = _get(current, options.parentIdField);
207
- current = _find(listData, [options.valueField, parentId]);
208
- }
209
- return result;
210
- }
211
- }]);
212
- return CrTreeUtil;
213
- }();
214
- export { CrTreeUtil as default };
@@ -1,221 +0,0 @@
1
- export default class CrUtil {
2
- /**
3
- * 判断是否为数组
4
- * @param value
5
- * @returns boolean
6
- */
7
- static isArray<T = any>(value: any): value is T[];
8
- /**
9
- * 判断是否为对象
10
- * @param value
11
- * @returns boolean
12
- */
13
- static isObject(value: unknown): value is Record<string | number, unknown>;
14
- /**
15
- * 判断是否为空对象
16
- * @param value
17
- * @returns boolean
18
- */
19
- static isEmptyObject(value: object): value is Record<string | number, never>;
20
- /**
21
- * 判断是否对象的属性是否全部为空
22
- * @param value
23
- * @returns boolean
24
- */
25
- static isObjectPropertiesAllEmpty(value: Record<string | number, any>): boolean;
26
- /**
27
- * 判断是否为日期
28
- * @param value
29
- * @returns boolean
30
- */
31
- static isDate(value: unknown): boolean;
32
- /**
33
- * 判断是否为字符串
34
- * @param value
35
- * @returns boolean
36
- */
37
- static isString(value: unknown): value is string;
38
- /**
39
- * 判断是否为数字
40
- * @param value
41
- * @returns boolean
42
- */
43
- static isNumber(value: unknown): value is number;
44
- /**
45
- * 判断是否为文件 File
46
- * @param value
47
- * @returns boolean
48
- */
49
- static isFile(value: unknown): value is File;
50
- /**
51
- * 判断是否为 Boolean
52
- * @param value
53
- * @returns boolean
54
- */
55
- static isBoolean(value: unknown): value is boolean;
56
- /**
57
- * 判断是否为 Function
58
- * @param value
59
- * @returns boolean
60
- */
61
- static isFunction(value: unknown): value is (...args: any[]) => any;
62
- /**
63
- * 去掉字符串前后所有空格
64
- * @param str
65
- * @returns string
66
- */
67
- static trim(str: string): string;
68
- /**
69
- * 获取数组为几维数组
70
- * @param arr
71
- * @returns number
72
- */
73
- static getArrayDimension(arr: any[]): number;
74
- /**
75
- * 深拷贝
76
- * @param value
77
- * @returns
78
- */
79
- static cloneDeep<T>(value: T): T;
80
- /**
81
- * 深拷贝
82
- * @param target
83
- * @deprecated 即将移除,使用 {@link CrUtil.cloneDeep} 替代
84
- * @returns
85
- */
86
- static deepCopy<T = any>(target: T): T;
87
- /**
88
- * 列表数据转树型数据
89
- * @param listData
90
- * @param settings
91
- * @param settings.idField 默认值 id
92
- * @param settings.pidField 默认值 parentId
93
- * @param settings.childrenField 默认值 children
94
- * @deprecated 即将移除,使用 {@link CrTreeUtil.listToTree} 替代
95
- * @returns
96
- */
97
- static listToTreeData(listData: any[], settings?: {
98
- idField?: string;
99
- pidField?: string;
100
- childrenField?: string;
101
- isDeepCopy?: boolean;
102
- getData?: (item: any) => any;
103
- }): any[];
104
- /**
105
- * 树型数据转列表数据
106
- * @param treeData
107
- * @param settings
108
- * @param settings.idField 默认值 id
109
- * @param settings.pidField 默认值 parentId
110
- * @param settings.childrenField 默认值 children
111
- * @deprecated 即将移除,使用 {@link CrTreeUtil.treeToList} 替代
112
- * @returns
113
- */
114
- static treeDataToListData(treeData: any[], pid?: string | number, settings?: {
115
- childrenField?: string;
116
- idField?: string;
117
- pidField?: string;
118
- isDeepCopy?: boolean;
119
- }): any[];
120
- /**
121
- * 获取所有父级数据(包含自身)
122
- * @param listData
123
- * @param value
124
- * @param settings
125
- * @param settings.valueField 默认值 value
126
- * @param settings.idField 默认值 id
127
- * @param settings.pidField 默认值 parentId
128
- * @deprecated 即将移除,使用 {@link CrTreeUtil.getFlatParentDatas} 替代
129
- * @returns
130
- */
131
- static getParentNodes<T, R extends Record<string, any>>(listData: R[], value: number | string, settings?: {
132
- valueField?: string;
133
- idField?: string;
134
- pidField?: string;
135
- getData?: (item: R) => T;
136
- }): T[];
137
- /**
138
- * 参数序列化
139
- * @param params {a:'1',b:{},c:[]}
140
- * @returns
141
- */
142
- static paramsSerializer(params: Record<string, any>, settings?: {
143
- isFilterNonNull: boolean;
144
- }): string;
145
- /**
146
- * 参数解析
147
- * @param {*} str
148
- * @param {*} settings
149
- * @returns
150
- */
151
- static paramsParse(str: string, settings?: {
152
- ignoreQueryPrefix: boolean;
153
- }): {};
154
- /**
155
- * 获取 URL 参数
156
- * @param {*} url
157
- * @returns
158
- * @example
159
- * "https://example.com?foo=bar&baz=qux" => {"query":{"foo":"bar","baz":"qux"},"hash":{},"all":{"foo":"bar","baz":"qux"}}
160
- * "https://example.com/page?foo=1#/?a=1&b=2" => {"query":{"foo":"1"},"hash":{"/":"","a":"1","b":"2"},"all":{"foo":"1","/":"","a":"1","b":"2"}},
161
- */
162
- static getQueryParams(url: string): {
163
- query: Record<string, any>;
164
- hash: Record<string, any>;
165
- all: Record<string, any>;
166
- };
167
- /**
168
- * 版本号比较
169
- * @param v1
170
- * @param v2
171
- * @returns number
172
- * @description v1大于v2(1)、v1小于v2(-1)、v1等于v2(0)
173
- */
174
- static compareVersion(v1: string, v2: string): number;
175
- /**
176
- * 根据 ids 获取相对应的数据名称
177
- * @param data
178
- * @param ids
179
- * @param settings
180
- * @returns string
181
- */
182
- static getDataNameByIds<T extends Record<string, any>>(data: T[], ids: (string | number)[], settings?: {
183
- sep?: string;
184
- nameField?: string;
185
- idField?: string;
186
- }): string;
187
- /**
188
- * 追加html标签属性值
189
- * @param htmlStr
190
- * @param tagName
191
- * @param attrName
192
- * @param newAttrValue
193
- * @returns string
194
- */
195
- static appendHtmlTagAttr(htmlStr: string, tagName: string, attrName: string, newAttrValue: string): string;
196
- /**
197
- * 比较数据差异
198
- * @param data1
199
- * @param data2
200
- * @returns
201
- */
202
- static compareDataDiff(data1: any, data2: any): Record<string, "added" | "removed" | "modified">;
203
- /**
204
- * 格式化为千分位,主要用于展示格式化
205
- * @param value
206
- * @returns 12345.6789 => 12,345.6789
207
- */
208
- static fmtThousands(value: number | string | undefined): string;
209
- /**
210
- * 格式化为千分位格式
211
- * @param value
212
- * @returns
213
- */
214
- static formatThousands(value?: string | number): string;
215
- /**
216
- * 解析千分位格式
217
- * @param value
218
- * @returns
219
- */
220
- static parseThousands(value?: string | number): string;
221
- }