From 229594b159d5e6ce5470685e1837406d1ea034ec 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, 5 Feb 2025 23:02:06 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E9=87=8D=E6=9E=84?=
=?UTF-8?q?=E3=80=91IoT=EF=BC=9A=E9=87=8D=E6=9E=84=E6=8F=92=E4=BB=B6?=
=?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=AE=A1=E7=90=86=EF=BC=8C=E6=9B=BF=E6=8D=A2?=
=?UTF-8?q?=20PluginInfo=20=E4=B8=BA=20PluginConfig?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/iot/plugin/index.ts | 51 ++++++++++++++++
src/api/iot/plugininfo/index.ts | 61 -------------------
...luginInfoForm.vue => PluginConfigForm.vue} | 16 ++---
.../iot/plugin/detail/PluginImportForm.vue | 2 +-
src/views/iot/plugin/detail/index.vue | 53 ++++++++--------
src/views/iot/plugin/index.vue | 55 +++++++++--------
6 files changed, 116 insertions(+), 122 deletions(-)
create mode 100644 src/api/iot/plugin/index.ts
delete mode 100644 src/api/iot/plugininfo/index.ts
rename src/views/iot/plugin/{PluginInfoForm.vue => PluginConfigForm.vue} (88%)
diff --git a/src/api/iot/plugin/index.ts b/src/api/iot/plugin/index.ts
new file mode 100644
index 00000000..114dc981
--- /dev/null
+++ b/src/api/iot/plugin/index.ts
@@ -0,0 +1,51 @@
+import request from '@/config/axios'
+
+// IoT 插件配置 VO
+export interface PluginConfigVO {
+ id: number // 主键ID
+ pluginKey: string // 插件标识
+ name: string // 插件名称
+ description: string // 描述
+ deployType: number // 部署方式
+ fileName: string // 插件包文件名
+ version: string // 插件版本
+ type: number // 插件类型
+ protocol: string // 设备插件协议类型
+ status: number // 状态
+ configSchema: string // 插件配置项描述信息
+ config: string // 插件配置信息
+ script: string // 插件脚本
+}
+
+// IoT 插件配置 API
+export const PluginConfigApi = {
+ // 查询IoT 插件配置分页
+ getPluginConfigPage: async (params: any) => {
+ return await request.get({ url: `/iot/plugin-config/page`, params })
+ },
+
+ // 查询IoT 插件配置详情
+ getPluginConfig: async (id: number) => {
+ return await request.get({ url: `/iot/plugin-config/get?id=` + id })
+ },
+
+ // 新增IoT 插件配置
+ createPluginConfig: async (data: PluginConfigVO) => {
+ return await request.post({ url: `/iot/plugin-config/create`, data })
+ },
+
+ // 修改IoT 插件配置
+ updatePluginConfig: async (data: PluginConfigVO) => {
+ return await request.put({ url: `/iot/plugin-config/update`, data })
+ },
+
+ // 删除IoT 插件配置
+ deletePluginConfig: async (id: number) => {
+ return await request.delete({ url: `/iot/plugin-config/delete?id=` + id })
+ },
+
+ // 修改IoT 插件状态
+ updatePluginStatus: async (data: any) => {
+ return await request.put({ url: `/iot/plugin-config/update-status`, data })
+ }
+}
diff --git a/src/api/iot/plugininfo/index.ts b/src/api/iot/plugininfo/index.ts
deleted file mode 100644
index 49a79bbf..00000000
--- a/src/api/iot/plugininfo/index.ts
+++ /dev/null
@@ -1,61 +0,0 @@
-import request from '@/config/axios'
-
-// IoT 插件信息 VO
-export interface PluginInfoVO {
- id: number // 主键ID
- pluginKey: string // 插件标识
- name: string // 插件名称
- description: string // 描述
- deployType: number // 部署方式
- fileName: string // 插件包文件名
- version: string // 插件版本
- type: number // 插件类型
- protocol: string // 设备插件协议类型
- status: number // 状态
- configSchema: string // 插件配置项描述信息
- config: string // 插件配置信息
- script: string // 插件脚本
-}
-
-// IoT 插件信息 API
-export const PluginInfoApi = {
- // 查询IoT 插件信息分页
- getPluginInfoPage: async (params: any) => {
- return await request.get({ url: `/iot/plugin-info/page`, params })
- },
-
- // 查询IoT 插件信息详情
- getPluginInfo: async (id: number) => {
- return await request.get({ url: `/iot/plugin-info/get?id=` + id })
- },
-
- // 新增IoT 插件信息
- createPluginInfo: async (data: PluginInfoVO) => {
- return await request.post({ url: `/iot/plugin-info/create`, data })
- },
-
- // 修改IoT 插件信息
- updatePluginInfo: async (data: PluginInfoVO) => {
- return await request.put({ url: `/iot/plugin-info/update`, data })
- },
-
- // 删除IoT 插件信息
- deletePluginInfo: async (id: number) => {
- return await request.delete({ url: `/iot/plugin-info/delete?id=` + id })
- },
-
- // 导出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/views/iot/plugin/PluginInfoForm.vue b/src/views/iot/plugin/PluginConfigForm.vue
similarity index 88%
rename from src/views/iot/plugin/PluginInfoForm.vue
rename to src/views/iot/plugin/PluginConfigForm.vue
index 8c8233c9..b4f51029 100644
--- a/src/views/iot/plugin/PluginInfoForm.vue
+++ b/src/views/iot/plugin/PluginConfigForm.vue
@@ -29,10 +29,10 @@
\ No newline at end of file
+
diff --git a/src/views/iot/plugin/detail/PluginImportForm.vue b/src/views/iot/plugin/detail/PluginImportForm.vue
index a0594444..2d3b7517 100644
--- a/src/views/iot/plugin/detail/PluginImportForm.vue
+++ b/src/views/iot/plugin/detail/PluginImportForm.vue
@@ -36,7 +36,7 @@ const dialogVisible = ref(false) // 弹窗的是否展示
const formLoading = ref(false) // 表单的加载中
const uploadRef = ref()
const importUrl =
- import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/iot/plugin-info/upload-file'
+ import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/iot/plugin-config/upload-file'
const uploadHeaders = ref() // 上传 Header 头
const fileList = ref([]) // 文件列表
diff --git a/src/views/iot/plugin/detail/index.vue b/src/views/iot/plugin/detail/index.vue
index f91e19d5..b322dc4c 100644
--- a/src/views/iot/plugin/detail/index.vue
+++ b/src/views/iot/plugin/detail/index.vue
@@ -12,24 +12,25 @@
- {{ pluginInfo.name }}
+ {{ pluginConfig.name }}
- {{ pluginInfo.pluginKey }}
+ {{ pluginConfig.pluginKey }}
- {{ pluginInfo.version }}
+ {{ pluginConfig.version }}
- {{ pluginInfo.description }}
+ {{ pluginConfig.description }}
@@ -45,23 +46,22 @@
-
diff --git a/src/views/iot/plugin/index.vue b/src/views/iot/plugin/index.vue
index fb0d1270..88a55187 100644
--- a/src/views/iot/plugin/index.vue
+++ b/src/views/iot/plugin/index.vue
@@ -1,4 +1,3 @@
-
@@ -51,7 +50,7 @@
type="primary"
plain
@click="openForm('create')"
- v-hasPermi="['iot:plugin-info:create']"
+ v-hasPermi="['iot:plugin-config:create']"
>
新增
@@ -65,7 +64,7 @@
-
+
@@ -103,7 +102,7 @@
link
type="primary"
@click="openForm('update', scope.row.id)"
- v-hasPermi="['iot:plugin-info:update']"
+ v-hasPermi="['iot:plugin-config:update']"
>
编辑
@@ -111,7 +110,7 @@
link
type="danger"
@click="handleDelete(scope.row.id)"
- v-hasPermi="['iot:plugin-info:delete']"
+ v-hasPermi="['iot:plugin-config:delete']"
>
删除
@@ -133,6 +132,24 @@
{{ item.name }}
+
+
+
+
+
+ {{ item.status === 1 ? '开启' : '禁用' }}
+
+
@@ -156,16 +173,6 @@
部署方式
-
-
- 状态
-
-
@@ -179,7 +186,7 @@
type="primary"
plain
@click="openForm('update', item.id)"
- v-hasPermi="['iot:plugin-info:update']"
+ v-hasPermi="['iot:plugin-config:update']"
>
编辑
@@ -220,23 +227,23 @@
-
+