Commit c47c6979d846cf05a67e76bd613767a39fdf61bd
1 parent
9c24a3cb
上传添加导入添加loading
Showing
3 changed files
with
22 additions
and
10 deletions
config/dev.env.js
| 1 | 1 | 'use strict' |
| 2 | 2 | const merge = require('webpack-merge') |
| 3 | 3 | const prodEnv = require('./prod.env') |
| 4 | +//是否开发状态 | |
| 4 | 5 | const isDev = true; |
| 5 | -const ipAddresses = isDev?"weberp.xlyprint.cn":"127.0.0.1:8080"; | |
| 6 | +//开发API地址 | |
| 7 | + const devAdrress='"http://weberp.xlyprint.cn/xlyReport"'; | |
| 8 | +//const devAdrress='"http://127.0.0.1:8080/xlyReport"'; | |
| 9 | +//正式打包API地址 | |
| 10 | +const ipAdrress='"http://"+location.host+"/xlyReport"'; | |
| 11 | + | |
| 6 | 12 | module.exports = merge(prodEnv, { |
| 7 | 13 | NODE_ENV: '"development"', |
| 8 | - BASE_API: '"http://'+ipAddresses+'/xlyReport"', | |
| 14 | + BASE_API: isDev?devAdrress:ipAdrress, | |
| 9 | 15 | // BASE_API: '"http://weberp.xlyprint.cn/xlyReport"', |
| 10 | - //API_WS: '"ws://127.0.0.1:8080/api/websocket"' | |
| 16 | +// API_WS: '"ws://127.0.0.1:8080/api/websocket"' | |
| 11 | 17 | }) |
| 18 | + | ... | ... |
src/utils/request.js
| ... | ... | @@ -55,12 +55,18 @@ service.interceptors.response.use( |
| 55 | 55 | } |
| 56 | 56 | }, |
| 57 | 57 | error => { |
| 58 | + // Message({ | |
| 59 | + // message: error.message, | |
| 60 | + // type: 'error', | |
| 61 | + // duration: 5 * 1000 | |
| 62 | + // }) | |
| 63 | + // return Promise.reject(error) | |
| 58 | 64 | Message({ |
| 59 | 65 | message: error.message, |
| 60 | 66 | type: 'error', |
| 61 | 67 | duration: 5 * 1000 |
| 62 | - }) | |
| 63 | - return Promise.reject(error) | |
| 68 | + }); | |
| 69 | + return {code:-1}; | |
| 64 | 70 | } |
| 65 | 71 | ) |
| 66 | 72 | ... | ... |
src/views/bigscreenDesigner/designer/index.vue
| ... | ... | @@ -732,6 +732,7 @@ export default { |
| 732 | 732 | exportDashboard(param).then((res) => { |
| 733 | 733 | const that = this; |
| 734 | 734 | const type = res.type; |
| 735 | + this.$hideLoading(); | |
| 735 | 736 | if (type == "application/json") { |
| 736 | 737 | let reader = new FileReader(); |
| 737 | 738 | reader.readAsText(res, "utf-8"); |
| ... | ... | @@ -742,7 +743,6 @@ export default { |
| 742 | 743 | return; |
| 743 | 744 | } |
| 744 | 745 | const blob = new Blob([res], { type: "application/octet-stream" }); |
| 745 | - this.$hideLoading(); | |
| 746 | 746 | if (window.navigator.msSaveOrOpenBlob) { |
| 747 | 747 | //msSaveOrOpenBlob方法返回bool值 |
| 748 | 748 | navigator.msSaveBlob(blob, fileName); //本地保存 |
| ... | ... | @@ -962,8 +962,6 @@ export default { |
| 962 | 962 | this.$refs.widgets[i].$refs.draggable.setActive(true); |
| 963 | 963 | } |
| 964 | 964 | } |
| 965 | - this.setOptionsOnClickWidget(index); | |
| 966 | - this.grade = true; | |
| 967 | 965 | }else{ |
| 968 | 966 | //没有按住shift键标识编辑单个 |
| 969 | 967 | for (let i = 0; i < draggableArr.length; i++) { |
| ... | ... | @@ -973,9 +971,10 @@ export default { |
| 973 | 971 | this.$refs.widgets[i].$refs.draggable.setActive(false); |
| 974 | 972 | } |
| 975 | 973 | } |
| 976 | - this.setOptionsOnClickWidget(index); | |
| 977 | - this.grade = true; | |
| 978 | 974 | } |
| 975 | + this.setOptionsOnClickWidget(index); | |
| 976 | + this.grade = true; | |
| 977 | + this.widgetIndex = index; | |
| 979 | 978 | }, |
| 980 | 979 | widgetsMouseup(e) { |
| 981 | 980 | this.grade = false; | ... | ... |