Commit b72e3d42 by 周田

fix:修复小问题

parent 677c608e
No preview for this file type
......@@ -57,8 +57,10 @@ onMounted(() => {
}
}
axios.get('/api/device_communication/performance/' + props.type + '/' + props.protocolName)
axios.get('/api/device_communication/performance/' + props.type + '/' + props.protocolName + '/')
.then((res) => {
console.log("table title", res.data);
tableTitles.value = res.data
for (let key of res.data) {
tableData.value[0][key] = ''
......@@ -69,6 +71,30 @@ onMounted(() => {
})
})
onBeforeUnmount(() => {
// 关闭 websocket
if (table_websocket) {
table_websocket.close()
}
// 关闭模拟设备
if (openSimulateDevice.value && props.type === '2') {
let body = {
protocol_name: props.protocolName,
status: false,
device_name: props.devName
}
request.post('/api/change_simulate_device/', body)
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
})
}
})
const emits = defineEmits(['deleteTable'])
const del = () => {
......@@ -87,7 +113,6 @@ const changeSimulateDevice = () => {
status: openSimulateDevice.value,
device_name: props.devName
}
console.log(body);
request.post('/api/change_simulate_device/', body)
.then((res) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment