1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093 |
- <template>
- <div class="light-matrix">
- <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>
- <Row>
- <Col :span="3">
- <div class="panel-item-gf">
- <div class="panel-item-gf-left">
- <span class="svg-icon svg-icon-write svg-icon-md">
- <SvgIcon :svgid="panelData.first.icon"></SvgIcon>
- </span>
- </div>
- <div class="panel-item-gf-right">
- <div class="panel-item-gf-up">{{ panelData.first.text }}</div>
- <div class="panel-item-gf-down">{{ sourceMap[panelData.first.key] || '---' }}</div>
- </div>
- </div>
- </Col>
- <Col :span="3" v-for="(data, index) of panelData.datas" :key="index">
- <div class="panel-item" :class="data.color">
- <div class="panel-item-left">
- <div class="panel-item-li">
- <span>{{ data.name }}</span>
- <span class="svg-icon svg-icon-sm" :class="'svg-icon-' + data.color">
- <SvgIcon :svgid="data.nameIcon"></SvgIcon>
- </span>
- </div>
- <div class="panel-item-li">
- <span v-if="data.calcStr && sourceMap">{{calcGfStr(data.calcStr) || '---'}}</span>
- <span v-else>{{sourceMap[data.key] || '---'}}</span>
- <span class="svg-icon svg-icon-sm" :class="'svg-icon-' + data.color">
- <SvgIcon :svgid="data.numIcon"></SvgIcon>
- </span>
- </div>
- </div>
- <div class="panel-item-right">
- <div class="panel-item-ri">
- <span>{{ data.text1 }}</span>
- <span>{{ sourceMap[data.key1] || '---' }}</span>
- </div>
- <div class="panel-item-ri">
- <span>{{ data.text2 }}</span>
- <span>{{ sourceMap[data.key2] || '---' }}</span>
- </div>
- </div>
- </div>
- </Col>
- </Row>
- </div>
- <div class="panel-box">
- <div v-for="(pItem, pIndex) in sourceMap.fjmap" :key="pIndex">
- <div class="panel-title">
- <div class="panel-title-name">
- <i class="fa fa-send"></i>
- <span>{{sourceMap.fczbmap[pItem[pIndex].wpId].name}}</span>
- <div class="sub-title-item" v-for="(data, index) of 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">
- <table>
- <tbody>
- <tr>
- <td v-for="(cItem, cIndex) in pItem" :key="cIndex">
- <div class="card" :class="cItem.color">
- <span class="center-icon svg-icon svg-icon-md" :class="cItem.color == 'write' ? 'svg-icon-black' : 'svg-icon-write'">
- <SvgIcon :svgid="mapping[cItem.color]"></SvgIcon>
- </span>
- <div class="card-panel">
- <div class="card-left">
- <div class="tag">{{ cItem.wtnum }}</div>
- <div class="num">
- <i class="fa fa-user"></i>
- <span>{{ cItem.fdl }}</span>
- </div>
- </div>
- <div class="card-right">
- <div class="num">
- <i class="fa fa-user"></i>
- <span>{{ cItem.gl }}</span>
- </div>
- <div class="num">
- <i class="fa fa-user"></i>
- <span>{{ cItem.fs }}</span>
- </div>
- </div>
- </div>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import Row from "@/components/coms/grid/row.vue";
- import Col from "@/components/coms/grid/col.vue";
- import SvgIcon from "@com/coms/icon/svg-icon.vue";
- import util from "@/helper/util.js";
- import { datainit, webtest } from "@tools/websocket.js";
- import store from "@store/index.js";
- export default {
- // 名称
- name: "LightMatrix3",
- // 使用组件
- components: {
- Row,
- Col,
- SvgIcon,
- },
- // 数据
- data () {
- return {
- loadingFlg: false, // 遮罩开关
- websocketServe: null, // websocket 服务实例
- sourceMap: {}, // 核心数据
- mapping: {
- green: "svg-standby",
- blue: "svg-normal-power",
- purple: "svg-limit-power",
- red: "svg-gz-downtime",
- orange: "svg-jx-downtime",
- gray: "svg-offline",
- write: "svg-intranet-involvement",
- },
- panelData: {
- first: {
- icon: "svg-photovoltaic",
- text: "接入风场",
- key: "fcjrnum",
- },
- datas: [
- {
- color: "green",
- name: "待机",
- nameIcon: "svg-standby",
- calcStr: ["fcdjnum", "fcsdtjnum"],
- numIcon: "svg-manual",
- text1: "待风",
- key1: "fcdjnum",
- text2: "手动停机",
- key2: "fcsdtjnum",
- },
- {
- color: "blue",
- name: "运行",
- nameIcon: "svg-normal-power",
- calcStr: ["fczcfdnum", "fcqxjclnum"],
- numIcon: "svg-drop-output",
- text1: "正常发电",
- key1: "fczcfdnum",
- text2: "降出力运行",
- key2: "fcqxjclnum",
- },
- {
- color: "purple",
- name: "限电",
- nameIcon: "svg-limit-power",
- calcStr: ["fcxdjclnum", "fcxdtjnum"],
- numIcon: "svg-downtime",
- text1: "限电降出力",
- key1: "fcxdjclnum",
- text2: "停机",
- key2: "fcxdtjnum",
- },
- {
- color: "red",
- name: "故障",
- nameIcon: "svg-gz-downtime",
- calcStr: ["fcgztjnum", "fccnsltjnum"],
- numIcon: "svg-field-involved",
- text1: "故障停机",
- key1: "fcgztjnum",
- text2: "场内受累",
- key2: "fccnsltjnum",
- },
- {
- color: "orange",
- name: "检休",
- nameIcon: "svg-jx-downtime",
- calcStr: ["fcjcnum", "fccnsljxnum"],
- numIcon: "svg-field-involved",
- text1: "检修停机",
- key1: "fcjxtjnum",
- text2: "产内受累",
- key2: "fccnsljxnum",
- },
- {
- color: "write",
- name: "受累",
- calcStr: ["fcdwslnum", "fchjslnum"],
- nameIcon: "svg-intranet-involvement",
- numIcon: "svg-environment",
- text1: "电网",
- key1: "fcdwslnum",
- text2: "环境",
- key2: "fchjslnum",
- },
- {
- color: "gray",
- name: "离线",
- nameIcon: "svg-offline",
- key: "fclxnum",
- numIcon: "svg-unknown",
- text1: "离线",
- key1: "fclxnum",
- text2: "未知",
- key2: "fcwznum",
- }
- ],
- },
- tables: [
- {
- col: 15,
- subTitleDatas: [
- {
- text: "接入台数",
- color: "write",
- key: "jrts"
- },
- {
- text: "待机台数",
- color: "green",
- key: "djts"
- },
- {
- text: "并网台数",
- color: "blue",
- key: "yxts",
- },
- {
- text: "限电台数",
- color: "purple",
- 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: "A-11",
- num1: 12.6,
- num2: 12.6,
- num3: 12.6,
- color: "blue",
- },
- ],
- groupDatas: [],
- },
- ],
- };
- },
- // 函数
- methods: {
- // 根据风机状态码返回对应 class
- getColor (fjzt) {
- switch (fjzt) {
- case 0:
- return 'green';
- break;
- case 1:
- return 'blue';
- break;
- case 2:
- return 'red';
- break;
- case 3:
- return 'gray';
- break;
- case 4:
- return 'orange';
- break;
- case 5:
- return 'purple';
- break;
- case 6:
- return 'write';
- break;
- }
- },
- calcGfStr (calcStr) {
- return (parseInt(this.sourceMap[calcStr[0]]) + parseInt(this.sourceMap[calcStr[1]])) + "";
- },
- createGroupDatas (table) {
- table.groupDatas = [];
- let tempDatas = [];
- table.datas.forEach((data, index) => {
- if (index % table.col == 0) {
- if (tempDatas.length > 0) {
- table.groupDatas.push(util.copy(tempDatas));
- tempDatas = [];
- }
- }
- tempDatas.push(util.copy(data));
- });
- if (tempDatas.length > 0) {
- table.groupDatas.push(util.copy(tempDatas));
- tempDatas = [];
- }
- },
- },
- created () {
- // 创建后
- let tempData = [];
- for (let i = 0; i < 45; i++) {
- tempData.push(util.copy(this.tables[0].datas[0]));
- if (i == 39) {
- tempData[i].color = "green";
- }
- if (i == 40) {
- tempData[i].color = "purple";
- }
- if (i == 41) {
- tempData[i].color = "orange";
- }
- if (i == 42) {
- tempData[i].color = "red";
- }
- if (i == 43) {
- tempData[i].color = "write";
- }
- if (i == 44) {
- tempData[i].color = "gray";
- }
- }
- this.tables[0].datas = util.copy(tempData);
- this.createGroupDatas(this.tables[0]);
- for (let i = 0; i < 5; i++) {
- this.tables.push(util.copy(this.tables[0]));
- }
- },
- mounted () {
- // 渲染后
- let that = this;
- that.loadingFlg = true;
- that.BASE.showLoading();
- that.$nextTick(() => {
- that.websocketServe && that.websocketServe.disconnect();
- that.API.requestData({
- method: "POST",
- subUrl: "admin/websocketdisconnect",
- success () {
- that.websocketServe = datainit("/topic/matrixdetialpushtask");
- }
- });
- });
- },
- watch: {
- // 监听 websocket 回调并包装数据用于展示
- '$store.state.windturbineMap': function (res) {
- this.loadingFlg && this.BASE.closeLoading();
- this.loadingFlg = false;
- if (res) {
- let sourceMap = JSON.parse(res);
- 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;
- } else {
- this.sourceMap = {};
- }
- }
- }
- };
- </script>
- <style lang="less" scoped>
- @panelHeight: 6.481vh;
- @titleHeight: 3.704vh;
- .light-matrix {
- width: calc(100% - 1.111vh);
- height: calc(100vh - 7.222vh);
- display: flex;
- flex-direction: column;
- .panel {
- width: 100%;
- border: 1px solid @gray;
- position: relative;
- padding: 1.111vh 2.222vh;
- background-color: fade(@gray, 20%);
- .dot {
- width: 2px;
- height: 2px;
- border-radius: 50%;
- background-color: @write;
- position: absolute;
- &.left {
- left: 4px;
- }
- &.right {
- right: 4px;
- }
- &.top {
- top: 4px;
- }
- &.bottom {
- bottom: 4px;
- }
- }
- .panel-item-gf {
- width: 100%;
- background-color: fade(@gray, 20%);
- display: flex;
- height: @panelHeight;
- .panel-item-gf-left {
- width: @panelHeight;
- height: @panelHeight;
- background-color: fade(@gray, 40%);
- display: flex;
- align-items: center;
- justify-content: center;
- i {
- font-size: 2.778vh;
- color: @write;
- }
- }
- .panel-item-gf-right {
- flex-grow: 1;
- color: @write;
- text-align: right;
- .panel-item-gf-up {
- height: @panelHeight / 2;
- border-bottom: 1px solid fade(@gray, 40%);
- line-height: @panelHeight / 2;
- padding-right: 1.111vh;
- font-size: @fontsize;
- }
- .panel-item-gf-down {
- height: @panelHeight / 2;
- line-height: @panelHeight / 2;
- padding-right: 1.111vh;
- font-weight: 600;
- font-size: @fontsize-l;
- }
- }
- }
- .panel-item {
- width: 100%;
- height: @panelHeight;
- display: flex;
- font-size: @fontsize;
- .panel-item-left {
- width: @panelHeight;
- height: @panelHeight;
- .panel-item-li {
- width: 100%;
- height: @panelHeight / 2;
- line-height: @panelHeight / 2;
- padding: 0 1.111vh;
- display: flex;
- align-items: center;
- .svg-icon {
- margin-left: auto;
- }
- }
- }
- .panel-item-right {
- flex-grow: 1;
- height: @panelHeight;
- .panel-item-ri {
- height: @panelHeight / 2;
- line-height: @panelHeight / 2;
- padding: 0 1.111vh;
- &:first-child {
- border-bottom: 0.093vh solid;
- }
- span {
- &:first-child {
- float: left;
- }
- &:last-child {
- float: right;
- color: @write;
- }
- }
- }
- }
- &.green {
- background-color: fade(@green, 20%);
- color: @green;
- .panel-item-left {
- background-color: fade(@green, 20%);
- }
- .panel-item-right {
- .panel-item-ri {
- &:first-child {
- border-color: @green;
- }
- }
- }
- }
- &.blue {
- background-color: fade(@darkBlue, 20%);
- color: @darkBlue;
- .panel-item-left {
- background-color: fade(@darkBlue, 20%);
- }
- .panel-item-right {
- .panel-item-ri {
- &:first-child {
- border-color: @darkBlue;
- }
- }
- }
- }
- &.purple {
- background-color: fade(@purple, 20%);
- color: @purple;
- .panel-item-left {
- background-color: fade(@purple, 20%);
- }
- .panel-item-right {
- .panel-item-ri {
- &:first-child {
- border-color: @purple;
- }
- }
- }
- }
- &.red {
- background-color: fade(@red, 20%);
- color: @red;
- .panel-item-left {
- background-color: fade(@red, 20%);
- }
- .panel-item-right {
- .panel-item-ri {
- &:first-child {
- border-color: @red;
- }
- }
- }
- }
- &.orange {
- background-color: fade(@orange, 20%);
- color: @orange;
- .panel-item-left {
- background-color: fade(@orange, 20%);
- }
- .panel-item-right {
- .panel-item-ri {
- &:first-child {
- border-color: @orange;
- }
- }
- }
- }
- &.gray {
- background-color: fade(@gray, 20%);
- color: @gray;
- .panel-item-left {
- background-color: fade(@gray, 20%);
- }
- .panel-item-right {
- .panel-item-ri {
- &:first-child {
- border-color: @gray;
- }
- }
- }
- }
- &.write {
- background-color: fade(@write, 20%);
- color: @write;
- .panel-item-left {
- background-color: fade(@write, 20%);
- }
- .panel-item-right {
- .panel-item-ri {
- &:first-child {
- border-color: @write;
- }
- }
- }
- }
- }
- }
- .panel-box {
- margin-top: 1.481vh;
- flex-grow: 1;
- overflow: auto;
- .panel-title {
- width: 100%;
- height: @titleHeight;
- line-height: @titleHeight;
- background-color: fade(@gray, 40%);
- .panel-title-name {
- font-size: 1.111vh;
- color: @green;
- display: flex;
- align-items: center;
- i {
- margin: 0 0.556vh 0 1.481vh;
- }
- .sub-title-item {
- .sub-title {
- color: @gray;
- font-size: 1.019vh;
- margin: 0 0.556vh 0 1.481vh;
- }
- .sub-count {
- font-size: 1.296vh;
- font-family: 'Bicubik';
- font-weight: 500;
- &.write {
- color: @write;
- }
- &.green {
- color: @green;
- }
- &.blue {
- color: @blue;
- }
- &.purple {
- color: @purple;
- }
- &.red {
- color: @red;
- }
- &.orange {
- color: @orange;
- }
- &.gray {
- color: @gray;
- }
- }
- }
- }
- }
- .panel-body {
- background-color: fade(@gray, 20%);
- padding: 0.741vh;
- margin-bottom: 1.481vh;
- table {
- width: 100%;
- .card {
- border: 1px solid;
- position: relative;
- .center-icon {
- font-size: 2.222vh;
- position: absolute;
- left: calc(50% - 1.111vh);
- top: calc(50% - 1.111vh);
- }
- .card-panel {
- display: flex;
- flex-grow: row;
- .card-left {
- width: 50%;
- border-right: 1px solid;
- .tag {
- color: @write;
- font-size: 1.111vh;
- width: 100%;
- text-align: center;
- border-bottom: 1px solid;
- padding: 0.37vh 0;
- }
- .num {
- width: 100%;
- font-size: 1.019vh;
- text-align: left;
- padding-right: 0.278vh;
- padding: 0.37vh 0;
- i {
- margin: 0 0.37vh;
- }
- }
- }
- .card-right {
- width: 50%;
- .num {
- width: 100%;
- font-size: 1.019vh;
- text-align: left;
- padding-right: 0.278vh;
- padding: 0.37vh 0;
- &:first-child {
- border-bottom: 1px solid;
- }
- i {
- margin: 0 0.37vh;
- }
- }
- }
- }
- .card-percent {
- height: 0.926vh;
- padding: 0.093vh 0.185vh;
- position: relative;
- border-top: 1px solid;
- background-color: transparent;
- .percent {
- height: 0.648vh;
- background-color: @green;
- position: absolute;
- left: 0.185vh;
- top: 0.093vh;
- }
- }
- &.blue {
- border-color: @darkBlue;
- background-color: fade(@darkBlue, 30%);
- .center-icon {
- color: @write;
- }
- .card-panel {
- .card-left {
- border-color: @darkBlue;
- .tag {
- border-color: @darkBlue;
- }
- .num {
- color: @darkBlue;
- }
- }
- .card-right {
- .num {
- color: @darkBlue;
- border-color: @darkBlue;
- }
- }
- }
- .card-percent {
- border-color: @darkBlue;
- }
- }
- &.purple {
- border-color: @purple;
- background-color: fade(@purple, 30%);
- .center-icon {
- color: @write;
- }
- .card-panel {
- .card-left {
- border-color: @purple;
- .tag {
- border-color: @purple;
- }
- .num {
- color: @purple;
- }
- }
- .card-right {
- .num {
- color: @purple;
- border-color: @purple;
- }
- }
- }
- .card-percent {
- border-color: @purple;
- }
- }
- &.orange {
- border-color: @orange;
- background-color: fade(@orange, 30%);
- .center-icon {
- color: @write;
- }
- .card-panel {
- .card-left {
- border-color: @orange;
- .tag {
- border-color: @orange;
- }
- .num {
- color: @orange;
- }
- }
- .card-right {
- .num {
- color: @orange;
- border-color: @orange;
- }
- }
- }
- .card-percent {
- border-color: @orange;
- }
- }
- &.green {
- border-color: @green;
- background-color: fade(@green, 30%);
- .center-icon {
- color: @write;
- }
- .card-panel {
- .card-left {
- border-color: @green;
- .tag {
- border-color: @green;
- }
- .num {
- color: @green;
- }
- }
- .card-right {
- .num {
- color: @green;
- border-color: @green;
- }
- }
- }
- .card-percent {
- border-color: @green;
- }
- }
- &.gray {
- border-color: @gray;
- background-color: fade(@gray, 30%);
- .center-icon {
- color: @write;
- }
- .card-panel {
- .card-left {
- border-color: @gray;
- .tag {
- border-color: @gray;
- }
- .num {
- color: @gray;
- }
- }
- .card-right {
- .num {
- color: @gray;
- border-color: @gray;
- }
- }
- }
- .card-percent {
- border-color: @gray;
- }
- }
- &.red {
- border-color: @red;
- .center-icon {
- color: @write;
- }
- .card-panel {
- background-color: @red;
- .card-left {
- border-color: @darkRed;
- .tag {
- border-color: @darkRed;
- }
- .num {
- color: @write;
- }
- }
- .card-right {
- .num {
- color: @write;
- border-color: @darkRed;
- }
- }
- }
- .card-percent {
- border-color: @red;
- }
- }
- &.write {
- border-color: @write;
- .center-icon {
- color: @black;
- }
- .card-panel {
- background-color: @write;
- .card-left {
- border-color: @black;
- .tag {
- color: @black;
- border-color: @black;
- }
- .num {
- color: @black;
- }
- }
- .card-right {
- .num {
- color: @black;
- border-color: @black;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- </style>
|