diff --git a/src/api/protocolPlugin.js b/src/api/protocolPlugin.js index a8cc4dc05f4d8f1e1fb01f93a369df763567bb42..4c619664bd3839f3ac1f0bce2e50ffc62e383a6e 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 e1a6ee0dec45a29cde8cabc8c13b106d7445a644..1ac9a4a5dcfdbf220ec3e28c641b8dd07da8e11b 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 e395323f3a7186b644f5b6defa8340be74ef0aa5..9f6b14186b091f10813b4d14412d751bf0a3ac60 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 486dddb25a626fb405e6f0e503c5e1eefae55fd4..f13f85421f0ef2764e1d3b55f82f85dd28e9c000 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 b85b9c84bcd92c02e6879beacb23f8c472534153..b93d8b3fc206e169cc176808d1b57e974ff8917c 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 133a3e052ffd5a33a7b8e33791116ed812959403..43428bdb2dd31d218883d4adcd1badc3c4ac144f 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 0ee9f96202df04808f002f4fcfaee4f84e9a5db5..a4b842b5bbf72781fccb2c130c21660cc817dd2e 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 0000000000000000000000000000000000000000..e8004c827a586fad4b8a5d748293cd11c7036506 --- /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 3ce3e8b45a185cd5b5b22aa45559b339b938ef47..8196378b027908dd82acac721fe96ffa7aef5be1 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