1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102 |
- <template>
- <div class="problem" @contextmenu="contextmenu">
- <div class="body">
- <img class="logo" src="../../assets/img/logo.png" alt="" />
- <div class="titleBar">
- <div class="title" @click="parametersContrast()">设备区</div>
- <el-select
- @change="listedChange()"
- class="inputs"
- v-model="selectValue"
- placeholder="请选择"
- >
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </div>
- <div
- class="content"
- style="
- margin-top: 20px;
- margin-left: 35px;
- height: 85%;
- overflow-y: auto;
- "
- >
- <!-- <el-scrollbar>
- <div class="scoll"> -->
- <div class="matrix" v-if="showList.length > 0">
- <box-select node=".box" @selectList="selectList">
- <!-- v-if="showWh(showList[0])" -->
- <MatrixBlock
- @choose-click="handleClick"
- @on-click="handleDetails"
- :dataList="showList"
- >
- </MatrixBlock>
- <!-- <MatrixBlockPv
- v-else
- @on-click="handleDetialPv"
- :dataList="showList"
- >
- </MatrixBlockPv> -->
- </box-select>
- </div>
- <!-- </div>
- </el-scrollbar> -->
- </div>
- </div>
- <WindturbineDetailPages
- v-model="dialogVisible"
- :showSvg="showSvg"
- @close="handleClose"
- :windturbine="currentWindturbine"
- ></WindturbineDetailPages>
- <PvDetailPages
- v-model="dialogPvDia"
- @close="handleClose"
- :windturbine="currentWindturbinePv"
- >
- </PvDetailPages>
- <ParametersContrast
- :chooseList="chooseList"
- v-model="parametersDisplay"
- ></ParametersContrast>
- </div>
- </template>
- <script>
- import WindturbineDetailPages from "../WindturbineDetailPages.vue";
- import PvDetailPages from "components/PvDetailPages.vue";
- import MatrixBlock from "../matrixBlock.vue";
- import MatrixBlockPv from "../matrixBlockPv.vue";
- import EaxyMatrxBlock from "../eaxyMatrixBlock.vue";
- import BackgroundData from "utils/BackgroundData";
- import api from "api/index";
- import boxSelect from "components/boxSelect.vue";
- import ParametersContrast from "./parametersContrast.vue";
- import MessageBridge from "utils/MessageBridge";
- import dataJson from "./controlJson.json";
- export default {
- name: "ProblemArea",
- components: {
- WindturbineDetailPages,
- PvDetailPages,
- MatrixBlock,
- MatrixBlockPv,
- boxSelect,
- ParametersContrast,
- EaxyMatrxBlock,
- },
- props: {
- current: {
- type: Number,
- },
- datas: {
- type: String,
- },
- },
- data() {
- return {
- allNames: [],
- allList: {},
- dataList: [],
- showList: [],
- chooseList: [],
- lockValues: [],
- currentWindturbine: {},
- currentWindturbinePv: {},
- dialogVisible: false,
- dialogPvDia: false,
- showSvg: false,
- parametersDisplay: false,
- windturbinelist: {},
- options: [
- {
- value: "0",
- label: "问题设备",
- },
- {
- value: "1",
- label: "故障",
- },
- {
- value: "2",
- label: "维护",
- },
- {
- value: "3",
- label: "离线",
- },
- {
- value: "4",
- label: "挂牌",
- },
- ],
- selectValue: "0",
- intervals: null,
- controlErorCodes: [
- "控制成功",
- "控制命令发送失败",
- "无效的控制地址",
- "被控设备异常",
- "无效的控制功能",
- "网络连接错误,检查场站通信",
- "控制结果读取超时",
- "未知错误",
- "控制命令错误",
- "收到无法识别数据",
- "未读取到数据包",
- "未知错误",
- "风机操作过频繁",
- "风机被挂牌",
- "风机操作与风机状态不符",
- "需要登录",
- ],
- };
- },
- computed: {},
- created: function () {
- // this.initData();
- // this.handleWindturbineChange();
- // this.controls();
- // this.getLocks();
- // this.intervals = setInterval(() =>{
- // this.handleWindturbineChange
- // }, 3000);
- },
- mounted() {
- this.$nextTick(() => {
- this.showList = dataJson.showList;
- });
- },
- methods: {
- showWh(item) {
- let show = false;
- if (item.stationId) {
- show = true;
- }
- return show;
- },
- selectList(val) {
- val.forEach((item) => {
- this.handleClick(this.windturbinelist[item.id]);
- });
- },
- controls() {
- this.options = [
- {
- value: "0",
- label: "问题设备",
- },
- {
- value: "1",
- label: "故障",
- },
- {
- value: "2",
- label: "维护",
- },
- {
- value: "3",
- label: "离线",
- },
- {
- value: "4",
- label: "挂牌",
- },
- ];
- let stationList = this.$store.state.stationList;
- stationList.forEach((item, index) => {
- if (item.id.indexOf("FDC") != -1 || item.id.indexOf("GDC") != -1) {
- let obj = {};
- obj.value = String(index + 6);
- obj.label = item.name;
- obj.stationId = item.code || item.id;
- this.options.push(obj);
- }
- });
- // let json = this.$store.state.windturbinelist;
- let wswind = JSON.parse(window.sessionStorage.getItem("windSbq"));
- let pv = JSON.parse(window.sessionStorage.getItem("pvSbq"));
- let json = {};
- if (wswind && pv) {
- json = { ...wswind, ...pv };
- this.dataList = [];
- const showList = [];
- let arr = Object.keys(json).sort();
- for (let id of arr) {
- let val = json[id];
- this.chooseList.forEach((item) => {
- if (item.windturbineId === val.windturbineId) {
- val.active = true;
- }
- });
- this.dataList.push(val);
- switch (Number(this.selectValue)) {
- case 0:
- if (
- val.status === 5 ||
- val.status === 6 ||
- val.status === 7 ||
- val.lockValue > 0
- ) {
- showList.push(val);
- }
- break;
- case 1:
- val.status === 5 ? showList.push(val) : "";
- break;
- case 2:
- val.status === 6 ? showList.push(val) : "";
- break;
- case 3:
- val.status === 7 ? showList.push(val) : "";
- break;
- case 4:
- val.lockValue > 0 ? showList.push(val) : "";
- break;
- default:
- if (
- val.stationId ===
- this.options.filter((ops) => ops?.value === this.selectValue)[0]
- .stationId
- ) {
- showList.push(val);
- }
- break;
- }
- }
- let checkoutList = BackgroundData.getInstance().checkouts;
- checkoutList.forEach((item) => {
- let showIndex = null;
- showList.forEach((param, index) => {
- if (item.windturbineId === param.windturbineId) {
- showIndex = index;
- }
- });
- showList.splice(showIndex, 1);
- });
- showList.sort((a, b) => {
- let aSubString = "0",
- bSubString = "0";
- let aStation = "1",
- bStation = "2";
- if (a.windturbineId && b.windturbineId) {
- aSubString = a.windturbineId.substring(
- a.windturbineId.lastIndexOf("_") + 1
- );
- bSubString = b.windturbineId.substring(
- b.windturbineId.lastIndexOf("_") + 1
- );
- aStation = a.windturbineId.substring(
- 0,
- a.windturbineId.lastIndexOf("_")
- );
- bStation = b.windturbineId.substring(
- 0,
- b.windturbineId.lastIndexOf("_")
- );
- } else if (a.id && b.id) {
- aSubString = a.id.substring(a.id.lastIndexOf("_") + 1);
- bSubString = b.id.substring(b.id.lastIndexOf("_") + 1);
- aStation = a.id.substring(0, a.id.lastIndexOf("_"));
- bStation = b.id.substring(0, b.id.lastIndexOf("_"));
- }
- if (aStation === bStation) {
- return parseInt(aSubString) - parseInt(bSubString);
- } else {
- return 0;
- }
- });
- this.showList = showList;
- }
- },
- getLocks() {
- api.getCustomerLock().then((res) => {
- if (res) {
- this.lockValues = res.data;
- }
- });
- },
- initData: function () {
- let mb = MessageBridge.getInstance();
- let vss = [
- { key: "/topic/voice-control", action: this.windturbineMessage },
- ];
- mb.register(vss);
- },
- windturbineMessage(msg) {
- if (this.$store.state.current === 2) {
- let arr = [];
- if (msg === "CLOSE") {
- arr.push(msg);
- } else {
- arr = msg.split("-");
- }
- this.dialogVisible = false;
- this.showSvg = false;
- this.svgWeb = "";
- if (arr[0] === "OPEN_FJ") {
- this.currentWindturbine = this.windturbinelist[arr[1]];
- this.dialogVisible = true;
- } else if (arr[0] === "CLOSE") {
- this.dialogVisible = false;
- } else if (
- arr[0] === "CONTROL_START" ||
- arr[0] === "CONTROL_STOP" ||
- arr[0] === "CONTROL_MAINTAIN"
- ) {
- let windControlList = [];
- let mss = {};
- arr.forEach((item) => {
- if (
- item ===
- (this.windturbinelist[item]
- ? this.windturbinelist[item].windturbineId
- : "")
- ) {
- switch (arr[0]) {
- case "CONTROL_START":
- this.windturbinelist[item].controlType = "1";
- break;
- case "CONTROL_STOP":
- this.windturbinelist[item].controlType = "2";
- break;
- case "CONTROL_MAINTAIN":
- this.windturbinelist[item].controlType = "6";
- break;
- case "CONTROL_UNMAINTAIN":
- this.windturbinelist[item].controlType = "8";
- break;
- }
- windControlList.push(this.windturbinelist[item]);
- }
- });
- mss.type = "send";
- this.sendCommand(mss, windControlList);
- } else if (
- arr[0] === "CONTROL_LOCK_OVERHAUL" ||
- arr[0] === "CONTROL_LOCK_MAINTAIN" ||
- arr[0] === "CONTROL_LOCK_LNVOLVED_OVERHAUL" ||
- arr[0] === "CONTROL_LOCK_LNVOLVED_MAINTAIN" ||
- arr[0] === "CONTROL_LOCK_LNVOLVED_PG" ||
- arr[0] === "CONTROL_LOCK_LNVOLVED_WEATHER" ||
- arr[0] === "CONTROL_UNLOCK"
- ) {
- let windturbine = this.windturbinelist[arr[1]];
- switch (arr[0]) {
- case "CONTROL_LOCK_OVERHAUL":
- this.sendLock({ value: "CheckLock" }, windturbine);
- break;
- case "CONTROL_LOCK_MAINTAIN":
- this.sendLock({ value: "FaultLock" }, windturbine);
- break;
- case "CONTROL_LOCK_LNVOLVED_OVERHAUL":
- this.sendLock({ value: "StationCheckLock" }, windturbine);
- break;
- case "CONTROL_LOCK_LNVOLVED_MAINTAIN":
- this.sendLock({ value: "StationFaulLock" }, windturbine);
- break;
- case "CONTROL_LOCK_LNVOLVED_PG":
- this.sendLock({ value: "StationPowerLineLock" }, windturbine);
- break;
- case "CONTROL_LOCK_LNVOLVED_WEATHER":
- this.sendLock({ value: "StationWeatherLock" }, windturbine);
- break;
- case "CONTROL_UNLOCK":
- this.sendLock({ value: "UnLock" }, windturbine);
- break;
- }
- }
- }
- },
- /* 右键菜单 */
- contextmenu() {
- const remote = require("electron").remote;
- let that = this;
- let menuTemplate = [];
- if (
- this.selectValue === "0" ||
- this.selectValue === "1" ||
- this.selectValue === "2" ||
- this.selectValue === "3" ||
- this.selectValue === "4"
- ) {
- menuTemplate = [
- {
- label: "挂牌",
- submenu: [
- {
- label: "检修",
- click() {
- that.sendLock({ value: "CheckLock" });
- },
- },
- {
- label: "故障维修",
- click() {
- that.sendLock({ value: "FaultLock" });
- },
- },
- {
- label: "场内受累检修",
- click() {
- that.sendLock({ value: "StationCheckLock" });
- },
- },
- {
- label: "场内受累故障",
- click() {
- that.sendLock({ value: "StationFaulLock" });
- },
- },
- {
- label: "场外受累电网",
- click() {
- that.sendLock({ value: "StationPowerLineLock" });
- },
- },
- {
- label: "场外受累天气",
- click() {
- that.sendLock({ value: "StationWeatherLock" });
- },
- },
- ],
- },
- {
- label: "取消挂牌",
- click() {
- that.sendLock({ value: "UnLock" });
- },
- },
- {
- label: "参数对比",
- click() {
- that.parametersContrast();
- },
- },
- ];
- } else {
- menuTemplate = [
- {
- label: "启动",
- click() {
- that.sendCommand({ controlType: "1", deviceType: "Manual" });
- },
- },
- {
- label: "停机",
- click() {
- that.sendCommand({ controlType: "2", deviceType: "Manual" });
- },
- },
- {
- label: "复位",
- click() {
- that.sendCommand({ controlType: "5", deviceType: "Manual" });
- },
- },
- {
- label: "维护",
- click() {
- that.sendCommand({ controlType: "6", deviceType: "Manual" });
- },
- },
- {
- label: "取消维护",
- click() {
- that.sendCommand({ controlType: "8", deviceType: "Manual" });
- },
- },
- {
- label: "挂牌",
- submenu: [
- {
- label: "检修",
- click() {
- that.sendLock({ value: "CheckLock" });
- },
- },
- {
- label: "故障维修",
- click() {
- that.sendLock({ value: "FaultLock" });
- },
- },
- {
- label: "场内受累检修",
- click() {
- that.sendLock({ value: "StationCheckLock" });
- },
- },
- {
- label: "场内受累故障",
- click() {
- that.sendLock({ value: "StationFaulLock" });
- },
- },
- {
- label: "场外受累电网",
- click() {
- that.sendLock({ value: "StationPowerLineLock" });
- },
- },
- {
- label: "场外受累天气",
- click() {
- that.sendLock({ value: "StationWeatherLock" });
- },
- },
- ],
- },
- {
- label: "取消挂牌",
- click() {
- that.sendLock({ value: "UnLock" });
- },
- },
- {
- label: "参数对比",
- click() {
- that.parametersContrast();
- },
- },
- ];
- }
- const menu = remote.Menu.buildFromTemplate(menuTemplate);
- menu.popup(remote.getCurrentWindow());
- },
- sendCommand(msg, windturbine) {
- let bd = BackgroundData.getInstance();
- if (!bd.LoginUser) {
- this.$notify({
- title: "请登录",
- message: "控制风机需要先登录!",
- type: "warning",
- position: "bottom-right",
- offset: 60,
- duration: 3000,
- });
- return;
- }
- let sendList = [];
- if (windturbine) {
- sendList = windturbine;
- } else {
- this.chooseList.forEach((item) => {
- item.controlType = Number(msg.controlType);
- });
- sendList = this.chooseList;
- }
- if (sendList.length > 0) {
- bd.checkout(sendList);
- this.chooseList = [];
- let pairs = {};
- sendList.forEach((item) => {
- let ct = {
- windturbineId: item.windturbineId,
- stationId: item.stationId,
- projectId: item.projectId,
- modelId: item.modelId,
- controlType: item.controlType,
- lockType: item.lockType,
- userName: `system_${bd.LoginUser.name}`,
- userId: 0,
- auto: false,
- deviceType: msg.deviceType,
- };
- pairs[ct.windturbineId] = ct;
- });
- api.windturbControl(pairs).then((res) => {
- if (res) {
- this.controlSuccess(res);
- }
- });
- }
- },
- sendLock(msg, windturbine) {
- let bd = BackgroundData.getInstance();
- if (!bd.LoginUser) {
- this.$notify({
- title: "请登录",
- message: "控制风机需要先登录!",
- type: "warning",
- position: "bottom-right",
- offset: 60,
- duration: 3000,
- });
- return;
- }
- let sendList = [];
- if (windturbine) {
- windturbine.lockType = msg.value;
- sendList.push(windturbine);
- } else {
- this.chooseList.forEach((item) => {
- item.lockType = msg.value;
- });
- sendList = this.chooseList;
- }
- if (sendList.length > 0) {
- this.chooseList = [];
- let pairs = {};
- sendList.forEach((item) => {
- let ct = {
- windturbineId: item.windturbineId,
- stationId: item.stationId,
- projectId: item.projectId,
- modelId: item.modelId,
- controlType: item.controlType,
- lockType: item.lockType,
- userName: `system_${bd.LoginUser.name}`,
- userId: 0,
- };
- pairs[ct.windturbineId] = ct;
- });
- api.windturbControlLock(pairs).then((res) => {
- if (res) {
- this.controlSuccess(res);
- }
- });
- }
- },
- /* 控制成功 */
- controlSuccess(msg) {
- let bd = BackgroundData.getInstance();
- for (let id in msg.data) {
- let val = msg.data[id];
- if (val.errorCode !== "0") {
- bd.removeCheckouts(val);
- }
- }
- let mss = ""; // 信息
- let iserror = false; // 是否有控制错误的风机
- for (let v in msg.data) {
- let val = msg.data[v];
- if (val.errorCode > 0) {
- iserror = true;
- mss += `${val.windturbineId} ${
- this.controlErorCodes[val.errorCode]
- }\n`;
- }
- }
- let tp = iserror ? "warning" : "success";
- // if (!iserror) {
- // mss = "控制成功";
- // }
- this.$notify({
- title: "控制",
- message: mss,
- type: tp,
- position: "bottom-right",
- offset: 60,
- duration: 3000,
- });
- },
- /* 控制失败 */
- controlError(err) {
- this.$notify({
- title: "控制出现错误",
- message: err.message,
- type: "warning",
- position: "bottom-right",
- offset: 60,
- duration: 3000,
- });
- },
- handleClick(values) {
- if (values.active) {
- let showIndex = null;
- this.chooseList.forEach((item, index) => {
- if (item.windturbineId === values.windturbineId) {
- showIndex = index;
- }
- });
- this.chooseList.splice(showIndex, 1);
- } else {
- this.chooseList.push(values);
- }
- this.showList.forEach((item) => {
- if (item.windturbineId === values.windturbineId) {
- item.active = !item.active;
- }
- });
- },
- listedChange() {
- this.chooseList = [];
- const showList = [];
- if (Number(this.selectValue) >= 6) {
- console.log(
- this.options.filter((ops) => ops?.value === this.selectValue)[0]
- .stationId
- );
- this.$store.commit(
- "currentStation",
- this.options.filter((ops) => ops?.value === this.selectValue)[0]
- .stationId
- );
- } else {
- this.$store.commit("currentStation", "");
- }
- console.log(this.$store.state.currentStation);
- this.dataList.forEach((val) => {
- val.active = false;
- switch (Number(this.selectValue)) {
- case 0:
- if (
- val.status === 5 ||
- val.status === 6 ||
- val.status === 7 ||
- val.lockValue > 0
- ) {
- showList.push(val);
- }
- break;
- case 1:
- val.status === 5 ? showList.push(val) : "";
- break;
- case 2:
- val.status === 6 ? showList.push(val) : "";
- break;
- case 3:
- val.status === 7 ? showList.push(val) : "";
- break;
- case 4:
- val.lockValue > 0 ? showList.push(val) : "";
- break;
- default:
- if (Number(this.selectValue) < 12) {
- if (
- val.stationId ===
- this.options.filter((ops) => ops?.value === this.selectValue)[0]
- .stationId
- ) {
- showList.push(val);
- }
- } else {
- if (
- val.station ===
- this.options.filter((ops) => ops?.value === this.selectValue)[0]
- .stationId
- ) {
- showList.push(val);
- }
- }
- break;
- }
- });
- showList.sort((a, b) => {
- let aSubString = "0",
- bSubString = "0";
- let aStation = "1",
- bStation = "2";
- if (a.windturbineId && b.windturbineId) {
- aSubString = a.windturbineId.substring(
- a.windturbineId.lastIndexOf("_") + 1
- );
- bSubString = b.windturbineId.substring(
- b.windturbineId.lastIndexOf("_") + 1
- );
- aStation = a.windturbineId.substring(
- 0,
- a.windturbineId.lastIndexOf("_")
- );
- bStation = b.windturbineId.substring(
- 0,
- b.windturbineId.lastIndexOf("_")
- );
- } else if (a.id && b.id) {
- aSubString = a.id.substring(a.id.lastIndexOf("_") + 1);
- bSubString = b.id.substring(b.id.lastIndexOf("_") + 1);
- aStation = a.id.substring(0, a.id.lastIndexOf("_"));
- bStation = b.id.substring(0, b.id.lastIndexOf("_"));
- }
- if (aStation === bStation) {
- return parseInt(aSubString) - parseInt(bSubString);
- } else {
- return 0;
- }
- });
- this.showList = showList;
- },
- handleDetails(itm) {
- this.dialogVisible = true;
- this.currentWindturbine = itm;
- },
- handleDetialPv(item) {
- this.dialogPvDia = true;
- this.currentWindturbinePv = item;
- },
- handleClose() {
- this.dialogVisible = false;
- this.showSvg = false;
- this.getLocks();
- },
- parametersContrast() {
- if (this.chooseList.length > 1) {
- this.parametersDisplay = true;
- }
- },
- handleWindturbineChange() {
- let ws = MessageBridge.getInstance();
- let wind = [{ key: "/topic/windturbine", action: this.getWindMsg }];
- let guangfu = [{ key: "/topic/pv", action: this.getPvMsg }];
- ws.register(wind);
- ws.register(guangfu);
- },
- getPvMsg(msg) {
- window.sessionStorage.removeItem("pvSbq");
- // let jsonMsg = JSON.parse(msg)
- window.sessionStorage.setItem("pvSbq", msg);
- this.changeData();
- },
- getWindMsg(msg) {
- window.sessionStorage.removeItem("windSbq");
- // let jsonMsg = JSON.parse(msg)
- window.sessionStorage.setItem("windSbq", msg);
- this.changeData();
- },
- changeData() {
- let wswind = JSON.parse(window.sessionStorage.getItem("windSbq"));
- let pv = JSON.parse(window.sessionStorage.getItem("pvSbq"));
- let msg = {};
- if (wswind || pv) {
- msg = { ...wswind };
- if (pv) {
- msg = { ...msg, ...pv };
- }
- this.windturbinelist = msg;
- this.$store.commit("windturbinelist", msg);
- this.dataList = [];
- const showList = [];
- let arr = Object.keys(msg).sort();
- let newArr = [];
- for (let id of arr) {
- let val = msg[id];
- newArr.push(val);
- this.chooseList.forEach((item) => {
- if (item.windturbineId === val.windturbineId) {
- val.active = true;
- }
- });
- if (val.lockValue === 9) {
- val.lockValues = this.lockValues.filter(
- (item) => val.windturbineId === item.windturbineID
- )[0]?.value;
- }
- this.dataList.push(val);
- switch (Number(this.selectValue)) {
- case 0:
- if (
- val.status === 5 ||
- val.status === 6 ||
- val.status === 7 ||
- val.lockValue > 0
- ) {
- showList.push(val);
- }
- break;
- case 1:
- val.status === 5 ? showList.push(val) : "";
- break;
- case 2:
- val.status === 6 ? showList.push(val) : "";
- break;
- case 3:
- val.status === 7 ? showList.push(val) : "";
- break;
- case 4:
- val.lockValue > 0 ? showList.push(val) : "";
- break;
- default:
- // if (
- // val.stationId ===
- // this.options.filter(
- // (ops) => ops?.value === this.selectValue
- // )[0].stationId
- // ) {
- // this.showList.push(val);
- // }
- if (Number(this.selectValue) < 12) {
- if (
- val.stationId ===
- this.options.filter(
- (ops) => ops?.value === this.selectValue
- )[0].stationId
- ) {
- showList.push(val);
- }
- } else {
- if (
- val.station ===
- this.options.filter(
- (ops) => ops?.value === this.selectValue
- )[0].stationId
- ) {
- showList.push(val);
- }
- }
- break;
- }
- }
- // console.log('showList', this.showList)
- let checkoutList = BackgroundData.getInstance().checkouts;
- if (checkoutList.length > 0) {
- checkoutList.forEach((item) => {
- let showIndex = null;
- showList.forEach((param, index) => {
- if (item.windturbineId === param.windturbineId) {
- showIndex = index;
- }
- });
- showList.splice(showIndex, 1);
- });
- }
- showList.sort((a, b) => {
- let aSubString = "0",
- bSubString = "0";
- let aStation = "1",
- bStation = "2";
- if (a.windturbineId && b.windturbineId) {
- aSubString = a.windturbineId.substring(
- a.windturbineId.lastIndexOf("_") + 1
- );
- bSubString = b.windturbineId.substring(
- b.windturbineId.lastIndexOf("_") + 1
- );
- aStation = a.windturbineId.substring(
- 0,
- a.windturbineId.lastIndexOf("_")
- );
- bStation = b.windturbineId.substring(
- 0,
- b.windturbineId.lastIndexOf("_")
- );
- } else if (a.id && b.id) {
- aSubString = a.id.substring(a.id.lastIndexOf("_") + 1);
- bSubString = b.id.substring(b.id.lastIndexOf("_") + 1);
- aStation = a.id.substring(0, a.id.lastIndexOf("_"));
- bStation = b.id.substring(0, b.id.lastIndexOf("_"));
- }
- if (aStation === bStation) {
- return parseInt(aSubString) - parseInt(bSubString);
- } else {
- return 0;
- }
- });
- this.showList = showList;
- }
- },
- },
- unmounted() {
- clearInterval(this.intervals);
- this.intervals = null;
- },
- };
- </script>
- <style scoped>
- .problem {
- height: 100%;
- }
- .body {
- border: 1px solid #373737;
- width: 100%;
- margin-left: 15px;
- margin-top: 10px;
- height: 61vh;
- }
- .body .scoll {
- height: 91%;
- }
- .titleBar {
- display: flex;
- flex-direction: row;
- align-items: center;
- }
- .title {
- color: #ffffff;
- font-size: 14px;
- margin-left: 32px;
- /* margin-top: 12px; */
- margin-bottom: 10px;
- /* width: 570px; */
- width: 29vw;
- height: 50px;
- display: flex;
- align-items: center;
- position: absolute;
- background-color: #000000;
- }
- .title::before {
- z-index: 1;
- content: "";
- position: absolute;
- left: -18px !important;
- /* top: 30px !important; */
- width: 5px;
- height: 5px;
- background-color: #54b75a;
- border-radius: 50%;
- }
- .inputs {
- border: none;
- width: 174px !important;
- margin-left: 110px;
- }
- .el-input__inner {
- background-color: rgb(100, 100, 100) !important;
- color: rgb(220, 220, 220) !important;
- border: 1px solid red !important;
- }
- .logo {
- position: absolute;
- top: 2px;
- left: 12px;
- }
- .content::-webkit-scrollbar {
- /*隐藏滚轮*/
- display: none;
- }
- .box1 {
- width: 99%;
- height: 40px;
- background-color: rgb(30, 30, 30);
- margin-top: 2px;
- text-align: left;
- line-height: 40px;
- color: #fff;
- box-sizing: border-box;
- padding-left: 20px;
- }
- </style>
|