Browse Source

REPORT-112276 公共数据取数简道云数据连接部分适配

引用lodash.uniqWith
research/test
hans 10 months ago
parent
commit
0680435c5d
  1. 25
      packages/fineui/src/core/1.lodash.js
  2. 6
      packages/fineui/src/core/2.base.js

25
packages/fineui/src/core/1.lodash.js

@ -6142,6 +6142,30 @@
return (array && array.length) ? baseUniq(array, baseIteratee(iteratee, 2)) : []; return (array && array.length) ? baseUniq(array, baseIteratee(iteratee, 2)) : [];
} }
/**
* This method is like `uniq` except that it accepts `comparator` which
* is invoked to compare elements of `array`. The order of result values is
* determined by the order they occur in the array. The comparator is invoked
* with two arguments: (arrVal, othVal).
*
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new duplicate free array.
* @see uniq, uniqBy
* @example
*
* const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]
*
* uniqWith(objects, isEqual)
* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
*/
function uniqWith(array, comparator) {
comparator = typeof comparator === 'function' ? comparator : undefined;
return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
}
/** /**
* This method is like `_.zip` except that it accepts an array of grouped * This method is like `_.zip` except that it accepts an array of grouped
* elements and creates an array regrouping the elements to their pre-zip * elements and creates an array regrouping the elements to their pre-zip
@ -10041,6 +10065,7 @@
lodash.union = union; lodash.union = union;
lodash.uniq = uniq; lodash.uniq = uniq;
lodash.uniqBy = uniqBy; lodash.uniqBy = uniqBy;
lodash.uniqWith = uniqWith;
lodash.unzip = unzip; lodash.unzip = unzip;
lodash.values = values; lodash.values = values;
lodash.without = without; lodash.without = without;

6
packages/fineui/src/core/2.base.js

@ -482,6 +482,7 @@ _.each(
"take", "take",
"takeRight", "takeRight",
"uniqBy", "uniqBy",
"uniqWith"
], ],
name => { name => {
lodashFns[name] = _apply(name); lodashFns[name] = _apply(name);
@ -510,6 +511,7 @@ export const range = lodashFns.range;
export const take = lodashFns.take; export const take = lodashFns.take;
export const takeRight = lodashFns.takeRight; export const takeRight = lodashFns.takeRight;
export const uniqBy = lodashFns.uniqBy; export const uniqBy = lodashFns.uniqBy;
export const uniqWith = lodashFns.uniqWith;
export const findIndex = lodashFns.findIndex; export const findIndex = lodashFns.findIndex;
export const findLastIndex = lodashFns.findLastIndex; export const findLastIndex = lodashFns.findLastIndex;
@ -972,7 +974,7 @@ export let nextTick = /*!PURE*/(function () {
pending = true; pending = true;
timerFunc(); timerFunc();
} }
if (!cb && typeof Promise !== "undefined") { if (!cb && typeof Promise !== "undefined") {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
_resolve = resolve; _resolve = resolve;
@ -983,7 +985,7 @@ export let nextTick = /*!PURE*/(function () {
export const setNextTick = (fn) => { export const setNextTick = (fn) => {
nextTick = fn; nextTick = fn;
} }
// 数字相关方法 // 数字相关方法
_.each(["random"], name => { _.each(["random"], name => {

Loading…
Cancel
Save