Merge pull request #1 from PanJiaChen/master

update
This commit is contained in:
MaYuanhai 2019-04-04 17:19:03 +08:00 committed by GitHub
commit f7b6f2005c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 126 additions and 47 deletions

33
.github/ISSUE_TEMPLATE/bug_report.md vendored Executable file
View File

@ -0,0 +1,33 @@
---
name: Bug report报告问题
about: Create a report to help us improve
---
<!--
注意:为更好的解决你的问题,请参考模板提供完整信息,准确描述问题,信息不全的 issue 将被关闭。
Note: In order to better solve your problem, please refer to the template to provide complete information, accurately describe the problem, and the incomplete information issue will be closed.
-->
## Bug report问题描述
#### Steps to reproduce问题复现步骤
<!--
1. [xxx]
2. [xxx]
3. [xxxx]
-->
#### Screenshot or Gif截图或动态图
#### Link to minimal reproduction最小可在线还原demo
<!--
Please only use Codepen, JSFiddle, CodeSandbox or a github repo
-->
#### Other relevant information格外信息
- Your OS:
- Node.js version:
- vue-element-admin version:

7
.github/ISSUE_TEMPLATE/feature_request.md vendored Executable file
View File

@ -0,0 +1,7 @@
---
name: Feature Request新功能建议
about: Suggest an idea for this project
---
## Feature request新功能建议

14
.github/ISSUE_TEMPLATE/question.md vendored Executable file
View File

@ -0,0 +1,14 @@
---
name: Question提问
about: Asking questions about use
---
## Question提问
<!--
提问之前,请确定你已经过自己的努力,尝试解决过这个问题。
若是代码相关问题,请不要只截图,请提供在线 demo以便节约彼此的时间。
Before asking a question, please make sure that you have tried your best to solve this problem.
If it's a code-related issue, please don't just take screenshots. Please provide an online demo to save each other's time.
-->

View File

@ -19,7 +19,7 @@ export const constantRoutes = [
}, },
{ {
path: '/auth-redirect', path: '/auth-redirect',
component: 'views/login/authredirect', component: 'views/login/authRedirect',
hidden: true hidden: true
}, },
{ {

View File

@ -2,7 +2,7 @@
<div class="dndList"> <div class="dndList">
<div :style="{width:width1}" class="dndList-list"> <div :style="{width:width1}" class="dndList-list">
<h3>{{ list1Title }}</h3> <h3>{{ list1Title }}</h3>
<draggable :list="list1" group="article" class="dragArea"> <draggable :set-data="setData" :list="list1" group="article" class="dragArea">
<div v-for="element in list1" :key="element.id" class="list-complete-item"> <div v-for="element in list1" :key="element.id" class="list-complete-item">
<div class="list-complete-item-handle"> <div class="list-complete-item-handle">
{{ element.id }}[{{ element.author }}] {{ element.title }} {{ element.id }}[{{ element.author }}] {{ element.title }}
@ -94,6 +94,11 @@ export default {
if (this.isNotInList1(ele)) { if (this.isNotInList1(ele)) {
this.list1.push(ele) this.list1.push(ele)
} }
},
setData(dataTransfer) {
// to avoid Firefox bug
// Detail see : https://github.com/RubaXa/Sortable/issues/1012
dataTransfer.setData('Text', '')
} }
} }
} }

View File

@ -7,6 +7,7 @@
:list="list" :list="list"
v-bind="$attrs" v-bind="$attrs"
class="board-column-content" class="board-column-content"
:set-data="setData"
> >
<div v-for="element in list" :key="element.id" class="board-item"> <div v-for="element in list" :key="element.id" class="board-item">
{{ element.name }} {{ element.id }} {{ element.name }} {{ element.id }}
@ -39,6 +40,13 @@ export default {
return [] return []
} }
} }
},
methods: {
setData(dataTransfer) {
// to avoid Firefox bug
// Detail see : https://github.com/RubaXa/Sortable/issues/1012
dataTransfer.setData('Text', '')
}
} }
} }
</script> </script>

View File

@ -24,11 +24,24 @@ const messages = {
...elementEsLocale ...elementEsLocale
} }
} }
export function getLanguage() {
const chooseLanguage = Cookies.get('language')
if (chooseLanguage) return chooseLanguage
// if has not choose language
const language = (navigator.language || navigator.browserLanguage).toLowerCase()
const locales = Object.keys(messages)
for (const locale of locales) {
if (language.indexOf(locale) > -1) {
return locale
}
}
return 'en'
}
const i18n = new VueI18n({ const i18n = new VueI18n({
// set locale // set locale
// options: en | zh | es // options: en | zh | es
locale: Cookies.get('language') || 'en', locale: getLanguage(),
// set locale messages // set locale messages
messages messages
}) })

View File

@ -1,19 +1,19 @@
<template> <template>
<div class="navbar"> <div class="navbar">
<hamburger :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
<breadcrumb class="breadcrumb-container" /> <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
<div class="right-menu"> <div class="right-menu">
<template v-if="device!=='mobile'"> <template v-if="device!=='mobile'">
<search class="right-menu-item" /> <search id="header-search" class="right-menu-item" />
<error-log class="errLog-container right-menu-item hover-effect" /> <error-log class="errLog-container right-menu-item hover-effect" />
<screenfull class="right-menu-item hover-effect" /> <screenfull id="screenfull" class="right-menu-item hover-effect" />
<el-tooltip :content="$t('navbar.size')" effect="dark" placement="bottom"> <el-tooltip :content="$t('navbar.size')" effect="dark" placement="bottom">
<size-select class="right-menu-item hover-effect" /> <size-select id="size-select" class="right-menu-item hover-effect" />
</el-tooltip> </el-tooltip>
<lang-select class="right-menu-item hover-effect" /> <lang-select class="right-menu-item hover-effect" />

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="tags-view-container"> <div id="tags-view-container" class="tags-view-container">
<scroll-pane ref="scrollPane" class="tags-view-wrapper"> <scroll-pane ref="scrollPane" class="tags-view-wrapper">
<router-link <router-link
v-for="tag in visitedViews" v-for="tag in visitedViews"
@ -243,7 +243,7 @@ export default {
.contextmenu { .contextmenu {
margin: 0; margin: 0;
background: #fff; background: #fff;
z-index: 100; z-index: 3000;
position: absolute; position: absolute;
list-style-type: none; list-style-type: none;
padding: 5px 0; padding: 5px 0;

View File

@ -57,7 +57,7 @@ export const constantRoutes = [
}, },
{ {
path: '/auth-redirect', path: '/auth-redirect',
component: () => import('@/views/login/authredirect'), component: () => import('@/views/login/authRedirect'),
hidden: true hidden: true
}, },
{ {

View File

@ -1,24 +1,24 @@
import Vue from 'vue' import Vue from 'vue'
import Vuex from 'vuex' import Vuex from 'vuex'
import app from './modules/app'
import errorLog from './modules/errorLog'
import permission from './modules/permission'
import tagsView from './modules/tagsView'
import settings from './modules/settings'
import user from './modules/user'
import getters from './getters' import getters from './getters'
Vue.use(Vuex) Vue.use(Vuex)
// https://webpack.js.org/guides/dependency-management/#requirecontext
const modulesFiles = require.context('./modules', false, /\.js$/)
// you do not need `import app from './modules/app'`
// it will auto require all vuex module from modules file
const modules = modulesFiles.keys().reduce((modules, modulePath) => {
// set './app.js' => 'app'
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
const value = modulesFiles(modulePath)
modules[moduleName] = value.default
return modules
}, {})
const store = new Vuex.Store({ const store = new Vuex.Store({
modules: { modules,
app,
errorLog,
permission,
tagsView,
settings,
user
},
getters getters
}) })

View File

@ -1,4 +1,5 @@
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
import { getLanguage } from '@/lang/index'
const state = { const state = {
sidebar: { sidebar: {
@ -6,7 +7,7 @@ const state = {
withoutAnimation: false withoutAnimation: false
}, },
device: 'desktop', device: 'desktop',
language: Cookies.get('language') || 'en', language: getLanguage(),
size: Cookies.get('size') || 'medium' size: Cookies.get('size') || 'medium'
} }

View File

@ -1,4 +1,3 @@
const state = { const state = {
logs: [] logs: []
} }

View File

@ -1,4 +1,3 @@
const state = { const state = {
visitedViews: [], visitedViews: [],
cachedViews: [] cachedViews: []

View File

@ -1,6 +1,6 @@
const steps = [ const steps = [
{ {
element: '.hamburger-container', element: '#hamburger-container',
popover: { popover: {
title: 'Hamburger', title: 'Hamburger',
description: 'Open && Close sidebar', description: 'Open && Close sidebar',
@ -8,7 +8,7 @@ const steps = [
} }
}, },
{ {
element: '.breadcrumb-container', element: '#breadcrumb-container',
popover: { popover: {
title: 'Breadcrumb', title: 'Breadcrumb',
description: 'Indicate the current page location', description: 'Indicate the current page location',
@ -16,31 +16,31 @@ const steps = [
} }
}, },
{ {
element: '.screenfull', element: '#header-search',
popover: {
title: 'Page Search',
description: 'Page search, quick navigation',
position: 'left'
}
},
{
element: '#screenfull',
popover: { popover: {
title: 'Screenfull', title: 'Screenfull',
description: 'Bring the page into fullscreen', description: 'Set the page into fullscreen',
position: 'left' position: 'left'
} }
}, },
{ {
element: '.international-icon', element: '#size-select',
popover: { popover: {
title: 'Switch language', title: 'Switch Size',
description: 'Switch the system language', description: 'Switch the system size',
position: 'left' position: 'left'
} }
}, },
{ {
element: '.theme-switch', element: '#tags-view-container',
popover: {
title: 'Theme Switch',
description: 'Custom switch system theme',
position: 'left'
}
},
{
element: '.tags-view-container',
popover: { popover: {
title: 'Tags view', title: 'Tags view',
description: 'The history of the page you visited', description: 'The history of the page you visited',

View File

@ -1,6 +1,6 @@
<script> <script>
export default { export default {
name: 'Authredirect', name: 'AuthRedirect',
created() { created() {
const hash = window.location.search.slice(1) const hash = window.location.search.slice(1)
if (window.localStorage) { if (window.localStorage) {

View File

@ -77,7 +77,7 @@
<script> <script>
import { validUsername } from '@/utils/validate' import { validUsername } from '@/utils/validate'
import LangSelect from '@/components/LangSelect' import LangSelect from '@/components/LangSelect'
import SocialSign from './socialsignin' import SocialSign from './socialSignin'
export default { export default {
name: 'Login', name: 'Login',

View File

@ -113,9 +113,9 @@ export default {
this.sortable = Sortable.create(el, { this.sortable = Sortable.create(el, {
ghostClass: 'sortable-ghost', // Class name for the drop placeholder, ghostClass: 'sortable-ghost', // Class name for the drop placeholder,
setData: function(dataTransfer) { setData: function(dataTransfer) {
dataTransfer.setData('Text', '')
// to avoid Firefox bug // to avoid Firefox bug
// Detail see : https://github.com/RubaXa/Sortable/issues/1012 // Detail see : https://github.com/RubaXa/Sortable/issues/1012
dataTransfer.setData('Text', '')
}, },
onEnd: evt => { onEnd: evt => {
const targetRow = this.list.splice(evt.oldIndex, 1)[0] const targetRow = this.list.splice(evt.oldIndex, 1)[0]