完善运行轨迹点展示与模拟数据
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
export type ResourceCollectionContract = {
|
||||
columns: string[];
|
||||
jsonColumns?: string[];
|
||||
rawColumns?: string[];
|
||||
relationIdentityKeys?: Record<string, string>;
|
||||
};
|
||||
|
||||
@@ -115,6 +116,7 @@ const contracts: Record<string, ResourceDetailContract> = {
|
||||
'occurred_at', 'received_at', 'longitude', 'latitude', 'accuracy',
|
||||
'speed', 'direction', 'source', 'request_no',
|
||||
],
|
||||
rawColumns: ['direction'],
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -173,3 +175,15 @@ export function isCollectionJsonField(
|
||||
?.jsonColumns?.includes(column),
|
||||
);
|
||||
}
|
||||
|
||||
/** 判断集合字段是否必须保留接口原始值,避免同名全局枚举误用到其他业务语义。 */
|
||||
export function isCollectionRawField(
|
||||
resourceName: string,
|
||||
collectionKey: string,
|
||||
column: string,
|
||||
) {
|
||||
return Boolean(
|
||||
contracts[resourceName]?.collections?.[collectionKey]
|
||||
?.rawColumns?.includes(column),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user