蒋珅 hace 1 año
padre
commit
38f2d80a32

+ 1 - 0
components.d.ts

@@ -51,6 +51,7 @@ declare module '@vue/runtime-core' {
     ElTabPane: typeof import('element-plus/es')['ElTabPane']
     ElTabs: typeof import('element-plus/es')['ElTabs']
     ElTree: typeof import('element-plus/es')['ElTree']
+    ElUpload: typeof import('element-plus/es')['ElUpload']
     Excel: typeof import('./src/components/excel.vue')['default']
     Header: typeof import('./src/components/Header.vue')['default']
     HealthBarLineChart: typeof import('./src/components/chart/combination/health-bar-line-chart.vue')['default']

+ 2 - 9
src/api/axios.js

@@ -1,11 +1,4 @@
-/*
- * @Author: 蒋珅 11455645+jiang-shena@user.noreply.gitee.com
- * @Date: 2023-06-12 14:02:04
- * @LastEditors: 蒋珅 11455645+jiang-shena@user.noreply.gitee.com
- * @LastEditTime: 2023-06-12 14:45:11
- * @FilePath: \PowerAnalysis\src\api\axios.js
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
+
 import axios from 'axios';
 import { ElMessage, ElMessageBox, ElLoading } from 'element-plus';
 import { nextTick } from "vue";
@@ -16,7 +9,7 @@ var loading = null;
 const service = axios.create({
     baseURL: baseURL,
     timeout: 200000,
-    headers: { 'Content-Type': 'application/json' },
+    headers: { 'Content-Type': 'application/json'},
     transformResponse: [
         function (data) {
             const json = JSONBIG({

+ 4 - 11
src/api/config.js

@@ -1,17 +1,10 @@
-/*
- * @Author: 蒋珅 11455645+jiang-shena@user.noreply.gitee.com
- * @Date: 2023-06-12 14:02:04
- * @LastEditors: 蒋珅 11455645+jiang-shena@user.noreply.gitee.com
- * @LastEditTime: 2023-06-13 16:27:08
- * @FilePath: \PowerAnalysis\src\api\config.js
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
+
 const config = {
     // baseURL: 'http://120.46.148.180:9002',
     // socketURL: 'ws://120.46.148.180:9002'
-    baseURL: 'http://192.168.1.67:9002',
-    socketURL: 'ws://192.168.1.67:9002'
-    // baseURL: 'http://192.168.10.7:9002',
+    // baseURL: 'http://192.168.1.67:9002',
+    baseURL: 'http://192.168.10.7:9002',
+    socketURL: 'ws://192.168.1.67:9002' 
     // socketURL: 'ws://192.168.10.7:9002'
 }
 

+ 0 - 397
src/pages/dataAnalysis/bladeAnalysis/components/barChart.json

@@ -1,397 +0,0 @@
-
-{
-	"color": [
-			"#db60c8",
-			"#c12e34",
-			"#e6b600d9",
-			"#0098d9",
-			"#465a83",
-			"#005eaa",
-			"#cda819",
-			"#32a487"
-	],
-	"backgroundColor": "rgba(0,0,0,0)",
-	"textStyle": {},
-	"title": {
-			"textStyle": {
-					"color": "#000"
-			},
-			"subtextStyle": {
-					"color": "#000"
-			}
-	},
-	"line": {
-			"itemStyle": {
-					"borderWidth": 1
-			},
-			"lineStyle": {
-					"width": 2
-			},
-			"symbolSize": 4,
-			"symbol": "emptyCircle",
-			"smooth": false
-	},
-	"radar": {
-			"itemStyle": {
-					"borderWidth": 1
-			},
-			"lineStyle": {
-					"width": 2
-			},
-			"symbolSize": 4,
-			"symbol": "emptyCircle",
-			"smooth": false
-	},
-	"bar": {
-			"itemStyle": {
-					"barBorderWidth": 0,
-					"barBorderColor": "#ccc"
-			},
-			"barMaxWidth": 50
-	},
-	"pie": {
-			"itemStyle": {
-					"borderWidth": 0,
-					"borderColor": "#ccc"
-			}
-	},
-	"scatter": {
-			"itemStyle": {
-					"borderWidth": 0,
-					"borderColor": "#ccc"
-			}
-	},
-	"boxplot": {
-			"itemStyle": {
-					"borderWidth": 0,
-					"borderColor": "#ccc"
-			}
-	},
-	"parallel": {
-			"itemStyle": {
-					"borderWidth": 0,
-					"borderColor": "#ccc"
-			}
-	},
-	"sankey": {
-			"itemStyle": {
-					"borderWidth": 0,
-					"borderColor": "#ccc"
-			}
-	},
-	"funnel": {
-			"itemStyle": {
-					"borderWidth": 0,
-					"borderColor": "#ccc"
-			}
-	},
-	"gauge": {
-			"itemStyle": {
-					"borderWidth": 0,
-					"borderColor": "#ccc"
-			}
-	},
-	"candlestick": {
-			"itemStyle": {
-					"color": "#c12e34",
-					"color0": "#2b821d",
-					"borderColor": "#c12e34",
-					"borderColor0": "#2b821d",
-					"borderWidth": 1
-			}
-	},
-	"graph": {
-			"itemStyle": {
-					"borderWidth": 0,
-					"borderColor": "#ccc"
-			},
-			"lineStyle": {
-					"width": 1,
-					"color": "#aaaaaa"
-			},
-			"symbolSize": 4,
-			"symbol": "emptyCircle",
-			"smooth": false,
-			"color": [
-					"#c12e34",
-					"#e6b600",
-					"#0098d9",
-					"#50ec39",
-					"#005eaa",
-					"#339ca8",
-					"#cda819",
-					"#32a487"
-			],
-			"label": {
-					"color": "#eeeeee"
-			}
-	},
-	"map": {
-			"itemStyle": {
-					"areaColor": "#ddd",
-					"borderColor": "#eee",
-					"borderWidth": 0.5
-			},
-			"label": {
-					"color": "#c12e34"
-			},
-			"emphasis": {
-					"itemStyle": {
-							"areaColor": "#e6b600",
-							"borderColor": "#ddd",
-							"borderWidth": 1
-					},
-					"label": {
-							"color": "#c12e34"
-					}
-			}
-	},
-	"geo": {
-			"itemStyle": {
-					"areaColor": "#ddd",
-					"borderColor": "#eee",
-					"borderWidth": 0.5
-			},
-			"label": {
-					"color": "#c12e34"
-			},
-			"emphasis": {
-					"itemStyle": {
-							"areaColor": "#e6b600",
-							"borderColor": "#ddd",
-							"borderWidth": 1
-					},
-					"label": {
-							"color": "#c12e34"
-					}
-			}
-	},
-	"categoryAxis": {
-			"axisLine": {
-					"show": true,
-					"lineStyle": {
-							"color": "#838383"
-					}
-			},
-			"axisTick": {
-					"show": true,
-					"lineStyle": {
-							"color": "#838383"
-					}
-			},
-			"axisLabel": {
-					"show": true,
-					"color": "#838383"
-			},
-			"splitLine": {
-					"show": false,
-					"lineStyle": {
-							"color": [
-									"#ccc"
-							]
-					}
-			},
-			"splitArea": {
-					"show": false,
-					"areaStyle": {
-							"color": [
-									"rgba(250,250,250,0.3)",
-									"rgba(200,200,200,0.3)"
-							]
-					}
-			}
-	},
-	"valueAxis": {
-			"axisLine": {
-					"show": true,
-					"lineStyle": {
-							"color": "#838383"
-					}
-			},
-			"axisTick": {
-					"show": true,
-					"lineStyle": {
-							"color": "#838383"
-					}
-			},
-			"axisLabel": {
-					"show": true,
-					"color": "#838383"
-			},
-			"splitLine": {
-					"show": true,
-					"lineStyle": {
-							"color": [
-									"#ccc"
-							]
-					}
-			},
-			"splitArea": {
-					"show": false,
-					"areaStyle": {
-							"color": [
-									"rgba(250,250,250,0.3)",
-									"rgba(200,200,200,0.3)"
-							]
-					}
-			}
-	},
-	"logAxis": {
-			"axisLine": {
-					"show": true,
-					"lineStyle": {
-							"color": "#838383"
-					}
-			},
-			"axisTick": {
-					"show": true,
-					"lineStyle": {
-							"color": "#838383"
-					}
-			},
-			"axisLabel": {
-					"show": true,
-					"color": "#838383"
-			},
-			"splitLine": {
-					"show": true,
-					"lineStyle": {
-							"color": [
-									"#ccc"
-							]
-					}
-			},
-			"splitArea": {
-					"show": false,
-					"areaStyle": {
-							"color": [
-									"rgba(250,250,250,0.3)",
-									"rgba(200,200,200,0.3)"
-							]
-					}
-			}
-	},
-	"timeAxis": {
-			"axisLine": {
-					"show": true,
-					"lineStyle": {
-							"color": "#838383"
-					}
-			},
-			"axisTick": {
-					"show": true,
-					"lineStyle": {
-							"color": "#838383"
-					}
-			},
-			"axisLabel": {
-					"show": true,
-					"color": "#838383"
-			},
-			"splitLine": {
-					"show": true,
-					"lineStyle": {
-							"color": [
-									"#ccc"
-							]
-					}
-			},
-			"splitArea": {
-					"show": false,
-					"areaStyle": {
-							"color": [
-									"rgba(250,250,250,0.3)",
-									"rgba(200,200,200,0.3)"
-							]
-					}
-			}
-	},
-	"toolbox": {
-			"iconStyle": {
-					"borderColor": "#06467c"
-			},
-			"emphasis": {
-					"iconStyle": {
-							"borderColor": "#4187c2"
-					}
-			}
-	},
-	"legend": {
-			"textStyle": {
-					"color": "#838383"
-			}
-	},
-	"tooltip": {
-			"axisPointer": {
-					"lineStyle": {
-							"color": "#cccccc",
-							"width": 1
-					},
-					"crossStyle": {
-							"color": "#cccccc",
-							"width": 1
-					}
-			}
-	},
-	"timeline": {
-			"lineStyle": {
-					"color": "#005eaa",
-					"width": 1
-			},
-			"itemStyle": {
-					"color": "#005eaa",
-					"borderWidth": 1
-			},
-			"controlStyle": {
-					"color": "#005eaa",
-					"borderColor": "#005eaa",
-					"borderWidth": 0.5
-			},
-			"checkpointStyle": {
-					"color": "#005eaa",
-					"borderColor": "#316bc2"
-			},
-			"label": {
-					"color": "#005eaa"
-			},
-			"emphasis": {
-					"itemStyle": {
-							"color": "#005eaa"
-					},
-					"controlStyle": {
-							"color": "#005eaa",
-							"borderColor": "#005eaa",
-							"borderWidth": 0.5
-					},
-					"label": {
-							"color": "#005eaa"
-					}
-			}
-	},
-	"visualMap": {
-			"color": [
-					"#1790cf",
-					"#a2d4e6"
-			]
-	},
-	"dataZoom": {
-			"backgroundColor": "rgba(47,69,84,0)",
-			"dataBackgroundColor": "rgba(47,69,84,0.3)",
-			"fillerColor": "rgba(167,183,204,0.4)",
-			"handleColor": "#a7b7cc",
-			"handleSize": "100%",
-			"textStyle": {
-					"color": "#838383B3B3B3"
-			}
-	},
-	"markPoint": {
-			"label": {
-					"color": "#eeeeee"
-			},
-			"emphasis": {
-					"label": {
-							"color": "#eeeeee"
-					}
-			}
-	}
-}

+ 0 - 199
src/pages/dataAnalysis/bladeAnalysis/components/barChart.vue

@@ -1,199 +0,0 @@
-<script setup>
-import util from "@tools/util";
-import chartTheme from './barChart.json'
-import { ref, toRaw, computed, onMounted, watch, nextTick } from 'vue';
-import {useStore} from 'vuex'
-import * as echarts from 'echarts'
-const chartId = 'chart-' + util.newGUID(); //chartId
-const chartIns = ref(null)  //chart 实例
-const emits = defineEmits(['getSelected'])
-const props = defineProps({
-	xAxis: {
-		type: Object,
-		required: true,
-		default: () => ({})
-	},
-	yAxis: {
-		type: Array,
-		required: false
-	},
-	series: {
-		type: Array,
-		required: true
-	},
-	dataset: {
-		type: Array,
-		required: false,
-		default: () => ([])
-	},
-	height: {
-		type: String,
-		required: false,
-		default: '500px'
-	},
-	width: {
-		type: String,
-		required: false,
-		default: '500px'
-	},
-	title: {
-		type: String,
-		required: false
-	},
-	subtext: {
-		type: String,
-		required: false
-	},
-	brush: {
-		type: Boolean,
-		required: false,
-		default: false
-	}
-})
-
-/**定义option */
-const option = computed({
-	get() {
-		return {
-			color:[
-				"rgb(54,90,176)",
-				"rgb(54,90,176)",
-				"#626c91",
-				"#a0a7e6",
-				"#c4ebad",
-				"#96dee8"
-			],
-			title: {
-				text: props.title || '',
-				subtext: props.subtext || '',
-				top: -6,
-				right: 360,
-			},
-			xAxis: props.xAxis || {},
-			yAxis: props.yAxis || {},
-			brush: {
-				seriesIndex: [1],
-				yAxisIndex: 0,
-				transformable: true,
-				throttleType: "debounce",
-				throttleDelay: 1000,
-				removeOnClick: true,
-				brushType: props.brush? "polygon" : false,
-				brushMode: "multiple",
-				brushStyle: {
-				borderWidth: 1,
-				borderColor: "#ff2424",
-          	},
-        },
-			toolbox:{
-				show: props.brush,
-			},
-			tooltip: {
-				confine: true,
-				trigger: "axis",
-			},
-			dataset: props.dataset || [],
-			series: props.series || [],
-			legend: {
-				right: "120",
-				top: "5",
-				itemWidth: 6,
-			},
-			grid: {
-				top: 80,
-				left: 40,
-				right: 40,
-				bottom: 40,
-			},
-			dataZoom: [
-				{
-					type: "inside", //图表下方的伸缩条
-					show: false, //是否显示
-					realtime: true, //拖动时,是否实时更新系列的视图
-					start: 0, //伸缩条开始位置(1-100),可以随时更改
-					end: 100, //伸缩条结束位置(1-100),可以随时更改
-				},
-				{
-					type: "slider", //图表下方的伸缩条
-					show: false, //是否显示
-					realtime: true, //拖动时,是否实时更新系列的视图
-					start: 0, //伸缩条开始位置(1-100),可以随时更改
-					end: 100, //伸缩条结束位置(1-100),可以随时更改
-				},
-       	   ],
-		}  
-	},
-	set(val) { }
-})
-watch(() => option, (newVal, oldVal) => {
-	if (chartIns.value) {
-		const echartIns = toRaw(chartIns.value)
-		echartIns.setOption(toRaw(newVal.value))
-	}
-}, { deep: true })
-
-watch([() => props.width, () => props.height],(newVal, oldVal) => {
-	if(chartIns.value){
-		const echartIns = toRaw(chartIns.value)
-		nextTick(() => echartIns.resize())
-	}
-})
-const store = useStore()
-const collapse = computed({
-	get(){
-		return store.state.collapse
-	},
-	set(val){}
-})
-watch(collapse, (val) => {
-	if(chartIns.value){
-		setTimeout(() => {
-			chartIns.value?.resize()
-		},300)
-	}
-})
-const funBrushChange = (flag) => {
-	const echartIns = toRaw(chartIns.value)
-	echartIns.dispatchAction({
-			type: "takeGlobalCursor",
-			// 如果想变为“可刷选状态”,必须设置。不设置则会关闭“可刷选状态”。
-			key: "brush",
-			brushOption: {
-				seriesIndex: [1],
-				yAxisIndex: 0,
-				transformable: true,
-				throttleType: "debounce",
-				throttleDelay: 1000,
-				removeOnClick: true,
-				brushType: flag? "polygon" : false,
-				brushMode: "multiple",
-				brushStyle: {
-					borderWidth: 1,
-					color: "rgba(255,36,36,0.2)",
-					borderColor: "#ff2424",
-				},
-			},
-		});
-	echartIns.off("brushSelected");
-	echartIns.on("brushSelected", (params) => {
-		emits("getSelected", params.batch || []);
-	});
-}
-watch(() => props.brush, (newVal, oldVal) => funBrushChange(newVal))
-
-onMounted(() => {
-	nextTick(() => {
-		echarts.registerTheme('chartTheme', chartTheme)
-		const echartIns =	echarts.init(document.getElementById(chartId),'chartTheme') 
-		chartIns.value = echartIns
-		echartIns.setOption(option.value)
-		funBrushChange(props.brush)
-		window.addEventListener('resize', () => {
-			echartIns.resize()
-		})
-	})
-})
-</script>
-<template>
-	<div :id="chartId" :style="{ height: props.height, width: props.width }"></div>
-</template>

+ 0 - 29
src/pages/dataAnalysis/bladeAnalysis/components/search.vue

@@ -1,29 +0,0 @@
-<script setup name="search">
-import SubmitBtn from '@com/SubmitBtn.vue'
-import { onMounted, reactive, ref } from 'vue'
-
-const queryForm = reactive({
-	mode: 0
-})
-/**执行 */
-const emits = defineEmits(['submit'])
-const funSubmit = async () => {
-	emits('submit', queryForm)
-}
-</script>
-<template>
-	<div class="pl-[20px] flex items-center h-[80px] relative">
-		<div class="absolute top-[-7px] left-[20px] text-[#838383] text-[14px]">操作面板</div>
-		<el-form class="whitespace-nowrap" :inline="true" :model="queryForm">
-			<el-form-item label="合并方式" class="!mb-0">
-				<el-select v-model="queryForm.mode">
-					<el-option :value="0" label="多表单台"></el-option>
-					<el-option :value="1" label="单表多台"></el-option>
-				</el-select>
-			</el-form-item>
-			<el-form-item class="!mb-0">
-				<submit-btn v-prevdbclick:5000="funSubmit" desc="执行"></submit-btn>
-			</el-form-item>
-		</el-form>
-	</div>
-</template>

+ 136 - 1
src/pages/dataFilter/prepare/components/search.vue

@@ -69,7 +69,77 @@ const funSubmit = async () => {
 	}
 	emits('submit', query)
 }
-/**created */
+const dialogFormVisible = ref(false)
+const formLabelWidth = '140px'
+
+const form = reactive({
+  name: '',
+  region: '',
+  value1:"",
+  value2:"",
+  
+})
+
+const BeginChange = (val) => {
+  form.value1 = val;
+};
+const BeginChange1 = (val) => {
+  form.value2 = val;
+};
+
+//存储文件变量
+let fileUplod = ref([]);
+function changeUpload(UploadFile, uploadFiles) {
+  fileUplod.value.push(UploadFile) 
+ console.log("228", fileUplod.value);
+
+}
+
+const addok = async (params) => {
+	dialogFormVisible.value = false
+	  let formData =new FormData()
+	  if (fileUplod.value.length>0) {
+                fileUplod.value.forEach(item =>{
+                    formData.append('files', item.raw)
+                })
+            }
+//   formData.append("files",'files')
+  console.log(formData);
+	const res = await request({
+		url:`/power/prepare/import?station=${form.name}&interval=${form.region}&st=${new Date(form.value1).getTime()}&et=${new Date(form.value2).getTime()}`,
+		method:"post",
+		headers: { 'Content-Type': 'multipart/form-data'},
+		mimeType:"multipart/form-data",
+		files:formData
+		 })
+	if (res.code === 200) {
+		ElMessage.success(res.msg)
+	}
+}
+
+
+const getTime1 = (val) => {
+  //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
+  var date = new Date();
+  var year = date.getFullYear(),
+    month = date.getMonth() + 1,
+    day = date.getDate();
+  month >= 1 && month <= 9 ? (month = "0" + month) : "";
+  day >= 0 && day <= 9 ? (day = "0" + day) : "";
+  var begin = year + "-" + month+ "-" +day;
+  var end = year + "-" + month+ "-" +day;
+  if (val == 1) {
+    return begin;
+  } else if (val == 2) {
+    return end;
+  }
+};
+
+onMounted(() => {
+  form.value1 = getTime1(1);
+  form.value2 = getTime1(2);
+   
+});
 funGetStation()
 </script>
 <template>
@@ -104,6 +174,71 @@ funGetStation()
 			<el-form-item class="!mb-0">
 				<submit-btn v-prevdbclick:5000="funSubmit" desc="执行"></submit-btn>
 			</el-form-item>
+			<el-form-item class="!mb-0">
+				<el-button type="primary" @click="dialogFormVisible = true">导入</el-button>
+			</el-form-item>
 		</el-form>
 	</div>
+	<div>
+		<el-dialog v-model="dialogFormVisible" title="导入">
+    <el-form :model="form">
+      <el-form-item label="场站" :label-width="formLabelWidth">
+        <el-input v-model="form.name" autocomplete="off" />
+      </el-form-item>
+      <el-form-item label="等间隔" :label-width="formLabelWidth">
+        <el-select v-model="form.region" placeholder="">
+          <el-option label="一秒钟" value="1" />
+          <el-option label="一分钟" value="60" />
+		  <el-option label="十分钟" value="600" />
+		  <el-option label="十五分钟" value="900" />
+        </el-select>
+      </el-form-item>
+	  <el-form-item label="时间" class="!ml-20" >
+          <el-date-picker
+            v-model="form.value1"
+            @change="BeginChange(form.value1)"
+            type="datetime"
+            value-format="YYYY/MM/DD hh:mm:ss"
+            placeholder="选择日期"
+          >
+          </el-date-picker>
+        </el-form-item>
+		 <el-form-item label="时间" class="!ml-20" >
+          <el-date-picker
+            v-model="form.value2"
+            @change="BeginChange1(form.value2)"
+            type="datetime"
+            value-format="YYYY/MM/DD hh:mm:ss"
+            placeholder="选择日期"
+          >
+          </el-date-picker>
+        </el-form-item>
+       
+    </el-form>
+	 
+    <el-upload  
+        class="upload-demo"
+        action="#"
+        :limit="3"
+        :on-change="changeUpload"
+        name="fileData"
+        :on-exceed="handleExceed"
+        :before-upload="beforeUpload"
+        :auto-upload="false"
+      >
+        <template #trigger >
+          <el-button type="primary" class="mt-2.5" >选择文件</el-button>
+        </template>
+      </el-upload>
+     
+    <template #footer>
+      <span class="dialog-footer">
+        <el-button @click="dialogFormVisible = false">取消</el-button>
+        <el-button type="primary" @click="addok">
+          确认
+        </el-button>
+      </span>
+    </template>
+  </el-dialog>
+	</div>
 </template>