diff --git a/src/api/PlatformApi.ts b/src/api/PlatformApi.ts
index 8454815..860e81e 100644
--- a/src/api/PlatformApi.ts
+++ b/src/api/PlatformApi.ts
@@ -3,28 +3,27 @@ import { api } from 'src/boot/axios';
const platformUriBase = '/mock/platform/status';
const stationUriBase = '/mock/rtu/status';
-export function mockPlatformApi(
- lineId: number,
- data: {
- emergstop: boolean;
- trainberth: boolean;
- close: boolean;
- upHold: boolean;
- downHold: boolean;
- upOccHold: boolean;
- downOccHold: boolean;
- psdOpen: boolean;
- psdCut: boolean;
- upSkipstop: boolean;
- downSkipstop: boolean;
- upTrainSkipstop: boolean;
- downTrainSkipstop: boolean;
- id: string;
- nextSectionRunTime: number;
- nextSectionRunLevel: number;
- stopTime: number;
- }
-) {
+export interface mockPlatformParams {
+ emergstop: boolean;
+ trainberth: boolean;
+ close: boolean;
+ upHold: boolean;
+ downHold: boolean;
+ upOccHold: boolean;
+ downOccHold: boolean;
+ psdOpen: boolean;
+ psdCut: boolean;
+ upSkipstop: boolean;
+ downSkipstop: boolean;
+ upTrainSkipstop: boolean;
+ downTrainSkipstop: boolean;
+ id: string;
+ nextSectionRunTime: number;
+ nextSectionRunLevel: number;
+ stopTime: number;
+}
+
+export function mockPlatformApi(lineId: number, data: mockPlatformParams) {
return api.post(`${platformUriBase}/${lineId}`, data);
}
diff --git a/src/components/state-app/deviceStates/PlatformProperty.vue b/src/components/state-app/deviceStates/PlatformProperty.vue
index a96c3c7..fcb8ff1 100644
--- a/src/components/state-app/deviceStates/PlatformProperty.vue
+++ b/src/components/state-app/deviceStates/PlatformProperty.vue
@@ -48,7 +48,7 @@
@blur="onUpdate"
v-model="upHold"
:options="optionsChoose"
- label="是否上行扣车"
+ label="是否上行车站扣车"
/>
{
upHold.value = (showSelectData as never)[platformModel.upHold + ''];
upOccHold.value = (showSelectData as never)[platformModel.upOccHold + ''];
upSkipstop.value = (showSelectData as never)[platformModel.upSkipstop + ''];
- downHold.value = (showSelectData as never)[platformModel.upHold + ''];
- downOccHold.value = (showSelectData as never)[platformModel.upOccHold + ''];
+ downHold.value = (showSelectData as never)[platformModel.downHold + ''];
+ downOccHold.value = (showSelectData as never)[
+ platformModel.downOccHold + ''
+ ];
downSkipstop.value = (showSelectData as never)[
platformModel.upSkipstop + ''
];
@@ -209,7 +211,7 @@ function onUpdate() {
platformModel.downSkipstop = JSON.parse(
(showSelect as never)[downSkipstop.value]
);
- const data = {
+ const data: { [key: string]: boolean | number | string } = {
emergstop: false,
trainberth: false,
close: false,
@@ -228,11 +230,12 @@ function onUpdate() {
nextSectionRunLevel: 0,
stopTime: 0,
};
+ type keyData = 'emergstop' | 'trainberth';
Object.keys(data).forEach((i) => {
- data[i] = platformModel[i] || (data[i] as boolean);
+ data[i] = platformModel[i as keyData] || data[i];
});
if (platform) {
- mockPlatformApi(3, data)
+ mockPlatformApi(3, data as unknown as mockPlatformParams)
.then((res) => {
console.log(res, '---res--');
})
diff --git a/src/pages/LineMonitorPage.vue b/src/pages/LineMonitorPage.vue
index ae5eaf7..83cddf0 100644
--- a/src/pages/LineMonitorPage.vue
+++ b/src/pages/LineMonitorPage.vue
@@ -1,11 +1,12 @@
-
+
-
+
+
-
+
@@ -55,7 +56,7 @@ function onResize() {
const dom = document.getElementById('line-app-container');
if (dom) {
dom.style.width = props.sizeWidth + 'px';
- dom.style.height = props.sizeHeight + 'px';
+ dom.style.height = props.sizeHeight + 50 + 'px';
}
const lineApp = getLineApp();
if (lineApp) {
diff --git a/src/pages/MonitorPage.vue b/src/pages/MonitorPage.vue
index 6032bb0..1054502 100644
--- a/src/pages/MonitorPage.vue
+++ b/src/pages/MonitorPage.vue
@@ -63,7 +63,7 @@ function onResize() {
}
const lineNetApp = getLineNetApp();
if (lineNetApp) {
- lineNetApp.onDomResize(props.sizeWidth, props.sizeHeight - 32);
+ lineNetApp.onDomResize(props.sizeWidth, props.sizeHeight);
}
}