123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373 |
- <template>
- <div class="draught-fan-list">
- <div class="query mg-b-8">
- <div class="query-items">
- <div class="query-item">
- <div class="lable">场站:</div>
- <div class="search-input">
- <el-select
- v-model="wpId"
- clearable
- placeholder="请选择"
- popper-class="select"
- >
- <el-option
- v-for="item in wpArray"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- />
- </el-select>
- </div>
- </div>
- <div class="query-item">
- <div class="lable">日期:</div>
- <div class="search-input">
- <el-date-picker
- v-model="recorddate"
- type="month"
- value-format="YYYY-MM"
- placeholder="选择日期"
- popper-class="date-select"
- >
- </el-date-picker>
- </div>
- </div>
- </div>
- <div class="query-actions">
- <button class="btn green" @click="search()">查询</button>
- <button class="btn green" @click="exportExcel">导出</button>
- </div>
- </div>
- <div class="df-table">
- <ComTable height="78vh" :data="tableData">
- <template v-slot:tr v-if="tableData.data.length > 0">
- <tr>
- <td v-for="(item, index) in tableData.column" :key="index">
- {{ tableDataEnd[item.field] }}
- </td>
- </tr>
- </template>
- </ComTable>
- </div>
- <el-dialog
- :title="wtId + '号风机' + year + '年' + month + '月运行指标性能分析'"
- v-model="dialogVisible"
- width="70%"
- top="10vh"
- custom-class="modal"
- :close-on-click-modal="false"
- :destroy-on-close='true'
- >
- <ZnzhFx :wtId="wtId" :year="year" :month="month" />
- </el-dialog>
- </div>
- </template>
- <script>
- import ComTable from "../Decision/table.vue";
- import ZnzhFx from "./znzhfx.vue";
- export default {
- // 名称
- name: "cutAnalyse",
- // 使用组件
- components: {
- ComTable,
- ZnzhFx,
- },
- // 数据
- data() {
- const that = this;
- return {
- isAsc: "asc",
- wpArray: [],
- wpId: "",
- dialogVisible: false,
- wtId: "",
- year: "",
- month: "",
- recorddate: new Date(new Date().getTime() - 3600 * 1000 * 24).formatDate(
- "yyyy-MM"
- ),
- tableDataEnd: [], //合计
- tableData: {
- column: [
- {
- name: "机组编号",
- field: "windturbineName",
- cursor: "pointer",
- is_num: false,
- is_light: false,
- sortable: true,
- click(e, row) {
- that.goznzhfx(row);
- },
- },
- {
- name: "实际发电量(万千瓦时)",
- field: "fdl",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "理论发电量(万千瓦时)",
- field: "llfdl",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "设备利用小时数(小时)",
- field: "lyxs",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "设备可利用率(%)",
- field: "sbklyl",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "等效可用系数(%)",
- field: "tjxs",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "平均风速(m/s)",
- field: "fs",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "小风切入风速(m/s)",
- field: "xfqr",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "有效风时数(小时)",
- field: "yxfss",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "故障损失电量(万千瓦时)",
- field: "gzss",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "调度限电损失电量(万千瓦时)",
- field: "xdss",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "计划检修损失电量(万千瓦时)",
- field: "jxss",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "性能未达标损失电量(万千瓦时)",
- field: "xnss",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "受累损失电量(万千瓦时)",
- field: "slss",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "故障停用时间(小时)",
- field: "gzxs",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "检修停用时间(小时)",
- field: "jxxs",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "机组功率一致性系数(%)",
- field: "glyzxxs",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- ],
- data: [],
- },
- };
- },
- // 函数
- methods: {
- goznzhfx(row) {
- let that = this;
- that.wtId = row.windturbineid;
- that.year = new Date(this.recorddate).formatDate("yyyy");
- that.month = new Date(this.recorddate).formatDate("MM");
- that.dialogVisible = true;
- that.$router.push({path:`/decision/znzhfx/${row.windturbineid}/${new Date(this.recorddate).formatDate("yyyy")}/${new Date(this.recorddate).formatDate("MM")}`})
- },
- // 请求服务
- requestData() {
- let that = this;
- that.API.requestData({
- method: "GET",
- subUrl: "powercompare/windfarmAjax",
- success(res) {
- that.wpArray = res.data;
- that.wpId = res.data[0].id;
- that.getOutputSpeedList(that.wpId);
- },
- });
- },
- getOutputSpeedList(wpId) {
- let that = this;
- if (!that.wpId || !that.recorddate) {
- that.BASE.showMsg({
- msg: "场站与日期不可为空",
- });
- } else {
- that.API.requestData({
- method: "POST",
- subUrl: "singleanalysis/singleanalysisMain",
- showLoading: true,
- data: {
- wpId,
- isAsc: that.isAsc,
- year: new Date(that.recorddate).getFullYear(),
- month: new Date(that.recorddate).getMonth() + 1,
- },
- success(res) {
- res.data.forEach((ele) => {
- for (let key in ele) {
- ele[key] = ele[key] || 0;
- }
- });
- that.tableDataEnd = res.data[res.data.length - 1];
- res.data.pop();
- that.tableData.data = res.data;
- },
- });
- }
- },
- search() {
- this.getOutputSpeedList(this.wpId);
- },
- // 导出excel
- exportExcel() {
- let that = this;
- const { export_json_to_excel } = require("@tools/excel/Export2Excel.js"); // 注意这个Export2Excel路径
- // const tHeader = ['点名', '描述']; // 上面设置Excel的表格第一行的标题
- // const filterVal = ['id', 'name']; // 上面的index、nickName、name是tableData里对象的属性key值
- let tHeader = []; // 上面设置Excel的表格第一行的标题
- let filterVal = []; // 上面的index、nickName、name是tableData里对象的属性key值
- that.tableData.column.forEach((ele) => {
- if (ele.name !== "操作") {
- tHeader.push(ele.name);
- filterVal.push(ele.field);
- }
- });
- var list = [];
- that.tableData.data.forEach((i, index) => {
- list.push(i);
- });
- list.push(that.tableDataEnd);
- const data = that.formatJson(filterVal, list);
- export_json_to_excel(tHeader, data, "导出的Excel"); // 最后一个是表名字
- },
- formatJson(filterVal, jsonData) {
- return jsonData.map((v) => filterVal.map((j) => v[j]));
- },
- },
- created() {
- this.requestData();
- },
- mounted() {},
- unmounted() {},
- };
- </script>
- <style lang="less" scoped>
- .draught-fan-list {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- .btn-group-tabs {
- display: flex;
- flex-direction: row;
- .photovoltaic {
- margin-left: 1.481vh;
- }
- }
- .df-table {
- cursor: pointer;
- border: 0.093vh solid fade(@darkgray, 50%);
- position: relative;
- flex-grow: 1;
- margin-top: 1.481vh;
- &:before {
- content: "";
- width: 0.37vh;
- height: 0.37vh;
- background: @write;
- position: absolute;
- left: 0.278vh;
- top: 0.278vh;
- }
- tbody {
- height: calc(100vh - 166px);
- }
- }
- }
- </style>
- <style lang="less">
- .draught-fan-list {
- .el-dialog__body {
- height: 600px;
- max-height: 600px;
- overflow-y: scroll;
- }
- }
- </style>
|