修改选择想定
This commit is contained in:
parent
5d536fdcad
commit
4e3e60950d
@ -8,15 +8,8 @@
|
||||
<div class="search-area">
|
||||
<div class="search-item">
|
||||
<label for="year">年度:</label>
|
||||
<el-date-picker
|
||||
v-model="year"
|
||||
type="year"
|
||||
placeholder="选择年"
|
||||
format="yyyy"
|
||||
value-format="yyyy"
|
||||
@change="handleChangeYear"
|
||||
class="year-picker"
|
||||
/>
|
||||
<el-date-picker v-model="year" type="year" placeholder="选择年" format="yyyy" value-format="yyyy"
|
||||
@change="handleChangeYear" class="year-picker" />
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<label for="taskName">任务名称:</label>
|
||||
@ -34,14 +27,14 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>日期</th>
|
||||
<th>游戏数</th>
|
||||
<th>练习日</th>
|
||||
<th>参数飞行数</th>
|
||||
<th>参数模型</th>
|
||||
<th>波次数</th>
|
||||
<th>演戏日</th>
|
||||
<th>参演飞机数</th>
|
||||
<th>参演机型</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(task, index) in tasks" :key="index">
|
||||
<tr v-for="(task, index) in tasks" :key="index" @click="getCurrentRow(task)">
|
||||
<td>{{ task.date || 'N/A' }}</td>
|
||||
<td>{{ task.gameCount || 0 }}</td>
|
||||
<td>{{ task.practiceDay || 0 }}</td>
|
||||
@ -92,6 +85,8 @@ export default {
|
||||
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);
|
||||
}
|
||||
@ -195,8 +211,8 @@ 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;
|
||||
@ -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();
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user