diff --git a/.env b/.env index a77d490d..3c5303b5 100644 --- a/.env +++ b/.env @@ -13,8 +13,5 @@ VITE_APP_TENANT_ENABLE=true # 验证码的开关 VITE_APP_CAPTCHA_ENABLE=true -# 验证码的开关 -VITE_APP_CAPTCHA_ENABLE=true - # 百度统计 VITE_APP_BAIDU_CODE = a1ff8825baa73c3a78eb96aa40325abc diff --git a/.env.front b/.env.front index 2641417d..1629ff9f 100644 --- a/.env.front +++ b/.env.front @@ -17,3 +17,18 @@ VITE_API_URL=/admin-api # 打包路径 VITE_BASE_PATH=/ + +# 项目本地运行端口号, 与.vscode/launch.json配合 +VITE_PORT=80 + +# 是否删除debugger +VITE_DROP_DEBUGGER=false + +# 是否删除console.log +VITE_DROP_CONSOLE=false + +# 是否sourcemap +VITE_SOURCEMAP=true + +# 验证码的开关 +VITE_APP_CAPTCHA_ENABLE=false diff --git a/.env.stage b/.env.stage new file mode 100644 index 00000000..d7157fbb --- /dev/null +++ b/.env.stage @@ -0,0 +1,31 @@ +# 生产环境 +NODE_ENV=production + +VITE_DEV=false + +# 请求路径 +VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn' + +# 上传路径 +VITE_UPLOAD_URL='http://api-dashboard.yudao.iocoder.cn/admin-api/infra/file/upload' + +# 接口前缀 +VITE_API_BASEPATH= + +# 接口地址 +VITE_API_URL=/admin-api + +# 是否删除debugger +VITE_DROP_DEBUGGER=true + +# 是否删除console.log +VITE_DROP_CONSOLE=true + +# 是否sourcemap +VITE_SOURCEMAP=false + +# 打包路径 +VITE_BASE_PATH='http://static-vue3.yudao.iocoder.cn/' + +# 输出路径 +VITE_OUT_DIR=dist-stage diff --git a/.env.test b/.env.test index 85e2cf54..0793af25 100644 --- a/.env.test +++ b/.env.test @@ -25,7 +25,7 @@ VITE_DROP_CONSOLE=false VITE_SOURCEMAP=true # 打包路径 -VITE_BASE_PATH=/dist-test/ +VITE_BASE_PATH=/ # 输出路径 VITE_OUT_DIR=dist-test diff --git a/.gitignore b/.gitignore index ac15926b..0f033cc4 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,6 @@ dist-ssr /dist* *-lock.* pnpm-debug - +auto-*.d.ts .idea .history diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..f43edc03 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "msedge", + "request": "launch", + "name": "Launch Edge against localhost", + "url": "http://localhost", + "webRoot": "${workspaceFolder}/src", + "sourceMaps": true + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 38cc3052..3036ebf1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -40,5 +40,15 @@ "i18n-ally.displayLanguage": "zh-CN", "i18n-ally.enabledFrameworks": ["vue", "react"], "god.tsconfig": "./tsconfig.json", - "vue-i18n.i18nPaths": "src/locales" + "vue-i18n.i18nPaths": "src/locales", + "explorer.fileNesting.enabled": true, + "explorer.fileNesting.expand": false, + "explorer.fileNesting.patterns": { + "*.ts": "$(capture).test.ts, $(capture).test.tsx", + "*.tsx": "$(capture).test.ts, $(capture).test.tsx", + "*.env": "$(capture).env.*", + "CHANGELOG.md": "CHANGELOG*", + "package.json": "pnpm-lock.yaml,pnpm-workspace.yaml,LICENSE,.gitattributes,.gitignore,.gitpod.yml,CNAME,README*,.npmrc,.browserslistrc,vite.config.*,windi.*,tailwind.*,tsconfig.*,postcss*", + ".eslintrc.js": ".eslintignore,.eslintrc-*,.prettierignore,.stylelintignore,.commitlintrc.js,.prettierrc.js,.stylelint*,stylelint*,prettier.*,.editorconfig" + } } diff --git a/README.md b/README.md index ea6214cc..d4ddd4f2 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,8 @@ ## 🐶 新手必读 * nodejs > 16.0.0 && pnpm > 7.30.0 -* 演示地址: +* 演示地址【Vue3 + element-plus】: +* 演示地址【Vue2 + element-ui】: * 启动文档: * 视频教程: @@ -42,7 +43,6 @@ | [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 4.9.5 | | [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.0.33 | | [vueuse](https://vueuse.org/) | 常用工具集 | 9.13.0 | -| [vxe-table](https://vxetable.cn/) | Vue 最强表单 | 4.3.10 | | [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.2 | | [vue-router](https://router.vuejs.org/) | Vue 路由 | 4.1.6 | | [windicss](https://cn.windicss.org/) | 下一代工具优先的 CSS 框架 | 3.5.6 | diff --git a/build/vite/index.ts b/build/vite/index.ts index 0e721ce9..574a0d61 100644 --- a/build/vite/index.ts +++ b/build/vite/index.ts @@ -13,16 +13,18 @@ import Components from 'unplugin-vue-components/vite' import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' import viteCompression from 'vite-plugin-compression' import topLevelAwait from 'vite-plugin-top-level-await' -import vueSetupExtend from 'vite-plugin-vue-setup-extend' +import vueSetupExtend from 'vite-plugin-vue-setup-extend-plus' import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite' import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' export function createVitePlugins() { const root = process.cwd() + // 路径查找 function pathResolve(dir: string) { return resolve(root, '.', dir) } + return [ Vue(), VueJsx(), @@ -45,8 +47,6 @@ export function createVitePlugins() { { '@/hooks/web/useI18n': ['useI18n'], '@/hooks/web/useMessage': ['useMessage'], - '@/hooks/web/useXTable': ['useXTable'], - '@/hooks/web/useVxeCrudSchemas': ['useVxeCrudSchemas'], '@/hooks/web/useTable': ['useTable'], '@/hooks/web/useCrudSchemas': ['useCrudSchemas'], '@/utils/formRules': ['required'], @@ -98,7 +98,8 @@ export function createVitePlugins() { deleteOriginFile: false //压缩后是否删除源文件 }), ViteEjsPlugin(), - topLevelAwait({ // https://juejin.cn/post/7152191742513512485 + topLevelAwait({ + // https://juejin.cn/post/7152191742513512485 // The export name of top-level await promise for each chunk module promiseExportName: '__tla', // The function to generate import names of top-level await promise in each chunk module diff --git a/build/vite/optimize.ts b/build/vite/optimize.ts index 3d90dbac..1a7a1b2f 100644 --- a/build/vite/optimize.ts +++ b/build/vite/optimize.ts @@ -18,10 +18,6 @@ const include = [ 'lodash-es', 'nprogress', 'animate.css', - 'vxe-table', - 'vxe-table/es/style', - 'vxe-table/lib/locale/lang/zh-CN', - 'vxe-table/lib/locale/lang/en-US', 'web-storage-cache', '@iconify/iconify', '@vueuse/core', @@ -68,6 +64,7 @@ const include = [ 'element-plus/es/components/dropdown-menu/style/index', 'element-plus/es/components/dropdown-item/style/index', 'element-plus/es/components/skeleton/style/index', + 'element-plus/es/components/skeleton/style/css', 'element-plus/es/components/backtop/style/css', 'element-plus/es/components/menu/style/css', @@ -79,7 +76,22 @@ const include = [ 'element-plus/es/components/dropdown-item/style/css', 'element-plus/es/components/badge/style/css', 'element-plus/es/components/breadcrumb/style/css', - 'element-plus/es/components/breadcrumb-item/style/css' + 'element-plus/es/components/breadcrumb-item/style/css', + 'element-plus/es/components/image/style/css', + 'element-plus/es/components/tag/style/css', + 'element-plus/es/components/dialog/style/css', + 'element-plus/es/components/form/style/css', + 'element-plus/es/components/form-item/style/css', + 'element-plus/es/components/card/style/css', + 'element-plus/es/components/tooltip/style/css', + 'element-plus/es/components/radio-group/style/css', + 'element-plus/es/components/radio/style/css', + 'element-plus/es/components/input-number/style/css', + 'element-plus/es/components/tree-select/style/css', + 'element-plus/es/components/drawer/style/css', + 'element-plus/es/components/image-viewer/style/css', + 'element-plus/es/components/upload/style/css', + 'element-plus/es/components/switch/style/css' ] const exclude = ['@iconify/json'] diff --git a/package.json b/package.json index def1f5c7..1a836c5a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yudao-ui-admin-vue3", - "version": "1.7.1-snapshot.1961", + "version": "1.7.2-snapshot", "description": "基于vue3、vite4、element-plus、typesScript", "author": "xingyu", "private": false, @@ -11,6 +11,7 @@ "ts:check": "vue-tsc --noEmit", "build:pro": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode pro", "build:dev": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode dev", + "build:stage": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode stage", "build:test": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode test", "build:static": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode static", "build:front": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode front", @@ -32,13 +33,12 @@ "@form-create/element-ui": "^3.1.17", "@iconify/iconify": "^3.1.0", "@videojs-player/vue": "^1.0.0", - "@vueup/vue-quill": "^1.1.1", "@vueuse/core": "^9.13.0", "@wangeditor/editor": "^5.1.23", "@wangeditor/editor-for-vue": "^5.1.10", "@zxcvbn-ts/core": "^2.2.1", "animate.css": "^4.1.1", - "axios": "^1.3.4", + "axios": "^1.3.5", "benz-amr-recorder": "^1.1.5", "bpmn-js-token-simulation": "^0.10.0", "camunda-bpmn-moddle": "^7.0.1", @@ -48,16 +48,16 @@ "diagram-js": "^11.6.0", "echarts": "^5.4.1", "echarts-wordcloud": "^2.1.0", - "element-plus": "2.3.1", + "element-plus": "2.3.3", "fast-xml-parser": "^4.1.3", "highlight.js": "^11.7.0", - "intro.js": "^6.0.0", + "intro.js": "^7.0.1", "jsencrypt": "^3.3.2", "lodash-es": "^4.17.21", "min-dash": "^4.0.0", "mitt": "^3.0.0", "nprogress": "^0.2.0", - "pinia": "^2.0.33", + "pinia": "^2.0.34", "qrcode": "^1.5.1", "qs": "^6.11.1", "steady-xml": "^0.1.0", @@ -68,7 +68,6 @@ "vue-router": "^4.1.6", "vue-types": "^5.0.2", "vuedraggable": "^4.1.0", - "vxe-table": "^4.3.11", "web-storage-cache": "^1.1.1", "xe-utils": "^3.5.7", "xml-js": "^1.6.11" @@ -126,7 +125,7 @@ "vite-plugin-purge-icons": "^0.9.2", "vite-plugin-svg-icons": "^2.0.1", "vite-plugin-top-level-await": "^1.3.0", - "vite-plugin-vue-setup-extend": "^0.4.0", + "vite-plugin-vue-setup-extend-plus": "^0.1.0", "vite-plugin-windicss": "^1.8.10", "vue-tsc": "^1.2.0", "windicss": "^3.5.6" diff --git a/src/App.vue b/src/App.vue index a7867a1c..75edd24f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,4 +1,4 @@ - - + diff --git a/src/views/mp/freePublish/index.vue b/src/views/mp/freePublish/index.vue index 66f35012..62ca1999 100644 --- a/src/views/mp/freePublish/index.vue +++ b/src/views/mp/freePublish/index.vue @@ -11,18 +11,7 @@ label-width="68px" > - - - - - - 搜索 - 重置 + @@ -59,31 +48,32 @@ - diff --git a/src/views/mp/material/components/UploadFile.vue b/src/views/mp/material/components/UploadFile.vue new file mode 100644 index 00000000..f58084bb --- /dev/null +++ b/src/views/mp/material/components/UploadFile.vue @@ -0,0 +1,74 @@ + + + + diff --git a/src/views/mp/material/components/UploadVideo.vue b/src/views/mp/material/components/UploadVideo.vue new file mode 100644 index 00000000..9d2fd861 --- /dev/null +++ b/src/views/mp/material/components/UploadVideo.vue @@ -0,0 +1,126 @@ + + + diff --git a/src/views/mp/material/components/VideoTable.vue b/src/views/mp/material/components/VideoTable.vue new file mode 100644 index 00000000..b1e14dd5 --- /dev/null +++ b/src/views/mp/material/components/VideoTable.vue @@ -0,0 +1,59 @@ + + + diff --git a/src/views/mp/material/components/VoiceTable.vue b/src/views/mp/material/components/VoiceTable.vue new file mode 100644 index 00000000..4ae5174b --- /dev/null +++ b/src/views/mp/material/components/VoiceTable.vue @@ -0,0 +1,51 @@ + + + diff --git a/src/views/mp/material/components/upload.ts b/src/views/mp/material/components/upload.ts new file mode 100644 index 00000000..7158ab12 --- /dev/null +++ b/src/views/mp/material/components/upload.ts @@ -0,0 +1,31 @@ +import type { UploadProps, UploadRawFile } from 'element-plus' +import { getAccessToken } from '@/utils/auth' +import { UploadType, useBeforeUpload } from '@/views/mp/hooks/useUpload' + +const HEADERS = { Authorization: 'Bearer ' + getAccessToken() } // 请求头 +const UPLOAD_URL = import.meta.env.VITE_BASE_URL + '/admin-api/mp/material/upload-permanent' // 上传地址 + +interface UploadData { + type: UploadType + title: string + introduction: string +} + +const beforeImageUpload: UploadProps['beforeUpload'] = (rawFile: UploadRawFile) => + useBeforeUpload(UploadType.Image, 2)(rawFile) + +const beforeVoiceUpload: UploadProps['beforeUpload'] = (rawFile: UploadRawFile) => + useBeforeUpload(UploadType.Voice, 2)(rawFile) + +const beforeVideoUpload: UploadProps['beforeUpload'] = (rawFile: UploadRawFile) => + useBeforeUpload(UploadType.Video, 10)(rawFile) + +export { + HEADERS, + UPLOAD_URL, + UploadType, + UploadData, + beforeImageUpload, + beforeVoiceUpload, + beforeVideoUpload +} diff --git a/src/views/mp/material/index.vue b/src/views/mp/material/index.vue index 778609b9..b72c9ad6 100644 --- a/src/views/mp/material/index.vue +++ b/src/views/mp/material/index.vue @@ -2,74 +2,29 @@ - + - - - - - - 搜索 - 重置 + - + - + -
- - 点击上传 - - -
-
- -
+ + 支持 bmp/png/jpeg/jpg/gif 格式,大小不超过 2M + + + - + -
- - 点击上传 - - -
- - - - - - - - - - - - - + + 格式支持 mp3/wma/wav/amr,文件大小不超过 2M,播放长度不超过 60s + + + - + -
- 新建视频 -
- - 新建视频 - - - 格式支持 MP4,文件大小不超过 10MB - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + +
- - - diff --git a/src/views/mp/menu/components/MenuEditor.vue b/src/views/mp/menu/components/MenuEditor.vue new file mode 100644 index 00000000..684d66f6 --- /dev/null +++ b/src/views/mp/menu/components/MenuEditor.vue @@ -0,0 +1,244 @@ + + + + + diff --git a/src/views/mp/menu/components/MenuPreviewer.vue b/src/views/mp/menu/components/MenuPreviewer.vue new file mode 100644 index 00000000..d2626320 --- /dev/null +++ b/src/views/mp/menu/components/MenuPreviewer.vue @@ -0,0 +1,226 @@ + + + + + diff --git a/src/views/mp/menu/menuOptions.ts b/src/views/mp/menu/components/menuOptions.ts similarity index 100% rename from src/views/mp/menu/menuOptions.ts rename to src/views/mp/menu/components/menuOptions.ts diff --git a/src/views/mp/menu/components/types.ts b/src/views/mp/menu/components/types.ts new file mode 100644 index 00000000..b9f76597 --- /dev/null +++ b/src/views/mp/menu/components/types.ts @@ -0,0 +1,73 @@ +export interface Replay { + title: string + description: string + picUrl: string + url: string +} + +export type MenuType = + | '' + | 'click' + | 'view' + | 'scancode_waitmsg' + | 'scancode_push' + | 'pic_sysphoto' + | 'pic_photo_or_album' + | 'pic_weixin' + | 'location_select' + | 'article_view_limited' + +interface _RawMenu { + // db + id: number + parentId: number + accountId: number + appId: string + createTime: number + + // mp-native + name: string + menuKey: string + type: MenuType + url: string + miniProgramAppId: string + miniProgramPagePath: string + articleId: string + replyMessageType: string + replyContent: string + replyMediaId: string + replyMediaUrl: string + replyThumbMediaId: string + replyThumbMediaUrl: string + replyTitle: string + replyDescription: string + replyArticles: Replay + replyMusicUrl: string + replyHqMusicUrl: string +} + +export type RawMenu = Partial<_RawMenu> + +interface _Reply { + type: string + accountId: number + content: string + mediaId: string + url: string + thumbMediaId: string + thumbMediaUrl: string + title: string + description: string + articles: null | Replay[] + musicUrl: string + hqMusicUrl: string +} + +export type Reply = Partial<_Reply> + +interface _Menu extends RawMenu { + children: _Menu[] + reply: Reply +} + +export type Menu = Partial<_Menu> diff --git a/src/views/mp/menu/index.vue b/src/views/mp/menu/index.vue index 2d4b7c76..0b02cc16 100644 --- a/src/views/mp/menu/index.vue +++ b/src/views/mp/menu/index.vue @@ -4,193 +4,45 @@ - - - - - - 搜索 - 重置 + -