123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474 |
- import * as echarts from "echarts";
- //import FiveLossRatesHistogramChart from "../../views/benchMarking/FiveLossRatesHistogramChart.vue";
- export default {
- data() {
- return {
- pickerOptions: {
- disabledDate(time) {
- return time.getTime() > Date.now();
- },
- },
- formInline: {
- windfarm: "",
- project: "",
- line: "",
- },
- timedate: [],
- isAsc: "asc",
- beginDate: "",
- endDate: "",
- gridData: [],
- multipleSelection: [],
- sortInOrder: [],
- sortInOrderTop: [],
- sortInOrde2: [],
- getTableData: [],
- sortInOrderTop2: [],
- fdcName1: "",
- fdcName2: "",
- wp_n_1: {},
- wp_n_2: {},
- currentPage2: 1,
- pagesize: 10,
- classification: [
- {
- id: "qf",
- label: "弃风率",
- },
- {
- id: "gz",
- label: "故障损失率",
- },
- {
- id: "jx",
- label: "检修损失率",
- },
- {
- id: "xn",
- label: "性能损失率",
- },
- {
- id: "sl",
- label: "受累损失率",
- },
- ],
- options: [
- {
- value: "MHS_FDC",
- label: "麻黄山风电场",
- },
- {
- value: "NSS_FDC",
- label: "牛首山风电场",
- },
- {
- value: "SBQ_FDC",
- label: "石板泉风电场",
- },
- {
- value: "QS_FDC",
- label: "青山风电场",
- },
- {
- value: "XS_FDC",
- label: "香山风电场",
- },
- ],
- value: "",
- value2: "gz",
- wpId: [],
- wpName: [],
- orderByColumn: "",
- dialogTableVisible: false,
- lineDataOption: [],
- getChartDataValue: [],
- getChartDataValue2: [],
- chartsAName2: "",
- selectrowdate: {},
- };
- },
- // components: {
- // FiveLossRatesHistogramChart: FiveLossRatesHistogramChart,
- // },
- created() {
- this.FiveLossInformation();
- },
- methods: {
- headStyle() {
- return "text-align:center";
- },
- onSubmit() {
- },
- handleClick() {},
- deleteRow(index, rows) {
- rows.splice(index, 1);
- },
- queryApData() {
- this.FiveLossInformation();
- },
- /**
- *
- * 检查是否选择两个项目
- */
- querycheck(){
- if(this.selectrowdate.length == 2){
- this.queryApDataMx();
- }else{
- this.$message({
- message:"请选择两个项目!",
- type:'error'
- });
- return
- }
- },
- /**
- * 获取表格数据
- */
- handleEdit(a, b) {
- this.wpId = [];
- this.lineDataOption = [];
- if (this.multipleSelection.length == 2) {
- for (let i = 0; i < this.multipleSelection.length; i++) {
- this.wpId.push(this.multipleSelection[i].wpId);
- this.wpName.push(this.multipleSelection[i].wpName);
- this.lineDataOption.push({
- id: this.multipleSelection[i].wpId,
- name: this.multipleSelection[i].wpName,
- });
- }
- this.$router.push({
- path: "/propertBenchmarkParticulars",
- query: {
- wpId: this.wpId,
- beginDate: this.beginDate,
- endDate: this.endDate,
- wpName: this.wpName,
- select: this.lineDataOption,
- },
- });
- } else {
- this.lineDataOption.push({ id: b.wpId, name: b.wpName });
- this.$router.push({
- path: "/propertBenchmarkParticulars",
- query: {
- wpId: b.wpId,
- beginDate: this.beginDate,
- endDate: this.endDate,
- wpName: b.wpName,
- select: this.lineDataOption,
- },
- });
- }
- },
- /**
- * 查询检查
- */
- checkwindfarm() {
- if (this.formInline.windfarm == "") {
- this.$message.error("请选择风场!");
- return;
- }
- },
- checkproject() {
- if (this.formInline.project == "") {
- this.$message.error("请选择项目!");
- return;
- }
- if (new Date(this.timedate) == null) {
- this.$message.error("请选择时间");
- return;
- }
- },
- /**
- * 弹出控制
- */
- queryApDataMx() {
- this.dialogTableVisible = true;
- this.check_wpid();
- this.$nextTick(function () {
- this.ECZM.bar_tc("leiDaTu8" , this.wp_n_1 , this.wp_n_2 , this.wp_n_1.wpId , this.wp_n_2.wpId);
- this.ECZM.leida_tc("leiDatu6" , this.sortInOrder,this.fdcName1,this.sortInOrderTop,this.fdcName2);
- });
- },
- handleSelectionChange(val) {
- this.selectrowdate = val;
- },
- /**
- * 数据转换
- */
- check_wpid() {
- this.wp_n_1 = {};
- this.wp_n_2 = {};
- this.sortInOrder = [];
- this.sortInOrderTop = [];
- this.getTableData = [];
- this.sortInOrde2 = [];
- this.fdcName1 = "";
- this.fdcName2 = "";
-
- this.wp_n_1 = this.selectrowdate[0];
- this.wp_n_2 = this.selectrowdate[1];
- this.fdcName1 = this.selectrowdate[0].wpName;
- this.fdcName2 = this.selectrowdate[1].wpName;
- this.sortInOrder.push(
- this.selectrowdate[0].fnlyl,
- this.selectrowdate[0].xqjsl,
- this.selectrowdate[0].ztzhjsl,
- this.selectrowdate[0].fwjsl,
- this.selectrowdate[0].slssl,
- this.selectrowdate[0].xnssl,
- this.selectrowdate[0].qfl,
- this.selectrowdate[0].jxssl,
- this.selectrowdate[0].gzssl
- );
- this.sortInOrderTop.push(
- this.selectrowdate[1].fnlyl,
- this.selectrowdate[1].xqjsl,
- this.selectrowdate[1].ztzhjsl,
- this.selectrowdate[1].fwjsl,
- this.selectrowdate[1].slssl,
- this.selectrowdate[1].xnssl,
- this.selectrowdate[1].qfl,
- this.selectrowdate[1].jxssl,
- this.selectrowdate[1].gzssl
- );
- // for (let i = 0; i < this.multipleSelection.length; i++) {
- // this.sortInOrde2.push({
- // product: this.multipleSelection[i].wpName,
- // "限电损失电量单位:万KWh": this.multipleSelection[i].xdss,
- // "故障损失电量单位:万KWh": this.multipleSelection[i].gzss,
- // "检修损失电量单位:万KWh": this.multipleSelection[i].jxssl,
- // "性能损失电量单位:万KWh": this.multipleSelection[i].xnssl,
- // "受累损失电量单位:万KWh": this.multipleSelection[i].slss,
- // });
- // }
- this.getTableData.push({
- index: "发电量",
- data1: this.selectrowdate[0].fdl,
- data2: this.selectrowdate[1].fdl,
- });
- this.getTableData.push({
- index: "故障损失电量",
- data1: this.selectrowdate[0].gzss,
- data2: this.selectrowdate[1].gzss,
- });
- this.getTableData.push({
- index: "检修损失电量",
- data1: this.selectrowdate[0].jxssl,
- data2: this.selectrowdate[1].jxssl,
- });
- this.getTableData.push({
- index: "性能未达标损失电量",
- data1: this.selectrowdate[0].xnsslfraction,
- data2: this.selectrowdate[1].xnsslfraction,
- });
- this.getTableData.push({
- index: "受累损失电量",
- data1: this.selectrowdate[0].slss,
- data2: this.selectrowdate[1].slss,
- });
- this.getTableData.push({
- index: "风能利用率",
- data1: this.selectrowdate[0].fnlyl,
- data2: this.selectrowdate[1].fnlyl,
- });
- this.getTableData.push({
- index: "故障损失率",
- data1: this.selectrowdate[0].gzssl,
- data2: this.selectrowdate[1].gzssl,
- });
- this.getTableData.push({
- index: "检修损失率",
- data1: this.selectrowdate[0].jxssl,
- data2: this.selectrowdate[1].jxssl,
- });
- this.getTableData.push({
- index: "弃风率",
- data1: this.selectrowdate[0].qfl,
- data2: this.selectrowdate[1].qfl,
- });
- this.getTableData.push({
- index: "性能损失率",
- data1: this.selectrowdate[0].xnssl,
- data2: this.selectrowdate[1].xnssl,
- });
- this.getTableData.push({
- index: "受累损失率",
- data1: this.selectrowdate[0].slssl,
- data2: this.selectrowdate[1].slssl,
- });
- this.getTableData.push({
- index: "复位及时率",
- data1: this.selectrowdate[0].fwjsl,
- data2: this.selectrowdate[1].fwjsl,
- });
- this.getTableData.push({
- index: "消缺及时率",
- data1: this.selectrowdate[0].xqjsl,
- data2: this.selectrowdate[1].xqjsl,
- });
- this.getTableData.push({
- index: "状态转换率",
- data1: this.selectrowdate[0].ztzhjsl,
- data2: this.selectrowdate[1].ztzhjsl,
- });
- },
- handleSizeChange(val) {
- this.pagesize = val;
- },
- changeTableSort(column) {
- this.orderByColumn = column.prop;
- if (column.order == "descending") {
- this.isAsc = "desc";
- } else if (column.order == "ascending") {
- this.isAsc = "asc";
- }
- this.FiveLossInformation();
- },
- /**
- * 查询风机列表信息
- */
- FiveLossInformation() {
- var newData = new Date();
- this.timedate[0] = this.BASE.getBzDate(newData.getTime(),-1);
- this.timedate[1] = this.BASE.getBzDate(newData.getTime(),0);
- let that = this;
- this.API.get("/powercompare/windfarmAjax").then((res) => {
- that.options = res.data;
- }).catch(error =>{
- this.$message.error('获取数据失败');
- });
- if (this.timedate == "") {
- this.beginDate = this.timedate[0];
- this.endDate = this.timedate[1];
- } else {
- this.beginDate = this.timedate[0];
- this.endDate = this.timedate[1];
- }
- var fiveLossData = new URLSearchParams();
- fiveLossData.append("pageNum", this.currentPage2);
- fiveLossData.append("pageSize", this.pagesize);
- fiveLossData.append("orderByColumn", this.orderByColumn);
- fiveLossData.append("isAsc", this.isAsc);
- fiveLossData.append("wpId", this.value);
- fiveLossData.append("beginDate", this.beginDate);
- fiveLossData.append("endDate", this.endDate);
- this.API
- .post("/contrast/benchmarkLossList", fiveLossData)
- .then((res) => {
- that.gridData = res.data;
- that.getPackageData(that.gridData, that.value2);
- }).catch(error =>{
- this.$message.error('获取数据失败');
- });
- },
- getPackageData(gridData, value2) {
- for (let i = 0; i < gridData.length; i++) {
- this.getChartDataValue.push({
- value: gridData[i].fdl,
- name: gridData[i].wpName,
- });
- if (value2 == "gz") {
- this.chartsAName2 = "故障损失占比";
- this.getChartDataValue2.push({
- value: gridData[i].gzss,
- name: gridData[i].wpName,
- });
- } else if (value2 == "xn") {
- this.chartsAName2 = "性能损失占比";
- this.getChartDataValue2.push({
- value: gridData[i].qfss,
- name: gridData[i].wpName,
- });
- } else if (value2 == "qf") {
- this.chartsAName2 = "弃风率占比";
- this.getChartDataValue2.push({
- value: gridData[i].qfl,
- name: gridData[i].wpName,
- });
- } else if (value2 == "jx") {
- this.chartsAName2 = "检修损失占比";
- this.getChartDataValue2.push({
- value: gridData[i].whss,
- name: gridData[i].wpName,
- });
- } else if (value2 == "sl") {
- this.chartsAName2 = "受累损失占比";
- this.getChartDataValue2.push({
- value: gridData[i].slss,
- name: gridData[i].wpName,
- });
- }
- }
- this.getChartDataImport();
- this.getChartDataValue = [];
- this.getChartDataValue2 = [];
- },
- /**
- * 判断当前分类
- */
- getChartDataImport() {
- var charts = echarts.init(document.getElementById("chartPie"));
- let option = {
- title: {
- text: "发电量占比",
- left: "center",
- },
- color: ["#90ED7D", "#F7A35C", "#7CB5EC", "#434348", "#8085E9"],
- tooltip: {
- trigger: "item",
- },
- legend: {
- orient: "vertical",
- left: "left",
- },
- series: [
- {
- type: "pie",
- radius: "50%",
- data: this.getChartDataValue,
- emphasis: {
- itemStyle: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: "rgba(0, 0, 0, 0.5)",
- },
- },
- },
- ],
- };
- charts.setOption(option);
- var charts2 = echarts.init(document.getElementById("chartPieRight"));
- let option2 = {
- title: {
- text: this.chartsAName2,
- left: "center",
- },
- color: ["#90ED7D", "#F7A35C", "#7CB5EC", "#434348", "#8085E9"],
- tooltip: {
- trigger: "item",
- },
- legend: {
- orient: "vertical",
- left: "left",
- },
- series: [
- {
- type: "pie",
- radius: "50%",
- data: this.getChartDataValue2,
- emphasis: {
- itemStyle: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: "rgba(0, 0, 0, 0.5)",
- },
- },
- },
- ],
- };
- charts2.setOption(option2);
- },
- },
- };
|