From b5cb3f31cef986a1cefab909c41845e80896b0c0 Mon Sep 17 00:00:00 2001 From: yangb <397447182@qq.com> Date: Wed, 31 May 2023 12:33:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E6=8F=92=E4=BB=B6--=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=BF=AE=E6=94=B9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/protocolPlugin.js | 13 + src/core/config/i18n/ch.js | 1 + src/core/config/i18n/de-DE.js | 1 + src/core/config/i18n/en-US.js | 1 + src/core/config/i18n/en.js | 1 + src/core/config/i18n/fr-FR.js | 1 + src/core/config/i18n/ja-JP.js | 1 + src/view/pages/system/protocol/EditPlugin.vue | 267 ++++++++++++++++++ src/view/pages/system/protocol/index.vue | 178 ++++++++---- 9 files changed, 413 insertions(+), 51 deletions(-) create mode 100644 src/view/pages/system/protocol/EditPlugin.vue diff --git a/src/api/protocolPlugin.js b/src/api/protocolPlugin.js index a8cc4dc0..4c619664 100644 --- a/src/api/protocolPlugin.js +++ b/src/api/protocolPlugin.js @@ -17,6 +17,19 @@ export default { data }) }, + + /** + * 修改插件 + * @param data + * @returns {AxiosPromise} + */ + edit: (data) => { + return axios({ + url: "/tp_protocol_plugin/edit", + method: "post", + data + }) + }, /** diff --git a/src/core/config/i18n/ch.js b/src/core/config/i18n/ch.js index e1a6ee0d..1ac9a4a5 100644 --- a/src/core/config/i18n/ch.js +++ b/src/core/config/i18n/ch.js @@ -1409,6 +1409,7 @@ export const locale = { TAB2_CONTENT: { TITLE: "接入协议插件", BTN: "注册插件", + EDIT_BTN: "编辑插件", NAME: "名称", DEVICETYPE: "设备类型", PROTOCOLTYPE: "协议类型", diff --git a/src/core/config/i18n/de-DE.js b/src/core/config/i18n/de-DE.js index e395323f..9f6b1418 100644 --- a/src/core/config/i18n/de-DE.js +++ b/src/core/config/i18n/de-DE.js @@ -1374,6 +1374,7 @@ export const locale = { TAB2_CONTENT: { TITLE: '接入协议插件', BTN: '注册插件', + EDIT_BTN: "编辑插件", NAME: '名称', DEVICETYPE: '设备类型', PROTOCOLTYPE: '协议类型', diff --git a/src/core/config/i18n/en-US.js b/src/core/config/i18n/en-US.js index 486dddb2..f13f8542 100644 --- a/src/core/config/i18n/en-US.js +++ b/src/core/config/i18n/en-US.js @@ -1374,6 +1374,7 @@ export const locale = { TAB2_CONTENT: { TITLE: 'Access protocol plug-in', BTN: 'Register plug-in', + EDIT_BTN: 'Edit plug-in', NAME: 'name', DEVICETYPE: 'Device type', PROTOCOLTYPE: 'Protocol Type', diff --git a/src/core/config/i18n/en.js b/src/core/config/i18n/en.js index b85b9c84..b93d8b3f 100644 --- a/src/core/config/i18n/en.js +++ b/src/core/config/i18n/en.js @@ -1230,6 +1230,7 @@ export const locale = { TAB2_CONTENT: { TITLE: "Access protocol plug-in", BTN: "Register plug-in", + EDIT_BTN: "Edit plug-in", NAME: "name", DEVICETYPE: "Device type", PROTOCOLTYPE: "Protocol Type", diff --git a/src/core/config/i18n/fr-FR.js b/src/core/config/i18n/fr-FR.js index 133a3e05..43428bdb 100644 --- a/src/core/config/i18n/fr-FR.js +++ b/src/core/config/i18n/fr-FR.js @@ -1374,6 +1374,7 @@ export const locale = { TAB2_CONTENT: { TITLE: '接入协议插件', BTN: '注册插件', + EDIT_BTN: '编辑插件', NAME: '名称', DEVICETYPE: '设备类型', PROTOCOLTYPE: '协议类型', diff --git a/src/core/config/i18n/ja-JP.js b/src/core/config/i18n/ja-JP.js index 0ee9f962..a4b842b5 100644 --- a/src/core/config/i18n/ja-JP.js +++ b/src/core/config/i18n/ja-JP.js @@ -1374,6 +1374,7 @@ export const locale = { TAB2_CONTENT: { TITLE: '接入协议插件', BTN: '注册插件', + EDIT_BTN: '编辑插件', NAME: '名称', DEVICETYPE: '设备类型', PROTOCOLTYPE: '协议类型', diff --git a/src/view/pages/system/protocol/EditPlugin.vue b/src/view/pages/system/protocol/EditPlugin.vue new file mode 100644 index 00000000..e8004c82 --- /dev/null +++ b/src/view/pages/system/protocol/EditPlugin.vue @@ -0,0 +1,267 @@ + + + + + diff --git a/src/view/pages/system/protocol/index.vue b/src/view/pages/system/protocol/index.vue index 3ce3e8b4..8196378b 100644 --- a/src/view/pages/system/protocol/index.vue +++ b/src/view/pages/system/protocol/index.vue @@ -2,58 +2,114 @@
- {{ $t('PLUGIN.TAB2_CONTENT.TITLE') }} + {{ $t("PLUGIN.TAB2_CONTENT.TITLE") }} - {{ $t('PLUGIN.TAB2_CONTENT.BTN') }} - 发布 + {{ + $t("PLUGIN.TAB2_CONTENT.BTN") + }} + 发布 - - + - + - + - + - + - + - + - + - + @@ -64,15 +120,25 @@
+ background + layout="prev, pager, next" + :total="params.total" + :current-page.sync="params.current_page" + :page-size="params.per_page" + @current-change="getPluginList" + >
- + +
@@ -80,10 +146,11 @@ import ProtocolPlugin from "@/api/protocolPlugin.js"; import TableTitle from "@/components/common/TableTitle.vue"; import RegisterPlugin from "./RegisterPlugin"; -import {message_success} from "@/utils/helpers"; +import EditPlugin from "./EditPlugin"; +import { message_success } from "@/utils/helpers"; export default { name: "index", - components: { TableTitle, RegisterPlugin }, + components: { TableTitle, RegisterPlugin, EditPlugin }, data() { return { loading: false, @@ -91,10 +158,12 @@ export default { total: 0, current_page: 1, per_page: 10, - data: [] + data: [], }, - registerDialogVisible: false - } + registerDialogVisible: false, + editDialogVisible: false, + currentItem: {}, + }; }, mounted() { this.getPluginList(); @@ -117,32 +186,39 @@ export default { */ getPluginList() { this.loading = true; - let params = { current_page: this.params.current_page, per_page: this.params.per_page } - ProtocolPlugin.page(params) - .then(({ data }) => { - if (data.code == 200) { - this.loading = false; - this.params = data.data; - } - }) + let params = { + current_page: this.params.current_page, + per_page: this.params.per_page, + }; + ProtocolPlugin.page(params).then(({ data }) => { + if (data.code == 200) { + this.loading = false; + this.params = data.data; + } + }); + }, + /** + * 显示修改页面 + * @param row + */ + handleShowEdit(row) { + this.currentItem = { ...row }; + this.editDialogVisible = true; }, /** * 删除 * @param row */ handleDelete(row) { - ProtocolPlugin.del({ id: row.id }) - .then(({ data }) => { - if (data.code == 200 && data.message == "success") { - message_success("删除成功!") - this.getPluginList(); - } - }) - } - } -} + ProtocolPlugin.del({ id: row.id }).then(({ data }) => { + if (data.code == 200 && data.message == "success") { + message_success("删除成功!"); + this.getPluginList(); + } + }); + }, + }, +}; - \ No newline at end of file + \ No newline at end of file -- Gitee