Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
seeta-device
/
deviceManage
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit cb3bb85a
authored
Nov 05, 2021
by
李俊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增删除设备和联调接口
1 parent
7c14ee4b
Pipeline
#5803
passed
in 2 minutes 11 seconds
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
7 deletions
src/axios.js
src/views/DeviceList/detail.vue
src/views/DeviceList/deviceService/components/GetParams.vue
src/views/DeviceList/index.vue
src/axios.js
View file @
cb3bb85
...
...
@@ -48,6 +48,7 @@ export const postServiceRequest = data => axios(POST, FRONT + DEVICE + '/service
export
const
postServiceCommand
=
data
=>
axios
(
POST
,
FRONT
+
DEVICE
+
'/service/command'
,
data
)
export
const
addTemplate
=
data
=>
axios
(
POST
,
FRONT
+
DEVICE
+
'/service/template/dispatch'
,
data
)
export
const
deleteTemplate
=
data
=>
axios
(
POST
,
FRONT
+
DEVICE
+
'/service/template/revoke'
,
data
)
export
const
deleteDevice
=
data
=>
axios
(
POST
,
FRONT
+
DEVICE
+
'/delete'
,
data
)
const
SERVICE
=
'/service'
export
const
getService
=
data
=>
axios
(
POST
,
FRONT
+
SERVICE
+
'/query_list'
,
data
)
...
...
src/views/DeviceList/detail.vue
View file @
cb3bb85
...
...
@@ -78,7 +78,7 @@
</el-tooltip>
</div>
<div
slot=
'operate'
slot-scope=
"row"
>
<span
class=
"operate-text operate-delete"
@
click=
"delete(row.id)"
>
{{ '删除 '}}
</span>
<span
class=
"operate-text operate-delete"
@
click=
"delete
Device
(row.id)"
>
{{ '删除 '}}
</span>
</div>
</st-table>
<p
class=
"table-title"
>
{{'包含服务'}}
</p>
...
...
@@ -129,7 +129,7 @@ import browserStorage from '@/services/local-storage'
import
Dialog
from
'@/helpers/dialog'
import
validate
from
'@/components/seeta-ui/seeta-form/validator'
import
{
rTimeMin
,
copyText
}
from
'@/utils/system.js'
import
{
getServiceDevice
,
deleteTag
,
addTag
}
from
'@/axios'
import
{
getServiceDevice
,
deleteTag
,
addTag
,
deleteDevice
}
from
'@/axios'
export
default
{
data
()
{
return
{
...
...
@@ -348,7 +348,16 @@ export default {
// 跳转到设备详情页面
detail
(
id
)
{
},
delete
(
id
)
{
async
deleteDevice
(
id
)
{
const
confirmDelete
=
await
Dialog
.
confirm
(
'提示'
,
{
message
:
'确认删除设备?删除设备时,也会删除此设备上的所有服务,还会取消相应的参数模板和服务配置的参数。'
})
if
(
!
confirmDelete
)
return
const
res
=
await
deleteDevice
({
deviceid
:
this
.
currentDeviceId
})
if
(
res
)
{
this
.
$message
({
message
:
'删除成功'
,
type
:
'success'
})
}
},
async
getData
()
{
const
res
=
await
getServiceDevice
({
deviceid
:
this
.
currentDeviceId
})
...
...
src/views/DeviceList/deviceService/components/GetParams.vue
View file @
cb3bb85
...
...
@@ -14,11 +14,11 @@
<div
class=
"list-item-content"
>
<div>
<span>
{{
'AppKey:'
}}
</span>
<st-input
width=
"240px"
class=
"list-item-input"
v-model
=
"currentService.appid"
show-password
></st-input>
<st-input
width=
"240px"
class=
"list-item-input"
:value
=
"currentService.appid"
show-password
></st-input>
</div>
<div>
<span>
{{
'Secret:'
}}
</span>
<st-input
width=
"240px"
class=
"list-item-input"
v-model
=
"currentService.secretkey"
show-password
></st-input>
<st-input
width=
"240px"
class=
"list-item-input"
:value
=
"currentService.secretkey"
show-password
></st-input>
</div>
<!--
<div
class=
"list-item-icon"
>
<i
class=
"el-icon-view blue-text"
></i>
...
...
@@ -521,6 +521,9 @@ export default {
row
.
isBack
=
true
this
.
$set
(
this
.
tokenList
,
index
,
JSON
.
parse
(
JSON
.
stringify
(
row
)))
},
disableInput
()
{
return
false
},
async
deleteRow
(
index
)
{
const
confirmDelete
=
await
Dialog
.
confirm
(
'提示'
,
{
message
:
'确认删除?'
})
if
(
!
confirmDelete
)
return
...
...
src/views/DeviceList/index.vue
View file @
cb3bb85
...
...
@@ -8,7 +8,7 @@
<div
class=
"flex-left"
>
<div
class=
"search-item"
>
<span
class=
"search-title"
>
状态:
</span>
<el-checkbox-group
v-model=
"search.checkList"
class=
"inline-div"
@
change=
"handleChangeSearch"
>
<el-checkbox-group
:max=
"1"
v-model=
"search.checkList"
class=
"inline-div"
@
change=
"handleChangeSearch"
>
<el-checkbox
:label=
"1"
class=
"check-title"
>
在线
</el-checkbox>
<el-checkbox
:label=
"0"
class=
"check-title"
>
离线
</el-checkbox>
<el-checkbox
:label=
"2"
class=
"check-title"
>
异常
</el-checkbox>
...
...
@@ -417,7 +417,7 @@ export default {
},
async
getData
()
{
const
res
=
await
getDevice
({
state
:
this
.
search
.
checkList
,
state
:
this
.
search
.
checkList
?
this
.
search
.
checkList
[
0
]
:
''
,
pages
:
this
.
pi
,
pagesize
:
this
.
ps
,
structure
:
this
.
search
.
structure
,
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment