Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
dd18f51
rm
PanJiaChen Apr 2, 2019
4107fa5
tweak
PanJiaChen Apr 2, 2019
7157c2a
refine
PanJiaChen Apr 2, 2019
3145f91
tweak
PanJiaChen Apr 2, 2019
3773a8a
rm
PanJiaChen Apr 2, 2019
8a2c4a9
tweak
PanJiaChen Apr 2, 2019
22b89a2
u+
PanJiaChen Apr 3, 2019
c58c764
u+
PanJiaChen Apr 3, 2019
f74659f
u+
PanJiaChen Apr 3, 2019
5135a64
u+
PanJiaChen Apr 3, 2019
8b28e5c
fix bug
PanJiaChen Apr 3, 2019
d0543a3
u+
PanJiaChen Apr 3, 2019
e148a57
u+
PanJiaChen Apr 3, 2019
938d764
merge master
PanJiaChen Apr 9, 2019
0efdf47
Merge branch 'master' into remove-i18n
PanJiaChen Apr 12, 2019
0727d0c
add
PanJiaChen Apr 12, 2019
f2d5567
merge master
PanJiaChen Apr 16, 2019
d025ea7
refine
PanJiaChen Apr 16, 2019
da850a1
Merge branch 'master' into remove-i18n
PanJiaChen Apr 16, 2019
7c7f74d
refine
PanJiaChen Apr 16, 2019
e0829be
merge master
PanJiaChen Apr 16, 2019
7c7eef3
rm
PanJiaChen Apr 16, 2019
0c21130
add
PanJiaChen Apr 16, 2019
c09fb7f
Merge branch 'master' into remove-i18n
PanJiaChen Apr 17, 2019
c47b3e5
perf: optimize some small details
PanJiaChen Apr 18, 2019
1b044c0
Merge branch 'master' into remove-i18n
PanJiaChen Apr 18, 2019
da5ce81
Merge branch 'master' into remove-i18n
PanJiaChen Apr 19, 2019
9091017
update
PanJiaChen Apr 19, 2019
08aceea
rm
PanJiaChen Apr 19, 2019
c303868
merge master
PanJiaChen Apr 25, 2019
6520d1b
tweak
PanJiaChen Apr 25, 2019
9beb54c
merge master
PanJiaChen Apr 28, 2019
5c45b21
fix[Mock]: add error handling
PanJiaChen Apr 28, 2019
6e0f61b
refine
PanJiaChen Apr 30, 2019
abbe03c
Merge branch 'master' into remove-i18n
PanJiaChen Apr 30, 2019
e36bc34
merge master
PanJiaChen Apr 30, 2019
3f16415
merge master
PanJiaChen May 3, 2019
48f0f88
refine
PanJiaChen May 3, 2019
9c0fb26
Merge branch 'master' into remove-i18n
PanJiaChen May 5, 2019
60340f4
docs
PanJiaChen May 5, 2019
363d0b9
doc
PanJiaChen May 5, 2019
da9e486
rm
PanJiaChen May 5, 2019
c28979b
update
PanJiaChen May 5, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
merge master
  • Loading branch information
PanJiaChen committed Apr 9, 2019
commit 938d764e6d9bf296d760d77c8a7093dd407ffbcf
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -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 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Feature Request(新功能建议)
about: Suggest an idea for this project
---

## Feature request(新功能建议)

14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -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.
-->
2 changes: 1 addition & 1 deletion build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
app.listen(port, function () {
console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`))
if (report) {
console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}/report.html`))
console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`))
}

})
Expand Down
21 changes: 17 additions & 4 deletions mock/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
import Mock from 'mockjs'
import mocks from './mocks'
import { param2Obj } from '../src/utils'

const MOCK_API_BASE = '/mock'
import user from './user'
import role from './role'
import article from './article'
import search from './remoteSearch'

const mocks = [
...user,
...role,
...article,
...search
]

// for front mock
// please use it cautiously, it will redefine XMLHttpRequest,
// which will cause many of your third-party libraries to be invalidated(like progress event).
export function mockXHR() {
// 修复在使用 MockJS 情况下,设置 withCredentials = true,且未被拦截的跨域请求丢失 Cookies 的问题
// mock patch
// https://github.com/nuysoft/Mock/issues/300
Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send
Mock.XHR.prototype.send = function() {
Expand Down Expand Up @@ -42,9 +54,10 @@ export function mockXHR() {
}
}

// for mock server
const responseFake = (url, type, respond) => {
return {
url: new RegExp(`${MOCK_API_BASE}${url}`),
url: new RegExp(`/mock${url}`),
type: type || 'get',
response(req, res) {
res.json(Mock.mock(respond instanceof Function ? respond(req, res) : respond))
Expand Down
62 changes: 62 additions & 0 deletions mock/mock-server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
const chokidar = require('chokidar')
const bodyParser = require('body-parser')
const chalk = require('chalk')

function registerRoutes(app) {
let mockStartIndex
const { default: mocks } = require('./index.js')
for (const mock of mocks) {
app[mock.type](mock.url, mock.response)
mockStartIndex = app._router.stack.length
}
const mockRoutesLength = Object.keys(mocks).length
return {
mockRoutesLength: mockRoutesLength,
mockStartIndex: mockStartIndex - mockRoutesLength
}
}

function unregisterRoutes() {
Object.keys(require.cache).forEach(i => {
if (i.includes('/mock')) {
delete require.cache[require.resolve(i)]
}
})
}

module.exports = app => {
// es6 polyfill
require('@babel/register')

// parse app.body
// http://expressjs.com/en/4x/api.html#req.body
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({
extended: true
}))

const mockRoutes = registerRoutes(app)
var mockRoutesLength = mockRoutes.mockRoutesLength
var mockStartIndex = mockRoutes.mockStartIndex

// watch files, hot reload mock server
chokidar.watch(('./mock'), {
ignored: 'mock/mock-server.js',
persistent: true,
ignoreInitial: true
}).on('all', (event, path) => {
if (event === 'change' || event === 'add') {
// remove mock routes stack
app._router.stack.splice(mockStartIndex, mockRoutesLength)

// clear routes cache
unregisterRoutes()

const mockRoutes = registerRoutes(app)
mockRoutesLength = mockRoutes.mockRoutesLength
mockStartIndex = mockRoutes.mockStartIndex

console.log(chalk.magentaBright(`\n > Mock Server hot reload success! changed ${path}`))
}
})
}
12 changes: 0 additions & 12 deletions mock/mocks.js

This file was deleted.

2 changes: 1 addition & 1 deletion mock/role/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const constantRoutes = [
},
{
path: '/auth-redirect',
component: 'views/login/authredirect',
component: 'views/login/authRedirect',
hidden: true
},
{
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@
"@babel/core": "7.0.0",
"@babel/register": "7.0.0",
"@vue/cli-plugin-babel": "3.5.3",
"@vue/cli-plugin-eslint": "3.5.1",
"@vue/cli-plugin-unit-jest": "3.5.3",
"@vue/cli-service": "3.5.3",
"@vue/test-utils": "1.0.0-beta.29",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.0.1",
"babel-jest": "23.6.0",
"chalk": "2.4.2",
"chokidar": "2.1.5",
"connect": "3.6.6",
"eslint": "5.15.3",
"eslint-plugin-vue": "5.2.2",
Expand Down
7 changes: 6 additions & 1 deletion src/components/DndList/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="dndList">
<div :style="{width:width1}" class="dndList-list">
<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 class="list-complete-item-handle">
{{ element.id }}[{{ element.author }}] {{ element.title }}
Expand Down Expand Up @@ -94,6 +94,11 @@ export default {
if (this.isNotInList1(ele)) {
this.list1.push(ele)
}
},
setData(dataTransfer) {
// to avoid Firefox bug
// Detail see : https://github.com/RubaXa/Sortable/issues/1012
dataTransfer.setData('Text', '')
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ErrorLog/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</el-button>
</el-badge>

<el-dialog :visible.sync="dialogTableVisible" title="Error Log" width="80%">
<el-dialog :visible.sync="dialogTableVisible" title="Error Log" width="80%" append-to-body>
<el-table :data="errorLogs" border>
<el-table-column label="Message">
<template slot-scope="{row}">
Expand Down
8 changes: 8 additions & 0 deletions src/components/Kanban/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
:list="list"
v-bind="$attrs"
class="board-column-content"
:set-data="setData"
>
<div v-for="element in list" :key="element.id" class="board-item">
{{ element.name }} {{ element.id }}
Expand Down Expand Up @@ -39,6 +40,13 @@ export default {
return []
}
}
},
methods: {
setData(dataTransfer) {
// to avoid Firefox bug
// Detail see : https://github.com/RubaXa/Sortable/issues/1012
dataTransfer.setData('Text', '')
}
}
}
</script>
Expand Down
11 changes: 10 additions & 1 deletion src/layout/components/Sidebar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<logo v-if="showLogo" :collapse="isCollapse" />
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-menu
:default-active="$route.path"
:default-active="activeMenu"
:collapse="isCollapse"
:background-color="variables.menuBg"
:text-color="variables.menuText"
Expand All @@ -30,6 +30,15 @@ export default {
'permission_routes',
'sidebar'
]),
activeMenu() {
const route = this.$route
const { meta, path } = route
// if set path, the sidebar will highlight the path you set
if (meta.activeMenu) {
return meta.activeMenu
}
return path
},
showLogo() {
return this.$store.state.settings.sidebarLogo
},
Expand Down
18 changes: 12 additions & 6 deletions src/layout/components/TagsView/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default {
closeSelectedTag(view) {
this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
if (this.isActive(view)) {
this.toLastView(visitedViews)
this.toLastView(visitedViews, view)
}
})
},
Expand All @@ -149,16 +149,22 @@ export default {
if (this.affixTags.some(tag => tag.path === view.path)) {
return
}
this.toLastView(visitedViews)
this.toLastView(visitedViews, view)
})
},
toLastView(visitedViews) {
toLastView(visitedViews, view) {
const latestView = visitedViews.slice(-1)[0]
if (latestView) {
this.$router.push(latestView)
} else {
// You can set another route
this.$router.push('/')
// now the default is to redirect to the home page if there is no tags-view,
// you can adjust it according to your needs.
if (view.name === 'Dashboard') {
// to reload home page
this.$router.replace({ path: '/redirect' + view.fullPath })
} else {
this.$router.push('/')
}
}
},
openMenu(tag, e) {
Expand Down Expand Up @@ -232,7 +238,7 @@ export default {
.contextmenu {
margin: 0;
background: #fff;
z-index: 100;
z-index: 3000;
position: absolute;
list-style-type: none;
padding: 5px 0;
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.