12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034 |
- <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) 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" :class="cItem.color">
- <div class="card-panel">
- <div class="card-left">
- <div class="tag">{{ cItem.wtnum }}</div>
- <div class="icon">
- <span class="svg-icon svg-icon-sm" :class="cItem.color == 'black' ? 'svg-icon-black' : cItem.color == 'gray' ? 'svg-icon-gray' : 'svg-icon-write'">
- <SvgIcon :svgid="cItem.icon"></SvgIcon>
- </span>
- </div>
- </div>
- <div class="card-right">
- <div class="num">
- <i class="svg-icon svg-icon-sm" :class="'svg-icon-' + cItem.color">
- <SvgIcon svgid="svg-A"></SvgIcon>
- </i>
- <span>{{ cItem.fdl }}</span>
- </div>
- <div class="num">
- <i class="svg-icon svg-icon-sm" :class="'svg-icon-' + cItem.color">
- <SvgIcon svgid="svg-W"></SvgIcon>
- </i>
- <span>{{ cItem.gl }}</span>
- </div>
- <div class="num">
- <i class="svg-icon svg-icon-sm" :class="'svg-icon-' + cItem.color">
- <SvgIcon svgid="svg-V"></SvgIcon>
- </i>
- <span>{{ cItem.fs }}</span>
- </div>
- </div>
- </div>
- </div>
- <!-- 站位用 保证卡片布局最后一行不会有问题 -->
- <i class="blank" v-for="i in pItem.length" :key="i"></i>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import Row from "@com/coms/grid/row.vue";
- import Col from "@com/coms/grid/col.vue";
- import SvgIcon from "@com/coms/icon/svg-icon.vue";
- import util from "@/helper/util.js";
- import store from "@store/index.js";
- export default {
- // 名称
- name: "LightMatrix",
- // 使用组件
- components: {
- Row,
- Col,
- SvgIcon,
- },
- // 数据
- data() {
- return {
- timmer: null, // 计时器
- sourceMap: {}, // 核心数据
- panelData: {
- first: {
- icon: "svg-photovoltaic",
- text: "接入光伏",
- key: "gfjrnum",
- },
- datas: [
- {
- color: "green",
- name: "待机",
- nameIcon: "svg-standby",
- calcStr: ["gfdjnum", "gfsdtjnum"],
- numIcon: "svg-manual",
- text1: "待风",
- key1: "gfdjnum",
- text2: "手动停机",
- key2: "gfsdtjnum",
- },
- {
- color: "blue",
- name: "运行",
- nameIcon: "svg-normal-power",
- calcStr: ["gfzcfdnum", "gfqxjclnum"],
- numIcon: "svg-drop-output",
- text1: "正常发电",
- key1: "gfzcfdnum",
- text2: "降出力运行",
- key2: "gfqxjclnum",
- },
- {
- color: "purple",
- name: "限电",
- nameIcon: "svg-limit-power",
- calcStr: ["gfxdjclnum", "gfxdtjnum"],
- numIcon: "svg-downtime",
- text1: "限电降出力",
- key1: "gfxdjclnum",
- text2: "停机",
- key2: "gfxdtjnum",
- },
- {
- color: "red",
- name: "故障",
- nameIcon: "svg-gz-downtime",
- calcStr: ["gfgztjnum", "gfcnsltjnum"],
- numIcon: "svg-field-involved",
- text1: "故障停机",
- key1: "gfgztjnum",
- text2: "场内受累",
- key2: "gfcnsltjnum",
- },
- {
- color: "orange",
- name: "检休",
- nameIcon: "svg-jx-downtime",
- calcStr: ["gfjcnum", "gfcnsljxnum"],
- numIcon: "svg-field-involved",
- text1: "检修停机",
- key1: "gfjxtjnum",
- text2: "产内受累",
- key2: "gfcnsljxnum",
- },
- {
- color: "write",
- name: "受累",
- calcStr: ["gfdwslnum", "gfhjslnum"],
- nameIcon: "svg-intranet-involvement",
- numIcon: "svg-environment",
- text1: "电网",
- key1: "gfdwslnum",
- text2: "环境",
- key2: "gfhjslnum",
- },
- {
- color: "gray",
- name: "离线",
- nameIcon: "svg-offline",
- key: "gflxnum",
- numIcon: "svg-unknown",
- text1: "离线",
- key1: "gflxnum",
- text2: "未知",
- key2: "gfwznum",
- },
- ],
- },
- 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: "01#",
- num1: 3262.8,
- num2: 12.6,
- num3: 12.6,
- icon: "svg-photovoltaic",
- color: "blue",
- },
- ],
- },
- ],
- };
- },
- // 函数
- 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]]) + "";
- },
- // 请求服务
- requestData(showLoading) {
- let that = this;
- that.API.requestData({
- showLoading,
- method: "POST",
- subUrl: "matrix/matrixDetialGfPush",
- 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;
- } else {
- that.sourceMap = {};
- }
- },
- });
- },
- },
- created() {
- let that = this;
- that.$nextTick(() => {
- that.requestData(false);
- 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: 3.704vh;
- .light-matrix {
- width: calc(100% - 1.111vh);
- height: calc(100vh - 7.222vh);
- display: flex;
- flex-direction: column;
- .panel {
- width: 100%;
- border: 0.093vh solid @darkgray;
- position: relative;
- padding: 1.111vh 2.222vh;
- background-color: fade(@darkgray, 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(@darkgray, 20%);
- display: flex;
- height: @panelHeight;
- .panel-item-gf-left {
- width: @panelHeight;
- height: @panelHeight;
- background-color: fade(@darkgray, 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;
- }
- }
- }
- .panel-item {
- width: 100%;
- height: @panelHeight;
- display: flex;
- font-size: @fontsize-s;
- .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;
- font-size: @fontsize-s;
- .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: 1px 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;
- }
- }
- }
- }
- &.pink {
- background-color: fade(@pink, 20%);
- color: @pink;
- .panel-item-left {
- background-color: fade(@pink, 20%);
- }
- .panel-item-right {
- .panel-item-ri {
- &:first-child {
- border-color: @pink;
- }
- }
- }
- }
- &.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(@darkgray, 20%);
- color: @gray;
- .panel-item-left {
- background-color: fade(@darkgray, 20%);
- }
- .panel-item-right {
- .panel-item-ri {
- &:first-child {
- border-color: @darkgray;
- }
- }
- }
- }
- &.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(@darkgray, 40%);
- .panel-title-name {
- font-size: @fontsize-s;
- color: @green;
- display: flex;
- align-items: center;
- i {
- margin: 0 0.556vh 0 1.481vh;
- }
- .sub-title-item {
- display: flex;
- .sub-title {
- color: @gray;
- font-size: @fontsize-s;
- margin: 0 0.556vh 0 1.481vh;
- }
- .sub-count {
- font-size: @fontsize-s;
- font-family: "Bicubik";
- font-weight: 500;
- &.write {
- color: @write;
- }
- &.green {
- color: @green;
- }
- &.blue {
- color: @blue;
- }
- &.pink {
- color: @pink;
- }
- &.red {
- color: @red;
- }
- &.orange {
- color: @orange;
- }
- &.gray {
- color: @gray;
- }
- }
- }
- }
- }
- .panel-body {
- background-color: fade(@darkgray, 20%);
- padding: 0.741vh;
- margin-bottom: 1.481vh;
- width: 100%;
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- justify-content: space-between;
- .blank {
- margin-right: 4px;
- flex: 1 0 125px;
- }
- .card {
- margin-right: 4px;
- margin-top: 4px;
- flex: 1 0 125px;
- }
- .card {
- border: 1px solid;
- .card-panel {
- display: flex;
- flex-grow: row;
- .card-left {
- width: 40%;
- border-right: 0.093vh dotted;
- display: flex;
- flex-direction: column;
- .tag {
- color: @write;
- font-size: @fontsize-s;
- width: 100%;
- text-align: center;
- }
- .icon {
- flex-grow: 1;
- display: flex;
- align-items: center;
- justify-content: center;
- i {
- font-size: 14px;
- }
- }
- }
- .card-right {
- width: 60%;
- .num {
- width: 100%;
- font-size: 14px;
- text-align: left;
- padding-right: 0.278vh;
- display: flex;
- align-items: center;
- justify-content: space-around;
- i {
- margin: 0 0.37vh;
- }
- span {
- flex: 1;
- }
- }
- }
- }
- .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%);
- .card-panel {
- .card-left {
- border-color: @darkBlue;
- .tag {
- background-color: @darkBlue;
- }
- .icon {
- svg {
- use {
- fill: @write;
- }
- }
- }
- }
- .card-right {
- .num {
- color: @darkBlue;
- }
- }
- }
- .card-percent {
- border-color: @darkBlue;
- }
- }
- &.pink {
- border-color: @pink;
- background-color: fade(@pink, 30%);
- .card-panel {
- .card-left {
- border-color: @pink;
- .tag {
- background-color: @pink;
- }
- .icon {
- svg {
- use {
- fill: @write;
- }
- }
- }
- }
- .card-right {
- .num {
- color: @pink;
- }
- }
- }
- .card-percent {
- border-color: @pink;
- }
- }
- &.orange {
- border-color: @orange;
- background-color: fade(@orange, 30%);
- .card-panel {
- .card-left {
- border-color: @orange;
- .tag {
- background-color: @orange;
- }
- .icon {
- use {
- fill: @write;
- }
- }
- }
- .card-right {
- .num {
- color: @orange;
- }
- }
- }
- .card-percent {
- border-color: @orange;
- }
- }
- &.green {
- border-color: @green;
- background-color: fade(@green, 30%);
- .card-panel {
- .card-left {
- border-color: @green;
- .tag {
- background-color: @green;
- }
- .icon {
- use {
- fill: @write;
- }
- }
- }
- .card-right {
- .num {
- color: @green;
- }
- }
- }
- .card-percent {
- border-color: @green;
- }
- }
- &.gray {
- border-color: @darkgray;
- background-color: fade(@darkgray, 30%);
- .card-panel {
- .card-left {
- border-color: @darkgray;
- .tag {
- background-color: @darkgray;
- }
- .icon {
- use {
- fill: @black;
- }
- }
- }
- .card-right {
- .num {
- color: @gray;
- }
- }
- }
- .card-percent {
- border-color: @darkgray;
- }
- }
- &.red {
- border-color: @red;
- .card-panel {
- background-color: @red;
- .card-left {
- border-color: @darkRed;
- .tag {
- background-color: @darkRed;
- }
- .icon {
- use {
- fill: @write;
- }
- }
- }
- .card-right {
- .num {
- color: @write;
- }
- }
- }
- .card-percent {
- border-color: @red;
- }
- }
- &.black {
- border-color: @write;
- .card-panel {
- background-color: @write;
- .card-left {
- border-color: @black;
- .tag {
- background-color: @darkgray;
- }
- .icon {
- .svg-icon {
- svg {
- use {
- fill: @black;
- }
- }
- }
- }
- }
- .card-right {
- .num {
- color: @black;
- }
- }
- }
- }
- }
- }
- }
- }
- </style>
|