BasicInformationDetail.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086
  1. <template>
  2. <div class="firstdiv">
  3. <el-row>
  4. <el-col :span="12">
  5. <StandAloneImg :activeIndex="showIndex" @selectSvg="selectSvg" class="sai"></StandAloneImg>
  6. </el-col>
  7. <el-col :span="12" class="rights">
  8. <!-- <div class="marks" v-if="healthInfo.bj">
  9. <div class="healthInfo">健康指数:</div>
  10. <div class="healthTable" v-if="healthInfo.other">
  11. <div class="healthTitle">
  12. <div class="name">名称</div>
  13. <div class="level">等级</div>
  14. <div class="times">重要报警次数</div>
  15. <div class="times">一般报警次数</div>
  16. </div>
  17. <div :class="showIndex===3?'healthContent_on':'healthContent'" @click="chooseInfo(3)">
  18. <div class="contentName">变桨</div>
  19. <el-rate class="starLevel" v-model="healthInfo.bj.star" disabled :max="max" void-color="#141414"
  20. text-color="#E8A20D">
  21. </el-rate>
  22. <div class="contentTimes">{{healthInfo.bj.heightCount}}</div>
  23. <div class="contentTimess">{{healthInfo.bj.lowCount}}</div>
  24. </div>
  25. <div :class="showIndex===2?'healthContent_on':'healthContent'" @click="chooseInfo(2)">
  26. <div class="contentName">齿轮箱</div>
  27. <el-rate class="starLevel" v-model="healthInfo.clx.star" disabled :max="max" void-color="#242424"
  28. text-color="#E8A20D">
  29. </el-rate>
  30. <div class="contentTimes">{{healthInfo.clx.heightCount}}</div>
  31. <div class="contentTimess">{{healthInfo.clx.lowCount}}</div>
  32. </div>
  33. <div :class="showIndex===1?'healthContent_on':'healthContent'" @click="chooseInfo(1)">
  34. <div class="contentName">发电机</div>
  35. <el-rate class="starLevel" v-model="healthInfo.fdj.star" disabled :max="max" void-color="#141414"
  36. text-color="#E8A20D">
  37. </el-rate>
  38. <div class="contentTimes">{{healthInfo.fdj.heightCount}}</div>
  39. <div class="contentTimess">{{healthInfo.fdj.lowCount}}</div>
  40. </div>
  41. <div :class="showIndex===5?'healthContent_on':'healthContent'" @click="chooseInfo(5)">
  42. <div class="contentName">液压</div>
  43. <el-rate class="starLevel" v-model="healthInfo.yy.star" disabled :max="max" void-color="#141414"
  44. text-color="#E8A20D">
  45. </el-rate>
  46. <div class="contentTimes">{{healthInfo.yy.heightCount}}</div>
  47. <div class="contentTimess">{{healthInfo.yy.lowCount}}</div>
  48. </div>
  49. <div :class="showIndex===4?'healthContent_on':'healthContent'" @click="chooseInfo(4)">
  50. <div class="contentName">偏航</div>
  51. <el-rate class="starLevel" v-model="healthInfo.ph.star" disabled :max="max" void-color="#141414"
  52. text-color="#E8A20D">
  53. </el-rate>
  54. <div class="contentTimes">{{healthInfo.ph.heightCount}}</div>
  55. <div class="contentTimess">{{healthInfo.ph.lowCount}}</div>
  56. </div>
  57. <div :class="showIndex===6?'healthContent_on':'healthContent'">
  58. <div class="contentName">其他</div>
  59. <el-rate class="starLevel" v-model="healthInfo.other.star" disabled :max="max" void-color="#141414"
  60. text-color="#E8A20D">
  61. </el-rate>
  62. <div class="contentTimes">{{healthInfo.other.heightCount}}</div>
  63. <div class="contentTimess">{{healthInfo.other.lowCount}}</div>
  64. </div>
  65. </div>
  66. </div> -->
  67. <div class="titleList">
  68. <div class="titleItem" @dblclick="dbClicks({code: 'JKZS',name: '健康指数'})">
  69. <div class="titleName">健康指数:</div>
  70. <div class="titleValues">{{dataValues?.score?.toFixed(0)}}</div>
  71. </div>
  72. <div class="line" />
  73. <div class="titleItem" @dblclick="dbClicks({code: 'ZYZS',name: '资源指数'})">
  74. <div class="titleName">资源指数:</div>
  75. <div class="titleValues">{{dataValues?.resourceLevel?.toFixed(0)}}</div>
  76. </div>
  77. <div class="line" />
  78. <div class="titleItem">
  79. <div class="titleName">运行状态:</div>
  80. <div class="titleValues">{{typeList[dataValues?.status]}}</div>
  81. </div>
  82. <div class="line" />
  83. <div class="titleItem">
  84. <div class="titleName">故障状态:</div>
  85. <img class="titleImg" v-if="!dataValues?.faultStatus" src="../assets/img/controlcenter/daraTrue.png" alt="">
  86. <img class="titleImg" v-else src="../assets/img/controlcenter/dataFalse.png" alt="">
  87. </div>
  88. </div>
  89. <div class="records">
  90. <el-scrollbar style="height:99%;">
  91. <div class="tables">
  92. <el-table :data="recordData" class="table" style=" width:100%" height="22vh" :header-cell-style="{
  93. background: 'rgb(30,30,30)',
  94. color: 'rgb(220,220,220)',
  95. padding: '4px',
  96. fontSize: '14px',
  97. 'border-bottom': 'solid 1px rgba(77, 77, 77, 1)',
  98. }" :cell-style="{
  99. height: '40px',
  100. background: 'rgb(30,30,30)',
  101. color: 'rgb(220,220,220)',
  102. padding: '3px',
  103. fontSize: '12px',
  104. 'border-bottom': '1px solid #000000'
  105. }">
  106. <el-table-column prop="time" label="日期" width="120" align="center">
  107. </el-table-column>
  108. <el-table-column prop="controls" label="控制命令" width="120" align="center">
  109. </el-table-column>
  110. <el-table-column prop="result" label="操作结果" align="center">
  111. </el-table-column>
  112. <el-table-column prop="userName" label="操作人" width="120" align="center">
  113. </el-table-column>
  114. </el-table>
  115. </div>
  116. </el-scrollbar>
  117. </div>
  118. <div class="showDate">
  119. <div class="label1">
  120. <div class="title">挂牌信息:</div>
  121. <!-- <div>挂牌原因</div> -->
  122. <el-select filterable allow-create default-first-option @change="listedChange(value)" class="inputs"
  123. v-model="selectValue" placeholder="请选择">
  124. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
  125. </el-option>
  126. </el-select>
  127. </div>
  128. </div>
  129. <div class="label">
  130. <div class="button" v-if="types === 2" @click="sendCommand({controlType:'1' })">启动</div>
  131. <div class="button" v-if="types === 4" @click="sendCommand({controlType:'2' })">停机</div>
  132. <div class="button" v-if="types === 0 ||types === 5 " @click="sendCommand({controlType:'5' })">
  133. 复位</div>
  134. <div class="button" v-if="types === 2" @click="sendCommand({controlType:'6' })">维护</div>
  135. <div class="button" v-if="types === 6" @click="sendCommand({controlType:'8' })">取消维护</div>
  136. <div class="button" v-if="selectValue !==''" @click="sendLock({value: 'UnLock' })">取消挂牌
  137. </div>
  138. </div>
  139. </el-col>
  140. </el-row>
  141. <el-row class="datas">
  142. <el-col :span="12">
  143. <div class="dataList">
  144. <div class="dataTitle">
  145. <div style="margin-left: 24px;">部件主要参数</div>
  146. </div>
  147. <div class="dataContent">
  148. <div class="dataBlock" v-for="(item,index) in showData" :key="index" @dblclick="dbClicks(item)">
  149. <div class="dataName">{{item.name}}</div>
  150. <div class="numerical">
  151. <div class="values">{{item.value}}</div>
  152. <div class="unit">{{item.unit}}</div>
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. </el-col>
  158. <el-col :span="12">
  159. <div class="dataLists">
  160. <div class="dataTitle">
  161. <div style="margin-left: 24px;">报警记录</div>
  162. </div>
  163. <el-scrollbar class="scorll">
  164. <el-table stripe="true" border-color="#141414" :data="warning" style="width: 100%" :header-cell-style="{
  165. background: '#141414',
  166. color: '#B3B3B3',
  167. 'border-bottom':'solid 1px #242424',
  168. 'text-align':'center'
  169. }"
  170. :cell-style="{ background: '#141414', color: '#B3B3B3', 'border-bottom': 'solid 1px #242424','text-align':'center' }">
  171. <el-table-column prop="time" label="时间" width="220">
  172. </el-table-column>
  173. <el-table-column prop="alertText" label="故障信息" width="280">
  174. </el-table-column>
  175. <el-table-column prop="rankName" label="故障级别">
  176. </el-table-column>
  177. </el-table>
  178. </el-scrollbar>
  179. </div>
  180. </el-col>
  181. </el-row>
  182. <BasicDataDetails @closed="closeds()" v-model="display" :datas="windDetails" :partsName="partsName"
  183. echartsId="partEcharts" @search-data="search" @original-data="originalData"></BasicDataDetails>
  184. </div>
  185. </template>
  186. <script>
  187. import BackgroundData from 'utils/BackgroundData'
  188. import BasicDataDetails from "./basicDataDetails.vue";
  189. import StandAloneImg from "./StandAloneImg.vue";
  190. import dayjs from 'dayjs'
  191. import api from "api/index";
  192. export default {
  193. name: "BasicInformationDetail",
  194. components: {
  195. // Worning,
  196. StandAloneImg,
  197. BasicDataDetails,
  198. },
  199. props: {
  200. types: {
  201. type: Number,
  202. default: null,
  203. },
  204. windturbine: Object,
  205. },
  206. mounted() {
  207. this.getLocks()
  208. // this.getHealthDate()
  209. this.getWarning()
  210. this.getDetial()
  211. this.records()
  212. },
  213. data() {
  214. return {
  215. // warnList: [],
  216. display: false,
  217. BasicInfo: {},
  218. // temperatureInfo: new Array() /* 温度信息 */,
  219. // pitchInfo: new Array() /* 变桨信息 */,
  220. // generalInfo: new Array() /* 基本信息 */,
  221. // powerGridInfo: new Array() /* 电网信息 */,
  222. restaurants: [],
  223. lockValues: [],
  224. windDetails: [],
  225. state1: "",
  226. showIndex: 1,
  227. starValue: 3,
  228. max: 4,
  229. current: null,
  230. disableds: true,
  231. options: [{
  232. value: '8',
  233. label: '检修'
  234. }, {
  235. value: '7',
  236. label: '故障维修'
  237. }, {
  238. value: '2',
  239. label: '场内受累检修'
  240. }, {
  241. value: '3',
  242. label: '场内受累故障'
  243. }, {
  244. value: '4',
  245. label: '场外受累电网'
  246. }, {
  247. value: '5',
  248. label: '场外受累天气'
  249. }],
  250. typeList: [
  251. '停机',
  252. '上电',
  253. '待机',
  254. '启动',
  255. '并网',
  256. '故障',
  257. '维护',
  258. '离线',
  259. ],
  260. selectValue: '7',
  261. healthInfo: {},
  262. dataValues: {},
  263. warning: ["-"],
  264. showData: [],
  265. partsName: '',
  266. modelData: {},
  267. interval: 60,
  268. controlErorCodes: [
  269. "控制成功",
  270. "控制命令发送失败",
  271. "无效的控制地址",
  272. "被控设备异常",
  273. "网络连接错误,检查场站通信",
  274. "控制结果读取超时",
  275. "未知错误",
  276. "控制命令错误",
  277. "收到无法识别数据",
  278. "未读取到数据包",
  279. "未知错误",
  280. "风机操作过频繁",
  281. "风机被挂牌",
  282. "风机操作与风机状态不符",
  283. "需要登录",
  284. ],
  285. recordData: [],
  286. };
  287. },
  288. methods: {
  289. getHealthDate() {
  290. api.getHealthDate(this.windturbine.stationId, this.windturbine.windturbineId).then(msg => {
  291. if (msg.data.code === 200) {
  292. this.healthInfo = msg.data.data;
  293. }
  294. })
  295. .catch(err => {
  296. console.log(err);
  297. });
  298. },
  299. getDetial() {
  300. api.getDetial(this.windturbine.windturbineId).then(msg => {
  301. this.dataValues = msg.data
  302. this.$emit('health-click', msg.data);
  303. if (msg.data.lockType === 9) {
  304. this.selectValue = this.lockValues?.filter(item => this.windturbine.windturbineId === item.windturbineID)[0]?.value;
  305. } else {
  306. this.selectValue = (msg.data.lockType === 0 ? '' : String(msg.data.lockType))
  307. }
  308. setTimeout(() => {
  309. this.getDetial()
  310. }, 1000);
  311. })
  312. },
  313. getLocks() {
  314. api.getCustomerLock().then(res => {
  315. if (res) {
  316. this.lockValues = res.data
  317. }
  318. })
  319. },
  320. records() {
  321. let date = new Date()
  322. api.controlRecord({
  323. stationId: this.windturbine.stationId,
  324. userName: "",
  325. windturbineId: this.windturbine.windturbineId,
  326. startTime: dayjs(date.getTime() - 172800000).format('YYYY/MM/DD HH:mm:ss'),
  327. endTime: dayjs(date.getTime()).format('YYYY/MM/DD HH:mm:ss'),
  328. pageSize: 100,
  329. pageIndex: 1,
  330. }).then(res => {
  331. if (res) {
  332. let types = {
  333. Start: '启动',
  334. Stop: '停止',
  335. Reset: '复位',
  336. Maintain: '维护',
  337. UnMaintain: '取消维护',
  338. Lock: '挂牌',
  339. UnLock: '取消挂牌',
  340. }
  341. res.data.dataList.forEach(item => {
  342. item.time = dayjs(item.time).format('MM-DD HH:mm:ss')
  343. item.result = this.controlErorCodes[item.errorCode]
  344. item.controls = types[item.controlType]
  345. })
  346. this.recordData = res.data.dataList
  347. }
  348. })
  349. },
  350. getWarning() {
  351. let parts = ''
  352. switch (this.showIndex) {
  353. case 1:
  354. parts = 'fdj'
  355. break;
  356. case 2:
  357. parts = 'clx'
  358. break;
  359. case 3:
  360. parts = 'bj'
  361. break;
  362. case 4:
  363. parts = 'ph'
  364. break;
  365. case 5:
  366. parts = 'yy'
  367. break;
  368. }
  369. api.getWarning(this.windturbine.stationId, this.windturbine.windturbineId, parts).then(msg => {
  370. if (msg.data.code === 200) {
  371. msg.data.data && msg.data.data.forEach(item => {
  372. item.time = dayjs(item.time).format('MM-DD HH:mm:ss')
  373. })
  374. this.warning = msg.data.data;
  375. }
  376. })
  377. .catch(err => {
  378. console.log(err);
  379. });
  380. },
  381. chooseInfo(value) {
  382. this.showIndex = value
  383. switch (this.showIndex) {
  384. case 1:
  385. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part6")[0]?.param
  386. break;
  387. case 2:
  388. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part8")[0]?.param
  389. break;
  390. case 3:
  391. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part7")[0]?.param
  392. break;
  393. case 4:
  394. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part10")[0]?.param
  395. break;
  396. case 5:
  397. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part9")[0]?.param
  398. break;
  399. }
  400. this.getWarning()
  401. },
  402. listedChange() {
  403. switch (this.selectValue) {
  404. case '8':
  405. this.sendLock({ value: "CheckLock" });
  406. break;
  407. case '7':
  408. this.sendLock({ value: "FaultLock" });
  409. break;
  410. case '2':
  411. this.sendLock({ value: "StationCheckLock" });
  412. break;
  413. case '3':
  414. this.sendLock({ value: "StationFaulLock" });
  415. break;
  416. case '4':
  417. this.sendLock({ value: "StationPowerLineLock" });
  418. break;
  419. case '5':
  420. this.sendLock({ value: "StationWeatherLock" });
  421. break;
  422. default:
  423. this.sendLock({ value: "CustomerLock", lockValue: this.selectValue });
  424. break;
  425. }
  426. },
  427. // labelChange() {
  428. // let values = BackgroundData.getInstance().Marks;
  429. // if (!values.filter(item => item.title = this.windturbine.windturbineId)[0]) {
  430. // this.menuClicked({ type: "marking" })
  431. // }
  432. // BackgroundData.getInstance().updateMarks(this.windturbine, this.state1);
  433. // },
  434. start(bi) {
  435. this.BasicInfo = bi;
  436. // this.bindData();
  437. this.refreshData();
  438. this.getLocks()
  439. this.getDetial()
  440. this.records()
  441. this.refreshTimer = setInterval(this.refreshData, 3000);
  442. },
  443. end() {
  444. clearInterval(this.refreshTimer);
  445. },
  446. /* 刷新数据 */
  447. refreshData() {
  448. let bg = BackgroundData.getInstance();
  449. let mark = BackgroundData.getInstance().Marks;
  450. console.log(mark);
  451. bg.initWinturbineBaseData(this.BasicInfo, this.onMessage);
  452. },
  453. /* 获得数据 */
  454. onMessage(msg) {
  455. this.BasicInfo.BasicInfo.forEach((element) => {
  456. element.param.forEach((im) => {
  457. let val = msg[im.code];
  458. if (typeof val !== "undefined") {
  459. if (im.unit == "万度") {
  460. im.value = (val.doubleValue / 10000).toFixed(2);
  461. } else {
  462. im.value = val.doubleValue === 0 ? val.doubleValue : val.doubleValue ? val.doubleValue.toFixed(2) : val.longValue ? val.longValue : val.booleanValue;
  463. }
  464. }
  465. });
  466. });
  467. switch (this.showIndex) {
  468. case 1:
  469. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part6")[0]?.param
  470. break;
  471. case 2:
  472. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part8")[0]?.param
  473. break;
  474. case 3:
  475. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part7")[0]?.param
  476. break;
  477. case 4:
  478. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part10")[0]?.param
  479. break;
  480. case 5:
  481. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part9")[0]?.param
  482. break;
  483. }
  484. },
  485. // bindData() {
  486. // this.BasicInfo.BasicInfo.forEach((element) => {
  487. // if (element.tag == "基本信息") {
  488. // this.generalInfo = element.param;
  489. // } else if (element.tag == "温度信息") {
  490. // this.temperatureInfo = element.param;
  491. // } else if (element.tag == "电网信息") {
  492. // this.powerGridInfo = element.param;
  493. // } else if (element.tag == "桨叶信息") {
  494. // this.pitchInfo = element.param;
  495. // }
  496. // });
  497. // },
  498. querySearch(queryString, cb) {
  499. let restaurants = this.restaurants;
  500. let results = queryString
  501. ? restaurants.filter(this.createFilter(queryString))
  502. : restaurants;
  503. // 调用 callback 返回建议列表的数据
  504. cb(results);
  505. },
  506. createFilter(queryString) {
  507. return (restaurant) => {
  508. return (
  509. restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) ===
  510. 0
  511. );
  512. };
  513. },
  514. handleSelect(item) {
  515. console.log(item);
  516. },
  517. selectSvg(index) {
  518. this.showIndex = index;
  519. // this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === `part${this.showIndex+5}`)[0]?.param
  520. switch (this.showIndex) {
  521. case 1:
  522. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === `part6`)[0]?.param
  523. break;
  524. case 2:
  525. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part8")[0]?.param
  526. break;
  527. case 3:
  528. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part7")[0]?.param
  529. break;
  530. case 4:
  531. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part10")[0]?.param
  532. break;
  533. case 5:
  534. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part9")[0]?.param
  535. break;
  536. }
  537. this.getWarning()
  538. },
  539. sendCommand(msg, windturbine) {
  540. let bd = BackgroundData.getInstance();
  541. if (!bd.LoginUser) {
  542. this.$notify({
  543. title: "请登录",
  544. message: "控制风机需要先登录!",
  545. type: "warning",
  546. position: "bottom-right",
  547. offset: 60,
  548. duration: 3000,
  549. });
  550. return;
  551. }
  552. let sendList = []
  553. this.windturbine.controlType = Number(msg.controlType)
  554. sendList.push(this.windturbine)
  555. if (sendList.length > 0) {
  556. bd.checkout(sendList);
  557. let pairs = {}
  558. sendList.forEach(item => {
  559. let ct = {
  560. windturbineId: item.windturbineId,
  561. stationId: item.stationId,
  562. projectId: item.projectId,
  563. modelId: item.modelId,
  564. controlType: item.controlType,
  565. lockType: item.lockType,
  566. userName: `system_${bd.LoginUser.name}`,
  567. userId: 0,
  568. };
  569. pairs[ct.windturbineId] = ct;
  570. })
  571. api.windturbControl(pairs).then(res => {
  572. if (res) {
  573. this.controlSuccess(res)
  574. }
  575. })
  576. }
  577. },
  578. sendLock(msg) {
  579. let bd = BackgroundData.getInstance();
  580. if (!bd.LoginUser) {
  581. this.$notify({
  582. title: "请登录",
  583. message: "控制风机需要先登录!",
  584. type: "warning",
  585. position: "bottom-right",
  586. offset: 60,
  587. duration: 3000,
  588. });
  589. return;
  590. }
  591. let sendList = []
  592. this.windturbine.lockType = msg.value;
  593. if (msg.lockValue) {
  594. this.windturbine.lockValue = msg.lockValue
  595. }
  596. sendList.push(this.windturbine)
  597. if (sendList.length > 0) {
  598. this.chooseList = []
  599. let pairs = {}
  600. sendList.forEach(item => {
  601. let ct = {
  602. windturbineId: item.windturbineId,
  603. stationId: item.stationId,
  604. projectId: item.projectId,
  605. modelId: item.modelId,
  606. controlType: item.controlType,
  607. lockType: item.lockType,
  608. lockValue: item.lockValue,
  609. userName: `system_${bd.LoginUser.name}`,
  610. userId: 0,
  611. };
  612. pairs[ct.windturbineId] = ct;
  613. })
  614. api.windturbControlLock(pairs).then(res => {
  615. if (res) {
  616. this.controlSuccess(res)
  617. }
  618. })
  619. }
  620. },
  621. /* 控制成功 */
  622. controlSuccess(msg) {
  623. console.log(msg);
  624. let mss = ''; // 信息
  625. let iserror = false;// 是否有控制错误的风机
  626. for (let v in msg.data) {
  627. let val = msg.data[v];
  628. if (val.errorCode > 0) {
  629. iserror = true;
  630. mss += `${val.windturbineId} ${this.controlErorCodes[val.errorCode]}\n`;
  631. }
  632. }
  633. let tp = iserror ? "warning" : "success";
  634. let dt = iserror ? 0 : 4500;
  635. if (!iserror) {
  636. mss = "控制成功";
  637. }
  638. this.$notify({
  639. title: "控制",
  640. message: mss,
  641. type: tp,
  642. position: "bottom-right",
  643. offset: 60,
  644. duration: 3000,
  645. });
  646. },
  647. /* 控制失败 */
  648. controlError(err) {
  649. this.$notify({
  650. title: "控制出现错误",
  651. message: err.message,
  652. type: "warning",
  653. position: "bottom-right",
  654. offset: 60,
  655. duration: 3000,
  656. });
  657. },
  658. dbClicks(value, windturbineId, timeValues) {
  659. this.modelData = value
  660. let date = new Date()
  661. let endTs = timeValues ? (timeValues[1] > date.getTime()) ? date.getTime() : timeValues[1] : date.getTime();
  662. let startTs = timeValues ? timeValues[0] : endTs - 28800000;
  663. api.getWindturbinePower({
  664. thingId: windturbineId ? windturbineId : this.windturbine.windturbineId,
  665. uniformCode: value.code,
  666. startTs: startTs,
  667. endTs: endTs,
  668. thingType: 'windturbine',
  669. interval: this.interval,
  670. }).then(res => {
  671. if (res.data.length > 0) {
  672. this.windDetails = res.data
  673. this.partsName = value.name
  674. this.display = true;
  675. } else {
  676. this.windDetails = []
  677. }
  678. })
  679. },
  680. original(value, windturbineId, timeValues) {
  681. this.modelData = value
  682. let date = new Date()
  683. let endTs = timeValues ? (timeValues[1] > date.getTime()) ? date.getTime() : timeValues[1] : date.getTime();
  684. let startTs = timeValues ? timeValues[0] : endTs - 28800000;
  685. api.getOriginalWindturbinePower({
  686. thingId: windturbineId ? windturbineId : this.windturbine.windturbineId,
  687. uniformCode: value.code,
  688. startTs: startTs,
  689. endTs: endTs,
  690. thingType: 'windturbine',
  691. }).then(res => {
  692. if (res.data.length > 0) {
  693. this.windDetails = res.data
  694. this.partsName = value.name
  695. this.display = true
  696. } else {
  697. this.windDetails = []
  698. }
  699. })
  700. },
  701. search(values, interval) {
  702. this.interval = interval
  703. this.dbClicks(this.modelData, '', values)
  704. },
  705. originalData(values) {
  706. this.original(this.modelData, '', values)
  707. },
  708. closeds() {
  709. this.display = false
  710. this.interval = 60
  711. }
  712. },
  713. };
  714. </script>
  715. <style scoped>
  716. .firstdiv {
  717. height: 70vh;
  718. }
  719. .onediv {
  720. float: left;
  721. margin-right: 30px;
  722. }
  723. .twodiv {
  724. float: right;
  725. margin-right: 30px;
  726. }
  727. td:nth-child(1) {
  728. height: 25px;
  729. width: 130px;
  730. text-align: right;
  731. }
  732. td:nth-child(2) {
  733. width: 78px;
  734. text-align: right;
  735. color: rgb(5, 176, 71);
  736. }
  737. td:nth-child(3) {
  738. text-align: center;
  739. width: 30px;
  740. }
  741. tr:nth-child(1) {
  742. font-size: 20px;
  743. width: 90px;
  744. text-align: right;
  745. }
  746. th {
  747. height: 40px;
  748. }
  749. table {
  750. margin-top: 30px;
  751. }
  752. .sai {
  753. float: left;
  754. margin-left: 40px;
  755. margin-top: 30px;
  756. margin-bottom: 15px;
  757. width: 55vh;
  758. height: 34vh;
  759. }
  760. .rights {
  761. display: flex;
  762. flex-direction: column;
  763. }
  764. .marks {
  765. display: flex;
  766. flex-direction: column;
  767. }
  768. .title {
  769. margin-right: 16px;
  770. font-size: 18px;
  771. color: #ffffff;
  772. }
  773. .inputs {
  774. border: none;
  775. width: 174px !important;
  776. }
  777. .area {
  778. border: 2px dashed #ffffff;
  779. height: 200px;
  780. border-radius: 10px;
  781. margin-top: 20px;
  782. margin-left: 5.5%;
  783. }
  784. .healthInfo {
  785. margin-top: 16px;
  786. margin-bottom: 11px;
  787. font-size: 18px;
  788. color: #FFFFFF;
  789. }
  790. .healthTable {
  791. width: 688px;
  792. background-color: #141414;
  793. }
  794. .healthTitle {
  795. width: 100%;
  796. height: 37px;
  797. background-color: #242424;
  798. font-size: 12px;
  799. color: #FFFFFF;
  800. display: flex;
  801. flex-direction: row;
  802. margin-bottom: 5px;
  803. }
  804. .name {
  805. width: 172px;
  806. height: 100%;
  807. display: flex;
  808. align-items: center;
  809. justify-content: center;
  810. }
  811. .level {
  812. width: 211px;
  813. height: 100%;
  814. display: flex;
  815. align-items: center;
  816. justify-content: center;
  817. }
  818. .times {
  819. width: 153px;
  820. height: 100%;
  821. display: flex;
  822. align-items: center;
  823. justify-content: center;
  824. }
  825. .healthContent {
  826. height: 30px;
  827. display: flex;
  828. flex-direction: row;
  829. width: 96%;
  830. margin-left: 2%;
  831. border-bottom: 1px solid #242424;
  832. font-size: 12px;
  833. color: #B3B3B3;
  834. }
  835. .healthContent_on {
  836. height: 30px;
  837. display: flex;
  838. flex-direction: row;
  839. width: 96%;
  840. margin-left: 2%;
  841. border-bottom: 1px solid #242424;
  842. background-color: #242424;
  843. font-size: 12px;
  844. color: #05BB4C;
  845. }
  846. .contentName {
  847. width: 158px;
  848. height: 100%;
  849. display: flex;
  850. align-items: center;
  851. justify-content: center;
  852. margin-left: -5px;
  853. }
  854. .starLevel {
  855. width: 211px;
  856. height: 100%;
  857. display: flex;
  858. align-items: center;
  859. justify-content: center;
  860. margin-left: 8px;
  861. }
  862. .contentTimes {
  863. width: 124px;
  864. height: 100%;
  865. display: flex;
  866. align-items: center;
  867. justify-content: center;
  868. margin-left: 11px;
  869. }
  870. .contentTimess {
  871. width: 120px;
  872. height: 100%;
  873. display: flex;
  874. align-items: center;
  875. justify-content: center;
  876. margin-left: 30px;
  877. }
  878. .label {
  879. display: flex;
  880. flex-direction: row;
  881. align-items: center;
  882. margin-top: 16px;
  883. }
  884. .label1 {
  885. display: flex;
  886. flex-direction: row;
  887. align-items: center;
  888. margin-top: 16px;
  889. margin-right: 15px;
  890. }
  891. .button {
  892. width: 100px;
  893. height: 27px;
  894. display: flex;
  895. align-items: center;
  896. justify-content: center;
  897. font-size: 12px;
  898. color: #ffffff;
  899. background-color: #242424;
  900. border: 1px solid #3D3D3D;
  901. margin-right: 12px;
  902. }
  903. .datas {
  904. margin-top: 15px;
  905. }
  906. .dataList {
  907. width: 94%;
  908. /* min-height: 250px; */
  909. height: 28vh;
  910. background-color: #141414;
  911. display: flex;
  912. flex-direction: column;
  913. margin-left: 2%;
  914. }
  915. .dataLists {
  916. width: 97%;
  917. /* min-height: 250px; */
  918. height: 28vh;
  919. background-color: #141414;
  920. display: flex;
  921. flex-direction: column;
  922. }
  923. .dataTitle {
  924. display: flex;
  925. height: 37px;
  926. width: 100%;
  927. background-color: #242424;
  928. color: #FFFFFF;
  929. font-size: 12px;
  930. align-items: center;
  931. }
  932. .dataContent {
  933. display: flex;
  934. flex-direction: row;
  935. flex-wrap: wrap;
  936. }
  937. .dataBlock {
  938. width: 145px;
  939. height: 62px;
  940. background-color: #242424;
  941. border: 1px solid #3D3D3D;
  942. margin-left: 16px;
  943. margin-top: 22px;
  944. display: flex;
  945. flex-direction: column;
  946. justify-content: center;
  947. }
  948. .dataName {
  949. font-size: 12px;
  950. color: #FFFFFF;
  951. margin-left: 26px;
  952. margin-bottom: 6px;
  953. }
  954. .numerical {
  955. display: flex;
  956. flex-direction: row;
  957. color: #05BB4C;
  958. align-items: baseline;
  959. margin-left: 26px;
  960. }
  961. .values {
  962. font-size: 16px;
  963. }
  964. .unit {
  965. font-size: 12px;
  966. margin-left: 8px;
  967. }
  968. .scorll {
  969. height: 212px;
  970. }
  971. .showDate {
  972. display: flex;
  973. flex-direction: row;
  974. justify-content: space-between;
  975. align-items: center;
  976. }
  977. .el-table {
  978. background-color: #141414 !important;
  979. }
  980. .el-table::before {
  981. width: 0;
  982. }
  983. .titleList {
  984. display: flex;
  985. flex-direction: row;
  986. align-items: center;
  987. width: 98%;
  988. height: 43px;
  989. background-color: #242424;
  990. border: 1px solid #3D3D3D;
  991. margin-top: 13px;
  992. }
  993. .titleItem {
  994. display: flex;
  995. flex-direction: row;
  996. width: 25%;
  997. height: 100%;
  998. align-items: center;
  999. justify-content: center;
  1000. font-size: 16px;
  1001. }
  1002. .titleName {
  1003. color: #FFFFFF;
  1004. }
  1005. .titleValues {
  1006. color: #05BB4C;
  1007. margin-left: 10px;
  1008. }
  1009. .line {
  1010. height: 23px;
  1011. width: 1px;
  1012. background-color: #3D3D3D;
  1013. }
  1014. .titleImg {
  1015. width: 16px;
  1016. height: 16px;
  1017. margin-left: 10px;
  1018. }
  1019. .records{
  1020. width: 98%;
  1021. height: 22vh;
  1022. margin-top: 16px;
  1023. }
  1024. </style>