33
33
</el-descriptions-item >
34
34
</el-descriptions >
35
35
</ContentWrap >
36
+ <!-- TODO @haohao:如果是独立部署,也是通过上传插件包哇? -->
36
37
<ContentWrap class =" mt-10px" >
37
38
<el-button type =" warning" plain @click =" handleImport" v-hasPermi =" ['system:user:import']" >
38
39
<Icon icon =" ep:upload" /> 上传插件包
39
40
</el-button >
40
41
</ContentWrap >
41
42
</div >
43
+ <!-- TODO @haohao:待完成:配置管理 -->
44
+ <!-- TODO @haohao:待完成:script 管理 -->
45
+ <!-- TODO @haohao:插件实例的前端展示:底部要不要加个分页,展示运行中的实力?默认勾选,只展示 state 为在线的 -->
46
+
42
47
<!-- 插件导入对话框 -->
48
+ <!-- TODO @haohao:Number 尽量不用。因为有用户会使用 snowflake、或者 string 的时候,会有问题 -->
43
49
<PluginImportForm
44
50
ref =" importFormRef"
45
51
:id =" Number(pluginInfo.id)"
50
56
<script lang="ts" setup>
51
57
import { PluginInfoApi , PluginInfoVO } from ' @/api/iot/plugininfo'
52
58
import { useRoute } from ' vue-router'
53
- import { ref , onMounted } from ' vue'
59
+ import { onMounted , ref } from ' vue'
54
60
import PluginImportForm from ' ./PluginImportForm.vue'
55
61
56
62
const message = useMessage ()
@@ -70,6 +76,7 @@ const pluginInfo = ref<PluginInfoVO>({
70
76
config: ' ' ,
71
77
script: ' '
72
78
})
79
+ // TODO @haohao:这里可以改成 pluginInfo.id > 0 去判断,然后 handleStatusChange disable 按钮
73
80
const isInitialLoad = ref (true ) // 初始化标志位
74
81
75
82
onMounted (() => {
@@ -81,9 +88,9 @@ onMounted(() => {
81
88
}
82
89
})
83
90
91
+ /** 获取插件详情 */
84
92
const getPluginInfo = async (id : number ) => {
85
- const data = await PluginInfoApi .getPluginInfo (id )
86
- pluginInfo .value = data
93
+ pluginInfo .value = await PluginInfoApi .getPluginInfo (id )
87
94
}
88
95
89
96
/** 处理状态变更 */
@@ -100,7 +107,8 @@ const handleStatusChange = async (status: number) => {
100
107
status
101
108
})
102
109
message .success (' 更新状态成功' )
103
- getPluginInfo (Number (pluginInfo .value .id ))
110
+ // 获取详情
111
+ await getPluginInfo (pluginInfo .value .id )
104
112
} catch (error ) {
105
113
pluginInfo .value .status = status === 1 ? 0 : 1
106
114
message .error (' 更新状态失败' )
0 commit comments