1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-12 22:29:59 +08:00
Edwin Betancourt cc35fd7a1d
feat: Update fork repository (#514)
* chore: remove i18n (#1828)

* [release] 4.1.0

* perf[Profile]: adapt the profile page to the mobile (#2020)

* Revert "perf: optimize page scrolling when setting fixedHeader"

This reverts commit e8e6c7e79c2488779090f00efc5f1bbfcb04bd5b.

* perf[Style]: refine fixed-header style when open el-dialog

* doc: add new article

* chore: use mockjs in production environment

* fix[sidebar.css]: remove redundant css

* perf[style]: refine dashboard style in mobile (#2060)

* feat[ErrorLog]: add a clear button in ErrorLog component (#2065)

* fix[redirect]: fix redirect bug in vue-devtools (#2066)

* perf[Tinymce]: update tinymce cdn version

* fix[redirect]: fix redirect bug in vue-devtool again

* docs: add support to readme for Spanish (#2070)

* docs[es]: add some translation(#2080)

* perf[Exapme]: set page title  according to article id

* perf[RightPanel]: tidy css (#2101)

* feat[SvgIcon]: support import svg from url (#2052)

* fix: fixed change roles bug (#2072)

* perf[Breadcrumb]: do not update breadcrumbs when go to redirect page (#2086)

* perf[store]: add support to sub-modules (#2047)

* perf[Login]: support other query (#2013)

* refactor[chore]: generate postcss.config.js instead of .postcssrc.js

consistent with vue-cli

* perf[Tinymce]: dynamic import tinymce(#2102)

* [release] 4.2.0

* docs: add support to readme for Spanish (#2070)

* docs[es]: add some translation(#2080)

* perf[Exapme]: set page title  according to article id

* perf[RightPanel]: tidy css (#2101)

* feat[SvgIcon]: support import svg from url (#2052)

* fix: fixed change roles bug (#2072)

* perf[Breadcrumb]: do not update breadcrumbs when go to redirect page (#2086)

* perf[store]: add support to sub-modules (#2047)

* perf[Login]: support other query (#2013)

* refactor[chore]: generate postcss.config.js instead of .postcssrc.js

consistent with vue-cli

* perf[Tinymce]: dynamic import tinymce(#2102)

* [release] 4.2.0

* perf[Style]: refine example css

* fix[Chart]: fixed chart bug in keep-alive (#2119)

* perf[Style]: refine example css

* fix[Chart]: fixed chart bug in keep-alive (#2119)

* Create FUNDING.yml

* chore: set localhost => 127.0.0.1 (#2142)

* update github ISSUE_TEMPLATE

* chore: add autoprefixer to devDependencies

* perf[Tinymce]: add language option (#2159)

* fix[Tinymce]: fixed bug when init multiple tinymces at the same time (#2152)

* feat: add tab url demo (#2114)

* perf[request.js]: refine error reject (#2160)

* [release] 4.2.1

* Create FUNDING.yml

* chore: set localhost => 127.0.0.1 (#2142)

* update github ISSUE_TEMPLATE

* chore: add autoprefixer to devDependencies

* fix[Tinymce]: fixed bug when init multiple tinymces at the same time (#2152)

* feat: add tab url demo (#2114)

* perf[request.js]: refine error reject (#2160)

* [release] 4.2.1

* perf: default not set withCredentials

* fix[ImageCropper]: removeEventListener when destroyed(#2169)

* docs: fix typo (#2170)

* fix: input attribute autocomplete error (#2191)

* perf: default not set withCredentials

* fix[ImageCropper]: removeEventListener when destroyed(#2169)

* docs: fix typo (#2170)

* fix: input attribute autocomplete error (#2191)

* perf[PanThumb]: Replace the image tag with background-image to prevent the stretching (#2202)

* docs: fix typo README.zh-CN.md (#2283)

修改错别字

* perf[clipboard.js]: remove redundant code (#2307)

* bump:  update axios for security vulnerability

* bump: update @vue/cli-plugin-eslint version (#2327)

FIx  cannot find module '.../node_modules/eslint/lib/api.js/package.json' bug,see https://github.com/vuejs/vue-cli/issues/4231.

* chore: allow dynamic set port

* fix[complex-table]: form header sort icon is out of sync (#2382)

* fix: fixed missing icons

* fix: typos (#2532)

Role Nmae => Role Name

* docs: add awesome-project

* fix[Dashboard]: fixed debounce bug (#2586) (#2597)

To fixed https://github.com/PanJiaChen/vue-element-admin/issues/2586

* perf: VS Code support webpack alias file jump (#2609)

* perf: optimize import file-saver way(#2347)

* refactor[ImageCropper]: fix lint error (#2365)

* fix: fixed numberFormatter  bug

https://github.com/PanJiaChen/vue-element-admin/issues/2568

* fix[example]: fixed create.vue cache error

https://github.com/PanJiaChen/vue-element-admin/issues/2608

* perf[utils.js]: perf parseTime function (#2625)

* perf[tagsView]: pref DEL_CACHED_VIEW and DEL_OTHERS_CACHED_VIEWS function (#2626)

* fix[tagsView]: fixed DEL_OTHERS_CACHED_VIEWS bug

* fix[logout]: empty tagsview when logout (#2632)

* fix[TagsView]: fixed toLastView bug (#2634)

* perf[SvgIcon]: change xlink:href to href(#2645)

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href

* fix[TagsView]: fixed click.middle can close affixed tag bug (#2649)

* docs: add job ad

* perf[PanThumb]: Replace the image tag with background-image to prevent the stretching (#2202)

* docs: fix typo README.zh-CN.md (#2283)

修改错别字

* perf[clipboard.js]: remove redundant code (#2307)

* bump:  update axios for security vulnerability

* bump: update @vue/cli-plugin-eslint version (#2327)

FIx  cannot find module '.../node_modules/eslint/lib/api.js/package.json' bug,see https://github.com/vuejs/vue-cli/issues/4231.

* chore: allow dynamic set port

* fix[complex-table]: form header sort icon is out of sync (#2382)

* fix: fixed missing icons

* fix: typos (#2532)

Role Nmae => Role Name

* docs: add awesome-project

* fix[Dashboard]: fixed debounce bug (#2586) (#2597)

To fixed https://github.com/PanJiaChen/vue-element-admin/issues/2586

* perf: VS Code support webpack alias file jump (#2609)

* perf: optimize import file-saver way(#2347)

* refactor[ImageCropper]: fix lint error (#2365)

* fix: fixed numberFormatter  bug

https://github.com/PanJiaChen/vue-element-admin/issues/2568

* fix[example]: fixed create.vue cache error

https://github.com/PanJiaChen/vue-element-admin/issues/2608

* perf[utils.js]: perf parseTime function (#2625)

* perf[tagsView]: pref DEL_CACHED_VIEW and DEL_OTHERS_CACHED_VIEWS function (#2626)

* fix[tagsView]: fixed DEL_OTHERS_CACHED_VIEWS bug

* fix[logout]: empty tagsview when logout (#2632)

* fix[TagsView]: fixed toLastView bug (#2634)

* perf[SvgIcon]: change xlink:href to href(#2645)

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href

* fix[TagsView]: fixed click.middle can close affixed tag bug (#2649)

* docs: add job ad

* feat: add job

* docs: improved README.md (#2656)

* style: fix el-date-picker css style

* perf: format dropdown menu code (#2720)

* perf: format inline edit table (#2725)

move one format `{row}`

* perf: format drag table (#2733)

move one format `{row}`

* perf: complex table (#2732)

* perf: text i18n (#2739)

* update 'MarkdownEditor' components name

* format: space in user card (#2744)

* perf: format pdf download (#2791)

* perf[views/icons]: use grid (#2803)

* feat: plop new generate store (#2805)

* fix[icons]:fixed eslint 1 error and 2 warnings (#2835)

* perf[documentation]:  refine css

* fix[Logout]: click blank area of ​​dropDown able to logout (#2896)

* perf: import mockXHR only in production (#2910)

* 自动排除mock

生产环境,使用webpack的条件编译自动排除mock数据

* perf: refine

Co-authored-by: 花裤衩 <panfree23@gmail.com>

* perf[Menu]: remove unused menu-wrapper (#2903)

* perf[complex-table]:refine code (#2825)

* perf: optimize checkCapslock method (#2635)

* optimize checkCapslock method

* update

Co-authored-by: 花裤衩 <panfree23@gmail.com>

* fix[Charts]: fix charts resize in keep-alive bug (#2922)

* fix[Charts]: fix charts resize in keep-alive bug

* refine

* fix: fixed mock server (#2929)

* init

* refine

* update

* bump: update element-ui version

* fix: fixed require mock bug in production

* feat[Search]: route search supports pinyin (#2643)

* fix: fixed redirect path regex (#2933)

* perf[Mock]: set responseFake to mock-server.js(#2966)

* modify 把mock/index.js中与mock-server相关的代码转移到mock-server.js中去,实现两则功能分割

* docs: improve Japanese translation (#2970)

* perf: change script-loader to dependencies

* fix[profile/UserCard]: fixed wrong key name (#3056)

roles => role

* fix:fixed parseTime bug in ie and safari(#3066)

* /src/utils/index.js parseTime 添加IE浏览器(版本10以下,包括版本10)兼容。

* perf: update

Co-authored-by: aisen60 <aisen60@qq.com>
Co-authored-by: 花裤衩 <panfree23@gmail.com>

* perf: format component names as PascalCase (#3074)

format: component names should be PascalCase

* docs: add smallsticker

* Update README.zh-CN.md

* fix: svg support old broswer (#3085)

* fixed typo (#3091)

* fix: use vue-cli default source-map (#3097)

cheap-module-eval-source-map

* perf[Tinymce]: editor try to keep these URLs intact (#3141)

* fix[element-variables]: missing space in element-variables (#3144)

* fix: compatibility with vetur (#1700)

* feat: add option to try project on CodeSandbox (#2976)

* docs: add tips

* perf: when tags-view scroll close the right-menu

* fix[parseTime]: fixed when pass null (#3038)

* fix[css]: min btn width (#3164)

* Add contributor into package.json file.

* fixed before merge.

Co-authored-by: 花裤衩 <panfree23@gmail.com>
Co-authored-by: toruksmakto <42709228+toruksmakto@users.noreply.github.com>
Co-authored-by: Yamel Senih <ysenih@erpya.com>
Co-authored-by: Yamel Senih <yamelsenih@gmail.com>
Co-authored-by: liugq <liugq5713@gmail.com>
Co-authored-by: bpzhang <bpzhang@users.noreply.github.com>
Co-authored-by: Serge <gaosj1993@foxmail.com>
Co-authored-by: MaYuanhai <414199639@qq.com>
Co-authored-by: Jessynt <xr5299@gmail.com>
Co-authored-by: 肖敏 <392716797@qq.com>
Co-authored-by: TinaryTree <mbdkhss@gmail.com>
Co-authored-by: itsccn <chen.sun@itsccn.com>
Co-authored-by: why <w.why@163.com>
Co-authored-by: Baskerville* <wszdlm@gmail.com>
Co-authored-by: Francis <31059354+FrancisSano@users.noreply.github.com>
Co-authored-by: monkeycf <41945134+monkeycf@users.noreply.github.com>
Co-authored-by: BradyBromley <51128276+BradyBromley@users.noreply.github.com>
Co-authored-by: Phạm Ngọc Hòa <thaycacac@gmail.com>
Co-authored-by: bbigcd <bbigcd@163.com>
Co-authored-by: xuanzai <43233731+MikuBlog@users.noreply.github.com>
Co-authored-by: flitrue <812863096@qq.com>
Co-authored-by: 韬 <605682551@qq.com>
Co-authored-by: 任羽飞 <ren12345@126.com>
Co-authored-by: Kaitian Xie <xkaitian@gmail.com>
Co-authored-by: AndyLZC/AndyLZC.github.io <34624589+AndyLZC@users.noreply.github.com>
Co-authored-by: RussXD <shangtouWeb@foxmail.com>
Co-authored-by: 李小斐 <623536309@qq.com>
Co-authored-by: RoBlues <robluesmail@gmail.com>
Co-authored-by: Shota Aratono <195194+artn@users.noreply.github.com>
Co-authored-by: echofly <36875450+echofly@users.noreply.github.com>
Co-authored-by: Aisen60 <1147319086@qq.com>
Co-authored-by: aisen60 <aisen60@qq.com>
Co-authored-by: Alex S <50220345+sabatale@users.noreply.github.com>
Co-authored-by: Aisen <caixusheng60@gmail.com>
Co-authored-by: ntnyq <ntnyq13@gmail.com>
Co-authored-by: garethx <gareth.wilson@gmail.com>
Co-authored-by: AiMe1991 <sxd.08@163.com>
Co-authored-by: cooper <1322849632@qq.com>
Co-authored-by: Nickbing Lao <giscafer@outlook.com>
2020-06-19 10:12:27 -04:00

226 lines
6.2 KiB
Vue

<template>
<div class="navbar">
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
<el-button v-if="isMenuMobile && isMobile" type="text" icon="el-icon-close" style="padding-top: 13px; color: #000000;font-size: 121%;font-weight: 615!important;" @click="isMenuOption()" />
<breadcrumb v-show="!isMenuMobile || device!=='mobile'" id="breadcrumb-container" class="breadcrumb-container" :style="isMobile ? { width: '40%' } : { width: 'auto' } " />
<div v-show="isMenuMobile && isMobile" style="display: inline-flex; float: right;">
<search id="header-search" class="right-menu-item" style="padding-top: 10px;" />
<badge style="padding-top: 6px;" />
<!-- <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="hover">
<div class="avatar-wrapper">
<img :src="avatar+'?imageView2/1/w/80/h/80'" class="user-avatar">
<i class="el-icon-caret-bottom" />
</div>
<el-dropdown-menu slot="dropdown">
<router-link to="/profile/index">
<el-dropdown-item>
{{ $t('navbar.profile') }}
</el-dropdown-item>
</router-link>
<router-link to="/">
<el-dropdown-item>
{{ $t('navbar.dashboard') }}
</el-dropdown-item>
</router-link>
<a target="_blank" href="https://github.com/PanJiaChen/vue-element-admin/">
<el-dropdown-item>
{{ $t('navbar.github') }}
</el-dropdown-item>
</a>
<a target="_blank" href="https://panjiachen.github.io/vue-element-admin-site/#/">
<el-dropdown-item>Docs</el-dropdown-item>
</a>
<el-dropdown-item divided @click.native="logout">
<span style="display:block;">{{ $t('navbar.logOut') }}</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown> -->
</div>
<div class="right-menu">
<template v-if="device!=='mobile'">
<search id="header-search" class="right-menu-item" />
<badge />
<error-log class="errLog-container right-menu-item hover-effect" />
<screenfull id="screenfull" class="right-menu-item hover-effect" />
<el-tooltip :content="$t('navbar.size')" effect="dark" placement="bottom">
<size-select id="size-select" class="right-menu-item hover-effect" />
</el-tooltip>
<lang-select class="right-menu-item hover-effect" />
</template>
<el-button v-show="!isMenuMobile && isMobile" type="text" icon="el-icon-more" @click="isMenuOption()" />
<el-popover
placement="bottom"
width="245"
trigger="click"
>
<div>
<user-card :user="user" />
<el-button type="text" style="float: left;" @click="handleClick">{{ $t('navbar.profile') }}</el-button>
<el-button type="text" style="float: right;" @click="logout">{{ $t('navbar.logOut') }}</el-button>
</div>
<el-button slot="reference" type="text" style="padding-top: 0px;"><img :src="avatar+'?imageView2/1/w/40/h/40'" class="user-avatar"></el-button>
</el-popover>
</div>
</div>
</template>
<script>
import UserCard from '@/views/profile/components/Profile'
import { mapGetters } from 'vuex'
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 LangSelect from '@/components/LangSelect'
import Search from '@/components/HeaderSearch'
import Badge from '@/components/ADempiere/Badge'
export default {
components: {
Breadcrumb,
Badge,
Hamburger,
ErrorLog,
Screenfull,
SizeSelect,
LangSelect,
UserCard,
Search
},
data() {
return {
user: {},
isMenuMobile: false
}
},
computed: {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
...mapGetters([
'sidebar',
'avatar',
'device'
])
},
methods: {
handleOpen(key, keyPath) {
console.log(key, keyPath)
},
handleClose(key, keyPath) {
console.log(key, keyPath)
},
isMenuOption() {
this.isMenuMobile = !this.isMenuMobile
},
toggleSideBar() {
this.$store.dispatch('app/toggleSideBar')
},
async logout() {
await this.$store.dispatch('user/logout')
this.$router.push({ path: '/login', query: { redirect: this.$route.fullPath }})
},
handleClick() {
this.$router.push({ name: 'Profile' })
}
}
}
</script>
<style lang="scss" scoped>
.el-dropdown {
display: inline-block;
position: relative;
color: #606266;
font-size: 14px;
width: 50px;
}
.navbar {
height: 50px;
overflow: hidden;
position: relative;
background: #fff;
box-shadow: 0 1px 4px rgba(0,21,41,.08);
.hamburger-container {
line-height: 46px;
height: 100%;
float: left;
cursor: pointer;
transition: background .3s;
-webkit-tap-highlight-color:transparent;
&:hover {
background: rgba(0, 0, 0, .025)
}
}
.breadcrumb-container {
float: left;
}
.errLog-container {
display: inline-block;
vertical-align: top;
}
.right-menu {
float: right;
display: flex;
height: 100%;
line-height: 50px;
&:focus {
outline: none;
}
.right-menu-item {
display: inline-block;
padding: 0 8px;
height: 100%;
font-size: 18px;
color: #5a5e66;
vertical-align: text-bottom;
&.hover-effect {
cursor: pointer;
transition: background .3s;
&:hover {
background: rgba(0, 0, 0, .025)
}
}
}
.avatar-container {
margin-right: 30px;
.avatar-wrapper {
margin-top: 5px;
position: relative;
.user-avatar {
cursor: pointer;
width: 40px;
height: 40px;
border-radius: 10px;
}
.el-icon-caret-bottom {
cursor: pointer;
position: absolute;
right: -20px;
top: 25px;
font-size: 12px;
}
}
}
}
}
</style>