diff --git a/mock/user.mock.ts b/mock/user.mock.ts index bc9041ea..3d0163a3 100644 --- a/mock/user.mock.ts +++ b/mock/user.mock.ts @@ -134,8 +134,8 @@ export default defineMock([ // 重置密码 { - url: "users/:userId/password", - method: ["PATCH"], + url: "users/:userId/password/reset", + method: ["PUT"], body({ query }) { return { code: "00000", @@ -156,6 +156,51 @@ export default defineMock([ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", }, }, + + { + url: "users/profile", + method: ["GET"], + body: { + code: "00000", + data: { + id: 2, + username: "admin", + nickname: "系统管理员", + avatar: + "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif", + gender: 1, + mobile: "17621210366", + email: null, + deptName: "有来技术", + roleNames: "系统管理员", + createTime: "2019-10-10", + }, + }, + }, + + { + url: "users/profile", + method: ["PUT"], + body({ query }) { + return { + code: "00000", + data: null, + msg: "修改个人信息成功", + }; + }, + }, + + { + url: "users/password", + method: ["PUT"], + body({ query }) { + return { + code: "00000", + data: null, + msg: "修改密码成功", + }; + }, + }, ]); // 用户映射表数据 diff --git a/package.json b/package.json index c198c99a..d209bf11 100644 --- a/package.json +++ b/package.json @@ -45,16 +45,17 @@ }, "dependencies": { "@element-plus/icons-vue": "^2.3.1", + "@stomp/stompjs": "^7.0.0", "@vueuse/core": "^10.11.1", "@wangeditor/editor": "^5.1.23", "@wangeditor/editor-for-vue": "5.1.10", "animate.css": "^4.1.1", - "axios": "^1.7.4", + "axios": "^1.7.7", "codemirror": "^5.65.17", "codemirror-editor-vue3": "^2.7.0", "color": "^4.2.3", "echarts": "^5.5.1", - "element-plus": "^2.8.0", + "element-plus": "^2.8.1", "exceljs": "^4.4.0", "lodash-es": "^4.17.21", "nprogress": "^0.2.0", @@ -62,45 +63,44 @@ "path-to-regexp": "^6.2.2", "pinia": "^2.2.2", "qs": "^6.13.0", - "sortablejs": "^1.15.2", - "@stomp/stompjs": "^7.0.0", - "vue": "^3.4.38", + "sortablejs": "^1.15.3", + "vue": "^3.5.1", "vue-i18n": "9.9.1", "vue-router": "^4.4.3" }, "devDependencies": { "@commitlint/cli": "^18.6.1", "@commitlint/config-conventional": "^18.6.3", - "@iconify-json/ep": "^1.1.16", + "@iconify-json/ep": "^1.2.0", "@types/codemirror": "^5.60.15", "@types/color": "^3.0.6", "@types/lodash": "^4.17.7", - "@types/node": "^20.14.15", + "@types/node": "^20.16.5", "@types/nprogress": "^0.2.3", - "@types/path-browserify": "^1.0.2", + "@types/path-browserify": "^1.0.3", "@types/qs": "^6.9.15", "@types/sortablejs": "^1.15.8", "@typescript-eslint/eslint-plugin": "^7.18.0", "@typescript-eslint/parser": "^7.18.0", - "@vitejs/plugin-vue": "^5.1.2", + "@vitejs/plugin-vue": "^5.1.3", "@vitejs/plugin-vue-jsx": "^3.1.0", "autoprefixer": "^10.4.20", "commitizen": "^4.3.0", "cz-git": "^1.9.4", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-import": "^2.29.1", + "eslint-plugin-import": "^2.30.0", "eslint-plugin-prettier": "^5.2.1", - "eslint-plugin-vue": "^9.27.0", + "eslint-plugin-vue": "^9.28.0", "fast-glob": "^3.3.2", - "husky": "^9.1.4", - "lint-staged": "^15.2.9", - "postcss": "^8.4.41", + "husky": "^9.1.5", + "lint-staged": "^15.2.10", + "postcss": "^8.4.45", "postcss-html": "^1.7.0", "postcss-scss": "^4.0.9", "prettier": "^3.3.3", - "sass": "^1.77.8", - "stylelint": "^16.8.2", + "sass": "^1.78.0", + "stylelint": "^16.9.0", "stylelint-config-html": "^1.1.0", "stylelint-config-recess-order": "^4.6.0", "stylelint-config-recommended-scss": "^14.1.0", @@ -112,16 +112,17 @@ "unplugin-auto-import": "^0.17.8", "unplugin-icons": "^0.18.5", "unplugin-vue-components": "^0.26.0", - "vite": "^5.4.1", + "vite": "^5.4.3", "vite-plugin-mock-dev-server": "^1.7.1", "vite-plugin-svg-icons": "^2.0.1", - "vite-plugin-vue-devtools": "^7.3.8", - "vue-tsc": "^2.0.29" + "vite-plugin-vue-devtools": "^7.4.4", + "vue-tsc": "^2.1.6" + }, + "engines": { + "node": "^18.0.0 || ^20.7.0", + "pnpm": ">=9" }, "repository": "https://gitee.com/youlaiorg/vue3-element-admin.git", "author": "有来开源组织", - "license": "MIT", - "engines": { - "node": ">=18.0.0" - } + "license": "MIT" } diff --git a/public/favicon.ico b/public/favicon.ico index fb82ed5b..8ed8d998 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/src/api/user.ts b/src/api/user.ts index ac18ae3f..27147a12 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -77,7 +77,7 @@ class UserAPI { */ static resetPassword(id: number, password: string) { return request({ - url: `${USER_BASE_URL}/${id}/password`, + url: `${USER_BASE_URL}/${id}/password/reset`, method: "put", params: { password: password }, }); diff --git a/src/assets/logo.png b/src/assets/logo.png index a7af162f..ffa62f3c 100644 Binary files a/src/assets/logo.png and b/src/assets/logo.png differ diff --git a/src/components/MenuSearch/index.vue b/src/components/MenuSearch/index.vue index 82932652..58e61a0b 100644 --- a/src/components/MenuSearch/index.vue +++ b/src/components/MenuSearch/index.vue @@ -147,6 +147,11 @@ interface SearchItem { } } +.search-content { + max-height: 400px; + overflow-y: auto; +} + .search-space { padding: 20px; color: #999; diff --git a/src/layout/components/Settings/index.vue b/src/layout/components/Settings/index.vue index ad3782cd..fe8e7793 100644 --- a/src/layout/components/Settings/index.vue +++ b/src/layout/components/Settings/index.vue @@ -96,7 +96,7 @@ function changeLayout(layout: string) { /** 重新激活顶部菜单 */ function againActiveTop(newVal: string) { const parent = findOutermostParent(permissionStore.routes, newVal); - if (appStore.activeTopMenu !== parent.path) { + if (appStore.activeTopMenuPath !== parent.path) { appStore.activeTopMenu(parent.path); } } diff --git a/src/views/generator/index.vue b/src/views/generator/index.vue index fe0c0b41..b1a6b1d2 100644 --- a/src/views/generator/index.vue +++ b/src/views/generator/index.vue @@ -97,15 +97,16 @@ v-show="active == 0" :model="genConfigFormData" :label-width="100" + :rules="genConfigFormRules" > - + - + - + - + @@ -135,7 +136,7 @@ - + - + + + ([]); + const queryFormRef = ref(ElForm); const queryParams = reactive({ pageNum: 1, @@ -455,6 +479,14 @@ const genConfigFormData = ref({ fieldConfigs: [], }); +const genConfigFormRules = { + tableName: [{ required: true, message: "请输入表名", trigger: "blur" }], + businessName: [{ required: true, message: "请输入业务名", trigger: "blur" }], + packageName: [{ required: true, message: "请输入包名", trigger: "blur" }], + moduleName: [{ required: true, message: "请输入模块名", trigger: "blur" }], + entityName: [{ required: true, message: "请输入实体名", trigger: "blur" }], +}; + const dialog = reactive({ visible: false, title: "", @@ -473,12 +505,12 @@ const active = ref(0); const currentTableName = ref(""); const sortFlag = ref(); -interface TreeNode { - label: string; - content?: string; - children?: TreeNode[]; -} -const treeData = ref([]); +// 查询是否全选 +const isCheckAllQuery = ref(false); +// 列表是否全选 +const isCheckAllList = ref(false); +// 表单是否全选 +const isCheckAllForm = ref(false); watch(active, (val) => { if (val === 0) { @@ -550,6 +582,7 @@ const setNodeSort = (oldIndex: number, newIndex: number) => { }); }; +/** 上一步 */ function handlePrevClick() { if (active.value === 2) { //这里需要重新获取一次数据,如果第一次生成代码后,再次点击上一步,数据不重新获取,再次点击下一步,会再次插入数据,导致索引重复报错 @@ -571,6 +604,7 @@ function handlePrevClick() { if (active.value-- <= 0) active.value = 0; } +/** 下一步 */ function handleNextClick() { if (active.value === 0) { initSort(); @@ -680,6 +714,7 @@ function handleResetConfig(tableName: string) { type FieldConfigKey = "isShowInQuery" | "isShowInList" | "isShowInForm"; +/** 全选 */ const toggleCheckAll = (key: FieldConfigKey, value: boolean) => { const fieldConfigs = genConfigFormData.value?.fieldConfigs; @@ -690,10 +725,6 @@ const toggleCheckAll = (key: FieldConfigKey, value: boolean) => { } }; -const isCheckAllQuery = ref(false); -const isCheckAllList = ref(false); -const isCheckAllForm = ref(false); - const checkAllSelected = (key: keyof FieldConfig, isCheckAllRef: any) => { const fieldConfigs = genConfigFormData.value?.fieldConfigs || []; isCheckAllRef.value = fieldConfigs.every( @@ -740,7 +771,6 @@ function buildTree( const parts = item.path.split(separator); // 定义特殊路径 - // TODO: 如果菜单有多个节点,需要将此菜单作为独立一级的节点,而不是合并到上一级。 按照此规则, com.youlai.system 则是三个节点,而不是合并到一起,但是这里需要将 com.youlai.system 合并到一起,所以需要特殊处理 const specialPaths = [ "src" + separator + "main", "java", @@ -753,8 +783,6 @@ function buildTree( ).replace(/\./g, separator), ]; - console.log("specialPaths", specialPaths); - // 检查路径中的特殊部分并合并它们 const mergedParts: string[] = []; let buffer: string[] = []; diff --git a/vite.config.ts b/vite.config.ts index b562db03..2aa9cde9 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -208,7 +208,8 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => { "element-plus/es/components/steps/style/css", "element-plus/es/components/step/style/css", "element-plus/es/components/avatar/style/css", - "sockjs-client/dist/sockjs.min.js", + "element-plus/es/components/descriptions/style/css", + "element-plus/es/components/descriptions-item/style/css", ], }, // 构建配置