123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950 |
- <template>
- <div class="light-matrix">
- <Row class="panel-2" type="">
- <Col :span="12" class="left-50-16">
- <div class="panel">
- <div class="dot left top"></div>
- <div class="dot left bottom"></div>
- <div class="dot right top"></div>
- <div class="dot right bottom"></div>
- <div class="item">
- <span class="svg-icon svg-icon-gray svg-icon-lg">
- <svg-icon svgid="svg-wind-site"></svg-icon>
- </span>
- </div>
- <div
- class="item curStyle"
- :class="data.color"
- v-for="(data, index) of panel1Data.datas"
- :key="index" @click="changeShow(data.category,data.fjzt)"
- >
- <div>{{ data.test }}</div>
- <div>{{ sourceMap[data.key] }}</div>
- </div>
- </div>
- </Col>
- <Col :span="12" class="left-50-16">
- <div class="panel">
- <div class="dot left top"></div>
- <div class="dot left bottom"></div>
- <div class="dot right top"></div>
- <div class="dot right bottom"></div>
- <div
- class="item2"
- v-for="(data, index) of panel2Data.datas"
- :key="index"
- >
- <div class="name">{{ data.test }}</div>
- <div class="num2">{{ sourceMap[data.key] }}</div>
- <div class="num1">×{{ data.num1 }}</div>
- <div class="num3">{{ data.num3 }}</div>
- </div>
- </div>
- </Col>
- </Row>
- <el-scrollbar>
- <div class="panel-box">
- <div v-for="(pItem, pIndex) of sourceMap.fjmap" :key="pIndex">
- <div class="panel-title">
- <div class="panel-title-name">
- <i class="svg-icon svg-icon-sm svg-icon-green">
- <SvgIcon :svgid="'svg-wind-site'"></SvgIcon>
- </i>
- <span>{{ sourceMap.fczbmap[pItem[pIndex].wpId].name }}</span>
- <div
- class="sub-title-item"
- v-for="(data, index) in tables[0].subTitleDatas"
- :key="index"
- >
- <span class="sub-title">{{ data.text }}</span>
- <span class="sub-count" :class="data.color">{{
- sourceMap.fczbmap[pItem[pIndex].wpId][data.key]
- }}</span>
- </div>
- </div>
- </div>
- <div class="panel-body">
- <div
- class="card"
- v-for="(cItem, cIndex) in pItem"
- :key="cIndex"
- v-show="cItem.isShow"
- :class="cItem.color"
- @click="goDetails(cItem)"
- >
- <div class="card-panel">
- <div class="card-left">
- <div class="tag">{{ cItem.wtId.substring(cItem.wtId.length - 3)}}</div>
- </div>
- <div class="card-right">
- <div class="num">{{ cItem.gl }} kw</div>
- <div class="num">{{ cItem.fs }} m/s</div>
- </div>
- </div>
- <div class="card-percent">
- <div class="split-item"></div>
- <div class="split-item"></div>
- <div class="split-item"></div>
- <div class="split-item"></div>
- <div class="split-item"></div>
- <div class="percent" :style="'width: ' + cItem.lyl + '%'"></div>
- </div>
- </div>
- <!-- 站位用 保证卡片布局最后一行不会有问题 -->
- <i class="blank" v-for="i in pItem.length" :key="i"></i>
- </div>
- </div>
- </div>
- </el-scrollbar>
- </div>
- </template>
- <script>
- import Row from "@/components/coms/grid/row.vue";
- import Col from "@/components/coms/grid/col.vue";
- import util from "@/helper/util.js";
- import api from "@api/cockpit/matrix/index.js";
- import store from "@store/index.js";
- import { isNumber } from "util";
- import SvgIcon from "../../components/coms/icon/svg-icon.vue";
- export default {
- // 名称
- name: "LightMatrix2",
- // 使用组件
- components: {
- Row,
- Col,
- SvgIcon,
- },
- // 数据
- data() {
- return {
- timmer: null, // 计时器
- sourceMap: {}, // 核心数据
- fillCategory: null, // 过滤条件
- fillFjzt: null, // 过滤条件
- panel1Data: {
- first: {
- icon: "fa fa-user",
- },
- datas: [
- {
- color: "write",
- test: "接入风机",
- key: "fcjrnum",
- category:'jrfj_FDC'
- },
- {
- color: "blue",
- test: "· 运行",
- key: "fcyxnum",
- category:'yx_FDC',
- fjzt:1
- },
- {
- color: "green",
- test: "· 待机",
- key: "fcdjnum",
- category:'dj_FDC',
- fjzt:0
- },
- {
- color: "pink",
- test: "· 限电",
- key: "fcxdnum",
- category:'xd_FDC',
- fjzt:5
- },
- {
- color: "red",
- test: "· 故障",
- key: "fcgznum",
- category:'gz_FDC',
- fjzt:2
- },
- {
- color: "orange",
- test: "· 检修",
- key: "fcwhnum",
- category:'jx_FDC',
- fjzt:4
- },
- {
- color: "write",
- test: "· 受累",
- key: "fcslnum",
- category:'sl_FDC',
- fjzt:6
- },
- {
- color: "gray",
- test: "· 离线",
- key: "fclxnum",
- category:'lx_FDC',
- fjzt:3
- },
- ],
- },
- panel2Data: {
- datas: [
- {
- test: "欠发电量",
- num1: 5,
- key: "r0qf",
- num3: "0%~5%",
- },
- {
- test: "欠发电量",
- num1: 4,
- key: "r1qf",
- num3: "5%~10%",
- },
- {
- test: "欠发电量",
- num1: 3,
- key: "r2qf",
- num3: "10%~20%",
- },
- {
- test: "欠发电量",
- num1: 2,
- key: "r3qf",
- num3: "20%~40%",
- },
- {
- test: "欠发电量",
- num1: 1,
- key: "r4qf",
- num3: ">40%",
- },
- ],
- },
- tables: [
- {
- col: 15,
- subTitleDatas: [
- {
- text: "接入台数",
- color: "write",
- key: "jrts",
- },
- {
- text: "待机台数",
- color: "green",
- key: "djts",
- },
- {
- text: "并网台数",
- color: "blue",
- key: "yxts",
- },
- {
- text: "限电台数",
- color: "pink",
- key: "xdts",
- },
- {
- text: "故障台数",
- color: "red",
- key: "gzts",
- },
- {
- text: "检修台数",
- color: "orange",
- key: "whts",
- },
- {
- text: "受累台数",
- color: "write",
- key: "slts",
- },
- {
- text: "离线台数",
- color: "gray",
- key: "lxts",
- },
- {
- text: "风速",
- color: "gray",
- key: "ssfs",
- },
- {
- text: "预测功率",
- color: "gray",
- key: "ycgl",
- },
- {
- text: "保证功率",
- color: "gray",
- key: "bzgl",
- },
- {
- text: "应发功率",
- color: "gray",
- key: "yfgl",
- },
- {
- text: "实际功率",
- color: "gray",
- key: "sjgl",
- },
- {
- text: "AGC指令",
- color: "gray",
- key: "agcygsd",
- },
- {
- text: "出线功率",
- color: "gray",
- key: "agccxyg",
- },
- ],
- datas: [
- {
- tag: "01",
- num1: "985.97 kw",
- num2: "6.45 m/s",
- percent: 70,
- color: "blue",
- },
- ],
- },
- ],
- };
- },
- // 函数
- methods: {
- getColor(fjzt) {
- switch (fjzt) {
- case 0:
- return "green";
- case 1:
- return "blue";
- case 2:
- return "red";
- case 3:
- return "gray";
- case 4:
- return "orange";
- case 5:
- return "pink";
- case 6:
- // return "pink";
- return "write";
- }
- },
- calcGfStr(calcStr) {
- return (
- parseInt(this.sourceMap[calcStr[0]]) +
- parseInt(this.sourceMap[calcStr[1]]) +
- ""
- );
- },
- // 切换显示种类
- changeShow(category, fjzt, skipFill) {
- // if (!skipFill) {
- // console.log('!skipFill:',!skipFill)
- // if (this.fillCategory === category) {
- // console.log('fillCategory:',this.fillCategory)
- // console.log('fillFjz:',this.fillFjzt)
- // this.fillCategory = null;
- // this.fillFjzt = null;
- // } else {
- this.fillCategory = category;
- this.fillFjzt = fjzt;
- // }
- // }
- let fjmap = this.BASE.deepCopy(this.sourceMap.fjmap);
- fjmap.forEach((pEle) => {
- // console.log('pele:',pEle)
- pEle.forEach((cEle) => {
- // console.log('cele:',cEle)
- cEle.isShow = true;
- if (!this.fillCategory) {
- cEle.isShow = true;
- // cEle.isShow=false;
- } else if (cEle.wpId.indexOf(category.split("_")[1]) !== -1) {
- if (isNumber(fjzt)) {
- cEle.fjzt === fjzt ? (cEle.isShow = true) : (cEle.isShow = false);
- } else {
- cEle.isShow = true;
- // cEle.isShow = false;
- }
- } else {
- cEle.isShow = true;
- }
- });
- });
- this.sourceMap.fjmap = fjmap;
- },
- // 请求服务
- requestData(showLoading) {
- api.matrixQfPush(showLoading).then(res =>{
- if (res.data) {
- let sourceMap = res.data;
- for (let key in sourceMap) {
- if (key !== "fczbmap" && key !== "fjmap") {
- sourceMap[key] += "";
- } else if (key === "fjmap") {
- sourceMap[key].forEach((pItem) => {
- pItem.forEach((cItem) => {
- cItem.color = this.getColor(cItem.fjzt);
- cItem.isShow = true;
- });
- });
- }
- }
- this.sourceMap = sourceMap;
- console.log('sourceMap:',this.sourceMap)
- if (this.fillCategory) {
- this.changeShow(this.fillCategory, this.fillFjzt, true);
- }
- } else {
- this.sourceMap = {};
- }
- })
- // let that = this;
- // that.API.requestData({
- // showLoading,
- // method: "POST",
- // subUrl: "matrix/matrixQfPush",
- // success(res) {
- // if (res.data) {
- // let sourceMap = res.data;
- // for (let key in sourceMap) {
- // if (key !== "fczbmap" && key !== "fjmap") {
- // sourceMap[key] += "";
- // } else if (key === "fjmap") {
- // sourceMap[key].forEach((pItem) => {
- // pItem.forEach((cItem) => {
- // cItem.color = that.getColor(cItem.fjzt);
- // cItem.isShow = true;
- // });
- // });
- // }
- // }
- // that.sourceMap = sourceMap;
- // console.log('sourceMap:',that.sourceMap)
- // if (that.fillCategory) {
- // that.changeShow(that.fillCategory, that.fillFjzt, true);
- // }
- // } else {
- // that.sourceMap = {};
- // }
- // },
- // });
- },
- // 查看风机详情
- goDetails(item) {
- this.$router.push({
- path: `/monitor/windsite/info/${item.wpId}/${item.wtId}`,
- });
- },
- },
- created() {
- let that = this;
- that.$nextTick(() => {
- that.requestData(true);
- that.timmer = setInterval(() => {
- that.requestData(false);
- }, that.$store.state.websocketTimeSec);
- });
- },
- mounted() {},
- unmounted() {
- clearInterval(this.timmer);
- this.timmer = null;
- },
- };
- </script>
- <style lang="less" scoped>
- @panelHeight: 6.481vh;
- @titleHeight: 26px;
- .light-matrix {
- // width: calc(100% - 1.111vh);
- height: calc(100vh - 7.222vh);
- display: flex;
- flex-direction: column;
- .panel-2 {
- .left-50-16 {
- width: calc(50% - 0.741vh);
- }
- }
- .panel {
- width: 100%;
- border: 0.093vh solid @darkgray;
- position: relative;
- padding: 1.111vh 2.222vh;
- background-color: fade(@darkgray, 20%);
- display: flex;
- height: 6.944vh;
- .dot {
- width: 0.185vh;
- height: 0.185vh;
- border-radius: 50%;
- background-color: @write;
- position: absolute;
- &.left {
- left: 0.37vh;
- }
- &.right {
- right: 0.37vh;
- }
- &.top {
- top: 0.37vh;
- }
- &.bottom {
- bottom: 0.37vh;
- }
- }
- .item {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- color: @write;
- i {
- color: @gray;
- font-size: 2.778vh;
- }
- &.write {
- color: @write;
- }
- &.green {
- color: @green;
- }
- &.blue {
- color: @darkBlue;
- }
- &.pink {
- color: @pink;
- }
- &.red {
- color: @red;
- }
- &.orange {
- color: @orange;
- }
- &.gray {
- color: @gray;
- }
- div {
- line-height: 2.222vh;
- &:first-child {
- font-size: @fontsize-s;
- }
- &:last-child {
- font-size: @fontsize;
- font-family: "Bicubik";
- }
- }
- }
- .item2 {
- flex: 1;
- display: flex;
- width: 20%;
- flex-wrap: wrap;
- .name {
- color: @gray;
- width: 50%;
- text-align: center;
- }
- .num2 {
- width: 50%;
- color: @yellow;
- text-align: left;
- }
- .num1 {
- width: 50%;
- color: @yellow;
- text-align: center;
- position: relative;
- &::after {
- content: "";
- position: absolute;
- width: 1.481vh;
- height: 0.556vh;
- background-color: @yellow;
- left: 1.204vh;
- top: 0.741vh;
- }
- }
- .num3 {
- width: 50%;
- color: @yellow;
- text-align: left;
- }
- }
- }
- .panel-box {
- margin-top: 1.481vh;
- flex-grow: 1;
- .panel-title {
- width: 100%;
- line-height: @titleHeight;
- background-color: fade(@darkgray, 40%);
- .panel-title-name {
- font-size: 12px;
- color: @green;
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- padding-left: 16px;
- i {
- margin-right: 0.7407vh;
- }
- .sub-title-item {
- display: flex;
- flex: 0 0 110px;
- .sub-title {
- flex: 0 0 auto;
- color: @gray;
- font-size: 12px;
- margin: 0 0.556vh 0 1.481vh;
- padding-top: 1px;
- }
- .sub-count {
- flex: 1 0 auto;
- font-size: 14px;
- font-family: "Bicubik";
- font-weight: 500;
- &.write {
- color: @write;
- }
- &.green {
- color: @green;
- }
- &.blue {
- color: @darkBlue;
- }
- &.pink {
- color: @pink;
- }
- &.red {
- color: @red;
- }
- &.orange {
- color: @orange;
- }
- &.gray {
- color: @gray;
- }
- }
- }
- }
- }
- .panel-body {
- height: calc(100% - 7.407vh);
- background-color: fade(@darkgray, 20%);
- padding: 4px 8px 8px 8px;
- margin-bottom: 8px;
- width: 100%;
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- justify-content: space-between;
- .blank {
- margin-right: 4px;
- flex: 1 0 110px;
- }
-
- .card {
- cursor: pointer;
- margin-right: 4px;
- margin-top: 4px;
- flex: 1 0 110px;
- }
- .card {
- border: 0.093vh solid;
- .card-panel {
- display: flex;
- .card-left {
- width: 30%;
- border-right: 0.093vh dotted;
- .tag {
- color: @write;
- font-size: 14px;
- width: 100%;
- text-align: center;
- padding-top: 0.3704vh;
- }
- }
- .card-right {
- width: 70%;
- .num {
- width: 100%;
- font-size: 13px;
- text-align: right;
- padding-right: 0.3704vh;
- margin: 0.3704vh 0;
- }
- }
- }
- .card-percent {
- height: 8px;
- position: relative;
- border-top: 1px solid;
- background-color: transparent;
- display: flex;
- .split-item {
- flex: 1;
- border-right: 1px solid @black;
- z-index: 1;
- &:last-child {
- border: none;
- }
- }
- .percent {
- height: 5px;
- background-color: @yellow;
- position: absolute;
- left: 0.185vh;
- top: 0.093vh;
- }
- }
- &.blue {
- border-color: @darkBlue;
- background-color: fade(@darkBlue, 15%);
- .card-panel {
- .card-left {
- .tag {
- color: @darkBlue;
- }
- border-color: @darkBlue;
- }
- .card-right {
- .num {
- color: @darkBlue;
- }
- }
- }
- .card-percent {
- border-color: @darkBlue;
- }
- }
- &.pink {
- border-color: @pink;
- background-color: fade(@pink, 15%);
- .card-panel {
- .card-left {
- .tag {
- color: @pink;
- }
- border-color: @pink;
- }
- .card-right {
- .num {
- color: @pink;
- }
- }
- }
- .card-percent {
- border-color: @pink;
- }
- }
- &.orange {
- border-color: @orange;
- background-color: fade(@orange, 15%);
- .card-panel {
- .card-left {
- .tag {
- color: @orange;
- }
- border-color: @orange;
- }
- .card-right {
- .num {
- color: @orange;
- }
- }
- }
- .card-percent {
- border-color: @orange;
- }
- }
- &.green {
- border-color: @green;
- background-color: fade(@green, 15%);
- .card-panel {
- .card-left {
- .tag {
- color: @green;
- }
- border-color: @green;
- }
- .card-right {
- .num {
- color: @green;
- }
- }
- }
- .card-percent {
- border-color: @green;
- }
- }
- &.gray {
- border-color: @darkgray;
- background-color: fade(@darkgray, 15%);
- .card-panel {
- .card-left {
- .tag {
- color: @white;
- }
- border-color: @darkgray;
- }
- .card-right {
- .num {
- color: @gray;
- }
- }
- }
- .card-percent {
- border-color: @darkgray;
- }
- }
- &.red {
- border-color: @red;
- .card-panel {
- background-color: @red;
- .card-left {
- .tag {
- color: @white;
- }
- border-color: @darkRed;
- }
- .card-right {
- .num {
- color: @write;
- }
- }
- }
- .card-percent {
- border-color: @red;
- }
- }
- &.write {
- border-color: @write;
- .card-panel {
- background-color: @write;
- .card-left {
- .tag {
- color: @white;
- }
- border-color: @black;
- .tag {
- color: @black;
- }
- }
- .card-right {
- .num {
- color: @black;
- }
- }
- }
- .card-percent {
- border-color: @write;
- }
- }
- }
- }
- }
- .curStyle {
- cursor: pointer;
- }
- }
- </style>
|