Commit 2e56c11259b4c1b080642e85e748600e03f4b569

Authored by ww
1 parent ed0cd4c6

fix: map component history model not setting model name

... ... @@ -111,7 +111,12 @@
111 111 </script>
112 112
113 113 <template>
114   - <BasicModal @register="registerModal" @ok="handleOk" :ok-button-props="{ loading }">
  114 + <BasicModal
  115 + title="历史轨迹"
  116 + @register="registerModal"
  117 + @ok="handleOk"
  118 + :ok-button-props="{ loading }"
  119 + >
115 120 <BasicForm @register="registerForm" />
116 121 </BasicModal>
117 122 </template>
... ...
... ... @@ -24,10 +24,13 @@ export const MapRealTrackConfig: Config = {
24 24 componentType: FrontComponent.MAP_COMPONENT_TRACK_REAL,
25 25 };
26 26
27   -const getTrack = (dataSource: DataSource[]) => {
  27 +const getTrack = (dataSource: DataSource[], config: Config) => {
28 28 if (dataSource.length >= 2) {
29 29 const trackRecord = dataSource.slice(0, 2);
30   - if (!trackRecord.every((item) => item.componentInfo.value))
  30 + if (
  31 + !trackRecord.every((item) => item.componentInfo.value) &&
  32 + config.componentType === FrontComponent.MAP_COMPONENT_TRACK_REAL
  33 + )
31 34 return { track: [], dataSource: [] };
32 35
33 36 const track = trackRecord.map((item) => {
... ... @@ -46,7 +49,7 @@ export const transfromMapComponentConfig: ComponentConfig['transformConfig'] = (
46 49 _record,
47 50 dataSourceRecord
48 51 ) => {
49   - const { track, dataSource } = getTrack(dataSourceRecord as DataSource[]);
  52 + const { track, dataSource } = getTrack(dataSourceRecord as DataSource[], componentConfig);
50 53 return {
51 54 layout: {
52 55 ...componentConfig,
... ...