Skip to content

Commit 42b42a5

Browse files
authored
Merge pull request #1 from PanJiaChen/master
update
2 parents 8f45dbe + fdea6c6 commit 42b42a5

File tree

83 files changed

+439
-350
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+439
-350
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# http://editorconfig.org
1+
# https://editorconfig.org
22
root = true
33

44
[*]

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ English | [简体中文](./README.zh-CN.md)
3030

3131
## Introduction
3232

33-
[vue-element-admin](http://panjiachen.github.io/vue-element-admin) is a production-ready front-end solution for admin interfaces. It based on [vue](https://github.com/vuejs/vue) and use the UI Toolkit [element-ui](https://github.com/ElemeFE/element).
33+
[vue-element-admin](https://panjiachen.github.io/vue-element-admin) is a production-ready front-end solution for admin interfaces. It based on [vue](https://github.com/vuejs/vue) and use the UI Toolkit [element-ui](https://github.com/ElemeFE/element).
3434

3535
It is a magical vue admin based on the newest development stack of vue, built-in i18n solution, typical templates for enterprise applications, lots of awesome features. It helps you build a large complex Single-Page Applications. I believe whatever your needs are, this project will help you.
3636

37-
- [Preview](http://panjiachen.github.io/vue-element-admin)
37+
- [Preview](https://panjiachen.github.io/vue-element-admin)
3838

3939
- [Documentation](https://panjiachen.github.io/vue-element-admin-site/)
4040

@@ -50,13 +50,13 @@ It is a magical vue admin based on the newest development stack of vue, built-in
5050
- Desktop: [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
5151
- Typescript: [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (Credits: [@Armour](https://github.com/Armour))
5252

53-
**The current version is `4.0-beta`. If you find a problem, please put [issue](https://github.com/PanJiaChen/vue-element-admin/issues/new). If you want to use the old version - stable version, you can switch branch to [tag/3.11.0](https://github.com/PanJiaChen/vue-element-admin/tree/tag/3.11.0)**
53+
**The current version is `v4.0+` build on `vue-cli`. If you find a problem, please put [issue](https://github.com/PanJiaChen/vue-element-admin/issues/new). If you want to use the old version , you can switch branch to [tag/3.11.0](https://github.com/PanJiaChen/vue-element-admin/tree/tag/3.11.0), it does not rely on `vue-cli'**
5454

5555
**This project does not support low version browsers (e.g. IE). Please add polyfill by yourself.**
5656

5757
## Preparation
5858

59-
You need to install [node](http://nodejs.org/) and [git](https://git-scm.com/) locally. The project is based on [ES2015+](http://es6.ruanyifeng.com/), [vue](https://cn.vuejs.org/index.html), [vuex](https://vuex.vuejs.org/zh-cn/), [vue-router](https://router.vuejs.org/zh-cn/), [vue-cli](https://github.com/vuejs/vue-cli) , [axios](https://github.com/axios/axios) and [element-ui](https://github.com/ElemeFE/element), all request data is simulated using [Mock.js](https://github.com/nuysoft/Mock).
59+
You need to install [node](https://nodejs.org/) and [git](https://git-scm.com/) locally. The project is based on [ES2015+](https://es6.ruanyifeng.com/), [vue](https://cn.vuejs.org/index.html), [vuex](https://vuex.vuejs.org/zh-cn/), [vue-router](https://router.vuejs.org/zh-cn/), [vue-cli](https://github.com/vuejs/vue-cli) , [axios](https://github.com/axios/axios) and [element-ui](https://github.com/ElemeFE/element), all request data is simulated using [Mock.js](https://github.com/nuysoft/Mock).
6060
Understanding and learning this knowledge in advance will greatly help the use of this project.
6161

6262
<p align="center">
@@ -187,7 +187,7 @@ Detailed changes for each release are documented in the [release notes](https://
187187

188188
## Online Demo
189189

190-
[Preview](http://panjiachen.github.io/vue-element-admin)
190+
[Preview](https://panjiachen.github.io/vue-element-admin)
191191

192192
## Donate
193193

@@ -203,7 +203,7 @@ If you find this project useful, you can buy author a glass of juice :tropical_d
203203

204204
Modern browsers and Internet Explorer 10+.
205205

206-
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari |
206+
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](https://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](https://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](https://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](https://godban.github.io/browsers-support-badges/)</br>Safari |
207207
| --------- | --------- | --------- | --------- |
208208
| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions
209209

README.zh-CN.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030

3131
## 简介
3232

33-
[vue-element-admin](http://panjiachen.github.io/vue-element-admin) 是一个后台前端解决方案,它基于 [vue](https://github.com/vuejs/vue)[element-ui](https://github.com/ElemeFE/element)实现。它使用了最新的前端技术栈,内置了 i18n 国际化解决方案,动态路由,权限验证,提炼了典型的业务模型,提供了丰富的功能组件,它可以帮助你快速搭建企业级中后台产品原型。相信不管你的需求是什么,本项目都能帮助到你。
33+
[vue-element-admin](https://panjiachen.github.io/vue-element-admin) 是一个后台前端解决方案,它基于 [vue](https://github.com/vuejs/vue)[element-ui](https://github.com/ElemeFE/element)实现。它使用了最新的前端技术栈,内置了 i18n 国际化解决方案,动态路由,权限验证,提炼了典型的业务模型,提供了丰富的功能组件,它可以帮助你快速搭建企业级中后台产品原型。相信不管你的需求是什么,本项目都能帮助到你。
3434

35-
- [在线预览](http://panjiachen.github.io/vue-element-admin)
35+
- [在线预览](https://panjiachen.github.io/vue-element-admin)
3636

3737
- [使用文档](https://panjiachen.github.io/vue-element-admin-site/zh/)
3838

@@ -50,7 +50,7 @@
5050
- 桌面端: [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
5151
- Typescript 版: [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (鸣谢: [@Armour](https://github.com/Armour))
5252

53-
**目前版本为 `4.0-beta`,若发现问题,欢迎提[issue](https://github.com/PanJiaChen/vue-element-admin/issues/new)。若你想使用旧版本-稳定版,可以切换分支到[tag/3.11.0](https://github.com/PanJiaChen/vue-element-admin/tree/tag/3.11.0)**
53+
**目前版本为 `v4.0+` 基于 `vue-cli` 进行构建,若发现问题,欢迎提[issue](https://github.com/PanJiaChen/vue-element-admin/issues/new)。若你想使用旧版本,可以切换分支到[tag/3.11.0](https://github.com/PanJiaChen/vue-element-admin/tree/tag/3.11.0),它不依赖 `vue-cli`**
5454

5555
**该项目不支持低版本浏览器(如 ie),有需求请自行添加 polyfill [详情](https://github.com/PanJiaChen/vue-element-admin/wiki#babel-polyfill)**
5656

@@ -204,7 +204,7 @@ Detailed changes for each release are documented in the [release notes](https://
204204

205205
## Online Demo
206206

207-
[在线 Demo](http://panjiachen.github.io/vue-element-admin)
207+
[在线 Demo](https://panjiachen.github.io/vue-element-admin)
208208

209209
## Donate
210210

@@ -221,7 +221,7 @@ Detailed changes for each release are documented in the [release notes](https://
221221

222222
Modern browsers and Internet Explorer 10+.
223223

224-
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari |
224+
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](https://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](https://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](https://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](https://godban.github.io/browsers-support-badges/)</br>Safari |
225225
| --------- | --------- | --------- | --------- |
226226
| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions
227227

mock/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { param2Obj } from '../src/utils'
44
import user from './user'
55
import role from './role'
66
import article from './article'
7-
import search from './remoteSearch'
7+
import search from './remote-search'
88

99
const mocks = [
1010
...user,

mock/mock-server.js

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@ const bodyParser = require('body-parser')
33
const chalk = require('chalk')
44

55
function registerRoutes(app) {
6+
let mockLastIndex
67
const { default: mocks } = require('./index.js')
78
for (const mock of mocks) {
89
app[mock.type](mock.url, mock.response)
10+
mockLastIndex = app._router.stack.length
911
}
12+
const mockRoutesLength = Object.keys(mocks).length
1013
return {
11-
mockRoutesLength: Object.keys(mocks).length
14+
mockRoutesLength: mockRoutesLength,
15+
mockStartIndex: mockLastIndex - mockRoutesLength
1216
}
1317
}
1418

@@ -20,40 +24,20 @@ function unregisterRoutes() {
2024
})
2125
}
2226

23-
function getPath(path) {
24-
var match = path.toString()
25-
.replace('\\/?', '')
26-
.replace('(?=\\/|$)', '$')
27-
.match(/^\/\^((?:\\[.*+?^${}()|[\]\\\/]|[^.*+?^${}()|[\]\\\/])*)\$\//)
28-
return match
29-
? match[1].replace(/\\(.)/g, '$1').split('/')
30-
: path.toString()
31-
}
32-
33-
function getMockRoutesIndex(app) {
34-
for (let index = 0; index <= app._router.stack.length; index++) {
35-
const r = app._router.stack[index]
36-
if (r.route && r.route.path) {
37-
const path = getPath(r.route.path)
38-
if (path.includes('mock')) {
39-
return index
40-
}
41-
}
42-
}
43-
}
44-
4527
module.exports = app => {
4628
// es6 polyfill
4729
require('@babel/register')
4830

4931
// parse app.body
50-
// http://expressjs.com/en/4x/api.html#req.body
32+
// https://expressjs.com/en/4x/api.html#req.body
5133
app.use(bodyParser.json())
5234
app.use(bodyParser.urlencoded({
5335
extended: true
5436
}))
5537

56-
const { mockRoutesLength } = registerRoutes(app)
38+
const mockRoutes = registerRoutes(app)
39+
var mockRoutesLength = mockRoutes.mockRoutesLength
40+
var mockStartIndex = mockRoutes.mockStartIndex
5741

5842
// watch files, hot reload mock server
5943
chokidar.watch(('./mock'), {
@@ -62,16 +46,15 @@ module.exports = app => {
6246
ignoreInitial: true
6347
}).on('all', (event, path) => {
6448
if (event === 'change' || event === 'add') {
65-
// find mock routes stack index
66-
const index = getMockRoutesIndex(app)
67-
6849
// remove mock routes stack
69-
app._router.stack.splice(index, mockRoutesLength)
50+
app._router.stack.splice(mockStartIndex, mockRoutesLength)
7051

7152
// clear routes cache
7253
unregisterRoutes()
7354

74-
registerRoutes(app)
55+
const mockRoutes = registerRoutes(app)
56+
mockRoutesLength = mockRoutes.mockRoutesLength
57+
mockStartIndex = mockRoutes.mockStartIndex
7558

7659
console.log(chalk.magentaBright(`\n > Mock Server hot reload success! changed ${path}`))
7760
}
File renamed without changes.

mock/role/routes.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ export const constantRoutes = [
1919
},
2020
{
2121
path: '/auth-redirect',
22-
component: 'views/login/authRedirect',
22+
component: 'views/login/auth-redirect',
2323
hidden: true
2424
},
2525
{
2626
path: '/404',
27-
component: 'views/errorPage/404',
27+
component: 'views/error-page/404',
2828
hidden: true
2929
},
3030
{
3131
path: '/401',
32-
component: 'views/errorPage/401',
32+
component: 'views/error-page/401',
3333
hidden: true
3434
},
3535
{
@@ -150,19 +150,19 @@ export const asyncRoutes = [
150150
},
151151
{
152152
path: 'json-editor',
153-
component: 'views/components-demo/jsonEditor',
153+
component: 'views/components-demo/json-editor',
154154
name: 'JsonEditorDemo',
155155
meta: { title: 'jsonEditor' }
156156
},
157157
{
158-
path: 'splitpane',
159-
component: 'views/components-demo/splitpane',
158+
path: 'split-pane',
159+
component: 'views/components-demo/split-pane',
160160
name: 'SplitpaneDemo',
161161
meta: { title: 'splitPane' }
162162
},
163163
{
164164
path: 'avatar-upload',
165-
component: 'views/components-demo/avatarUpload',
165+
component: 'views/components-demo/avatar-upload',
166166
name: 'AvatarUploadDemo',
167167
meta: { title: 'avatarUpload' }
168168
},
@@ -180,7 +180,7 @@ export const asyncRoutes = [
180180
},
181181
{
182182
path: 'count-to',
183-
component: 'views/components-demo/countTo',
183+
component: 'views/components-demo/count-to',
184184
name: 'CountToDemo',
185185
meta: { title: 'countTo' }
186186
},
@@ -192,31 +192,31 @@ export const asyncRoutes = [
192192
},
193193
{
194194
path: 'back-to-top',
195-
component: 'views/components-demo/backToTop',
195+
component: 'views/components-demo/back-to-top',
196196
name: 'BackToTopDemo',
197197
meta: { title: 'backToTop' }
198198
},
199199
{
200200
path: 'drag-dialog',
201-
component: 'views/components-demo/dragDialog',
201+
component: 'views/components-demo/drag-dialog',
202202
name: 'DragDialogDemo',
203203
meta: { title: 'dragDialog' }
204204
},
205205
{
206206
path: 'drag-select',
207-
component: 'views/components-demo/dragSelect',
207+
component: 'views/components-demo/drag-select',
208208
name: 'DragSelectDemo',
209209
meta: { title: 'dragSelect' }
210210
},
211211
{
212212
path: 'dnd-list',
213-
component: 'views/components-demo/dndList',
213+
component: 'views/components-demo/dnd-list',
214214
name: 'DndListDemo',
215215
meta: { title: 'dndList' }
216216
},
217217
{
218218
path: 'drag-kanban',
219-
component: 'views/components-demo/dragKanban',
219+
component: 'views/components-demo/drag-kanban',
220220
name: 'DragKanbanDemo',
221221
meta: { title: 'dragKanban' }
222222
}
@@ -370,13 +370,13 @@ export const asyncRoutes = [
370370
children: [
371371
{
372372
path: '401',
373-
component: 'views/errorPage/401',
373+
component: 'views/error-page/401',
374374
name: 'Page401',
375375
meta: { title: 'page401', noCache: true }
376376
},
377377
{
378378
path: '404',
379-
component: 'views/errorPage/404',
379+
component: 'views/error-page/404',
380380
name: 'Page404',
381381
meta: { title: 'page404', noCache: true }
382382
}
@@ -390,7 +390,7 @@ export const asyncRoutes = [
390390
children: [
391391
{
392392
path: 'log',
393-
component: 'views/errorLog/index',
393+
component: 'views/error-log/index',
394394
name: 'ErrorLog',
395395
meta: { title: 'errorLog', icon: 'bug' }
396396
}
@@ -409,25 +409,25 @@ export const asyncRoutes = [
409409
children: [
410410
{
411411
path: 'export-excel',
412-
component: 'views/excel/exportExcel',
412+
component: 'views/excel/export-excel',
413413
name: 'ExportExcel',
414414
meta: { title: 'exportExcel' }
415415
},
416416
{
417417
path: 'export-selected-excel',
418-
component: 'views/excel/selectExcel',
418+
component: 'views/excel/select-excel',
419419
name: 'SelectExcel',
420420
meta: { title: 'selectExcel' }
421421
},
422422
{
423423
path: 'export-merge-header',
424-
component: 'views/excel/mergeHeader',
424+
component: 'views/excel/merge-header',
425425
name: 'MergeHeader',
426426
meta: { title: 'mergeHeader' }
427427
},
428428
{
429429
path: 'upload-excel',
430-
component: 'views/excel/uploadExcel',
430+
component: 'views/excel/upload-excel',
431431
name: 'UploadExcel',
432432
meta: { title: 'uploadExcel' }
433433
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-element-admin",
3-
"version": "4.0.0",
3+
"version": "4.0.1",
44
"description": "A magical vue admin. An out-of-box UI solution for enterprise applications. Newest development stack of vue. Lots of awesome features",
55
"author": "Pan <[email protected]>",
66
"license": "MIT",
File renamed without changes.

0 commit comments

Comments
 (0)