Merge branch 'master' into pr/3048
This commit is contained in:
		
							
								
								
									
										29
									
								
								README.es.md
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								README.es.md
									
									
									
									
									
								
							@@ -51,24 +51,26 @@ Vue Element Admin es una solución práctica basada en la nueva plataforma de de
 | 
			
		||||
- Plantilla de Typescript: [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (Créditos: [@Armour](https://github.com/Armour))
 | 
			
		||||
- [awesome-project](https://github.com/PanJiaChen/vue-element-admin/issues/2312)
 | 
			
		||||
 | 
			
		||||
**Después de la versión `v4.1.0+`, la rama por defecto master no tendrá soporte para i18n. Por favor use [i18n](https://github.com/PanJiaChen/vue-element-admin/tree/i18n), los cambios serán incluidos en la rama master**
 | 
			
		||||
**Después de la versión `v4.1.0+`, la rama por defecto master no tendrá soporte para i18n. Por favor utilice la rama [i18n](https://github.com/PanJiaChen/vue-element-admin/tree/i18n), los cambios serán incluidos en la rama master**
 | 
			
		||||
 | 
			
		||||
**la versión actual es `v4.0+` construida con `vue-cli`. Si encuentra algún problema, por favor coloque un [issue](https://github.com/PanJiaChen/vue-element-admin/issues/new). Si desea usar la versión anterior, puede cambiar de rama a [tag/3.11.0](https://github.com/PanJiaChen/vue-element-admin/tree/tag/3.11.0), no relacionado con `vue-cli`**
 | 
			
		||||
 | 
			
		||||
**Este proyecto no está soportado para versiones muy viejas de navegadores (e.g. IE).**
 | 
			
		||||
**Este proyecto no está soportado para versiones antigüas de navegadores (ej. IE).**
 | 
			
		||||
 | 
			
		||||
## Preparación
 | 
			
		||||
 | 
			
		||||
Necesita instalar [node](https://nodejs.org/) y [git](https://git-scm.com/) localmente. El proyecto es basado en [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), toda la solicitud de datos simulada se realiza a través de [Mock.js](https://github.com/nuysoft/Mock).
 | 
			
		||||
Entendiendo y aprendiendo esto pudiera ayudarle con su proyecto.
 | 
			
		||||
 | 
			
		||||
 <p align="center">
 | 
			
		||||
[](https://codesandbox.io/s/github/PanJiaChen/vue-element-admin/tree/CodeSandbox)
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img width="900" src="https://wpimg.wallstcn.com/a5894c1b-f6af-456e-82df-1151da0839bf.png">
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
## Patrocinantes
 | 
			
		||||
 | 
			
		||||
Se un patrocinante y pon tu logo en nuestro README on GitHub con un enlace directo a tu sitio web. [[Se un Patrocinante]](https://www.patreon.com/panjiachen)
 | 
			
		||||
Sea un patrocinante y coloque su logo en nuestro LEEME en GitHub con un enlace directo a su sitio web. [[Se un Patrocinante]](https://www.patreon.com/panjiachen)
 | 
			
		||||
 | 
			
		||||
<a href="https://flatlogic.com/admin-dashboards?from=vue-element-admin"><img width="150px" src="https://wpimg.wallstcn.com/9c0b719b-5551-4c1e-b776-63994632d94a.png" /></a><p>Plantilla de Dashboard de administración hecha con Vue, React y Angular.</p>
 | 
			
		||||
 | 
			
		||||
@@ -77,25 +79,28 @@ Se un patrocinante y pon tu logo en nuestro README on GitHub con un enlace direc
 | 
			
		||||
```
 | 
			
		||||
- Iniciar / Cerrar Sesión
 | 
			
		||||
 | 
			
		||||
- Permisos de Authentication
 | 
			
		||||
- Permisos de Autenticación
 | 
			
		||||
  - Página de Permisos
 | 
			
		||||
  - Directivas de permisos
 | 
			
		||||
  - Página de configuración de permisos
 | 
			
		||||
  - Autenticación por dos pasos
 | 
			
		||||
 | 
			
		||||
- Construcción Multi-entorno
 | 
			
		||||
  - dev sit stage  producción
 | 
			
		||||
  - Desarrollo (dev)
 | 
			
		||||
  - sit
 | 
			
		||||
  - Escenario de pruebas (stage),
 | 
			
		||||
  - Producción (prod)
 | 
			
		||||
 | 
			
		||||
- Características Globales
 | 
			
		||||
  - I18n
 | 
			
		||||
  - Temas dinámicos
 | 
			
		||||
  - Dynamic sidebar (soporte a rutas multi-nivel)
 | 
			
		||||
  - Menu lateral dinámico (soporte a rutas multi-nivel)
 | 
			
		||||
  - Barra de rutas dinámica
 | 
			
		||||
  - Tags-view (Tab page Support right-click operation)
 | 
			
		||||
  - Tags-view (Pestañas de página, Soporta operación de clic derecho)
 | 
			
		||||
  - Svg Sprite
 | 
			
		||||
  - Datos de simulación con Mock
 | 
			
		||||
  - Pantalla completa
 | 
			
		||||
  - Responsive Sidebar
 | 
			
		||||
  - Menu lateral responsivo
 | 
			
		||||
 | 
			
		||||
- Editor
 | 
			
		||||
  - Editor de Texto Enriquecido
 | 
			
		||||
@@ -106,7 +111,7 @@ Se un patrocinante y pon tu logo en nuestro README on GitHub con un enlace direc
 | 
			
		||||
  - Exportación a Excel
 | 
			
		||||
  - Carga de Excel
 | 
			
		||||
  - Visualización de Excel
 | 
			
		||||
  - Exportación como zip
 | 
			
		||||
  - Exportación como ZIP
 | 
			
		||||
 | 
			
		||||
- Tabla
 | 
			
		||||
  - Tabla Dinámica
 | 
			
		||||
@@ -135,7 +140,7 @@ Se un patrocinante y pon tu logo en nuestro README on GitHub con un enlace direc
 | 
			
		||||
- Página de Guías
 | 
			
		||||
- ECharts (Gráficos)
 | 
			
		||||
- Portapapeles
 | 
			
		||||
- Convertidor de Markdown a html
 | 
			
		||||
- Convertidor de Markdown a HTML
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Iniciando
 | 
			
		||||
@@ -208,7 +213,7 @@ Navegadores modernos e Internet Explorer 10+.
 | 
			
		||||
 | 
			
		||||
| [<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 |
 | 
			
		||||
| --------- | --------- | --------- | --------- |
 | 
			
		||||
| IE10, IE11, Edge| últimas 2 versiones| últimas 2 versiones| últimas 2 versiones
 | 
			
		||||
| IE10, IE11, Edge | últimas 2 versiones | últimas 2 versiones | últimas 2 versiones |
 | 
			
		||||
 | 
			
		||||
## Licencia
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										11
									
								
								README.ja.md
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								README.ja.md
									
									
									
									
									
								
							@@ -59,7 +59,9 @@
 | 
			
		||||
 | 
			
		||||
**バグ修正や新規機能追加のissue と pull requestは大歓迎です。**
 | 
			
		||||
 | 
			
		||||
 <p align="center">
 | 
			
		||||
[](https://codesandbox.io/s/github/PanJiaChen/vue-element-admin/tree/CodeSandbox)
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img width="900" src="https://wpimg.wallstcn.com/a5894c1b-f6af-456e-82df-1151da0839bf.png">
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
@@ -81,7 +83,10 @@ Become a sponsor and get your logo on our README on GitHub with a link to your s
 | 
			
		||||
  - 外部IDでログイン
 | 
			
		||||
 | 
			
		||||
- 複数環境デプロイ
 | 
			
		||||
  - dev sit stage prod
 | 
			
		||||
  - dev
 | 
			
		||||
  - sit
 | 
			
		||||
  - stage
 | 
			
		||||
  - prod
 | 
			
		||||
 | 
			
		||||
- 共通機能
 | 
			
		||||
  - 多言語切替
 | 
			
		||||
@@ -204,7 +209,7 @@ Modern browsers and Internet Explorer 10+.
 | 
			
		||||
 | 
			
		||||
| [<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 |
 | 
			
		||||
| --------- | --------- | --------- | --------- |
 | 
			
		||||
| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions
 | 
			
		||||
| IE10, IE11, Edge | last 2 versions | last 2 versions | last 2 versions |
 | 
			
		||||
 | 
			
		||||
## License
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										11
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								README.md
									
									
									
									
									
								
							@@ -62,7 +62,9 @@ English | [简体中文](./README.zh-CN.md) | [日本語](./README.ja.md) | [Spa
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
 <p align="center">
 | 
			
		||||
[](https://codesandbox.io/s/github/PanJiaChen/vue-element-admin/tree/CodeSandbox)
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img width="900" src="https://wpimg.wallstcn.com/a5894c1b-f6af-456e-82df-1151da0839bf.png">
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
@@ -84,7 +86,10 @@ Become a sponsor and get your logo on our README on GitHub with a link to your s
 | 
			
		||||
  - Two-step login
 | 
			
		||||
 | 
			
		||||
- Multi-environment build
 | 
			
		||||
  - dev sit stage prod
 | 
			
		||||
  - Develop (dev)
 | 
			
		||||
  - sit
 | 
			
		||||
  - Stage Test (stage)
 | 
			
		||||
  - Production (prod)
 | 
			
		||||
 | 
			
		||||
- Global Features
 | 
			
		||||
  - I18n
 | 
			
		||||
@@ -208,7 +213,7 @@ Modern browsers and Internet Explorer 10+.
 | 
			
		||||
 | 
			
		||||
| [<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 |
 | 
			
		||||
| --------- | --------- | --------- | --------- |
 | 
			
		||||
| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions
 | 
			
		||||
| IE10, IE11, Edge | last 2 versions | last 2 versions | last 2 versions |
 | 
			
		||||
 | 
			
		||||
## License
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -77,7 +77,9 @@
 | 
			
		||||
 | 
			
		||||
**如有问题请先看上述使用文档和文章,若不能满足,欢迎 issue 和 pr**
 | 
			
		||||
 | 
			
		||||
 <p align="center">
 | 
			
		||||
[](https://codesandbox.io/s/github/PanJiaChen/vue-element-admin/tree/CodeSandbox)
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img width="900" src="https://wpimg.wallstcn.com/a5894c1b-f6af-456e-82df-1151da0839bf.png">
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
@@ -99,7 +101,10 @@ Become a sponsor and get your logo on our README on GitHub with a link to your s
 | 
			
		||||
  - 二步登录
 | 
			
		||||
 | 
			
		||||
- 多环境发布
 | 
			
		||||
  - dev sit stage prod
 | 
			
		||||
  - dev
 | 
			
		||||
  - sit
 | 
			
		||||
  - stage
 | 
			
		||||
  - prod
 | 
			
		||||
 | 
			
		||||
- 全局功能
 | 
			
		||||
  - 国际化多语言
 | 
			
		||||
@@ -221,13 +226,17 @@ Detailed changes for each release are documented in the [release notes](https://
 | 
			
		||||
 | 
			
		||||
[Buy me a coffee](https://www.buymeacoffee.com/Pan)
 | 
			
		||||
 | 
			
		||||
## 购买贴纸
 | 
			
		||||
 | 
			
		||||
你也可以通过 购买[官方授权的贴纸](https://smallsticker.com/product/vue-element-admin) 的方式来支持 vue-element-admin - 每售出一张贴纸,本项目将获得 2 元的捐赠。
 | 
			
		||||
 | 
			
		||||
## Browsers support
 | 
			
		||||
 | 
			
		||||
Modern browsers and Internet Explorer 10+.
 | 
			
		||||
 | 
			
		||||
| [<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 |
 | 
			
		||||
| --------- | --------- | --------- | --------- |
 | 
			
		||||
| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions
 | 
			
		||||
| IE10, IE11, Edge | last 2 versions | last 2 versions | last 2 versions |
 | 
			
		||||
 | 
			
		||||
## License
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
import Mock from 'mockjs'
 | 
			
		||||
const Mock = require('mockjs')
 | 
			
		||||
 | 
			
		||||
const List = []
 | 
			
		||||
const count = 100
 | 
			
		||||
@@ -27,7 +27,7 @@ for (let i = 0; i < count; i++) {
 | 
			
		||||
  }))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default [
 | 
			
		||||
module.exports = [
 | 
			
		||||
  {
 | 
			
		||||
    url: '/vue-element-admin/article/list',
 | 
			
		||||
    type: 'get',
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,10 @@
 | 
			
		||||
import Mock from 'mockjs'
 | 
			
		||||
import { param2Obj } from '../src/utils'
 | 
			
		||||
const Mock = require('mockjs')
 | 
			
		||||
const { param2Obj } = require('./utils')
 | 
			
		||||
 | 
			
		||||
import user from './user'
 | 
			
		||||
import role from './role'
 | 
			
		||||
import article from './article'
 | 
			
		||||
import search from './remote-search'
 | 
			
		||||
const user = require('./user')
 | 
			
		||||
const role = require('./role')
 | 
			
		||||
const article = require('./article')
 | 
			
		||||
const search = require('./remote-search')
 | 
			
		||||
 | 
			
		||||
const mocks = [
 | 
			
		||||
  ...user,
 | 
			
		||||
@@ -16,7 +16,7 @@ const mocks = [
 | 
			
		||||
// 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() {
 | 
			
		||||
function mockXHR() {
 | 
			
		||||
  // mock patch
 | 
			
		||||
  // https://github.com/nuysoft/Mock/issues/300
 | 
			
		||||
  Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send
 | 
			
		||||
@@ -54,4 +54,7 @@ export function mockXHR() {
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default mocks
 | 
			
		||||
module.exports = {
 | 
			
		||||
  mocks,
 | 
			
		||||
  mockXHR
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,7 @@ const mockDir = path.join(process.cwd(), 'mock')
 | 
			
		||||
 | 
			
		||||
function registerRoutes(app) {
 | 
			
		||||
  let mockLastIndex
 | 
			
		||||
  const { default: mocks } = require('./index.js')
 | 
			
		||||
  const { mocks } = require('./index.js')
 | 
			
		||||
  const mocksForServer = mocks.map(route => {
 | 
			
		||||
    return responseFake(route.url, route.type, route.response)
 | 
			
		||||
  })
 | 
			
		||||
@@ -44,9 +44,6 @@ const responseFake = (url, type, respond) => {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
module.exports = app => {
 | 
			
		||||
  // es6 polyfill
 | 
			
		||||
  require('@babel/register')
 | 
			
		||||
 | 
			
		||||
  // parse app.body
 | 
			
		||||
  // https://expressjs.com/en/4x/api.html#req.body
 | 
			
		||||
  app.use(bodyParser.json())
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
import Mock from 'mockjs'
 | 
			
		||||
const Mock = require('mockjs')
 | 
			
		||||
 | 
			
		||||
const NameList = []
 | 
			
		||||
const count = 100
 | 
			
		||||
@@ -10,7 +10,7 @@ for (let i = 0; i < count; i++) {
 | 
			
		||||
}
 | 
			
		||||
NameList.push({ name: 'mock-Pan' })
 | 
			
		||||
 | 
			
		||||
export default [
 | 
			
		||||
module.exports = [
 | 
			
		||||
  // username search
 | 
			
		||||
  {
 | 
			
		||||
    url: '/vue-element-admin/search/user',
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
import Mock from 'mockjs'
 | 
			
		||||
import { deepClone } from '../../src/utils/index.js'
 | 
			
		||||
import { asyncRoutes, constantRoutes } from './routes.js'
 | 
			
		||||
const Mock = require('mockjs')
 | 
			
		||||
const { deepClone } = require('../utils')
 | 
			
		||||
const { asyncRoutes, constantRoutes } = require('./routes.js')
 | 
			
		||||
 | 
			
		||||
const routes = deepClone([...constantRoutes, ...asyncRoutes])
 | 
			
		||||
 | 
			
		||||
@@ -35,7 +35,7 @@ const roles = [
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
export default [
 | 
			
		||||
module.exports = [
 | 
			
		||||
  // mock get all routes form server
 | 
			
		||||
  {
 | 
			
		||||
    url: '/vue-element-admin/routes',
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
// Just a mock data
 | 
			
		||||
 | 
			
		||||
export const constantRoutes = [
 | 
			
		||||
const constantRoutes = [
 | 
			
		||||
  {
 | 
			
		||||
    path: '/redirect',
 | 
			
		||||
    component: 'layout/Layout',
 | 
			
		||||
@@ -72,7 +72,7 @@ export const constantRoutes = [
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
export const asyncRoutes = [
 | 
			
		||||
const asyncRoutes = [
 | 
			
		||||
  {
 | 
			
		||||
    path: '/permission',
 | 
			
		||||
    component: 'layout/Layout',
 | 
			
		||||
@@ -523,3 +523,8 @@ export const asyncRoutes = [
 | 
			
		||||
 | 
			
		||||
  { path: '*', redirect: '/404', hidden: true }
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
module.exports = {
 | 
			
		||||
  constantRoutes,
 | 
			
		||||
  asyncRoutes
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -23,7 +23,7 @@ const users = {
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default [
 | 
			
		||||
module.exports = [
 | 
			
		||||
  // user login
 | 
			
		||||
  {
 | 
			
		||||
    url: '/vue-element-admin/user/login',
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										46
									
								
								mock/utils.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								mock/utils.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,46 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @param {string} url
 | 
			
		||||
 * @returns {Object}
 | 
			
		||||
 */
 | 
			
		||||
function param2Obj(url) {
 | 
			
		||||
  const search = url.split('?')[1]
 | 
			
		||||
  if (!search) {
 | 
			
		||||
    return {}
 | 
			
		||||
  }
 | 
			
		||||
  return JSON.parse(
 | 
			
		||||
    '{"' +
 | 
			
		||||
      decodeURIComponent(search)
 | 
			
		||||
        .replace(/"/g, '\\"')
 | 
			
		||||
        .replace(/&/g, '","')
 | 
			
		||||
        .replace(/=/g, '":"')
 | 
			
		||||
        .replace(/\+/g, ' ') +
 | 
			
		||||
      '"}'
 | 
			
		||||
  )
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * This is just a simple version of deep copy
 | 
			
		||||
 * Has a lot of edge cases bug
 | 
			
		||||
 * If you want to use a perfect deep copy, use lodash's _.cloneDeep
 | 
			
		||||
 * @param {Object} source
 | 
			
		||||
 * @returns {Object}
 | 
			
		||||
 */
 | 
			
		||||
function deepClone(source) {
 | 
			
		||||
  if (!source && typeof source !== 'object') {
 | 
			
		||||
    throw new Error('error arguments', 'deepClone')
 | 
			
		||||
  }
 | 
			
		||||
  const targetObj = source.constructor === Array ? [] : {}
 | 
			
		||||
  Object.keys(source).forEach(keys => {
 | 
			
		||||
    if (source[keys] && typeof source[keys] === 'object') {
 | 
			
		||||
      targetObj[keys] = deepClone(source[keys])
 | 
			
		||||
    } else {
 | 
			
		||||
      targetObj[keys] = source[keys]
 | 
			
		||||
    }
 | 
			
		||||
  })
 | 
			
		||||
  return targetObj
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
module.exports = {
 | 
			
		||||
  param2Obj,
 | 
			
		||||
  deepClone
 | 
			
		||||
}
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "vue-element-admin",
 | 
			
		||||
  "version": "4.2.1",
 | 
			
		||||
  "version": "4.3.0",
 | 
			
		||||
  "description": "A magical vue admin. An out-of-box UI solution for enterprise applications. Newest development stack of vue. Lots of awesome features",
 | 
			
		||||
  "author": "Pan <panfree23@gmail.com>",
 | 
			
		||||
  "license": "MIT",
 | 
			
		||||
@@ -72,8 +72,6 @@
 | 
			
		||||
    "xlsx": "0.14.1"
 | 
			
		||||
  },
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "@babel/core": "7.0.0",
 | 
			
		||||
    "@babel/register": "7.0.0",
 | 
			
		||||
    "@vue/cli-plugin-babel": "3.5.3",
 | 
			
		||||
    "@vue/cli-plugin-eslint": "^3.9.1",
 | 
			
		||||
    "@vue/cli-plugin-unit-jest": "3.5.3",
 | 
			
		||||
@@ -92,9 +90,9 @@
 | 
			
		||||
    "husky": "1.3.1",
 | 
			
		||||
    "lint-staged": "8.1.5",
 | 
			
		||||
    "mockjs": "1.0.1-beta3",
 | 
			
		||||
    "node-sass": "^4.9.0",
 | 
			
		||||
    "plop": "2.3.0",
 | 
			
		||||
    "runjs": "^4.3.2",
 | 
			
		||||
    "sass": "^1.26.2",
 | 
			
		||||
    "sass-loader": "^7.1.0",
 | 
			
		||||
    "script-ext-html-webpack-plugin": "2.1.3",
 | 
			
		||||
    "serve-static": "^1.13.2",
 | 
			
		||||
 
 | 
			
		||||
@@ -48,14 +48,18 @@ export default {
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
.drag-select >>> .sortable-ghost {
 | 
			
		||||
  opacity: .8;
 | 
			
		||||
  color: #fff!important;
 | 
			
		||||
  background: #42b983!important;
 | 
			
		||||
}
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.drag-select {
 | 
			
		||||
  ::v-deep {
 | 
			
		||||
    .sortable-ghost {
 | 
			
		||||
      opacity: .8;
 | 
			
		||||
      color: #fff !important;
 | 
			
		||||
      background: #42b983 !important;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
.drag-select >>> .el-tag {
 | 
			
		||||
  cursor: pointer;
 | 
			
		||||
    .el-tag {
 | 
			
		||||
      cursor: pointer;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -159,7 +159,7 @@ export default {
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    vertical-align: middle;
 | 
			
		||||
 | 
			
		||||
    /deep/ .el-input__inner {
 | 
			
		||||
    ::v-deep .el-input__inner {
 | 
			
		||||
      border-radius: 0;
 | 
			
		||||
      border: 0;
 | 
			
		||||
      padding-left: 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -54,19 +54,24 @@ export default {
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
.json-editor{
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.json-editor {
 | 
			
		||||
  height: 100%;
 | 
			
		||||
  position: relative;
 | 
			
		||||
}
 | 
			
		||||
.json-editor >>> .CodeMirror {
 | 
			
		||||
  height: auto;
 | 
			
		||||
  min-height: 300px;
 | 
			
		||||
}
 | 
			
		||||
.json-editor >>> .CodeMirror-scroll{
 | 
			
		||||
  min-height: 300px;
 | 
			
		||||
}
 | 
			
		||||
.json-editor >>> .cm-s-rubyblue span.cm-string {
 | 
			
		||||
  color: #F08047;
 | 
			
		||||
 | 
			
		||||
  ::v-deep {
 | 
			
		||||
    .CodeMirror {
 | 
			
		||||
      height: auto;
 | 
			
		||||
      min-height: 300px;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .CodeMirror-scroll {
 | 
			
		||||
      min-height: 300px;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .cm-s-rubyblue span.cm-string {
 | 
			
		||||
      color: #F08047;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div v-if="isExternal" :style="styleExternalIcon" class="svg-external-icon svg-icon" v-on="$listeners" />
 | 
			
		||||
  <svg v-else :class="svgClass" aria-hidden="true" v-on="$listeners">
 | 
			
		||||
    <use :href="iconName" />
 | 
			
		||||
    <use :xlink:href="iconName" />
 | 
			
		||||
  </svg>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -104,7 +104,7 @@ export default {
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.editor-slide-upload {
 | 
			
		||||
  margin-bottom: 20px;
 | 
			
		||||
  /deep/ .el-upload--picture-card {
 | 
			
		||||
  ::v-deep .el-upload--picture-card {
 | 
			
		||||
    width: 100%;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -147,7 +147,11 @@ export default {
 | 
			
		||||
          editor.on('FullscreenStateChanged', (e) => {
 | 
			
		||||
            _this.fullscreen = e.state
 | 
			
		||||
          })
 | 
			
		||||
        }
 | 
			
		||||
        },
 | 
			
		||||
        // it will try to keep these URLs intact
 | 
			
		||||
        // https://www.tiny.cloud/docs-3x/reference/configuration/Configuration3x@convert_urls/
 | 
			
		||||
        // https://stackoverflow.com/questions/5196205/disable-tinymce-absolute-to-relative-url-conversions
 | 
			
		||||
        convert_urls: false
 | 
			
		||||
        // 整合七牛上传
 | 
			
		||||
        // images_dataimg_filter(img) {
 | 
			
		||||
        //   setTimeout(() => {
 | 
			
		||||
@@ -209,28 +213,37 @@ export default {
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.tinymce-container {
 | 
			
		||||
  position: relative;
 | 
			
		||||
  line-height: normal;
 | 
			
		||||
}
 | 
			
		||||
.tinymce-container>>>.mce-fullscreen {
 | 
			
		||||
  z-index: 10000;
 | 
			
		||||
 | 
			
		||||
.tinymce-container {
 | 
			
		||||
  ::v-deep {
 | 
			
		||||
    .mce-fullscreen {
 | 
			
		||||
      z-index: 10000;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.tinymce-textarea {
 | 
			
		||||
  visibility: hidden;
 | 
			
		||||
  z-index: -1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.editor-custom-btn-container {
 | 
			
		||||
  position: absolute;
 | 
			
		||||
  right: 4px;
 | 
			
		||||
  top: 4px;
 | 
			
		||||
  /*z-index: 2005;*/
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.fullscreen .editor-custom-btn-container {
 | 
			
		||||
  z-index: 10000;
 | 
			
		||||
  position: fixed;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.editor-upload-btn {
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,5 @@
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
  <!-- eslint-disable vue/require-component-is -->
 | 
			
		||||
  <component v-bind="linkProps(to)">
 | 
			
		||||
  <component :is="type" v-bind="linkProps(to)">
 | 
			
		||||
    <slot />
 | 
			
		||||
  </component>
 | 
			
		||||
</template>
 | 
			
		||||
@@ -16,19 +14,28 @@ export default {
 | 
			
		||||
      required: true
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  computed: {
 | 
			
		||||
    isExternal() {
 | 
			
		||||
      return isExternal(this.to)
 | 
			
		||||
    },
 | 
			
		||||
    type() {
 | 
			
		||||
      if (this.isExternal) {
 | 
			
		||||
        return 'a'
 | 
			
		||||
      }
 | 
			
		||||
      return 'router-link'
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    linkProps(url) {
 | 
			
		||||
      if (isExternal(url)) {
 | 
			
		||||
    linkProps(to) {
 | 
			
		||||
      if (this.isExternal) {
 | 
			
		||||
        return {
 | 
			
		||||
          is: 'a',
 | 
			
		||||
          href: url,
 | 
			
		||||
          href: to,
 | 
			
		||||
          target: '_blank',
 | 
			
		||||
          rel: 'noopener'
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      return {
 | 
			
		||||
        is: 'router-link',
 | 
			
		||||
        to: url
 | 
			
		||||
        to: to
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -19,12 +19,21 @@ export default {
 | 
			
		||||
      return this.$refs.scrollContainer.$refs.wrap
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.scrollWrapper.addEventListener('scroll', this.emitScroll, true)
 | 
			
		||||
  },
 | 
			
		||||
  beforeDestroy() {
 | 
			
		||||
    this.scrollWrapper.removeEventListener('scroll', this.emitScroll)
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    handleScroll(e) {
 | 
			
		||||
      const eventDelta = e.wheelDelta || -e.deltaY * 40
 | 
			
		||||
      const $scrollWrapper = this.scrollWrapper
 | 
			
		||||
      $scrollWrapper.scrollLeft = $scrollWrapper.scrollLeft + eventDelta / 4
 | 
			
		||||
    },
 | 
			
		||||
    emitScroll() {
 | 
			
		||||
      this.$emit('scroll')
 | 
			
		||||
    },
 | 
			
		||||
    moveToTarget(currentTag) {
 | 
			
		||||
      const $container = this.$refs.scrollContainer.$el
 | 
			
		||||
      const $containerWidth = $container.offsetWidth
 | 
			
		||||
@@ -73,7 +82,7 @@ export default {
 | 
			
		||||
  position: relative;
 | 
			
		||||
  overflow: hidden;
 | 
			
		||||
  width: 100%;
 | 
			
		||||
  /deep/ {
 | 
			
		||||
  ::v-deep {
 | 
			
		||||
    .el-scrollbar__bar {
 | 
			
		||||
      bottom: 0px;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <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" @scroll="handleScroll">
 | 
			
		||||
      <router-link
 | 
			
		||||
        v-for="tag in visitedViews"
 | 
			
		||||
        ref="tag"
 | 
			
		||||
@@ -189,6 +189,9 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
    closeMenu() {
 | 
			
		||||
      this.visible = false
 | 
			
		||||
    },
 | 
			
		||||
    handleScroll() {
 | 
			
		||||
      this.closeMenu()
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -6,6 +6,7 @@ import 'normalize.css/normalize.css' // a modern alternative to CSS resets
 | 
			
		||||
 | 
			
		||||
import Element from 'element-ui'
 | 
			
		||||
import './styles/element-variables.scss'
 | 
			
		||||
import enLang from 'element-ui/lib/locale/lang/en'// 如果使用中文语言包请默认支持,无需额外引入,请删除该依赖
 | 
			
		||||
 | 
			
		||||
import '@/styles/index.scss' // global css
 | 
			
		||||
 | 
			
		||||
@@ -33,7 +34,8 @@ if (process.env.NODE_ENV === 'production') {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Vue.use(Element, {
 | 
			
		||||
  size: Cookies.get('size') || 'medium' // set element-ui default size
 | 
			
		||||
  size: Cookies.get('size') || 'medium', // set element-ui default size
 | 
			
		||||
  locale: enLang // 如果使用中文,无需设置,请删除
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
// register global utility filters
 | 
			
		||||
 
 | 
			
		||||
@@ -24,7 +24,7 @@ router.beforeEach(async(to, from, next) => {
 | 
			
		||||
    if (to.path === '/login') {
 | 
			
		||||
      // if is logged in, redirect to the home page
 | 
			
		||||
      next({ path: '/' })
 | 
			
		||||
      NProgress.done()
 | 
			
		||||
      NProgress.done() // hack: https://github.com/PanJiaChen/vue-element-admin/pull/2939
 | 
			
		||||
    } else {
 | 
			
		||||
      // determine whether the user has obtained his permission roles through getInfo
 | 
			
		||||
      const hasRoles = store.getters.roles && store.getters.roles.length > 0
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,7 @@
 | 
			
		||||
.fixed-width {
 | 
			
		||||
  .el-button--mini {
 | 
			
		||||
    padding: 7px 10px;
 | 
			
		||||
    width: 60px;
 | 
			
		||||
    min-width: 60px;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -6,7 +6,7 @@
 | 
			
		||||
/* theme color */
 | 
			
		||||
$--color-primary: #1890ff;
 | 
			
		||||
$--color-success: #13ce66;
 | 
			
		||||
$--color-warning: #FFBA00;
 | 
			
		||||
$--color-warning: #ffba00;
 | 
			
		||||
$--color-danger: #ff4949;
 | 
			
		||||
// $--color-info: #1E1E1E;
 | 
			
		||||
 | 
			
		||||
@@ -17,10 +17,10 @@ $--button-font-weight: 400;
 | 
			
		||||
$--border-color-light: #dfe4ed;
 | 
			
		||||
$--border-color-lighter: #e6ebf5;
 | 
			
		||||
 | 
			
		||||
$--table-border:1px solid#dfe6ec;
 | 
			
		||||
$--table-border: 1px solid #dfe6ec;
 | 
			
		||||
 | 
			
		||||
/* icon font path, required */
 | 
			
		||||
$--font-path: '~element-ui/lib/theme-chalk/fonts';
 | 
			
		||||
$--font-path: "~element-ui/lib/theme-chalk/fonts";
 | 
			
		||||
 | 
			
		||||
@import "~element-ui/packages/theme-chalk/src/index";
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@
 | 
			
		||||
 * @returns {string | null}
 | 
			
		||||
 */
 | 
			
		||||
export function parseTime(time, cFormat) {
 | 
			
		||||
  if (arguments.length === 0) {
 | 
			
		||||
  if (arguments.length === 0 || !time) {
 | 
			
		||||
    return null
 | 
			
		||||
  }
 | 
			
		||||
  const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
 | 
			
		||||
@@ -17,9 +17,17 @@ export function parseTime(time, cFormat) {
 | 
			
		||||
  if (typeof time === 'object') {
 | 
			
		||||
    date = time
 | 
			
		||||
  } else {
 | 
			
		||||
    if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
 | 
			
		||||
      time = parseInt(time)
 | 
			
		||||
    if ((typeof time === 'string')) {
 | 
			
		||||
      if ((/^[0-9]+$/.test(time))) {
 | 
			
		||||
        // support "1548221490638"
 | 
			
		||||
        time = parseInt(time)
 | 
			
		||||
      } else {
 | 
			
		||||
        // support safari
 | 
			
		||||
        // https://stackoverflow.com/questions/4310953/invalid-date-in-safari
 | 
			
		||||
        time = time.replace(new RegExp(/-/gm), '/')
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if ((typeof time === 'number') && (time.toString().length === 10)) {
 | 
			
		||||
      time = time * 1000
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
  <div class="components-container">
 | 
			
		||||
    <aside>
 | 
			
		||||
      Rich text is a core feature of the management backend, but at the same time it is a place with lots of pits. In the process of selecting rich texts, I also took a lot of detours. The common rich texts on the market have been basically used, and I finally chose Tinymce. See the more detailed rich text comparison and introduction.
 | 
			
		||||
      <a target="_blank" class="link-type" href="https://panjiachen.github.io/vue-element-admin-site/component/rich-editor.html">Documentation</a>
 | 
			
		||||
      <a target="_blank" class="link-type" href="https://panjiachen.github.io/vue-element-admin-site/feature/component/rich-editor.html">Documentation</a>
 | 
			
		||||
    </aside>
 | 
			
		||||
    <div>
 | 
			
		||||
      <tinymce v-model="content" :height="300" />
 | 
			
		||||
 
 | 
			
		||||
@@ -101,7 +101,7 @@ export default {
 | 
			
		||||
    background-color: #fff;
 | 
			
		||||
    margin: auto;
 | 
			
		||||
    box-shadow: none!important;
 | 
			
		||||
    /deep/ .pan-info {
 | 
			
		||||
    ::v-deep .pan-info {
 | 
			
		||||
      box-shadow: none!important;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -70,7 +70,7 @@ export default {
 | 
			
		||||
          indicator: [
 | 
			
		||||
            { name: 'Sales', max: 10000 },
 | 
			
		||||
            { name: 'Administration', max: 20000 },
 | 
			
		||||
            { name: 'Information Techology', max: 20000 },
 | 
			
		||||
            { name: 'Information Technology', max: 20000 },
 | 
			
		||||
            { name: 'Customer Support', max: 20000 },
 | 
			
		||||
            { name: 'Development', max: 20000 },
 | 
			
		||||
            { name: 'Marketing', max: 20000 }
 | 
			
		||||
 
 | 
			
		||||
@@ -277,7 +277,7 @@ export default {
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.article-textarea /deep/ {
 | 
			
		||||
.article-textarea ::v-deep {
 | 
			
		||||
  textarea {
 | 
			
		||||
    padding-right: 40px;
 | 
			
		||||
    resize: none;
 | 
			
		||||
 
 | 
			
		||||
@@ -91,7 +91,7 @@ export default {
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.app-container {
 | 
			
		||||
  /deep/ .permission-alert {
 | 
			
		||||
  ::v-deep .permission-alert {
 | 
			
		||||
    width: 320px;
 | 
			
		||||
    margin-top: 15px;
 | 
			
		||||
    background-color: #f0f9eb;
 | 
			
		||||
@@ -100,10 +100,10 @@ export default {
 | 
			
		||||
    border-radius: 4px;
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
  }
 | 
			
		||||
  /deep/ .permission-sourceCode {
 | 
			
		||||
  ::v-deep .permission-sourceCode {
 | 
			
		||||
    margin-left: 15px;
 | 
			
		||||
  }
 | 
			
		||||
  /deep/ .permission-tag {
 | 
			
		||||
  ::v-deep .permission-tag {
 | 
			
		||||
    background-color: #ecf5ff;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -65,7 +65,7 @@ export default {
 | 
			
		||||
          name: '',
 | 
			
		||||
          email: '',
 | 
			
		||||
          avatar: '',
 | 
			
		||||
          roles: ''
 | 
			
		||||
          role: ''
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -13,11 +13,11 @@
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import tabPane from './components/TabPane'
 | 
			
		||||
import TabPane from './components/TabPane'
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'Tab',
 | 
			
		||||
  components: { tabPane },
 | 
			
		||||
  components: { TabPane },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      tabMapOptions: [
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,15 @@
 | 
			
		||||
import { parseTime } from '@/utils/index.js'
 | 
			
		||||
 | 
			
		||||
describe('Utils:parseTime', () => {
 | 
			
		||||
  const d = new Date('2018-07-13 17:54:01') // "2018-07-13 17:54:01"
 | 
			
		||||
  it('timestamp', () => {
 | 
			
		||||
    expect(parseTime(d)).toBe('2018-07-13 17:54:01')
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
  it('timestamp string', () => {
 | 
			
		||||
    expect(parseTime((d + ''))).toBe('2018-07-13 17:54:01')
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
  it('ten digits timestamp', () => {
 | 
			
		||||
    expect(parseTime((d / 1000).toFixed(0))).toBe('2018-07-13 17:54:01')
 | 
			
		||||
  })
 | 
			
		||||
@@ -24,4 +30,8 @@ describe('Utils:parseTime', () => {
 | 
			
		||||
  it('empty argument', () => {
 | 
			
		||||
    expect(parseTime()).toBeNull()
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
  it('null', () => {
 | 
			
		||||
    expect(parseTime(null)).toBeNull()
 | 
			
		||||
  })
 | 
			
		||||
})
 | 
			
		||||
 
 | 
			
		||||
@@ -49,8 +49,11 @@ module.exports = {
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  chainWebpack(config) {
 | 
			
		||||
    config.plugins.delete('preload') // TODO: need test
 | 
			
		||||
    config.plugins.delete('prefetch') // TODO: need test
 | 
			
		||||
    // it can improve the speed of the first screen, it is recommended to turn on preload
 | 
			
		||||
    // config.plugins.delete('preload')
 | 
			
		||||
 | 
			
		||||
    // when there are many pages, it will cause too many meaningless requests
 | 
			
		||||
    config.plugins.delete('prefetch') //
 | 
			
		||||
 | 
			
		||||
    // set svg-sprite-loader
 | 
			
		||||
    config.module
 | 
			
		||||
@@ -80,12 +83,6 @@ module.exports = {
 | 
			
		||||
      })
 | 
			
		||||
      .end()
 | 
			
		||||
 | 
			
		||||
    config
 | 
			
		||||
      // https://webpack.js.org/configuration/devtool/#development
 | 
			
		||||
      .when(process.env.NODE_ENV === 'development',
 | 
			
		||||
        config => config.devtool('cheap-source-map')
 | 
			
		||||
      )
 | 
			
		||||
 | 
			
		||||
    config
 | 
			
		||||
      .when(process.env.NODE_ENV !== 'development',
 | 
			
		||||
        config => {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user