|
@@ -62,7 +62,7 @@
|
62
|
62
|
</el-table-column>
|
63
|
63
|
</el-table>
|
64
|
64
|
|
65
|
|
- <el-dialog title="添加小程序模板" width="80%"
|
|
65
|
+ <el-dialog title="发送蓝牙数据" width="80%"
|
66
|
66
|
:close-on-click-modal="false"
|
67
|
67
|
:visible.sync="validate"
|
68
|
68
|
:modal-append-to-body="false"
|
|
@@ -81,7 +81,23 @@
|
81
|
81
|
<el-button @click="stopCollection">停止采集</el-button>
|
82
|
82
|
<el-button @click="resetDevice">复位</el-button>
|
83
|
83
|
</div>
|
84
|
|
-
|
|
84
|
+ <el-row>
|
|
85
|
+ <el-col :span="8">
|
|
86
|
+ <div class="grid-content bg-purple">
|
|
87
|
+ <span>请输入指令(hex):</span>
|
|
88
|
+ </div>
|
|
89
|
+ </el-col>
|
|
90
|
+ <el-col :span="8">
|
|
91
|
+ <div class="grid-content bg-purple-light">
|
|
92
|
+ <el-input v-model="inputData" placeholder="请输入内容"></el-input>
|
|
93
|
+ </div>
|
|
94
|
+ </el-col>
|
|
95
|
+ <el-col :span="8">
|
|
96
|
+ <div class="grid-content bg-purple">
|
|
97
|
+ <el-button @click="sendInputData">发送</el-button>
|
|
98
|
+ </div>
|
|
99
|
+ </el-col>
|
|
100
|
+ </el-row>
|
85
|
101
|
<div style="padding-bottom: 20px">
|
86
|
102
|
<div style="width:140px;height:140px;position:relative;margin-top:30px" >
|
87
|
103
|
<div ref="heatsample" style="width:540px;height:540px;position:absolute;top:0;left:0" />
|
|
@@ -109,6 +125,7 @@
|
109
|
125
|
localName:typeof (this.$route.query.localName) =='undefined' ?'N/A':this.$route.query.localName,
|
110
|
126
|
validate:false,
|
111
|
127
|
sendData:'',
|
|
128
|
+ inputData:'04 00 02 00'
|
112
|
129
|
}
|
113
|
130
|
},
|
114
|
131
|
created() {
|
|
@@ -168,9 +185,11 @@
|
168
|
185
|
for(let j of properties) {
|
169
|
186
|
if (j=='write'||j=='read') {
|
170
|
187
|
flag ++
|
|
188
|
+ } else if(j == 'notify') {
|
|
189
|
+ flag += 2
|
171
|
190
|
}
|
172
|
191
|
}
|
173
|
|
- if(flag == 1) {
|
|
192
|
+ if(flag >= 1) {
|
174
|
193
|
bRes = true
|
175
|
194
|
}
|
176
|
195
|
return bRes
|
|
@@ -215,9 +234,21 @@
|
215
|
234
|
},
|
216
|
235
|
resetDevice() {
|
217
|
236
|
this.$socket.emit('sendBleData', {type: 'resetDevice'})
|
|
237
|
+ },
|
|
238
|
+ sendInputData() {
|
|
239
|
+ if(this.inputData =='') {
|
|
240
|
+ this.errorNotify('输入指令值不能为空')
|
|
241
|
+ } else {
|
|
242
|
+ // 16进制数操作
|
|
243
|
+ let arr = this.inputData.trim().split(" ");
|
|
244
|
+ let data = []
|
|
245
|
+ for(let j of arr) {
|
|
246
|
+ data.push(parseInt(j,16))
|
|
247
|
+ }
|
|
248
|
+ this.$socket.emit('sendBleData', {type: 'sendOwnData',data:Buffer(data)})
|
|
249
|
+ }
|
218
|
250
|
}
|
219
|
251
|
|
220
|
|
-
|
221
|
252
|
},
|
222
|
253
|
computed: {
|
223
|
254
|
...mapGetters([
|