From fe70746902e0a8f32e7cefe8449c62db3aa37303 Mon Sep 17 00:00:00 2001 From: lyt <1105290566@qq.com> Date: Sat, 25 Sep 2021 16:47:30 +0800 Subject: [PATCH] =?UTF-8?q?'admin-21.09.25:=E6=9B=B4=E6=96=B0=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=AF=B8=E5=A4=9A=E5=86=85=E5=AE=B9=EF=BC=8C=E8=AF=B7?= =?UTF-8?q?=E6=9F=A5=E7=9C=8BCHANGELOG.md'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 10 + README.md | 9 +- package.json | 27 +- src/layout/component/aside.vue | 10 +- src/layout/component/columnsAside.vue | 59 ++- src/layout/lockScreen/index.vue | 6 +- src/layout/navBars/breadcrumb/setings.vue | 4 +- src/store/interface/index.ts | 2 + src/store/modules/routesList.ts | 18 + src/theme/app.scss | 8 - src/theme/element.scss | 47 +- .../workflow/component/contextmenu/index.vue | 106 +++++ .../pages/workflow/component/drawer/index.vue | 36 ++ src/views/pages/workflow/config.ts | 91 ++++ src/views/pages/workflow/index.vue | 419 +++++++++++++++--- src/views/pages/workflow/mock.ts | 117 ++++- 16 files changed, 855 insertions(+), 114 deletions(-) create mode 100644 src/views/pages/workflow/component/contextmenu/index.vue create mode 100644 src/views/pages/workflow/component/drawer/index.vue create mode 100644 src/views/pages/workflow/config.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index c3a2711b..3af520f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ 🎉🎉🔥 `vue-next-admin` 基于 vue3.x 、Typescript、vite、Element plus 等,适配手机、平板、pc 的后台开源免费模板库(vue2.x 请切换 vue-prev-admin 分支) +## 1.1.1 + +`2021.09.25` + +- 🌟 更新 依赖更新最新版本(`"element-plus": "^1.1.0-beta.13"` 版本运行错误,`^1.1.0-beta.16`修复横向菜单卡死问题) +- 🐞 修复 Dialog 弹窗位置错误、Drawer 抽屉内边距、el-menu 菜单收起时背景色问题 +- 🎯 优化 锁屏界面自动锁屏(s/秒)必须设置至少 1 秒 +- 🎉 新增 分栏布局,鼠标移入当前项时,显示当前项菜单内容 +- 🎉 新增 工作流(未完成) + ## 1.1.0 `2021.09.10` diff --git a/README.md b/README.md index af1f0e06..34127ae8 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,11 @@ #### 🏭 环境支持 -| Edge | last 2 versions | last 2 versions | last 2 versions | -| ---- | ---- | ---- | ---- | -| ![Edge](https://cdn.jsdelivr.net/npm/@browser-logos/edge/edge_32x32.png) | ![Firefox](https://cdn.jsdelivr.net/npm/@browser-logos/firefox/firefox_32x32.png) | ![Chrome](https://cdn.jsdelivr.net/npm/@browser-logos/chrome/chrome_32x32.png)| ![Safari](https://cdn.jsdelivr.net/npm/@browser-logos/safari/safari_32x32.png)| +| Edge | last 2 versions | last 2 versions | last 2 versions | +| ------------------------------------------------------------------------ | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| ![Edge](https://cdn.jsdelivr.net/npm/@browser-logos/edge/edge_32x32.png) | ![Firefox](https://cdn.jsdelivr.net/npm/@browser-logos/firefox/firefox_32x32.png) | ![Chrome](https://cdn.jsdelivr.net/npm/@browser-logos/chrome/chrome_32x32.png) | ![Safari](https://cdn.jsdelivr.net/npm/@browser-logos/safari/safari_32x32.png) | + +> 由于 Vue3 不再支持 IE11,故而 ElementPlus 也不支持 IE11 及之前版本。 #### ⚡ 使用说明 @@ -117,6 +119,7 @@ cnpm run build - vue-grid-layout - splitpanes - vue-drag-verify +- jsplumb #### 💕 特别感谢 diff --git a/package.json b/package.json index ce9c9573..060f93f9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-next-admin", - "version": "1.1.0", + "version": "1.1.1", "scripts": { "dev": "vite", "build": "vite build", @@ -10,10 +10,11 @@ "axios": "^0.21.4", "countup.js": "^2.0.8", "cropperjs": "^1.5.12", - "echarts": "^5.2.0", + "echarts": "^5.2.1", "echarts-gl": "^2.0.8", "echarts-wordcloud": "^2.0.0", - "element-plus": "^1.1.0-beta.9", + "element-plus": "^1.1.0-beta.16", + "jsplumb": "^2.15.6", "mitt": "^3.0.0", "nprogress": "^0.2.0", "print-js": "^1.6.0", @@ -33,21 +34,21 @@ "devDependencies": { "@types/axios": "^0.14.0", "@types/clipboard": "^2.0.1", - "@types/node": "^16.9.1", + "@types/node": "^16.9.6", "@types/nprogress": "^0.2.0", "@types/sortablejs": "^1.10.7", - "@typescript-eslint/eslint-plugin": "^4.31.0", - "@typescript-eslint/parser": "^4.31.0", - "@vitejs/plugin-vue": "^1.6.2", - "@vue/compiler-sfc": "^3.2.11", + "@typescript-eslint/eslint-plugin": "^4.31.2", + "@typescript-eslint/parser": "^4.31.2", + "@vitejs/plugin-vue": "^1.9.2", + "@vue/compiler-sfc": "^3.2.18", "dotenv": "^10.0.0", "eslint": "^7.32.0", - "eslint-plugin-vue": "^7.17.0", - "prettier": "^2.4.0", - "sass": "^1.39.2", + "eslint-plugin-vue": "^7.18.0", + "prettier": "^2.4.1", + "sass": "^1.42.1", "sass-loader": "^12.1.0", - "typescript": "^4.4.2", - "vite": "^2.5.6", + "typescript": "^4.4.3", + "vite": "^2.5.10", "vue-eslint-parser": "^7.11.0" }, "browserslist": [ diff --git a/src/layout/component/aside.vue b/src/layout/component/aside.vue index f07eec21..bdc425f8 100644 --- a/src/layout/component/aside.vue +++ b/src/layout/component/aside.vue @@ -2,7 +2,7 @@
- + @@ -101,6 +101,13 @@ export default { const initMenuFixed = (clientWidth: number) => { state.clientWidth = clientWidth; }; + // 鼠标移入、移出 + const onAsideEnterLeave = (bool: Boolean) => { + let { layout } = store.state.themeConfig.themeConfig; + if (layout !== 'columns') return false; + if (!bool) proxy.mittBus.emit('restoreDefault'); + store.dispatch('routesList/setColumnsMenuHover', bool); + }; // 监听 themeConfig 配置文件的变化,更新菜单 el-scrollbar 的高度 watch(store.state.themeConfig.themeConfig, (val) => { if (val.isShowLogoChange !== val.isShowLogo) { @@ -143,6 +150,7 @@ export default { setShowLogo, getThemeConfig, isTagsViewCurrenFull, + onAsideEnterLeave, ...toRefs(state), }; }, diff --git a/src/layout/component/columnsAside.vue b/src/layout/component/columnsAside.vue index ab99c825..37e35137 100644 --- a/src/layout/component/columnsAside.vue +++ b/src/layout/component/columnsAside.vue @@ -1,17 +1,18 @@ + + diff --git a/src/views/pages/workflow/component/drawer/index.vue b/src/views/pages/workflow/component/drawer/index.vue new file mode 100644 index 00000000..fadc4f79 --- /dev/null +++ b/src/views/pages/workflow/component/drawer/index.vue @@ -0,0 +1,36 @@ + + + diff --git a/src/views/pages/workflow/config.ts b/src/views/pages/workflow/config.ts new file mode 100644 index 00000000..e7c90b9b --- /dev/null +++ b/src/views/pages/workflow/config.ts @@ -0,0 +1,91 @@ +// jsplumb 默认配置 +export const jsplumbDefaults = { + // 多个锚点 [源锚点,目标锚点] + Anchors: [ + 'Top', + 'TopCenter', + 'TopRight', + 'TopLeft', + 'Right', + 'RightMiddle', + 'Bottom', + 'BottomCenter', + 'BottomRight', + 'BottomLeft', + 'Left', + 'LeftMiddle', + ], + // 连线的容器id + Container: 'workflow-right', + // 设置链接线的形状,如直线或者曲线之类的。anchor可以去设置锚点的位置。可选值"" + Connector: ['Bezier', { curviness: 100 }], + // 节点是否可以用鼠标拖动使其断开,默认为true。即用鼠标链接上的连线,也可以使用鼠标拖动让其断开。设置成false,可以让其拖动也不会自动断开 + ConnectionsDetachable: false, + // 删除线的时候节点不删除 + DeleteEndpointsOnDetach: false, + // 每当添加或以其他方式创建 Endpoint 并且 jsPlumb 尚未给出任何明确的 Endpoint 定义时将使用 + Endpoint: ['Blank', { Overlays: '' }], + // 连接中源和目标端点的默认外观 + EndpointStyle: { fill: '#1879ffa1', outlineWidth: 1 }, + // jsPlumb 的内部日志记录是否打开 + LogEnabled: true, + // 连接器的默认外观 + PaintStyle: { + stroke: '#E0E3E7', + strokeWidth: 1, + outlineStroke: 'transparent', + outlineWidth: 10, + }, + // 用于配置任何可拖动元素的默认选项jsPlumb.draggable + DragOptions: { cursor: 'pointer', zIndex: 2000 }, + // 添加到连接器和端点的默认叠加层。已弃用:从 4.x 开始,将不支持此功能。并非所有叠加层都可以连接到连接器和端点。 + Overlays: [ + [ + 'Arrow', + { + width: 10, // 箭头尾部的宽度 + length: 8, // 从箭头的尾部到头部的距离 + location: 1, // 位置,建议使用0~1之间 + direction: 1, // 方向,默认值为1(表示向前),可选-1(表示向后) + foldback: 0.623, // 折回,也就是尾翼的角度,默认0.623,当为1时,为正三角 + }, + ], + [ + 'Label', + { + label: '', + location: 0.5, + cssClass: 'aLabel', + }, + ], + ], + // 默认渲染模式 svg、canvas + RenderMode: 'svg', + // 悬停状态下连接的默认外观 + HoverPaintStyle: { stroke: '#b0b2b5', strokeWidth: 1 }, + // 悬停状态下端点的默认外观 + EndpointHoverStyle: { fill: 'red' }, + // 端点和连接的默认范围。范围提供了对哪些端点可以连接到哪些其他端点的基本控制 + Scope: 'jsPlumb_DefaultScope', +}; + +// 整个节点作为source或者target +export const jsplumbMakeSource = { + // 设置可以拖拽的类名,只要鼠标移动到该类名上的DOM,就可以拖拽连线 + filter: '.workflow-icon-drag', + filterExclude: false, + anchor: 'Continuous', + // 是否允许自己连接自己 + allowLoopback: true, + maxConnections: -1, +}; + +// 整个节点作为source或者target +export const jsplumbMakeMakeTarget = { + filter: '.workflow-icon-drag', + filterExclude: false, + // 是否允许自己连接自己 + anchor: 'Continuous', + allowLoopback: true, + dropOptions: { hoverClass: 'ef-drop-hover' }, +}; diff --git a/src/views/pages/workflow/index.vue b/src/views/pages/workflow/index.vue index 47635628..bd59c935 100644 --- a/src/views/pages/workflow/index.vue +++ b/src/views/pages/workflow/index.vue @@ -2,38 +2,112 @@
-
- -
-
- {{ val.title }} - + +
+
{{ setToolTitle }}
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ + +
+
+ +
+
+ {{ val.title }} + +
+
+
+ +
{{ v.name }}
+
+
-
- + +
+ + +
+
+
+
+ +
{{ v.name }}
+
- -
-
- +
+ + + + + +