Skip to content

Commit

Permalink
【fix】更新iclient-common
Browse files Browse the repository at this point in the history
  • Loading branch information
songyumeng committed May 15, 2024
1 parent ac85b8b commit 342e34e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/common/_utils/style/theme/chart.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { getColorWithOpacity } from 'vue-iclient/src/common/_utils/util';
import cloneDeep from 'lodash.clonedeep';
import { ColorsPickerUtil } from 'vue-iclient/static/libs/iclient-common/iclient-common';

export const handleMultiGradient = (colorGroupsData, dataLength) => {
let startColors = [];
Expand All @@ -11,8 +12,8 @@ export const handleMultiGradient = (colorGroupsData, dataLength) => {
startColors.push(colorInfo.colorStops[0].color);
endColors.push(colorInfo.colorStops[1].color);
});
startColorGroups = SuperMap.ColorsPickerUtil.getGradientColors(startColors, dataLength, 'RANGE');
endColorGroups = SuperMap.ColorsPickerUtil.getGradientColors(endColors, dataLength, 'RANGE');
startColorGroups = ColorsPickerUtil.getGradientColors(startColors, dataLength, 'RANGE');
endColorGroups = ColorsPickerUtil.getGradientColors(endColors, dataLength, 'RANGE');
for (let i = 0; i < dataLength; i++) {
let colorGroupDataCopy = cloneDeep(colorGroupsData[0]);
colorGroupDataCopy.colorStops = [
Expand All @@ -36,7 +37,7 @@ export const getMultiColorGroup = (colorGroup, dataNumber) => {
if (colorGroup && dataNumber > colorGroup.length && typeof colorGroup[0] === 'object') {
nextColorGroup = handleMultiGradient(colorGroup, dataNumber);
} else {
nextColorGroup = SuperMap.ColorsPickerUtil.getGradientColors(colorGroup, dataNumber, 'RANGE');
nextColorGroup = ColorsPickerUtil.getGradientColors(colorGroup, dataNumber, 'RANGE');
}
return nextColorGroup;
};
Expand Down
3 changes: 2 additions & 1 deletion src/common/chart/ChartMixin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import Timer from 'vue-iclient/src/common/_mixin/Timer';
import { chartThemeUtil, handleMultiGradient, getMultiColorGroup } from 'vue-iclient/src/common/_utils/style/theme/chart';
import EchartsDataService from 'vue-iclient/src/common/_utils/EchartsDataService';
import { getFeatureCenter, getColorWithOpacity, setPopupArrowStyle } from 'vue-iclient/src/common/_utils/util';
import { ColorsPickerUtil } from 'vue-iclient/static/libs/iclient-common/iclient-common';
import TablePopup from 'vue-iclient/src/common/table-popup/TablePopup.vue';
import Message from 'vue-iclient/src/common/message/index.js';
import { addListener, removeListener } from 'resize-detector';
Expand Down Expand Up @@ -1073,7 +1074,7 @@ export default {
if (typeof this.colorGroupsData[0] === 'object') {
return handleMultiGradient(this.colorGroupsData, serielDataLength);
} else {
return SuperMap.ColorsPickerUtil.getGradientColors(this.colorGroupsData, serielDataLength, 'RANGE');
return ColorsPickerUtil.getGradientColors(this.colorGroupsData, serielDataLength, 'RANGE');
}
},
// 控制label显示条数
Expand Down
2 changes: 1 addition & 1 deletion static/libs/iclient-common/iclient-common.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions test/unit/mocks/FetchRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ function mockFetch(resource) {
}
});
};

jest.spyOn(SuperMap.FetchRequest, 'get').mockImplementation(mockImplementation);
if (window && window.SuperMap) {
jest.spyOn(SuperMap.FetchRequest, 'get').mockImplementation(mockImplementation);
}
jest.spyOn(FetchRequest, 'get').mockImplementation(mockImplementation);
}
export default mockFetch;

0 comments on commit 342e34e

Please sign in to comment.