From e6a5bb0293843e6a645c3d02c2568be68521a9f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E6=B5=A9=E6=B5=A9?= <1036606149@qq.com> Date: Mon, 30 Dec 2024 12:03:30 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E3=80=91IOT:=20=E6=B7=BB=E5=8A=A0=E6=8F=92=E4=BB=B6=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=8C=85=E6=8B=AC=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E5=88=97=E8=A1=A8=E3=80=81=E8=AF=A6=E6=83=85=E3=80=81?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9B=B4=E6=96=B0=E5=8F=8A=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot/plugininfo/index.ts | 10 ++ src/router/modules/remaining.ts | 11 ++ .../{plugininfo => plugin}/PluginInfoForm.vue | 0 .../iot/plugin/detail/PluginImportForm.vue | 99 +++++++++++++++++ src/views/iot/plugin/detail/index.vue | 101 ++++++++++++++++++ .../iot/{plugininfo => plugin}/index.vue | 98 +++-------------- src/views/iot/plugininfo/detail.vue | 44 -------- 7 files changed, 238 insertions(+), 125 deletions(-) rename src/views/iot/{plugininfo => plugin}/PluginInfoForm.vue (100%) create mode 100644 src/views/iot/plugin/detail/PluginImportForm.vue create mode 100644 src/views/iot/plugin/detail/index.vue rename src/views/iot/{plugininfo => plugin}/index.vue (67%) delete mode 100644 src/views/iot/plugininfo/detail.vue diff --git a/src/api/iot/plugininfo/index.ts b/src/api/iot/plugininfo/index.ts index 03229f70..91459063 100644 --- a/src/api/iot/plugininfo/index.ts +++ b/src/api/iot/plugininfo/index.ts @@ -47,5 +47,15 @@ export const PluginInfoApi = { // 导出IoT 插件信息 Excel exportPluginInfo: async (params) => { return await request.download({ url: `/iot/plugin-info/export-excel`, params }) + }, + + // 修改IoT 插件状态 + updatePluginStatus: async (data: any) => { + return await request.put({ url: `/iot/plugin-info/update-status`, data }) + }, + + // 上传Jar包 + uploadPluginFile: async (data: any) => { + return await request.post({ url: `/iot/plugin-info/upload-file`, data }) } } diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 8b4bbe0e..2619e6bf 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -638,6 +638,17 @@ const remainingRouter: AppRouteRecordRaw[] = [ activeMenu: '/iot/device' }, component: () => import('@/views/iot/device/device/detail/index.vue') + }, + { + path: 'plugin/detail/:id', + name: 'IoTPluginDetail', + meta: { + title: '插件详情', + noCache: true, + hidden: true, + activeMenu: '/iot/plugin' + }, + component: () => import('@/views/iot/plugin/detail/index.vue') } ] } diff --git a/src/views/iot/plugininfo/PluginInfoForm.vue b/src/views/iot/plugin/PluginInfoForm.vue similarity index 100% rename from src/views/iot/plugininfo/PluginInfoForm.vue rename to src/views/iot/plugin/PluginInfoForm.vue diff --git a/src/views/iot/plugin/detail/PluginImportForm.vue b/src/views/iot/plugin/detail/PluginImportForm.vue new file mode 100644 index 00000000..a0594444 --- /dev/null +++ b/src/views/iot/plugin/detail/PluginImportForm.vue @@ -0,0 +1,99 @@ + + + + + 将文件拖到此处,或点击上传 + + + 确 定 + 取 消 + + + + diff --git a/src/views/iot/plugin/detail/index.vue b/src/views/iot/plugin/detail/index.vue new file mode 100644 index 00000000..83eadc63 --- /dev/null +++ b/src/views/iot/plugin/detail/index.vue @@ -0,0 +1,101 @@ + + + + + + + 插件详情 + + + + + + + + {{ pluginInfo.name }} + + + {{ pluginInfo.pluginId }} + + + {{ pluginInfo.version }} + + + + + + {{ pluginInfo.description }} + + + + + + 上传插件包 + + + + + + + + \ No newline at end of file diff --git a/src/views/iot/plugininfo/index.vue b/src/views/iot/plugin/index.vue similarity index 67% rename from src/views/iot/plugininfo/index.vue rename to src/views/iot/plugin/index.vue index 5591cef4..0f64bc8d 100644 --- a/src/views/iot/plugininfo/index.vue +++ b/src/views/iot/plugin/index.vue @@ -45,25 +45,11 @@ 新增 - - - - - - - - - - - - + @@ -88,6 +74,14 @@ /> + + 查看 + 删除 - - 详情 - @@ -123,57 +110,6 @@ /> - - - - - - - {{ item.name }} - 组件ID: {{ item.pluginId }} - - - - Jar包: {{ item.file }} - 版本号: {{ item.version }} - 部署方式: - 状态: - - - - 编辑 - - - 删除 - - - - - - - - @@ -185,7 +121,7 @@ import { PluginInfoApi, PluginInfoVO } from '@/api/iot/plugininfo' import PluginInfoForm from './PluginInfoForm.vue' /** IoT 插件信息 列表 */ -defineOptions({ name: 'PluginInfo' }) +defineOptions({ name: 'IoTPlugin' }) const message = useMessage() // 消息弹窗 const { t } = useI18n() // 国际化 @@ -200,7 +136,6 @@ const queryParams = reactive({ status: undefined }) const queryFormRef = ref() // 搜索的表单 -const viewType = ref<'card' | 'table'>('table') // 视图类型,默认为表格视图 /** 查询列表 */ const getList = async () => { @@ -232,6 +167,12 @@ const openForm = (type: string, id?: number) => { formRef.value.open(type, id) } +/** 打开详情 */ +const { push } = useRouter() +const openDetail = (id: number) => { + push({ name: 'IoTPluginDetail', params: { id } }) +} + /** 删除按钮操作 */ const handleDelete = async (id: number) => { try { @@ -245,13 +186,8 @@ const handleDelete = async (id: number) => { } catch {} } -/** 查看详情操作 */ -const viewDetail = (id: number) => { - router.push({ path: `/iot/plugininfo/detail/${id}` }) -} - /** 初始化 **/ onMounted(() => { getList() }) - \ No newline at end of file + diff --git a/src/views/iot/plugininfo/detail.vue b/src/views/iot/plugininfo/detail.vue deleted file mode 100644 index 2f3f02f9..00000000 --- a/src/views/iot/plugininfo/detail.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - - {{ pluginInfo.name }} - {{ pluginInfo.pluginId }} - {{ pluginInfo.file }} - {{ pluginInfo.version }} - - - - - - - - 返回 - - - -