Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: midfar/vue3-element-admin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3.4.30
Choose a base ref
...
head repository: midfar/vue3-element-admin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 20 commits
  • 44 files changed
  • 1 contributor

Commits on Jul 1, 2024

  1. Copy the full SHA
    2f01530 View commit details
  2. Copy the full SHA
    33ca726 View commit details

Commits on Jul 2, 2024

  1. feat: update README

    midfar committed Jul 2, 2024
    Copy the full SHA
    1048790 View commit details
  2. Copy the full SHA
    da4650e View commit details
  3. fix: warnings

    midfar committed Jul 2, 2024
    Copy the full SHA
    2d933ee View commit details
  4. Merge pull request #2 from midfar/demo/left-menu

    新增配置项:左侧菜单子目录气泡显示
    midfar authored Jul 2, 2024
    Copy the full SHA
    4f7a152 View commit details
  5. Copy the full SHA
    1ae2e40 View commit details

Commits on Jul 3, 2024

  1. feat: update README

    midfar committed Jul 3, 2024
    Copy the full SHA
    f84d5be View commit details
  2. feat: 汉化 & warning fix

    midfar committed Jul 3, 2024
    Copy the full SHA
    bcdca55 View commit details
  3. Copy the full SHA
    1a5ccf9 View commit details
  4. feat: update cn

    midfar committed Jul 3, 2024
    Copy the full SHA
    3305e43 View commit details

Commits on Jul 4, 2024

  1. feat: update name

    midfar committed Jul 4, 2024
    Copy the full SHA
    970ec91 View commit details
  2. fix: warnings

    midfar committed Jul 4, 2024
    Copy the full SHA
    f83e98c View commit details
  3. fix: css

    midfar committed Jul 4, 2024
    Copy the full SHA
    0b5d15f View commit details

Commits on Jul 11, 2024

  1. fix: store

    midfar committed Jul 11, 2024
    Copy the full SHA
    ad6fcee View commit details
  2. fix: icon

    midfar committed Jul 11, 2024
    Copy the full SHA
    1b6be1e View commit details

Commits on Nov 7, 2024

  1. Update README.md

    midfar authored Nov 7, 2024
    Copy the full SHA
    27404ce View commit details

Commits on Feb 24, 2025

  1. fix: reloading 问题

    midfar committed Feb 24, 2025
    Copy the full SHA
    1c7e3e1 View commit details
  2. Copy the full SHA
    ec0664a View commit details
  3. revert: router

    midfar committed Feb 24, 2025
    Copy the full SHA
    2941a0e View commit details
Showing with 272 additions and 217 deletions.
  1. +4 −4 .env.build_prod
  2. +5 −5 .env.build_test
  3. +5 −5 .env.dev_prod
  4. +6 −6 .env.dev_test
  5. +1 −5 CODE_OF_CONDUCT.md
  6. +10 −10 README.md
  7. +15 −0 components.d.ts
  8. +1 −1 index.html
  9. +6 −2 src/App.vue
  10. +6 −6 src/components/Breadcrumb/index.vue
  11. +10 −2 src/components/DragSelect/index.vue
  12. +1 −1 src/components/Dropzone/index.vue
  13. +4 −2 src/components/ErrorLog/index.vue
  14. +3 −4 src/components/SizeSelect/index.vue
  15. +4 −2 src/components/Tinymce/components/EditorImage.vue
  16. +1 −1 src/components/Tinymce/index.vue
  17. +9 −9 src/layout/components/Navbar.vue
  18. +23 −4 src/layout/components/Settings/index.vue
  19. +1 −1 src/layout/components/Sidebar/Logo.vue
  20. +15 −3 src/layout/components/Sidebar/SidebarItem.vue
  21. +7 −1 src/layout/components/Sidebar/index.vue
  22. +4 −4 src/layout/components/TagsView/index.vue
  23. +1 −1 src/permission.ts
  24. +28 −27 src/router/index.ts
  25. +4 −4 src/router/modules/charts.ts
  26. +7 −7 src/router/modules/components.ts
  27. +8 −8 src/router/modules/nested.ts
  28. +5 −5 src/router/modules/table.ts
  29. +8 −1 src/settings.ts
  30. +2 −2 src/store/modules/app.ts
  31. +3 −2 src/store/modules/settings.ts
  32. +8 −0 src/styles/sidebar.scss
  33. +1 −1 src/utils/get-page-title.js
  34. +4 −2 src/views/components-demo/mixin.vue
  35. +6 −6 src/views/dashboard/admin/components/RaddarChart.vue
  36. +2 −1 src/views/example/components/ArticleDetail.vue
  37. +4 −2 src/views/example/list.vue
  38. +0 −2 src/views/login/components/SocialSignin.vue
  39. +8 −65 src/views/mydemo/ElementDemo.vue
  40. +8 −0 src/views/mydemo/StoreDemo.vue
  41. +1 −1 src/views/tab/components/TabPane.vue
  42. +1 −1 src/views/tab/index.vue
  43. +3 −1 tsconfig.app.json
  44. +19 −0 vite.config.ts
8 changes: 4 additions & 4 deletions .env.build_prod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# just a flag
NODE_ENV = 'production'
# 打包模式连生产服
# just a flag
NODE_ENV = 'production'

# 打包模式连生产服
VUE_APP_BASE_API = '/api-prod'
10 changes: 5 additions & 5 deletions .env.build_test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# just a flag
NODE_ENV = 'production'
# 打包模式连测试服
#VUE_APP_BASE_API = './api-test'
# just a flag
NODE_ENV = 'production'

# 打包模式连测试服
#VUE_APP_BASE_API = './api-test'
VUE_APP_BASE_API = '/'
10 changes: 5 additions & 5 deletions .env.dev_prod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# just a flag
NODE_ENV = 'development'
# 开发模式连生产服
VUE_APP_BASE_API = '/api-prod'
# just a flag
NODE_ENV = 'development'

# 开发模式连生产服
VUE_APP_BASE_API = '/api-prod'
VUE_APP_COOKIE = ''
12 changes: 6 additions & 6 deletions .env.dev_test
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# just a flag
NODE_ENV = 'development'
# 开发模式连测试服
# VUE_APP_BASE_API = './api-test'
VUE_APP_BASE_API = '/'
# just a flag
NODE_ENV = 'development'

# 开发模式连测试服
# VUE_APP_BASE_API = './api-test'
VUE_APP_BASE_API = '/'
VUE_APP_COOKIE = ''
6 changes: 1 addition & 5 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
有助于提高编码效率和质量的行为包括:

- 1、遵守开发规范。
- 2、使用eslint+Prettier自动修复代码
- 2、使用eslint自动修复代码
- 3、代码行文尽量整洁规整。业务逻辑简洁、清晰。
- 4、核心业务上必须要有注释,头部需要有注释便与溯源。
- 5、公共组件开发需要记录文档且注释丰富。
@@ -37,7 +37,3 @@
- 4、细节是否完善、整体代码行文。
- 5、业务逻辑和代码细节是否合理。

## 相关文档

- 前端通用开发规范 [http://172.18.7.186:8181/read/team/prefix_59454ed663cdb4bb8d542c1967a62056.md]

20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@

## 推荐的 IDE 工具和插件

[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (禁用 Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
[VSCode](https://code.visualstudio.com/) + [Vue - Official](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (需禁用旧插件 Vetur、Volar ) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

## Vite 构建工具配置

@@ -57,6 +57,12 @@

## 使用

### 确定本地的node版本>=20。本地使用v20.18.0验证通过。

```sh
node -v
```

### 安装依赖

```sh
@@ -85,15 +91,9 @@ npm run lint

现代浏览器。

| IE/Edge | Firefox | Chrome | Safari |
| ---------------- | --------------- | --------------- | --------------- |
| IE10, IE11, Edge | last 2 versions | last 2 versions | last 2 versions |

## TODO

当前问题

- 暂未配置git提交规范。
| Chrome | Edge | Firefox | Safari |
| --------------- | --------------- | --------------- | --------------- |
| Chrome ≥ 85 | Edge ≥ 85 | Firefox ≥ 79 | Safari ≥ 14.1 |

## 参与贡献

15 changes: 15 additions & 0 deletions components.d.ts
Original file line number Diff line number Diff line change
@@ -13,13 +13,19 @@ declare module 'vue' {
DropdownMenu: typeof import('./src/components/Share/DropdownMenu.vue')['default']
Dropzone: typeof import('./src/components/Dropzone/index.vue')['default']
EditorImage: typeof import('./src/components/Tinymce/components/EditorImage.vue')['default']
ElAlert: typeof import('element-plus/es')['ElAlert']
ElBadge: typeof import('element-plus/es')['ElBadge']
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard']
ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
ElCol: typeof import('element-plus/es')['ElCol']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElDropdown: typeof import('element-plus/es')['ElDropdown']
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
@@ -31,19 +37,25 @@ declare module 'vue' {
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElProgress: typeof import('element-plus/es')['ElProgress']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRate: typeof import('element-plus/es')['ElRate']
ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSlider: typeof import('element-plus/es')['ElSlider']
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTag: typeof import('element-plus/es')['ElTag']
ElTimeline: typeof import('element-plus/es')['ElTimeline']
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree']
ElUpload: typeof import('element-plus/es')['ElUpload']
@@ -73,4 +85,7 @@ declare module 'vue' {
UploadExcel: typeof import('./src/components/UploadExcel/index.vue')['default']
VueCountTo: typeof import('./src/components/vue-count-to/vue-countTo.vue')['default']
}
export interface ComponentCustomProperties {
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
}
}
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
<title>Vue3 Element Admin</title>
</head>
<body>
<div id="app"></div>
8 changes: 6 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -8,16 +8,20 @@
import { defineComponent } from 'vue';
import { ElConfigProvider } from 'element-plus';
import zhCn from 'element-plus/dist/locale/zh-cn.mjs';
import { mapState } from 'pinia';
import store from '@/store';

export default defineComponent({
components: {
ElConfigProvider
},
computed: {
...mapState(store.app, ['size'])
},
data() {
return {
locale: zhCn,
zIndex: 3000,
size: 'default'
zIndex: 3000
};
}
});
12 changes: 6 additions & 6 deletions src/components/Breadcrumb/index.vue
Original file line number Diff line number Diff line change
@@ -37,12 +37,12 @@ export default defineComponent({
methods: {
getBreadcrumb() {
// only show routes with meta.title
let matched = this.$route.matched.filter(item => item.meta && item.meta.title);
const first = matched[0];

if (!this.isDashboard(first)) {
matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched);
}
const matched = this.$route.matched.filter(item => item.meta && item.meta.title);
// const first = matched[0];
//
// if (!this.isDashboard(first)) {
// matched = [{ path: '/dashboard', meta: { title: '首页' }}].concat(matched);
// }

this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false);
},
12 changes: 10 additions & 2 deletions src/components/DragSelect/index.vue
Original file line number Diff line number Diff line change
@@ -14,6 +14,14 @@ export default defineComponent({
modelValue: {
type: Array,
required: true
},
placeholder: {
type: String,
default: null
},
style: {
type: [String, Object],
default: null
}
},
computed: {
@@ -31,7 +39,7 @@ export default defineComponent({
},
methods: {
setSort() {
const el = this.$refs.dragSelect.$el.querySelectorAll('.el-select__tags > span')[0];
const el = this.$refs.dragSelect.$el.querySelector('.el-select__wrapper .el-select__selection');
this.sortable = Sortable.create(el, {
ghostClass: 'sortable-ghost', // Class name for the drop placeholder,
setData: function(dataTransfer) {
@@ -52,7 +60,7 @@ export default defineComponent({

<style lang="scss" scoped>
.drag-select {
:deep(.sortable-ghost) {
:deep(.sortable-ghost .el-tag) {
opacity: .8;
color: #fff !important;
background: #42b983 !important;
2 changes: 1 addition & 1 deletion src/components/Dropzone/index.vue
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@ export default defineComponent({
},
accept: (file, done) => {
/* 七牛*/
// const token = this.$store.getters.token;
// const token = store.user().token;
// getToken(token).then(response => {
// file.token = response.data.qiniu_token;
// file.key = response.data.qiniu_key;
6 changes: 4 additions & 2 deletions src/components/ErrorLog/index.vue
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
<template v-slot:title>
<div class="text-title">
<span style="padding-right: 10px;">Error Log</span>
<el-button size="small" type="primary" icon="el-icon-delete" @click="clearAll">Clear All</el-button>
<el-button size="small" type="primary" :icon="IconDelete" @click="clearAll">Clear All</el-button>
</div>
</template>
<el-table :data="errorLogs" border>
@@ -49,13 +49,15 @@
</template>

<script>
import { defineComponent } from 'vue';
import { defineComponent, markRaw } from 'vue';
import store from '@/store';
import { Delete as IconDelete } from '@element-plus/icons-vue';

export default defineComponent({
name: 'ErrorLog',
data() {
return {
IconDelete: markRaw(IconDelete),
dialogTableVisible: false
};
},
7 changes: 3 additions & 4 deletions src/components/SizeSelect/index.vue
Original file line number Diff line number Diff line change
@@ -22,9 +22,9 @@ export default defineComponent({
data() {
return {
sizeOptions: [
{ label: 'Default', value: 'default' },
{ label: 'Large', value: 'large' },
{ label: 'small', value: 'default' }
{ label: '默认', value: 'default' },
{ label: '大号', value: 'large' },
{ label: '小号', value: 'small' }
]
};
},
@@ -35,7 +35,6 @@ export default defineComponent({
},
methods: {
handleSetSize(size) {
this.$ELEMENT.size = size;
store.app().setSize(size);
this.refreshView();
ElMessage({
6 changes: 4 additions & 2 deletions src/components/Tinymce/components/EditorImage.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="upload-container">
<el-button :style="{background:color,borderColor:color}" icon="el-icon-upload" size="small" type="primary" @click=" dialogVisible=true">
<el-button :style="{background:color,borderColor:color}" :icon="IconUpload" size="small" type="primary" @click=" dialogVisible=true">
upload
</el-button>
<el-dialog v-model="dialogVisible">
@@ -30,7 +30,8 @@
</template>

<script>
import { defineComponent } from 'vue';
import { defineComponent, markRaw } from 'vue';
import { Upload as IconUpload } from '@element-plus/icons-vue';
// import { getToken } from 'api/qiniu'

export default defineComponent({
@@ -43,6 +44,7 @@ export default defineComponent({
},
data() {
return {
IconUpload: markRaw(IconUpload),
dialogVisible: false,
listObj: {},
fileList: []
2 changes: 1 addition & 1 deletion src/components/Tinymce/index.vue
Original file line number Diff line number Diff line change
@@ -174,7 +174,7 @@ export default defineComponent({
// },
// images_upload_handler(blobInfo, success, failure, progress) {
// progress(0);
// const token = that.$store.getters.token;
// const token = store.user().token;
// getToken(token).then(response => {
// const url = response.data.qiniu_url;
// const formData = new FormData();
18 changes: 9 additions & 9 deletions src/layout/components/Navbar.vue
Original file line number Diff line number Diff line change
@@ -13,9 +13,9 @@

<screenfull id="screenfull" class="right-menu-item hover-effect" />

<!-- <el-tooltip content="Global Size" effect="dark" placement="bottom">
<el-tooltip content="全局组件尺寸" effect="dark" placement="bottom">
<size-select id="size-select" class="right-menu-item hover-effect" />
</el-tooltip> -->
</el-tooltip>

</template>

@@ -29,19 +29,19 @@
<template #dropdown>
<el-dropdown-menu>
<router-link to="/profile/index">
<el-dropdown-item>Profile</el-dropdown-item>
<el-dropdown-item>个人中心</el-dropdown-item>
</router-link>
<router-link to="/">
<el-dropdown-item>Dashboard</el-dropdown-item>
<el-dropdown-item>首页</el-dropdown-item>
</router-link>
<a target="_blank" href="https://github.com/midfar/vue3-element-admin">
<el-dropdown-item>Github</el-dropdown-item>
<el-dropdown-item>项目地址</el-dropdown-item>
</a>
<a target="_blank" href="https://vue3-element-admin-site.midfar.com/">
<el-dropdown-item>Docs</el-dropdown-item>
<el-dropdown-item>文档地址</el-dropdown-item>
</a>
<el-dropdown-item divided @click="logout">
<span style="display:block;">Log Out</span>
<span style="display:block;">退出登录</span>
</el-dropdown-item>
</el-dropdown-menu>
</template>
@@ -57,7 +57,7 @@ import Breadcrumb from '@/components/Breadcrumb';
import Hamburger from '@/components/Hamburger';
import ErrorLog from '@/components/ErrorLog';
import Screenfull from '@/components/Screenfull';
// import SizeSelect from '@/components/SizeSelect';
import SizeSelect from '@/components/SizeSelect';
import Search from '@/components/HeaderSearch';
import { defineComponent } from 'vue';
import { CaretBottom } from '@element-plus/icons-vue';
@@ -68,7 +68,7 @@ export default defineComponent({
Hamburger,
ErrorLog,
Screenfull,
// SizeSelect,
SizeSelect,
Search,
CaretBottom
},
Loading