Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
bfdf7f61
authored
Feb 08, 2025
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码评审】IoT:plugin 相关的实现
parent
229594b1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
src/api/iot/plugin/index.ts
+6
-6
src/views/iot/plugin/detail/index.vue
+5
-5
No files found.
src/api/iot/plugin/index.ts
View file @
bfdf7f61
...
...
@@ -19,32 +19,32 @@ export interface PluginConfigVO {
// IoT 插件配置 API
export
const
PluginConfigApi
=
{
// 查询
IoT
插件配置分页
// 查询插件配置分页
getPluginConfigPage
:
async
(
params
:
any
)
=>
{
return
await
request
.
get
({
url
:
`/iot/plugin-config/page`
,
params
})
},
// 查询
IoT
插件配置详情
// 查询插件配置详情
getPluginConfig
:
async
(
id
:
number
)
=>
{
return
await
request
.
get
({
url
:
`/iot/plugin-config/get?id=`
+
id
})
},
// 新增
IoT
插件配置
// 新增插件配置
createPluginConfig
:
async
(
data
:
PluginConfigVO
)
=>
{
return
await
request
.
post
({
url
:
`/iot/plugin-config/create`
,
data
})
},
// 修改
IoT
插件配置
// 修改插件配置
updatePluginConfig
:
async
(
data
:
PluginConfigVO
)
=>
{
return
await
request
.
put
({
url
:
`/iot/plugin-config/update`
,
data
})
},
// 删除
IoT
插件配置
// 删除插件配置
deletePluginConfig
:
async
(
id
:
number
)
=>
{
return
await
request
.
delete
({
url
:
`/iot/plugin-config/delete?id=`
+
id
})
},
// 修改
IoT
插件状态
// 修改插件状态
updatePluginStatus
:
async
(
data
:
any
)
=>
{
return
await
request
.
put
({
url
:
`/iot/plugin-config/update-status`
,
data
})
}
...
...
src/views/iot/plugin/detail/index.vue
View file @
bfdf7f61
...
...
@@ -4,7 +4,7 @@
<div>
<el-col>
<el-row>
<span
class=
"text-xl font-bold"
>
插件
详情
</span>
<span
class=
"text-xl font-bold"
>
插件
配置
</span>
</el-row>
</el-col>
</div>
...
...
@@ -42,7 +42,7 @@
</ContentWrap>
</div>
<!-- TODO @haohao:待完成:配置管理 -->
<!-- TODO @haohao:待完成:script 管理 -->
<!-- TODO @haohao:待完成:script 管理
;可以最后搞
-->
<!-- TODO @haohao:插件实例的前端展示:底部要不要加个分页,展示运行中的实力?默认勾选,只展示 state 为在线的 -->
<!-- 插件导入对话框 -->
...
...
@@ -77,7 +77,7 @@ const pluginConfig = ref<PluginConfigVO>({
script
:
''
})
/** 获取插件
详情
*/
/** 获取插件
配置
*/
const
getPluginConfig
=
async
(
id
:
number
)
=>
{
pluginConfig
.
value
=
await
PluginConfigApi
.
getPluginConfig
(
id
)
}
...
...
@@ -96,7 +96,7 @@ const handleStatusChange = async (status: number) => {
status
})
message
.
success
(
'更新状态成功'
)
// 获取
详情
// 获取
配置
await
getPluginConfig
(
pluginConfig
.
value
.
id
)
}
catch
(
error
)
{
pluginConfig
.
value
.
status
=
status
===
1
?
0
:
1
...
...
@@ -110,7 +110,7 @@ const handleImport = () => {
importFormRef
.
value
.
open
()
}
/** 初始化插件
详情
*/
/** 初始化插件
配置
*/
onMounted
(()
=>
{
const
id
=
Number
(
route
.
params
.
id
)
if
(
id
)
{
...
...
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