BasicInformationDetail.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974
  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="right">
  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="showDate">
  68. <div class="label">
  69. <div class="title">标注信息:</div>
  70. <el-autocomplete @blur="labelChange(state1)" class="inputs" v-model="state1"
  71. :fetch-suggestions="querySearch" placeholder="请输入内容" @select="handleSelect" style="width: 174px">
  72. </el-autocomplete>
  73. </div>
  74. <div class="label1">
  75. <div class="title">挂牌信息:</div>
  76. <!-- <div>挂牌原因</div> -->
  77. <el-select @change="listedChange(value)" class="inputs" v-model="selectValue" placeholder="请选择">
  78. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
  79. </el-option>
  80. </el-select>
  81. </div>
  82. </div>
  83. <div class="label">
  84. <div class="button" v-if="types === 2" @click="menuClicked({ type: 'send', controlType:'1' })">启动</div>
  85. <div class="button" v-if="types === 4" @click="menuClicked({ type: 'send', controlType:'2' })">停机</div>
  86. <div class="button" v-if="types === 0 ||types === 5 " @click="menuClicked({ type: 'send', controlType:'5' })">
  87. 复位</div>
  88. <div class="button" v-if="types === 2" @click="menuClicked({ type: 'send', controlType:'6' })">维护</div>
  89. <div class="button" v-if="types === 6" @click="menuClicked({ type: 'send', controlType:'8' })">取消维护</div>
  90. <div class="button" v-if="selectValue !==''" @click="menuClicked({ type: 'lock', value: 'UnLock' })">取消挂牌
  91. </div>
  92. <!-- <div class="button" @click="menuClicked({ type: 'send' })">生成缺陷单</div> -->
  93. </div>
  94. </el-col>
  95. </el-row>
  96. <el-row class="datas">
  97. <el-col :span="12">
  98. <div class="dataList">
  99. <div class="dataTitle">
  100. <div style="margin-left: 24px;">部件主要参数</div>
  101. </div>
  102. <div class="dataContent">
  103. <div class="dataBlock" v-for="(item,index) in showData" :key="index">
  104. <div class="dataName">{{item.name}}</div>
  105. <div class="numerical">
  106. <div class="values">{{item.value}}</div>
  107. <div class="unit">{{item.unit}}</div>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </el-col>
  113. <el-col :span="12">
  114. <div class="dataLists">
  115. <div class="dataTitle">
  116. <div style="margin-left: 24px;">报警记录</div>
  117. </div>
  118. <el-scrollbar class="scorll">
  119. <el-table stripe="true" border-color="#141414" :data="warning" style="width: 100%" :header-cell-style="{
  120. background: '#141414',
  121. color: '#B3B3B3',
  122. 'border-bottom':'solid 1px #242424',
  123. 'text-align':'center'
  124. }"
  125. :cell-style="{ background: '#141414', color: '#B3B3B3', 'border-bottom': 'solid 1px #242424','text-align':'center' }">
  126. <el-table-column prop="time" label="时间" width="220">
  127. </el-table-column>
  128. <el-table-column prop="alertText" label="故障信息" width="280">
  129. </el-table-column>
  130. <el-table-column prop="rankName" label="故障级别">
  131. </el-table-column>
  132. </el-table>
  133. </el-scrollbar>
  134. </div>
  135. </el-col>
  136. </el-row>
  137. </div>
  138. </template>
  139. <script>
  140. import BackgroundData from 'utils/BackgroundData'
  141. // import Worning from "./warning.vue"
  142. import axios from 'axios';
  143. import StandAloneImg from "./StandAloneImg.vue";
  144. import dayjs from 'dayjs'
  145. export default {
  146. name: "BasicInformationDetail",
  147. components: {
  148. // Worning,
  149. StandAloneImg,
  150. },
  151. props: {
  152. types: {
  153. type: Number,
  154. default: null,
  155. },
  156. windturbine: Object,
  157. },
  158. mounted() {
  159. this.getDetial()
  160. this.getHealthDate()
  161. this.getWarning()
  162. },
  163. beforeUpdate() {
  164. },
  165. data() {
  166. return {
  167. // warnList: [],
  168. BasicInfo: {},
  169. temperatureInfo: new Array() /* 温度信息 */,
  170. pitchInfo: new Array() /* 变桨信息 */,
  171. generalInfo: new Array() /* 基本信息 */,
  172. powerGridInfo: new Array() /* 电网信息 */,
  173. restaurants: [],
  174. state1: "",
  175. showIndex: 1,
  176. starValue: 3,
  177. max: 4,
  178. current: null,
  179. disableds: true,
  180. tableData: [{
  181. date: '2016-05-02',
  182. name: '王小虎',
  183. address: '上海市普陀区金沙江路 1518 弄'
  184. }, {
  185. date: '2016-05-04',
  186. name: '王小虎',
  187. address: '上海市普陀区金沙江路 1517 弄'
  188. }, {
  189. date: '2016-05-01',
  190. name: '王小虎',
  191. address: '上海市普陀区金沙江路 1519 弄'
  192. }, {
  193. date: '2016-05-03',
  194. name: '王小虎',
  195. address: '上海市普陀区金沙江路 1516 弄'
  196. }, {
  197. date: '2016-05-08',
  198. name: '王小虎',
  199. address: '上海市普陀区金沙江路 1516 弄'
  200. }, {
  201. date: '2016-05-09',
  202. name: '王小虎',
  203. address: '上海市普陀区金沙江路 1516 弄'
  204. }],
  205. options: [{
  206. value: '8',
  207. label: '检修'
  208. }, {
  209. value: '7',
  210. label: '故障维修'
  211. }, {
  212. value: '2',
  213. label: '场内受累检修'
  214. }, {
  215. value: '3',
  216. label: '场内受累故障'
  217. }, {
  218. value: '4',
  219. label: '场外受累电网'
  220. }, {
  221. value: '5',
  222. label: '场外受累天气'
  223. }],
  224. selectValue: '7',
  225. healthInfo: {},
  226. warning: [],
  227. showData: [],
  228. controlErorCodes: [
  229. "控制成功",
  230. "控制命令发送失败",
  231. "无效的控制地址",
  232. "被控设备异常",
  233. "网络连接错误,检查场站通信",
  234. "控制结果读取超时",
  235. "未知错误",
  236. "控制命令错误",
  237. "收到无法识别数据",
  238. "未读取到数据包",
  239. "未知错误",
  240. "风机操作过频繁",
  241. "风机被挂牌",
  242. "风机操作与风机状态不符",
  243. "需要登录",
  244. ],
  245. };
  246. },
  247. methods: {
  248. getHealthDate() {
  249. axios.get(`http://18.6.30.53:8070/alarm/statistic?stId=${this.windturbine.stationId}&wtId=${this.windturbine.windturbineId}`)
  250. .then(msg => {
  251. if (msg.data.code === 200) {
  252. this.healthInfo = msg.data.data;
  253. }
  254. })
  255. .catch(err => {
  256. console.log(err);
  257. });
  258. },
  259. getDetial() {
  260. axios.get(process.env.VUE_APP_API+`/api/windturbine/info/${this.windturbine.windturbineId}`)
  261. .then(msg => {
  262. let restaurants = []
  263. this.selectValue = (msg.data.lockType === 0 ? '' : String(msg.data.lockType))
  264. this.state1 = msg.data.markValue
  265. msg.data.markValues.forEach(item => {
  266. let data = {}
  267. data.value = item
  268. restaurants.push(data)
  269. })
  270. this.restaurants = restaurants
  271. })
  272. },
  273. getWarning() {
  274. let parts = ''
  275. switch (this.showIndex) {
  276. case 1:
  277. parts = 'fdj'
  278. break;
  279. case 2:
  280. parts = 'clx'
  281. break;
  282. case 3:
  283. parts = 'bj'
  284. break;
  285. case 4:
  286. parts = 'ph'
  287. break;
  288. case 5:
  289. parts = 'yy'
  290. break;
  291. }
  292. axios.get(`http://18.6.30.53:8070/alarm/list?stId=${this.windturbine.stationId}&wtId=${this.windturbine.windturbineId}&widget=${parts}`)
  293. .then(msg => {
  294. if (msg.data.code === 200) {
  295. msg.data.data && msg.data.data.forEach(item => {
  296. item.time = dayjs(item.time).format('MM-DD HH:mm:ss')
  297. })
  298. this.warning = msg.data.data;
  299. }
  300. })
  301. .catch(err => {
  302. console.log(err);
  303. });
  304. },
  305. chooseInfo(value) {
  306. this.showIndex = value
  307. switch (this.showIndex) {
  308. case 1:
  309. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part6")[0] ? this.BasicInfo.BasicInfo.filter(item => item.index === "part6")[0].param : []
  310. break;
  311. case 2:
  312. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part8")[0] ? this.BasicInfo.BasicInfo.filter(item => item.index === "part8")[0].param : []
  313. break;
  314. case 3:
  315. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part7")[0] ? this.BasicInfo.BasicInfo.filter(item => item.index === "part7")[0].param : []
  316. break;
  317. case 4:
  318. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part10")[0] ? this.BasicInfo.BasicInfo.filter(item => item.index === "part10")[0].param : []
  319. break;
  320. case 5:
  321. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part9")[0] ? this.BasicInfo.BasicInfo.filter(item => item.index === "part9")[0].param : []
  322. break;
  323. }
  324. this.getWarning()
  325. },
  326. listedChange() {
  327. switch (this.selectValue) {
  328. case '8':
  329. this.menuClicked({ type: "lock", value: "CheckLock" });
  330. break;
  331. case '7':
  332. this.menuClicked({ type: "lock", value: "FaultLock" });
  333. break;
  334. case '2':
  335. this.menuClicked({ type: "lock", value: "StationCheckLock" });
  336. break;
  337. case '3':
  338. this.menuClicked({ type: "lock", value: "StationFaulLock" });
  339. break;
  340. case '4':
  341. this.menuClicked({ type: "lock", value: "StationPowerLineLock" });
  342. break;
  343. case '5':
  344. this.menuClicked({ type: "lock", value: "StationWeatherLock" });
  345. break;
  346. }
  347. },
  348. labelChange() {
  349. let values = BackgroundData.getInstance().Marks;
  350. if (!values.filter(item => item.title = this.windturbine.windturbineId)[0]) {
  351. this.menuClicked({ type: "marking" })
  352. }
  353. BackgroundData.getInstance().updateMarks(this.windturbine, this.state1);
  354. },
  355. show() {
  356. // axios.get(`http://${config.calcUrl}/alarm/real-time-alarm?objectId=${this.windturbine.windturbineId}&pageIndex=1&pageSize=50`)
  357. // .then(msg=>{
  358. // var vs = msg.data;
  359. // if(vs.length<=0)return;
  360. // this.alarmTime = BackgroundData.getInstance().formatDate(vs[0].lastUpdateTime);
  361. // this.alarmContent = vs[0].alertText;
  362. // this.alarms = msg.data;
  363. // console.log(this.alarms)
  364. // })
  365. },
  366. start(bi) {
  367. this.BasicInfo = bi;
  368. this.bindData();
  369. this.refreshData();
  370. this.refreshTimer = setInterval(this.refreshData, 3000);
  371. },
  372. end() {
  373. clearInterval(this.refreshTimer);
  374. },
  375. // alarmd(bi) {
  376. // let dataList = []
  377. // let warnList = []
  378. // let date1 = {
  379. // type: 1,
  380. // alertText: []
  381. // }
  382. // let date2 = {
  383. // type: 2,
  384. // alertText: []
  385. // }
  386. // let date3 = {
  387. // type: 3,
  388. // alertText: []
  389. // }
  390. // let date4 = {
  391. // type: 4,
  392. // alertText: []
  393. // }
  394. // let date5 = {
  395. // type: 5,
  396. // alertText: []
  397. // }
  398. // bi.forEach(item => {
  399. // let data = {}
  400. // data.alertText = item.alertText
  401. // if (item.alertText.indexOf("变桨") >= 0) {
  402. // data.type = 1
  403. // } else if (item.alertText.indexOf("偏航") >= 0) {
  404. // data.type = 5
  405. // }
  406. // else if (item.alertText.indexOf("发电机") >= 0) {
  407. // data.type = 3
  408. // }
  409. // else if (item.alertText.indexOf("齿轮箱") >= 0) {
  410. // data.type = 2
  411. // }
  412. // else if (item.alertText.indexOf("液压") >= 0) {
  413. // data.type = 4
  414. // }
  415. // data.type ? warnList.push(data) : ''
  416. // })
  417. // warnList.forEach(item => {
  418. // switch (item.type) {
  419. // case 1:
  420. // date1.alertText.push(item.alertText)
  421. // break;
  422. // case 2:
  423. // date2.alertText.push(item.alertText)
  424. // break;
  425. // case 3:
  426. // date3.alertText.push(item.alertText)
  427. // break;
  428. // case 4:
  429. // date4.alertText.push(item.alertText)
  430. // break;
  431. // case 5:
  432. // date5.alertText.push(item.alertText)
  433. // break;
  434. // }
  435. // })
  436. // date1.alertText.length > 0 ? dataList.push(date1) : ''
  437. // date2.alertText.length > 0 ? dataList.push(date2) : ''
  438. // date3.alertText.length > 0 ? dataList.push(date3) : ''
  439. // date4.alertText.length > 0 ? dataList.push(date4) : ''
  440. // date5.alertText.length > 0 ? dataList.push(date5) : ''
  441. // this.warnList = dataList
  442. // },
  443. /* 刷新数据 */
  444. refreshData() {
  445. var bg = BackgroundData.getInstance();
  446. let mark = BackgroundData.getInstance().Marks;
  447. console.log(mark);
  448. bg.initWinturbineBaseData(this.BasicInfo, this.onMessage);
  449. },
  450. /* 获得数据 */
  451. onMessage(msg) {
  452. this.BasicInfo.BasicInfo.forEach((element) => {
  453. element.param.forEach((im) => {
  454. var val = msg[im.code];
  455. if (typeof val !== "undefined") {
  456. if (im.unit == "万度") {
  457. im.value = (val.doubleValue / 10000).toFixed(2);
  458. } else {
  459. im.value = val.doubleValue === 0 ? val.doubleValue : val.doubleValue ? val.doubleValue.toFixed(2) : val.longValue ? val.longValue : val.booleanValue;
  460. }
  461. }
  462. });
  463. });
  464. console.log(msg);
  465. console.log(this.BasicInfo.BasicInfo);
  466. switch (this.showIndex) {
  467. case 1:
  468. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part6")[0] ? this.BasicInfo.BasicInfo.filter(item => item.index === "part6")[0].param : []
  469. break;
  470. case 2:
  471. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part8")[0] ? this.BasicInfo.BasicInfo.filter(item => item.index === "part8")[0].param : []
  472. break;
  473. case 3:
  474. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part7")[0] ? this.BasicInfo.BasicInfo.filter(item => item.index === "part7")[0].param : []
  475. break;
  476. case 4:
  477. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part10")[0] ? this.BasicInfo.BasicInfo.filter(item => item.index === "part10")[0].param : []
  478. break;
  479. case 5:
  480. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part9")[0] ? this.BasicInfo.BasicInfo.filter(item => item.index === "part9")[0].param : []
  481. break;
  482. }
  483. },
  484. bindData() {
  485. this.BasicInfo.BasicInfo.forEach((element) => {
  486. if (element.tag == "基本信息") {
  487. this.generalInfo = element.param;
  488. } else if (element.tag == "温度信息") {
  489. this.temperatureInfo = element.param;
  490. } else if (element.tag == "电网信息") {
  491. this.powerGridInfo = element.param;
  492. } else if (element.tag == "桨叶信息") {
  493. this.pitchInfo = element.param;
  494. }
  495. });
  496. },
  497. querySearch(queryString, cb) {
  498. var restaurants = this.restaurants;
  499. var results = queryString
  500. ? restaurants.filter(this.createFilter(queryString))
  501. : restaurants;
  502. // 调用 callback 返回建议列表的数据
  503. cb(results);
  504. },
  505. createFilter(queryString) {
  506. return (restaurant) => {
  507. return (
  508. restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) ===
  509. 0
  510. );
  511. };
  512. },
  513. handleSelect(item) {
  514. console.log(item);
  515. },
  516. selectSvg(index) {
  517. this.showIndex = index;
  518. switch (this.showIndex) {
  519. case 1:
  520. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part6")[0] ? this.BasicInfo.BasicInfo.filter(item => item.index === "part6")[0].param : []
  521. break;
  522. case 2:
  523. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part8")[0] ? this.BasicInfo.BasicInfo.filter(item => item.index === "part8")[0].param : []
  524. break;
  525. case 3:
  526. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part7")[0] ? this.BasicInfo.BasicInfo.filter(item => item.index === "part7")[0].param : []
  527. break;
  528. case 4:
  529. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part10")[0] ? this.BasicInfo.BasicInfo.filter(item => item.index === "part10")[0].param : []
  530. break;
  531. case 5:
  532. this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part9")[0] ? this.BasicInfo.BasicInfo.filter(item => item.index === "part9")[0].param : []
  533. break;
  534. }
  535. this.getWarning()
  536. },
  537. menuClicked(msg, windturbine) {
  538. let dataList = []
  539. dataList[0] = windturbine ? windturbine : this.windturbine
  540. var 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. this.selectValue = ''
  551. return;
  552. }
  553. if (msg.type == "lock") {
  554. // 挂牌
  555. var los = dataList;
  556. for (var id in los) {
  557. los[id].lockType = msg.value;
  558. }
  559. bd.windturbineControl(
  560. los,
  561. true,
  562. '',
  563. this.controlSuccess,
  564. this.controlError
  565. );
  566. } else if (msg.type == "send") {
  567. // 发送
  568. dataList[0].controlType = Number(msg.controlType)
  569. var vs = dataList;
  570. bd.windturbineControl(
  571. vs,
  572. false,
  573. '',
  574. this.controlSuccess,
  575. this.controlError
  576. );
  577. } else if (msg.type == "marking") {
  578. // 标注
  579. var vvs = dataList;
  580. bd.marking(vvs);
  581. }
  582. },
  583. /* 控制成功 */
  584. controlSuccess(msg) {
  585. console.log(msg);
  586. var mss = ''; // 信息
  587. var iserror = false;// 是否有控制错误的风机
  588. for (var v in msg.data) {
  589. var val = msg.data[v];
  590. if (val.errorCode > 0) {
  591. iserror = true;
  592. mss += `${val.windturbineId} ${this.controlErorCodes[val.errorCode]}\n`;
  593. }
  594. }
  595. var tp = iserror ? "warning" : "success";
  596. var dt = iserror ? 0 : 4500;
  597. if (!iserror) {
  598. mss = "控制成功";
  599. }
  600. this.$notify({
  601. title: "控制",
  602. message: mss,
  603. type: tp,
  604. position: "bottom-right",
  605. offset: 60,
  606. duration: 3000,
  607. });
  608. },
  609. /* 控制失败 */
  610. controlError(err) {
  611. this.$notify({
  612. title: "控制出现错误",
  613. message: err.message,
  614. type: "warning",
  615. position: "bottom-right",
  616. offset: 60,
  617. duration: 3000,
  618. });
  619. },
  620. },
  621. };
  622. </script>
  623. <style scoped>
  624. .firstdiv {
  625. height: 70vh;
  626. }
  627. .onediv {
  628. float: left;
  629. margin-right: 30px;
  630. }
  631. .twodiv {
  632. float: right;
  633. margin-right: 30px;
  634. }
  635. td:nth-child(1) {
  636. height: 25px;
  637. width: 130px;
  638. text-align: right;
  639. }
  640. td:nth-child(2) {
  641. width: 78px;
  642. text-align: right;
  643. color: rgb(5, 176, 71);
  644. }
  645. td:nth-child(3) {
  646. text-align: center;
  647. width: 30px;
  648. }
  649. tr:nth-child(1) {
  650. font-size: 20px;
  651. width: 90px;
  652. text-align: right;
  653. }
  654. th {
  655. height: 40px;
  656. }
  657. table {
  658. margin-top: 30px;
  659. }
  660. /* .worning1{
  661. position: absolute;
  662. top: 143px;
  663. left: 119px;
  664. z-index: 999;
  665. }
  666. .worning2{
  667. position: absolute;
  668. top: 210px;
  669. left: 282px;
  670. z-index: 99;
  671. }
  672. .worning3{
  673. position: absolute;
  674. top: 219px;
  675. left: 348px;
  676. z-index: 0;
  677. }
  678. .worning4{
  679. position: absolute;
  680. top: 273px;
  681. left: 296px;
  682. z-index: 0;
  683. }
  684. .worning5{
  685. position: absolute;
  686. top: 287px;
  687. left: 252px;
  688. z-index: 0;
  689. } */
  690. .sai {
  691. float: left;
  692. margin-left: 40px;
  693. margin-top: 30px;
  694. margin-bottom: 15px;
  695. width: 55vh;
  696. height: 34vh;
  697. }
  698. /* .inline-input {
  699. .el-scrollbar{
  700. max-height: 160px;
  701. }
  702. } */
  703. .right {
  704. display: flex;
  705. flex-direction: column;
  706. }
  707. .marks {
  708. display: flex;
  709. flex-direction: column;
  710. }
  711. .title {
  712. margin-right: 16px;
  713. font-size: 18px;
  714. color: #ffffff;
  715. }
  716. .inputs {
  717. border: none;
  718. width: 174px !important;
  719. }
  720. .area {
  721. border: 2px dashed #ffffff;
  722. height: 200px;
  723. border-radius: 10px;
  724. margin-top: 20px;
  725. margin-left: 5.5%;
  726. }
  727. .healthInfo {
  728. margin-top: 16px;
  729. margin-bottom: 11px;
  730. font-size: 18px;
  731. color: #FFFFFF;
  732. }
  733. .healthTable {
  734. width: 688px;
  735. background-color: #141414;
  736. }
  737. .healthTitle {
  738. width: 100%;
  739. height: 37px;
  740. background-color: #242424;
  741. font-size: 12px;
  742. color: #FFFFFF;
  743. display: flex;
  744. flex-direction: row;
  745. margin-bottom: 5px;
  746. }
  747. .name {
  748. width: 172px;
  749. height: 100%;
  750. display: flex;
  751. align-items: center;
  752. justify-content: center;
  753. }
  754. .level {
  755. width: 211px;
  756. height: 100%;
  757. display: flex;
  758. align-items: center;
  759. justify-content: center;
  760. }
  761. .times {
  762. width: 153px;
  763. height: 100%;
  764. display: flex;
  765. align-items: center;
  766. justify-content: center;
  767. }
  768. .healthContent {
  769. height: 30px;
  770. display: flex;
  771. flex-direction: row;
  772. width: 96%;
  773. margin-left: 2%;
  774. border-bottom: 1px solid #242424;
  775. font-size: 12px;
  776. color: #B3B3B3;
  777. }
  778. .healthContent_on {
  779. height: 30px;
  780. display: flex;
  781. flex-direction: row;
  782. width: 96%;
  783. margin-left: 2%;
  784. border-bottom: 1px solid #242424;
  785. background-color: #242424;
  786. font-size: 12px;
  787. color: #05BB4C;
  788. }
  789. .contentName {
  790. width: 158px;
  791. height: 100%;
  792. display: flex;
  793. align-items: center;
  794. justify-content: center;
  795. margin-left: -5px;
  796. }
  797. .starLevel {
  798. width: 211px;
  799. height: 100%;
  800. display: flex;
  801. align-items: center;
  802. justify-content: center;
  803. margin-left: 8px;
  804. }
  805. .contentTimes {
  806. width: 124px;
  807. height: 100%;
  808. display: flex;
  809. align-items: center;
  810. justify-content: center;
  811. margin-left: 11px;
  812. }
  813. .contentTimess {
  814. width: 120px;
  815. height: 100%;
  816. display: flex;
  817. align-items: center;
  818. justify-content: center;
  819. margin-left: 30px;
  820. }
  821. .label {
  822. display: flex;
  823. flex-direction: row;
  824. align-items: center;
  825. margin-top: 16px;
  826. }
  827. .label1 {
  828. display: flex;
  829. flex-direction: row;
  830. align-items: center;
  831. margin-top: 16px;
  832. margin-right: 15px;
  833. }
  834. .button {
  835. width: 100px;
  836. height: 27px;
  837. display: flex;
  838. align-items: center;
  839. justify-content: center;
  840. font-size: 12px;
  841. color: #ffffff;
  842. background-color: #242424;
  843. border: 1px solid #3D3D3D;
  844. margin-right: 12px;
  845. }
  846. .datas {
  847. margin-top: 15px;
  848. }
  849. .dataList {
  850. width: 94%;
  851. /* min-height: 250px; */
  852. height: 28vh;
  853. background-color: #141414;
  854. display: flex;
  855. flex-direction: column;
  856. margin-left: 2%;
  857. }
  858. .dataLists {
  859. width: 97%;
  860. /* min-height: 250px; */
  861. height: 28vh;
  862. background-color: #141414;
  863. display: flex;
  864. flex-direction: column;
  865. }
  866. .dataTitle {
  867. display: flex;
  868. height: 37px;
  869. width: 100%;
  870. background-color: #242424;
  871. color: #FFFFFF;
  872. font-size: 12px;
  873. align-items: center;
  874. }
  875. .dataContent {
  876. display: flex;
  877. flex-direction: row;
  878. flex-wrap: wrap;
  879. }
  880. .dataBlock {
  881. width: 145px;
  882. height: 62px;
  883. background-color: #242424;
  884. border: 1px solid #3D3D3D;
  885. margin-left: 16px;
  886. margin-top: 22px;
  887. display: flex;
  888. flex-direction: column;
  889. justify-content: center;
  890. }
  891. .dataName {
  892. font-size: 12px;
  893. color: #FFFFFF;
  894. margin-left: 26px;
  895. margin-bottom: 6px;
  896. }
  897. .numerical {
  898. display: flex;
  899. flex-direction: row;
  900. color: #05BB4C;
  901. align-items: baseline;
  902. margin-left: 26px;
  903. }
  904. .values {
  905. font-size: 16px;
  906. }
  907. .unit {
  908. font-size: 12px;
  909. margin-left: 8px;
  910. }
  911. .scorll {
  912. height: 212px;
  913. }
  914. .showDate {
  915. display: flex;
  916. flex-direction: row;
  917. justify-content: space-between;
  918. align-items: center;
  919. }
  920. </style>