diff --git a/web/src/components/TaskModal.vue b/web/src/components/TaskModal.vue
index b6c5e37..e57b243 100644
--- a/web/src/components/TaskModal.vue
+++ b/web/src/components/TaskModal.vue
@@ -8,15 +8,8 @@
-
+
@@ -34,14 +27,14 @@
日期 |
- 游戏数 |
- 练习日 |
- 参数飞行数 |
- 参数模型 |
+ 波次数 |
+ 演戏日 |
+ 参演飞机数 |
+ 参演机型 |
-
+
{{ task.date || 'N/A' }} |
{{ task.gameCount || 0 }} |
{{ task.practiceDay || 0 }} |
@@ -86,12 +79,14 @@ export default {
tasks: [],
originalTasks: [],
taskList: [
- {
- id: 1,
- value: 'J-11,模型-7',
- label: 'J-11,模型-7'
+ {
+ id: 1,
+ value: 'J-11,模型-7',
+ label: 'J-11,模型-7'
},
],
+ taskRQ: '',
+ taskBC: '',
};
},
watch: {
@@ -121,8 +116,29 @@ export default {
};
console.log('Confirmed:', data);
+ const currentTaskName = this.taskName;
+ if (!currentTaskName) {
+ console.warn('Task name is empty');
+ return;
+ }
+
+ const currentTaskRQ = this.taskRQ;
+ if (!currentTaskRQ) {
+ return;
+ }
+
+ const currentTaskBC = this.taskBC;
+ if (!currentTaskBC) {
+ return;
+ }
+
try {
- webrtc.webrtc.emitCommand("TaskSelected", data);
+ webrtc.webrtc.emitUIInter({
+ command: "LoadScenario",
+ rwbs: currentTaskName,
+ rq: currentTaskRQ,
+ bc: currentTaskBC
+ });
} catch (error) {
console.error('Error in emitCommand:', error);
}
@@ -149,13 +165,13 @@ export default {
console.warn('Invalid timestamp:', timestamp);
return 'Invalid Date';
}
-
+
const date = new Date(ts * 1000); // 转换为毫秒
if (date.toString() === 'Invalid Date') {
console.warn('Invalid date from timestamp:', ts);
return 'Invalid Date';
}
-
+
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
@@ -167,7 +183,7 @@ export default {
},
handleSearch() {
const currentTaskName = this.taskName;
-
+
if (!currentTaskName) {
console.warn('Task name is empty');
return;
@@ -178,13 +194,13 @@ export default {
command: "SelectScenarioTask",
task: currentTaskName
});
-
+
// 添加调试日志
console.log('Sending request with task:', currentTaskName);
-
+
webrtc.webrtc.addResponseEventListener('SelectScenarioTask', (response) => {
console.log('SelectScenarioTask response1111:', response);
-
+
try {
const parsedResponse = JSON.parse(response);
console.log('Parsed response:', parsedResponse, Array.isArray(parsedResponse.data));
@@ -195,15 +211,15 @@ export default {
date: this.formatTimestamp(Number(item.timestamp)),
gameCount: Number(item.bc) || 0,
practiceDay: Number(item.yxr) || 0,
- paramFlightCount: 0,
- paramModel: ''
+ paramFlightCount: Number(item.count) || 0,
+ paramModel: item.jx
};
console.log('Mapped item:', mappedItem);
return mappedItem;
});
-
+
console.log('Updated tasks array:', this.tasks);
-
+
// 强制更新视图
this.$forceUpdate();
} else {
@@ -214,7 +230,7 @@ export default {
console.error('Error parsing response:', parseError);
this.tasks = [];
}
-
+
webrtc.webrtc.removeResponseEventListener('SelectScenarioTask');
});
} catch (error) {
@@ -226,7 +242,7 @@ export default {
this.year = String(new Date().getFullYear());
this.taskName = '';
this.tasks = [...this.originalTasks];
-
+
try {
webrtc.webrtc.emitUIInter({
ResetTask: true
@@ -238,7 +254,7 @@ export default {
handleChangeYear() {
// 清空表格数据
this.tasks = [];
-
+
try {
webrtc.webrtc.emitUIInter({
command: "LoadScenarioTask",
@@ -254,7 +270,7 @@ export default {
value: task,
label: task
}));
-
+
// 设置默认选中的任务名称
if (this.taskList.length > 0) {
this.taskName = this.taskList[0].value;
@@ -273,6 +289,13 @@ export default {
console.error('Error in emitUIInter:', error);
}
},
+ getCurrentRow(task) {
+ this.currentRow = task;
+ console.log('Current Row:', this.currentRow);
+
+ this.taskRQ = task.date;
+ this.taskBC = task.gameCount;
+ },
},
created() {
this.initData();
diff --git a/web/src/webrtc.js b/web/src/webrtc.js
index 43570e1..aebc80a 100644
--- a/web/src/webrtc.js
+++ b/web/src/webrtc.js
@@ -1865,7 +1865,7 @@ function connect() {
}
// ws = new WebSocket("ws://localhost/");
// ws = new WebSocket(window.location.href.replace('http://', 'ws://').replace('https://', 'wss://'));
- let connectionUrl = window.location.href.replace('http://', 'ws://').replace('https://', 'wss://').replace(/:\d+/, '');
+ let connectionUrl = window.location.href.replace('http://', 'ws://').replace('https://', 'wss://').replace(/:\d+/, ':8000');
console.log(`Creating a websocket connection to: ${connectionUrl}`);
ws = new WebSocket(connectionUrl);
ws.attemptStreamReconnection = true;