Commit 1788c804bc23fc7828d24152162e87faee56f3f4

Authored by qianbao
1 parent 78ceab92

上传添加导入添加loading

config/dev.env.js
1 1 'use strict'
2 2 const merge = require('webpack-merge')
3 3 const prodEnv = require('./prod.env')
4   -const isDev = false;
  4 +const isDev = true;
5 5 const ipAddresses = isDev?"weberp.xlyprint.cn":"127.0.0.1:8080";
6   - //window.location.host;
7   -
8 6 module.exports = merge(prodEnv, {
9 7 NODE_ENV: '"development"',
10 8 BASE_API: '"http://'+ipAddresses+'/xlyReport"',
... ...
src/views/bigscreenDesigner/designer/index.vue
... ... @@ -131,6 +131,7 @@
131 131 :headers="headers"
132 132 accept=".zip"
133 133 :on-success="handleUpload"
  134 + :before-upload="beforeUpload"
134 135 :on-error="handleError"
135 136 :show-file-list="false"
136 137 :limit="1"
... ... @@ -140,34 +141,42 @@
140 141 </el-tooltip>
141 142 </span>
142 143 <span class="btn border-left" v-permission="'bigScreenManage:import'">
143   - <ul class="nav">
144   - <li>
145   - <i class="iconfont icondaochu"></i
146   - ><i class="el-icon-arrow-down"></i>
147   - <ul>
148   - <li>
149   - <el-tooltip
150   - class="item"
151   - effect="dark"
152   - content="适合当前系统"
153   - placement="right"
154   - >
155   - <div @click="exportDashboard(1)">导出(包含数据集)</div>
156   - </el-tooltip>
157   - </li>
158   - <li>
159   - <el-tooltip
160   - class="item"
161   - effect="dark"
162   - content="适合跨系统"
163   - placement="right"
164   - >
165   - <div @click="exportDashboard(0)">导出(不包含数据集)</div>
166   - </el-tooltip>
167   - </li>
168   - </ul>
169   - </li>
170   - </ul>
  144 + <i class="iconfont icondaochu" @click="exportDashboard(1)"></i>
  145 + <el-tooltip
  146 + class="item"
  147 + effect="dark"
  148 + content="导出"
  149 + placement="right"
  150 + >
  151 + </el-tooltip>
  152 +<!-- <ul class="nav">-->
  153 +<!-- <li>-->
  154 +<!-- <i class="iconfont icondaochu"></i-->
  155 +<!-- ><i class="el-icon-arrow-down"></i>-->
  156 +<!-- <ul>-->
  157 +<!-- <li>-->
  158 +<!-- <el-tooltip-->
  159 +<!-- class="item"-->
  160 +<!-- effect="dark"-->
  161 +<!-- content="适合当前系统"-->
  162 +<!-- placement="right"-->
  163 +<!-- >-->
  164 +<!-- <div @click="exportDashboard(1)">导出(包含数据集)</div>-->
  165 +<!-- </el-tooltip>-->
  166 +<!-- </li>-->
  167 +<!-- <li>-->
  168 +<!-- <el-tooltip-->
  169 +<!-- class="item"-->
  170 +<!-- effect="dark"-->
  171 +<!-- content="适合跨系统"-->
  172 +<!-- placement="right"-->
  173 +<!-- >-->
  174 +<!-- <div @click="exportDashboard(0)">导出(不包含数据集)</div>-->
  175 +<!-- </el-tooltip>-->
  176 +<!-- </li>-->
  177 +<!-- </ul>-->
  178 +<!-- </li>-->
  179 +<!-- </ul>-->
171 180 </span>
172 181 </div>
173 182 <!-- 中间设计-->
... ... @@ -301,7 +310,6 @@
301 310 import {
302 311 insertDashboard,
303 312 detailDashboard,
304   - importDashboard,
305 313 exportDashboard,
306 314 } from "@/api/bigscreen";
307 315 import { widgetTools, getToolByCode } from "./tools/index";
... ... @@ -319,7 +327,6 @@ import { debounce } from &#39;@/utils/debounce&#39;; // 引入防抖函数
319 327 import loadingViewerVue from 'loading-view-vue'
320 328 import Vue from "vue";
321 329 Vue.use(loadingViewerVue,{mode:"5"});
322   -
323 330 export default {
324 331 name: "Login",
325 332 components: {
... ... @@ -331,7 +338,7 @@ export default {
331 338 },
332 339 data() {
333 340 return {
334   - uploadUrl:process.env.BASE_API +"/reportDashboard/import/" +this.$route.query.reportCode,
  341 + uploadUrl :"http://"+window.location.host+"/xlyReport/reportDashboard/import/" +this.$route.query.reportCode,
335 342 grade: false,
336 343 layerWidget: [],
337 344 widgetTools: widgetTools, // 左侧工具栏的组件图标,将js变量加入到当前作用域
... ... @@ -717,11 +724,11 @@ export default {
717 724 // 导出
718 725 async exportDashboard(val) {
719 726 const fileName = this.$route.query.reportCode + ".zip";
720   -
721 727 const param = {
722 728 reportCode: this.$route.query.reportCode,
723 729 showDataSet: val,
724 730 };
  731 + this.$showLoading();
725 732 exportDashboard(param).then((res) => {
726 733 const that = this;
727 734 const type = res.type;
... ... @@ -734,8 +741,8 @@ export default {
734 741 };
735 742 return;
736 743 }
737   -
738 744 const blob = new Blob([res], { type: "application/octet-stream" });
  745 + this.$hideLoading();
739 746 if (window.navigator.msSaveOrOpenBlob) {
740 747 //msSaveOrOpenBlob方法返回bool值
741 748 navigator.msSaveBlob(blob, fileName); //本地保存
... ... @@ -748,12 +755,17 @@ export default {
748 755 }
749 756 });
750 757 },
  758 + //上传之前
  759 + beforeUpload(){
  760 + this.$showLoading();
  761 + },
751 762 // 上传成功的回调
752 763 handleUpload(response, file, fileList) {
753 764 //清除el-upload组件中的文件
754 765 this.$refs.upload.clearFiles();
755 766 //刷新大屏页面
756 767 this.initEchartData();
  768 + this.$hideLoading();
757 769 if (response.code == "200") {
758 770 this.$message({
759 771 message: "导入成功!",
... ... @@ -767,6 +779,7 @@ export default {
767 779 }
768 780 },
769 781 handleError(err) {
  782 + this.$hideLoading();
770 783 this.$message({
771 784 message: "上传失败!",
772 785 type: "error",
... ... @@ -941,6 +954,8 @@ export default {
941 954 this.widgetOptions = this.deepClone(this.widgets[obj.index]["options"]);
942 955 },
943 956 widgetsClick(index) {
  957 + console.log("222222",process);
  958 + console.log("222222",window.location.host,reurl);
944 959 const draggableArr = this.$refs.widgets;
945 960 //判断是否按住了shift键盘
946 961 if(this.shiftEnt){
... ...