areaCard.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828
  1. /* 自定义tabs */
  2. <template>
  3. <div class="body" :style="style">
  4. <img class="logo" src="../../assets/img/logo.png" alt="">
  5. <div class="title">{{ title }}</div>
  6. <div style="margin-top: 50px; height:85%;" @contextmenu="contextmenu">
  7. <el-scrollbar>
  8. <div class="scoll">
  9. <div class="matrix" v-if="startList.length>0">
  10. <div class="problemTitle">启动</div>
  11. <MatrixBlock @on-click="handleDetial" @choose-click="handleClick" :dataList="startList">
  12. </MatrixBlock>
  13. </div>
  14. <div class="matrix" v-if="stopList.length>0">
  15. <div class="problemTitle">停机</div>
  16. <MatrixBlock @on-click="handleDetial" @choose-click="handleClick" :dataList="stopList">
  17. </MatrixBlock>
  18. </div>
  19. <div class="matrix" v-if="maintainList.length>0">
  20. <div class="problemTitle">维护</div>
  21. <MatrixBlock @on-click="handleDetial" @choose-click="handleClick" :dataList="maintainList">
  22. </MatrixBlock>
  23. </div>
  24. <div class="matrix" v-if="unMaintainList.length>0">
  25. <div class="problemTitle">取消维护</div>
  26. <MatrixBlock @on-click="handleDetial" @choose-click="handleClick" :dataList="unMaintainList">
  27. </MatrixBlock>
  28. </div>
  29. </div>
  30. </el-scrollbar>
  31. </div>
  32. <div v-if="current==1" class="send" @click="handleSend">发送</div>
  33. <div class="success" v-if="showFlag&&current===0">指令发送成功</div>
  34. </div>
  35. <WindturbineDetailPages v-model="dialogVisible" :showSvg="showSvg" @close="handleClose" :svgWeb="svgWeb"
  36. :stationName="stationName" :windturbine="currentWindturbine"></WindturbineDetailPages>
  37. </template>
  38. <script>
  39. import BackgroundData from 'utils/BackgroundData'
  40. import WindturbineDetailPages from "../WindturbineDetailPages.vue";
  41. import MatrixBlock from "../matrixBlock.vue";
  42. import MessageBridge from 'utils/MessageBridge'
  43. import api from "api/index";
  44. export default {
  45. name: 'gy-card',
  46. components: {
  47. MatrixBlock,
  48. WindturbineDetailPages
  49. },
  50. created: function () {
  51. console.log(this.current)
  52. this.initData();
  53. this.suggestion();
  54. },
  55. emits: ["parentRun"],
  56. props: {
  57. title: {
  58. type: String,
  59. default: '',
  60. required: true,
  61. },
  62. height: {
  63. type: Number,
  64. default: 200,
  65. },
  66. },
  67. data() {
  68. return {
  69. testsIndex: 0,
  70. testIndex: 0,
  71. current: 1,
  72. vss: {},
  73. windturbinelist: {},
  74. titleList: [],
  75. startList: [],
  76. stopList: [],
  77. maintainList: [],
  78. unMaintainList: [],
  79. chooseList: [],
  80. sendList: [],
  81. currentWindturbine: {},
  82. dialogVisible: false,
  83. showSvg: false,
  84. showFlag: false,
  85. postData: false,
  86. svgWeb: '',
  87. stationName: '',
  88. // 定时器
  89. timer: "",
  90. controlErorCodes: [
  91. "控制成功",
  92. "控制命令发送失败",
  93. "无效的控制地址",
  94. "被控设备异常",
  95. "无效的控制功能",
  96. "网络连接错误,检查场站通信",
  97. "控制结果读取超时",
  98. "未知错误",
  99. "控制命令错误",
  100. "收到无法识别数据",
  101. "未读取到数据包",
  102. "未知错误",
  103. "风机操作过频繁",
  104. "风机被挂牌",
  105. "风机操作与风机状态不符",
  106. "需要登录",
  107. ],
  108. boosterStation: {
  109. 'MHS_SYZ': {
  110. name: '麻黄山升压站'
  111. },
  112. 'NSS_SYZ': {
  113. name: '牛首山升压站'
  114. },
  115. 'QS_SYZ': {
  116. name: '青山升压站'
  117. },
  118. 'QS3_SYZ': {
  119. name: '青山三期升压站'
  120. },
  121. 'SBQ_SYZ': {
  122. name: '石板泉升压站'
  123. },
  124. 'XS_SYZ': {
  125. name: '香山升压站'
  126. },
  127. 'DWK_SYZ': {
  128. name: '大武口升压站'
  129. },
  130. 'PL_SYZ': {
  131. name: '平罗升压站'
  132. },
  133. 'PL2_SYZ': {
  134. name: '平罗二期升压站'
  135. },
  136. 'XH_SYZ': {
  137. name: '宣和升压站'
  138. },
  139. 'MCH_SYZ': {
  140. name: '马场湖升压站'
  141. },
  142. 'HZJ_SYZ': {
  143. name: '海子井升压站'
  144. },
  145. },
  146. indexsss: 0,
  147. }
  148. },
  149. computed: {
  150. style() {
  151. return `width: 100%; height: ${this.height}vh;`
  152. },
  153. },
  154. methods: {
  155. control(current) {
  156. this.current = current === 0?current:current === 1?current:1
  157. },
  158. initData: function () {
  159. var mb = MessageBridge.getInstance();
  160. mb.unregister({ key: "/topic/suggestion"});
  161. var vs = [{ key: "/topic/suggestion", action: this.suggestion }];
  162. var vss = [{ key: "/topic/voice-control", action: this.windturbineMessage }];
  163. this.vss = vss
  164. mb.register(vs);
  165. mb.register(vss);
  166. },
  167. suggestion(msg, headers) {
  168. let bd = BackgroundData.getInstance();
  169. this.titleList = msg ? JSON.parse(msg) : this.$store.state.suggestion
  170. if (msg && JSON.parse(msg).length > 0) {
  171. if (bd.LoginUser) {
  172. this.postData = true
  173. }
  174. }
  175. if (this.current === 0) {
  176. console.log(this);
  177. let dateList = []
  178. this.titleList.forEach(item => {
  179. if (item.windturbineId.slice(0, 2) === 'NG') {
  180. switch (item.operateStyle) {
  181. case 'Start':
  182. this.windturbinelist[item.windturbineId].controlType = 1
  183. break;
  184. case 'Stop':
  185. this.windturbinelist[item.windturbineId].controlType = 2
  186. break;
  187. case 'Maintain':
  188. this.windturbinelist[item.windturbineId].controlType = 6
  189. break;
  190. case 'UnMaintain':
  191. this.windturbinelist[item.windturbineId].controlType = 8
  192. break;
  193. }
  194. dateList.push(this.windturbinelist[item.windturbineId])
  195. }
  196. })
  197. let mss = {}
  198. mss.type = 'send'
  199. this.timer = setTimeout(() => {
  200. this.sendCommand(mss, dateList, 'automatic')
  201. this.showFlag = false
  202. clearInterval(this.timer);
  203. }, 3000);
  204. }
  205. },
  206. windturbineMessage(msg) {
  207. if (this.$store.state.current === 1 || this.$store.state.current === 0) {
  208. let arr = []
  209. if (msg === 'CLOSE') {
  210. arr.push(msg)
  211. } else {
  212. arr = msg.split('-')
  213. }
  214. this.dialogVisible = false
  215. this.showSvg = false
  216. this.svgWeb = ''
  217. console.log(arr);
  218. if (arr[0] === 'OPEN_FJ') {
  219. this.currentWindturbine = this.windturbinelist[arr[1]]
  220. setTimeout(() => {
  221. this.dialogVisible = true;
  222. }, 500);
  223. } else if (arr[0] === 'CLOSE') {
  224. this.dialogVisible = false
  225. } else if (arr[0] === 'OPEN_SYZ') {
  226. this.showSvg = true
  227. this.dialogVisible = true
  228. this.svgWeb = arr[1];
  229. this.stationName = this.boosterStation[arr[1]].name
  230. } else if (arr[0] === 'CONTROL_START' || arr[0] === 'CONTROL_STOP' || arr[0] === 'CONTROL_MAINTAIN' || arr[0] === 'CONTROL_UNMAINTAIN') {
  231. let windControlList = [];
  232. let mss = {}
  233. arr.forEach(item => {
  234. if (item === (this.windturbinelist[item] ? this.windturbinelist[item].windturbineId : '')) {
  235. switch (arr[0]) {
  236. case 'CONTROL_START':
  237. this.windturbinelist[item].controlType = '1'
  238. break
  239. case 'CONTROL_STOP':
  240. this.windturbinelist[item].controlType = '2'
  241. break
  242. case 'CONTROL_MAINTAIN':
  243. this.windturbinelist[item].controlType = '6'
  244. break
  245. case 'CONTROL_UNMAINTAIN':
  246. this.windturbinelist[item].controlType = '8'
  247. break
  248. }
  249. windControlList.push(this.windturbinelist[item])
  250. }
  251. })
  252. mss.type = 'send'
  253. this.testIndex++
  254. this.sendCommand(mss, windControlList, 'automatic')
  255. // this.menuClicked(mss, windControlList, 'automatic')
  256. } else if (arr[0] === 'CONTROL_LOCK_OVERHAUL' || arr[0] === 'CONTROL_LOCK_MAINTAIN' || arr[0] === 'CONTROL_LOCK_LNVOLVED_OVERHAUL' ||
  257. arr[0] === 'CONTROL_LOCK_LNVOLVED_MAINTAIN' || arr[0] === 'CONTROL_LOCK_LNVOLVED_PG' || arr[0] === 'CONTROL_LOCK_LNVOLVED_WEATHER' || arr[0] === 'CONTROL_UNLOCK') {
  258. let windturbine = this.windturbinelist[arr[1]]
  259. this.testIndex++
  260. switch (arr[0]) {
  261. case 'CONTROL_LOCK':
  262. this.menuClicked({ type: "lock", value: "Lock" }, windturbine);
  263. break;
  264. case 'CONTROL_LOCK_OVERHAUL':
  265. this.menuClicked({ type: "lock", value: "CheckLock" }, windturbine);
  266. break;
  267. case 'CONTROL_LOCK_MAINTAIN':
  268. this.menuClicked({ type: "lock", value: "FaultLock" }, windturbine);
  269. break;
  270. case 'CONTROL_LOCK_LNVOLVED_OVERHAUL':
  271. this.menuClicked({ type: "lock", value: "StationCheckLock" }, windturbine);
  272. break;
  273. case 'CONTROL_LOCK_LNVOLVED_MAINTAIN':
  274. this.menuClicked({ type: "lock", value: "StationFaulLock" }, windturbine);
  275. break;
  276. case 'CONTROL_LOCK_LNVOLVED_PG':
  277. this.menuClicked({ type: "lock", value: "StationPowerLineLock" }, windturbine);
  278. break;
  279. case 'CONTROL_LOCK_LNVOLVED_WEATHER':
  280. this.menuClicked({ type: "lock", value: "StationWeatherLock" }, windturbine);
  281. break;
  282. case 'CONTROL_UNLOCK':
  283. this.menuClicked({ type: "lock", value: "UnLock" }, windturbine);
  284. break;
  285. }
  286. } else if (arr[0] === 'CONTROL_SART_RECOMMENDATION') {
  287. let mss = {}
  288. mss.type = 'send'
  289. this.startList.forEach(item => {
  290. item.controlType = '1'
  291. })
  292. this.menuClicked(mss, this.startList, 'automatic')
  293. } else if (arr[0] === 'CONTROL_STOP_RECOMMENDATION') {
  294. let mss = {}
  295. mss.type = 'send'
  296. this.stopList.forEach(item => {
  297. item.controlType = '2'
  298. })
  299. this.menuClicked(mss, this.stopList, 'automatic')
  300. } else if (arr[0] === 'CONTROL_RECOMMENDATION_ALL') {
  301. let windControlList = []
  302. let mss = {}
  303. mss.type = 'send'
  304. this.startList.forEach(item => {
  305. item.controlType = '1'
  306. windControlList.push(item)
  307. })
  308. this.stopList.forEach(item => {
  309. item.controlType = '2'
  310. windControlList.push(item)
  311. })
  312. this.maintainList.forEach(item => {
  313. item.controlType = '6'
  314. windControlList.push(item)
  315. })
  316. this.unMaintainList.forEach(item => {
  317. item.controlType = '8'
  318. windControlList.push(item)
  319. })
  320. console.log(windControlList);
  321. this.menuClicked(mss, windControlList, 'automatic')
  322. }
  323. }
  324. },
  325. handleClick(values) {
  326. if (values.active) {
  327. let showIndex = null
  328. this.chooseList.forEach((item, index) => {
  329. if (item.windturbineId === values.windturbineId) {
  330. showIndex = index
  331. }
  332. })
  333. this.chooseList.splice(showIndex, 1);
  334. } else {
  335. this.chooseList.push(values)
  336. }
  337. this.startList.forEach(item => { if (item.windturbineId === values.windturbineId) { item.active = !item.active } })
  338. this.stopList.forEach(item => { if (item.windturbineId === values.windturbineId) { item.active = !item.active } })
  339. this.maintainList.forEach(item => { if (item.windturbineId === values.windturbineId) { item.active = !item.active } })
  340. this.unMaintainList.forEach(item => { if (item.windturbineId === values.windturbineId) { item.active = !item.active } })
  341. },
  342. handleDetial(itm) {
  343. this.dialogVisible = true;
  344. this.currentWindturbine = itm;
  345. },
  346. handleClose() {
  347. this.dialogVisible = false
  348. this.showSvg = false
  349. },
  350. handleSend() {
  351. if (this.chooseList.length > 0) {
  352. this.menuClicked({ type: "send" });
  353. }
  354. },
  355. /* 右键菜单 */
  356. contextmenu() {
  357. const { remote } = require("electron");
  358. let that = this;
  359. const menuTemplate = [
  360. {
  361. label: "发送",
  362. click() {
  363. that.menuClicked({ type: "send" });
  364. },
  365. },
  366. {
  367. label: "挂牌",
  368. submenu: [
  369. {
  370. label: "检修",
  371. click() {
  372. that.menuClicked({ type: "lock", value: "CheckLock" });
  373. },
  374. },
  375. {
  376. label: "故障维修",
  377. click() {
  378. that.menuClicked({ type: "lock", value: "FaultLock" });
  379. },
  380. },
  381. {
  382. label: "场内受累检修",
  383. click() {
  384. that.menuClicked({ type: "lock", value: "StationCheckLock" });
  385. },
  386. },
  387. {
  388. label: "场内受累故障",
  389. click() {
  390. that.menuClicked({ type: "lock", value: "StationFaulLock" });
  391. },
  392. },
  393. {
  394. label: "场外受累电网",
  395. click() {
  396. that.menuClicked({
  397. type: "lock",
  398. value: "StationPowerLineLock",
  399. });
  400. },
  401. },
  402. {
  403. label: "场外受累天气",
  404. click() {
  405. that.menuClicked({ type: "lock", value: "StationWeatherLock" });
  406. },
  407. },
  408. ],
  409. },
  410. // {
  411. // label: "标注",
  412. // click() {
  413. // that.menuClicked({ type: "marking" });
  414. // },
  415. // },
  416. ];
  417. const menu = remote.Menu.buildFromTemplate(menuTemplate);
  418. menu.popup(remote.getCurrentWindow());
  419. },
  420. menuClicked(msg, windturbine, automatic) {
  421. let bd = BackgroundData.getInstance();
  422. if (!bd.LoginUser) {
  423. this.$notify({
  424. title: "请登录",
  425. message: "控制风机需要先登录!",
  426. type: "warning",
  427. position: "bottom-right",
  428. offset: 60,
  429. duration: 3000,
  430. });
  431. return;
  432. }
  433. if (msg.type == "lock") {
  434. let sendList = []
  435. // 挂牌
  436. if (windturbine) {
  437. windturbine.lockType = msg.value;
  438. sendList.push(windturbine)
  439. } else {
  440. this.chooseList.forEach(item => {
  441. item.lockType = msg.value;
  442. })
  443. sendList = this.chooseList
  444. }
  445. if (sendList.length > 0) {
  446. let showss = ''
  447. this.testsIndex++
  448. showss = String(this.testsIndex) + String(this.testIndex)
  449. bd.windturbineControl(
  450. sendList,
  451. true,
  452. '',
  453. showss,
  454. this.controlSuccess,
  455. this.controlError
  456. );
  457. }
  458. } else if (msg.type == "send") {
  459. // 发送
  460. let sendList = []
  461. if (automatic) {
  462. sendList = windturbine
  463. }
  464. else if (windturbine) {
  465. //windturbine.controlType = msg.controlType
  466. sendList.push(windturbine)
  467. } else {
  468. this.chooseList.forEach(item => {
  469. if (item.operateStyle === "Start") {
  470. item.controlType = 1
  471. } else if (item.operateStyle === "Stop") {
  472. item.controlType = 2
  473. } else if (item.operateStyle === "Maintain") {
  474. item.controlType = 6
  475. } else if (item.operateStyle === "UnMaintain") {
  476. item.controlType = 8
  477. }
  478. })
  479. sendList = this.chooseList
  480. }
  481. this.showFlag = true
  482. this.testsIndex++
  483. let showss = ''
  484. showss = String(this.testsIndex) + String(this.testIndex)
  485. if (sendList.length > 0) {
  486. bd.checkout(sendList);
  487. if (automatic) {
  488. bd.windturbineControl(
  489. sendList,
  490. false,
  491. 'automatic',
  492. showss,
  493. this.controlSuccess,
  494. this.controlError
  495. );
  496. } else {
  497. bd.windturbineControl(
  498. sendList,
  499. false,
  500. '',
  501. '',
  502. this.controlSuccess,
  503. this.controlError
  504. );
  505. }
  506. }
  507. } else if (msg.type == "marking") {
  508. // 标注
  509. let vvs = this.getSelectedItems();
  510. bd.marking(vvs);
  511. }
  512. this.clearSelected();
  513. },
  514. sendCommand(msg, windturbine, automatic) {
  515. let bd = BackgroundData.getInstance();
  516. if (!bd.LoginUser) {
  517. this.$notify({
  518. title: "请登录",
  519. message: "控制风机需要先登录!",
  520. type: "warning",
  521. position: "bottom-right",
  522. offset: 60,
  523. duration: 3000,
  524. });
  525. return;
  526. }
  527. let sendList = windturbine
  528. if (sendList.length > 0) {
  529. bd.checkout(sendList);
  530. let pairs = {}
  531. sendList.forEach(item => {
  532. let ct = {
  533. windturbineId: item.windturbineId,
  534. stationId: item.stationId,
  535. projectId: item.projectId,
  536. modelId: item.modelId,
  537. controlType: item.controlType,
  538. lockType: item.lockType,
  539. userName: `system_${bd.LoginUser.name}`,
  540. userId: 0,
  541. };
  542. pairs[ct.windturbineId] = ct;
  543. })
  544. api.windturbControl(false, pairs, '1').then(res => {
  545. if (res) {
  546. this.controlSuccess(res)
  547. }
  548. })
  549. }
  550. },
  551. clearSelected() {
  552. this.startList.forEach(item => {
  553. item.active = false
  554. })
  555. this.stopList.forEach(item => {
  556. item.active = false
  557. })
  558. this.chooseList = []
  559. },
  560. /* 控制成功 */
  561. controlSuccess(msg) {
  562. let bd = BackgroundData.getInstance();
  563. console.log(msg);
  564. if (msg.data || msg.data !== {}) {
  565. let mss = ''; // 信息
  566. let iserror = false;// 是否有控制错误的风机
  567. for (let v in msg.data) {
  568. let val = msg.data[v];
  569. if (val.errorCode > 0) {
  570. iserror = true;
  571. mss += `${val.windturbineId} ${this.controlErorCodes[val.errorCode]}\n`;
  572. }
  573. }
  574. let tp = iserror ? "warning" : "success";
  575. let dt = iserror ? 0 : 4500;
  576. if (!iserror) {
  577. mss = "控制成功";
  578. }
  579. this.$notify({
  580. title: "控制",
  581. message: mss,
  582. type: tp,
  583. position: "bottom-right",
  584. offset: 60,
  585. duration: 3000,
  586. });
  587. } else {
  588. this.$notify({
  589. title: "控制出现错误",
  590. message: '控制失败,请重试',
  591. type: "warning",
  592. position: "bottom-right",
  593. offset: 60,
  594. duration: 3000,
  595. });
  596. }
  597. },
  598. /* 控制失败 */
  599. controlError(err) {
  600. this.$notify({
  601. title: "控制出现错误",
  602. message: err.message,
  603. type: "warning",
  604. position: "bottom-right",
  605. offset: 60,
  606. duration: 3000,
  607. });
  608. },
  609. },
  610. watch: {
  611. "$store.getters.windturbinelist": {
  612. deep: true,
  613. handler: function (json) {
  614. this.windturbinelist = json
  615. let arr = Object.keys(json).sort()
  616. this.stopList = []
  617. this.startList = []
  618. this.maintainList = []
  619. this.unMaintainList = []
  620. for (let id of arr) {
  621. let val = json[id];
  622. this.chooseList.forEach(item => {
  623. if (item.windturbineId === val.windturbineId) {
  624. val.active = true
  625. }
  626. })
  627. this.titleList.forEach(item => {
  628. if (item.windturbineId === val.windturbineId) {
  629. val.operateStyle = item.operateStyle
  630. if (item.operateStyle === "Start" && val.status === 2) {
  631. this.startList.push(val)
  632. } else if (item.operateStyle === "Stop" && val.status === 4) {
  633. this.stopList.push(val)
  634. }
  635. else if (item.operateStyle === "Maintain" && val.status === 2) {
  636. this.maintainList.push(val)
  637. }
  638. else if (item.operateStyle === "UnMaintain" && val.status === 6) {
  639. this.unMaintainList.push(val)
  640. }
  641. }
  642. })
  643. }
  644. if (this.postData && (this.current === 1)) {
  645. let postList = [...this.startList, ...this.stopList]
  646. api.sendRecommend(postList).then(res => {
  647. if (res) {
  648. }
  649. })
  650. }
  651. this.postData = false
  652. let checkoutList = BackgroundData.getInstance().checkouts;
  653. checkoutList.forEach(item => {
  654. let starIndex = null
  655. let stopIndex = null
  656. let maintainIndex = null
  657. let unMaintainIndex = null
  658. let starFlag = false
  659. let stopFlag = false
  660. let maintainFlag = false
  661. let unMaintainFlag = false
  662. this.startList.forEach((param, index) => {
  663. if (item.windturbineId === param.windturbineId) {
  664. starIndex = index
  665. starFlag = true
  666. }
  667. })
  668. this.stopList.forEach((param, index) => {
  669. if (item.windturbineId === param.windturbineId) {
  670. stopIndex = index
  671. stopFlag = true
  672. }
  673. })
  674. this.maintainList.forEach((param, index) => {
  675. if (item.windturbineId === param.windturbineId) {
  676. maintainIndex = index
  677. maintainFlag = true
  678. }
  679. })
  680. this.unMaintainList.forEach((param, index) => {
  681. if (item.windturbineId === param.windturbineId) {
  682. unMaintainIndex = index
  683. unMaintainFlag = true
  684. }
  685. })
  686. starFlag ? this.startList.splice(starIndex, 1) : '';
  687. stopFlag ? this.stopList.splice(stopIndex, 1) : '';
  688. maintainFlag ? this.maintainList.splice(maintainIndex, 1) : '';
  689. unMaintainFlag ? this.unMaintainList.splice(unMaintainIndex, 1) : '';
  690. })
  691. },
  692. },
  693. "$store.getters.current": {
  694. handler: function (json) {
  695. this.current = json
  696. if (json === 0) {
  697. let dateList = []
  698. this.titleList.forEach(item => {
  699. if (item.windturbineId.slice(0, 2) === 'NG') {
  700. switch (item.operateStyle) {
  701. case 'Start':
  702. this.windturbinelist[item.windturbineId].controlType = 1
  703. break;
  704. case 'Stop':
  705. this.windturbinelist[item.windturbineId].controlType = 2
  706. break;
  707. case 'Maintain':
  708. this.windturbinelist[item.windturbineId].controlType = 6
  709. break;
  710. case 'UnMaintain':
  711. this.windturbinelist[item.windturbineId].controlType = 8
  712. break;
  713. }
  714. dateList.push(this.windturbinelist[item.windturbineId])
  715. }
  716. })
  717. let mss = {}
  718. mss.type = 'send'
  719. this.timer = setTimeout(() => {
  720. this.sendCommand(mss, dateList, 'automatic')
  721. this.showFlag = false
  722. clearInterval(this.timer);
  723. }, 3000);
  724. }
  725. }
  726. }
  727. },
  728. }
  729. </script>
  730. <style scoped="scoped">
  731. .body {
  732. border: 1px solid #373737;
  733. width: 100%;
  734. margin-left: 15px;
  735. margin-top: 20px;
  736. }
  737. .body .scoll {
  738. height: 91%;
  739. }
  740. .title {
  741. color: #ffffff;
  742. font-size: 14px;
  743. margin-left: 32px;
  744. /* margin-top: 12px; */
  745. margin-bottom: 10px;
  746. /* width: 570px; */
  747. width: 29vw;
  748. height: 50px;
  749. display: flex;
  750. align-items: center;
  751. position: absolute;
  752. background-color: #000000;
  753. }
  754. .title::before {
  755. z-index: 1;
  756. content: '';
  757. position: absolute;
  758. left: -18px !important;
  759. /* top: 30px !important; */
  760. width: 5px;
  761. height: 5px;
  762. background-color: #54B75A;
  763. border-radius: 50%;
  764. }
  765. .logo {
  766. position: absolute;
  767. top: 12px;
  768. left: 12px;
  769. }
  770. .matrix {
  771. margin-left: 20px;
  772. /* margin-right: 10px; */
  773. padding-bottom: 20px;
  774. border-bottom: 1px solid rgba(31, 31, 31, 1);
  775. }
  776. .problemTitle {
  777. font-size: 12px;
  778. color: #BFBFBF;
  779. margin-top: 20px;
  780. margin-bottom: 20px;
  781. margin-left: 12px;
  782. }
  783. .send {
  784. width: 86px;
  785. height: 26px;
  786. display: flex;
  787. align-items: center;
  788. justify-content: center;
  789. background-color: rgba(84, 183, 90, 1);
  790. color: #ffffff;
  791. font-size: 14px;
  792. position: absolute;
  793. bottom: 20px;
  794. right: 10px;
  795. }
  796. .success {
  797. display: flex;
  798. align-items: center;
  799. justify-content: center;
  800. width: 250px;
  801. height: 48px;
  802. position: absolute;
  803. bottom: 20px;
  804. right: 20%;
  805. border: 1px solid rgba(55, 55, 55, 1);
  806. border-radius: 10px;
  807. color: #ffffff;
  808. font-size: 14px;
  809. }
  810. </style>