Browse Source

晋能发电场站生产实时运营管理平台APP,公司电量预测页面中24小时功率预测曲线服务联调;场站电量预测页面中本期预测电量,上期日发电量和同期日发电量服务联调,72小时风速功率曲线服务联调;公司故障分类系统页面和机型页面对故障次数进行服务联调;场站故障分类系统页面和机型页面对故障次数,五项损失进行服务联调;

SunZehao 1 year ago
parent
commit
5b602ecc48
9 changed files with 617 additions and 407 deletions
  1. 44 0
      api/power.js
  2. 37 0
      api/type.js
  3. 6 1
      manifest.json
  4. 6 6
      pages/home/index.vue
  5. 5 5
      pages/home/stationIndex.vue
  6. 197 119
      pages/power/index.vue
  7. 109 50
      pages/power/stationIndex.vue
  8. 80 100
      pages/type/index.vue
  9. 133 126
      pages/type/stationIndex.vue

+ 44 - 0
api/power.js

@@ -15,4 +15,48 @@ export function electricityStatisticsApi(params) {
 		'method': 'GET',
 		params: params
 	})
+}
+
+//获取公司电量
+export function bulletinappCompanyelectricityApi() {
+	return request({
+		url: '/bulletinapp/companyelectricity',
+		'method': 'GET'
+	})
+}
+
+//获取公司预测数据
+export function bulletinappForecastApi(params) {
+	return request({
+		url: '/bulletinapp/forecast',
+		'method': 'GET',
+		'params': params
+	})
+}
+
+//获取场站预测数据
+export function bulletinappCzforecastApi(params) {
+	return request({
+		url: '/bulletinapp/czforecast',
+		'method': 'GET',
+		'params': params
+	})
+}
+
+//获取公司预测数据--24小时功率曲线
+export function cockpitPowercurve24Api(params) {
+	return request({
+		url: '/cockpit/Powercurve24',
+		'method': 'GET',
+		'params': params
+	})
+}
+
+//获取场站预测数据--72小时风功率曲线
+export function forecastShortApi(params) {
+	return request({
+		url: '/Forecast/short',
+		'method': 'GET',
+		'params': params
+	})
 }

+ 37 - 0
api/type.js

@@ -0,0 +1,37 @@
+import request from '@/utils/request'
+
+// 获取公司系统
+export function bulletinappShutdowngsApi(params) {
+	return request({
+		url: '/bulletinapp/shutdowngs',
+		'method': 'GET',
+		params: params
+	})
+}
+
+// 获取公司机型
+export function bulletinappShutdowngsjxApi(params) {
+	return request({
+		url: '/bulletinapp/shutdowngsjx',
+		'method': 'GET',
+		params: params
+	})
+}
+
+// 获取场站系统
+export function bulletinappShutdownczApi(params) {
+	return request({
+		url: '/bulletinapp/shutdowncz',
+		'method': 'GET',
+		params: params
+	})
+}
+
+// 获取场站机型
+export function bulletinappShutdownczjxApi(params) {
+	return request({
+		url: '/bulletinapp/shutdownczjx',
+		'method': 'GET',
+		params: params
+	})
+}

+ 6 - 1
manifest.json

@@ -1,5 +1,5 @@
 {
-    "name" : "芋道移动端",
+    "name" : "晋能电力",
     "appid" : "__UNI__B5DFCD0",
     "description" : "",
     "versionName" : "1.0.0",
@@ -40,6 +40,11 @@
             },
             "sdkConfigs" : {
                 "ad" : {}
+            },
+            "icons" : {
+                "android" : {
+                    "xhdpi" : ""
+                }
             }
         }
     },

+ 6 - 6
pages/home/index.vue

@@ -381,32 +381,32 @@
 							let datas = res.data.qt
 							that.mesExData = [{
 									leftName: '容量',
-									leftValue: datas.zzjrl,
+									leftValue: Math.ceil(datas.zzjrl),
 									leftCode: '(WM)',
 								},
 								{
 									leftName: '安全天数',
-									leftValue: datas.aqts,
+									leftValue: Math.ceil(datas.aqts),
 									leftCode: '(天)',
 								},
 								{
 									leftName: '日发电量',
-									leftValue: datas.rfdl,
+									leftValue: Math.ceil(datas.rfdl),
 									leftCode: '(万kWh)'
 								},
 								{
 									leftName: '利用小时',
-									leftValue: datas.fdylyxs + datas.fdnlyxs,
+									leftValue: Math.ceil(datas.fdylyxs + datas.fdnlyxs),
 									leftCode: '(万kWh)'
 								},
 								{
 									leftName: '月发电量',
-									leftValue: datas.yfdl,
+									leftValue: Math.ceil(datas.yfdl),
 									leftCode: '(万kWh)'
 								},
 								{
 									leftName: '年发电量',
-									leftValue: datas.nfdl,
+									leftValue: Math.ceil(datas.nfdl),
 									leftCode: '(万kWh)'
 								},
 							]

+ 5 - 5
pages/home/stationIndex.vue

@@ -366,7 +366,7 @@
 						let datas = res.data.data
 						that.mesExData = [{
 								leftName: '容量',
-								leftValue: datas.zzjrl / 1000,
+								leftValue: Math.ceil(datas.zzjrl / 1000),
 								leftCode: '(WM)',
 							},
 							{
@@ -376,22 +376,22 @@
 							},
 							{
 								leftName: '日发电量',
-								leftValue: datas.rfdl,
+								leftValue: Math.ceil(datas.rfdl),
 								leftCode: '(万kWh)'
 							},
 							{
 								leftName: '利用小时',
-								leftValue: datas.ylyxs + datas.nlyxs,
+								leftValue: Math.ceil(datas.ylyxs + datas.nlyxs),
 								leftCode: '(万kWh)'
 							},
 							{
 								leftName: '月发电量',
-								leftValue: datas.yfdl,
+								leftValue: Math.ceil(datas.yfdl),
 								leftCode: '(万kWh)'
 							},
 							{
 								leftName: '年发电量',
-								leftValue: datas.nfdl,
+								leftValue: Math.ceil(datas.nfdl),
 								leftCode: '(万kWh)'
 							},
 						]

+ 197 - 119
pages/power/index.vue

@@ -22,7 +22,9 @@
 				<view class="fdwcl_DataAll" v-for="(item,index) in powerProgressData" :key="index">
 					<view class="fdwcl_Data flex justify-between">
 						<view class="fdwcl_Data_1 flex">
-							<image src="../../static/jnImage/indexPage/windIcon.png" mode=""></image>
+							<image src="../../static/jnImage/indexPage/windIcon.png" v-if="item.type==='wind'" mode="">
+							</image>
+							<image src="../../static/jnImage/indexPage/powerIcon.png" v-else mode=""></image>
 							<text>{{item.inPower}}万kWh</text>
 						</view>
 						<view class="fdwcl_Data_2">
@@ -40,21 +42,21 @@
 				</view>
 			</view>
 			<view class="ycdl" v-else>
-				<view class="ycdl_msg" v-for="(item,index) in 3" :key="index">
+				<view class="ycdl_msg" v-for="(item,index) in powerFulterData" :key="index">
 					<view class="ycdl_title flex">
 						<image src="../../static/jnImage/powerPage/clock.png" mode=""></image>
-						<text>11月22日</text>
+						<text>{{item.date}}</text>
 						<text>预测电量</text>
 					</view>
 					<view class="ycdl_data">
 						<uni-row class="ycdl_data_row">
-							<uni-col :span="12" v-for="(item,index) in powerProgressData" :key="index">
+							<uni-col :span="12" v-for="(itv,index) in item.values" :key="index">
 								<view class="ycdl_data_col flex">
 									<view class="ycdl_data_col_left">
-										<text>{{item.name}}</text>
+										<text>{{showStationZH(itv.windpowerstationId)}}</text>
 									</view>
 									<view class="ycdl_data_col_right flex justify-between">
-										<text>{{item.inPower}}</text>
+										<text>{{itv.dayPowerForecast}}</text>
 										<text>MW</text>
 									</view>
 								</view>
@@ -75,7 +77,7 @@
 			<view class="xsfsgl" v-else>
 				<view class="xsfsgl_title flex justify-center">
 					<image src="../../static/jnImage/powerPage/72clock.png" mode=""></image>
-					<text>72小时风速功率</text>
+					<text>24小时功率曲线</text>
 				</view>
 				<view class="qiun-chartsLine">
 					<qiun-data-charts type="mix" :opts="optsLine" :chartData="chartDataLine" />
@@ -86,6 +88,14 @@
 </template>
 
 <script>
+	import {
+		bulletinappCompanyelectricityApi,
+		bulletinappForecastApi,
+		cockpitPowercurve24Api
+	} from '../../api/power.js'
+	import {
+		windPowerDataApi
+	} from '../../api/common.js'
 	import companyHeader from '../common/companyHeader.vue'
 	var uChartsInstance = {};
 	export default {
@@ -104,9 +114,14 @@
 				chartDataLine: {},
 				opts: {},
 				optsLine: {},
+				windData: [],
+				powerData: [],
+				powerFulterData: []
 			}
 		},
 		created() {
+			this.stationData("0", "-1");
+			this.stationData("0", "-2");
 			this.powerTabData = [{
 					nameZN: '电量',
 					nameEN: 'DL',
@@ -120,78 +135,87 @@
 				}
 			]
 			this.yearData = [{
-						nameZN: '月',
-						nameEN: 'month',
-						showColor: true
-					},
-					{
-						nameZN: '年',
-						nameEN: 'year',
-						showColor: false
+					nameZN: '月',
+					nameEN: 'month',
+					showColor: true
+				},
+				{
+					nameZN: '年',
+					nameEN: 'year',
+					showColor: false
 
-					}
-				],
-				this.powerProgressData = [{
-						type: 'wind',
-						inPower: 961,
-						allPower: 1865,
-						name: '宝龙山'
-					},
-					{
-						type: 'wind',
-						inPower: 852,
-						allPower: 1865,
-						name: '乌力吉'
-					},
-					{
-						type: 'wind',
-						inPower: 696,
-						allPower: 1865,
-						name: '浩日格吐'
-					},
-					{
-						type: 'wind',
-						inPower: 527,
-						allPower: 1865,
-						name: '开鲁'
-					},
-					{
-						type: 'wind',
-						inPower: 935,
-						allPower: 1865,
-						name: '景观'
-					},
-					{
-						type: 'wind',
-						inPower: 1022,
-						allPower: 1865,
-						name: '高力板'
-					},
-					{
-						type: 'wind',
-						inPower: 752,
-						allPower: 1865,
-						name: '书声'
-					},
-					{
-						type: 'wind',
-						inPower: 1520,
-						allPower: 1865,
-						name: '宝力根花'
-					},
-					{
-						type: 'wind',
-						inPower: 365.6,
-						allPower: 1865,
-						name: '振发'
-					},
-				]
-		},
-		onReady() {
-			this.getPowerBar()
+				}
+			]
 		},
 		methods: {
-			getPowerBar() {
+			//获取公司电量
+			getCompanyData() {
+				let that = this
+				bulletinappCompanyelectricityApi().then(res => {
+					if (res && res.data) {
+						let allData = []
+						let allSation = [...that.windData, ...that.powerData]
+						allSation.forEach(item => {
+							for (let i in res.data) {
+								if (i === item.wpid) {
+									let obj = res.data[i]
+									obj.wpname = item.wpname
+									obj.wpid = item.wpid
+									allData.push(obj)
+								}
+							}
+						})
+						allData.forEach(item => {
+							//公司电量月年数据
+							let obj = {
+								type: item.wpid.indexOf('_FDC') > -1 ? 'wind' : 'power',
+								name: item.wpname
+							}
+							if (that.yearTab === 'month') {
+								obj.inPower = item.yfdl
+								obj.allPower = item.yjhdl
+							} else if (that.yearTab === 'year') {
+								obj.inPower = item.nfdl
+								obj.allPower = item.njhdl
+							}
+							that.powerProgressData.push(obj)
+						})
+						//公司电量日数据
+						that.getPowerBar(allData)
+					}
+				})
+			},
+			async stationData(type1, type2) {
+				await windPowerDataApi({
+						company: type1,
+						type: type2
+					})
+					.then((res) => {
+						if (Object.values(res.data.data).length) {
+							if (res.data.data.powerVos.length > 0) {
+								res.data.data.powerVos.forEach(item => {
+									let obj = {
+										wpname: item.wpname,
+										wpid: item.wpid
+									}
+									if (type2 === "-1") {
+										this.windData.push(obj)
+									} else {
+										this.powerData.push(obj)
+									}
+								})
+								if (type2 === "-2") {
+									this.getCompanyData()
+								}
+							}
+
+						} else {
+							this.windData = [];
+							this.powerData = [];
+						}
+					});
+			},
+			getPowerBar(allData) {
 				let opts = {
 					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
 						"#ea7ccc"
@@ -204,6 +228,7 @@
 					xAxis: {
 						disableGrid: true,
 						rotateLabel: true,
+						rotateAngle: 90,
 						axisLineColor: "#A49EAC",
 						fontColor: "#A49EAC",
 						fontSize: 10,
@@ -232,18 +257,17 @@
 				let proColor = ['#6C4B9E', '#323A97', '#4951B2', '#4287FF', '#3CB8FE', '#1AA7B5', '#5183B6', '#9F65C1',
 					'#766FF1', '#4951B2',
 				]
-				//模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
 
 				let xAxis = []
 				let series = []
-				this.powerProgressData.forEach((item, index) => {
-					xAxis.push(item.name)
+				allData.forEach((item, index) => {
+					xAxis.push(item.wpname)
 					let obj = {
 						color: '',
 						name: '',
 						textSize: 10,
 						textColor: "#A49EAC",
-						value: item.inPower
+						value: item.rjhdl.toFixed(2)
 					}
 					proColor.forEach((it, idx) => {
 						if (index.toString().length > 1) {
@@ -257,13 +281,56 @@
 				let res = {
 					categories: xAxis,
 					series: [{
+						name: '日计划电量',
+						textColor: "#FFFFFF",
+						textSize: 12,
 						data: series
 					}]
 				};
 				this.opts = opts
 				this.chartData = JSON.parse(JSON.stringify(res));
 			},
-			getLineBar() {
+
+			//获取公司预测电量
+			getCompanyEleData() {
+				let that = this
+				bulletinappForecastApi({
+					type: 0,
+					wpId: '1'
+				}).then(res => {
+					if (res && res.data) {
+						for (let i in res.data) {
+							let obj = {
+								date: res.data[i][0].recordDate,
+								values: res.data[i]
+							}
+							that.powerFulterData.push(obj)
+						}
+					}
+				})
+			},
+			showStationZH(stationId) {
+				let allStation = [...this.windData, ...this.powerData]
+				let str = ''
+				allStation.forEach(item => {
+					if (item.wpid === stationId) {
+						str = item.wpname
+					}
+				})
+				return str
+			},
+			// 获取公司24小时功率预测
+			getcockpitPowercurve() {
+				let that = this
+				cockpitPowercurve24Api({
+					wpId: 'KGDL_FGS0'
+				}).then(res => {
+					if (res && res.data) {
+						this.getLineBar(res.data)
+					}
+				})
+			},
+			getLineBar(values) {
 				let opts = {
 					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
 						"#ea7ccc"
@@ -275,6 +342,7 @@
 					},
 					xAxis: {
 						disableGrid: true,
+						rotateLabel: true,
 						axisLineColor: "#A49EAC",
 						fontColor: "#A49EAC",
 						fontSize: 10,
@@ -290,23 +358,12 @@
 						gridColor: "#CCCCCC",
 						padding: 10,
 						data: [{
-								position: "left",
-								title: "折线",
-								fontColor: "#A49EAC",
-								titleFontColor: "#A49EAC",
-								titleFontSize: 10
-							},
-							{
-								position: "right",
-								min: 0,
-								max: 200,
-								title: "点",
-								textAlign: "left",
-								fontColor: "#A49EAC",
-								titleFontColor: "#A49EAC",
-								titleFontSize: 10
-							}
-						]
+							position: "left",
+							title: "MW",
+							fontColor: "#A49EAC",
+							titleFontColor: "#A49EAC",
+							titleFontSize: 10
+						}]
 					},
 					extra: {
 						mix: {
@@ -317,37 +374,45 @@
 					}
 				}
 
-				let proColor = ['#6C4B9E', '#323A97', '#4951B2', '#4287FF', '#3CB8FE', '#1AA7B5', '#5183B6', '#9F65C1',
-					'#766FF1', '#4951B2',
-				]
-				//模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
+				let sjglArr = []
+				let ycglArr = []
+				let xAxisArr = []
+				if (values.length > 0) {
+					values.forEach((item, index) => {
+						xAxisArr.push(this.changTimeSV(index + 1))
+						sjglArr.push(item.sjgl)
+						ycglArr.push(item.bzgl)
+					})
+				}
 
 				let res = {
-					categories: ["2018", "2019", "2020", "2021", "2022", "2023"],
+					categories: xAxisArr,
 					series: [{
-							name: "折线",
+							name: "实际功率",
 							type: "line",
-							color: "#2fc25b",
-							data: [150, 186, 205, 155, 96, 84]
+							color: "#25a1ff",
+							data: sjglArr
 						},
 						{
-							name: "折线",
+							name: "预测功率",
 							type: "line",
-							color: "#2fc25b",
-							data: [120, 140, 105, 170, 95, 160]
-						},
-						{
-							name: "点",
-							index: 2,
-							type: "point",
-							color: "#f04864",
-							data: [100, 80, 125, 150, 112, 132]
+							color: "#bc39aa",
+							data: ycglArr
 						}
 					]
 				};
 				this.optsLine = opts
 				this.chartDataLine = JSON.parse(JSON.stringify(res));
 			},
+			changTimeSV(date) {
+				let str = ''
+				if (date < 10) {
+					str = '0' + date + ':00'
+				} else {
+					str = date + ':00'
+				}
+				return str
+			},
 			changePowerTab(item) {
 				this.powerTabData.forEach(it => {
 					it.showColor = false
@@ -357,12 +422,14 @@
 					}
 				})
 				if (this.powerTab === 'DL') {
-					this.getPowerBar()
+					this.getCompanyData()
 				} else {
-					this.getLineBar()
+					this.getCompanyEleData()
+					this.getcockpitPowercurve()
 				}
 			},
 			changeYearTab(item) {
+				this.powerProgressData = []
 				this.yearData.forEach(it => {
 					it.showColor = false
 					if (it.nameEN === item.nameEN) {
@@ -370,6 +437,7 @@
 						this.yearTab = it.nameEN
 					}
 				})
+				this.getCompanyData()
 			},
 			showProgress(item, index) {
 				let indexX = index
@@ -379,7 +447,12 @@
 				let proColor = ['#6C4B9E', '#323A97', '#4951B2', '#4287FF', '#3CB8FE', '#1AA7B5', '#5183B6', '#9F65C1',
 					'#766FF1'
 				]
-				let pro = ((item.inPower / item.allPower).toFixed(2)) * 100 + '%'
+				let pro = ((item.inPower / item.allPower).toFixed(2)) * 100
+				if (pro > 100) {
+					pro = '100%'
+				} else {
+					pro = pro + '%'
+				}
 				let showColor = proColor[indexX]
 				let ss = `width: ${pro};background: ${showColor}`
 				return ss
@@ -574,6 +647,11 @@
 
 									text {
 										margin-left: 5px;
+										width: 100%;
+										display: inline-block;
+										overflow: hidden;
+										white-space: nowrap;
+										text-overflow: ellipsis;
 									}
 								}
 

+ 109 - 50
pages/power/stationIndex.vue

@@ -39,15 +39,15 @@
 				</view>
 				<view class="ycdl_station">
 					<uni-row class="ycdl_station_row">
-						<uni-col :span="7" v-for="(item,index) in powerNowData" :key="index">
+						<uni-col :span="8" v-for="(item,index) in powerBQData" :key="index">
 							<view class="ycdl_station_col">
-								<view class="ycdl_data_col_top flex">
+								<view class="ycdl_data_col_top ">
 									<text>{{item.inPower}}</text>
-									<text>{{item.type}}</text>
+									<text>kWh</text>
 								</view>
 								<view class="ycdl_data_col_bot flex">
 									<image src="../../static/jnImage/powerPage/clockW.png" mode=""></image>
-									<text>11月22日</text>
+									<text>{{item.date}}</text>
 								</view>
 							</view>
 						</uni-col>
@@ -57,17 +57,17 @@
 					<image src="../../static/jnImage/powerPage/sqrfdl.png" mode=""></image>
 					<text>上期日发电量</text>
 				</view>
-				<view class="ycdl_msg" v-for="(item,index) in 3" :key="index">
+				<view class="ycdl_msg" v-for="(item,index) in powerSQData" :key="index">
 					<view class="ycdl_title flex">
 						<image src="../../static/jnImage/powerPage/clock.png" mode=""></image>
-						<text>11月22日</text>
+						<text>{{item.date}}</text>
 					</view>
 					<view class="ycdl_data">
 						<uni-row class="ycdl_data_row">
-							<uni-col :span="12" v-for="(item,index) in powerNowData" :key="index">
+							<uni-col :span="12" v-for="(it, idx) in dayPowerSS" :key="idx+5">
 								<view class="ycdl_data_col flex">
 									<view class="ycdl_data_col_left">
-										<text>{{item.name}}</text>
+										<text>{{it}}</text>
 									</view>
 									<view class="ycdl_data_col_right flex justify-between">
 										<text>{{item.inPower}}</text>
@@ -82,17 +82,17 @@
 					<image src="../../static/jnImage/powerPage/tqrfdl.png" mode=""></image>
 					<text>同期日发电量</text>
 				</view>
-				<view class="ycdl_msg" v-for="(item,index) in 3" :key="index">
+				<view class="ycdl_msg" v-for="(item,index) in powerTQData" :key="index">
 					<view class="ycdl_title flex">
 						<image src="../../static/jnImage/powerPage/clock.png" mode=""></image>
-						<text>11月22日</text>
+						<text>{{item.date}}</text>
 					</view>
 					<view class="ycdl_data">
 						<uni-row class="ycdl_data_row">
-							<uni-col :span="12" v-for="(item,index) in powerNowData" :key="index">
+							<uni-col :span="12" v-for="(it,idx) in dayPowerSS" :key="idx+2">
 								<view class="ycdl_data_col flex">
 									<view class="ycdl_data_col_left">
-										<text>{{item.name}}</text>
+										<text>{{it}}</text>
 									</view>
 									<view class="ycdl_data_col_right flex justify-between">
 										<text>{{item.inPower}}</text>
@@ -138,7 +138,9 @@
 	import stationBar from '../common/stationTab.vue'
 	import {
 		electricityStatisticsApi,
-		statisticsHisdataApi
+		statisticsHisdataApi,
+		bulletinappCzforecastApi,
+		forecastShortApi
 	} from '../../api/power.js'
 	import {
 		bulletinappBulletinApi
@@ -161,13 +163,16 @@
 				powerTabData: [],
 				yearData: [],
 				powerProgressData: [],
-				powerNowData: [],
+				powerBQData: [],
+				powerSQData: [],
+				powerTQData: [],
 				chartDataDay: {},
 				chartDataMonth: {},
 				chartDataLine: {},
 				optsDay: {},
 				optsMonth: {},
 				optsLine: {},
+				dayPowerSS: ['预测电量', '实发电量'],
 			}
 		},
 		created() {
@@ -198,20 +203,6 @@
 
 				}
 			]
-
-			this.powerNowData = [{
-					type: 'wind',
-					inPower: 961,
-					allPower: 1865,
-					name: '预测电量'
-				},
-				{
-					type: 'wind',
-					inPower: 852,
-					allPower: 1865,
-					name: '实发电量'
-				}
-			]
 		},
 		mounted() {
 			this.$refs.stationBar.showTab = '电量预测'
@@ -380,7 +371,52 @@
 				this.optsMonth = opts
 				this.chartDataMonth = JSON.parse(JSON.stringify(res));
 			},
-			getLineBar() {
+
+			//获取场站预测数据
+			getPowerAllData() {
+				let that = this
+				bulletinappCzforecastApi({
+					wpId: that.stationWpid
+				}).then(res => {
+					if (res && res.data) {
+						res.data.forEach(item => {
+							let objBQ = {
+								date: item.date,
+								inPower: item.ycdl
+							}
+							that.powerBQData.push(objBQ)
+							let objSQ = {
+								date: item.date,
+								inPower: item.sqrfdl,
+								allPower: item.sqycdl
+							}
+							that.powerSQData.push(objSQ)
+							let objTQ = {
+								date: item.date,
+								inPower: item.tqrfdl,
+								allPower: item.tqycdl
+							}
+							that.powerTQData.push(objTQ)
+						})
+					}
+				})
+			},
+			getSevenTwoData() {
+				let that = this
+				let threeDays = new Date(new Date().getTime() + 3 * 24 * 60 * 60 * 1000)
+				let params = {
+					wpId: that.stationWpid,
+					beginDate: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date()
+						.getDate(),
+					endDate: threeDays.getFullYear() + '-' + (threeDays.getMonth() + 1) + '-' + threeDays.getDate()
+				}
+				forecastShortApi(params).then(res => {
+					if (res && res.data) {
+						that.getLineBar(res.data[that.stationWpid])
+					}
+				})
+			},
+			getLineBar(values) {
 				let opts = {
 					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
 						"#ea7ccc"
@@ -392,6 +428,8 @@
 					},
 					xAxis: {
 						disableGrid: true,
+						rotateLabel: true,
+						rotateAngle: 90,
 						axisLineColor: "#A49EAC",
 						fontColor: "#A49EAC",
 						fontSize: 10,
@@ -408,7 +446,7 @@
 						padding: 10,
 						data: [{
 								position: "left",
-								title: "折线",
+								title: "MW",
 								fontColor: "#A49EAC",
 								titleFontColor: "#A49EAC",
 								titleFontSize: 10
@@ -416,8 +454,8 @@
 							{
 								position: "right",
 								min: 0,
-								max: 200,
-								title: "",
+								max: 20,
+								title: "m/s",
 								textAlign: "left",
 								fontColor: "#A49EAC",
 								titleFontColor: "#A49EAC",
@@ -434,37 +472,52 @@
 					}
 				}
 
-				let proColor = ['#6C4B9E', '#323A97', '#4951B2', '#4287FF', '#3CB8FE', '#1AA7B5', '#5183B6', '#9F65C1',
-					'#766FF1', '#4951B2',
-				]
-				//模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
+				let sjglArr = []
+				let ycglArr = []
+				let sjfsArr = []
+				let xAxisArr = []
+				if (values.length > 0) {
+					values.forEach(item => {
+						xAxisArr.push(this.changTime(item.hours))
+						sjglArr.push(item.sjgl)
+						ycglArr.push(item.ycgl)
+						sjfsArr.push(item.pjfs)
+					})
+				}
 
 				let res = {
-					categories: ["2018", "2019", "2020", "2021", "2022", "2023"],
+					categories: xAxisArr,
 					series: [{
-							name: "折线",
+							name: "实际功率",
 							type: "line",
-							color: "#2fc25b",
-							data: [150, 186, 205, 155, 96, 84]
+							color: "#25a1ff",
+							data: sjglArr
 						},
 						{
-							name: "折线",
+							name: "预测功率",
 							type: "line",
-							color: "#2fc25b",
-							data: [120, 140, 105, 170, 95, 160]
+							color: "#bc39aa",
+							data: ycglArr
 						},
 						{
-							name: "",
+							name: "实际风速",
 							index: 2,
-							type: "point",
-							color: "#f04864",
-							data: [100, 80, 125, 150, 112, 132]
+							type: "line",
+							color: "#00bd4c",
+							data: sjfsArr
 						}
 					]
 				};
 				this.optsLine = opts
 				this.chartDataLine = JSON.parse(JSON.stringify(res));
 			},
+			//时间转换
+			changTime(date) {
+				let str = (new Date(date).getMonth() + 1) + '-' + new Date(date).getDate() + ' ' + new Date(date)
+					.getHours() + ':'
+				new Date(date).getMinutes() < 10 ? '0' + new Date(date).getMinutes() : new Date(date)
+				return str
+			},
 			changePowerTab(item) {
 				this.powerTabData.forEach(it => {
 					it.showColor = false
@@ -474,9 +527,12 @@
 					}
 				})
 				if (this.powerTab === 'DL') {
-					this.getPowerBar()
+					this.getReportData()
+					this.getStationDayPowerData()
+					this.getStationMonthPowerData()
 				} else {
-					this.getLineBar()
+					this.getPowerAllData()
+					this.getSevenTwoData()
 				}
 			},
 			changeYearTab(item) {
@@ -724,12 +780,14 @@
 								height: 40px;
 
 								text {
+									display: inline-block;
 									font-size: 28upx;
 									margin-left: 10px;
 								}
 
 								text:nth-of-type(1) {
 									color: #fff;
+									width: 100%;
 									position: relative;
 									top: 8px;
 									font-size: 36upx;
@@ -738,7 +796,8 @@
 								text:nth-of-type(2) {
 									color: #6274A1;
 									position: relative;
-									top: 18px;
+									top: 10px;
+									right: -50px;
 								}
 							}
 

+ 80 - 100
pages/type/index.vue

@@ -8,12 +8,10 @@
 						:style="item.showColor ? 'background: #4287FF;color:#fff': ''">{{item.nameZN}}</text>
 				</view>
 			</view>
-			<view class="gzcs">
+			<view class="gzcs" v-if="faultTypeTab === 'XT'">
 				<view class="flex justify-between">
 					<view class="gzcs_title flex justify-center">
-						<image src="../../static/jnImage/powerPage/powerDayIcon.png" mode=""
-							v-if="faultTypeTab === 'XT'"></image>
-						<image src="../../static/jnImage/powerPage/cishu.png" mode="" v-else></image>
+						<image src="../../static/jnImage/powerPage/powerDayIcon.png" mode=""></image>
 						<text>故障次数</text>
 					</view>
 					<view class="yearTab">
@@ -22,7 +20,7 @@
 					</view>
 				</view>
 				<view class="qiun-chartsPie">
-					<qiun-data-charts type="ring" :opts="opts" :chartData="chartData" />
+					<qiun-data-charts type="ring" :opts="opts" :chartData="chartDataXT" />
 				</view>
 				<view class="gzcs_data">
 					<uni-row class="gzcs_data_row">
@@ -32,35 +30,19 @@
 									<text>{{item.name}}</text>
 								</view>
 								<view class=" gzcs_data_col_right flex justify-between">
-									<text>{{item.data}}</text>
+									<text>{{ item.num_of_warnings}}</text>
 									<text>次</text>
 								</view>
 							</view>
 						</uni-col>
 					</uni-row>
 				</view>
-				<view class="heji flex" v-if="faultTypeTab === 'JX'">
-					<view class="heji_img">
-						<image src="../../static/jnImage/powerPage/heji.png" mode=""></image>
-					</view>
-					<view class="heji_msg flex justify-between">
-						<view class="heji_msg_tit">
-							<text>公司合计</text>
-						</view>
-						<view class="heji_msg_data flex justify-between">
-							<text>600</text>
-							<text>次</text>
-						</view>
-					</view>
-				</view>
 			</view>
-			<!-- <view class="ssdl">
+			<view class="gzcs" v-else>
 				<view class="flex justify-between">
 					<view class="gzcs_title flex justify-center">
-						<image src="../../static/jnImage/powerPage/powerDayIcon.png" mode=""
-							v-if="faultTypeTab === 'XT'"></image>
-						<image src="../../static/jnImage/powerPage/sunshi.png" mode="" v-else></image>
-						<text>损失电量</text>
+						<image src="../../static/jnImage/powerPage/cishu.png" mode=""></image>
+						<text>故障次数</text>
 					</view>
 					<view class="yearTab">
 						<text v-for="(item,index) in yearData" :key="index" @click="changeYearTab(item)"
@@ -68,39 +50,39 @@
 					</view>
 				</view>
 				<view class="qiun-chartsPie">
-					<qiun-data-charts type="ring" :opts="opts" :chartData="chartData" />
+					<qiun-data-charts type="ring" :opts="opts" :chartData="chartDataJX" />
 				</view>
 				<view class="gzcs_data">
 					<uni-row class="gzcs_data_row">
-						<uni-col :span="12" v-for="(item,index) in faultTypeData" :key="index">
+						<uni-col :span="12" v-for="(item,index) in faultTypeJXData" :key="index">
 							<view class="gzcs_data_col flex">
 								<view class="gzcs_data_col_left" :style="showColor(item)">
 									<text>{{item.name}}</text>
 								</view>
 								<view class=" gzcs_data_col_right flex justify-between">
-									<text>{{item.data}}</text>
+									<text>{{item.num_of_events}}</text>
 									<text>次</text>
 								</view>
 							</view>
 						</uni-col>
 					</uni-row>
 				</view>
-				<view class="heji flex" v-if="faultTypeTab === 'JX'">
+				<view class="heji flex">
 					<view class="heji_img">
 						<image src="../../static/jnImage/powerPage/heji.png" mode=""></image>
 					</view>
 					<view class="heji_msg flex justify-between">
 						<view class="heji_msg_tit">
-							<text>公司合计</text>
+							<text>次数合计</text>
 						</view>
 						<view class="heji_msg_data flex justify-between">
-							<text>600</text>
+							<text>{{jxgzcs}}</text>
 							<text>次</text>
 						</view>
 					</view>
 				</view>
-			</view> -->
-			<view class="wxss">
+			</view>
+			<!-- <view class="wxss">
 				<view class="flex justify-between">
 					<view class="gzcs_title flex justify-center">
 						<image src="../../static/jnImage/powerPage/powerDayIcon.png" mode=""
@@ -131,13 +113,17 @@
 						</uni-col>
 					</uni-row>
 				</view>
-			</view>
+			</view> -->
 		</view>
 	</view>
 </template>
 
 <script>
 	import companyHeader from '../common/companyHeader.vue'
+	import {
+		bulletinappShutdowngsApi,
+		bulletinappShutdowngsjxApi
+	} from '../../api/type.js'
 	export default {
 		onLoad: function() {},
 		components: {
@@ -147,12 +133,14 @@
 			return {
 				faultTypeTab: 'XT',
 				faultTypeTabData: [],
-				yearTab: '',
+				yearTab: 'day',
 				yearData: [],
-				chartData: {},
+				chartDataXT: {},
+				chartDataJX: {},
 				chartDatawxss: {},
-				opts: {},
 				faultTypeData: [],
+				faultTypeJXData: [],
+				jxgzcs: 0,
 				wxssTypeData: [],
 				opts: {
 					rotate: false,
@@ -190,7 +178,7 @@
 							border: false,
 						}
 					}
-				}
+				},
 			}
 		},
 		created() {
@@ -223,55 +211,6 @@
 
 				}
 			]
-			this.faultTypeData = [{
-					data: 1865,
-					name: '发电机'
-				},
-				{
-					data: 1865,
-					name: '传动变速'
-				},
-				{
-					data: 696,
-					name: '远程监控'
-				},
-				{
-					data: 527,
-					name: '电气控制'
-				},
-				{
-					data: 935,
-					name: '变桨'
-				},
-				{
-					data: 1022,
-					name: '变频'
-				},
-				{
-					data: 752,
-					name: '电源'
-				},
-				{
-					data: 1520,
-					name: '机舱与塔架'
-				},
-				{
-					data: 365.6,
-					name: '风轮'
-				},
-				{
-					data: 365,
-					name: '偏航'
-				},
-				{
-					data: 256,
-					name: '液压'
-				},
-				{
-					data: 214,
-					name: '通讯'
-				},
-			]
 			this.wxssTypeData = [{
 					data: 1865,
 					name: '发电机'
@@ -297,22 +236,48 @@
 					name: '变频'
 				}
 			]
-		},
-		onReady() {
-			this.getPieBar()
-			this.getPieBarwxss()
+
+			this.getXTGZCSdata()
 		},
 		methods: {
-			getPieBar() {
+			//获取系统故障次数
+			getXTGZCSdata() {
+				let that = this
+				bulletinappShutdowngsApi({
+					type: that.yearTab
+				}).then(res => {
+					if (res && res.data) {
+						that.faultTypeData = res.data
+						that.getPieBar(res.data)
+					}
+				})
+			},
+			//获取机型故障次数
+			getJXGZCSdata() {
+				let that = this
+				bulletinappShutdowngsjxApi({
+					type: that.yearTab
+				}).then(res => {
+					if (res && res.data) {
+						that.faultTypeJXData = res.data
+						that.getPieBar(res.data)
+					}
+				})
+			},
+			getPieBar(values) {
 				let proColor = ['#5CB2EF', '#3E78C5', '#00299D', '#3EAD9F', '#3F3A99', '#5EAC88', '#5D56D0', '#CD8D23',
 					'#9F65C1', '#FD8974', '#C745B9', '#FF6B3E'
 				]
 
 				let series = []
-				this.faultTypeData.forEach((item, index) => {
+				let allNum = 0
+				values.forEach((item, index) => {
+					if (this.faultTypeTab === 'JX') {
+						allNum += item.num_of_events
+					}
 					let obj = {
 						name: item.name,
-						value: item.data,
+						value: this.faultTypeTab === 'XT' ? item.num_of_warnings : item.num_of_events,
 					}
 					proColor.forEach((it, idx) => {
 						if (index.toString().length > 1) {
@@ -325,12 +290,17 @@
 					})
 					series.push(obj)
 				})
+				this.jxgzcs = allNum
 				let res = {
 					series: [{
 						data: series
 					}]
 				};
-				this.chartData = JSON.parse(JSON.stringify(res));
+				if (this.faultTypeTab === 'XT') {
+					this.chartDataXT = JSON.parse(JSON.stringify(res));
+				} else {
+					this.chartDataJX = JSON.parse(JSON.stringify(res));
+				}
 			},
 			getPieBarwxss() {
 				let proColor = ['#5CB2EF', '#3E78C5', '#00299D', '#3EAD9F', '#3F3A99', '#5EAC88', '#5D56D0', '#CD8D23',
@@ -372,11 +342,11 @@
 						this.faultTypeTab = it.nameEN
 					}
 				})
-				// if (this.faultTypeTab === 'XT') {
-				// 	this.getPowerBar()
-				// } else {
-				// 	this.getLineBar()
-				// }
+				if (this.faultTypeTab === 'XT') {
+					this.getXTGZCSdata()
+				} else {
+					this.getJXGZCSdata()
+				}
 			},
 			changeYearTab(item) {
 				this.yearData.forEach(it => {
@@ -386,6 +356,11 @@
 						this.yearTab = it.nameEN
 					}
 				})
+				if (this.faultTypeTab === 'XT') {
+					this.getXTGZCSdata()
+				} else {
+					this.getJXGZCSdata()
+				}
 			},
 		}
 	}
@@ -484,6 +459,11 @@
 
 								text {
 									margin-left: 5px;
+									width: 100%;
+									display: inline-block;
+									overflow: hidden;
+									white-space: nowrap;
+									text-overflow: ellipsis;
 								}
 							}
 

+ 133 - 126
pages/type/stationIndex.vue

@@ -11,12 +11,10 @@
 						:style="item.showColor ? 'background: #4287FF;color:#fff': ''">{{item.nameZN}}</text>
 				</view>
 			</view>
-			<view class="gzcs">
+			<view class="gzcs" v-if="faultTypeTab === 'XT'">
 				<view class="flex justify-between">
 					<view class="gzcs_title flex justify-center">
-						<image src="../../static/jnImage/powerPage/powerDayIcon.png" mode=""
-							v-if="faultTypeTab === 'XT'"></image>
-						<image src="../../static/jnImage/powerPage/cishu.png" mode="" v-else></image>
+						<image src="../../static/jnImage/powerPage/powerDayIcon.png" mode=""></image>
 						<text>故障次数</text>
 					</view>
 					<view class="yearTab">
@@ -25,45 +23,29 @@
 					</view>
 				</view>
 				<view class="qiun-chartsPie">
-					<qiun-data-charts type="ring" :opts="opts" :chartData="chartData" />
+					<qiun-data-charts type="ring" :opts="opts" :chartData="chartDataXTgzcs" />
 				</view>
 				<view class="gzcs_data">
 					<uni-row class="gzcs_data_row">
-						<uni-col :span="12" v-for="(item,index) in faultTypeData" :key="index">
+						<uni-col :span="12" v-for="(item,index) in faultTypeXTgzcsData" :key="index">
 							<view class="gzcs_data_col flex">
 								<view class="gzcs_data_col_left" :style="showColor(item)">
 									<text>{{item.name}}</text>
 								</view>
 								<view class=" gzcs_data_col_right flex justify-between">
-									<text>{{item.data}}</text>
+									<text>{{item.num_of_warnings}}</text>
 									<text>次</text>
 								</view>
 							</view>
 						</uni-col>
 					</uni-row>
 				</view>
-				<view class="heji flex" v-if="faultTypeTab === 'JX'">
-					<view class="heji_img">
-						<image src="../../static/jnImage/powerPage/heji.png" mode=""></image>
-					</view>
-					<view class="heji_msg flex justify-between">
-						<view class="heji_msg_tit">
-							<text>公司合计</text>
-						</view>
-						<view class="heji_msg_data flex justify-between">
-							<text>600</text>
-							<text>次</text>
-						</view>
-					</view>
-				</view>
 			</view>
-			<!-- <view class="ssdl">
+			<view class="gzcs" v-else>
 				<view class="flex justify-between">
 					<view class="gzcs_title flex justify-center">
-						<image src="../../static/jnImage/powerPage/powerDayIcon.png" mode=""
-							v-if="faultTypeTab === 'XT'"></image>
-						<image src="../../static/jnImage/powerPage/sunshi.png" mode="" v-else></image>
-						<text>损失电量</text>
+						<image src="../../static/jnImage/powerPage/cishu.png" mode=""></image>
+						<text>故障次数</text>
 					</view>
 					<view class="yearTab">
 						<text v-for="(item,index) in yearData" :key="index" @click="changeYearTab(item)"
@@ -71,24 +53,24 @@
 					</view>
 				</view>
 				<view class="qiun-chartsPie">
-					<qiun-data-charts type="ring" :opts="opts" :chartData="chartData" />
+					<qiun-data-charts type="ring" :opts="opts" :chartData="chartDataJXgzcs" />
 				</view>
 				<view class="gzcs_data">
 					<uni-row class="gzcs_data_row">
-						<uni-col :span="12" v-for="(item,index) in faultTypeData" :key="index">
+						<uni-col :span="12" v-for="(item,index) in faultTypeJXgzcsData" :key="index">
 							<view class="gzcs_data_col flex">
 								<view class="gzcs_data_col_left" :style="showColor(item)">
 									<text>{{item.name}}</text>
 								</view>
 								<view class=" gzcs_data_col_right flex justify-between">
-									<text>{{item.data}}</text>
+									<text>{{item.num_of_events}}</text>
 									<text>次</text>
 								</view>
 							</view>
 						</uni-col>
 					</uni-row>
 				</view>
-				<view class="heji flex" v-if="faultTypeTab === 'JX'">
+				<view class="heji flex">
 					<view class="heji_img">
 						<image src="../../static/jnImage/powerPage/heji.png" mode=""></image>
 					</view>
@@ -97,12 +79,12 @@
 							<text>公司合计</text>
 						</view>
 						<view class="heji_msg_data flex justify-between">
-							<text>600</text>
+							<text>{{czxtgzcs}}</text>
 							<text>次</text>
 						</view>
 					</view>
 				</view>
-			</view> -->
+			</view>
 			<view class="wxss">
 				<view class="flex justify-between">
 					<view class="gzcs_title flex justify-center">
@@ -142,24 +124,33 @@
 
 <script>
 	import stationBar from '../common/stationTab.vue'
+	import {
+		bulletinappShutdownczApi,
+		bulletinappShutdownczjxApi
+	} from '../../api/type.js'
+	import {
+		stationCaldataApi
+	} from '../../api/home.js'
 	export default {
-		onLoad: function() {
-			this.stationName = uni.getStorageSync('stationName')
-		},
+		onLoad: function() {},
 		components: {
 			stationBar
 		},
 		data() {
 			return {
 				stationName: '',
+				stationWpid: '',
 				faultTypeTab: 'XT',
 				faultTypeTabData: [],
-				yearTab: '',
+				yearTab: 'day',
 				yearData: [],
-				chartData: {},
+				chartDataXTgzcs: {},
+				chartDataJXgzcs: {},
 				chartDatawxss: {},
 				opts: {},
-				faultTypeData: [],
+				faultTypeXTgzcsData: [],
+				faultTypeJXgzcsData: [],
+				czxtgzcs: 0,
 				wxssTypeData: [],
 				opts: {
 					rotate: false,
@@ -201,6 +192,8 @@
 			}
 		},
 		created() {
+			this.stationName = uni.getStorageSync('stationName')
+			this.stationWpid = uni.getStorageSync('stationWpid')
 			this.faultTypeTabData = [{
 					nameZN: '系统',
 					nameEN: 'XT',
@@ -230,100 +223,98 @@
 
 				}
 			]
-			this.faultTypeData = [{
-					data: 1865,
-					name: '发电机'
-				},
-				{
-					data: 1865,
-					name: '传动变速'
-				},
-				{
-					data: 696,
-					name: '远程监控'
-				},
-				{
-					data: 527,
-					name: '电气控制'
-				},
-				{
-					data: 935,
-					name: '变桨'
-				},
-				{
-					data: 1022,
-					name: '变频'
-				},
-				{
-					data: 752,
-					name: '电源'
-				},
-				{
-					data: 1520,
-					name: '机舱与塔架'
-				},
-				{
-					data: 365.6,
-					name: '风轮'
-				},
-				{
-					data: 365,
-					name: '偏航'
-				},
-				{
-					data: 256,
-					name: '液压'
-				},
-				{
-					data: 214,
-					name: '通讯'
-				},
-			]
-			this.wxssTypeData = [{
-					data: 1865,
-					name: '发电机'
-				},
-				{
-					data: 1865,
-					name: '传动变速'
-				},
-				{
-					data: 696,
-					name: '远程监控'
-				},
-				{
-					data: 527,
-					name: '电气控制'
-				},
-				{
-					data: 935,
-					name: '变桨'
-				},
-				{
-					data: 1022,
-					name: '变频'
-				}
-			]
 		},
 		mounted() {
 			this.$refs.stationBar.showTab = '故障分类'
-			this.getPieBar()
-			this.getPieBarwxss()
+			this.getXTGZCSdata()
+			this.getWXSSdata()
 		},
 		methods: {
 			back() {
 				this.$tab.switchTab('/pages/home/index')
 			},
-			getPieBar() {
+			//获取系统故障次数
+			getXTGZCSdata() {
+				let that = this
+				bulletinappShutdownczApi({
+					type: that.yearTab,
+					wpId: that.stationWpid
+				}).then(res => {
+					if (res && res.data) {
+						that.faultTypeXTgzcsData = res.data
+						that.getPieBar(res.data)
+					}
+				})
+			},
+			//获取机型故障次数
+			getJXGZCSdata() {
+				let that = this
+				bulletinappShutdownczjxApi({
+					type: that.yearTab,
+					wpId: that.stationWpid
+				}).then(res => {
+					if (res && res.data) {
+						that.faultTypeJXgzcsData = res.data
+						that.getPieBar(res.data)
+					}
+				})
+			},
+			//获取五项损失数据
+			getWXSSdata() {
+				let that = this
+				stationCaldataApi({
+					wpid: that.stationWpid
+				}).then(res => {
+					if (res.data.data) {
+						let item = res.data.data
+						that.wxssTypeData = [{
+								data: this.yearTab === 'day' ? item.rfdl : this.yearTab === 'month' ? item
+									.yfdl : item.nfdl,
+								name: '实发电量'
+							}, {
+								data: this.yearTab === 'day' ? item.rxnssdl : this.yearTab === 'month' ? item
+									.yxnssdl : item.nxnssdl,
+								name: '性能损失'
+							},
+							{
+								data: this.yearTab === 'day' ? item.rwhssdl : this.yearTab === 'month' ? item
+									.ywhssdl : item.nwhssdl,
+								name: '检修损失'
+							},
+							{
+								data: this.yearTab === 'day' ? item.rgzssdl : this.yearTab === 'month' ? item
+									.ygzssdl : item.ngzssdl,
+								name: '故障损失'
+							},
+							{
+								data: this.yearTab === 'day' ? item.rxdssdl : this.yearTab === 'month' ? item
+									.yxdssdl : item.nxdssdl,
+								name: '限电损失'
+							},
+							{
+								data: this.yearTab === 'day' ? item.rslssdl : this.yearTab === 'month' ? item
+									.yslssdl : item.nslssdl,
+								name: '受累损失'
+							}
+						]
+						that.getPieBarwxss()
+					}
+				})
+			},
+			getPieBar(values) {
 				let proColor = ['#5CB2EF', '#3E78C5', '#00299D', '#3EAD9F', '#3F3A99', '#5EAC88', '#5D56D0', '#CD8D23',
 					'#9F65C1', '#FD8974', '#C745B9', '#FF6B3E'
 				]
 
 				let series = []
-				this.faultTypeData.forEach((item, index) => {
+				let allNum = 0
+				values.forEach((item, index) => {
+					if (this.faultTypeTab === 'JX') {
+						allNum += item.num_of_events
+					}
 					let obj = {
 						name: item.name,
-						value: item.data,
+						value: this.faultTypeTab === 'XT' ? item.num_of_warnings : item.num_of_events,
 					}
 					proColor.forEach((it, idx) => {
 						if (index.toString().length > 1) {
@@ -336,12 +327,17 @@
 					})
 					series.push(obj)
 				})
+				this.czxtgzcs = allNum
 				let res = {
 					series: [{
 						data: series
 					}]
 				};
-				this.chartData = JSON.parse(JSON.stringify(res));
+				if (this.faultTypeTab === 'XT') {
+					this.chartDataXTgzcs = JSON.parse(JSON.stringify(res));
+				} else {
+					this.chartDataJXgzcs = JSON.parse(JSON.stringify(res));
+				}
 			},
 			changeMsg() {
 				this.$tab.navigateTo('/pages/common/messagePage')
@@ -349,7 +345,7 @@
 			changeStation() {
 				this.$tab.navigateTo('/pages/common/stationListPage')
 			},
-			getPieBarwxss() {
+			getPieBarwxss(values) {
 				let proColor = ['#5CB2EF', '#3E78C5', '#00299D', '#3EAD9F', '#3F3A99', '#5EAC88', '#5D56D0', '#CD8D23',
 					'#9F65C1', '#FD8974', '#C745B9', '#FF6B3E'
 				]
@@ -389,11 +385,11 @@
 						this.faultTypeTab = it.nameEN
 					}
 				})
-				// if (this.faultTypeTab === 'XT') {
-				// 	this.getPowerBar()
-				// } else {
-				// 	this.getLineBar()
-				// }
+				if (this.faultTypeTab === 'XT') {
+					this.getXTGZCSdata()
+				} else {
+					this.getJXGZCSdata()
+				}
 			},
 			changeYearTab(item) {
 				this.yearData.forEach(it => {
@@ -403,6 +399,12 @@
 						this.yearTab = it.nameEN
 					}
 				})
+				if (this.faultTypeTab === 'XT') {
+					this.getXTGZCSdata()
+				} else {
+					this.getJXGZCSdata()
+				}
+				this.getWXSSdata()
 			},
 		}
 	}
@@ -432,10 +434,10 @@
 		}
 
 		.faultType_main {
-			padding: 0 20px;
-			margin-top: 20px;
+			padding: 20px 20px 50px 20px;
 
 			.faultType_tab {
+
 				text {
 					display: inline-block;
 					width: 80px;
@@ -514,6 +516,11 @@
 
 								text {
 									margin-left: 5px;
+									width: 100%;
+									display: inline-block;
+									overflow: hidden;
+									white-space: nowrap;
+									text-overflow: ellipsis;
 								}
 							}