Browse Source

Merge branch 'main' of http://124.70.43.205:3000/xufenqi/PowerAnalysis into main

chenminghua 2 years ago
parent
commit
ffbe5ad255

+ 1 - 1
src/api/axios.js

@@ -62,7 +62,7 @@ service.interceptors.response.use(
             window.location.href = '/'; // 去登录页
             ElMessage.error(res.msg)
         } else {
-            if(response.status === 200 && res.code !== 200){
+            if(response.status === 200 && res.code &&  res.code !== 200){
                 ElMessage.error(res.msg)
             }
             return response.data;

+ 4 - 7
src/pages/dataAnalysis/agcAnalysis/components/current-scatter-chart.vue

@@ -214,22 +214,19 @@ export default {
         grid: {
           top: 58,
           left: 40,
-          right: 40,
+          right: 48,
           bottom: 24,
         },
         //x轴
         xAxis: [
           {
-            name: 'm/s',
+            name: '时间',
             nameTextStyle: {
               color: '#B3B3B3'
             },
-            type: "value",
+            type: "category",
             boundaryGap: false,
             data: that.xAxisData || [],
-            min: 0,
-            max: 25,
-            interval: 1,
             axisLabel: {
               formatter: "{value}",
             },
@@ -250,7 +247,7 @@ export default {
           splitLine: { show: false },
           position: 'left',
           min: 0,
-          name: 'kW',
+          name: '',
           nameTextStyle: {
             color: '#B3B3B3'
           }

+ 4 - 3
src/pages/dataAnalysis/agcAnalysis/components/search.vue

@@ -2,7 +2,7 @@
 import { onMounted, reactive, ref } from 'vue'
 import request from '@/api/axios.js'
 import SubmitBtn from '@com/SubmitBtn.vue'
-import configStationJson from './configStation.json'
+// import configStationJson from './configStation.json'
 
 const queryForm = reactive({
 	station: '',
@@ -13,8 +13,9 @@ const queryForm = reactive({
 /**场站 */
 const stationList = ref([])
 const funGetStation = async () => {
-	// const res = await request.get("/agc/config")
-	stationList.value = Object.values(configStationJson) // configStationJson
+	const res = await request.get("/agc/config")
+	// stationList.value = Object.values(configStationJson) // configStationJson
+	stationList.value = Object.values(res)
 	if (stationList.value.length) {
 		queryForm.station = stationList.value[0].id
 	}

File diff suppressed because it is too large
+ 1 - 0
src/pages/dataAnalysis/agcAnalysis/components/submitRES.json


+ 4 - 4
src/pages/dataAnalysis/agcAnalysis/components/table.vue

@@ -32,16 +32,16 @@ const funExport = () => {
 }
 const tableRef = ref('')
 const tableHeight =  computed(() => {
-  return tableRef.value.offsetHeight? tableRef.value.offsetHeight - 46 : 739
+  return tableRef.value.offsetHeight? tableRef.value.offsetHeight - 12 : 739
 })
 </script>
 <template>
   <div ref="tableRef" class="p-[10px]"
     :style="{ height: typeof props.height === 'string' ? props.height : props.height + 'px' }">
-    <div class="flex justify-between items-center pb-[10px]">
-      <h3>{{props.tableName}}</h3>
+    <!-- <div class="flex justify-between items-center pb-[10px]"> -->
+      <!-- <h3>{{props.tableName}}</h3> -->
       <!-- <el-button size="small" type="primary" @click="funExport" :disabled="!props.tableId">数据导出</el-button> -->
-    </div>
+    <!-- </div> -->
     <el-table :data="props.data"
       stripe
       size="small" v-loading="props.loading"

+ 114 - 3
src/pages/dataAnalysis/agcAnalysis/index.vue

@@ -8,6 +8,7 @@ import { onMounted, ref, onActivated } from 'vue'
 import CurrentScatterChart from './components/current-scatter-chart.vue'
 import request from '@/api/axios.js'
 import {baseURL, socketURL} from '@/api/axios.js'
+import dayjs from 'dayjs';
 /**配置参数 */
 const tableHeight = ref(window.innerHeight - 314 + 'px')
 const treeHeight = ref(window.innerHeight - 260 + 'px') //tree高度
@@ -99,9 +100,119 @@ const funChartSelect = async (batch) => {
 }
 /**submit */
 const funSubmit = async (params) => {
+	activeTab.value = '2'
+	tableShowId.value = 1
+	tableName.value = ''
+	tableLoading.value = true
 	const res = await request.get('/agc/deviate', { params: params })
-	if (res.code === 200) {
-		ElMessage.success(res.msg)
+	tableColumn.value = [
+		{
+			prop: 'ts',
+			label: '时间',
+			width: 100,
+		},
+		{
+			prop: 'ygsdxz',
+			label: '有功设定限值',
+			width: 80,
+		},
+		{
+			prop: 'sfyg',
+			label: '实发有功',
+			width: 80,
+		},
+		{
+			prop: 'llgl',
+			label: '理论功率',
+			width: 80,
+		},
+		{
+			prop: 'pcsx',
+			label: '偏差上限',
+			width: 80,
+		},
+		{
+			prop: 'pcxx',
+			label: '偏差下限',
+			width: 100,
+		},
+	]
+	const tableArr = []
+	const tsArr = []
+	const ygsdxz = []
+	const sfyg = []
+	const llgl = []
+	const pcsx = []
+	const pcxx = []
+	res[0].values.map((o, index) => {
+		tsArr.push(dayjs(o.ts).format('YYYY-MM-DD HH:mm:ss'))
+		ygsdxz.push(Number(o.value).toFixed(2))
+		sfyg.push(Number(res[1].values[index].value).toFixed(2))
+		llgl.push(Number(res[2].values[index].value).toFixed(2))
+		pcsx.push(Number(res[3].values[index].value).toFixed(2))
+		pcxx.push(Number(res[4].values[index].value).toFixed(2))
+		tableArr.push({
+			ts: dayjs(o.ts).format('YYYY-MM-DD HH:mm:ss'),
+			ygsdxz: Number(o.value).toFixed(2),
+			sfyg: Number(res[1].values[index].value).toFixed(2),
+			llgl: Number(res[2].values[index].value).toFixed(2),
+			pcsx: Number(res[3].values[index].value).toFixed(2),
+			pcxx: Number(res[4].values[index].value).toFixed(2),
+		})
+	})
+	xAxisData.value = tableArr.map(o => o.ts)
+	seriesData.value = [
+		{
+			name: "有功设定限值",
+			type: "line",
+			symbol: "line", //设定为实心点
+			symbolSize: 0, //设定实心点的大小
+			smooth: true, //这个是把线变成曲线
+			data: ygsdxz,
+			xAxisIndex: 0,
+		},
+		{
+			name: "实发有功",
+			type: "line",
+			symbol: "line", //设定为实心点
+			symbolSize: 0, //设定实心点的大小
+			smooth: true, //这个是把线变成曲线
+			data: sfyg,
+			xAxisIndex: 0,
+		},
+		{
+			name: "理论功率",
+			type: "line",
+			symbol: "line", //设定为实心点
+			symbolSize: 0, //设定实心点的大小
+			smooth: true, //这个是把线变成曲线
+			data: llgl,
+			xAxisIndex: 0,
+		},
+		{
+			name: "偏差上限",
+			type: "line",
+			symbol: "line", //设定为实心点
+			symbolSize: 0, //设定实心点的大小
+			smooth: true, //这个是把线变成曲线
+			data: pcsx,
+			xAxisIndex: 0,
+		},
+		{
+			name: "偏差下限",
+			type: "line",
+			symbol: "line", //设定为实心点
+			symbolSize: 0, //设定实心点的大小
+			smooth: true, //这个是把线变成曲线
+			data: pcxx,
+			xAxisIndex: 0,
+		},
+	]
+	tableData.value = tableArr
+	tableLoading.value = false
+
+	
+	// if (res.code === 200) {
 		// if(res.data.sjgl?.length){
 		// 	for(const wtObj of res.data.sjgl){
 		// 		seriesData.value.push(
@@ -118,7 +229,7 @@ const funSubmit = async (params) => {
 		// 		wtData.value.push(wtObj.obj)
 		// 	}
 		// }
-	}
+	// }
 }
 /**created */
 // funGetTree()

+ 5 - 5
src/pages/dataAnalysis/lineAnalysis/components/barChart.json

@@ -1,11 +1,11 @@
 
 {
 	"color": [
-			"#db60c8",
-			"#c12e34",
-			"#e6b600d9",
-			"#0098d9",
-			"#465a83",
+			"rgb(50,93,171)",
+			"rgb(222,132,82)",
+			"rgb(105,188,80)",
+			"rgb(197,78,82)",
+			"rgb(129,114,181)",
 			"#005eaa",
 			"#cda819",
 			"#32a487"

+ 8 - 6
src/pages/dataAnalysis/lineAnalysis/components/barChart.vue

@@ -55,12 +55,14 @@ const option = computed({
 	get() {
 		return {
 			color:[
-				"#FF8700",
-				"#0098d980",
-				"#626c91",
-				"#a0a7e6",
-				"#c4ebad",
-				"#96dee8"
+				"rgb(50,93,171)",
+				"rgb(222,132,82)",
+				"rgb(105,188,80)",
+				"rgb(197,78,82)",
+				"rgb(129,114,181)",
+				"#005eaa",
+				"#cda819",
+				"#32a487"
 			],
 			title: {
 				text: props.title || '',

+ 5 - 5
src/pages/dataAnalysis/lineAnalysis/index.vue

@@ -256,27 +256,27 @@ const funTimeArea = async () => {
 		if(res.code===200){
 			barxAxis.data = []
 			barSeries.value = [{
-				name: "3~5m功率",
+				name: "不运行",
 				type: "bar",
 				stack: 'a',
 				data: [],
 			},{
-				name: "5~10m功率",
+				name: "3~5m风速",
 				type: "bar",
 				stack: 'a',
 				data: [],
 			},{
-				name: "10~12m功率",
+				name: "5~10m风速",
 				type: "bar",
 				stack: 'a',
 				data: [],
 			},{
-				name: "12~25m全功率",
+				name: "10~12m风速",
 				type: "bar",
 				stack: 'a',
 				data: [],
 			},{
-				name: "不运行",
+				name: "12~25m风速",
 				type: "bar",
 				stack: 'a',
 				data: [],

+ 2 - 2
src/pages/dataAnalysis/tempAnalysis/components/barChart.json

@@ -14,10 +14,10 @@
 	"textStyle": {},
 	"title": {
 			"textStyle": {
-					"color": "#B3B3B3B3B3B3"
+					"color": "#000"
 			},
 			"subtextStyle": {
-					"color": "#aaaaaa"
+					"color": "#000"
 			}
 	},
 	"line": {

+ 1 - 1
src/pages/dataAnalysis/tempAnalysis/components/barChart.vue

@@ -55,7 +55,7 @@ const option = computed({
 	get() {
 		return {
 			color:[
-				"#FF8700",
+				"rgb(50,93,171)",
 				"#0098d980",
 				"#626c91",
 				"#a0a7e6",

+ 89 - 126
src/pages/dataAnalysis/tempAnalysis/index.vue

@@ -107,21 +107,37 @@ const funSubmit = async () => {
 			ids: excelCheckIds.value.join(','),
 		}
 	})
-	const lineRes = await request.get('/wind/deviation/ratio', {
-		params: {
-			ids: excelCheckIds.value.join(','),
-			mode: 0
-		}
-	})
+	// const lineRes = await request.get('/wind/deviation/ratio', {
+	// 	params: {
+	// 		ids: excelCheckIds.value.join(','),
+	// 		mode: 0
+	// 	}
+	// })
 	// const rosesRes = flowerRes
 	// const lineRes = lineChartRes
 	if (tempRes.code === 200) {
 		if (tempRes.data?.length) {
 			console.log(tempRes.data)
-			// for (const chart of rosesRes.data) {
-			// 	barSeries[0].data = chart.roses?.length ?chart.roses[0]: []
-			// 	chartId++
-			// }
+			for (const chart of tempRes.data) {
+				barxAxis.data = Object.keys(chart.res1)
+				barSeries[0].data = Object.values(chart.res1)
+				chartId++
+				lineSeries.value = [
+					{
+						type: 'effectScatter',
+						showEffectOn: "emphasis",
+						rippleEffect: {
+							scale: 1
+						},
+						legendHoverLink: false,
+						name: '',
+						symbolSize: 5,
+						data: chart.res2,
+						yAxisIndex: 0,
+					}
+				]
+				chartId++
+			}
 		}
 	}
 	// if(lineRes.code === 200){
@@ -159,9 +175,9 @@ const funSubmit = async () => {
 	// }
 }
 /**lineChart */
-const linexAxis = ref({
-	type: 'category',
-	data: new Array(101).fill(-50).map((o,index) => Number((o + index).toFixed(1))),
+const linexAxis = reactive({
+	type: 'value',
+	name: '°C',
 	splitLine: {
 		show: false
 	},
@@ -169,18 +185,10 @@ const linexAxis = ref({
 		show: true
 	}
 })
-const lineyAxis = ref([
+const lineyAxis = reactive([
 	{
 		type: 'value',
-		name: 'm/s',
-		splitLine: {
-		show: false
-	},
-	axisTick: {
-		show: true
-	}
-	},{
-		type: 'value',
+		name: 'kW',
 		splitLine: {
 		show: false
 	},
@@ -190,7 +198,7 @@ const lineyAxis = ref([
 	}
 ])
 const lineSeries = ref([])
-const lineDataSet = ref([
+const lineDataSet = reactive([
 	{
 		source: []
 	}
@@ -247,7 +255,7 @@ const funChartSelect = async (batch) => {
 /**barChart */
 const barxAxis = reactive({
 	type: 'category',
-	data: ['N','', 'N-E','', 'E','', 'S-E','', 'S','', 'S-W','', 'W','', 'W-N',''],
+	data: [],
 	splitLine: {
 		show: false
 	},
@@ -255,9 +263,9 @@ const barxAxis = reactive({
 		show: true
 	}
 })
-const baryAxis = ref({
+const baryAxis = reactive({
 		type: 'value',
-		name: '小时',
+		name: 'kW',
 		splitLine: {
 		show: false
 	},
@@ -266,9 +274,8 @@ const baryAxis = ref({
 	}
 })
 const barSeries = reactive([{
-	name: "3~5m功率",
+	name: "",
 	type: "bar",
-	stack: 'a',
 	data: [],
 }])
 /**dialog 数据 */
@@ -312,20 +319,20 @@ const funActCop = (obj, type) => {
 		case 'barChartCop':
 			actChartName.value = 'barChartCop'
 			obj.actCop = shallowRef(barChartCop)
-			actDiaTitle.value = '风速风向玫瑰图'
+			actDiaTitle.value = '平均功率-额定功率'
 			break
 		case 'lineChartCop':
 			actChartName.value = 'lineChartCop'
 			obj.actCop = shallowRef(lineChartCop)
-			actDiaTitle.value = '对风偏差分析图'
-			break
-		case 'CurrentScatterChartCop':
-			actChartName.value = 'CurrentScatterChartCop'
-			obj.actCop = shallowRef(CurrentScatterChartCop)
-			actDiaTitle.value = '静态偏航对风分析图'
+			actDiaTitle.value = '额定功率温度分析'
 			break
+		// case 'CurrentScatterChartCop':
+		// 	actChartName.value = 'CurrentScatterChartCop'
+		// 	obj.actCop = shallowRef(CurrentScatterChartCop)
+		// 	actDiaTitle.value = '静态偏航对风分析图'
+		// 	break
 	}
-	obj.isBrush = type === 'lineChartCop' ? true :false
+	obj.isBrush = false
 	obj.id = chartId
 	chartId ++
 	dialog.value = true
@@ -338,14 +345,14 @@ const funDiaSubmit = async () => {
 	let url = ''
 	switch(actChartName.value){
 		case 'barChartCop':
-			url = '/wind/roses'
+			url = '/temperature/rated/power'
 			break
 		case 'lineChartCop':
-			url = '/wind/deviation/ratio'
-			break
-		case 'CurrentScatterChartCop':
-			url = '' //暂无接口
+			url = '/temperature/rated/power'
 			break
+		// case 'CurrentScatterChartCop':
+		// 	url = '' //暂无接口
+		// 	break
 	}
 	if(url){
 		const res = await request.get(url, {
@@ -367,16 +374,17 @@ const funDiaSubmit = async () => {
 							isBrush: false,
 							actCop: shallowRef(barChartCop),
 							title: chart.wt,
-							subtext: '风速风向玫瑰图',
+							subtext: '平均功率-额定功率',
 							xAxis: {
-								type: 'category',
-								boundaryGap: false,
-								data: ['N','', 'N-E','', 'E','', 'S-E','', 'S','', 'S-W','', 'W','', 'W-N',''],
-								splitLine: {
-									show: true
-								},
+								...barxAxis,
+								data: Object.keys(chart.res1)
 							},
-							series: chart.roses?.length ?chart.roses[0]: []
+							yAxis: baryAxis,
+							series: [{
+								name: "",
+								type: "bar", 
+								data: Object.values(chart.res1),
+							}]
 						})
 						chartId++
 					}
@@ -385,69 +393,25 @@ const funDiaSubmit = async () => {
 							id: chartId,
 							isBrush: false,
 							actCop: shallowRef(lineChartCop),
-							title: chart.wtId,
-							subtext: '对风偏差分析图',
-							xAxis: {
-								type: 'category',
-								data: new Array(101).fill(-50).map((o,index) => Number((o + index).toFixed(1))),
-								splitLine: {
-									show: false
-								},
-								axisTick: {
-									show: true
-								}
-							},
-							yAxis: [
+							title: chart.wt,
+							subtext: '额定功率温度分析',
+							xAxis: linexAxis,
+							yAxis: lineyAxis,
+							dataset: lineDataSet,
+							series: [
 								{
-									type: 'value',
-									name: 'm/s',
-									splitLine: {
-									show: false
-								},
-								axisTick: {
-									show: true
+									type: 'effectScatter',
+									showEffectOn: "emphasis",
+									rippleEffect: {
+										scale: 1
+									},
+									legendHoverLink: false,
+									name: '',
+									symbolSize: 5,
+									data: chart.res2,
+									yAxisIndex: 0,
 								}
-								},{
-									type: 'value',
-									splitLine: {
-									show: false
-								},
-								axisTick: {
-									show: true
-								}
-								}
-							],
-							dataset: [{
-								source: chart.scatter.map(o => {
-									return [o.x+'', o.y]
-								})
-							}],
-							series: [{
-								name: "对风频次",
-								type: "line",
-								symbol: "line", //设定为实心点
-								symbolSize: 0, //设定实心点的大小
-								smooth: true, //这个是把线变成曲线
-								data: chart.count,
-								yAxisIndex: 1,
-							},
-							{
-								type: 'effectScatter',
-								showEffectOn: "emphasis",
-								
-								rippleEffect: {
-									scale: 1
-								},
-								legendHoverLink: false,
-								name: '数据散点',
-								symbolSize: 5,
-								datasetIndex: 0,
-								encode: {
-									x: 'x',
-									y: 'y'
-								},
-								yAxisIndex: 0,
-							}]
+							]
 
 						})
 						chartId++
@@ -495,9 +459,7 @@ onActivated(() => {
 </script>
 <template>
 	<div class="bg-white py-[10px] px-[10px] relative s-dialog-body">
-		<!-- <search-cop class="mb-[20px]  shadow rounded-[6px] shadow-blue-500" @submit="funSubmit">
-		</search-cop> -->
-		<el-dialog v-model="wtDialog" draggable title="风机功率点位">
+		<!-- <el-dialog v-model="wtDialog" draggable title="风机功率点位">
 			<el-tabs v-model="wtTab">
 				<el-tab-pane label="数据" name="table">
 					<el-table :data="wtData" row-key="id" :max-height="550">
@@ -514,7 +476,7 @@ onActivated(() => {
 				<el-tab-pane label="预警" name="warning" disabled>
 				</el-tab-pane>
 			</el-tabs>
-		</el-dialog>
+		</el-dialog> -->
 		<el-dialog draggable width="80%" v-model="dialog" :title="actDiaTitle">
 			<el-form class="whitespace-nowrap" :inline="true" :model="queryForm">
 				<el-form-item label="" class="!mb-0">
@@ -552,34 +514,35 @@ onActivated(() => {
 					<div :style="{ height: tableHeight }"
 						class="flex flex-wrap justify-center items-center overflow-x-hidden overflow-y-auto ">
 						<div class="mb-[10px] mr-[10px] w-[49%] h-[49%] flex flex-col items-end shadow rounded-[6px] shadow-blue-500">
-							<!-- <el-icon class="mr-[10px] mt-[10px] cursor-pointer" size="18"
+							<el-icon class="mr-[10px] mt-[10px] cursor-pointer" size="18"
 								@click="funActCop({xAxis:barxAxis, yAxis:baryAxis, series: barSeries}, 'barChartCop')">
 								<ZoomIn />
-							</el-icon> -->
-							<bar-chart-cop width="100%" height="100%" :xAxis="barxAxis" :yAxis="baryAxis" :series="barSeries"></bar-chart-cop>
+							</el-icon>
+							<bar-chart-cop width="100%" height="100%" subtext="平均功率-额定功率" :xAxis="barxAxis" :yAxis="baryAxis" :series="barSeries"></bar-chart-cop>
 						</div>
 						<div class="mb-[10px] w-[49%] h-[49%] flex flex-col items-end shadow rounded-[6px] shadow-blue-500">
-							<!-- <el-icon class="mr-[10px] mt-[10px] cursor-pointer" size="18"
-								@click="funActCop({xAxis:barxAxis, yAxis:baryAxis, series: barSeries}, 'barChartCop')">
+							<el-icon class="mr-[10px] mt-[10px] cursor-pointer" size="18"
+								@click="funActCop({xAxis:linexAxis, yAxis:lineyAxis, series: lineSeries}, 'lineChartCop')">
 								<ZoomIn />
-							</el-icon> -->
-							<bar-chart-cop width="100%" height="100%" :xAxis="barxAxis" :yAxis="baryAxis" :series="barSeries"></bar-chart-cop>
+							</el-icon>
+							<line-chart-cop class="" height="100%" width="100%" :xAxis="linexAxis" :yAxis="lineyAxis"
+								:series="lineSeries" subtext="额定功率温度分析" :dataset="lineDataSet"></line-chart-cop>
 						</div>
 						<div class="mr-[10px] w-[49%] h-[49%] flex flex-col items-end shadow rounded-[6px] shadow-blue-500" v-if="!!lineSeries.length">
 							<!-- <el-icon class="mr-[10px] mt-[10px] cursor-pointer" size="18"
 								@click="funActCop({ xAxis: linexAxis, yAxis: lineyAxis, series: lineSeries, dataset: lineDataSet }, 'lineChartCop')">
 								<ZoomIn />
 							</el-icon> -->
-							<line-chart-cop class="" height="100%" width="100%" :xAxis="linexAxis" :yAxis="lineyAxis"
-								:series="lineSeries" subtext="对风偏差分析图" :dataset="lineDataSet"></line-chart-cop>
+							<!-- <current-scatter-chart-cop class="" height="100%" width="100%" :xAxis="linexAxis" :yAxis="lineyAxis"
+								:series="lineSeries" subtext="风速功率-温度分析" :dataset="lineDataSet"></current-scatter-chart-cop> -->
 						</div>
 						<div class="w-[49%] h-[49%] flex flex-col items-end shadow rounded-[6px] shadow-blue-500" v-if="!!lineSeries.length">
 							<!-- <el-icon class="mr-[10px] mt-[10px] cursor-pointer" size="18"
 								@click="funActCop({ xAxis: xAxisData, yAxis: { splitLine: { show: false } }, series: seriesData, dataSet: dataSet }, 'CurrentScatterChartCop')">
 								<ZoomIn />
 							</el-icon> -->
-							<current-scatter-chart-cop class="" height="100%" width="100%" :xAxis="linexAxis" :yAxis="lineyAxis"
-								:series="lineSeries" subtext="对风偏差分析图" :dataset="lineDataSet"></current-scatter-chart-cop>
+							<!-- <current-scatter-chart-cop class="" height="100%" width="100%" :xAxis="linexAxis" :yAxis="lineyAxis"
+								:series="lineSeries" subtext="对风偏差分析图" :dataset="lineDataSet"></current-scatter-chart-cop> -->
 						</div>
 					</div>
 				</el-col>

+ 1 - 1
src/router/index.js

@@ -115,7 +115,7 @@ const routes = [{
                     path: '/dataAnalysis/agcAnalysis',
                     name: 'dataAnalysisAgcAnalysis',
                     meta: {
-                        title: '外部曲线分析',
+                        title: 'AGC曲线偏差分析',
                     },
                     component: () =>
                         import(