|
@@ -7,14 +7,13 @@
|
|
<!-- 任务、消息、提醒、超期 -->
|
|
<!-- 任务、消息、提醒、超期 -->
|
|
<Panel :data-list="panelList"
|
|
<Panel :data-list="panelList"
|
|
@click="gotoNewRw"></Panel>
|
|
@click="gotoNewRw"></Panel>
|
|
- <div v-show="true">
|
|
|
|
- <el-button @click="test()">test</el-button>
|
|
|
|
- <el-button @click="test1()">test1</el-button>
|
|
|
|
|
|
+ <div v-show="false">
|
|
|
|
+ <el-input v-model="param"/>
|
|
<el-button @click="openPort()">openPort</el-button>
|
|
<el-button @click="openPort()">openPort</el-button>
|
|
<el-button @click="closePort()">closePort</el-button>
|
|
<el-button @click="closePort()">closePort</el-button>
|
|
<div>{{text}}</div>
|
|
<div>{{text}}</div>
|
|
</div>
|
|
</div>
|
|
- <!-- <img style='width:100%;margin-top:10px;' src="../../../public/img/tmt.gif" alt=""> -->
|
|
|
|
|
|
+ <img style='width:100%;margin-top:10px;' src="../../../public/img/tmt.gif" alt="">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="mapXY"></div>
|
|
<div id="mapXY"></div>
|
|
@@ -120,7 +119,8 @@ export default {
|
|
vesselBankFlag: sessionStorage.getItem('ws-pf_vesselBankFlag'),
|
|
vesselBankFlag: sessionStorage.getItem('ws-pf_vesselBankFlag'),
|
|
shezhiVal: '',
|
|
shezhiVal: '',
|
|
text:"数据",
|
|
text:"数据",
|
|
- reader:null
|
|
|
|
|
|
+ reader:null,
|
|
|
|
+ param:9600
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -547,8 +547,9 @@ export default {
|
|
if ('serial' in navigator) {
|
|
if ('serial' in navigator) {
|
|
// The Web Serial API is supported.
|
|
// The Web Serial API is supported.
|
|
console.log('the Web Serial API is supported.');
|
|
console.log('the Web Serial API is supported.');
|
|
|
|
+ console.log(this.param);
|
|
const port = await navigator.serial.requestPort();
|
|
const port = await navigator.serial.requestPort();
|
|
- await port.open({ baudRate: 9600 }); // set baud rate
|
|
|
|
|
|
+ await port.open({ baudRate: this.param }); // set baud rate
|
|
this.reader = port.readable.getReader();
|
|
this.reader = port.readable.getReader();
|
|
// 监听来自串行设备的数据
|
|
// 监听来自串行设备的数据
|
|
while (true) {
|
|
while (true) {
|