From 77e0a763891007befafe8e73dbf671b3318df1aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E6=B5=A9=E6=B5=A9?= <1036606149@qq.com> Date: Wed, 1 Jan 2025 20:41:59 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E3=80=91IOT:=20=E6=9B=B4=E6=96=B0=E6=8F=92=E4=BB=B6=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=AD=97=E6=AE=B5=E5=90=8D=E4=B8=BA=E2=80=9CfileName?= =?UTF-8?q?=E2=80=9D=EF=BC=8C=E6=96=B0=E5=A2=9E=E8=A7=86=E5=9B=BE=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E5=88=87=E6=8D=A2=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=8F=92=E4=BB=B6=E8=AF=A6=E6=83=85=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot/plugininfo/index.ts | 2 +- src/views/iot/plugin/detail/index.vue | 18 +- src/views/iot/plugin/index.vue | 226 ++++++++++++++++++++------ 3 files changed, 193 insertions(+), 53 deletions(-) diff --git a/src/api/iot/plugininfo/index.ts b/src/api/iot/plugininfo/index.ts index 21dfce42..49a79bbf 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 9b402924..b5f69e6d 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 3cd5f94a..eeecd79c 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()