123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466 |
- import * as echarts from "echarts";
- export default {
- data() {
- return {
- pickerOptions: {
- disabledDate(time) {
- return time.getTime() > Date.now();
- },
- },
- tb2: false,
- loading:true,
- loading2:true,
- tableData: [],
- options: [],
- fc: "",
- fc2: "",
- pj: "",
- pj2: "",
- timedate: [],
- multipleSelection: [],
- multipleSelection1: [],
- multipleSelection2: [],
- orderByColumn: "",
- isAsc: "asc",
- fdcLineData: [],
- fdcLineData2: [],
- currentPage2: 1,
- pagesize: 10,
- wpId: "",
- pjId: "",
- beginDate: "",
- endDate: "",
- dialogTableVisible: false,
- sortInOrder: [],
- sortInOrderTop: [],
- pjName1: "",
- pjName2: "",
- sortInOrde2: [],
- getTableData: [],
- fdcND: [],
- fdcND1: "",
- fdcND2: "",
- wp_n_1: {},
- wp_n_2: {},
- wpIdslist: {
- name: "",
- id: "",
- },
- projectlist: {
- name: "",
- id: "",
- },
- projectlist2: {
- name: "",
- id: "",
- },
- };
- },
- filters: {
- rounding(fc) {
- return fc.toFixed(2);
- },
- },
- created() {
- this.timedate[0] = this.$route.query.beginDate;
- this.timedate[1] = this.$route.query.endDate;
- this.fc = this.$route.query.wpId;
- this.query_xml();
- this.query_wpid();
- this.YardTableData();
- },
- methods: {
- /**
- * 查询风机列表信息
- */
- queryApData() {
- this.YardTableData();
- if (this.fc2 != null || this.fc2 != undefined) {
- this.tb2 = true;
- if (this.timedate == "") {
- this.beginDate = this.$route.query.beginDate;
- this.endDate = this.$route.query.endDate;
- } else {
- this.beginDate = this.timedate[0];
- this.endDate = this.timedate[1];
- }
- var guilty = new URLSearchParams();
- guilty.append("pageNum", this.currentPage2);
- guilty.append("pageSize", this.pagesize);
- guilty.append("orderByColumn", this.orderByColumn);
- guilty.append("isAsc", this.isAsc);
- guilty.append("wpId", this.fc2);
- guilty.append("wtId", this.pj2);
- guilty.append("beginDate", this.beginDate);
- guilty.append("endDate", this.endDate);
- this.API.post("/contrast/benchmarkWtList", guilty).then((res) => {
- this.fdcLineData2 = res.data;
- this.loading2 = false;
- }).catch(error =>{
- this.$message.error('获取数据失败');
- });
- }
- },
- /**
- * 查询检查
- */
- querycheck(){
- if(this.multipleSelection1.length + this.multipleSelection2.length ==2){
- this.queryApDataMx();
- }else{
- this.$message({
- message:"请选择两个项目!",
- type:'error'
- });
- return
- }
- },
- /**
- * 判断是否选择两项 改变数据格式
- */
- queryApDataMx() {
- this.dialogTableVisible = true;
- this.wp_n_1 = {};
- this.wp_n_2 = {};
- this.getTableData = [];
- if (
- this.multipleSelection1.length + this.multipleSelection2.length ==
- 2
- ) {
- this.multipleSelection = this.multipleSelection1.concat(
- this.multipleSelection2
- );
- } else {
- this.$message.error("请选两个风场!");
- return;
- }
- if (this.multipleSelection.length == 2) {
-
- this.wp_n_1 = this.multipleSelection[0];
- this.wp_n_2 = this.multipleSelection[1];
- this.pjName1 = this.multipleSelection[0].wtName;
- this.pjName2 = this.multipleSelection[1].wtName;
- this.fdcND1 =
- this.multipleSelection[0].wtName +
- "" +
- this.BASE.getBzDate(new Date(this.multipleSelection[0].recordDate),0);
- this.fdcND2 =
- this.multipleSelection[1].wtName +
- "" +
- this.BASE.getBzDate(new Date(this.multipleSelection[1].recordDate),0);
- this.fdcND.push(this.fdcND1, this.fdcND2);
- this.sortInOrder.push(
- this.multipleSelection[0].fnlyl,
- this.multipleSelection[0].xqjsl,
- this.multipleSelection[0].ztzhjsl,
- this.multipleSelection[0].fwjsl,
- this.multipleSelection[0].slssl,
- this.multipleSelection[0].xnssl,
- this.multipleSelection[0].qfl,
- this.multipleSelection[0].jxssl,
- this.multipleSelection[0].gzssl
- );
- this.sortInOrderTop.push(
- this.multipleSelection[1].fnlyl,
- this.multipleSelection[1].xqjsl,
- this.multipleSelection[1].ztzhjsl,
- this.multipleSelection[1].fwjsl,
- this.multipleSelection[1].slssl,
- this.multipleSelection[1].xnssl,
- this.multipleSelection[1].qfl,
- this.multipleSelection[1].jxssl,
- this.multipleSelection[1].gzssl
- );
- // for (let i = 0; i < this.multipleSelection.length; i++) {
- // this.sortInOrde2.push({
- // product: this.multipleSelection[i].wtName+" "+this.BASE.getBzDate(this.multipleSelection[i].recordDate,0),
- // "限电损失电量单位:万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.multipleSelection[0].scadafdl,
- data2: this.multipleSelection[1].scadafdl,
- });
- this.getTableData.push({
- index: "故障损失电量",
- data1: this.multipleSelection[0].gzss,
- data2: this.multipleSelection[1].gzss,
- });
- this.getTableData.push({
- index: "检修损失电量",
- data1: this.multipleSelection[0].jxssl,
- data2: this.multipleSelection[1].jxssl,
- });
- this.getTableData.push({
- index: "性能未达标损失电量",
- data1: this.multipleSelection[0].xnsslfraction,
- data2: this.multipleSelection[1].xnsslfraction,
- });
- this.getTableData.push({
- index: "受累损失电量",
- data1: this.multipleSelection[0].slss,
- data2: this.multipleSelection[1].slss,
- });
- this.getTableData.push({
- index: "风能利用率",
- data1: this.multipleSelection[0].fnlyl,
- data2: this.multipleSelection[1].fnlyl,
- });
- this.getTableData.push({
- index: "故障损失率",
- data1: this.multipleSelection[0].gzssl,
- data2: this.multipleSelection[1].gzssl,
- });
- this.getTableData.push({
- index: "检修损失率",
- data1: this.multipleSelection[0].jxssl,
- data2: this.multipleSelection[1].jxssl,
- });
- this.getTableData.push({
- index: "弃风率",
- data1: this.multipleSelection[0].qfl,
- data2: this.multipleSelection[1].qfl,
- });
- this.getTableData.push({
- index: "性能损失率",
- data1: this.multipleSelection[0].xnssl,
- data2: this.multipleSelection[1].xnssl,
- });
- this.getTableData.push({
- index: "受累损失率",
- data1: this.multipleSelection[0].slssl,
- data2: this.multipleSelection[1].slssl,
- });
- this.getTableData.push({
- index: "复位及时率",
- data1: this.multipleSelection[0].fwjsl,
- data2: this.multipleSelection[1].fwjsl,
- });
- this.getTableData.push({
- index: "消缺及时率",
- data1: this.multipleSelection[0].xqjsl,
- data2: this.multipleSelection[1].xqjsl,
- });
- this.getTableData.push({
- index: "状态转换率",
- data1: this.multipleSelection[0].ztzhjsl,
- data2: this.multipleSelection[1].ztzhjsl,
- });
- }
- this.$nextTick(function () {
- this.ECZM.leida_tc("leiDaTu3" , this.sortInOrder,this.pjName1,this.sortInOrderTop,this.pjName2);
- this.ECZM.bar_tc("leiDaTu4" , this.wp_n_1 , this.wp_n_2 ,this.wp_n_1.wtId , this.wp_n_2.wtId);
-
- });
- },
- /**
- * 保留两位小数
- */
- filter_fdl(cellValue) {
- return parseFloat(cellValue.scadafdl).toFixed(2);
- },
- /**
- * 查询风机列表信息
- */
- YardTableData() {
- this.API.get("/powercompare/windfarmAjax").then((res) => {
- this.options = res.data;
- }).catch(error =>{
- this.$message.error('获取数据失败');
- });
- this.wpId = this.$route.query.wpId;
- if (this.timedate == "") {
- this.beginDate = this.$route.query.beginDate;
- this.endDate = this.$route.query.endDate;
- } else {
- this.beginDate = this.timedate[0];
- this.endDate = this.timedate[1];
- }
- var guilty = new URLSearchParams();
- guilty.append("pageNum", this.currentPage2);
- guilty.append("pageSize", this.pagesize);
- guilty.append("orderByColumn", this.orderByColumn);
- guilty.append("isAsc", this.isAsc);
- if (this.fc == "") {
- guilty.append("wpId", this.wpId);
- } else {
- guilty.append("wpId", this.fc);
- }
- if (this.pj == "") {
- guilty.append("wtId", this.pjId);
- } else {
- guilty.append("wtId", this.pj);
- }
- guilty.append("beginDate", this.beginDate);
- guilty.append("endDate", this.endDate);
- this.API.post("/contrast/benchmarkWtList", guilty).then((res) => {
- this.fdcLineData = res.data;
- this.loading = false;
- }).catch(error =>{
- this.$message.error('获取数据失败');
- });
- },
- /**
- * 获取项目
- */
- query_xml() {
- this.pj = "";
- this.xl = "";
- this.pj2 = "";
- this.xl2 = "";
- this.API
- .get("powercompare/windturbineAjax?wpId=" + this.fc)
- .then((res) => {
- this.projectlist = res.data;
- }).catch(error =>{
- this.$message.error('获取数据失败');
- });
- },
- query_xml2() {
- this.pj = "";
- this.xl = "";
- this.API
- .get("powercompare/windturbineAjax?wpId=" + this.fc2)
- .then((res) => {
- this.projectlist2 = res.data;
- });
- },
- /**
- * 查询风场
- */
- query_wpid() {
- this.API.get("powercompare/windfarmAjax?").then((res) => {
- this.wpIdslist = res.data;
- }).catch(error =>{
- this.$message.error('获取数据失败');
- });
- },
- headStyle() {
- return "text-align:left";
- },
- handleSelectionChange(val) {
- this.sortInOrder = [];
- this.sortInOrderTop = [];
- this.getTableData = [];
- this.sortInOrde2 = [];
- this.multipleSelection1 = [];
- this.multipleSelection1 = val;
- },
- handleSelectionChange2(val) {
- this.sortInOrder = [];
- this.sortInOrderTop = [];
- this.getTableData = [];
- this.sortInOrde2 = [];
- this.multipleSelection2 = [];
- this.multipleSelection2 = val;
- },
- changeTableSort(column) {
- this.orderByColumn = column.prop;
- if (column.order == "descending") {
- this.isAsc = "desc";
- } else if (column.order == "ascending") {
- this.isAsc = "asc";
- }
- this.YardTableData();
- },
- filter_date(cellValue) {
- let date = new Date(cellValue.recordDate);
- return this.BASE.getBzDate(date,0);
- },
- drawPie2() {
- var charts2;
- if (charts2 != null && charts2 != "" && charts2 != undefined) {
- charts2.dispose();
- }
- charts2 = this.$echarts.init(document.getElementById("leiDaTu4"));
- let option2 = {
- legend: {
- orient: "vertical",
- left: "right",
- },
- tooltip: {},
- dataset: {
- dimensions: [
- "product",
- "限电损失电量单位:万KWh",
- "故障损失电量单位:万KWh",
- "检修损失电量单位:万KWh",
- "性能损失电量单位:万KWh",
- "受累损失电量单位:万KWh",
- ],
- source: this.sortInOrde2,
- },
- xAxis: {
- type: "category",
- date: this.fdcND,
- axisPointer: {
- type: "shadow",
- },
- },
- yAxis: { type: "category" },
- series: [
- {
- // barGap:'100%',/*多个并排柱子设置柱子之间的间距*/
- type: "bar",
- barWidth: 30,
- itemStyle: {
- normal: {
- color: "#D201D8",
- },
- },
- },
- {
- type: "bar",
- barWidth: 30,
- itemStyle: {
- normal: {
- color: "#FD0100",
- },
- },
- },
- {
- type: "bar",
- barWidth: 30,
- itemStyle: {
- normal: {
- color: "#FF7B16",
- },
- },
- },
- {
- type: "bar",
- barWidth: 30,
- itemStyle: {
- normal: {
- color: "#8085E9",
- },
- },
- },
- {
- type: "bar",
- barWidth: 30,
- itemStyle: {
- normal: {
- color: "#A6A6A6",
- },
- },
- },
- ],
- };
- charts2.clear();
- charts2.setOption(option2);
- },
- /**
- * 返回
- */
- goReturn() {
- this.$router.push("/benchmark_property");
- },
- toExcel() {},
- },
- };
|