Commit 975522b1 by 周田

feat:将设备的通信参数应用到 devinfo 表

parent 5f27157e
......@@ -49,7 +49,7 @@ def set_communication_to_devinfo_table(request):
if type is None or type == '':
return Response(status=status.HTTP_400_BAD_REQUEST)
if type == 'simulate':
if type == 'simulate_communicate':
communications = SimulateDeviceCommunicationParameter.objects.all()
else:
communications = DeviceCommunicationParameter.objects.all()
......
<template>
<div class="text-right mb-5">
<el-button type="primary" @click="applyComunications"> 应用 </el-button>
<el-button type="primary" @click="copy">copy to ini</el-button>
<el-button type="primary" @click="addDevice">Add device</el-button>
</div>
......@@ -127,4 +128,26 @@ function composeConfigText(): string {
}
return configText
}
// 应用设备通信参数
const applyComunications = () => {
console.log('applyComunications')
axios.post('/api/device_communication/set_communication_to_devinfo_table/', {
type: props.tabType
})
.then((res) => {
console.log(res.data);
ElMessage({
message: '应用成功',
type: 'success'
})
})
.catch((err) => {
console.log(err);
ElMessage({
message: '应用失败',
type: 'error'
})
})
}
</script>
No preview for this file type
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