Compare commits

..

78 Commits

Author SHA1 Message Date
花裤衩 33a93a12b4 feat: add new sponsored 2020-12-04 13:50:23 +08:00
花裤衩 1bc2e5c198 docs: add coupon 2020-09-08 10:01:50 +08:00
花裤衩 9cc3fa732a perf: refine documentation button css 2020-09-07 21:45:28 +08:00
花裤衩 44e23d00ca docs: add vue-java-admin-dashboard-spring 2020-09-07 21:37:44 +08:00
花裤衩 8fd08c9167 docs: remove gitads 2020-08-30 22:57:38 +08:00
花裤衩 5e7113935c docs: add GitAds 2020-07-27 10:08:38 +08:00
Kerollos Magdy 46e11caafc
typo: replace Css with CSS (#3323) 2020-07-20 18:13:01 +08:00
dyz ea60478304
perf[permission.js]: remove useless code (#3301) 2020-07-05 13:12:46 +08:00
crayymumu fe22b3cd94
perf[Tinymce]: remove useless code (#3295) 2020-07-01 13:50:18 +08:00
花裤衩 7c06214190
perf[chore]: remove preserveWhitespace config (#3280) 2020-06-24 10:17:57 +08:00
花裤衩 73a9ab0379
fix[chore]: do not preload runtime.js (#3279) 2020-06-23 21:12:44 +08:00
花裤衩 585391228e [release] 4.4.0 2020-06-21 21:39:37 +08:00
Dihak ae2aa61880
bump: update to vue-cli@4 (#3028) 2020-06-21 21:25:55 +08:00
花裤衩 f6d8204b0b [release] 4.3.1 2020-06-18 21:01:02 +08:00
花裤衩 435db380d3 fix some typos 2020-06-15 17:18:55 +08:00
qige2016 6d88db5c73
fix[plop]: set trim => trim() (#3254)
notEmpty
2020-06-15 12:00:17 +08:00
花裤衩 1c943509f9 chore: update element-ui to 2.13.2 2020-06-12 10:18:05 +08:00
花裤衩 4e7665c072
fix[v-permission]: support dynamic set roles (#3251) 2020-06-11 21:02:18 +08:00
花裤衩 a87218e266 perf: lint code 2020-06-11 20:51:10 +08:00
Silentdoer 7702b3d809
perf: remove unused showdown
Co-authored-by: 花裤衩 <panfree23@gmail.com>
2020-06-11 20:24:17 +08:00
MaYuanhai a50180f653
fix[utils]: param2Obj bug when url params includes ==(#3100) 2020-06-11 20:18:23 +08:00
Cat73 fc68f56d13
feat[Menu]: menu icon support el-icon(#3048) 2020-06-11 13:57:41 +08:00
花裤衩 d3bd933a8e
refactor: change mock files to commonjs (#3246) 2020-06-11 11:40:53 +08:00
花裤衩 0bf61aac53 chore: turn on the preload 2020-06-10 21:47:50 +08:00
花裤衩 2ef49493c3 docs: fix wrong link 2020-06-09 10:51:27 +08:00
花裤衩 f14805d0cd [release] 4.3.0 2020-06-08 21:35:01 +08:00
花裤衩 c5abe7532c perf: change >>> ::v-deep 2020-06-08 20:42:55 +08:00
Cat73 534cd5bc26
chore: change node-sass to dart-sass (#3040) 2020-06-08 20:41:46 +08:00
花裤衩 f1feb2a86d [release] 4.2.2 2020-06-08 19:38:55 +08:00
Edwin Betancourt 0ae5079b2a
docs: Improve read me files and changes in Spanish. (#3234) 2020-06-05 13:32:15 +08:00
Nickbing Lao 6f80263b42
fix[css]: min btn width (#3164) 2020-05-08 11:43:39 +08:00
cooper 5890499077
fix[parseTime]: fixed when pass null (#3038) 2020-05-05 13:21:51 +08:00
AiMe1991 29b4ff636b
perf: when tags-view scroll close the right-menu 2020-05-05 12:55:22 +08:00
花裤衩 e692876c28 docs: add tips 2020-05-05 11:06:51 +08:00
garethx 6dacb783b2
feat: add option to try project on CodeSandbox (#2976) 2020-05-04 23:05:29 +08:00
Phạm Ngọc Hòa a2784dd6ef
perf: change default element-ui language to english (#2741) 2020-05-04 21:51:21 +08:00
花裤衩 fc26c3106f
fix: compatibility with vetur (#1700) 2020-05-04 21:30:58 +08:00
ntnyq 9580c43a8e
fix[element-variables]: missing space in element-variables (#3144) 2020-04-28 18:26:34 +08:00
Aisen 1b8f726529
perf[Tinymce]: editor try to keep these URLs intact (#3141) 2020-04-28 10:10:58 +08:00
花裤衩 d4405464ce
fix: use vue-cli default source-map (#3097)
cheap-module-eval-source-map
2020-04-22 10:31:46 +08:00
Alex S 9d8c7edf91
fixed typo (#3091) 2020-04-04 15:53:26 +08:00
花裤衩 6eccffeb2f
fix: svg support old broswer (#3085) 2020-03-28 11:16:41 +08:00
花裤衩 f7a9d21109
Update README.zh-CN.md 2020-03-27 12:32:30 +08:00
花裤衩 993a6c72e8 docs: add smallsticker 2020-03-27 11:57:40 +08:00
echofly 9e0435ac85
perf: format component names as PascalCase (#3074)
format: component names should be PascalCase
2020-03-24 10:17:18 +08:00
Aisen60 776f10e197
fix:fixed parseTime bug in ie and safari(#3066)
* /src/utils/index.js parseTime 添加IE浏览器(版本10以下,包括版本10)兼容。

* perf: update

Co-authored-by: aisen60 <aisen60@qq.com>
Co-authored-by: 花裤衩 <panfree23@gmail.com>
2020-03-20 21:24:31 +08:00
echofly c2a5a15956
fix[profile/UserCard]: fixed wrong key name (#3056)
roles => role
2020-03-18 19:22:38 +08:00
花裤衩 a45e64fcb2 perf: change script-loader to dependencies 2020-02-12 10:01:27 +08:00
Shota Aratono fec25fedba
docs: improve Japanese translation (#2970) 2020-02-05 09:51:43 +08:00
RoBlues d6816c547d
perf[Mock]: set responseFake to mock-server.js(#2966)
* modify 把mock/index.js中与mock-server相关的代码转移到mock-server.js中去,实现两则功能分割
2020-02-02 19:39:40 +08:00
李小斐 6850312e89 fix: fixed redirect path regex (#2933) 2020-01-11 10:25:59 +08:00
花裤衩 d634e2ae2f fix: fixed require mock bug in production 2020-01-09 20:24:48 +08:00
花裤衩 b57f2008bd bump: update element-ui version 2020-01-09 17:36:49 +08:00
花裤衩 c9affcf2ad
fix: fixed mock server (#2929)
* init

* refine

* update
2020-01-09 17:21:36 +08:00
花裤衩 fbad7f481b
fix[Charts]: fix charts resize in keep-alive bug (#2922)
* fix[Charts]: fix charts resize in keep-alive bug

* refine
2020-01-09 16:49:57 +08:00
RussXD 088f64eecc perf: optimize checkCapslock method (#2635)
* optimize checkCapslock method

* update

Co-authored-by: 花裤衩 <panfree23@gmail.com>
2020-01-08 12:12:10 +08:00
AndyLZC/AndyLZC.github.io 55b1bbac99 perf[complex-table]:refine code (#2825)
* 解决无法删除列表的bug;优化代码;

* perf: refine

Co-authored-by: 花裤衩 <panfree23@gmail.com>
2020-01-07 22:30:07 +08:00
Kaitian Xie fd5a2e8da2 perf[Menu]: remove unused menu-wrapper (#2903) 2020-01-06 22:34:14 +08:00
任羽飞 a0b39d5043 perf: import mockXHR only in production (#2910)
* 自动排除mock

生产环境,使用webpack的条件编译自动排除mock数据

* perf: refine

Co-authored-by: 花裤衩 <panfree23@gmail.com>
2020-01-06 22:22:37 +08:00
4f563a7bfe fix[Logout]: click blank area of ​​dropDown able to logout (#2896)
Fixed clicking blank area of ​​drop-down unable to log out
2019-12-31 14:14:34 +08:00
花裤衩 262c0ba08e perf[documentation]: refine css 2019-12-15 20:17:59 +08:00
flitrue 594fc58d0c fix[icons]:fixed eslint 1 error and 2 warnings (#2835) 2019-12-12 15:16:03 +08:00
monkeycf 65d8c451e8 feat: plop new generate store (#2805) 2019-12-04 10:34:23 +08:00
xuanzai e1554fdbd0 perf[views/icons]: use grid (#2803) 2019-12-01 15:48:30 +08:00
Phạm Ngọc Hòa 53803d067d perf: format pdf download (#2791) 2019-11-27 10:06:28 +08:00
花裤衩 25dddbbce8
update 'MarkdownEditor' components name (#2743) 2019-11-12 17:25:12 +08:00
Phạm Ngọc Hòa 683f68b838 format: space in user card (#2744) 2019-11-12 17:24:30 +08:00
bbigcd 44203f88a7
update 'MarkdownEditor' components name 2019-11-12 12:08:45 +08:00
Phạm Ngọc Hòa d5c013a48c perf: text i18n (#2739) 2019-11-11 19:39:59 +08:00
Phạm Ngọc Hòa b11acb2171 perf: complex table (#2732)
Move ont format `{row}`
2019-11-08 11:26:53 +08:00
Phạm Ngọc Hòa b2dd7caee6 perf: format drag table (#2733)
move one format `{row}`
2019-11-08 11:25:42 +08:00
Phạm Ngọc Hòa a4fa1199ba perf: format inline edit table (#2725)
move one format `{row}`
2019-11-07 13:37:05 +08:00
Phạm Ngọc Hòa 6a194d1b4f perf: format dropdown menu code (#2720) 2019-11-05 14:26:24 +08:00
花裤衩 6739ab543b style: fix el-date-picker css style 2019-10-25 19:45:21 +08:00
BradyBromley 6a214f0eac docs: improved README.md (#2656) 2019-10-14 10:25:30 +08:00
花裤衩 5273e02259 docs: add job ad 2019-10-12 17:51:26 +08:00
花裤衩 b51590b982
fix[TagsView]: fixed click.middle can close affixed tag bug (#2649) 2019-10-11 13:37:01 +08:00
MaYuanhai 12b44f5d4b perf[SvgIcon]: change xlink:href to href(#2645)
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href
2019-10-10 11:35:48 +08:00
71 changed files with 895 additions and 641 deletions

View File

@ -3,12 +3,3 @@ ENV = 'development'
# base api
VUE_APP_BASE_API = '/dev-api'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
# It only does one thing by converting all import() to require().
# This configuration can significantly increase the speed of hot updates,
# when you have a large number of pages.
# Detail: https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -51,51 +51,62 @@ 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">
[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](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>
### Akveo
<a href="https://store.akveo.com/products/vue-java-admin-dashboard-spring?utm_campaign=akveo_store-Vue-Vue_demo%2Fgithub&utm_source=vue_admin&utm_medium=referral&utm_content=github_banner"><img width="500px" src="https://raw.githubusercontent.com/PanJiaChen/vue-element-admin-site/master/docs/.vuepress/public/images/vue-java-banner.png" /></a><p>Get Java backend for Vue admin with 20% discount for 39$ use coupon code SWB0RAZPZR1M
</p>
### Flatlogic
<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>Admin Dashboard Templates made with Vue, React and Angular.</p>
## Características
```
- 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 +117,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 +146,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 +219,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

View File

@ -30,7 +30,7 @@
## 概要
[vue-element-admin](https://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の多言語対応、可変ルート、権限、典型的なビジネスアプリテンプレートであり、豊富なコンポーネントを提供しています素早くビジネス用の管理画面の現型を構築に役立ちます。
- [デモページ](https://panjiachen.github.io/vue-element-admin)
@ -44,22 +44,24 @@
- おすすめシンプルテンプレート: [vue-admin-template](https://github.com/PanJiaChen/vue-admin-template)
- デスクトップバージョン: [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))
- Typescriptバージョン: [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (感謝: [@Armour](https://github.com/Armour))
- [awesome-project](https://github.com/PanJiaChen/vue-element-admin/issues/2312)
**After the `v4.1.0+` version, the default master branch will not support i18n. Please use [i18n Branch](https://github.com/PanJiaChen/vue-element-admin/tree/i18n), it will keep up with the master update**
**バージョン`v4.1.0+`以降について、デフォルトのmasterブランチではi18nをサポートしていません。masterブランチと共にアップデートされる[i18n Branch](https://github.com/PanJiaChen/vue-element-admin/tree/i18n)を使用してください。 **
**現在のバージョン `v4.0+``vue-cli` で構築バグ報告は[issue](https://github.com/PanJiaChen/vue-element-admin/issues/new)のissueでお願いします。旧バージョン[tag/3.11.0](https://github.com/PanJiaChen/vue-element-admin/tree/tag/3.11.0)もあります。`vue-cli`に依存しないです。**
**現在のバージョン `v4.0+``vue-cli` で構築していて、バグ報告は[issue](https://github.com/PanJiaChen/vue-element-admin/issues/new)のissueでお願いします。旧バージョン[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)**
## 前準備
ローカル環境に [node](http://nodejs.org/) と [git](https://git-scm.com/)インストールが必要です。[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) [element-ui](https://github.com/ElemeFE/element)で開発しています。Requestは[Mock.js](https://github.com/nuysoft/Mock)のモックデータを使っています。
ローカル環境に [node](http://nodejs.org/) と [git](https://git-scm.com/)インストールが必要です。[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) [element-ui](https://github.com/ElemeFE/element)で開発しています。Requestは[Mock.js](https://github.com/nuysoft/Mock)のモックデータを使っています。
**バグ修正や新規機能追加のissue と pull requestは大歓迎です。**
<p align="center">
[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](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>
@ -67,6 +69,12 @@
Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor]](https://www.patreon.com/panjiachen)
### Akveo
<a href="https://store.akveo.com/products/vue-java-admin-dashboard-spring?utm_campaign=akveo_store-Vue-Vue_demo%2Fgithub&utm_source=vue_admin&utm_medium=referral&utm_content=github_banner"><img width="500px" src="https://raw.githubusercontent.com/PanJiaChen/vue-element-admin-site/master/docs/.vuepress/public/images/vue-java-banner.png" /></a><p>Get Java backend for Vue admin with 20% discount for 39$ use coupon code SWB0RAZPZR1M
</p>
### Flatlogic
<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>Admin Dashboard Templates made with Vue, React and Angular.</p>
## 機能一覧
@ -81,15 +89,18 @@ 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
- 共通機能
- 多言語切替
- テーマ切替
- サイトメニュー(ルートから生成)
- Breadcrumb Navigation
- Tag Navigation
- Svg Sprite Icon
- パンくずリストナビゲーション
- タブナビゲーション
- Svg Sprite アイコン
- ローカル/バックエンド モック データ
- Screenfull
@ -104,33 +115,33 @@ Become a sponsor and get your logo on our README on GitHub with a link to your s
- リード
- Zip
- Table
- Dynamic Table
- Drag And Drop Table
- Inline Edit Table
- テーブル
- ダイナミックテーブル
- ドラッグアンドドロップテーブル
- インラインエディットテーブル
- Error Page
- エラーページ
- 401
- 404
- コンポーネント
- Avatar Upload
- Back To Top
- Drag Dialog
- Drag Select
- Drag Kanban
- Drag List
- SplitPane
- アバターアップロード
- トップに戻る
- ドラッグダイアログ
- ドラッグ選択
- ドラッグKanban
- ドラッグリスト
- ペインの分割
- Dropzone
- Sticky
- スティッキー
- CountTo
- Advanced Example
- Error Log
- Dashboard
- Guide Page
- 高度なサンプル
- エラーログ
- ダッシュボード
- ガイドページ
- ECharts
- Clipboard
- クリップボード
- Markdown to html
```
@ -150,7 +161,7 @@ npm install
npm run dev
```
This will automatically open http://localhost:9527
http://localhost:9527 が自動的に開きます。
## Build
@ -178,11 +189,11 @@ npm run lint
npm run lint -- --fix
```
Refer to [Documentation](https://panjiachen.github.io/vue-element-admin-site/guide/essentials/deploy.html) for more information
詳細は [Documentation](https://panjiachen.github.io/vue-element-admin-site/guide/essentials/deploy.html) を参照してください。
## Changelog
Detailed changes for each release are documented in the [release notes](https://github.com/PanJiaChen/vue-element-admin/releases).
各リリースの詳細は [release notes](https://github.com/PanJiaChen/vue-element-admin/releases) にあります。
## Online Demo
@ -204,7 +215,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

View File

@ -28,11 +28,33 @@
English | [简体中文](./README.zh-CN.md) | [日本語](./README.ja.md) | [Spanish](./README.es.md)
<p align="center">
<b>SPONSORED BY</b>
</p>
<table align="center" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="center" valign="middle" width="250">
<a href="https://www.duohui.cn/?utm_source=vue-element-admin&utm_medium=web&utm_campaign=vue-element-admin_github" title="多会" target="_blank">
<img height="60px" src="https://qiniu.cdn.duohui.co/brand/duohui.png" title="多会 - 活动服务销售平台">
<p>活动服务销售平台</p>
</a>
</td>
<td align="center" valign="middle" width="250">
<a href="https://youke.co/?utm_source=vue-element-admin&utm_medium=web&utm_campaign=vue-element-admin_github" title="有客" target="_blank">
<img height="60px" src="https://qiniu.cdn.duohui.co/brand/youke.png" title="有客 - 客户消息直达工作群">
<p>客户消息直达工作群</p>
</a>
</td>
</tr>
</tbody>
</table>
## Introduction
[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).
[vue-element-admin](https://panjiachen.github.io/vue-element-admin) is a production-ready front-end solution for admin interfaces. It is based on [vue](https://github.com/vuejs/vue) and uses 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.
[vue-element-admin](https://panjiachen.github.io/vue-element-admin) is based on the newest development stack of vue and it has a built-in i18n solution, typical templates for enterprise applications, and lots of awesome features. It helps you build large and complex Single-Page Applications. I believe whatever your needs are, this project will help you.
- [Preview](https://panjiachen.github.io/vue-element-admin)
@ -62,7 +84,9 @@ It is a magical vue admin based on the newest development stack of vue, built-in
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">
[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](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>
@ -70,6 +94,12 @@ Understanding and learning this knowledge in advance will greatly help the use o
Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor]](https://www.patreon.com/panjiachen)
### Akveo
<a href="https://store.akveo.com/products/vue-java-admin-dashboard-spring?utm_campaign=akveo_store-Vue-Vue_demo%2Fgithub&utm_source=vue_admin&utm_medium=referral&utm_content=github_banner"><img width="500px" src="https://raw.githubusercontent.com/PanJiaChen/vue-element-admin-site/master/docs/.vuepress/public/images/vue-java-banner.png" /></a><p>Get Java backend for Vue admin with 20% discount for 39$ use coupon code SWB0RAZPZR1M
</p>
### Flatlogic
<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>Admin Dashboard Templates made with Vue, React and Angular.</p>
## Features
@ -84,7 +114,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 +241,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

View File

@ -28,6 +28,28 @@
简体中文 | [English](./README.md) | [日本語](./README.ja.md) | [Spanish](./README.es.md)
<p align="center">
<b>SPONSORED BY</b>
</p>
<table align="center" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="center" valign="middle" width="250">
<a href="https://www.duohui.cn/?utm_source=vue-element-admin&utm_medium=web&utm_campaign=vue-element-admin_github" title="多会" target="_blank">
<img height="60px" src="https://qiniu.cdn.duohui.co/brand/duohui.png" title="多会 - 活动服务销售平台">
<p>活动服务销售平台</p>
</a>
</td>
<td align="center" valign="middle" width="250">
<a href="https://youke.co/?utm_source=vue-element-admin&utm_medium=web&utm_campaign=vue-element-admin_github" title="有客" target="_blank">
<img height="60px" src="https://qiniu.cdn.duohui.co/brand/youke.png" title="有客 - 客户消息直达工作群">
<p>客户消息直达工作群</p>
</a>
</td>
</tr>
</tbody>
</table>
## 简介
[vue-element-admin](https://panjiachen.github.io/vue-element-admin) 是一个后台前端解决方案,它基于 [vue](https://github.com/vuejs/vue) 和 [element-ui](https://github.com/ElemeFE/element)实现。它使用了最新的前端技术栈,内置了 i18n 国际化解决方案,动态路由,权限验证,提炼了典型的业务模型,提供了丰富的功能组件,它可以帮助你快速搭建企业级中后台产品原型。相信不管你的需求是什么,本项目都能帮助到你。
@ -77,7 +99,9 @@
**如有问题请先看上述使用文档和文章,若不能满足,欢迎 issue 和 pr**
<p align="center">
[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](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>
@ -85,8 +109,14 @@
Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor]](https://www.patreon.com/panjiachen)
### Akveo
<a href="https://store.akveo.com/products/vue-java-admin-dashboard-spring?utm_campaign=akveo_store-Vue-Vue_demo%2Fgithub&utm_source=vue_admin&utm_medium=referral&utm_content=github_banner"><img width="500px" src="https://raw.githubusercontent.com/PanJiaChen/vue-element-admin-site/master/docs/.vuepress/public/images/vue-java-banner.png" /></a><p>Java 后端整合可以使用优惠码SWB0RAZPZR1M获得20%的价格优化</p>
### Flatlogic
<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>Admin Dashboard Templates made with Vue, React and Angular.</p>
## 功能
```
@ -99,7 +129,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 +254,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

View File

@ -1,5 +1,14 @@
module.exports = {
presets: [
'@vue/app'
]
// https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app
'@vue/cli-plugin-babel/preset'
],
'env': {
'development': {
// babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().
// This plugin can significantly increase the speed of hot updates, when you have a large number of pages.
// https://panjiachen.github.io/vue-element-admin-site/guide/advanced/lazy-loading.html
'plugins': ['dynamic-import-node']
}
}
}

View File

@ -1,4 +1,4 @@
const { sh } = require('tasksfile')
const { run } = require('runjs')
const chalk = require('chalk')
const config = require('../vue.config.js')
const rawArgv = process.argv.slice(2)
@ -7,7 +7,7 @@ const args = rawArgv.join(' ')
if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
const report = rawArgv.includes('--report')
sh(`vue-cli-service build ${args}`)
run(`vue-cli-service build ${args}`)
const port = 9526
const publicPath = config.publicPath
@ -31,5 +31,5 @@ if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
})
} else {
sh(`vue-cli-service build ${args}`)
run(`vue-cli-service build ${args}`)
}

View File

@ -1,4 +1,4 @@
import Mock from 'mockjs'
const Mock = require('mockjs')
const List = []
const count = 100
@ -18,7 +18,7 @@ for (let i = 0; i < count; i++) {
forecast: '@float(0, 100, 2, 2)',
importance: '@integer(1, 3)',
'type|1': ['CN', 'US', 'JP', 'EU'],
'status|1': ['published', 'draft', 'deleted'],
'status|1': ['published', 'draft'],
display_time: '@datetime',
comment_disabled: true,
pageviews: '@integer(300, 5000)',
@ -27,9 +27,9 @@ for (let i = 0; i < count; i++) {
}))
}
export default [
module.exports = [
{
url: '/article/list',
url: '/vue-element-admin/article/list',
type: 'get',
response: config => {
const { importance, type, title, page = 1, limit = 20, sort } = config.query
@ -58,7 +58,7 @@ export default [
},
{
url: '/article/detail',
url: '/vue-element-admin/article/detail',
type: 'get',
response: config => {
const { id } = config.query
@ -74,7 +74,7 @@ export default [
},
{
url: '/article/pv',
url: '/vue-element-admin/article/pv',
type: 'get',
response: _ => {
return {
@ -92,7 +92,7 @@ export default [
},
{
url: '/article/create',
url: '/vue-element-admin/article/create',
type: 'post',
response: _ => {
return {
@ -103,7 +103,7 @@ export default [
},
{
url: '/article/update',
url: '/vue-element-admin/article/update',
type: 'post',
response: _ => {
return {

View File

@ -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,17 +54,7 @@ export function mockXHR() {
}
}
// for mock server
const responseFake = (url, type, respond) => {
return {
url: new RegExp(`/mock${url}`),
type: type || 'get',
response(req, res) {
res.json(Mock.mock(respond instanceof Function ? respond(req, res) : respond))
}
}
module.exports = {
mocks,
mockXHR
}
export default mocks.map(route => {
return responseFake(route.url, route.type, route.response)
})

View File

@ -2,17 +2,21 @@ const chokidar = require('chokidar')
const bodyParser = require('body-parser')
const chalk = require('chalk')
const path = require('path')
const Mock = require('mockjs')
const mockDir = path.join(process.cwd(), 'mock')
function registerRoutes(app) {
let mockLastIndex
const { default: mocks } = require('./index.js')
for (const mock of mocks) {
const { mocks } = require('./index.js')
const mocksForServer = mocks.map(route => {
return responseFake(route.url, route.type, route.response)
})
for (const mock of mocksForServer) {
app[mock.type](mock.url, mock.response)
mockLastIndex = app._router.stack.length
}
const mockRoutesLength = Object.keys(mocks).length
const mockRoutesLength = Object.keys(mocksForServer).length
return {
mockRoutesLength: mockRoutesLength,
mockStartIndex: mockLastIndex - mockRoutesLength
@ -27,10 +31,19 @@ function unregisterRoutes() {
})
}
module.exports = app => {
// es6 polyfill
require('@babel/register')
// for mock server
const responseFake = (url, type, respond) => {
return {
url: new RegExp(`${process.env.VUE_APP_BASE_API}${url}`),
type: type || 'get',
response(req, res) {
console.log('request invoke:' + req.path)
res.json(Mock.mock(respond instanceof Function ? respond(req, res) : respond))
}
}
}
module.exports = app => {
// parse app.body
// https://expressjs.com/en/4x/api.html#req.body
app.use(bodyParser.json())

View File

@ -1,4 +1,4 @@
import Mock from 'mockjs'
const Mock = require('mockjs')
const NameList = []
const count = 100
@ -10,10 +10,10 @@ for (let i = 0; i < count; i++) {
}
NameList.push({ name: 'mock-Pan' })
export default [
module.exports = [
// username search
{
url: '/search/user',
url: '/vue-element-admin/search/user',
type: 'get',
response: config => {
const { name } = config.query
@ -30,7 +30,7 @@ export default [
// transaction list
{
url: '/transaction/list',
url: '/vue-element-admin/transaction/list',
type: 'get',
response: _ => {
return {

View File

@ -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,10 +35,10 @@ const roles = [
}
]
export default [
module.exports = [
// mock get all routes form server
{
url: '/routes',
url: '/vue-element-admin/routes',
type: 'get',
response: _ => {
return {
@ -50,7 +50,7 @@ export default [
// mock get all roles form server
{
url: '/roles',
url: '/vue-element-admin/roles',
type: 'get',
response: _ => {
return {
@ -62,7 +62,7 @@ export default [
// add role
{
url: '/role',
url: '/vue-element-admin/role',
type: 'post',
response: {
code: 20000,
@ -74,7 +74,7 @@ export default [
// update role
{
url: '/role/[A-Za-z0-9]',
url: '/vue-element-admin/role/[A-Za-z0-9]',
type: 'put',
response: {
code: 20000,
@ -86,7 +86,7 @@ export default [
// delete role
{
url: '/role/[A-Za-z0-9]',
url: '/vue-element-admin/role/[A-Za-z0-9]',
type: 'delete',
response: {
code: 20000,

View File

@ -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
}

View File

@ -23,10 +23,10 @@ const users = {
}
}
export default [
module.exports = [
// user login
{
url: '/user/login',
url: '/vue-element-admin/user/login',
type: 'post',
response: config => {
const { username } = config.body
@ -49,7 +49,7 @@ export default [
// get user info
{
url: '/user/info\.*',
url: '/vue-element-admin/user/info\.*',
type: 'get',
response: config => {
const { token } = config.query
@ -72,7 +72,7 @@ export default [
// user logout
{
url: '/user/logout',
url: '/vue-element-admin/user/logout',
type: 'post',
response: _ => {
return {

48
mock/utils.js Normal file
View File

@ -0,0 +1,48 @@
/**
* @param {string} url
* @returns {Object}
*/
function param2Obj(url) {
const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ')
if (!search) {
return {}
}
const obj = {}
const searchArr = search.split('&')
searchArr.forEach(v => {
const index = v.indexOf('=')
if (index !== -1) {
const name = v.substring(0, index)
const val = v.substring(index + 1, v.length)
obj[name] = val
}
})
return obj
}
/**
* 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
}

View File

@ -1,30 +1,87 @@
{
"name": "vue-element-admin",
"version": "4.2.1",
"version": "4.4.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",
"scripts": {
"dev": "vue-cli-service serve",
"lint": "eslint --ext .js,.vue src",
"build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",
"lint": "eslint --ext .js,.vue src",
"test:unit": "jest --clearCache && vue-cli-service test:unit",
"test:ci": "npm run lint && npm run test:unit",
"new": "plop",
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
"new": "plop"
"test:unit": "jest --clearCache && vue-cli-service test:unit",
"test:ci": "npm run lint && npm run test:unit"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
"dependencies": {
"axios": "0.18.1",
"clipboard": "2.0.4",
"codemirror": "5.45.0",
"core-js": "3.6.5",
"driver.js": "0.9.5",
"dropzone": "5.5.1",
"echarts": "4.2.1",
"element-ui": "2.13.2",
"file-saver": "2.0.1",
"fuse.js": "3.4.4",
"js-cookie": "2.2.0",
"jsonlint": "1.6.3",
"jszip": "3.2.1",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
"screenfull": "4.2.0",
"script-loader": "0.7.2",
"sortablejs": "1.8.4",
"tui-editor": "1.3.3",
"vue": "2.6.10",
"vue-count-to": "1.0.13",
"vue-router": "3.0.2",
"vue-splitpane": "1.0.4",
"vuedraggable": "2.20.0",
"vuex": "3.1.0",
"xlsx": "0.14.1"
},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
"devDependencies": {
"@vue/cli-plugin-babel": "4.4.4",
"@vue/cli-plugin-eslint": "4.4.4",
"@vue/cli-plugin-unit-jest": "4.4.4",
"@vue/cli-service": "4.4.4",
"@vue/test-utils": "1.0.0-beta.29",
"autoprefixer": "9.5.1",
"babel-eslint": "10.1.0",
"babel-jest": "23.6.0",
"babel-plugin-dynamic-import-node": "2.3.3",
"chalk": "2.4.2",
"chokidar": "2.1.5",
"connect": "3.6.6",
"eslint": "6.7.2",
"eslint-plugin-vue": "6.2.2",
"html-webpack-plugin": "3.2.0",
"husky": "1.3.1",
"lint-staged": "8.1.5",
"mockjs": "1.0.1-beta3",
"plop": "2.3.0",
"runjs": "4.3.2",
"sass": "1.26.2",
"sass-loader": "8.0.2",
"script-ext-html-webpack-plugin": "2.1.3",
"serve-static": "1.13.2",
"svg-sprite-loader": "4.1.3",
"svgo": "1.2.0",
"vue-template-compiler": "2.6.10"
},
"browserslist": [
"> 1%",
"last 2 versions"
],
"bugs": {
"url": "https://github.com/PanJiaChen/vue-element-admin/issues"
},
"engines": {
"node": ">=8.9",
"npm": ">= 3.0.0"
},
"keywords": [
"vue",
@ -35,79 +92,20 @@
"admin-template",
"management-system"
],
"license": "MIT",
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/PanJiaChen/vue-element-admin.git"
},
"bugs": {
"url": "https://github.com/PanJiaChen/vue-element-admin/issues"
},
"dependencies": {
"axios": "0.18.1",
"clipboard": "2.0.4",
"codemirror": "5.49.0",
"driver.js": "0.9.7",
"dropzone": "5.5.1",
"echarts": "4.3.0",
"element-ui": "2.12.0",
"file-saver": "2.0.2",
"fuse.js": "3.4.5",
"js-cookie": "2.2.1",
"jsonlint": "1.6.3",
"jszip": "3.2.2",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
"screenfull": "5.0.0",
"showdown": "1.9.0",
"sortablejs": "1.10.1",
"tui-editor": "1.4.7",
"vue": "2.6.10",
"vue-count-to": "1.0.13",
"vue-router": "3.1.3",
"vue-splitpane": "1.0.4",
"vuedraggable": "2.23.2",
"vuex": "3.1.1",
"xlsx": "0.15.1"
},
"devDependencies": {
"@babel/core": "7.0.0",
"@babel/register": "7.0.0",
"@vue/cli-plugin-babel": "3.11.0",
"@vue/cli-plugin-eslint": "3.11.0",
"@vue/cli-plugin-unit-jest": "3.11.0",
"@vue/cli-service": "3.11.0",
"@vue/test-utils": "1.0.0-beta.29",
"autoprefixer": "^9.5.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.0.3",
"babel-jest": "24.9.0",
"chalk": "2.4.2",
"chokidar": "3.1.1",
"connect": "3.7.0",
"eslint": "6.5.1",
"eslint-plugin-vue": "5.2.3",
"html-webpack-plugin": "3.2.0",
"husky": "3.0.8",
"lint-staged": "9.4.2",
"mockjs": "1.0.1-beta3",
"node-sass": "^4.9.0",
"plop": "2.4.0",
"tasksfile": "5.1.0",
"sass-loader": "^7.1.0",
"script-ext-html-webpack-plugin": "2.1.4",
"script-loader": "0.7.2",
"serve-static": "^1.13.2",
"svg-sprite-loader": "4.1.6",
"svgo": "1.3.0",
"vue-template-compiler": "2.6.10"
},
"engines": {
"node": ">=8.9",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}
}

View File

@ -0,0 +1,16 @@
{{#if state}}
const state = {}
{{/if}}
{{#if mutations}}
const mutations = {}
{{/if}}
{{#if actions}}
const actions = {}
{{/if}}
export default {
namespaced: true,
{{options}}
}

View File

@ -0,0 +1,62 @@
const { notEmpty } = require('../utils.js')
module.exports = {
description: 'generate store',
prompts: [{
type: 'input',
name: 'name',
message: 'store name please',
validate: notEmpty('name')
},
{
type: 'checkbox',
name: 'blocks',
message: 'Blocks:',
choices: [{
name: 'state',
value: 'state',
checked: true
},
{
name: 'mutations',
value: 'mutations',
checked: true
},
{
name: 'actions',
value: 'actions',
checked: true
}
],
validate(value) {
if (!value.includes('state') || !value.includes('mutations')) {
return 'store require at least state and mutations'
}
return true
}
}
],
actions(data) {
const name = '{{name}}'
const { blocks } = data
const options = ['state', 'mutations']
const joinFlag = `,
`
if (blocks.length === 3) {
options.push('actions')
}
const actions = [{
type: 'add',
path: `src/store/modules/${name}.js`,
templateFile: 'plop-templates/store/index.hbs',
data: {
options: options.join(joinFlag),
state: blocks.includes('state'),
mutations: blocks.includes('mutations'),
actions: blocks.includes('actions')
}
}]
return actions
}
}

View File

@ -1,9 +1,2 @@
exports.notEmpty = name => {
return v => {
if (!v || v.trim === '') {
return `${name} is required`
} else {
return true
}
}
}
exports.notEmpty = name => v =>
!v || v.trim() === '' ? `${name} is required` : true

View File

@ -1,7 +1,9 @@
const viewGenerator = require('./plop-templates/view/prompt')
const componentGenerator = require('./plop-templates/component/prompt')
const storeGenerator = require('./plop-templates/store/prompt.js')
module.exports = function(plop) {
plop.setGenerator('view', viewGenerator)
plop.setGenerator('component', componentGenerator)
plop.setGenerator('store', storeGenerator)
}

View File

@ -2,7 +2,7 @@ import request from '@/utils/request'
export function fetchList(query) {
return request({
url: '/article/list',
url: '/vue-element-admin/article/list',
method: 'get',
params: query
})
@ -10,7 +10,7 @@ export function fetchList(query) {
export function fetchArticle(id) {
return request({
url: '/article/detail',
url: '/vue-element-admin/article/detail',
method: 'get',
params: { id }
})
@ -18,7 +18,7 @@ export function fetchArticle(id) {
export function fetchPv(pv) {
return request({
url: '/article/pv',
url: '/vue-element-admin/article/pv',
method: 'get',
params: { pv }
})
@ -26,7 +26,7 @@ export function fetchPv(pv) {
export function createArticle(data) {
return request({
url: '/article/create',
url: '/vue-element-admin/article/create',
method: 'post',
data
})
@ -34,7 +34,7 @@ export function createArticle(data) {
export function updateArticle(data) {
return request({
url: '/article/update',
url: '/vue-element-admin/article/update',
method: 'post',
data
})

View File

@ -2,7 +2,7 @@ import request from '@/utils/request'
export function searchUser(name) {
return request({
url: '/search/user',
url: '/vue-element-admin/search/user',
method: 'get',
params: { name }
})
@ -10,7 +10,7 @@ export function searchUser(name) {
export function transactionList(query) {
return request({
url: '/transaction/list',
url: '/vue-element-admin/transaction/list',
method: 'get',
params: query
})

View File

@ -2,21 +2,21 @@ import request from '@/utils/request'
export function getRoutes() {
return request({
url: '/routes',
url: '/vue-element-admin/routes',
method: 'get'
})
}
export function getRoles() {
return request({
url: '/roles',
url: '/vue-element-admin/roles',
method: 'get'
})
}
export function addRole(data) {
return request({
url: '/role',
url: '/vue-element-admin/role',
method: 'post',
data
})
@ -24,7 +24,7 @@ export function addRole(data) {
export function updateRole(id, data) {
return request({
url: `/role/${id}`,
url: `/vue-element-admin/role/${id}`,
method: 'put',
data
})
@ -32,7 +32,7 @@ export function updateRole(id, data) {
export function deleteRole(id) {
return request({
url: `/role/${id}`,
url: `/vue-element-admin/role/${id}`,
method: 'delete'
})
}

View File

@ -2,7 +2,7 @@ import request from '@/utils/request'
export function login(data) {
return request({
url: '/user/login',
url: '/vue-element-admin/user/login',
method: 'post',
data
})
@ -10,7 +10,7 @@ export function login(data) {
export function getInfo(token) {
return request({
url: '/user/info',
url: '/vue-element-admin/user/info',
method: 'get',
params: { token }
})
@ -18,7 +18,7 @@ export function getInfo(token) {
export function logout() {
return request({
url: '/user/logout',
url: '/vue-element-admin/user/logout',
method: 'post'
})
}

View File

@ -3,32 +3,54 @@ import { debounce } from '@/utils'
export default {
data() {
return {
$_sidebarElm: null
$_sidebarElm: null,
$_resizeHandler: null
}
},
mounted() {
this.__resizeHandler = debounce(() => {
if (this.chart) {
this.chart.resize()
this.initListener()
},
activated() {
if (!this.$_resizeHandler) {
// avoid duplication init
this.initListener()
}
}, 100)
window.addEventListener('resize', this.__resizeHandler)
this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0]
this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler)
// when keep-alive chart activated, auto resize
this.resize()
},
beforeDestroy() {
window.removeEventListener('resize', this.__resizeHandler)
this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler)
this.destroyListener()
},
deactivated() {
this.destroyListener()
},
methods: {
// use $_ for mixins properties
// https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
$_sidebarResizeHandler(e) {
if (e.propertyName === 'width') {
this.__resizeHandler()
this.$_resizeHandler()
}
},
initListener() {
this.$_resizeHandler = debounce(() => {
this.resize()
}, 100)
window.addEventListener('resize', this.$_resizeHandler)
this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0]
this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler)
},
destroyListener() {
window.removeEventListener('resize', this.$_resizeHandler)
this.$_resizeHandler = null
this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler)
},
resize() {
const { chart } = this
chart && chart.resize()
}
}
}

View File

@ -48,14 +48,18 @@ export default {
}
</script>
<style scoped>
.drag-select >>> .sortable-ghost {
<style lang="scss" scoped>
.drag-select {
::v-deep {
.sortable-ghost {
opacity: .8;
color: #fff!important;
background: #42b983!important;
}
color: #fff !important;
background: #42b983 !important;
}
.drag-select >>> .el-tag {
.el-tag {
cursor: pointer;
}
}
}
</style>

View File

@ -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;

View File

@ -248,8 +248,8 @@ export default {
//
isSupported,
//
isSupportTouch: Object.prototype.hasOwnProperty.call(document, 'ontouchstart'),
// eslint-disable-next-line no-prototype-builtins
isSupportTouch: document.hasOwnProperty('ontouchstart'),
//
step: 1, // 1 2 3
//

View File

@ -54,19 +54,24 @@ export default {
}
</script>
<style scoped>
.json-editor{
<style lang="scss" scoped>
.json-editor {
height: 100%;
position: relative;
}
.json-editor >>> .CodeMirror {
::v-deep {
.CodeMirror {
height: auto;
min-height: 300px;
}
.json-editor >>> .CodeMirror-scroll{
}
.CodeMirror-scroll {
min-height: 300px;
}
.json-editor >>> .cm-s-rubyblue span.cm-string {
}
.cm-s-rubyblue span.cm-string {
color: #F08047;
}
}
}
</style>

View File

@ -12,7 +12,7 @@ import Editor from 'tui-editor'
import defaultOptions from './default-options'
export default {
name: 'MarddownEditor',
name: 'MarkdownEditor',
props: {
value: {
type: String,

View File

@ -22,7 +22,7 @@ export default {
},
methods: {
click() {
if (!screenfull.isEnabled) {
if (!screenfull.enabled) {
this.$message({
message: 'you browser can not work',
type: 'warning'
@ -35,12 +35,12 @@ export default {
this.isFullscreen = screenfull.isFullscreen
},
init() {
if (screenfull.isEnabled) {
if (screenfull.enabled) {
screenfull.on('change', this.change)
}
},
destroy() {
if (screenfull.isEnabled) {
if (screenfull.enabled) {
screenfull.off('change', this.change)
}
}

View File

@ -44,6 +44,7 @@ $t: .1s;
width: 250px;
position: relative;
z-index: 1;
height: auto!important;
&-title {
width: 100%;
display: block;
@ -65,10 +66,12 @@ $t: .1s;
position: absolute;
width: 100%;
background: #e0e0e0;
color: #000;
line-height: 60px;
height: 60px;
cursor: pointer;
font-size: 20px;
font-size: 18px;
overflow: hidden;
opacity: 1;
transition: transform 0.28s ease;
&:hover {

View File

@ -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%;
}
}

View File

@ -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(() => {
@ -200,37 +204,43 @@ export default {
window.tinymce.get(this.tinymceId).getContent()
},
imageSuccessCBK(arr) {
const _this = this
arr.forEach(v => {
window.tinymce.get(_this.tinymceId).insertContent(`<img class="wscnph" src="${v.url}" >`)
})
arr.forEach(v => window.tinymce.get(this.tinymceId).insertContent(`<img class="wscnph" src="${v.url}" >`))
}
}
}
</script>
<style scoped>
<style lang="scss" scoped>
.tinymce-container {
position: relative;
line-height: normal;
}
.tinymce-container>>>.mce-fullscreen {
.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;
}

View File

@ -1,11 +1,11 @@
import store from '@/store'
export default {
inserted(el, binding, vnode) {
function checkPermission(el, binding) {
const { value } = binding
const roles = store.getters && store.getters.roles
if (value && value instanceof Array && value.length > 0) {
if (value && value instanceof Array) {
if (value.length > 0) {
const permissionRoles = value
const hasPermission = roles.some(role => {
@ -15,8 +15,17 @@ export default {
if (!hasPermission) {
el.parentNode && el.parentNode.removeChild(el)
}
}
} else {
throw new Error(`need roles! Like v-permission="['admin','editor']"`)
}
}
export default {
inserted(el, binding) {
checkPermission(el, binding)
},
update(el, binding) {
checkPermission(el, binding)
}
}

View File

@ -36,8 +36,8 @@
<a target="_blank" href="https://panjiachen.github.io/vue-element-admin-site/#/">
<el-dropdown-item>Docs</el-dropdown-item>
</a>
<el-dropdown-item divided>
<span style="display:block;" @click="logout">Log Out</span>
<el-dropdown-item divided @click.native="logout">
<span style="display:block;">Log Out</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>

View File

@ -17,8 +17,12 @@ export default {
const vnodes = []
if (icon) {
if (icon.includes('el-icon')) {
vnodes.push(<i class={[icon, 'sub-el-icon']} />)
} else {
vnodes.push(<svg-icon icon-class={icon}/>)
}
}
if (title) {
vnodes.push(<span slot='title'>{(title)}</span>)
@ -27,3 +31,11 @@ export default {
}
}
</script>
<style scoped>
.sub-el-icon {
color: currentColor;
width: 1em;
height: 1em;
}
</style>

View File

@ -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
}
}
}

View File

@ -1,5 +1,5 @@
<template>
<div v-if="!item.hidden" class="menu-wrapper">
<div v-if="!item.hidden">
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">

View File

@ -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;
}

View File

@ -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"
@ -9,16 +9,16 @@
:to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
tag="span"
class="tags-view-item"
@click.middle.native="closeSelectedTag(tag)"
@click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''"
@contextmenu.prevent.native="openMenu(tag,$event)"
>
{{ tag.title }}
<span v-if="!tag.meta.affix" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
<span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
</router-link>
</scroll-pane>
<ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
<li @click="refreshSelectedTag(selectedTag)">Refresh</li>
<li v-if="!(selectedTag.meta&&selectedTag.meta.affix)" @click="closeSelectedTag(selectedTag)">Close</li>
<li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">Close</li>
<li @click="closeOthersTags">Close Others</li>
<li @click="closeAllTags(selectedTag)">Close All</li>
</ul>
@ -69,6 +69,9 @@ export default {
isActive(route) {
return route.path === this.$route.path
},
isAffix(tag) {
return tag.meta && tag.meta.affix
},
filterAffixTags(routes, basePath = '/') {
let tags = []
routes.forEach(route => {
@ -186,6 +189,9 @@ export default {
},
closeMenu() {
this.visible = false
},
handleScroll() {
this.closeMenu()
}
}
}

View File

@ -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
@ -25,15 +26,16 @@ import * as filters from './filters' // global filters
* you can execute: mockXHR()
*
* Currently MockJs will be used in the production environment,
* please remove it before going online! ! !
* please remove it before going online ! ! !
*/
import { mockXHR } from '../mock'
if (process.env.NODE_ENV === 'production') {
const { mockXHR } = require('../mock')
mockXHR()
}
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

View File

@ -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

View File

@ -25,7 +25,7 @@ import nestedRouter from './modules/nested'
* meta : {
roles: ['admin','editor'] control the page roles (you can set multiple roles)
title: 'title' the name show in sidebar and breadcrumb (recommend set)
icon: 'svg-name' the icon show in the sidebar
icon: 'svg-name'/'el-icon-x' the icon show in the sidebar
noCache: true if set true, the page will no be cached(default is false)
affix: true if set true, the tag will affix in the tags-view
breadcrumb: false if set false, the item will hidden in breadcrumb(default is true)
@ -45,7 +45,7 @@ export const constantRoutes = [
hidden: true,
children: [
{
path: '/redirect/:path*',
path: '/redirect/:path(.*)',
component: () => import('@/views/redirect/index')
}
]
@ -197,7 +197,7 @@ export const asyncRoutes = [
name: 'Example',
meta: {
title: 'Example',
icon: 'example'
icon: 'el-icon-s-help'
},
children: [
{

View File

@ -13,8 +13,8 @@ const state = {
const mutations = {
CHANGE_SETTING: (state, { key, value }) => {
// https://eslint.org/docs/rules/no-prototype-builtins
if (Object.prototype.hasOwnProperty.call(state, key)) {
// eslint-disable-next-line no-prototype-builtins
if (state.hasOwnProperty(key)) {
state[key] = value
}
}

View File

@ -103,9 +103,7 @@ const actions = {
},
// dynamically modify permissions
changeRoles({ commit, dispatch }, role) {
// eslint-disable-next-line
return new Promise(async resolve => {
async changeRoles({ commit, dispatch }, role) {
const token = role + '-token'
commit('SET_TOKEN', token)
@ -117,15 +115,11 @@ const actions = {
// generate accessible routes map based on roles
const accessRoutes = await dispatch('permission/generateRoutes', roles, { root: true })
// dynamically add accessible routes
router.addRoutes(accessRoutes)
// reset visited views and cached views
dispatch('tagsView/delAllViews', null, { root: true })
resolve()
})
}
}

View File

@ -31,7 +31,7 @@
.fixed-width {
.el-button--mini {
padding: 7px 10px;
width: 60px;
min-width: 60px;
}
}
@ -77,3 +77,8 @@
.el-range-editor.el-input__inner {
display: inline-flex !important;
}
// to fix el-date-picker css style
.el-range-separator {
box-sizing: content-box;
}

View File

@ -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";

View File

@ -57,6 +57,11 @@
margin-right: 16px;
}
.sub-el-icon {
margin-right: 12px;
margin-left: -2px;
}
.el-menu {
border: none;
height: 100%;
@ -105,6 +110,10 @@
.svg-icon {
margin-left: 20px;
}
.sub-el-icon {
margin-left: 19px;
}
}
}
@ -118,6 +127,10 @@
margin-left: 20px;
}
.sub-el-icon {
margin-left: 19px;
}
.el-submenu__icon-arrow {
display: none;
}
@ -178,6 +191,10 @@
.svg-icon {
margin-right: 16px;
}
.sub-el-icon {
margin-right: 12px;
margin-left: -2px;
}
}
.nest-menu .el-submenu>.el-submenu__title,

View File

@ -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))) {
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
}
@ -154,19 +162,21 @@ export function param(json) {
* @returns {Object}
*/
export function param2Obj(url) {
const search = url.split('?')[1]
const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ')
if (!search) {
return {}
}
return JSON.parse(
'{"' +
decodeURIComponent(search)
.replace(/"/g, '\\"')
.replace(/&/g, '","')
.replace(/=/g, '":"')
.replace(/\+/g, ' ') +
'"}'
)
const obj = {}
const searchArr = search.split('&')
searchArr.forEach(v => {
const index = v.indexOf('=')
if (index !== -1) {
const name = v.substring(0, index)
const val = v.substring(index + 1, v.length)
obj[name] = val
}
})
return obj
}
/**

View File

@ -13,11 +13,7 @@ export default function checkPermission(value) {
const hasPermission = roles.some(role => {
return permissionRoles.includes(role)
})
if (!hasPermission) {
return false
}
return true
return hasPermission
} else {
console.error(`need roles! Like v-permission="['admin','editor']"`)
return false

View File

@ -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" />

View File

@ -15,7 +15,7 @@
<el-progress :percentage="18" />
</div>
<div class="progress-item">
<span>Css</span>
<span>CSS</span>
<el-progress :percentage="12" />
</div>
<div class="progress-item">
@ -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;
}
}

View File

@ -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 }

View File

@ -1,21 +1,11 @@
<template>
<div class="app-container documentation-container">
<a
class="document-btn"
target="_blank"
href="https://panjiachen.github.io/vue-element-admin-site/"
>Documentation</a>
<a
class="document-btn"
target="_blank"
href="https://github.com/PanJiaChen/vue-element-admin/"
>Github Repository</a>
<a
class="document-btn"
target="_blank"
href="https://panjiachen.gitee.io/vue-element-admin-site/zh/"
>国内文档</a>
<dropdown-menu :items="articleList" style="float:left;margin-left:50px;" title="系列文章" />
<a class="document-btn" target="_blank" href="https://store.akveo.com/products/vue-java-admin-dashboard-spring?utm_campaign=akveo_store-Vue-Vue_demo%2Fgithub&utm_source=vue_admin&utm_medium=referral&utm_content=demo_English_button">Java backend integration</a>
<a class="document-btn" target="_blank" href="https://panjiachen.github.io/vue-element-admin-site/">Documentation</a>
<a class="document-btn" target="_blank" href="https://github.com/PanJiaChen/vue-element-admin/">Github Repository</a>
<a class="document-btn" target="_blank" href="https://panjiachen.gitee.io/vue-element-admin-site/zh/">国内文档</a>
<dropdown-menu class="document-btn" :items="articleList" title="系列文章" />
<a class="document-btn" target="_blank" href="https://panjiachen.github.io/vue-element-admin-site/zh/job/">内推招聘</a>
</div>
</template>
@ -46,15 +36,19 @@ export default {
<style lang="scss" scoped>
.documentation-container {
margin: 50px;
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
.document-btn {
float: left;
margin-left: 50px;
flex-shrink: 0;
display: block;
cursor: pointer;
background: black;
color: white;
height: 60px;
width: 200px;
padding: 0 16px;
margin: 16px;
line-height: 60px;
font-size: 20px;
text-align: center;

View File

@ -277,7 +277,7 @@ export default {
}
}
.article-textarea /deep/ {
.article-textarea ::v-deep {
textarea {
padding-right: 40px;
resize: none;

View File

@ -13,7 +13,7 @@
</a>
</div>
<el-table v-loading="listLoading" :data="list" element-loading-text="拼命加载中" border fit highlight-current-row>
<el-table v-loading="listLoading" :data="list" element-loading-text="Loading..." border fit highlight-current-row>
<el-table-column align="center" label="Id" width="95">
<template slot-scope="scope">
{{ scope.$index }}

View File

@ -1,74 +1,3 @@
const elementIcons = [
'info',
'error',
'success',
'warning',
'question',
'back',
'arrow-left',
'arrow-down',
'arrow-right',
'arrow-up',
'caret-left',
'caret-bottom',
'caret-top',
'caret-right',
'd-arrow-left',
'd-arrow-right',
'minus',
'plus',
'remove',
'circle-plus',
'remove-outline',
'circle-plus-outline',
'close',
'check',
'circle-close',
'circle-check',
'circle-close-outline',
'circle-check-outline',
'zoom-out',
'zoom-in',
'd-caret',
'sort',
'sort-down',
'sort-up',
'tickets',
'document',
'goods',
'sold-out',
'news',
'message',
'date',
'printer',
'time',
'bell',
'mobile-phone',
'service',
'view',
'menu',
'more',
'more-outline',
'star-on',
'star-off',
'location',
'location-outline',
'phone',
'phone-outline',
'picture',
'picture-outline',
'delete',
'search',
'edit',
'edit-outline',
'rank',
'refresh',
'share',
'setting',
'upload',
'upload2',
'download',
'loading'
]
const elementIcons = ['platform-eleme', 'eleme', 'delete-solid', 'delete', 's-tools', 'setting', 'user-solid', 'user', 'phone', 'phone-outline', 'more', 'more-outline', 'star-on', 'star-off', 's-goods', 'goods', 'warning', 'warning-outline', 'question', 'info', 'remove', 'circle-plus', 'success', 'error', 'zoom-in', 'zoom-out', 'remove-outline', 'circle-plus-outline', 'circle-check', 'circle-close', 's-help', 'help', 'minus', 'plus', 'check', 'close', 'picture', 'picture-outline', 'picture-outline-round', 'upload', 'upload2', 'download', 'camera-solid', 'camera', 'video-camera-solid', 'video-camera', 'message-solid', 'bell', 's-cooperation', 's-order', 's-platform', 's-fold', 's-unfold', 's-operation', 's-promotion', 's-home', 's-release', 's-ticket', 's-management', 's-open', 's-shop', 's-marketing', 's-flag', 's-comment', 's-finance', 's-claim', 's-custom', 's-opportunity', 's-data', 's-check', 's-grid', 'menu', 'share', 'd-caret', 'caret-left', 'caret-right', 'caret-bottom', 'caret-top', 'bottom-left', 'bottom-right', 'back', 'right', 'bottom', 'top', 'top-left', 'top-right', 'arrow-left', 'arrow-right', 'arrow-down', 'arrow-up', 'd-arrow-left', 'd-arrow-right', 'video-pause', 'video-play', 'refresh', 'refresh-right', 'refresh-left', 'finished', 'sort', 'sort-up', 'sort-down', 'rank', 'loading', 'view', 'c-scale-to-original', 'date', 'edit', 'edit-outline', 'folder', 'folder-opened', 'folder-add', 'folder-remove', 'folder-delete', 'folder-checked', 'tickets', 'document-remove', 'document-delete', 'document-copy', 'document-checked', 'document', 'document-add', 'printer', 'paperclip', 'takeaway-box', 'search', 'monitor', 'attract', 'mobile', 'scissors', 'umbrella', 'headset', 'brush', 'mouse', 'coordinate', 'magic-stick', 'reading', 'data-line', 'data-board', 'pie-chart', 'data-analysis', 'collection-tag', 'film', 'suitcase', 'suitcase-1', 'receiving', 'collection', 'files', 'notebook-1', 'notebook-2', 'toilet-paper', 'office-building', 'school', 'table-lamp', 'house', 'no-smoking', 'smoking', 'shopping-cart-full', 'shopping-cart-1', 'shopping-cart-2', 'shopping-bag-1', 'shopping-bag-2', 'sold-out', 'sell', 'present', 'box', 'bank-card', 'money', 'coin', 'wallet', 'discount', 'price-tag', 'news', 'guide', 'male', 'female', 'thumb', 'cpu', 'link', 'connection', 'open', 'turn-off', 'set-up', 'chat-round', 'chat-line-round', 'chat-square', 'chat-dot-round', 'chat-dot-square', 'chat-line-square', 'message', 'postcard', 'position', 'turn-off-microphone', 'microphone', 'close-notification', 'bangzhu', 'time', 'odometer', 'crop', 'aim', 'switch-button', 'full-screen', 'copy-document', 'mic', 'stopwatch', 'medal-1', 'medal', 'trophy', 'trophy-1', 'first-aid-kit', 'discover', 'place', 'location', 'location-outline', 'location-information', 'add-location', 'delete-location', 'map-location', 'alarm-clock', 'timer', 'watch-1', 'watch', 'lock', 'unlock', 'key', 'service', 'mobile-phone', 'bicycle', 'truck', 'ship', 'basketball', 'football', 'soccer', 'baseball', 'wind-power', 'light-rain', 'lightning', 'heavy-rain', 'sunrise', 'sunrise-1', 'sunset', 'sunny', 'cloudy', 'partly-cloudy', 'cloudy-and-sunny', 'moon', 'moon-night', 'dish', 'dish-1', 'food', 'chicken', 'fork-spoon', 'knife-fork', 'burger', 'tableware', 'sugar', 'dessert', 'ice-cream', 'hot-water', 'water-cup', 'coffee-cup', 'cold-drink', 'goblet', 'goblet-full', 'goblet-square', 'goblet-square-full', 'refrigerator', 'grape', 'watermelon', 'cherry', 'apple', 'pear', 'orange', 'coffee', 'ice-tea', 'ice-drink', 'milk-tea', 'potato-strips', 'lollipop', 'ice-cream-square', 'ice-cream-round']
export default elementIcons

View File

@ -6,6 +6,7 @@
</aside>
<el-tabs type="border-card">
<el-tab-pane label="Icons">
<div class="grid">
<div v-for="item of svgIcons" :key="item" @click="handleClipboard(generateIconCode(item),$event)">
<el-tooltip placement="top">
<div slot="content">
@ -17,8 +18,10 @@
</div>
</el-tooltip>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="Element-UI Icons">
<div class="grid">
<div v-for="item of elementIcons" :key="item" @click="handleClipboard(generateElementIconCode(item),$event)">
<el-tooltip placement="top">
<div slot="content">
@ -30,6 +33,7 @@
</div>
</el-tooltip>
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
@ -67,6 +71,12 @@ export default {
margin: 10px 20px 0;
overflow: hidden;
.grid {
position: relative;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.icon-item {
margin: 20px;
height: 85px;

View File

@ -138,17 +138,9 @@ export default {
// window.removeEventListener('storage', this.afterQRScan)
},
methods: {
checkCapslock({ shiftKey, key } = {}) {
if (key && key.length === 1) {
if (shiftKey && (key >= 'a' && key <= 'z') || !shiftKey && (key >= 'A' && key <= 'Z')) {
this.capsTooltip = true
} else {
this.capsTooltip = false
}
}
if (key === 'CapsLock' && this.capsTooltip === true) {
this.capsTooltip = false
}
checkCapslock(e) {
const { key } = e
this.capsTooltip = key && key.length === 1 && (key >= 'A' && key <= 'Z')
},
showPwd() {
if (this.passwordType === 'password') {

View File

@ -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;
}
}

View File

@ -65,7 +65,7 @@ export default {
name: '',
email: '',
avatar: '',
roles: ''
role: ''
}
}
}
@ -74,16 +74,16 @@ export default {
</script>
<style lang="scss" scoped>
.box-center {
.box-center {
margin: 0 auto;
display: table;
}
}
.text-muted {
.text-muted {
color: #777;
}
}
.user-profile {
.user-profile {
.user-name {
font-weight: bold;
}
@ -109,9 +109,9 @@ export default {
.user-follow {
padding-top: 20px;
}
}
}
.user-bio {
.user-bio {
margin-top: 20px;
color: #606266;
@ -130,5 +130,5 @@ export default {
font-weight: bold;
}
}
}
}
</style>

View File

@ -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: [

View File

@ -36,13 +36,13 @@
@sort-change="sortChange"
>
<el-table-column label="ID" prop="id" sortable="custom" align="center" width="80" :class-name="getSortClass('id')">
<template slot-scope="scope">
<span>{{ scope.row.id }}</span>
<template slot-scope="{row}">
<span>{{ row.id }}</span>
</template>
</el-table-column>
<el-table-column label="Date" width="150px" align="center">
<template slot-scope="scope">
<span>{{ scope.row.timestamp | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
<template slot-scope="{row}">
<span>{{ row.timestamp | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="Title" min-width="150px">
@ -52,18 +52,18 @@
</template>
</el-table-column>
<el-table-column label="Author" width="110px" align="center">
<template slot-scope="scope">
<span>{{ scope.row.author }}</span>
<template slot-scope="{row}">
<span>{{ row.author }}</span>
</template>
</el-table-column>
<el-table-column v-if="showReviewer" label="Reviewer" width="110px" align="center">
<template slot-scope="scope">
<span style="color:red;">{{ scope.row.reviewer }}</span>
<template slot-scope="{row}">
<span style="color:red;">{{ row.reviewer }}</span>
</template>
</el-table-column>
<el-table-column label="Imp" width="80px">
<template slot-scope="scope">
<svg-icon v-for="n in +scope.row.importance" :key="n" icon-class="star" class="meta-item__icon" />
<template slot-scope="{row}">
<svg-icon v-for="n in + row.importance" :key="n" icon-class="star" class="meta-item__icon" />
</template>
</el-table-column>
<el-table-column label="Readings" align="center" width="95">
@ -80,7 +80,7 @@
</template>
</el-table-column>
<el-table-column label="Actions" align="center" width="230" class-name="small-padding fixed-width">
<template slot-scope="{row}">
<template slot-scope="{row,$index}">
<el-button type="primary" size="mini" @click="handleUpdate(row)">
Edit
</el-button>
@ -90,7 +90,7 @@
<el-button v-if="row.status!='draft'" size="mini" @click="handleModifyStatus(row,'draft')">
Draft
</el-button>
<el-button v-if="row.status!='deleted'" size="mini" type="danger" @click="handleModifyStatus(row,'deleted')">
<el-button v-if="row.status!='deleted'" size="mini" type="danger" @click="handleDelete(row,$index)">
Delete
</el-button>
</template>
@ -319,13 +319,8 @@ export default {
const tempData = Object.assign({}, this.temp)
tempData.timestamp = +new Date(tempData.timestamp) // change Thu Nov 30 2017 16:41:05 GMT+0800 (CST) to 1512031311464
updateArticle(tempData).then(() => {
for (const v of this.list) {
if (v.id === this.temp.id) {
const index = this.list.indexOf(v)
const index = this.list.findIndex(v => v.id === this.temp.id)
this.list.splice(index, 1, this.temp)
break
}
}
this.dialogFormVisible = false
this.$notify({
title: 'Success',
@ -337,14 +332,13 @@ export default {
}
})
},
handleDelete(row) {
handleDelete(row, index) {
this.$notify({
title: 'Success',
message: 'Delete Successfully',
type: 'success',
duration: 2000
})
const index = this.list.indexOf(row)
this.list.splice(index, 1)
},
handleFetchPv(pv) {
@ -358,7 +352,7 @@ export default {
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['timestamp', 'title', 'type', 'importance', 'status']
const filterVal = ['timestamp', 'title', 'type', 'importance', 'status']
const data = this.formatJson(filterVal, this.list)
const data = this.formatJson(filterVal)
excel.export_json_to_excel({
header: tHeader,
data,
@ -367,8 +361,8 @@ export default {
this.downloadLoading = false
})
},
formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => {
formatJson(filterVal) {
return this.list.map(v => filterVal.map(j => {
if (j === 'timestamp') {
return parseTime(v[j])
} else {
@ -378,11 +372,7 @@ export default {
},
getSortClass: function(key) {
const sort = this.listQuery.sort
return sort === `+${key}`
? 'ascending'
: sort === `-${key}`
? 'descending'
: ''
return sort === `+${key}` ? 'ascending' : 'descending'
}
}
}

View File

@ -3,38 +3,38 @@
<!-- Note that row-key is necessary to get a correct row order. -->
<el-table ref="dragTable" v-loading="listLoading" :data="list" row-key="id" border fit highlight-current-row style="width: 100%">
<el-table-column align="center" label="ID" width="65">
<template slot-scope="scope">
<span>{{ scope.row.id }}</span>
<template slot-scope="{row}">
<span>{{ row.id }}</span>
</template>
</el-table-column>
<el-table-column width="180px" align="center" label="Date">
<template slot-scope="scope">
<span>{{ scope.row.timestamp | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
<template slot-scope="{row}">
<span>{{ row.timestamp | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column min-width="300px" label="Title">
<template slot-scope="scope">
<span>{{ scope.row.title }}</span>
<template slot-scope="{row}">
<span>{{ row.title }}</span>
</template>
</el-table-column>
<el-table-column width="110px" align="center" label="Author">
<template slot-scope="scope">
<span>{{ scope.row.author }}</span>
<template slot-scope="{row}">
<span>{{ row.author }}</span>
</template>
</el-table-column>
<el-table-column width="100px" label="Importance">
<template slot-scope="scope">
<svg-icon v-for="n in +scope.row.importance" :key="n" icon-class="star" class="icon-star" />
<template slot-scope="{row}">
<svg-icon v-for="n in + row.importance" :key="n" icon-class="star" class="icon-star" />
</template>
</el-table-column>
<el-table-column align="center" label="Readings" width="95">
<template slot-scope="scope">
<span>{{ scope.row.pageviews }}</span>
<template slot-scope="{row}">
<span>{{ row.pageviews }}</span>
</template>
</el-table-column>

View File

@ -2,26 +2,26 @@
<div class="app-container">
<el-table v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%">
<el-table-column align="center" label="ID" width="80">
<template slot-scope="scope">
<span>{{ scope.row.id }}</span>
<template slot-scope="{row}">
<span>{{ row.id }}</span>
</template>
</el-table-column>
<el-table-column width="180px" align="center" label="Date">
<template slot-scope="scope">
<span>{{ scope.row.timestamp | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
<template slot-scope="{row}">
<span>{{ row.timestamp | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column width="120px" align="center" label="Author">
<template slot-scope="scope">
<span>{{ scope.row.author }}</span>
<template slot-scope="{row}">
<span>{{ row.author }}</span>
</template>
</el-table-column>
<el-table-column width="100px" label="Importance">
<template slot-scope="scope">
<svg-icon v-for="n in +scope.row.importance" :key="n" icon-class="star" class="meta-item__icon" />
<template slot-scope="{row}">
<svg-icon v-for="n in + row.importance" :key="n" icon-class="star" class="meta-item__icon" />
</template>
</el-table-column>

View File

@ -0,0 +1,14 @@
import { param2Obj } from '@/utils/index.js'
describe('Utils:param2Obj', () => {
const url = 'https://github.com/PanJiaChen/vue-element-admin?name=bill&age=29&sex=1&field=dGVzdA==&key=%E6%B5%8B%E8%AF%95'
it('param2Obj test', () => {
expect(param2Obj(url)).toEqual({
name: 'bill',
age: '29',
sex: '1',
field: window.btoa('test'),
key: '测试'
})
})
})

View File

@ -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()
})
})

View File

@ -36,18 +36,7 @@ module.exports = {
warnings: false,
errors: true
},
proxy: {
// change xxx-api/login => mock/login
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://127.0.0.1:${port}/mock`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
}
}
},
after: require('./mock/mock-server.js')
before: require('./mock/mock-server.js')
},
configureWebpack: {
// provide the app's title in webpack's name field, so that
@ -60,8 +49,20 @@ 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
// it can improve the speed of the first screen, it is recommended to turn on preload
config.plugin('preload').tap(() => [
{
rel: 'preload',
// to ignore runtime.js
// https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171
fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/],
include: 'initial'
}
])
// when there are many pages, it will cause too many meaningless requests
config.plugins.delete('prefetch')
// set svg-sprite-loader
config.module
@ -80,23 +81,6 @@ module.exports = {
})
.end()
// set preserveWhitespace
config.module
.rule('vue')
.use('vue-loader')
.loader('vue-loader')
.tap(options => {
options.compilerOptions.preserveWhitespace = true
return options
})
.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 => {
@ -132,6 +116,7 @@ module.exports = {
}
}
})
// https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk
config.optimization.runtimeChunk('single')
}
)