zhaoyun 1 месяц назад
Родитель
Сommit
aa9a5b8f32

+ 24 - 9
src/views/modules/load-data/index.vue

@@ -369,16 +369,31 @@
 				// this.layouts = arr.join()
 				// this.contents.pageEachNum = 10
 			},
-		 downloadTemplate() {
-			  const link = document.createElement('a');
-			  link.href = './voltageLoad_template.xlsx';
-			  link.download = 'voltageLoad_template.xlsx';
-			  document.body.appendChild(link);
-			  link.click();
-			  document.body.removeChild(link);
-			},
+		 // downloadTemplate() {
+			//   const link = document.createElement('a');
+			//   link.href = './voltageLoad_template.xlsx';
+			//   link.download = 'voltageLoad_template.xlsx';
+			//   document.body.appendChild(link);
+			//   link.click();
+			//   document.body.removeChild(link);
+			// },
 	
-			
+			downloadTemplate(){
+				this.$http({
+				  url: '/voltageLoad/exportTemplate',
+				  method: 'get',
+				  responseType: 'blob',
+				}).then(({ data }) => {
+				  const blob = new Blob([data], { type: 'application/vnd.ms-excel' });
+				  const fileName = '变电站数据导入模板.xlsx';
+				  const a = document.createElement('a');
+				  a.href = URL.createObjectURL(blob);
+				  a.download = fileName;
+				  a.click();
+				  URL.revokeObjectURL(a.href);
+				  //this.$message.success('导出成功');
+				});
+			},
 			// 统计接口
 			chartDialog5() {
 				this.chartVisiable5 = !this.chartVisiable5;

BIN
src/views/modules/load-data/voltageLoad_template.xlsx


+ 6 - 6
src/views/modules/load-forecasting-v2/index.vue

@@ -261,9 +261,9 @@
             </template>
           </el-table-column>
           <!-- <el-table-column :resizable="true" :sortable="true" prop="recordDate" label="预测方法" /> -->
-          <el-table-column :resizable="true" :sortable="true" prop="temperatures" label="预测参数">
+          <el-table-column :resizable="true" :sortable="true" prop="temperatures" label="预测参数" width="150">
             <template slot-scope="scope">
-              {{ '温度范围:' + scope.row.minTemperatures + '℃ - ' + scope.row.maxTemperatures + '℃' }}
+              {{ '温度:' + scope.row.minTemperatures + '℃ - ' + scope.row.maxTemperatures + '℃' }}
             </template>
           </el-table-column>
           <el-table-column :resizable="true" :sortable="true" prop="dimension" label="时间维度">
@@ -279,17 +279,17 @@
             </template>
           </el-table-column>
           <!-- <el-table-column :resizable="true" :sortable="true" prop="userCount" label="当前用户数量" /> -->
-          <el-table-column :resizable="true" :sortable="true" prop="result" label="预测结果">
+          <el-table-column :resizable="true" :sortable="true" prop="result" label="预测状态">
             <template slot-scope="scope">
-              {{ scope.row.result == '0' ? '待预测' : scope.row.result == '1' ? '成' : '失败' }}
+              {{ scope.row.result == '0' ? '待预测' : scope.row.result == '1' ? '预测完成' : '预测失败' }}
             </template>
           </el-table-column>
-          <el-table-column :resizable="true" :sortable="true" prop="execTime" label="执行时间">
+          <el-table-column :resizable="true" :sortable="true" prop="execTime" label="执行时间" width="150">
             <template slot-scope="scope">
               {{ scope.row.execTime == null ? '---' : scope.row.execTime }}
             </template>
           </el-table-column>
-          <el-table-column :resizable="true" :sortable="true" prop="createTime" label="添加时间" />
+          <el-table-column :resizable="true" :sortable="true" prop="createTime" label="添加时间" width="150"/>
           <el-table-column width="270" label="操作">
             <template slot-scope="scope">
               <el-button class="view" type="success" @click="handleForecastingDetail(scope.row)">

+ 22 - 0
src/views/modules/station/list.vue

@@ -35,6 +35,12 @@
 						<span class="icon iconfont icon-xihuan" :style='{"margin":"0 2px","fontSize":"14px","color":"#fff","display":"none","height":"34px"}'></span>
 						导入
 					</el-button>
+					
+					<el-button class="btn18"  type="success" @click="downloadTemplate()">
+						<span class="icon iconfont icon-xihuan" :style='{"margin":"0 2px","fontSize":"14px","color":"#fff","display":"none","height":"34px"}'></span>
+						下载模板
+					</el-button>
+					
 				</el-row>
 			</el-form>
 			<div :style='{"border":"0px solid #fff","width":"100%","padding":"0 20px 20px","fontSize":"14px","color":"#000","background":"#fff"}'>
@@ -426,6 +432,22 @@
 				this.importUrl = ''
 				this.importVisiable = !this.importVisiable;
 			},
+			downloadTemplate(){
+				this.$http({
+				  url: '/substation/exportTemplate',
+				  method: 'get',
+				  responseType: 'blob',
+				}).then(({ data }) => {
+				  const blob = new Blob([data], { type: 'application/vnd.ms-excel' });
+				  const fileName = '变电站模板.xlsx';
+				  const a = document.createElement('a');
+				  a.href = URL.createObjectURL(blob);
+				  a.download = fileName;
+				  a.click();
+				  URL.revokeObjectURL(a.href);
+				  //this.$message.success('导出成功');
+				});
+			},
 			// 下载
 			download(file){
 				let arr = file.replace(new RegExp('upload/', "g"), "")

+ 21 - 1
src/views/modules/weather/list.vue

@@ -32,9 +32,13 @@
 						<span class="icon iconfont icon-xihuan" :style='{"margin":"0 2px","fontSize":"14px","color":"#fff","display":"none","height":"34px"}'></span>
 						导入
 					</el-button>
-					<el-button class="btn18"  type="success" @click="chartDialog5()">
+					<!-- <el-button class="btn18"  type="success" @click="chartDialog5()">
 						<span class="icon iconfont icon-xihuan" :style='{"margin":"0 2px","fontSize":"14px","color":"#fff","display":"none","height":"34px"}'></span>
 						温度统计
+					</el-button> -->
+					<el-button class="btn18"  type="success" @click="downloadTemplate()">
+						<span class="icon iconfont icon-xihuan" :style='{"margin":"0 2px","fontSize":"14px","color":"#fff","display":"none","height":"34px"}'></span>
+						下载模板
 					</el-button>
 				</el-row>
 			</el-form>
@@ -424,6 +428,22 @@
 					})
 				})
 			},
+			downloadTemplate(){
+				this.$http({
+				  url: '/regionWeather/exportTemplate',
+				  method: 'get',
+				  responseType: 'blob',
+				}).then(({ data }) => {
+				  const blob = new Blob([data], { type: 'application/vnd.ms-excel' });
+				  const fileName = '地区天气数据模板.xlsx';
+				  const a = document.createElement('a');
+				  a.href = URL.createObjectURL(blob);
+				  a.download = fileName;
+				  a.click();
+				  URL.revokeObjectURL(a.href);
+				  //this.$message.success('导出成功');
+				});
+			},
 			// 删除
 			async deleteHandler(id ) {
 				var ids = id? [Number(id)]: this.dataListSelections.map(item => {