From 50c4fb7bfd5280264403d60d54d217e0bb4ce097 Mon Sep 17 00:00:00 2001 From: xingyu Date: Tue, 20 Dec 2022 16:36:54 +0800 Subject: [PATCH 01/11] =?UTF-8?q?docs:=20=E4=BC=98=E5=8C=96=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E6=8E=92=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 36 +++++++++++++++++------------------ yudao-ui-admin-vue3/README.md | 19 +++++++++--------- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 6973c6fe6f..4c328a8449 100644 --- a/README.md +++ b/README.md @@ -169,21 +169,21 @@ ps:核心功能已经实现,正在对接微信小程序中... ## 🐨 技术栈 -| 项目 | 说明 | -|-----------------------|--------------------| -| `yudao-dependencies` | Maven 依赖版本管理 | -| `yudao-framework` | Java 框架拓展 | -| `yudao-server` | 管理后台 + 用户 APP 的服务端 | -| `yudao-ui-admin` | 管理后台的 Vue2 前端项目 | -| `yudao-ui-admin-vue3` | 管理后台的 Vue3 前端项目 | -| `yudao-ui-admin-uniapp` | 管理后台的 uni-app 多端项目 | -| `yudao-ui-app` | 用户 APP 的 UI 界面 | -| `yudao-module-system` | 系统功能的 Module 模块 | -| `yudao-module-member` | 会员中心的 Module 模块 | -| `yudao-module-infra` | 基础设施的 Module 模块 | -| `yudao-module-tool` | 研发工具的 Module 模块 | -| `yudao-module-bpm` | 工作流程的 Module 模块 | -| `yudao-module-pay` | 支付系统的 Module 模块 | +| 项目 | 说明 | +|-------------------------|-----------------------| +| `yudao-dependencies` | Maven 依赖版本管理 | +| `yudao-framework` | Java 框架拓展 | +| `yudao-server` | 管理后台 + 用户 APP 的服务端 | +| `yudao-ui-admin` | 管理后台的 Vue2 前端项目 | +| `yudao-ui-admin-vue3` | 管理后台的 Vue3 前端项目 | +| `yudao-ui-admin-uniapp` | 管理后台的 uni-app 多端项目 | +| `yudao-ui-app` | 用户 APP 的 UI 界面 | +| `yudao-module-system` | 系统功能的 Module 模块 | +| `yudao-module-member` | 会员中心的 Module 模块 | +| `yudao-module-infra` | 基础设施的 Module 模块 | +| `yudao-module-tool` | 研发工具的 Module 模块 | +| `yudao-module-bpm` | 工作流程的 Module 模块 | +| `yudao-module-pay` | 支付系统的 Module 模块 | ### 后端 @@ -242,15 +242,15 @@ ps:核心功能已经实现,正在对接微信小程序中... ### 系统功能 | 模块 | biu | biu | biu | -|----------|--------------------------------------------------------------------|------------------------------------------------------------------|------------------------------------------------------------------| +|------------|--------------------------------------------------------------------|------------------------------------------------------------------|------------------------------------------------------------------| | 登录 & 首页 | ![登录](https://static.iocoder.cn/images/ruoyi-vue-pro/登录.jpg?imageView2/2/format/webp/w/1280) | ![首页](https://static.iocoder.cn/images/ruoyi-vue-pro/首页.jpg?imageView2/2/format/webp/w/1280) | ![个人中心](https://static.iocoder.cn/images/ruoyi-vue-pro/个人中心.jpg?imageView2/2/format/webp/w/1280) | -| 用户 & 应用 | ![用户管理](https://static.iocoder.cn/images/ruoyi-vue-pro/用户管理.jpg?imageView2/2/format/webp/w/1280) | ![令牌管理](https://static.iocoder.cn/images/ruoyi-vue-pro/令牌管理.jpg?imageView2/2/format/webp/w/1280) | ![应用管理](https://static.iocoder.cn/images/ruoyi-vue-pro/应用管理.jpg?imageView2/2/format/webp/w/1280) | +| 用户 & 应用 | ![用户管理](https://static.iocoder.cn/images/ruoyi-vue-pro/用户管理.jpg?imageView2/2/format/webp/w/1280) | ![令牌管理](https://static.iocoder.cn/images/ruoyi-vue-pro/令牌管理.jpg?imageView2/2/format/webp/w/1280) | ![应用管理](https://static.iocoder.cn/images/ruoyi-vue-pro/应用管理.jpg?imageView2/2/format/webp/w/1280) | | 租户 & 套餐 | ![租户管理](https://static.iocoder.cn/images/ruoyi-vue-pro/租户管理.jpg?imageView2/2/format/webp/w/1280) | ![租户套餐](https://static.iocoder.cn/images/ruoyi-vue-pro/租户套餐.png) | - | | 部门 & 岗位 | ![部门管理](https://static.iocoder.cn/images/ruoyi-vue-pro/部门管理.jpg?imageView2/2/format/webp/w/1280) | ![岗位管理](https://static.iocoder.cn/images/ruoyi-vue-pro/岗位管理.jpg?imageView2/2/format/webp/w/1280) | - | | 菜单 & 角色 | ![菜单管理](https://static.iocoder.cn/images/ruoyi-vue-pro/菜单管理.jpg?imageView2/2/format/webp/w/1280) | ![角色管理](https://static.iocoder.cn/images/ruoyi-vue-pro/角色管理.jpg?imageView2/2/format/webp/w/1280) | - | | 审计日志 | ![操作日志](https://static.iocoder.cn/images/ruoyi-vue-pro/操作日志.jpg?imageView2/2/format/webp/w/1280) | ![登录日志](https://static.iocoder.cn/images/ruoyi-vue-pro/登录日志.jpg?imageView2/2/format/webp/w/1280) | - | | 短信 | ![短信渠道](https://static.iocoder.cn/images/ruoyi-vue-pro/短信渠道.jpg?imageView2/2/format/webp/w/1280) | ![短信模板](https://static.iocoder.cn/images/ruoyi-vue-pro/短信模板.jpg?imageView2/2/format/webp/w/1280) | ![短信日志](https://static.iocoder.cn/images/ruoyi-vue-pro/短信日志.jpg?imageView2/2/format/webp/w/1280) | -| 字典 & 敏感词 | ![字典类型](https://static.iocoder.cn/images/ruoyi-vue-pro/字典类型.jpg?imageView2/2/format/webp/w/1280) | ![字典数据](https://static.iocoder.cn/images/ruoyi-vue-pro/字典数据.jpg?imageView2/2/format/webp/w/1280) | ![敏感词](https://static.iocoder.cn/images/ruoyi-vue-pro/敏感词.jpg?imageView2/2/format/webp/w/1280) | +| 字典 & 敏感词 | ![字典类型](https://static.iocoder.cn/images/ruoyi-vue-pro/字典类型.jpg?imageView2/2/format/webp/w/1280) | ![字典数据](https://static.iocoder.cn/images/ruoyi-vue-pro/字典数据.jpg?imageView2/2/format/webp/w/1280) | ![敏感词](https://static.iocoder.cn/images/ruoyi-vue-pro/敏感词.jpg?imageView2/2/format/webp/w/1280) | | 错误码 & 通知 | ![错误码管理](https://static.iocoder.cn/images/ruoyi-vue-pro/错误码管理.jpg?imageView2/2/format/webp/w/1280) | ![通知公告](https://static.iocoder.cn/images/ruoyi-vue-pro/通知公告.jpg?imageView2/2/format/webp/w/1280) | - | ### 工作流程 diff --git a/yudao-ui-admin-vue3/README.md b/yudao-ui-admin-vue3/README.md index c652a01731..cf6dda9c47 100644 --- a/yudao-ui-admin-vue3/README.md +++ b/yudao-ui-admin-vue3/README.md @@ -1,16 +1,15 @@ -

🌈 yudao-ui-admin-vue3

+# 🌈 yudao-ui-admin-vue3 # -

- - - - - - - +

+ vue + vite + typescript + Pinia2 + eslint + pnpm Prettier Sass - Taiwind + WindCSS

## 介绍 From 0f562e59c2e8cf73a05fe8f7e7d924d3a85f33e5 Mon Sep 17 00:00:00 2001 From: xingyu Date: Wed, 21 Dec 2022 13:06:19 +0800 Subject: [PATCH 02/11] =?UTF-8?q?fix:=20menu=20=E9=AB=98=E5=BA=A6=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/ContentDetailWrap/src/ContentDetailWrap.vue | 2 +- yudao-ui-admin-vue3/src/layout/components/Menu/src/Menu.vue | 2 ++ yudao-ui-admin-vue3/src/router/modules/remaining.ts | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/yudao-ui-admin-vue3/src/components/ContentDetailWrap/src/ContentDetailWrap.vue b/yudao-ui-admin-vue3/src/components/ContentDetailWrap/src/ContentDetailWrap.vue index a06fa3e176..887357b1a5 100644 --- a/yudao-ui-admin-vue3/src/components/ContentDetailWrap/src/ContentDetailWrap.vue +++ b/yudao-ui-admin-vue3/src/components/ContentDetailWrap/src/ContentDetailWrap.vue @@ -2,7 +2,7 @@ import { ElCard } from 'element-plus' import { propTypes } from '@/utils/propTypes' import { useDesign } from '@/hooks/web/useDesign' -import { ref, onMounted, defineEmits } from 'vue' +import { ref, onMounted } from 'vue' import { Sticky } from '@/components/Sticky' import { useI18n } from '@/hooks/web/useI18n' const { t } = useI18n() diff --git a/yudao-ui-admin-vue3/src/layout/components/Menu/src/Menu.vue b/yudao-ui-admin-vue3/src/layout/components/Menu/src/Menu.vue index 40718d093b..99a7c00332 100644 --- a/yudao-ui-admin-vue3/src/layout/components/Menu/src/Menu.vue +++ b/yudao-ui-admin-vue3/src/layout/components/Menu/src/Menu.vue @@ -161,6 +161,7 @@ $prefix-cls: #{$namespace}-menu; // 设置子菜单悬停的高亮和背景色 .#{$elNamespace}-sub-menu__title, .#{$elNamespace}-menu-item { + height: 59px; &:hover { color: var(--left-menu-text-active-color) !important; background-color: var(--left-menu-bg-color) !important; @@ -170,6 +171,7 @@ $prefix-cls: #{$namespace}-menu; // 设置选中时的高亮背景和高亮颜色 .#{$elNamespace}-sub-menu.is-active, .#{$elNamespace}-menu-item.is-active { + height: 59px; color: var(--left-menu-text-active-color) !important; background-color: var(--left-menu-bg-active-color) !important; diff --git a/yudao-ui-admin-vue3/src/router/modules/remaining.ts b/yudao-ui-admin-vue3/src/router/modules/remaining.ts index d883eb66b0..d26cd11fd8 100644 --- a/yudao-ui-admin-vue3/src/router/modules/remaining.ts +++ b/yudao-ui-admin-vue3/src/router/modules/remaining.ts @@ -85,7 +85,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ meta: { canTo: true, hidden: true, - noTagsView: true, + noTagsView: false, icon: 'ep:user', title: t('common.profile') } From 91abae8898d5d4b301a236e5f9c6a3f78fc69900 Mon Sep 17 00:00:00 2001 From: xingyu Date: Wed, 21 Dec 2022 16:10:28 +0800 Subject: [PATCH 03/11] refactor: cropper --- yudao-dependencies/pom.xml | 2 +- yudao-ui-admin-vue3/package.json | 6 +- yudao-ui-admin-vue3/pnpm-lock.yaml | 87 +++--- .../src/api/system/user/profile.ts | 2 +- .../src/components/Cropper/index.ts | 4 + .../components/Cropper/src/CopperModal.vue | 256 ++++++++++++++++++ .../src/components/Cropper/src/Cropper.vue | 190 +++++++++++++ .../components/Cropper/src/CropperAvatar.vue | 125 +++++++++ .../src/components/Cropper/src/types.ts | 8 + yudao-ui-admin-vue3/src/config/axios/index.ts | 2 +- yudao-ui-admin-vue3/src/locales/en.ts | 14 + yudao-ui-admin-vue3/src/locales/zh-CN.ts | 14 + .../views/Profile/components/UserAvatar.vue | 252 ++--------------- 13 files changed, 686 insertions(+), 276 deletions(-) create mode 100644 yudao-ui-admin-vue3/src/components/Cropper/index.ts create mode 100644 yudao-ui-admin-vue3/src/components/Cropper/src/CopperModal.vue create mode 100644 yudao-ui-admin-vue3/src/components/Cropper/src/Cropper.vue create mode 100644 yudao-ui-admin-vue3/src/components/Cropper/src/CropperAvatar.vue create mode 100644 yudao-ui-admin-vue3/src/components/Cropper/src/types.ts diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index ca662cb40c..db4f5af63d 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -24,7 +24,7 @@ 1.2.15 3.5.2 - 3.5.2 + 3.5.3 3.6.0 3.18.0 diff --git a/yudao-ui-admin-vue3/package.json b/yudao-ui-admin-vue3/package.json index b96f1a52a6..6b551fa35f 100644 --- a/yudao-ui-admin-vue3/package.json +++ b/yudao-ui-admin-vue3/package.json @@ -25,12 +25,13 @@ }, "dependencies": { "@iconify/iconify": "^3.0.1", - "@vueuse/core": "^9.7.0", + "@vueuse/core": "^9.8.2", "@wangeditor/editor": "^5.1.23", "@wangeditor/editor-for-vue": "^5.1.10", "@zxcvbn-ts/core": "^2.1.0", "animate.css": "^4.1.1", "axios": "^1.2.1", + "cropperjs": "^1.5.13", "crypto-js": "^4.1.1", "dayjs": "^1.11.7", "echarts": "^5.4.1", @@ -46,7 +47,6 @@ "qs": "^6.11.0", "url": "^0.11.0", "vue": "3.2.45", - "vue-cropper": "^1.0.3", "vue-i18n": "9.2.2", "vue-router": "^4.1.6", "vue-types": "^5.0.1", @@ -104,7 +104,7 @@ "vite-plugin-svg-icons": "^2.0.1", "vite-plugin-vue-setup-extend": "^0.4.0", "vite-plugin-windicss": "^1.8.10", - "vue-tsc": "^1.0.14", + "vue-tsc": "^1.0.16", "windicss": "^3.5.6" }, "engines": { diff --git a/yudao-ui-admin-vue3/pnpm-lock.yaml b/yudao-ui-admin-vue3/pnpm-lock.yaml index 498d41f818..df512f52f6 100644 --- a/yudao-ui-admin-vue3/pnpm-lock.yaml +++ b/yudao-ui-admin-vue3/pnpm-lock.yaml @@ -18,7 +18,7 @@ specifiers: '@vitejs/plugin-legacy': ^3.0.1 '@vitejs/plugin-vue': ^4.0.0 '@vitejs/plugin-vue-jsx': ^3.0.0 - '@vueuse/core': ^9.7.0 + '@vueuse/core': ^9.8.2 '@wangeditor/editor': ^5.1.23 '@wangeditor/editor-for-vue': ^5.1.10 '@zxcvbn-ts/core': ^2.1.0 @@ -26,6 +26,7 @@ specifiers: autoprefixer: ^10.4.13 axios: ^1.2.1 consola: ^2.15.3 + cropperjs: ^1.5.13 crypto-js: ^4.1.1 dayjs: ^1.11.7 echarts: ^5.4.1 @@ -72,10 +73,9 @@ specifiers: vite-plugin-vue-setup-extend: ^0.4.0 vite-plugin-windicss: ^1.8.10 vue: 3.2.45 - vue-cropper: ^1.0.3 vue-i18n: 9.2.2 vue-router: ^4.1.6 - vue-tsc: ^1.0.14 + vue-tsc: ^1.0.16 vue-types: ^5.0.1 vxe-table: ^4.3.7 web-storage-cache: ^1.1.1 @@ -84,12 +84,13 @@ specifiers: dependencies: '@iconify/iconify': 3.0.1 - '@vueuse/core': 9.7.0_vue@3.2.45 + '@vueuse/core': 9.8.2_vue@3.2.45 '@wangeditor/editor': 5.1.23 '@wangeditor/editor-for-vue': 5.1.12_3apfu3xbp6awzuex7ed3sbrv6y '@zxcvbn-ts/core': 2.1.0 animate.css: 4.1.1 axios: 1.2.1 + cropperjs: 1.5.13 crypto-js: 4.1.1 dayjs: 1.11.7 echarts: registry.npmmirror.com/echarts/5.4.1 @@ -105,7 +106,6 @@ dependencies: qs: 6.11.0 url: 0.11.0 vue: 3.2.45 - vue-cropper: 1.0.5 vue-i18n: 9.2.2_vue@3.2.45 vue-router: 4.1.6_vue@3.2.45 vue-types: 5.0.1_vue@3.2.45 @@ -163,7 +163,7 @@ devDependencies: vite-plugin-svg-icons: 2.0.1_vite@4.0.2 vite-plugin-vue-setup-extend: 0.4.0_vite@4.0.2 vite-plugin-windicss: registry.npmmirror.com/vite-plugin-windicss/1.8.10_vite@4.0.2 - vue-tsc: 1.0.14_typescript@4.9.4 + vue-tsc: 1.0.16_typescript@4.9.4 windicss: 3.5.6 packages: @@ -1079,44 +1079,44 @@ packages: nanoid: registry.npmmirror.com/nanoid/3.3.4 dev: false - /@volar/language-core/1.0.14: - resolution: {integrity: sha512-j1tMQgw0qCV2amM4qDJNG/zc0yj3ay8HoWNt05IaiCPsULtSSpF/9+F6Izvn0DF7nWOd6MUHTxaQAeZwLfr56Q==} + /@volar/language-core/1.0.16: + resolution: {integrity: sha512-IGnOxWTs4DZ81TDcmxBAkCBxs97hUblwcjpBsTx/pOGGaSSDQRJPn0wL8NYTybEObU0i7lhEpKZ+0vJfdIy1Kg==} dependencies: - '@volar/source-map': 1.0.14 + '@volar/source-map': 1.0.16 '@vue/reactivity': 3.2.45 muggle-string: 0.1.0 dev: true - /@volar/source-map/1.0.14: - resolution: {integrity: sha512-8pHCbEWHWaSDGb/FM9zRIW1lY1OAo16MENVSQGCgTwz7PWf3Gw6WW3TFVKCtzaFhLjPH0i5e9hALy7vBPbSHoA==} + /@volar/source-map/1.0.16: + resolution: {integrity: sha512-PKjzmQcg8QOGC/1V9tmGh2jcy6bKLhkW5bGidElSr83iDbCzLvldt2/La/QlDxaRCHYLT0MeyuGJBZIChB1dYQ==} dependencies: muggle-string: 0.1.0 dev: true - /@volar/typescript/1.0.14: - resolution: {integrity: sha512-67qcjjz7KGFhMCG9EKMA9qJK3BRGQecO4dGyAKfMfClZ/PaVoKfDvJvYo89McGTQ8SeczD48I9TPnaJM0zK8JQ==} + /@volar/typescript/1.0.16: + resolution: {integrity: sha512-Yov+n4oO3iYnuMt9QJAFpJabfTRCzc7KvjlAwBaSuZy+Gc/f9611MgtqAh5/SIGmltFN8dXn1Ijno8ro8I4lyw==} dependencies: - '@volar/language-core': 1.0.14 + '@volar/language-core': 1.0.16 dev: true - /@volar/vue-language-core/1.0.14: - resolution: {integrity: sha512-grJ4dQ7c/suZmBBmZtw2O2XeDX+rtgpdBtHxMug1NMPRDxj5EZ9WGphWtGnMQj8RyVgpz9ByvV5GbQjk4/wfBw==} + /@volar/vue-language-core/1.0.16: + resolution: {integrity: sha512-sQ/aW1Vuiyy4OQuh2lthyYicruM3qh9VSk/aDh8/bFvM8GoohHZqVpMN3LYldEJ9eT/rN6u4xmYP54vc/EjX4Q==} dependencies: - '@volar/language-core': 1.0.14 - '@volar/source-map': 1.0.14 + '@volar/language-core': 1.0.16 + '@volar/source-map': 1.0.16 '@vue/compiler-dom': 3.2.45 '@vue/compiler-sfc': 3.2.45 '@vue/reactivity': 3.2.45 '@vue/shared': 3.2.45 - minimatch: 5.1.0 + minimatch: 5.1.2 vue-template-compiler: 2.7.14 dev: true - /@volar/vue-typescript/1.0.14: - resolution: {integrity: sha512-2P0QeGLLY05fDTu8GqY8SR2+jldXRTrkQdD2Nc0sVOjMJ7j3RYYY0wJyZ9hCBDuxV4Micc6jdB8nKS0yxQgNvA==} + /@volar/vue-typescript/1.0.16: + resolution: {integrity: sha512-M018Ulg/o2FVktAdlr5b/z4K69bYzekxNUA1o39y5Ur6CObc/o+5eDCCS7gIYijWnx9iNKkSQpWWWblJFv7kHQ==} dependencies: - '@volar/typescript': 1.0.14 - '@volar/vue-language-core': 1.0.14 + '@volar/typescript': 1.0.16 + '@volar/vue-language-core': 1.0.16 dev: true /@vue/compiler-core/3.2.45: @@ -1196,24 +1196,24 @@ packages: /@vue/shared/3.2.45: resolution: {integrity: sha512-Ewzq5Yhimg7pSztDV+RH1UDKBzmtqieXQlpTVm2AwraoRL/Rks96mvd8Vgi7Lj+h+TH8dv7mXD3FRZR3TUvbSg==} - /@vueuse/core/9.7.0_vue@3.2.45: - resolution: {integrity: sha512-/AGY/t7jJPxCyRoVTygNKoroTiCvRaaZIW+yeSlBCnI7QRpQ9cvXNTdNaSl3GvSyFbn83+XwZwEZvI1OpQfeGw==} + /@vueuse/core/9.8.2_vue@3.2.45: + resolution: {integrity: sha512-aWiCmcYIpPt7xjuqYiceODEMHchDYthrJ4AqI+FXPZrR23PZOqdiktbUVyQl2kGlR3H4i9UJ/uimQrwhz9UouQ==} dependencies: '@types/web-bluetooth': 0.0.16 - '@vueuse/metadata': 9.7.0 - '@vueuse/shared': 9.7.0_vue@3.2.45 + '@vueuse/metadata': 9.8.2 + '@vueuse/shared': 9.8.2_vue@3.2.45 vue-demi: 0.13.11_vue@3.2.45 transitivePeerDependencies: - '@vue/composition-api' - vue dev: false - /@vueuse/metadata/9.7.0: - resolution: {integrity: sha512-M7WsAgw28FNtTH0bzsGuHEtJOPJqPpyeHS6PHq+8UesLgNjZ9waMAntiUrgUQlxt09M4i2lH7y9sRi0jkfeXGA==} + /@vueuse/metadata/9.8.2: + resolution: {integrity: sha512-N4E/BKS+9VsUeD4WLVRU1J2kCOLh+iikBcMtipFcTyL204132vDYHs27zLAVabJYGnhC0dIVGdhg9pbOZiY2TQ==} dev: false - /@vueuse/shared/9.7.0_vue@3.2.45: - resolution: {integrity: sha512-pwmt1y3TJ2s5KqWmkv9ZKEV59GwuZQZk8XLiU+hGswz0jej318ozbea9E4A/A50ksyM26swSFr7sZ9llNPsZHg==} + /@vueuse/shared/9.8.2_vue@3.2.45: + resolution: {integrity: sha512-ACjrPQzowd5dnabNJt9EoGVobco9/ENiA5qP53vjiuxndlJYuc/UegwhXC7KdQbPX4F45a50+45K3g1wNqOzmA==} dependencies: vue-demi: 0.13.11_vue@3.2.45 transitivePeerDependencies: @@ -2019,6 +2019,10 @@ packages: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} dev: true + /cropperjs/1.5.13: + resolution: {integrity: sha512-by7jKAo73y5/Do0K6sxdTKHgndY0NMjG2bEdgeJxycbcmHuCiMXqw8sxy5C5Y5WTOTcDGmbT7Sr5CgKOXR06OA==} + dev: false + /cross-spawn/7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} @@ -2319,7 +2323,7 @@ packages: '@popperjs/core': /@sxzz/popperjs-es/2.11.7 '@types/lodash': 4.14.189 '@types/lodash-es': 4.17.6 - '@vueuse/core': 9.7.0_vue@3.2.45 + '@vueuse/core': 9.8.2_vue@3.2.45 async-validator: 4.2.5 dayjs: 1.11.7 escape-html: 1.0.3 @@ -3831,6 +3835,13 @@ packages: brace-expansion: 2.0.1 dev: true + /minimatch/5.1.2: + resolution: {integrity: sha512-bNH9mmM9qsJ2X4r2Nat1B//1dJVcn3+iBLa3IgqJ7EbGaDNepL9QSHOxN4ng33s52VMMhhIfgCYDk3C4ZmlDAg==} + engines: {node: '>=10'} + dependencies: + brace-expansion: 2.0.1 + dev: true + /minimist-options/4.1.0: resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} engines: {node: '>= 6'} @@ -5461,10 +5472,6 @@ packages: fsevents: 2.3.2 dev: true - /vue-cropper/1.0.5: - resolution: {integrity: sha512-D4XXdqWmMWRLOIV9LIh7/mkH6OBOMQDFbRjwntkxmAtxOtwpC9U5ZZ6lSXw5F5cbd4g8znDjk6MuCwIL+fZSrA==} - dev: false - /vue-demi/0.13.11_vue@3.2.45: resolution: {integrity: sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A==} engines: {node: '>=12'} @@ -5526,14 +5533,14 @@ packages: he: 1.2.0 dev: true - /vue-tsc/1.0.14_typescript@4.9.4: - resolution: {integrity: sha512-HeqtyxMrSRUCnU5nxB0lQc3o7zirMppZ/V6HLL3l4FsObGepH3A3beNmNehpLQs0Gt7DkSWVi3CpVCFgrf+/sQ==} + /vue-tsc/1.0.16_typescript@4.9.4: + resolution: {integrity: sha512-yZaiJBbcKR1rSLhiF9KryAFH7R63po+N/invr2EAHGXxMzZksE5j1zyQKvrYiqK47ZHLAlCR+re/PHqWp/UzTg==} hasBin: true peerDependencies: typescript: '*' dependencies: - '@volar/vue-language-core': 1.0.14 - '@volar/vue-typescript': 1.0.14 + '@volar/vue-language-core': 1.0.16 + '@volar/vue-typescript': 1.0.16 typescript: 4.9.4 dev: true diff --git a/yudao-ui-admin-vue3/src/api/system/user/profile.ts b/yudao-ui-admin-vue3/src/api/system/user/profile.ts index eb3de0f5f7..e78424cc42 100644 --- a/yudao-ui-admin-vue3/src/api/system/user/profile.ts +++ b/yudao-ui-admin-vue3/src/api/system/user/profile.ts @@ -73,5 +73,5 @@ export const updateUserPwdApi = (oldPassword: string, newPassword: string) => { // 用户头像上传 export const uploadAvatarApi = (data) => { - return request.put({ url: '/system/user/profile/update-avatar', data }) + return request.upload({ url: '/system/user/profile/update-avatar', data: data }) } diff --git a/yudao-ui-admin-vue3/src/components/Cropper/index.ts b/yudao-ui-admin-vue3/src/components/Cropper/index.ts new file mode 100644 index 0000000000..8fcc61830c --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/Cropper/index.ts @@ -0,0 +1,4 @@ +import CropperImage from './src/Cropper.vue' +import CropperAvatar from './src/CropperAvatar.vue' + +export { CropperImage, CropperAvatar } diff --git a/yudao-ui-admin-vue3/src/components/Cropper/src/CopperModal.vue b/yudao-ui-admin-vue3/src/components/Cropper/src/CopperModal.vue new file mode 100644 index 0000000000..a2c50f6b03 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/Cropper/src/CopperModal.vue @@ -0,0 +1,256 @@ + + + diff --git a/yudao-ui-admin-vue3/src/components/Cropper/src/Cropper.vue b/yudao-ui-admin-vue3/src/components/Cropper/src/Cropper.vue new file mode 100644 index 0000000000..2e38e06d06 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/Cropper/src/Cropper.vue @@ -0,0 +1,190 @@ + + + diff --git a/yudao-ui-admin-vue3/src/components/Cropper/src/CropperAvatar.vue b/yudao-ui-admin-vue3/src/components/Cropper/src/CropperAvatar.vue new file mode 100644 index 0000000000..a960afcfe1 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/Cropper/src/CropperAvatar.vue @@ -0,0 +1,125 @@ + + + diff --git a/yudao-ui-admin-vue3/src/components/Cropper/src/types.ts b/yudao-ui-admin-vue3/src/components/Cropper/src/types.ts new file mode 100644 index 0000000000..bcad3b4509 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/Cropper/src/types.ts @@ -0,0 +1,8 @@ +import type Cropper from 'cropperjs' + +export interface CropendResult { + imgBase64: string + imgInfo: Cropper.Data +} + +export type { Cropper } diff --git a/yudao-ui-admin-vue3/src/config/axios/index.ts b/yudao-ui-admin-vue3/src/config/axios/index.ts index c2a3344bf6..e6c6af8d77 100644 --- a/yudao-ui-admin-vue3/src/config/axios/index.ts +++ b/yudao-ui-admin-vue3/src/config/axios/index.ts @@ -44,7 +44,7 @@ export default { }, upload: async (option: any) => { option.headersType = 'multipart/form-data' - const res = await request({ method: 'PUT', ...option }) + const res = await request({ method: 'POST', ...option }) return res as unknown as Promise } } diff --git a/yudao-ui-admin-vue3/src/locales/en.ts b/yudao-ui-admin-vue3/src/locales/en.ts index af7a9314f9..9733d9c933 100644 --- a/yudao-ui-admin-vue3/src/locales/en.ts +++ b/yudao-ui-admin-vue3/src/locales/en.ts @@ -426,5 +426,19 @@ export default { cfPwdMsg: 'Please Enter Confirm Password', diffPwd: 'The Passwords Entered Twice No Match' } + }, + cropper: { + selectImage: 'Select Image', + uploadSuccess: 'Uploaded success!', + modalTitle: 'Avatar upload', + okText: 'Confirm and upload', + btn_reset: 'Reset', + btn_rotate_left: 'Counterclockwise rotation', + btn_rotate_right: 'Clockwise rotation', + btn_scale_x: 'Flip horizontal', + btn_scale_y: 'Flip vertical', + btn_zoom_in: 'Zoom in', + btn_zoom_out: 'Zoom out', + preview: 'Preivew' } } diff --git a/yudao-ui-admin-vue3/src/locales/zh-CN.ts b/yudao-ui-admin-vue3/src/locales/zh-CN.ts index 4c4c471548..71e2c3427a 100644 --- a/yudao-ui-admin-vue3/src/locales/zh-CN.ts +++ b/yudao-ui-admin-vue3/src/locales/zh-CN.ts @@ -419,5 +419,19 @@ export default { pwdRules: '长度在 6 到 20 个字符', diffPwd: '两次输入密码不一致' } + }, + cropper: { + selectImage: '选择图片', + uploadSuccess: '上传成功', + modalTitle: '头像上传', + okText: '确认并上传', + btn_reset: '重置', + btn_rotate_left: '逆时针旋转', + btn_rotate_right: '顺时针旋转', + btn_scale_x: '水平翻转', + btn_scale_y: '垂直翻转', + btn_zoom_in: '放大', + btn_zoom_out: '缩小', + preview: '预览' } } diff --git a/yudao-ui-admin-vue3/src/views/Profile/components/UserAvatar.vue b/yudao-ui-admin-vue3/src/views/Profile/components/UserAvatar.vue index 4e80faf217..e6c0a2895d 100644 --- a/yudao-ui-admin-vue3/src/views/Profile/components/UserAvatar.vue +++ b/yudao-ui-admin-vue3/src/views/Profile/components/UserAvatar.vue @@ -1,245 +1,37 @@ - From 7eb0fb1655b38387991f3a9d00658fcba961881e Mon Sep 17 00:00:00 2001 From: xingyu Date: Wed, 21 Dec 2022 16:18:47 +0800 Subject: [PATCH 04/11] fix: close modal --- .../components/Cropper/src/CopperModal.vue | 221 +++++++++--------- .../components/Cropper/src/CropperAvatar.vue | 17 +- .../views/Profile/components/UserAvatar.vue | 5 +- 3 files changed, 129 insertions(+), 114 deletions(-) diff --git a/yudao-ui-admin-vue3/src/components/Cropper/src/CopperModal.vue b/yudao-ui-admin-vue3/src/components/Cropper/src/CopperModal.vue index a2c50f6b03..919e1d1bb5 100644 --- a/yudao-ui-admin-vue3/src/components/Cropper/src/CopperModal.vue +++ b/yudao-ui-admin-vue3/src/components/Cropper/src/CopperModal.vue @@ -1,115 +1,117 @@ diff --git a/yudao-ui-admin-vue3/src/layout/components/Setting/src/Setting.vue b/yudao-ui-admin-vue3/src/layout/components/Setting/src/Setting.vue index ac3f13affb..14bb7393d3 100644 --- a/yudao-ui-admin-vue3/src/layout/components/Setting/src/Setting.vue +++ b/yudao-ui-admin-vue3/src/layout/components/Setting/src/Setting.vue @@ -122,6 +122,8 @@ const copyConfig = async () => { size: ${appStore.getSize}, // 多语言图标 locale: ${appStore.getLocale}, + // 消息图标 + message: ${appStore.getMessage}, // 标签页 tagsView: ${appStore.getTagsView}, // 标签页图标 diff --git a/yudao-ui-admin-vue3/src/layout/components/Setting/src/components/InterfaceDisplay.vue b/yudao-ui-admin-vue3/src/layout/components/Setting/src/components/InterfaceDisplay.vue index 39030a6f22..f44397c459 100644 --- a/yudao-ui-admin-vue3/src/layout/components/Setting/src/components/InterfaceDisplay.vue +++ b/yudao-ui-admin-vue3/src/layout/components/Setting/src/components/InterfaceDisplay.vue @@ -57,6 +57,13 @@ const localeChange = (show: boolean) => { appStore.setLocale(show) } +// 消息图标 +const message = ref(appStore.getMessage) + +const messageChange = (show: boolean) => { + appStore.setMessage(show) +} + // 标签页 const tagsView = ref(appStore.getTagsView) @@ -164,6 +171,11 @@ watch( +
+ {{ t('setting.messageIcon') }} + +
+
{{ t('setting.tagsView') }} diff --git a/yudao-ui-admin-vue3/src/layout/components/ToolHeader.vue b/yudao-ui-admin-vue3/src/layout/components/ToolHeader.vue index 674886c4ca..4930777396 100644 --- a/yudao-ui-admin-vue3/src/layout/components/ToolHeader.vue +++ b/yudao-ui-admin-vue3/src/layout/components/ToolHeader.vue @@ -1,11 +1,12 @@ - +