WindturbineDetailPages.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template>
  2. <el-dialog width="75%" @opened="opened()" @closed="closed()" :show-close="false" class="my-info-dialog">
  3. <template #title>
  4. <div style="margin-top:-10px;color: #FFFFFF;">风机详情</div>
  5. </template>
  6. <div class="body">
  7. <div class="titleList">
  8. <div class="chunkdiv">
  9. <div class="title">风机号:&emsp;</div>
  10. <div>{{ windturbine.windturbineId }}</div>
  11. </div>
  12. <div class="chunkdiv" @dblclick="dbClicks(baseDate.windSpeed)">
  13. <div class="title">{{baseDate.windSpeed.name}}:&emsp;</div>
  14. <div>{{baseDate.windSpeed.value}}{{baseDate.windSpeed.unit}}</div>
  15. </div>
  16. <div class="chunkdiv" @dblclick="dbClicks({code: 'YDPJFS5M',name: '五分钟平均风速'})">
  17. <div class="title">五分钟平均风速:&emsp;</div>
  18. <div>{{healthInfo?.averageWindSpeed5?.toFixed(2)}}m/s</div>
  19. </div>
  20. <div class="chunkdiv" @dblclick="dbClicks(theoreticalPower)">
  21. <div class="title">理论功率:&emsp;</div>
  22. <div>{{healthInfo?.theoreticalPower?.toFixed(2)}}Kw</div>
  23. </div>
  24. <div class="chunkdiv" @dblclick="dbClicks(baseDate.power)">
  25. <div class="title">{{baseDate.power.name}}:&emsp;</div>
  26. <div>{{baseDate.power.value}}{{baseDate.power.unit}}</div>
  27. </div>
  28. <div class="chunkdiv" @dblclick="dbClicks(baseDate.generatorSpeed)">
  29. <div class="title">{{baseDate.generatorSpeed.name}}:&emsp;</div>
  30. <div>{{baseDate.generatorSpeed.value}}{{baseDate.generatorSpeed.unit}}</div>
  31. </div>
  32. </div>
  33. <BasicInformationDetail ref="BasicInfo" :types="types" @health-click="handleHealth" :windturbine="windturbine"></BasicInformationDetail>
  34. </div>
  35. </el-dialog>
  36. </template>
  37. <script>
  38. // import YawDetail from "./YawDetail.vue";
  39. import api from "api/index";
  40. import BasicInformationDetail from "./BasicInformationDetail.vue";
  41. import UniformCodes from "utils/UniformCodes";
  42. import BackgroundData from 'utils/BackgroundData'
  43. // import Worning from "./warning.vue"
  44. export default {
  45. components: {
  46. BasicInformationDetail,
  47. },
  48. props: {
  49. windturbine: Object,
  50. },
  51. data() {
  52. return {
  53. BasicInfo: {},
  54. healthInfo: {},
  55. line: "",
  56. alarmTime: "",
  57. alarmContent: "",
  58. alarms: [],
  59. count: false,
  60. theoreticalPower:{
  61. code: "LLGL",
  62. name: "理论功率"
  63. },
  64. typeList: [{
  65. type: 0,
  66. name: '已经停机',
  67. },
  68. {
  69. type: 1,
  70. name: '上电',
  71. },
  72. {
  73. type: 2,
  74. name: '待机',
  75. },
  76. {
  77. type: 3,
  78. name: '启动',
  79. },
  80. {
  81. type: 4,
  82. name: '并网',
  83. },
  84. {
  85. type: 5,
  86. name: '故障',
  87. },
  88. {
  89. type: 6,
  90. name: '维护',
  91. },
  92. {
  93. type: 7,
  94. name: '离线',
  95. },
  96. ],
  97. baseDate: {
  98. windSpeed: {
  99. name: '',
  100. num: '',
  101. unit: ''
  102. },
  103. power: {
  104. name: '',
  105. num: '',
  106. unit: ''
  107. },
  108. generatorSpeed: {
  109. name: '',
  110. num: '',
  111. unit: ''
  112. },
  113. },
  114. types: null,
  115. };
  116. },
  117. created() {
  118. this.UniformCodes = new UniformCodes();
  119. },
  120. methods: {
  121. opened() {
  122. this.line = "";
  123. this.alarmTime = "";
  124. this.alarmContent = "";
  125. this.BasicInfo = this.UniformCodes.getStationInfos(this.windturbine);
  126. this.BasicInfo.windturbineId = this.windturbine.windturbineId;
  127. // this.dateDeal(this.BasicInfo)
  128. this.$refs.BasicInfo.start(this.BasicInfo);
  129. this.initData();
  130. this.refreshData();
  131. this.refreshTimer = setInterval(this.refreshData, 100)
  132. },
  133. closed() {
  134. // todo 切换页面的时候应该让上一个页面停止刷新数据(调用end方法)
  135. // this.$refs.svgRef.closed();
  136. // this.$refs.BasicInfo.end();
  137. // this.$refs.BasicInfo.labelChange();
  138. this.$emit('close');
  139. //clearInterval(this.refreshTimer);
  140. },
  141. dateDeal(BasicInfo) {
  142. let showInf = {}
  143. showInf = BasicInfo.BasicInfo.filter(item => item.tag === "基本信息")[0]
  144. this.baseDate.windSpeed = showInf.param.filter(item => item.name === "风速")[0]
  145. this.baseDate.power = showInf.param.filter(item => item.name === "有功功率")[0]
  146. this.baseDate.generatorSpeed = showInf.param.filter(item => item.name === "发电机转速")[0]
  147. this.baseDate.type = showInf.param.filter(item => item.name === "状态")[0].value ? this.typeList.filter(
  148. status => status.type === Number(showInf.param.filter(item => item.name === "状态")[0].value))[0]
  149. .name : ''
  150. console.log(this.baseDate.generatorSpeed.name);
  151. this.types = Number(showInf.param.filter(item => item.name === "状态")[0].value)
  152. console.log(this.types)
  153. },
  154. refreshData() {
  155. let bg = BackgroundData.getInstance();
  156. bg.initWinturbineBaseData(this.BasicInfo, this.onMessage);
  157. this.dateDeal(this.BasicInfo)
  158. clearInterval(this.refreshTimer);
  159. this.refreshTimer = setInterval(this.refreshData, 5000)
  160. },
  161. initData() {
  162. // axiios.get(`http://${config.calcUrl}/windturbine/line/${this.windturbine.windturbineId}`)
  163. // .then(msg => this.line = msg.data);
  164. api.getWindWarning(this.windturbine.windturbineId, '1', '50').then(msg => {
  165. let vs = msg.data;
  166. if (vs.length <= 0) return;
  167. this.alarmTime = BackgroundData.getInstance().formatDate(vs[0].lastUpdateTime);
  168. this.alarmContent = vs[0].alertText;
  169. this.alarms = msg.data;
  170. this.$refs.BasicInfo.alarmd(this.alarms);
  171. console.log(this.alarms)
  172. })
  173. .catch(err => {
  174. console.log(err);
  175. });
  176. },
  177. dbClicks(value) {
  178. this.$refs.BasicInfo.dbClicks(value, this.windturbine.windturbineId)
  179. },
  180. handleHealth(value){
  181. this.healthInfo = value
  182. }
  183. },
  184. watch: {
  185. 'windturbine': {
  186. handler: function (json) {
  187. if (json) {
  188. this.initData()
  189. }
  190. }
  191. }
  192. }
  193. };
  194. </script>
  195. <style scoped>
  196. .my-info-dialog {
  197. box-shadow: 0px 0px 10px #05bb4c;
  198. }
  199. .body {
  200. background-color: black;
  201. margin-top: -30px;
  202. margin-left: -10px;
  203. margin-right: -10px;
  204. margin-bottom: -30px;
  205. border-bottom: 20px solid rgb(36, 36, 36);
  206. }
  207. .chunkdiv {
  208. display: flex;
  209. flex-direction: row;
  210. justify-content: center;
  211. align-items: center;
  212. width: 17%;
  213. background-color: #363636;
  214. margin: 1px;
  215. padding: 4px 0px;
  216. font-size: 12px;
  217. color: #FFFFFF;
  218. overflow: hidden;
  219. white-space: nowrap;
  220. }
  221. .title {
  222. font-size: 12px;
  223. color: #B3B3B3;
  224. }
  225. table {
  226. margin-left: 2px;
  227. margin-right: 2px;
  228. }
  229. /* td {
  230. width: 20%;
  231. } */
  232. el-tabs {
  233. background-color: black;
  234. }
  235. .svg {
  236. height: 67vh;
  237. }
  238. .titleList{
  239. display: flex;
  240. flex-direction: row;
  241. align-items: center;
  242. }
  243. </style>