From 3fd9da3e1ffa62963df69b524d797a39de1ad91f Mon Sep 17 00:00:00 2001 From: Odboy Date: Wed, 30 Jul 2025 21:12:30 +0800 Subject: [PATCH] =?UTF-8?q?refactor(module):=20=E9=87=8D=E6=9E=84=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=EF=BC=8C=E5=B9=B6=E6=B7=BB=E5=8A=A0=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E4=B8=80=E9=94=AE=E5=A4=8D=E5=88=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/Crud/UD.operation.vue | 13 ++-- .../src/views/system/menu/index.vue | 78 ++++++++++++++++++- 2 files changed, 82 insertions(+), 9 deletions(-) diff --git a/cutejava-front/src/components/Crud/UD.operation.vue b/cutejava-front/src/components/Crud/UD.operation.vue index ed52ba53..ee40ee70 100644 --- a/cutejava-front/src/components/Crud/UD.operation.vue +++ b/cutejava-front/src/components/Crud/UD.operation.vue @@ -1,14 +1,14 @@ diff --git a/cutejava-front/src/views/system/menu/index.vue b/cutejava-front/src/views/system/menu/index.vue index adf7ee3b..e5a182c1 100644 --- a/cutejava-front/src/views/system/menu/index.vue +++ b/cutejava-front/src/views/system/menu/index.vue @@ -181,7 +181,7 @@ @@ -190,7 +190,15 @@ :data="scope.row" :permission="permission" msg="确定删除吗,如果存在下级节点则一并删除,此操作不能撤销!" - /> + > + 复制 + + @@ -207,6 +215,7 @@ import rrOperation from '@crud/RR.operation' import crudOperation from '@crud/CRUD.operation' import udOperation from '@crud/UD.operation' import DateRangePicker from '@/components/DateRangePicker' +import CsMessage from '@/utils/elementui/CsMessage' // crud交由presenter持有 const defaultForm = { @@ -304,6 +313,71 @@ export default { // 选中图标 selected(name) { this.form.icon = name + }, + onCopyClick(row) { + let data = {} + if (row.type === 0) { + // 目录 + data = { + id: null, + title: row.title + 'Copy', + menuSort: 1, + path: row.path + 'Copy', + component: null, + componentName: null, + iFrame: row.IFrame, + roles: [], + pid: 0, + icon: row.icon, + cache: row.cache, + hidden: row.hidden, + type: row.type, + permission: null + } + } else if (row.type === 1) { + // 菜单 + data = { + id: null, + title: row.title + 'Copy', + menuSort: row.menuSort, + path: row.path + 'Copy', + component: row.component, + componentName: row.componentName + 'Copy', + iFrame: row.IFrame, + roles: [], + pid: row.pid, + icon: row.icon, + cache: row.cache, + hidden: row.hidden, + type: row.type, + permission: row.permission + } + } else if (row.type === 2) { + // 按钮 + data = { + id: null, + title: row.title + 'Copy', + menuSort: row.menuSort, + path: null, + component: null, + componentName: null, + iFrame: row.IFrame, + roles: [], + pid: row.pid, + icon: null, + cache: row.cache, + hidden: row.hidden, + type: row.type, + permission: row.permission + } + } + const that = this + crudMenu.add(data).then(() => { + setTimeout(() => { + CsMessage.Success('复制成功') + that.crud.toQuery() + }, 1000) + }) } } }