diff --git a/src/api/iot/plugininfo/index.ts b/src/api/iot/plugininfo/index.ts index 21dfce424..49a79bbfb 100644 --- a/src/api/iot/plugininfo/index.ts +++ b/src/api/iot/plugininfo/index.ts @@ -7,7 +7,7 @@ export interface PluginInfoVO { name: string // 插件名称 description: string // 描述 deployType: number // 部署方式 - file: string // 插件包文件名 + fileName: string // 插件包文件名 version: string // 插件版本 type: number // 插件类型 protocol: string // 设备插件协议类型 diff --git a/src/views/iot/plugin/detail/index.vue b/src/views/iot/plugin/detail/index.vue index 9b4029247..b5f69e6d0 100644 --- a/src/views/iot/plugin/detail/index.vue +++ b/src/views/iot/plugin/detail/index.vue @@ -55,7 +55,21 @@ import PluginImportForm from './PluginImportForm.vue' const message = useMessage() const route = useRoute() -const pluginInfo = ref({}) +const pluginInfo = ref({ + id: 0, + pluginKey: '', + name: '', + description: '', + version: '', + status: 0, + deployType: 0, + fileName: '', + type: 0, + protocol: '', + configSchema: '', + config: '', + script: '' +}) const isInitialLoad = ref(true) // 初始化标志位 onMounted(() => { @@ -98,4 +112,4 @@ const importFormRef = ref() const handleImport = () => { importFormRef.value.open() } - \ No newline at end of file + diff --git a/src/views/iot/plugin/index.vue b/src/views/iot/plugin/index.vue index 3cd5f94a1..eeecd79c0 100644 --- a/src/views/iot/plugin/index.vue +++ b/src/views/iot/plugin/index.vue @@ -33,6 +33,16 @@ /> + + + + + + + + + + 搜索 重置 @@ -50,57 +60,154 @@ - - - - - - - - - - - - - - + - - +
+ +
+
+ +
+
{{ item.name }}
+
+ + +
+
+
+ 插件标识 + {{ + item.pluginKey + }} +
+
+ jar包 + {{ item.fileName }} +
+
+ 版本号 + {{ item.version }} +
+
+ 部署方式 + +
+
+ 状态 + +
+
+
+ + + + + +
+ + + 编辑 + + + + 详情 + +
+ + + +
+
+ + + + + ('card') // 视图模式状态 /** 查询列表 */ const getList = async () => { @@ -186,6 +295,23 @@ const handleDelete = async (id: number) => { } catch {} } +/** 处理状态变更 */ +const handleStatusChange = async (id: number, status: number) => { + try { + // 修改状态的二次确认 + const text = status === 1 ? '启用' : '停用' + await message.confirm('确认要"' + text + '"插件吗?') + await PluginInfoApi.updatePluginStatus({ + id: id, + status + }) + message.success('更新状态成功') + getList() + } catch (error) { + message.error('更新状态失败') + } +} + /** 初始化 **/ onMounted(() => { getList()