Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue_django_test
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周田
vue_django_test
Commits
975522b1
Commit
975522b1
authored
Sep 04, 2023
by
周田
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:将设备的通信参数应用到 devinfo 表
parent
5f27157e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletions
+24
-1
views.py
device_communication/views.py
+1
-1
CommunicationTab.vue
.../src/components/device_communication/CommunicationTab.vue
+23
-0
xdc.sqlite
xdc.sqlite
+0
-0
No files found.
device_communication/views.py
View file @
975522b1
...
@@ -49,7 +49,7 @@ def set_communication_to_devinfo_table(request):
...
@@ -49,7 +49,7 @@ def set_communication_to_devinfo_table(request):
if
type
is
None
or
type
==
''
:
if
type
is
None
or
type
==
''
:
return
Response
(
status
=
status
.
HTTP_400_BAD_REQUEST
)
return
Response
(
status
=
status
.
HTTP_400_BAD_REQUEST
)
if
type
==
'simulate'
:
if
type
==
'simulate
_communicate
'
:
communications
=
SimulateDeviceCommunicationParameter
.
objects
.
all
()
communications
=
SimulateDeviceCommunicationParameter
.
objects
.
all
()
else
:
else
:
communications
=
DeviceCommunicationParameter
.
objects
.
all
()
communications
=
DeviceCommunicationParameter
.
objects
.
all
()
...
...
frontend/src/components/device_communication/CommunicationTab.vue
View file @
975522b1
<
template
>
<
template
>
<div
class=
"text-right mb-5"
>
<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=
"copy"
>
copy to ini
</el-button>
<el-button
type=
"primary"
@
click=
"addDevice"
>
Add device
</el-button>
<el-button
type=
"primary"
@
click=
"addDevice"
>
Add device
</el-button>
</div>
</div>
...
@@ -127,4 +128,26 @@ function composeConfigText(): string {
...
@@ -127,4 +128,26 @@ function composeConfigText(): string {
}
}
return
configText
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
>
</
script
>
xdc.sqlite
View file @
975522b1
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment