| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492 |
- <template>
- <div class="windTurbineMonitor">
- <div class="title">
- <div class="station">
- 机型:
- <el-select v-model="windModel" @change="changeModel">
- <el-option v-for="item in windModelSList" :key="item.value" :label="item.label" :value="item.value">
- </el-option>
- </el-select>
- </div>
- <div class="station">
- 风机:
- <el-select v-model="windSObj" clearable @clear="checkAllWind = false" collapse-tags multiple>
- <el-option label="全选" :class="{ selected: checkAllWind }" @click="funCheckwindsAll"></el-option>
- <el-option v-for="item in windSList" :key="item.aname" :label="item.aname" :value="item.aname">
- </el-option>
- </el-select>
- </div>
- <div class="station">
- 日期
- <div class="search-input">
- <el-date-picker
- v-model="dateTime"
- size="mini"
- type="datetime"
- format="YYYY/MM/DD HH:mm:ss"
- >
- </el-date-picker>
- </div>
- </div>
- <el-button round size="mini" class="searchColor" @click="funGetTableData"
- >搜 索</el-button
- >
- </div>
- <div class="data-bodys">
- <div class="line clearfix">
- <div class="leftContent left"><span>风机数据查询</span></div>
- </div>
- <div class="economicTable">
- <el-table
- :data="tableData"
- style="width: 100%"
- size="mini"
- stripe
- height="100%"
- @cell-click="cellClick"
- @header-click="headerClick"
- >
- <el-table-column
- align="center"
- prop="code"
- label="风机编号"
- width="200"
- ></el-table-column>
- <el-table-column
- v-for="(item, index) in tableColumn"
- :key="index"
- :prop="item.code"
- header-align="center"
- align="center"
- >
- <template #header>
- <!-- <el-tooltip
- class="box-item"
- effect="dark"
- :content="item.message"
- placement="top"
- > -->
- <div style="padding: 5px 0">
- <div style="font-size: 14px">{{item.label}}</div>
- <div style="font-size: 16px">{{item.title}}</div>
- </div>
- <!-- </el-tooltip> -->
- </template>
- <template #default="scoped">
- <span>{{scoped.row[item.code] || "-"}}</span>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <el-dialog
- v-model="componentsVisible"
- width="50%"
- custom-class="componentsDia"
- destroy-on-close
- >
- <template #title>
- <div class="dialog-title">
- <div class="title">测点</div>
- </div>
- </template>
- <div style="height: 100%">
- <!-- :componentsData="componentsData" -->
- <components-detail
- ref="componentsDetail"
- :windModel="windModel"
- @selectTags="selectTags"
- >
- </components-detail>
- </div>
- </el-dialog>
- <el-dialog
- v-model="dialogVisible"
- width="100%"
- custom-class="historyDetailModel"
- destroy-on-close
- fullscreen
- >
- <template #title>
- <div class="dialog-title">
- <div class="title">{{dialogTitle}}</div>
- </div>
- </template>
- <div style="height: 100%">
- <history-detail
- ref="windhistoryDetail"
- :dateTime="dateTime"
- :hiswindVal="hiswindVal"
- :hisuniVal="hisuniVal"
- :componentsData="componentsData"
- >
- </history-detail>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import dayjs from "dayjs";
- import historyDetail from "./historyDetail.vue";
- import componentsDetail from "./componentsDetail.vue";
- import { getApiequipmentListByWp2, getComponentsData, getComponentsTableData } from "@/api/monthlyPerformanceAnalysis";
- import dataJson from "./dataJson.json";
- export default {
- name: "windTurbineMonitor",
- components: {
- historyDetail,
- componentsDetail
- },
- data() {
- return {
- windSObj: [],
- windModel: "WT2000D121H85",
- windModelSList: [],
- dialogVisible: false,
- componentsVisible: false,
- windComponent: "",
- dialogTitle: "",
- checkAllWind: true,
- windSList: [],
- allwindSList: [],
- stationVal: "NX_FGS_HA_FDC_STA",
- dateTime: "",
- tableData: [],
- tableColumn: [],
- company: "",
- companyOptions: [],
- pickerTimer: [],
- componentsData: [],
- selectComponentsData: [],
- hiswindVal: "",
- hisuniVal: "",
- };
- },
- watch: {},
- filters: {},
- computed: {},
- created() {
- this.windModelSList = [
- {
- label: "中车",
- value: "WT2000D121H85"
- },
- {
- label: "联合动力",
- value: "UP2000-130"
- }
- ]
- // this.tableColumn = [
- // {
- // label: "日平均风速",
- // title: "m/s",
- // code: "RPJFS",
- // message: "区域集控.惠安风场.一期.风机1107.日平均风速"
- // },
- // {
- // label: "IGBT温度1",
- // title: "℃",
- // code: "AI002",
- // message: "区域集控.惠安风场.一期.风机1106.IGBT温度1"
- // }
- // ]
- // this.componentsData = dataJson.data.components
- // this.dataChange(dataJson.data.tableData)
- this.dateTime = dayjs().format("YYYY-MM-DD HH:mm:ss"),
- this.getWindData();
- },
- methods: {
- selectTags(tags) {
- this.selectComponentsData = tags
- this.tableColumn = []
- tags.forEach(it => {
- let obj = {
- label: it.description,
- title: it.unit || "",
- code: it.uniformCode,
- message: it.code
- }
- this.tableColumn.push(obj)
- })
- this.componentsVisible = false
- this.funGetTableData()
- },
- changeModel(val) {
- console.log("val===>>", val)
- this.windSList = [];
- this.allwindSList.forEach(it => {
- if (it.modelId === val) {
- this.windSList.push(it)
- }
- })
- },
- // 获取风机
- async getWindData() {
- let that = this
- that.windSList = [];
- let params = {
- wpid: that.stationVal,
- };
- const { data: datas } = await getApiequipmentListByWp2(params);
- if (datas.data.length) {
- that.allwindSList = datas.data
- datas.data.forEach(it => {
- if (it.modelId === that.windModel) {
- that.windSList.push(it)
- }
- })
- that.windSList.forEach((it, index) => {
- if (index < 10) {
- this.windSObj.push(it.aname)
- }
- })
- } else {
- that.windSList = datas.data;
- that.windVal = "";
- }
- that.funGetComponents();
- },
- //获取测点
- funGetComponents() {
- let that = this;
- let params = {
- modelId: that.windModel,
- query: ""
- }
- getComponentsData(params).then((res) => {
- if (res) {
- that.componentsData = res
- that.selectComponentsData = res.slice(0, 10)
- that.selectComponentsData.forEach(it => {
- let obj = {
- label: it.description,
- title: it.unit || "",
- code: it.uniformCode
- }
- this.tableColumn.push(obj)
- })
- that.funGetTableData()
- }
- });
- },
- //获取表格
- funGetTableData() {
- let that = this;
- let uni = []
- that.selectComponentsData.forEach((it, index) => {
- if (index < 10) {
- uni.push(it.uniformCode)
- }
- })
- let params = {
- windturbineIds: that.windSObj.join(","),
- uniformCodes: uni.join(","),
- time: new Date(that.dateTime).getTime() / 1000
- }
- getComponentsTableData(params).then((res) => {
- if (res) {
- that.dataChange(res)
- }
- });
- },
- dataChange(res) {
- if (res) {
- let data = []
- for(let i in res) {
- let obj = {
- code: i
- }
- res[i].forEach(it => {
- obj[it.uniformCode] = it.value
- })
- data.push(obj)
- }
- this.tableData = data
- }
- },
- cellClick(row, column, cell, event) {
- if (column.property !== "code") {
- this.dialogVisible = true;
- this.dialogTitle = "历史数据查询";
- this.hiswindVal = row.code
- this.hisuniVal = column.property
- }
- },
- headerClick() {
- this.componentsVisible = true
- },
- funCheckwindsAll() {
- this.checkAllWind = !this.checkAllWind;
- if (this.checkAllWind) {
- this.windSObj = this.windSList.map((o) => o.aname);
- } else {
- this.windSObj = [];
- }
- },
- },
- mounted() {},
- beforeUnmount() {},
- };
- </script>
- <style lang="less" scoped>
- .title {
- display: flex;
- flex-direction: row;
- align-items: center;
- margin-top: 10px;
- .station {
- display: flex;
- flex-direction: row;
- align-items: center;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #b3b3b3;
- margin-left: 10px;
- }
- .el-date-editor--daterange {
- background: transparent;
- border: 1px solid #2a374f;
- border-radius: 30px;
- height: 25px;
- .el-range-input {
- background: transparent;
- color: #fff;
- }
- .el-range-separator {
- width: 10%;
- color: #fff;
- position: relative;
- }
- }
- .search-input {
- margin-left: 10px;
- }
- .but {
- display: flex;
- flex-direction: row;
- align-content: center;
- margin-left: 20px;
- }
- .buttons {
- background-color: rgba(5, 187, 76, 0.2);
- border: 1px solid #3b6c53;
- color: #b3b3b3;
- font-size: 14px;
- &:hover {
- background-color: rgba(5, 187, 76, 0.5);
- color: #ffffff;
- }
- }
- }
- .windTurbineMonitor {
- height: 100%;
- width: 100%;
- padding: 0 10px;
- padding-bottom: 10px;
- .line {
- padding-bottom: 5px;
- .leftContent {
- width: 242px;
- height: 41px;
- line-height: 41px;
- background: url("~@/assets/imgs/title_left_bg.png") no-repeat;
- span {
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #05bb4c;
- margin-left: 25px;
- }
- }
- }
- .data-bodys {
- display: flex;
- flex-direction: column;
- background-color: rgba(0, 0, 0, 0.45);
- border-radius: 5px;
- height: calc(100% - 45px);
- padding-top: 10px;
- .economicTable {
- width: 100%;
- height: calc(100% - 40px);
- }
- }
- }
- .clearfix::after {
- content: "";
- clear: both;
- height: 0;
- line-height: 0;
- visibility: hidden;
- display: block;
- }
- .clearfix {
- zoom: 1;
- }
- .left {
- float: left;
- }
- .right {
- float: right;
- }
- .searchColor {
- background-color: rgba(5, 187, 76, 0.2);
- border: 1px solid #3b6c53;
- color: #b3b3b3;
- font-size: 14px;
- margin-left: 10px;
- &:hover {
- background-color: rgba(5, 187, 76, 0.5);
- color: #ffffff;
- }
- }
- </style>
- <style lang="less" scoped>
- ::v-deep .el-table__body-wrapper {
- background: #142446 !important;
- }
- </style>
- <style lang="less">
- .el-overlay {
- .el-overlay-dialog {
- overflow-y: hidden !important;
- .componentsDia{
- background: #142446 !important;
- margin-top: 10vh !important;
- .el-dialog__header{
- .dialog-title{
- padding-left: 20px;
- }
- }
- .el-dialog__body {
- padding: 0px 20px !important;
- }
- }
- .historyDetailModel{
- overflow-x: hidden !important;
- .el-dialog__header{
- .dialog-title{
- padding-left: 20px;
- }
- }
- }
- }
- }
- </style>
|