Merge branch 'main' into refactor/theme

This commit is contained in:
xiaoxian521 2021-11-03 23:24:53 +08:00
commit 8436f964e4
12 changed files with 5329 additions and 75 deletions

View File

@ -45,11 +45,21 @@ jobs:
# Full git history is needed to get a proper list of changed files within `super-linter` # Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0 fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: "16"
registry-url: https://registry.npmjs.com/
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Build - name: Build
run: | run: |
yarn install pnpm install
yarn lint pnpm lint
yarn build
env: env:
VALIDATE_ALL_CODEBASE: false VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: main DEFAULT_BRANCH: main

6
.gitignore vendored
View File

@ -7,8 +7,8 @@ dist-ssr
yarn.lock yarn.lock
npm-debug.log* npm-debug.log*
yarn-debug.log* .pnpm-error.log*
yarn-error.log* .pnpm-debug.log
tests/**/coverage/ tests/**/coverage/
# Editor directories and files # Editor directories and files
@ -17,5 +17,3 @@ tests/**/coverage/
*.ntvs* *.ntvs*
*.njsproj *.njsproj
*.sln *.sln
pnpm-lock.yaml
yarn.lock

View File

@ -3,7 +3,7 @@ command_exists () {
command -v "$1" >/dev/null 2>&1 command -v "$1" >/dev/null 2>&1
} }
# Workaround for Windows 10, Git Bash and Yarn # Workaround for Windows 10, Git Bash and Pnpm
if command_exists winpty && test -t 1; then if command_exists winpty && test -t 1; then
exec < /dev/tty exec < /dev/tty
fi fi

View File

@ -9,7 +9,6 @@
"terminal.integrated.rendererType": "dom", "terminal.integrated.rendererType": "dom",
"editor.formatOnType": true, "editor.formatOnType": true,
"editor.formatOnSave": true, "editor.formatOnSave": true,
"window.zoomLevel": 1,
"javascript.updateImportsOnFileMove.enabled": "always", "javascript.updateImportsOnFileMove.enabled": "always",
"[vue]": { "[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"

View File

@ -59,20 +59,20 @@ git clone https://github.com.cnpmjs.org/xiaoxian521/vue-pure-admin.git
```bash ```bash
cd vue-pure-admin cd vue-pure-admin
yarn install pnpm install
``` ```
- run - run
```bash ```bash
yarn serve pnpm serve
``` ```
- build - build
```bash ```bash
yarn build pnpm build
``` ```
## Change Log ## Change Log

View File

@ -59,20 +59,20 @@ git clone https://github.com.cnpmjs.org/xiaoxian521/vue-pure-admin.git
```bash ```bash
cd vue-pure-admin cd vue-pure-admin
yarn install pnpm install
``` ```
- 运行 - 运行
```bash ```bash
yarn serve pnpm serve
``` ```
- 打包 - 打包
```bash ```bash
yarn build pnpm build
``` ```
## 更新日志 ## 更新日志

View File

@ -2,26 +2,43 @@
"name": "vue-pure-admin", "name": "vue-pure-admin",
"version": "2.1.0", "version": "2.1.0",
"private": true, "private": true,
"packageManager": "pnpm@6.20.1",
"workspaces": [
"build/**",
"mock/**",
"src/**",
"types/**"
],
"engines": {
"node": ">= 16",
"pnpm": ">= 6"
},
"scripts": { "scripts": {
"dev": "cross-env --max_old_space_size=4096 vite", "dev": "cross-env --max_old_space_size=4096 vite",
"serve": "yarn dev", "serve": "pnpm dev",
"build": "rimraf dist && cross-env vite build", "build": "rimraf dist && cross-env vite build",
"preview": "vite preview", "preview": "vite preview",
"preview:build": "yarn build && vite preview", "preview:build": "pnpm build && vite preview",
"clean:cache": "rm -rf node_modules && rm -rf .eslintcache && yarn cache clean && yarn", "clean:cache": "rm -rf node_modules && rm -rf .eslintcache && pnpm install",
"lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock}/**/*.{vue,ts,tsx}\" --fix", "lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock}/**/*.{vue,ts,tsx}\" --fix",
"lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"", "lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"",
"lint:stylelint": "stylelint --cache --fix \"**/*.{vue,css,scss,postcss,less}\" --cache --cache-location node_modules/.cache/stylelint/", "lint:stylelint": "stylelint --cache --fix \"**/*.{vue,css,scss,postcss,less}\" --cache --cache-location node_modules/.cache/stylelint/",
"lint:lint-staged": "lint-staged -c ./.husky/lintstagedrc.js", "lint:lint-staged": "lint-staged -c ./.husky/lintstagedrc.js",
"lint:pretty": "pretty-quick --staged", "lint:pretty": "pretty-quick --staged",
"lint": "yarn lint:eslint && yarn lint:prettier && yarn lint:stylelint && yarn lint:pretty", "lint": "pnpm lint:eslint && pnpm lint:prettier && pnpm lint:stylelint && pnpm lint:pretty",
"prepare": "husky install" "prepare": "husky install",
"preinstall": "npx only-allow pnpm"
}, },
"browserslist": [
"> 1%",
"not ie 11",
"not op_mini all"
],
"dependencies": { "dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1", "@amap/amap-jsapi-loader": "^1.0.1",
"@element-plus/icons": "^0.0.11", "@element-plus/icons": "^0.0.11",
"@logicflow/core": "^0.7.1", "@logicflow/core": "0.7.1",
"@logicflow/extension": "^0.7.1", "@logicflow/extension": "0.7.1",
"@vueuse/core": "^6.7.1", "@vueuse/core": "^6.7.1",
"@vueuse/motion": "^2.0.0-beta.4", "@vueuse/motion": "^2.0.0-beta.4",
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
@ -45,61 +62,61 @@
"responsive-storage": "^1.0.11", "responsive-storage": "^1.0.11",
"sortablejs": "1.13.0", "sortablejs": "1.13.0",
"typescript-cookie": "^1.0.0", "typescript-cookie": "^1.0.0",
"v-contextmenu": "^3.0.0", "v-contextmenu": "3.0.0",
"vue": "^3.2.20", "vue": "^3.2.20",
"vue-i18n": "^9.2.0-beta.3", "vue-i18n": "^9.2.0-beta.3",
"vue-json-pretty": "^2.0.2", "vue-json-pretty": "^2.0.2",
"vue-router": "^4.0.11", "vue-router": "^4.0.11",
"vue-types": "^4.1.0", "vue-types": "^4.1.0",
"vuedraggable": "^4.1.0", "vuedraggable": "4.1.0",
"vxe-table": "^4.0.30", "vxe-table": "4.0.30",
"wangeditor": "^4.7.7", "wangeditor": "4.7.7",
"xe-ajax": "^4.0.5", "xe-ajax": "4.0.5",
"xe-utils": "^3.4.0", "xe-utils": "3.4.0",
"xgplayer": "^2.31.1" "xgplayer": "2.28.0"
}, },
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^13.1.0", "@commitlint/cli": "13.1.0",
"@commitlint/config-conventional": "^13.1.0", "@commitlint/config-conventional": "13.1.0",
"@types/element-resize-detector": "^1.1.3", "@types/element-resize-detector": "1.1.3",
"@types/mockjs": "^1.0.3", "@types/mockjs": "1.0.3",
"@types/node": "^14.14.14", "@types/node": "14.14.14",
"@types/nprogress": "^0.2.0", "@types/nprogress": "0.2.0",
"@typescript-eslint/eslint-plugin": "^4.31.0", "@typescript-eslint/eslint-plugin": "4.31.0",
"@typescript-eslint/parser": "^4.31.0", "@typescript-eslint/parser": "4.31.0",
"@vitejs/plugin-vue": "^1.6.0", "@vitejs/plugin-vue": "1.6.0",
"@vitejs/plugin-vue-jsx": "^1.1.7", "@vitejs/plugin-vue-jsx": "1.1.7",
"@vue/compiler-sfc": "^3.2.20", "@vue/compiler-sfc": "3.2.20",
"@vue/eslint-config-prettier": "^6.0.0", "@vue/eslint-config-prettier": "6.0.0",
"@vue/eslint-config-typescript": "^7.0.0", "@vue/eslint-config-typescript": "7.0.0",
"@zougt/vite-plugin-theme-preprocessor": "^1.3.4", "@zougt/vite-plugin-theme-preprocessor": "^1.3.4",
"autoprefixer": "^10.2.4", "autoprefixer": "10.2.4",
"babel-plugin-transform-remove-console": "^6.9.4", "babel-plugin-transform-remove-console": "6.9.4",
"chalk": "^2.4.2", "chalk": "2.4.2",
"cross-env": "^7.0.3", "cross-env": "7.0.3",
"eslint": "^7.30.0", "eslint": "7.30.0",
"eslint-plugin-prettier": "^3.4.0", "eslint-plugin-prettier": "3.4.0",
"eslint-plugin-vue": "^7.17.0", "eslint-plugin-vue": "7.17.0",
"husky": "^7.0.2", "husky": "7.0.2",
"lint-staged": "^11.1.2", "lint-staged": "11.1.2",
"postcss": "^8.2.6", "postcss": "8.2.6",
"postcss-import": "^14.0.0", "postcss-import": "14.0.0",
"prettier": "^2.3.2", "prettier": "2.3.2",
"pretty-quick": "^3.1.1", "pretty-quick": "3.1.1",
"rimraf": "^3.0.2", "rimraf": "3.0.2",
"sass": "^1.38.0", "sass": "1.38.0",
"sass-loader": "^12.1.0", "sass-loader": "12.1.0",
"stylelint": "^13.13.1", "stylelint": "13.13.1",
"stylelint-config-prettier": "^8.0.2", "stylelint-config-prettier": "8.0.2",
"stylelint-config-standard": "^22.0.0", "stylelint-config-standard": "22.0.0",
"stylelint-order": "^4.1.0", "stylelint-order": "4.1.0",
"typescript": "^4.4.2", "typescript": "4.4.2",
"unplugin-element-plus": "^0.1.0", "unplugin-element-plus": "^0.1.0",
"vite": "^2.6.11", "vite": "latest",
"vite-plugin-mock": "^2.9.6", "vite-plugin-mock": "^2.9.6",
"vite-plugin-style-import": "^1.2.1", "vite-plugin-style-import": "^1.2.1",
"vite-svg-loader": "^2.2.0", "vite-svg-loader": "^2.2.0",
"vue-eslint-parser": "^7.10.0" "vue-eslint-parser": "7.10.0"
}, },
"repository": "git@github.com:xiaoxian521/vue-pure-admin.git", "repository": "git@github.com:xiaoxian521/vue-pure-admin.git",
"author": "xiaoxian521", "author": "xiaoxian521",

5205
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load Diff

6
pnpm-workspace.yaml Normal file
View File

@ -0,0 +1,6 @@
#
packages:
- "build/**"
- "mock/**"
- "src/**"
- "types/**"

View File

@ -3,11 +3,13 @@ import path from "path";
import { storageLocal } from "/@/utils/storage"; import { storageLocal } from "/@/utils/storage";
import { PropType, ref, nextTick } from "vue"; import { PropType, ref, nextTick } from "vue";
import { childrenType } from "../../types"; import { childrenType } from "../../types";
import { useAppStoreHook } from "/@/store/modules/app";
import Icon from "/@/components/ReIcon/src/Icon.vue"; import Icon from "/@/components/ReIcon/src/Icon.vue";
const layout = ref( const layout = ref(
storageLocal.getItem("responsive-layout") || "vertical-dark" storageLocal.getItem("responsive-layout") || "vertical-dark"
); );
const menuMode = layout.value.layout.split("-")[0] === "vertical"; const menuMode = layout.value.layout.split("-")[0] === "vertical";
const pureApp = useAppStoreHook();
const props = defineProps({ const props = defineProps({
item: { item: {
@ -92,7 +94,15 @@ function resolvePath(routePath) {
></component> ></component>
</el-icon> </el-icon>
<template #title> <template #title>
<div style="display: flex; align-items: center; overflow: hidden"> <div
style="
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
overflow: hidden;
"
>
<span v-if="!menuMode">{{ $t(onlyOneChild.meta.title) }}</span> <span v-if="!menuMode">{{ $t(onlyOneChild.meta.title) }}</span>
<el-tooltip <el-tooltip
v-else v-else
@ -103,7 +113,11 @@ function resolvePath(routePath) {
<template #content> {{ $t(onlyOneChild.meta.title) }} </template> <template #content> {{ $t(onlyOneChild.meta.title) }} </template>
<span <span
ref="menuTextRef" ref="menuTextRef"
style="overflow: hidden; text-overflow: ellipsis" :style="{
width: pureApp.sidebar.opened ? '125px' : '',
overflow: 'hidden',
textOverflow: 'ellipsis'
}"
@mouseover="hoverMenu(onlyOneChild)" @mouseover="hoverMenu(onlyOneChild)"
> >
{{ $t(onlyOneChild.meta.title) }} {{ $t(onlyOneChild.meta.title) }}
@ -134,17 +148,17 @@ function resolvePath(routePath) {
v-else v-else
placement="top" placement="top"
:offset="-10" :offset="-10"
:disabled="!props.item.showTooltip" :disabled="!pureApp.sidebar.opened || !props.item.showTooltip"
> >
<template #content> {{ $t(props.item.meta.title) }} </template> <template #content> {{ $t(props.item.meta.title) }} </template>
<div <div
ref="menuTextRef" ref="menuTextRef"
style=" :style="{
display: inline-block; width: pureApp.sidebar.opened ? '125px' : '',
overflow: hidden; display: 'inline-block',
text-overflow: ellipsis; overflow: 'hidden',
width: 125px; textOverflow: 'ellipsis'
" }"
@mouseover="hoverMenu(props.item)" @mouseover="hoverMenu(props.item)"
> >
<span style="overflow: hidden; text-overflow: ellipsis"> <span style="overflow: hidden; text-overflow: ellipsis">

View File

@ -123,6 +123,7 @@
.el-menu-item, .el-menu-item,
.el-sub-menu__title { .el-sub-menu__title {
color: $menuText; color: $menuText;
padding: 0 16px 0 40px;
&:hover { &:hover {
color: $menuTitleHover !important; color: $menuTitleHover !important;

View File

@ -36,6 +36,10 @@ onBeforeUnmount(() => {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.main-content {
margin: 40px;
}
:deep(.w-e-text-container) { :deep(.w-e-text-container) {
z-index: 99 !important; z-index: 99 !important;
} }