diff --git a/.editorconfig b/.editorconfig index ea6e20f5..3454886e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,4 @@ -# http://editorconfig.org +# https://editorconfig.org root = true [*] diff --git a/README.md b/README.md index 48599a7e..01034b51 100644 --- a/README.md +++ b/README.md @@ -30,11 +30,11 @@ English | [简体中文](./README.zh-CN.md) ## Introduction -[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). +[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). 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. -- [Preview](http://panjiachen.github.io/vue-element-admin) +- [Preview](https://panjiachen.github.io/vue-element-admin) - [Documentation](https://panjiachen.github.io/vue-element-admin-site/) @@ -50,13 +50,13 @@ It is a magical vue admin based on the newest development stack of vue, built-in - Desktop: [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin) - Typescript: [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (Credits: [@Armour](https://github.com/Armour)) -**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)** +**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'** **This project does not support low version browsers (e.g. IE). Please add polyfill by yourself.** ## Preparation -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). +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). Understanding and learning this knowledge in advance will greatly help the use of this project.

@@ -187,7 +187,7 @@ Detailed changes for each release are documented in the [release notes](https:// ## Online Demo -[Preview](http://panjiachen.github.io/vue-element-admin) +[Preview](https://panjiachen.github.io/vue-element-admin) ## Donate @@ -203,7 +203,7 @@ If you find this project useful, you can buy author a glass of juice :tropical_d Modern browsers and Internet Explorer 10+. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | +| [IE / Edge](https://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](https://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](https://godban.github.io/browsers-support-badges/)
Chrome | [Safari](https://godban.github.io/browsers-support-badges/)
Safari | | --------- | --------- | --------- | --------- | | IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions diff --git a/README.zh-CN.md b/README.zh-CN.md index e0ec09bb..0e15d8a4 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -30,9 +30,9 @@ ## 简介 -[vue-element-admin](http://panjiachen.github.io/vue-element-admin) 是一个后台前端解决方案,它基于 [vue](https://github.com/vuejs/vue) 和 [element-ui](https://github.com/ElemeFE/element)实现。它使用了最新的前端技术栈,内置了 i18n 国际化解决方案,动态路由,权限验证,提炼了典型的业务模型,提供了丰富的功能组件,它可以帮助你快速搭建企业级中后台产品原型。相信不管你的需求是什么,本项目都能帮助到你。 +[vue-element-admin](https://panjiachen.github.io/vue-element-admin) 是一个后台前端解决方案,它基于 [vue](https://github.com/vuejs/vue) 和 [element-ui](https://github.com/ElemeFE/element)实现。它使用了最新的前端技术栈,内置了 i18n 国际化解决方案,动态路由,权限验证,提炼了典型的业务模型,提供了丰富的功能组件,它可以帮助你快速搭建企业级中后台产品原型。相信不管你的需求是什么,本项目都能帮助到你。 -- [在线预览](http://panjiachen.github.io/vue-element-admin) +- [在线预览](https://panjiachen.github.io/vue-element-admin) - [使用文档](https://panjiachen.github.io/vue-element-admin-site/zh/) @@ -50,7 +50,7 @@ - 桌面端: [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin) - Typescript 版: [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (鸣谢: [@Armour](https://github.com/Armour)) -**目前版本为 `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)** +**目前版本为 `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`** **该项目不支持低版本浏览器(如 ie),有需求请自行添加 polyfill [详情](https://github.com/PanJiaChen/vue-element-admin/wiki#babel-polyfill)** @@ -204,7 +204,7 @@ Detailed changes for each release are documented in the [release notes](https:// ## Online Demo -[在线 Demo](http://panjiachen.github.io/vue-element-admin) +[在线 Demo](https://panjiachen.github.io/vue-element-admin) ## Donate @@ -221,7 +221,7 @@ Detailed changes for each release are documented in the [release notes](https:// Modern browsers and Internet Explorer 10+. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | +| [IE / Edge](https://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](https://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](https://godban.github.io/browsers-support-badges/)
Chrome | [Safari](https://godban.github.io/browsers-support-badges/)
Safari | | --------- | --------- | --------- | --------- | | IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions diff --git a/mock/mock-server.js b/mock/mock-server.js index af7e67ee..b29b7c3f 100644 --- a/mock/mock-server.js +++ b/mock/mock-server.js @@ -3,16 +3,16 @@ const bodyParser = require('body-parser') const chalk = require('chalk') function registerRoutes(app) { - let mockStartIndex + let mockLastIndex const { default: mocks } = require('./index.js') for (const mock of mocks) { app[mock.type](mock.url, mock.response) - mockStartIndex = app._router.stack.length + mockLastIndex = app._router.stack.length } const mockRoutesLength = Object.keys(mocks).length return { mockRoutesLength: mockRoutesLength, - mockStartIndex: mockStartIndex - mockRoutesLength + mockStartIndex: mockLastIndex - mockRoutesLength } } @@ -29,7 +29,7 @@ module.exports = app => { require('@babel/register') // parse app.body - // http://expressjs.com/en/4x/api.html#req.body + // https://expressjs.com/en/4x/api.html#req.body app.use(bodyParser.json()) app.use(bodyParser.urlencoded({ extended: true diff --git a/src/components/Charts/Keyboard.vue b/src/components/Charts/Keyboard.vue index 3f061bd0..0b258f36 100644 --- a/src/components/Charts/Keyboard.vue +++ b/src/components/Charts/Keyboard.vue @@ -53,103 +53,102 @@ export default { data.push((Math.sin(i / 5) * (i / 5 - 10) + i / 6) * 5) data2.push((Math.sin(i / 5) * (i / 5 + 10) + i / 6) * 3) } - this.chart.setOption( - { - backgroundColor: '#08263a', - grid: { - left: '5%', - right: '5%' - }, - xAxis: [{ - show: false, - data: xAxisData - }, { - show: false, - data: xAxisData - }], - visualMap: { - show: false, - min: 0, - max: 50, - dimension: 0, - inRange: { - color: ['#4a657a', '#308e92', '#b1cfa5', '#f5d69f', '#f5898b', '#ef5055'] - } - }, - yAxis: { - axisLine: { - show: false - }, - axisLabel: { - textStyle: { - color: '#4a657a' - } - }, - splitLine: { - show: true, - lineStyle: { - color: '#08263f' - } - }, - axisTick: { - show: false - } - }, - series: [{ - name: 'back', - type: 'bar', - data: data2, - z: 1, - itemStyle: { - normal: { - opacity: 0.4, - barBorderRadius: 5, - shadowBlur: 3, - shadowColor: '#111' - } - } - }, { - name: 'Simulate Shadow', - type: 'line', - data, - z: 2, - showSymbol: false, - animationDelay: 0, - animationEasing: 'linear', - animationDuration: 1200, - lineStyle: { - normal: { - color: 'transparent' - } - }, - areaStyle: { - normal: { - color: '#08263a', - shadowBlur: 50, - shadowColor: '#000' - } - } - }, { - name: 'front', - type: 'bar', - data, - xAxisIndex: 1, - z: 3, - itemStyle: { - normal: { - barBorderRadius: 5 - } - } - }], - animationEasing: 'elasticOut', - animationEasingUpdate: 'elasticOut', - animationDelay(idx) { - return idx * 20 - }, - animationDelayUpdate(idx) { - return idx * 20 + this.chart.setOption({ + backgroundColor: '#08263a', + grid: { + left: '5%', + right: '5%' + }, + xAxis: [{ + show: false, + data: xAxisData + }, { + show: false, + data: xAxisData + }], + visualMap: { + show: false, + min: 0, + max: 50, + dimension: 0, + inRange: { + color: ['#4a657a', '#308e92', '#b1cfa5', '#f5d69f', '#f5898b', '#ef5055'] } - }) + }, + yAxis: { + axisLine: { + show: false + }, + axisLabel: { + textStyle: { + color: '#4a657a' + } + }, + splitLine: { + show: true, + lineStyle: { + color: '#08263f' + } + }, + axisTick: { + show: false + } + }, + series: [{ + name: 'back', + type: 'bar', + data: data2, + z: 1, + itemStyle: { + normal: { + opacity: 0.4, + barBorderRadius: 5, + shadowBlur: 3, + shadowColor: '#111' + } + } + }, { + name: 'Simulate Shadow', + type: 'line', + data, + z: 2, + showSymbol: false, + animationDelay: 0, + animationEasing: 'linear', + animationDuration: 1200, + lineStyle: { + normal: { + color: 'transparent' + } + }, + areaStyle: { + normal: { + color: '#08263a', + shadowBlur: 50, + shadowColor: '#000' + } + } + }, { + name: 'front', + type: 'bar', + data, + xAxisIndex: 1, + z: 3, + itemStyle: { + normal: { + barBorderRadius: 5 + } + } + }], + animationEasing: 'elasticOut', + animationEasingUpdate: 'elasticOut', + animationDelay(idx) { + return idx * 20 + }, + animationDelayUpdate(idx) { + return idx * 20 + } + }) } } } diff --git a/src/components/DragSelect/index.vue b/src/components/DragSelect/index.vue index 4a2e6300..28256a8b 100644 --- a/src/components/DragSelect/index.vue +++ b/src/components/DragSelect/index.vue @@ -49,13 +49,13 @@ export default { diff --git a/src/filters/index.js b/src/filters/index.js index b164513a..86e768d8 100644 --- a/src/filters/index.js +++ b/src/filters/index.js @@ -1,6 +1,12 @@ // set function parseTime,formatTime to filter export { parseTime, formatTime } from '@/utils' +/** + * Show plural label if time is plural number + * @param {number} time + * @param {string} label + * @return {string} + */ function pluralize(time, label) { if (time === 1) { return time + label @@ -8,6 +14,9 @@ function pluralize(time, label) { return time + label + 's' } +/** + * @param {number} time + */ export function timeAgo(time) { const between = Date.now() / 1000 - Number(time) if (between < 3600) { @@ -19,7 +28,12 @@ export function timeAgo(time) { } } -/* 数字 格式化*/ +/** + * Number formatting + * like 10000 => 10k + * @param {number} num + * @param {number} digits + */ export function numberFormatter(num, digits) { const si = [ { value: 1E18, symbol: 'E' }, @@ -37,6 +51,10 @@ export function numberFormatter(num, digits) { return num.toString() } +/** + * 10000 => "10,000" + * @param {number} num + */ export function toThousandFilter(num) { return (+num || 0).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ',')) } diff --git a/src/layout/components/index.js b/src/layout/components/index.js index e9f79ddd..104bd3ac 100644 --- a/src/layout/components/index.js +++ b/src/layout/components/index.js @@ -1,5 +1,5 @@ +export { default as AppMain } from './AppMain' export { default as Navbar } from './Navbar' +export { default as Settings } from './Settings' export { default as Sidebar } from './Sidebar/index.vue' export { default as TagsView } from './TagsView/index.vue' -export { default as AppMain } from './AppMain' -export { default as Settings } from './Settings' diff --git a/src/layout/index.vue b/src/layout/index.vue index ec6df90c..965bcd1b 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -17,19 +17,19 @@