diff --git a/src/views/iot/plugin/detail/index.vue b/src/views/iot/plugin/detail/index.vue index b5f69e6d..f91e19d5 100644 --- a/src/views/iot/plugin/detail/index.vue +++ b/src/views/iot/plugin/detail/index.vue @@ -33,13 +33,19 @@ + 上传插件包 + + + + + import { PluginInfoApi, PluginInfoVO } from '@/api/iot/plugininfo' import { useRoute } from 'vue-router' -import { ref, onMounted } from 'vue' +import { onMounted, ref } from 'vue' import PluginImportForm from './PluginImportForm.vue' const message = useMessage() @@ -70,6 +76,7 @@ const pluginInfo = ref({ config: '', script: '' }) +// TODO @haohao:这里可以改成 pluginInfo.id > 0 去判断,然后 handleStatusChange disable 按钮 const isInitialLoad = ref(true) // 初始化标志位 onMounted(() => { @@ -81,9 +88,9 @@ onMounted(() => { } }) +/** 获取插件详情 */ const getPluginInfo = async (id: number) => { - const data = await PluginInfoApi.getPluginInfo(id) - pluginInfo.value = data + pluginInfo.value = await PluginInfoApi.getPluginInfo(id) } /** 处理状态变更 */ @@ -100,7 +107,8 @@ const handleStatusChange = async (status: number) => { status }) message.success('更新状态成功') - getPluginInfo(Number(pluginInfo.value.id)) + // 获取详情 + await getPluginInfo(pluginInfo.value.id) } catch (error) { pluginInfo.value.status = status === 1 ? 0 : 1 message.error('更新状态失败') diff --git a/src/views/iot/plugin/index.vue b/src/views/iot/plugin/index.vue index aae5c589..fb0d1270 100644 --- a/src/views/iot/plugin/index.vue +++ b/src/views/iot/plugin/index.vue @@ -1,3 +1,4 @@ + @@ -64,7 +65,7 @@ - + @@ -144,7 +145,7 @@ - jar包 + jar 包 {{ item.fileName }} @@ -155,6 +156,7 @@ 部署方式 + 状态