123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743 |
- <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="date"
- value-format="YYYY-MM-DD"
- 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"></ComTable>
- </div>
- <el-dialog
- title="单机历史性能分析"
- v-model="dialogShow"
- width="85%"
- top="10vh"
- custom-class="modal"
- :close-on-click-modal="true"
- @closed="dialogType = ''"
- >
- <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="wpId2"
- clearable
- placeholder="请选择"
- popper-class="select"
- @change="reGetWtArray"
- >
- <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-select
- v-model="wtId"
- clearable
- placeholder="请选择"
- popper-class="select"
- >
- <el-option
- v-for="item in wtArray"
- :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="beginDate"
- type="date"
- value-format="YYYY-MM-DD"
- placeholder="选择日期"
- popper-class="date-select"
- >
- </el-date-picker>
- </div>
- </div>
- <div class="query-item">
- <div class="lable">结束日期:</div>
- <div class="search-input">
- <el-date-picker
- v-model="endDate"
- type="date"
- value-format="YYYY-MM-DD"
- placeholder="选择日期"
- popper-class="date-select"
- >
- </el-date-picker>
- </div>
- </div>
- </div>
- <div class="query-actions">
- <button class="btn green" @click="reGetHistoryTableData">查询</button>
- <button class="btn green" @click="exportExcel2">导出</button>
- </div>
- </div>
- <ComTable height="78vh" :data="historyTableData"></ComTable>
- </el-dialog>
- </div>
- </template>
- <script>
- import ComTable from "@com/coms/table/table.vue";
- import api from "@api/economic/index.js";
- export default {
- // 名称
- name: "cutAnalyse",
- // 使用组件
- components: {
- ComTable,
- },
- // 数据
- data() {
- const that = this;
- return {
- isAsc: "asc",
- wpArray: [],
- wtArray: [],
- wpId: "",
- wtId: "",
- wpId2: "",
- recorddate: new Date(new Date().getTime() - 3600 * 1000 * 24).formatDate(
- "yyyy-MM-dd"
- ),
- beginDate: "",
- endDate: "",
- dialogShow: false,
- tableData: {
- column: [
- {
- name: "风机",
- field: "windturbineid",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "型号",
- field: "modelid",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日排行榜",
- field: "daytop",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日拟合优度(%)",
- field: "daygoodness",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日风速(m/s)",
- field: "dayspeed",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "月排行榜",
- field: "monthtop",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "月拟合优度(%)",
- field: "monthgoodness",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "月风速(m/s)",
- field: "monthspeed",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "年排行榜",
- field: "yeartop",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "年拟合优度(%)",
- field: "yeargoodness",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "年风速(m/s)",
- field: "yearspeed",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "操作",
- field: "",
- is_num: false,
- is_light: false,
- template() {
- return "<el-button type='text' style='cursor: pointer;'>详情</el-button>";
- },
- click(e, row) {
- that.jumpUrl(row);
- },
- },
- {
- name: "操作",
- field: "",
- is_num: false,
- is_light: false,
- template() {
- return "<el-button type='text' style='cursor: pointer;'>历史</el-button>";
- },
- click(e, row) {
- that.getOutputspeedHistoryList(row);
- },
- },
- ],
- data: [],
- },
- historyTableData: {
- column: [
- {
- name: "日期",
- field: "time",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "风机",
- field: "windturbineid",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日发电量",
- field: "c1",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日理论发电量",
- field: "c2",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日平均功率",
- field: "c3",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日运行小时",
- field: "c4",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日待机小时",
- field: "c5",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日故障小时",
- field: "c6",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日维护小时",
- field: "c7",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日终端小时",
- field: "c8",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日有效风时",
- field: "c9",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日损失电量",
- field: "c10",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日报警次数",
- field: "c11",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日停机次数",
- field: "c12",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日不饱和次数",
- field: "c13",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日设备可利用率",
- field: "c14",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日平均温度",
- field: "c15",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日平均湿度",
- field: "c16",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日平均压强",
- field: "c17",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日拟合优度",
- field: "c18",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- {
- name: "日实际/保证",
- field: "c19",
- is_num: false,
- is_light: false,
- sortable: true,
- },
- ],
- data: [],
- },
- };
- },
- // 函数
- methods: {
- // 请求服务
- requestData() {
- api.powercompareWindfarmAjax({}).then((res) => {
- this.wpArray = res.data;
- this.wpId = res.data[0].id;
- this.getOutputSpeedList(that.wpId);
- });
- // 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 {
- api
- .goodnessWindturbinegoodness({
- wpId,
- isAsc: that.isAsc,
- recorddate: that.recorddate,
- })
- .then((res) => {
- this.tableData.data = res.data.list;
- });
- // that.API.requestData({
- // method: "POST",
- // subUrl: "goodness/windturbinegoodness",
- // data: {
- // wpId,
- // isAsc: that.isAsc,
- // recorddate: that.recorddate,
- // },
- // success(res) {
- // that.tableData.data = res.data.list;
- // },
- // });
- }
- },
- getOutputspeedHistoryList(item) {
- api
- .powercompareWindturbineAjax({
- wpId: item.windtpowerstationid,
- })
- .then((res) => {
- this.wtArray = res.data;
- this.wpId2 = item.windtpowerstationid;
- this.wtId = item.windturbineid;
- this.beginDate = new Date().formatDate("yyyy-MM") + "-01";
- this.endDate = new Date().formatDate("yyyy-MM-dd");
- api
- .goodnessGoodhistorylist({
- wpId: this.wpId2,
- wtId: this.wtId,
- beginDate: this.beginDate,
- endDate: this.endDate,
- })
- .then((res) => {
- res.data.forEach((ele) => {
- ele.time = new Date(ele.recorddate).formatDate("yyyy-MM-dd");
- });
- this.historyTableData.data = res.data;
- this.dialogShow = true;
- });
- // that.API.requestData({
- // method: "POST",
- // subUrl: "goodness/goodhistorylist",
- // data: {
- // wpId: that.wpId2,
- // wtId: that.wtId,
- // beginDate: that.beginDate,
- // endDate: that.endDate,
- // },
- // success(res) {
- // res.data.forEach((ele) => {
- // ele.time = new Date(ele.recorddate).formatDate("yyyy-MM-dd");
- // });
- // that.historyTableData.data = res.data;
- // that.dialogShow = true;
- // },
- // });
- });
- // let that = this;
- // that.API.requestData({
- // method: "GET",
- // subUrl: "powercompare/windturbineAjax",
- // data: {
- // wpId: item.windtpowerstationid,
- // },
- // success(res) {
- // that.wtArray = res.data;
- // that.wpId2 = item.windtpowerstationid;
- // that.wtId = item.windturbineid;
- // that.beginDate = new Date().formatDate("yyyy-MM") + "-01";
- // that.endDate = new Date().formatDate("yyyy-MM-dd");
- // that.API.requestData({
- // method: "POST",
- // subUrl: "goodness/goodhistorylist",
- // data: {
- // wpId: that.wpId2,
- // wtId: that.wtId,
- // beginDate: that.beginDate,
- // endDate: that.endDate,
- // },
- // success(res) {
- // res.data.forEach((ele) => {
- // ele.time = new Date(ele.recorddate).formatDate("yyyy-MM-dd");
- // });
- // that.historyTableData.data = res.data;
- // that.dialogShow = true;
- // },
- // });
- // },
- // });
- },
- reGetWtArray() {
- api
- .powercompareWindturbineAjax({
- wpId: this.wpId2,
- })
- .then((res) => {
- this.wtArray = res.data;
- this.wtId = res.data[0].id;
- });
- // let that = this;
- // that.API.requestData({
- // method: "GET",
- // subUrl: "powercompare/windturbineAjax",
- // data: {
- // wpId: that.wpId2,
- // },
- // success(res) {
- // that.wtArray = res.data;
- // that.wtId = res.data[0].id;
- // },
- // });
- },
- reGetHistoryTableData() {
- let that = this;
- if (!that.wpId2) {
- that.BASE.showMgs({
- msg: "场站不可为空",
- });
- } else if (!that.wtId) {
- that.BASE.showMgs({
- msg: "风机不可为空",
- });
- } else if (!that.beginDate || !that.endDate) {
- that.BASE.showMgs({
- msg: "开始日期与结束日期不可为空",
- });
- } else {
- // -------------------------------------------------
- api.goodnessGoodhistorylist({
- wpId: this.wpId2,
- wtId: this.wtId,
- beginDate: this.beginDate,
- endDate: this.endDate,
- }).then((res) => {
- res.data.forEach((ele) => {
- ele.time = new Date(ele.recorddate).formatDate("yyyy-MM-dd");
- });
- this.historyTableData.data = res.data;
- this.dialogShow = true;
- });
- // that.API.requestData({
- // method: "POST",
- // subUrl: "goodness/goodhistorylist",
- // showLoading: true,
- // data: {
- // wpId: that.wpId2,
- // wtId: that.wtId,
- // beginDate: that.beginDate,
- // endDate: that.endDate,
- // },
- // success(res) {
- // res.data.forEach((ele) => {
- // ele.time = new Date(ele.recorddate).formatDate("yyyy-MM-dd");
- // });
- // that.historyTableData.data = res.data;
- // that.dialogShow = true;
- // },
- // });
- }
- },
- 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);
- }
- });
- const list = that.tableData.data; //把要导出的数据tableData存到list
- const data = that.formatJson(filterVal, list);
- export_json_to_excel(tHeader, data, "导出的Excel"); // 最后一个是表名字
- },
- // 弹窗表格导出excel
- exportExcel2() {
- 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.historyTableData.column.forEach((ele) => {
- if (ele.name !== "操作") {
- tHeader.push(ele.name);
- filterVal.push(ele.field);
- }
- });
- const list = that.historyTableData.data; //把要导出的数据tableData存到list
- 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]));
- },
- // 页面跳转
- jumpUrl(item) {
- this.$router.push(
- `/decision/performanceAnalysis/detail/${item.windtpowerstationid}/${item.windturbineid}`
- );
- },
- },
- 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 {
- border: 0.093vh solid fade(@darkgray, 50%);
- position: relative;
- overflow: auto;
- 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>
|