+
+
Drop excel file here or
Browse
@@ -26,7 +26,7 @@ export default {
}
},
methods: {
- generateDate({ header, results }) {
+ generateData({ header, results }) {
this.excelData.header = header
this.excelData.results = results
this.onSuccess && this.onSuccess(this.excelData)
@@ -56,7 +56,7 @@ export default {
e.dataTransfer.dropEffect = 'copy'
},
handleUpload() {
- document.getElementById('excel-upload-input').click()
+ this.$refs['excel-upload-input'].click()
},
handleClick(e) {
const files = e.target.files
@@ -82,20 +82,20 @@ export default {
const reader = new FileReader()
reader.onload = e => {
const data = e.target.result
- const fixedData = this.fixdata(data)
+ const fixedData = this.fixData(data)
const workbook = XLSX.read(btoa(fixedData), { type: 'base64' })
const firstSheetName = workbook.SheetNames[0]
const worksheet = workbook.Sheets[firstSheetName]
- const header = this.get_header_row(worksheet)
+ const header = this.getHeaderRow(worksheet)
const results = XLSX.utils.sheet_to_json(worksheet)
- this.generateDate({ header, results })
+ this.generateData({ header, results })
this.loading = false
resolve()
}
reader.readAsArrayBuffer(rawFile)
})
},
- fixdata(data) {
+ fixData(data) {
let o = ''
let l = 0
const w = 10240
@@ -103,14 +103,16 @@ export default {
o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)))
return o
},
- get_header_row(sheet) {
+ getHeaderRow(sheet) {
const headers = []
const range = XLSX.utils.decode_range(sheet['!ref'])
let C
- const R = range.s.r /* start in the first row */
+ const R = range.s.r
+ /* start in the first row */
for (C = range.s.c; C <= range.e.c; ++C) { /* walk every column in the range */
- var cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })] /* find the cell in the first row */
- var hdr = 'UNKNOWN ' + C // <-- replace with your desired default
+ const cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })]
+ /* find the cell in the first row */
+ let hdr = 'UNKNOWN ' + C // <-- replace with your desired default
if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
headers.push(hdr)
}
@@ -124,11 +126,11 @@ export default {
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/bug.svg b/src/icons/svg/bug.svg
index a12a9394..05a150dc 100644
--- a/src/icons/svg/bug.svg
+++ b/src/icons/svg/bug.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/chart.svg b/src/icons/svg/chart.svg
index b1b31336..27728fb0 100644
--- a/src/icons/svg/chart.svg
+++ b/src/icons/svg/chart.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/clipboard.svg b/src/icons/svg/clipboard.svg
index cf1c9b0c..90923ff6 100644
--- a/src/icons/svg/clipboard.svg
+++ b/src/icons/svg/clipboard.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/component.svg b/src/icons/svg/component.svg
index a8008c84..207ada34 100644
--- a/src/icons/svg/component.svg
+++ b/src/icons/svg/component.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/dashboard.svg b/src/icons/svg/dashboard.svg
index bee42507..5317d370 100644
--- a/src/icons/svg/dashboard.svg
+++ b/src/icons/svg/dashboard.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/documentation.svg b/src/icons/svg/documentation.svg
index 405c2ad7..70431228 100644
--- a/src/icons/svg/documentation.svg
+++ b/src/icons/svg/documentation.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/drag.svg b/src/icons/svg/drag.svg
index 819c8d50..4185d3ce 100644
--- a/src/icons/svg/drag.svg
+++ b/src/icons/svg/drag.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/edit.svg b/src/icons/svg/edit.svg
index 5c77d97a..0306a867 100644
--- a/src/icons/svg/edit.svg
+++ b/src/icons/svg/edit.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/email.svg b/src/icons/svg/email.svg
index 8a87e147..055e5013 100644
--- a/src/icons/svg/email.svg
+++ b/src/icons/svg/email.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/example.svg b/src/icons/svg/example.svg
index 681422ea..46f42b53 100644
--- a/src/icons/svg/example.svg
+++ b/src/icons/svg/example.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/excel.svg b/src/icons/svg/excel.svg
index e5dd5cec..59d54b2c 100644
--- a/src/icons/svg/excel.svg
+++ b/src/icons/svg/excel.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/eye.svg b/src/icons/svg/eye.svg
index 194aa45c..16ed2d87 100644
--- a/src/icons/svg/eye.svg
+++ b/src/icons/svg/eye.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/form.svg b/src/icons/svg/form.svg
index 79716f06..dcbaa185 100644
--- a/src/icons/svg/form.svg
+++ b/src/icons/svg/form.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/guide 2.svg b/src/icons/svg/guide 2.svg
new file mode 100644
index 00000000..d053bd73
--- /dev/null
+++ b/src/icons/svg/guide 2.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/guide.svg b/src/icons/svg/guide.svg
index 9bae3394..b2710017 100644
--- a/src/icons/svg/guide.svg
+++ b/src/icons/svg/guide.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/src/icons/svg/icon.svg b/src/icons/svg/icon.svg
index 906af96a..82be8eee 100644
--- a/src/icons/svg/icon.svg
+++ b/src/icons/svg/icon.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/international.svg b/src/icons/svg/international.svg
index 6912767d..e9b56eee 100644
--- a/src/icons/svg/international.svg
+++ b/src/icons/svg/international.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/language.svg b/src/icons/svg/language.svg
index 2baf7431..96d00288 100644
--- a/src/icons/svg/language.svg
+++ b/src/icons/svg/language.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/src/icons/svg/link.svg b/src/icons/svg/link.svg
index 11037e6f..07090147 100644
--- a/src/icons/svg/link.svg
+++ b/src/icons/svg/link.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/list.svg b/src/icons/svg/list.svg
index c45f4591..20259edd 100644
--- a/src/icons/svg/list.svg
+++ b/src/icons/svg/list.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/lock.svg b/src/icons/svg/lock.svg
index 37c60701..74fee543 100644
--- a/src/icons/svg/lock.svg
+++ b/src/icons/svg/lock.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/message.svg b/src/icons/svg/message.svg
index d807b002..14ca8172 100644
--- a/src/icons/svg/message.svg
+++ b/src/icons/svg/message.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/money.svg b/src/icons/svg/money.svg
index d4fcb9ca..c1580de1 100644
--- a/src/icons/svg/money.svg
+++ b/src/icons/svg/money.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/nested.svg b/src/icons/svg/nested.svg
index f5641979..06713a86 100644
--- a/src/icons/svg/nested.svg
+++ b/src/icons/svg/nested.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/password.svg b/src/icons/svg/password.svg
index 920b500b..e291d85d 100644
--- a/src/icons/svg/password.svg
+++ b/src/icons/svg/password.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/people.svg b/src/icons/svg/people.svg
index 3985ab51..2bd54aeb 100644
--- a/src/icons/svg/people.svg
+++ b/src/icons/svg/people.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/peoples.svg b/src/icons/svg/peoples.svg
index 2dccfcc0..2c911615 100644
--- a/src/icons/svg/peoples.svg
+++ b/src/icons/svg/peoples.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/qq.svg b/src/icons/svg/qq.svg
index 97aee717..ee13d4ec 100644
--- a/src/icons/svg/qq.svg
+++ b/src/icons/svg/qq.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/shopping.svg b/src/icons/svg/shopping.svg
new file mode 100644
index 00000000..87513e7c
--- /dev/null
+++ b/src/icons/svg/shopping.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/shoppingCard.svg b/src/icons/svg/shoppingCard.svg
deleted file mode 100644
index cdebbdb4..00000000
--- a/src/icons/svg/shoppingCard.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/icons/svg/size.svg b/src/icons/svg/size.svg
new file mode 100644
index 00000000..ddb25b8d
--- /dev/null
+++ b/src/icons/svg/size.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/star.svg b/src/icons/svg/star.svg
index 685a301d..6cf86e66 100644
--- a/src/icons/svg/star.svg
+++ b/src/icons/svg/star.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/tab.svg b/src/icons/svg/tab.svg
index 17aa088b..b4b48e48 100644
--- a/src/icons/svg/tab.svg
+++ b/src/icons/svg/tab.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/table.svg b/src/icons/svg/table.svg
index 083bc8cc..dbfe5d64 100644
--- a/src/icons/svg/table.svg
+++ b/src/icons/svg/table.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/theme.svg b/src/icons/svg/theme.svg
index d5c2e5ad..5982a2f7 100644
--- a/src/icons/svg/theme.svg
+++ b/src/icons/svg/theme.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/src/icons/svg/tree.svg b/src/icons/svg/tree.svg
new file mode 100644
index 00000000..dd4b7dd2
--- /dev/null
+++ b/src/icons/svg/tree.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/user.svg b/src/icons/svg/user.svg
index 5971deeb..0ba0716a 100644
--- a/src/icons/svg/user.svg
+++ b/src/icons/svg/user.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/wechat.svg b/src/icons/svg/wechat.svg
index d88a64bc..9e18b717 100644
--- a/src/icons/svg/wechat.svg
+++ b/src/icons/svg/wechat.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/icons/svg/zip.svg b/src/icons/svg/zip.svg
index e9a9d012..f806fc48 100644
--- a/src/icons/svg/zip.svg
+++ b/src/icons/svg/zip.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/src/icons/svgo.yml b/src/icons/svgo.yml
new file mode 100644
index 00000000..d11906ae
--- /dev/null
+++ b/src/icons/svgo.yml
@@ -0,0 +1,22 @@
+# replace default config
+
+# multipass: true
+# full: true
+
+plugins:
+
+ # - name
+ #
+ # or:
+ # - name: false
+ # - name: true
+ #
+ # or:
+ # - name:
+ # param1: 1
+ # param2: 2
+
+- removeAttrs:
+ attrs:
+ - 'fill'
+ - 'fill-rule'
diff --git a/src/lang/en.js b/src/lang/en.js
index 1d712bbe..930f0ad1 100644
--- a/src/lang/en.js
+++ b/src/lang/en.js
@@ -68,8 +68,9 @@ export default {
logOut: 'Log Out',
dashboard: 'Dashboard',
github: 'Github',
- screenfull: 'screenfull',
- theme: 'theme'
+ screenfull: 'Screenfull',
+ theme: 'Theme',
+ size: 'Global Size'
},
login: {
title: 'Login Form',
@@ -147,6 +148,7 @@ export default {
tips: 'Tips: It is different from the theme-pick on the navbar is two different skinning methods, each with different application scenarios. Refer to the documentation for details.'
},
tagsView: {
+ refresh: 'Refresh',
close: 'Close',
closeOthers: 'Close Others',
closeAll: 'Close All'
diff --git a/src/lang/es.js b/src/lang/es.js
new file mode 100755
index 00000000..19171904
--- /dev/null
+++ b/src/lang/es.js
@@ -0,0 +1,155 @@
+export default {
+ route: {
+ dashboard: 'Panel de control',
+ introduction: 'Introducción',
+ documentation: 'Documentación',
+ guide: 'Guía',
+ permission: 'Permisos',
+ pagePermission: 'Permisos de la página',
+ directivePermission: 'Permisos de la directiva',
+ icons: 'Iconos',
+ components: 'Componentes',
+ componentIndex: 'Introducción',
+ tinymce: 'Tinymce',
+ markdown: 'Markdown',
+ jsonEditor: 'Editor JSON',
+ dndList: 'Lista Dnd',
+ splitPane: 'Panel dividido',
+ avatarUpload: 'Subir avatar',
+ dropzone: 'Subir ficheros',
+ sticky: 'Sticky',
+ countTo: 'CountTo',
+ componentMixin: 'Mixin',
+ backToTop: 'Ir arriba',
+ dragDialog: 'Drag Dialog',
+ dragKanban: 'Drag Kanban',
+ charts: 'Gráficos',
+ keyboardChart: 'Keyboard Chart',
+ lineChart: 'Gráfico de líneas',
+ mixChart: 'Mix Chart',
+ example: 'Ejemplo',
+ nested: 'Rutas anidadass',
+ menu1: 'Menu 1',
+ 'menu1-1': 'Menu 1-1',
+ 'menu1-2': 'Menu 1-2',
+ 'menu1-2-1': 'Menu 1-2-1',
+ 'menu1-2-2': 'Menu 1-2-2',
+ 'menu1-3': 'Menu 1-3',
+ menu2: 'Menu 2',
+ Table: 'Tabla',
+ dynamicTable: 'Tabla dinámica',
+ dragTable: 'Arrastrar tabla',
+ inlineEditTable: 'Editor',
+ complexTable: 'Complex Table',
+ treeTable: 'Tree Table',
+ customTreeTable: 'Custom TreeTable',
+ tab: 'Pestaña',
+ form: 'Formulario',
+ createArticle: 'Crear artículo',
+ editArticle: 'Editar artículo',
+ articleList: 'Listado de artículos',
+ errorPages: 'Páginas de error',
+ page401: '401',
+ page404: '404',
+ errorLog: 'Registro de errores',
+ excel: 'Excel',
+ exportExcel: 'Exportar a Excel',
+ selectExcel: 'Export seleccionado',
+ uploadExcel: 'Subir Excel',
+ zip: 'Zip',
+ exportZip: 'Exportar a Zip',
+ theme: 'Tema',
+ clipboardDemo: 'Clipboard',
+ i18n: 'I18n',
+ externalLink: 'Enlace externo'
+ },
+ navbar: {
+ logOut: 'Salir',
+ dashboard: 'Panel de control',
+ github: 'Github',
+ screenfull: 'Pantalla completa',
+ theme: 'Tema',
+ size: 'Tamaño global'
+ },
+ login: {
+ title: 'Formulario de acceso',
+ logIn: 'Acceso',
+ username: 'Usuario',
+ password: 'Contraseña',
+ any: 'nada',
+ thirdparty: 'Conectar con',
+ thirdpartyTips: 'No se puede simular en local, así que combine su propia simulación de negocios. ! !'
+ },
+ documentation: {
+ documentation: 'Documentación',
+ github: 'Repositorio Github'
+ },
+ permission: {
+ roles: 'Tus permisos',
+ switchRoles: 'Cambiar permisos'
+ },
+ guide: {
+ description: 'The guide page is useful for some people who entered the project for the first time. You can briefly introduce the features of the project. Demo is based on ',
+ button: 'Ver guía'
+ },
+ components: {
+ documentation: 'Documentación',
+ tinymceTips: 'Rich text editor is a core part of management system, but at the same time is a place with lots of problems. In the process of selecting rich texts, I also walked a lot of detours. The common rich text editors in the market are basically used, and the finally chose Tinymce. See documentation for more detailed rich text editor comparisons and introductions.',
+ dropzoneTips: 'Because my business has special needs, and has to upload images to qiniu, so instead of a third party, I chose encapsulate it by myself. It is very simple, you can see the detail code in @/components/Dropzone.',
+ stickyTips: 'when the page is scrolled to the preset position will be sticky on the top.',
+ backToTopTips1: 'When the page is scrolled to the specified position, the Back to Top button appears in the lower right corner',
+ backToTopTips2: 'You can customize the style of the button, show / hide, height of appearance, height of the return. If you need a text prompt, you can use element-ui el-tooltip elements externally',
+ imageUploadTips: 'Since I was using only the vue@1 version, and it is not compatible with mockjs at the moment, I modified it myself, and if you are going to use it, it is better to use official version.'
+ },
+ table: {
+ dynamicTips1: 'Fixed header, sorted by header order',
+ dynamicTips2: 'Not fixed header, sorted by click order',
+ dragTips1: 'Orden por defecto',
+ dragTips2: 'The after dragging order',
+ title: 'Título',
+ importance: 'Importancia',
+ type: 'Tipo',
+ remark: 'Remark',
+ search: 'Buscar',
+ add: 'Añadir',
+ export: 'Exportar',
+ reviewer: 'reviewer',
+ id: 'ID',
+ date: 'Fecha',
+ author: 'Autor',
+ readings: 'Lector',
+ status: 'Estado',
+ actions: 'Acciones',
+ edit: 'Editar',
+ publish: 'Publicar',
+ draft: 'Draft',
+ delete: 'Eliminar',
+ cancel: 'Cancelar',
+ confirm: 'Confirmar'
+ },
+ errorLog: {
+ tips: 'Please click the bug icon in the upper right corner',
+ description: 'Now the management system are basically the form of the spa, it enhances the user experience, but it also increases the possibility of page problems, a small negligence may lead to the entire page deadlock. Fortunately Vue provides a way to catch handling exceptions, where you can handle errors or report exceptions.',
+ documentation: 'Documento de introducción'
+ },
+ excel: {
+ export: 'Exportar',
+ selectedExport: 'Exportar seleccionados',
+ placeholder: 'Por favor escribe un nombre de fichero'
+ },
+ zip: {
+ export: 'Exportar',
+ placeholder: 'Por favor escribe un nombre de fichero'
+ },
+ theme: {
+ change: 'Cambiar tema',
+ documentation: 'Documentación del tema',
+ tips: 'Tips: It is different from the theme-pick on the navbar is two different skinning methods, each with different application scenarios. Refer to the documentation for details.'
+ },
+ tagsView: {
+ refresh: 'Actualizar',
+ close: 'Cerrar',
+ closeOthers: 'Cerrar otros',
+ closeAll: 'Cerrar todos'
+ }
+}
diff --git a/src/lang/index.js b/src/lang/index.js
index a77b07ea..7c9c8af6 100644
--- a/src/lang/index.js
+++ b/src/lang/index.js
@@ -3,8 +3,10 @@ import VueI18n from 'vue-i18n'
import Cookies from 'js-cookie'
import elementEnLocale from 'element-ui/lib/locale/lang/en' // element-ui lang
import elementZhLocale from 'element-ui/lib/locale/lang/zh-CN'// element-ui lang
+import elementEsLocale from 'element-ui/lib/locale/lang/es'// element-ui lang
import enLocale from './en'
import zhLocale from './zh'
+import esLocale from './es'
Vue.use(VueI18n)
@@ -16,12 +18,16 @@ const messages = {
zh: {
...zhLocale,
...elementZhLocale
+ },
+ es: {
+ ...esLocale,
+ ...elementEsLocale
}
}
const i18n = new VueI18n({
// set locale
- // options: en or zh
+ // options: en | zh | es
locale: Cookies.get('language') || 'en',
// set locale messages
messages
diff --git a/src/lang/zh.js b/src/lang/zh.js
index 2b873419..46e96ccf 100644
--- a/src/lang/zh.js
+++ b/src/lang/zh.js
@@ -69,7 +69,8 @@ export default {
dashboard: '首页',
github: '项目地址',
screenfull: '全屏',
- theme: '换肤'
+ theme: '换肤',
+ size: '布局大小'
},
login: {
title: '系统登录',
@@ -147,6 +148,7 @@ export default {
tips: 'Tips: 它区别于 navbar 上的 theme-pick, 是两种不同的换肤方法,各自有不同的应用场景,具体请参考文档。'
},
tagsView: {
+ refresh: '刷新',
close: '关闭',
closeOthers: '关闭其它',
closeAll: '关闭所有'
diff --git a/src/main.js b/src/main.js
index 1dc4af9e..1ce709c9 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,5 +1,7 @@
import Vue from 'vue'
+import Cookies from 'js-cookie'
+
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import Element from 'element-ui'
@@ -20,7 +22,7 @@ import './mock' // simulation data
import * as filters from './filters' // global filters
Vue.use(Element, {
- size: 'medium', // set element-ui default size
+ size: Cookies.get('size') || 'medium', // set element-ui default size
i18n: (key, value) => i18n.t(key, value)
})
diff --git a/src/mock/index.js b/src/mock/index.js
index e6644ae1..3e00e918 100644
--- a/src/mock/index.js
+++ b/src/mock/index.js
@@ -4,6 +4,16 @@ import articleAPI from './article'
import remoteSearchAPI from './remoteSearch'
import transactionAPI from './transaction'
+// 修复在使用 MockJS 情况下,设置 withCredentials = true,且未被拦截的跨域请求丢失 Cookies 的问题
+// https://github.com/nuysoft/Mock/issues/300
+Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send
+Mock.XHR.prototype.send = function() {
+ if (this.custom.xhr) {
+ this.custom.xhr.withCredentials = this.withCredentials || false
+ }
+ this.proxy_send(...arguments)
+}
+
// Mock.setup({
// timeout: '350-600'
// })
diff --git a/src/permission.js b/src/permission.js
index 22522832..81f9d113 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -14,7 +14,7 @@ function hasPermission(roles, permissionRoles) {
return roles.some(role => permissionRoles.indexOf(role) >= 0)
}
-const whiteList = ['/login', '/authredirect']// no redirect whitelist
+const whiteList = ['/login', '/auth-redirect']// no redirect whitelist
router.beforeEach((to, from, next) => {
NProgress.start() // start progress bar
@@ -52,7 +52,7 @@ router.beforeEach((to, from, next) => {
if (whiteList.indexOf(to.path) !== -1) { // 在免登录白名单,直接进入
next()
} else {
- next('/login') // 否则全部重定向到登录页
+ next(`/login?redirect=${to.path}`) // 否则全部重定向到登录页
NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
}
}
diff --git a/src/router/index.js b/src/router/index.js
index 6c0c0f0d..ab328c46 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -12,7 +12,7 @@ import chartsRouter from './modules/charts'
import tableRouter from './modules/table'
import nestedRouter from './modules/nested'
-/** note: submenu only apppear when children.length>=1
+/** note: Submenu only appear when children.length>=1
* detail see https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
**/
@@ -21,7 +21,7 @@ import nestedRouter from './modules/nested'
* alwaysShow: true if set true, will always show the root menu, whatever its child routes length
* if not set alwaysShow, only more than one route under the children
* it will becomes nested mode, otherwise not show the root menu
-* redirect: noredirect if `redirect:noredirect` will no redirct in the breadcrumb
+* redirect: noredirect if `redirect:noredirect` will no redirect in the breadcrumb
* name:'router-name' the name is used by
(must set!!!)
* meta : {
roles: ['admin','editor'] will control the page roles (you can set multiple roles)
@@ -31,13 +31,24 @@ import nestedRouter from './modules/nested'
}
**/
export const constantRouterMap = [
+ {
+ path: '/redirect',
+ component: Layout,
+ hidden: true,
+ children: [
+ {
+ path: '/redirect/:path*',
+ component: () => import('@/views/redirect/index')
+ }
+ ]
+ },
{
path: '/login',
component: () => import('@/views/login/index'),
hidden: true
},
{
- path: '/authredirect',
+ path: '/auth-redirect',
component: () => import('@/views/login/authredirect'),
hidden: true
},
@@ -253,7 +264,7 @@ export const asyncRouterMap = [
{
path: 'export-selected-excel',
component: () => import('@/views/excel/selectExcel'),
- name: 'EelectExcel',
+ name: 'SelectExcel',
meta: { title: 'selectExcel' }
},
{
diff --git a/src/store/getters.js b/src/store/getters.js
index d68251fd..cf314f5c 100644
--- a/src/store/getters.js
+++ b/src/store/getters.js
@@ -1,6 +1,7 @@
const getters = {
sidebar: state => state.app.sidebar,
language: state => state.app.language,
+ size: state => state.app.size,
device: state => state.app.device,
visitedViews: state => state.tagsView.visitedViews,
cachedViews: state => state.tagsView.cachedViews,
diff --git a/src/store/modules/app.js b/src/store/modules/app.js
index d89664f8..bc4fb478 100644
--- a/src/store/modules/app.js
+++ b/src/store/modules/app.js
@@ -7,7 +7,8 @@ const app = {
withoutAnimation: false
},
device: 'desktop',
- language: Cookies.get('language') || 'en'
+ language: Cookies.get('language') || 'en',
+ size: Cookies.get('size') || 'medium'
},
mutations: {
TOGGLE_SIDEBAR: state => {
@@ -30,6 +31,10 @@ const app = {
SET_LANGUAGE: (state, language) => {
state.language = language
Cookies.set('language', language)
+ },
+ SET_SIZE: (state, size) => {
+ state.size = size
+ Cookies.set('size', size)
}
},
actions: {
@@ -44,6 +49,9 @@ const app = {
},
setLanguage({ commit }, language) {
commit('SET_LANGUAGE', language)
+ },
+ setSize({ commit }, size) {
+ commit('SET_SIZE', size)
}
}
}
diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js
index ce1aafa6..97de701e 100644
--- a/src/store/modules/permission.js
+++ b/src/store/modules/permission.js
@@ -7,7 +7,7 @@ import { asyncRouterMap, constantRouterMap } from '@/router'
*/
function hasPermission(roles, route) {
if (route.meta && route.meta.roles) {
- return roles.some(role => route.meta.roles.indexOf(role) >= 0)
+ return roles.some(role => route.meta.roles.includes(role))
} else {
return true
}
@@ -15,20 +15,23 @@ function hasPermission(roles, route) {
/**
* 递归过滤异步路由表,返回符合用户角色权限的路由表
- * @param asyncRouterMap
+ * @param routes asyncRouterMap
* @param roles
*/
-function filterAsyncRouter(asyncRouterMap, roles) {
- const accessedRouters = asyncRouterMap.filter(route => {
- if (hasPermission(roles, route)) {
- if (route.children && route.children.length) {
- route.children = filterAsyncRouter(route.children, roles)
+function filterAsyncRouter(routes, roles) {
+ const res = []
+
+ routes.forEach(route => {
+ const tmp = { ...route }
+ if (hasPermission(roles, tmp)) {
+ if (tmp.children) {
+ tmp.children = filterAsyncRouter(tmp.children, roles)
}
- return true
+ res.push(tmp)
}
- return false
})
- return accessedRouters
+
+ return res
}
const permission = {
@@ -47,7 +50,7 @@ const permission = {
return new Promise(resolve => {
const { roles } = data
let accessedRouters
- if (roles.indexOf('admin') >= 0) {
+ if (roles.includes('admin')) {
accessedRouters = asyncRouterMap
} else {
accessedRouters = filterAsyncRouter(asyncRouterMap, roles)
diff --git a/src/store/modules/tagsView.js b/src/store/modules/tagsView.js
index bb126492..cbf9eeb7 100644
--- a/src/store/modules/tagsView.js
+++ b/src/store/modules/tagsView.js
@@ -4,24 +4,30 @@ const tagsView = {
cachedViews: []
},
mutations: {
- ADD_VISITED_VIEWS: (state, view) => {
+ ADD_VISITED_VIEW: (state, view) => {
if (state.visitedViews.some(v => v.path === view.path)) return
state.visitedViews.push(
Object.assign({}, view, {
title: view.meta.title || 'no-name'
})
)
+ },
+ ADD_CACHED_VIEW: (state, view) => {
+ if (state.cachedViews.includes(view.name)) return
if (!view.meta.noCache) {
state.cachedViews.push(view.name)
}
},
- DEL_VISITED_VIEWS: (state, view) => {
+
+ DEL_VISITED_VIEW: (state, view) => {
for (const [i, v] of state.visitedViews.entries()) {
if (v.path === view.path) {
state.visitedViews.splice(i, 1)
break
}
}
+ },
+ DEL_CACHED_VIEW: (state, view) => {
for (const i of state.cachedViews) {
if (i === view.name) {
const index = state.cachedViews.indexOf(i)
@@ -30,13 +36,16 @@ const tagsView = {
}
}
},
- DEL_OTHERS_VIEWS: (state, view) => {
+
+ DEL_OTHERS_VISITED_VIEWS: (state, view) => {
for (const [i, v] of state.visitedViews.entries()) {
if (v.path === view.path) {
state.visitedViews = state.visitedViews.slice(i, i + 1)
break
}
}
+ },
+ DEL_OTHERS_CACHED_VIEWS: (state, view) => {
for (const i of state.cachedViews) {
if (i === view.name) {
const index = state.cachedViews.indexOf(i)
@@ -45,32 +54,107 @@ const tagsView = {
}
}
},
- DEL_ALL_VIEWS: state => {
+
+ DEL_ALL_VISITED_VIEWS: state => {
state.visitedViews = []
+ },
+ DEL_ALL_CACHED_VIEWS: state => {
state.cachedViews = []
+ },
+
+ UPDATE_VISITED_VIEW: (state, view) => {
+ for (let v of state.visitedViews) {
+ if (v.path === view.path) {
+ v = Object.assign(v, view)
+ break
+ }
+ }
}
+
},
actions: {
- addVisitedViews({ commit }, view) {
- commit('ADD_VISITED_VIEWS', view)
+ addView({ dispatch }, view) {
+ dispatch('addVisitedView', view)
+ dispatch('addCachedView', view)
},
- delVisitedViews({ commit, state }, view) {
+ addVisitedView({ commit }, view) {
+ commit('ADD_VISITED_VIEW', view)
+ },
+ addCachedView({ commit }, view) {
+ commit('ADD_CACHED_VIEW', view)
+ },
+
+ delView({ dispatch, state }, view) {
return new Promise(resolve => {
- commit('DEL_VISITED_VIEWS', view)
+ dispatch('delVisitedView', view)
+ dispatch('delCachedView', view)
+ resolve({
+ visitedViews: [...state.visitedViews],
+ cachedViews: [...state.cachedViews]
+ })
+ })
+ },
+ delVisitedView({ commit, state }, view) {
+ return new Promise(resolve => {
+ commit('DEL_VISITED_VIEW', view)
resolve([...state.visitedViews])
})
},
- delOthersViews({ commit, state }, view) {
+ delCachedView({ commit, state }, view) {
return new Promise(resolve => {
- commit('DEL_OTHERS_VIEWS', view)
+ commit('DEL_CACHED_VIEW', view)
+ resolve([...state.cachedViews])
+ })
+ },
+
+ delOthersViews({ dispatch, state }, view) {
+ return new Promise(resolve => {
+ dispatch('delOthersVisitedViews', view)
+ dispatch('delOthersCachedViews', view)
+ resolve({
+ visitedViews: [...state.visitedViews],
+ cachedViews: [...state.cachedViews]
+ })
+ })
+ },
+ delOthersVisitedViews({ commit, state }, view) {
+ return new Promise(resolve => {
+ commit('DEL_OTHERS_VISITED_VIEWS', view)
resolve([...state.visitedViews])
})
},
- delAllViews({ commit, state }) {
+ delOthersCachedViews({ commit, state }, view) {
return new Promise(resolve => {
- commit('DEL_ALL_VIEWS')
+ commit('DEL_OTHERS_CACHED_VIEWS', view)
+ resolve([...state.cachedViews])
+ })
+ },
+
+ delAllViews({ dispatch, state }, view) {
+ return new Promise(resolve => {
+ dispatch('delAllVisitedViews', view)
+ dispatch('delAllCachedViews', view)
+ resolve({
+ visitedViews: [...state.visitedViews],
+ cachedViews: [...state.cachedViews]
+ })
+ })
+ },
+ delAllVisitedViews({ commit, state }) {
+ return new Promise(resolve => {
+ commit('DEL_ALL_VISITED_VIEWS')
resolve([...state.visitedViews])
})
+ },
+ delAllCachedViews({ commit, state }) {
+ return new Promise(resolve => {
+ commit('DEL_ALL_CACHED_VIEWS')
+ resolve([...state.cachedViews])
+ })
+ },
+
+ updateVisitedView({ commit }, view) {
+ commit('UPDATE_VISITED_VIEW', view)
}
}
}
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 13e76399..0f7e2296 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -122,7 +122,7 @@ const user = {
},
// 动态修改权限
- ChangeRoles({ commit }, role) {
+ ChangeRoles({ commit, dispatch }, role) {
return new Promise(resolve => {
commit('SET_TOKEN', role)
setToken(role)
@@ -132,6 +132,7 @@ const user = {
commit('SET_NAME', data.name)
commit('SET_AVATAR', data.avatar)
commit('SET_INTRODUCTION', data.introduction)
+ dispatch('GenerateRoutes', data) // 动态修改权限后 重绘侧边菜单
resolve()
})
})
diff --git a/src/styles/sidebar.scss b/src/styles/sidebar.scss
index 8e6db3b9..faa7366e 100644
--- a/src/styles/sidebar.scss
+++ b/src/styles/sidebar.scss
@@ -28,6 +28,9 @@
height: 100%;
}
}
+ .el-scrollbar__bar.is-vertical{
+ right: 0px;
+ }
.is-horizontal {
display: none;
}
@@ -44,6 +47,9 @@
height: 100%;
width: 100% !important;
}
+ .is-active > .el-submenu__title{
+ color: #f4f4f5!important;
+ }
}
.hideSidebar {
.sidebar-container {
@@ -117,3 +123,11 @@
}
}
}
+
+.el-menu--vertical{
+ & >.el-menu{
+ .svg-icon{
+ margin-right: 16px;
+ }
+ }
+}
diff --git a/src/utils/i18n.js b/src/utils/i18n.js
index 0cb5e253..76be5a4e 100644
--- a/src/utils/i18n.js
+++ b/src/utils/i18n.js
@@ -1,9 +1,11 @@
// translate router.meta.title, be used in breadcrumb sidebar tagsview
export function generateTitle(title) {
const hasKey = this.$te('route.' + title)
- const translatedTitle = this.$t('route.' + title) // $t :this method from vue-i18n, inject in @/lang/index.js
if (hasKey) {
+ // $t :this method from vue-i18n, inject in @/lang/index.js
+ const translatedTitle = this.$t('route.' + title)
+
return translatedTitle
}
return title
diff --git a/src/utils/index.js b/src/utils/index.js
index 43a374e4..0445827b 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -164,18 +164,6 @@ export function objectMerge(target, source) {
return target
}
-export function scrollTo(element, to, duration) {
- if (duration <= 0) return
- const difference = to - element.scrollTop
- const perTick = (difference / duration) * 10
- setTimeout(() => {
- console.log(new Date())
- element.scrollTop = element.scrollTop + perTick
- if (element.scrollTop === to) return
- scrollTo(element, to, duration - 10)
- }, 10)
-}
-
export function toggleClass(element, className) {
if (!element || !className) {
return
@@ -297,3 +285,7 @@ export function deepClone(source) {
export function uniqueArr(arr) {
return Array.from(new Set(arr))
}
+
+export function isExternal(path) {
+ return /^(https?:|mailto:|tel:)/.test(path)
+}
diff --git a/src/utils/request.js b/src/utils/request.js
index 5ce53933..50f9ecec 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -5,7 +5,7 @@ import { getToken } from '@/utils/auth'
// create an axios instance
const service = axios.create({
- baseURL: process.env.BASE_API, // api的base_url
+ baseURL: process.env.BASE_API, // api 的 base_url
timeout: 5000 // request timeout
})
@@ -26,13 +26,13 @@ service.interceptors.request.use(
}
)
-// respone interceptor
+// response interceptor
service.interceptors.response.use(
response => response,
/**
* 下面的注释为通过在response里,自定义code来标示请求状态
* 当code返回如下情况则说明权限有问题,登出并返回到登录页
- * 如想通过xmlhttprequest来状态码标识 逻辑可写在下面error中
+ * 如想通过 xmlhttprequest 来状态码标识 逻辑可写在下面error中
* 以下代码均为样例,请结合自生需求加以修改,若不需要,则可删除
*/
// response => {
diff --git a/src/utils/scrollTo.js b/src/utils/scrollTo.js
new file mode 100644
index 00000000..8affede6
--- /dev/null
+++ b/src/utils/scrollTo.js
@@ -0,0 +1,50 @@
+Math.easeInOutQuad = function(t, b, c, d) {
+ t /= d / 2
+ if (t < 1) {
+ return c / 2 * t * t + b
+ }
+ t--
+ return -c / 2 * (t * (t - 2) - 1) + b
+}
+
+// requestAnimationFrame for Smart Animating http://goo.gl/sx5sts
+var requestAnimFrame = (function() {
+ return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60) }
+})()
+
+// because it's so fucking difficult to detect the scrolling element, just move them all
+function move(amount) {
+ document.documentElement.scrollTop = amount
+ document.body.parentNode.scrollTop = amount
+ document.body.scrollTop = amount
+}
+
+function position() {
+ return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop
+}
+
+export function scrollTo(to, duration, callback) {
+ const start = position()
+ const change = to - start
+ const increment = 20
+ let currentTime = 0
+ duration = (typeof (duration) === 'undefined') ? 500 : duration
+ var animateScroll = function() {
+ // increment the time
+ currentTime += increment
+ // find the value with the quadratic in-out easing function
+ var val = Math.easeInOutQuad(currentTime, start, change, duration)
+ // move the document.body
+ move(val)
+ // do the animation unless its over
+ if (currentTime < duration) {
+ requestAnimFrame(animateScroll)
+ } else {
+ if (callback && typeof (callback) === 'function') {
+ // the animation is done so lets callback
+ callback()
+ }
+ }
+ }
+ animateScroll()
+}
diff --git a/src/vendor/Blob.js b/src/vendor/Blob.js
deleted file mode 100644
index 5e426dc2..00000000
--- a/src/vendor/Blob.js
+++ /dev/null
@@ -1,176 +0,0 @@
-/* eslint-disable */
-/* Blob.js
- * A Blob implementation.
- * 2014-05-27
- *
- * By Eli Grey, http://eligrey.com
- * By Devin Samarin, https://github.com/eboyjr
- * License: X11/MIT
- * See LICENSE.md
- */
-
-/*global self, unescape */
-/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true,
- plusplus: true */
-
-/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */
-
-(function (view) {
- "use strict";
-
- view.URL = view.URL || view.webkitURL;
-
- if (view.Blob && view.URL) {
- try {
- new Blob;
- return;
- } catch (e) {}
- }
-
- // Internally we use a BlobBuilder implementation to base Blob off of
- // in order to support older browsers that only have BlobBuilder
- var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function (view) {
- var
- get_class = function (object) {
- return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1];
- },
- FakeBlobBuilder = function BlobBuilder() {
- this.data = [];
- },
- FakeBlob = function Blob(data, type, encoding) {
- this.data = data;
- this.size = data.length;
- this.type = type;
- this.encoding = encoding;
- },
- FBB_proto = FakeBlobBuilder.prototype,
- FB_proto = FakeBlob.prototype,
- FileReaderSync = view.FileReaderSync,
- FileException = function (type) {
- this.code = this[this.name = type];
- },
- file_ex_codes = (
- "NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR " +
- "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR"
- ).split(" "),
- file_ex_code = file_ex_codes.length,
- real_URL = view.URL || view.webkitURL || view,
- real_create_object_URL = real_URL.createObjectURL,
- real_revoke_object_URL = real_URL.revokeObjectURL,
- URL = real_URL,
- btoa = view.btoa,
- atob = view.atob
-
- ,
- ArrayBuffer = view.ArrayBuffer,
- Uint8Array = view.Uint8Array;
- FakeBlob.fake = FB_proto.fake = true;
- while (file_ex_code--) {
- FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1;
- }
- if (!real_URL.createObjectURL) {
- URL = view.URL = {};
- }
- URL.createObjectURL = function (blob) {
- var
- type = blob.type,
- data_URI_header;
- if (type === null) {
- type = "application/octet-stream";
- }
- if (blob instanceof FakeBlob) {
- data_URI_header = "data:" + type;
- if (blob.encoding === "base64") {
- return data_URI_header + ";base64," + blob.data;
- } else if (blob.encoding === "URI") {
- return data_URI_header + "," + decodeURIComponent(blob.data);
- }
- if (btoa) {
- return data_URI_header + ";base64," + btoa(blob.data);
- } else {
- return data_URI_header + "," + encodeURIComponent(blob.data);
- }
- } else if (real_create_object_URL) {
- return real_create_object_URL.call(real_URL, blob);
- }
- };
- URL.revokeObjectURL = function (object_URL) {
- if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) {
- real_revoke_object_URL.call(real_URL, object_URL);
- }
- };
- FBB_proto.append = function (data /*, endings*/ ) {
- var bb = this.data;
- // decode data to a binary string
- if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) {
- var
- str = "",
- buf = new Uint8Array(data),
- i = 0,
- buf_len = buf.length;
- for (; i < buf_len; i++) {
- str += String.fromCharCode(buf[i]);
- }
- bb.push(str);
- } else if (get_class(data) === "Blob" || get_class(data) === "File") {
- if (FileReaderSync) {
- var fr = new FileReaderSync;
- bb.push(fr.readAsBinaryString(data));
- } else {
- // async FileReader won't work as BlobBuilder is sync
- throw new FileException("NOT_READABLE_ERR");
- }
- } else if (data instanceof FakeBlob) {
- if (data.encoding === "base64" && atob) {
- bb.push(atob(data.data));
- } else if (data.encoding === "URI") {
- bb.push(decodeURIComponent(data.data));
- } else if (data.encoding === "raw") {
- bb.push(data.data);
- }
- } else {
- if (typeof data !== "string") {
- data += ""; // convert unsupported types to strings
- }
- // decode UTF-16 to binary string
- bb.push(unescape(encodeURIComponent(data)));
- }
- };
- FBB_proto.getBlob = function (type) {
- if (!arguments.length) {
- type = null;
- }
- return new FakeBlob(this.data.join(""), type, "raw");
- };
- FBB_proto.toString = function () {
- return "[object BlobBuilder]";
- };
- FB_proto.slice = function (start, end, type) {
- var args = arguments.length;
- if (args < 3) {
- type = null;
- }
- return new FakeBlob(
- this.data.slice(start, args > 1 ? end : this.data.length), type, this.encoding
- );
- };
- FB_proto.toString = function () {
- return "[object Blob]";
- };
- FB_proto.close = function () {
- this.size = this.data.length = 0;
- };
- return FakeBlobBuilder;
- }(view));
-
- view.Blob = function Blob(blobParts, options) {
- var type = options ? (options.type || "") : "";
- var builder = new BlobBuilder();
- if (blobParts) {
- for (var i = 0, len = blobParts.length; i < len; i++) {
- builder.append(blobParts[i]);
- }
- }
- return builder.getBlob(type);
- };
-}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this));
diff --git a/src/vendor/Export2Excel.js b/src/vendor/Export2Excel.js
index 75f33ae1..ba956dc1 100644
--- a/src/vendor/Export2Excel.js
+++ b/src/vendor/Export2Excel.js
@@ -1,6 +1,5 @@
/* eslint-disable */
require('script-loader!file-saver');
-require('script-loader!@/vendor/Blob');
import XLSX from 'xlsx'
function generateArray(table) {
@@ -149,7 +148,8 @@ export function export_json_to_excel({
header,
data,
filename,
- autoWidth = true
+ autoWidth = true,
+ bookType= 'xlsx'
} = {}) {
/* original data */
filename = filename || 'excel-list'
@@ -196,11 +196,11 @@ export function export_json_to_excel({
wb.Sheets[ws_name] = ws;
var wbout = XLSX.write(wb, {
- bookType: 'xlsx',
+ bookType: bookType,
bookSST: false,
type: 'binary'
});
saveAs(new Blob([s2ab(wbout)], {
type: "application/octet-stream"
- }), filename + ".xlsx");
+ }), `${filename}.${bookType}`);
}
diff --git a/src/views/charts/keyboard.vue b/src/views/charts/keyboard.vue
index 98087ab0..3ea21397 100644
--- a/src/views/charts/keyboard.vue
+++ b/src/views/charts/keyboard.vue
@@ -16,9 +16,8 @@ export default {
diff --git a/src/views/charts/line.vue b/src/views/charts/line.vue
index da0b5bba..2034d4c7 100644
--- a/src/views/charts/line.vue
+++ b/src/views/charts/line.vue
@@ -16,9 +16,8 @@ export default {
diff --git a/src/views/charts/mixChart.vue b/src/views/charts/mixChart.vue
index 568bae7b..7ccc7fa0 100644
--- a/src/views/charts/mixChart.vue
+++ b/src/views/charts/mixChart.vue
@@ -16,9 +16,8 @@ export default {
diff --git a/src/views/clipboard/index.vue b/src/views/clipboard/index.vue
index 0a4c63f2..607dfb66 100644
--- a/src/views/clipboard/index.vue
+++ b/src/views/clipboard/index.vue
@@ -2,11 +2,11 @@
-
+
copy
-
+
copy
diff --git a/src/views/dashboard/admin/components/BarChart.vue b/src/views/dashboard/admin/components/BarChart.vue
index a694f2b9..28e0aef9 100644
--- a/src/views/dashboard/admin/components/BarChart.vue
+++ b/src/views/dashboard/admin/components/BarChart.vue
@@ -31,18 +31,18 @@ export default {
},
mounted() {
this.initChart()
- this.__resizeHanlder = debounce(() => {
+ this.__resizeHandler = debounce(() => {
if (this.chart) {
this.chart.resize()
}
}, 100)
- window.addEventListener('resize', this.__resizeHanlder)
+ window.addEventListener('resize', this.__resizeHandler)
},
beforeDestroy() {
if (!this.chart) {
return
}
- window.removeEventListener('resize', this.__resizeHanlder)
+ window.removeEventListener('resize', this.__resizeHandler)
this.chart.dispose()
this.chart = null
},
diff --git a/src/views/dashboard/admin/components/LineChart.vue b/src/views/dashboard/admin/components/LineChart.vue
index 6c6637a8..ef493c4b 100644
--- a/src/views/dashboard/admin/components/LineChart.vue
+++ b/src/views/dashboard/admin/components/LineChart.vue
@@ -46,33 +46,38 @@ export default {
mounted() {
this.initChart()
if (this.autoResize) {
- this.__resizeHanlder = debounce(() => {
+ this.__resizeHandler = debounce(() => {
if (this.chart) {
this.chart.resize()
}
}, 100)
- window.addEventListener('resize', this.__resizeHanlder)
+ window.addEventListener('resize', this.__resizeHandler)
}
// 监听侧边栏的变化
const sidebarElm = document.getElementsByClassName('sidebar-container')[0]
- sidebarElm.addEventListener('transitionend', this.__resizeHanlder)
+ sidebarElm.addEventListener('transitionend', this.sidebarResizeHandler)
},
beforeDestroy() {
if (!this.chart) {
return
}
if (this.autoResize) {
- window.removeEventListener('resize', this.__resizeHanlder)
+ window.removeEventListener('resize', this.__resizeHandler)
}
const sidebarElm = document.getElementsByClassName('sidebar-container')[0]
- sidebarElm.removeEventListener('transitionend', this.__resizeHanlder)
+ sidebarElm.removeEventListener('transitionend', this.sidebarResizeHandler)
this.chart.dispose()
this.chart = null
},
methods: {
+ sidebarResizeHandler(e) {
+ if (e.propertyName === 'width') {
+ this.__resizeHandler()
+ }
+ },
setOptions({ expectedData, actualData } = {}) {
this.chart.setOption({
xAxis: {
diff --git a/src/views/dashboard/admin/components/PanelGroup.vue b/src/views/dashboard/admin/components/PanelGroup.vue
index 2d1d58c9..8125b846 100644
--- a/src/views/dashboard/admin/components/PanelGroup.vue
+++ b/src/views/dashboard/admin/components/PanelGroup.vue
@@ -35,8 +35,8 @@