diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index 96be4532..76083546 100755 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -12,3 +12,24 @@ about: Asking questions about use Before asking a question, please make sure that you have tried your best to solve this problem. If it's a code-related issue, please don't just take screenshots. Please provide an online demo to save each other's time. --> + +#### Steps to reproduce(问题复现步骤) + + +#### Screenshot or Gif(截图或动态图) + + +#### Link to minimal reproduction(最小可在线还原demo) + + + +#### Other relevant information(格外信息) +- Your OS: +- Node.js version: +- vue-element-admin version: diff --git a/README.es.md b/README.es.md index 734c51c2..396556f5 100644 --- a/README.es.md +++ b/README.es.md @@ -49,6 +49,7 @@ Vue Element Admin es una solución práctica basada en la nueva plataforma de de - Plantilla base recomendada para usar: [vue-admin-template](https://github.com/PanJiaChen/vue-admin-template) - Aplicación de Escritorio: [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin) - 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** diff --git a/README.ja.md b/README.ja.md index 7b1232bc..2f43128c 100644 --- a/README.ja.md +++ b/README.ja.md @@ -45,6 +45,7 @@ - おすすめシンプルテンプレート: [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)) +- [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** diff --git a/README.md b/README.md index 3a2b6191..9cd95cc1 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ It is a magical vue admin based on the newest development stack of vue, built-in - Base template recommends using: [vue-admin-template](https://github.com/PanJiaChen/vue-admin-template) - Desktop: [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin) - Typescript: [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (Credits: [@Armour](https://github.com/Armour)) +- [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** diff --git a/README.zh-CN.md b/README.zh-CN.md index 31bbe351..bbb94a48 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -49,6 +49,7 @@ - 基础模板建议使用: [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)) +- [awesome-project](https://github.com/PanJiaChen/vue-element-admin/issues/2312) **`v4.1.0+`版本之后默认 master 分支将不支持国际化,有需要的请使用[i18n](https://github.com/PanJiaChen/vue-element-admin/tree/i18n)分支,它会和 master 保持同步更新** @@ -164,7 +165,7 @@ cd vue-element-admin # 安装依赖 npm install -# 建议不要直接使用 cnpm 安装以来,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题 +# 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题 npm install --registry=https://registry.npm.taobao.org # 启动服务 diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 00000000..958df046 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "paths": { + "@/*": ["src/*"] + } + }, + "exclude": ["node_modules", "dist"] +} \ No newline at end of file diff --git a/package.json b/package.json index cd1369b8..9942fbac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-element-admin", - "version": "4.2.0", + "version": "4.2.1", "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 ", "license": "MIT", @@ -43,7 +43,7 @@ "url": "https://github.com/PanJiaChen/vue-element-admin/issues" }, "dependencies": { - "axios": "0.18.0", + "axios": "0.18.1", "clipboard": "2.0.4", "codemirror": "5.45.0", "driver.js": "0.9.5", @@ -74,10 +74,11 @@ "@babel/core": "7.0.0", "@babel/register": "7.0.0", "@vue/cli-plugin-babel": "3.5.3", - "@vue/cli-plugin-eslint": "3.5.1", + "@vue/cli-plugin-eslint": "^3.9.1", "@vue/cli-plugin-unit-jest": "3.5.3", "@vue/cli-service": "3.5.3", "@vue/test-utils": "1.0.0-beta.29", + "autoprefixer": "^9.5.1", "babel-core": "7.0.0-bridge.0", "babel-eslint": "10.0.1", "babel-jest": "23.6.0", diff --git a/src/components/ImageCropper/index.vue b/src/components/ImageCropper/index.vue index c30c5b18..13ae9a11 100644 --- a/src/components/ImageCropper/index.vue +++ b/src/components/ImageCropper/index.vue @@ -6,7 +6,14 @@
-
+
@@ -17,7 +24,8 @@
- {{ errorMsg }} + + {{ errorMsg }}
{{ lang.btn.off }} @@ -55,9 +63,26 @@
- - - + + +
@@ -91,10 +116,12 @@
- {{ errorMsg }} + + {{ errorMsg }}
- {{ lang.success }} + + {{ lang.success }}
@@ -108,7 +135,6 @@ - - - diff --git a/src/components/MDinput/index.vue b/src/components/MDinput/index.vue index 013462fa..c59ea34a 100644 --- a/src/components/MDinput/index.vue +++ b/src/components/MDinput/index.vue @@ -9,7 +9,7 @@ :placeholder="fillPlaceHolder" :readonly="readonly" :disabled="disabled" - :autoComplete="autoComplete" + :autocomplete="autoComplete" :required="required" type="email" class="material-input" @@ -24,7 +24,7 @@ :placeholder="fillPlaceHolder" :readonly="readonly" :disabled="disabled" - :autoComplete="autoComplete" + :autocomplete="autoComplete" :required="required" type="url" class="material-input" @@ -40,7 +40,7 @@ :step="step" :readonly="readonly" :disabled="disabled" - :autoComplete="autoComplete" + :autocomplete="autoComplete" :max="max" :min="min" :minlength="minlength" @@ -59,7 +59,7 @@ :placeholder="fillPlaceHolder" :readonly="readonly" :disabled="disabled" - :autoComplete="autoComplete" + :autocomplete="autoComplete" :max="max" :min="min" :required="required" @@ -76,7 +76,7 @@ :placeholder="fillPlaceHolder" :readonly="readonly" :disabled="disabled" - :autoComplete="autoComplete" + :autocomplete="autoComplete" :required="required" type="tel" class="material-input" @@ -91,7 +91,7 @@ :placeholder="fillPlaceHolder" :readonly="readonly" :disabled="disabled" - :autoComplete="autoComplete" + :autocomplete="autoComplete" :minlength="minlength" :maxlength="maxlength" :required="required" diff --git a/src/components/PanThumb/index.vue b/src/components/PanThumb/index.vue index de6940ad..1bcf4170 100644 --- a/src/components/PanThumb/index.vue +++ b/src/components/PanThumb/index.vue @@ -5,7 +5,8 @@
- + +
@@ -52,7 +53,8 @@ export default { .pan-thumb { width: 100%; height: 100%; - background-size: 100%; + background-position: center center; + background-size: cover; border-radius: 50%; overflow: hidden; position: absolute; @@ -60,7 +62,7 @@ export default { transition: all 0.3s ease-in-out; } -.pan-thumb:after { +/* .pan-thumb:after { content: ''; width: 8px; height: 8px; @@ -71,7 +73,7 @@ export default { margin: -4px 0 0 -4px; background: radial-gradient(ellipse at center, rgba(14, 14, 14, 1) 0%, rgba(125, 126, 125, 1) 100%); box-shadow: 0 0 1px rgba(255, 255, 255, 0.9); -} +} */ .pan-info { position: absolute; diff --git a/src/components/Tinymce/dynamicLoadScript.js b/src/components/Tinymce/dynamicLoadScript.js index 46a93290..185f58dc 100644 --- a/src/components/Tinymce/dynamicLoadScript.js +++ b/src/components/Tinymce/dynamicLoadScript.js @@ -1,3 +1,11 @@ +let callbacks = [] + +function loadedTinymce() { + // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2144 + // check is successfully downloaded script + return window.tinymce +} + const dynamicLoadScript = (src, callback) => { const existingScript = document.getElementById(src) const cb = callback || function() {} @@ -7,19 +15,28 @@ const dynamicLoadScript = (src, callback) => { script.src = src // src url for the third-party library being loaded. script.id = src document.body.appendChild(script) - + callbacks.push(cb) const onEnd = 'onload' in script ? stdOnEnd : ieOnEnd - onEnd(script, cb) + onEnd(script) } - if (existingScript && cb) cb(null, existingScript) + if (existingScript && cb) { + if (loadedTinymce()) { + cb(null, existingScript) + } else { + callbacks.push(cb) + } + } - function stdOnEnd(script, cb) { + function stdOnEnd(script) { script.onload = function() { // this.onload = null here is necessary // because even IE9 works not like others this.onerror = this.onload = null - cb(null, script) + for (const cb of callbacks) { + cb(null, script) + } + callbacks = null } script.onerror = function() { this.onerror = this.onload = null @@ -27,11 +44,14 @@ const dynamicLoadScript = (src, callback) => { } } - function ieOnEnd(script, cb) { + function ieOnEnd(script) { script.onreadystatechange = function() { if (this.readyState !== 'complete' && this.readyState !== 'loaded') return this.onreadystatechange = null - cb(null, script) // there is no way to catch loading errors in IE8 + for (const cb of callbacks) { + cb(null, script) // there is no way to catch loading errors in IE8 + } + callbacks = null } } } diff --git a/src/components/Tinymce/index.vue b/src/components/Tinymce/index.vue index a46b37d6..0c6174c4 100644 --- a/src/components/Tinymce/index.vue +++ b/src/components/Tinymce/index.vue @@ -64,7 +64,9 @@ export default { fullscreen: false, languageTypeList: { 'en': 'en', - 'zh': 'zh_CN' + 'zh': 'zh_CN', + 'es': 'es_MX', + 'ja': 'ja' } } }, @@ -114,6 +116,7 @@ export default { const _this = this window.tinymce.init({ selector: `#${this.tinymceId}`, + language: this.languageTypeList['en'], height: this.height, body_class: 'panel-body ', object_resizing: false, diff --git a/src/filters/index.js b/src/filters/index.js index f6a28488..98222339 100644 --- a/src/filters/index.js +++ b/src/filters/index.js @@ -45,7 +45,7 @@ export function numberFormatter(num, digits) { ] for (let i = 0; i < si.length; i++) { if (num >= si[i].value) { - return (num / si[i].value + 0.1).toFixed(digits).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, '$1') + si[i].symbol + return (num / si[i].value).toFixed(digits).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, '$1') + si[i].symbol } } return num.toString() diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index 9e12c662..a8976380 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -16,7 +16,7 @@ export default { return this.$store.state.tagsView.cachedViews }, key() { - return this.$route.fullPath + return this.$route.path } } } diff --git a/src/utils/clipboard.js b/src/utils/clipboard.js index e916a44d..cf5b07a1 100644 --- a/src/utils/clipboard.js +++ b/src/utils/clipboard.js @@ -22,14 +22,10 @@ export default function handleClipboard(text, event) { }) clipboard.on('success', () => { clipboardSuccess() - clipboard.off('error') - clipboard.off('success') clipboard.destroy() }) clipboard.on('error', () => { clipboardError() - clipboard.off('error') - clipboard.off('success') clipboard.destroy() }) clipboard.onClick(event) diff --git a/src/utils/request.js b/src/utils/request.js index bc346a8c..2fb95ac0 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -6,7 +6,7 @@ import { getToken } from '@/utils/auth' // create an axios instance const service = axios.create({ baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url - withCredentials: true, // send cookies when cross-domain requests + // withCredentials: true, // send cookies when cross-domain requests timeout: 5000 // request timeout }) @@ -48,7 +48,7 @@ service.interceptors.response.use( // if the custom code is not 20000, it is judged as an error. if (res.code !== 20000) { Message({ - message: res.message || 'error', + message: res.message || 'Error', type: 'error', duration: 5 * 1000 }) @@ -66,7 +66,7 @@ service.interceptors.response.use( }) }) } - return Promise.reject(res.message || 'error') + return Promise.reject(new Error(res.message || 'Error')) } else { return res } diff --git a/src/vendor/Export2Excel.js b/src/vendor/Export2Excel.js index 20784f3a..d8a2af3d 100644 --- a/src/vendor/Export2Excel.js +++ b/src/vendor/Export2Excel.js @@ -1,5 +1,5 @@ /* eslint-disable */ -require('script-loader!file-saver'); +import { saveAs } from 'file-saver' import XLSX from 'xlsx' function generateArray(table) { @@ -151,14 +151,14 @@ export function export_json_to_excel({ filename, merges = [], autoWidth = true, - bookType= 'xlsx' + bookType = 'xlsx' } = {}) { /* original data */ filename = filename || 'excel-list' data = [...data] data.unshift(header); - for (let i = multiHeader.length-1; i > -1; i--) { + for (let i = multiHeader.length - 1; i > -1; i--) { data.unshift(multiHeader[i]) } diff --git a/src/vendor/Export2Zip.js b/src/vendor/Export2Zip.js index f776465e..db70707d 100644 --- a/src/vendor/Export2Zip.js +++ b/src/vendor/Export2Zip.js @@ -1,5 +1,5 @@ /* eslint-disable */ -require('script-loader!file-saver'); +import { saveAs } from 'file-saver' import JSZip from 'jszip' export function export_txt_to_zip(th, jsonData, txtName, zipName) { diff --git a/src/views/clipboard/index.vue b/src/views/clipboard/index.vue index e78c6359..4a6bdd1e 100644 --- a/src/views/clipboard/index.vue +++ b/src/views/clipboard/index.vue @@ -3,13 +3,13 @@ - + copy - + copy diff --git a/src/views/components-demo/avatar-upload.vue b/src/views/components-demo/avatar-upload.vue index 41bb9bc7..5cb20a56 100644 --- a/src/views/components-demo/avatar-upload.vue +++ b/src/views/components-demo/avatar-upload.vue @@ -7,7 +7,7 @@ - + Change Avatar diff --git a/src/views/components-demo/mixin.vue b/src/views/components-demo/mixin.vue index c64a073a..425cf4fb 100644 --- a/src/views/components-demo/mixin.vue +++ b/src/views/components-demo/mixin.vue @@ -49,7 +49,7 @@
- + 标题 diff --git a/src/views/dashboard/admin/components/mixins/resize.js b/src/views/dashboard/admin/components/mixins/resize.js index bcd17bf0..234953b1 100644 --- a/src/views/dashboard/admin/components/mixins/resize.js +++ b/src/views/dashboard/admin/components/mixins/resize.js @@ -3,10 +3,16 @@ import { debounce } from '@/utils' export default { data() { return { - $_sidebarElm: null + $_sidebarElm: null, + $_resizeHandler: null } }, mounted() { + this.$_resizeHandler = debounce(() => { + if (this.chart) { + this.chart.resize() + } + }, 100) this.$_initResizeEvent() this.$_initSidebarResizeEvent() }, @@ -27,13 +33,6 @@ export default { methods: { // use $_ for mixins properties // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential - $_resizeHandler() { - return debounce(() => { - if (this.chart) { - this.chart.resize() - } - }, 100)() - }, $_initResizeEvent() { window.addEventListener('resize', this.$_resizeHandler) }, diff --git a/src/views/error-page/401.vue b/src/views/error-page/401.vue index 032e808f..a52ed23b 100644 --- a/src/views/error-page/401.vue +++ b/src/views/error-page/401.vue @@ -1,6 +1,6 @@