@rfkit/charts 1.2.11 → 1.2.12
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/components/Signal/tools.d.ts +3 -3
- package/index.d.ts +1 -1
- package/index.js +7 -7
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { StationInfoType } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* 全局台站信号数据存储
|
|
4
|
-
*
|
|
5
|
-
* - 写入时:同时存到 openData(按 globalID)和
|
|
6
|
-
* - 读取时:优先从 openData 读取,如果为空则从
|
|
4
|
+
* 支持会话级缓存(按 globalID 隔离):
|
|
5
|
+
* - 写入时:同时存到 openData(按 globalID)和 sessionStorage(按 globalID)
|
|
6
|
+
* - 读取时:优先从 openData 读取,如果为空则从 sessionStorage 恢复
|
|
7
7
|
*/
|
|
8
8
|
export declare const STATION_DATA: (globalID: string, data?: StationInfoType[]) => StationInfoType[];
|
package/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { setFrequencyAllocationToCache } from './components/FrequencyAllocation/
|
|
|
2
2
|
export { ChartType, MarkerEventType, OptionKey, PSType, SegmentsEvent, SeriesType, ToolsBarItemType } from './config';
|
|
3
3
|
export { default as useSafePublish } from './hooks/useSafePublish';
|
|
4
4
|
export { Dial, Gauge, Heatmap, IQ, LevelStream, Occupancy, Spectrum } from './lib';
|
|
5
|
-
export type { AxisXProps, AxisYRange, ChartRef, MarkerProps, MarkerType, Publish, PublishData, PublishDial, PublishGauge, PublishHeatmap, PublishIQ, PublishLevelStream, PublishOccupancy, PublishSpectrum, RecursiveFunction, // 递归方法 后期会删除
|
|
5
|
+
export type { AxisXProps, AxisYRange, ChartRef, FrequencyAllocationItem, MarkerProps, MarkerType, Publish, PublishData, PublishDial, PublishGauge, PublishHeatmap, PublishIQ, PublishLevelStream, PublishOccupancy, PublishSpectrum, RecursiveFunction, // 递归方法 后期会删除
|
|
6
6
|
RecursiveObject, // 递归对象 后期会删除
|
|
7
7
|
Render, Reset, SegmentsOriginal, SeriesConfig, SetAntennaFactor, SetChannels, SetMarker, SetSegments, SetSeries, SetSpectrumBandwidth, SpectrumBandwidth, SpectrumExtraData, StationInfoType } from './types';
|
|
8
8
|
export { HeatmapCaptureType, MarkerMode } from './types';
|
package/index.js
CHANGED
|
@@ -7559,19 +7559,19 @@ const ZoomOffsetContainer = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.
|
|
|
7559
7559
|
});
|
|
7560
7560
|
});
|
|
7561
7561
|
const Zoom_ZoomOffsetContainer = ZoomOffsetContainer;
|
|
7562
|
-
const
|
|
7563
|
-
function getStationDataFromStorage() {
|
|
7562
|
+
const STORAGE_KEY_PREFIX = 'rfkit-charts-stationData';
|
|
7563
|
+
function getStationDataFromStorage(globalID) {
|
|
7564
7564
|
try {
|
|
7565
|
-
const stored =
|
|
7565
|
+
const stored = sessionStorage.getItem(`${STORAGE_KEY_PREFIX}-${globalID}`);
|
|
7566
7566
|
if (stored) return JSON.parse(stored);
|
|
7567
7567
|
} catch (error) {
|
|
7568
7568
|
console.error("\u8BFB\u53D6\u53F0\u7AD9\u6570\u636E\u5931\u8D25:", error);
|
|
7569
7569
|
}
|
|
7570
7570
|
return [];
|
|
7571
7571
|
}
|
|
7572
|
-
function saveStationDataToStorage(data) {
|
|
7572
|
+
function saveStationDataToStorage(globalID, data) {
|
|
7573
7573
|
try {
|
|
7574
|
-
|
|
7574
|
+
sessionStorage.setItem(`${STORAGE_KEY_PREFIX}-${globalID}`, JSON.stringify(data));
|
|
7575
7575
|
} catch (error) {
|
|
7576
7576
|
console.error("\u4FDD\u5B58\u53F0\u7AD9\u6570\u636E\u5931\u8D25:", error);
|
|
7577
7577
|
}
|
|
@@ -7579,12 +7579,12 @@ function saveStationDataToStorage(data) {
|
|
|
7579
7579
|
const STATION_DATA = (globalID, data)=>{
|
|
7580
7580
|
if (void 0 !== data) {
|
|
7581
7581
|
subscription_openData(`stationData-${globalID}`, data, []);
|
|
7582
|
-
saveStationDataToStorage(data);
|
|
7582
|
+
saveStationDataToStorage(globalID, data);
|
|
7583
7583
|
return data;
|
|
7584
7584
|
}
|
|
7585
7585
|
const openDataResult = subscription_openData(`stationData-${globalID}`, void 0, null);
|
|
7586
7586
|
if (openDataResult && openDataResult.length > 0) return openDataResult;
|
|
7587
|
-
const storedData = getStationDataFromStorage();
|
|
7587
|
+
const storedData = getStationDataFromStorage(globalID);
|
|
7588
7588
|
if (storedData.length > 0) {
|
|
7589
7589
|
subscription_openData(`stationData-${globalID}`, storedData, []);
|
|
7590
7590
|
return storedData;
|