Tower.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. <template>
  2. <div class="tower">
  3. <Wave></Wave>
  4. <Windmill class="windmill-1"></Windmill>
  5. <Windmill class="windmill-2"></Windmill>
  6. <Windmill class="windmill-3"></Windmill>
  7. <Windmill class="windmill-4"></Windmill>
  8. <Windmill class="windmill-5"></Windmill>
  9. <WindTower :data="cftmap"></WindTower>
  10. <dash-pie-chart class="pie-left" title="空气密度" :value="cftmap.KQMD || 0" height="9.722vh" width="9.722vh" />
  11. <dash-pie-chart class="pie-right" title="压强" :value="cftmap.FCCFTYQ || 0" height="9.722vh" width="9.722vh" />
  12. <Panel class="panel-top" title="日资源玫瑰图">
  13. <div class="direction-chart">
  14. <DirectionRadarChart width="70%" height="152px" :value="rmgtmap" />
  15. <div class="legend">
  16. <span class="dot bg-purple"></span>
  17. <span>{{ rmgtTitle || "" }}</span>
  18. </div>
  19. </div>
  20. </Panel>
  21. <Panel class="panel-bottom" title="月资源玫瑰图">
  22. <div class="direction-chart">
  23. <DirectionRadarChart width="70%" height="152px" :value="ymgtmap" />
  24. <div class="legend">
  25. <span class="dot bg-purple"></span>
  26. <span>{{ ymgtTitle || "" }}</span>
  27. </div>
  28. </div>
  29. </Panel>
  30. <toolbar-panel class="rose-chart" title="功率曲线">
  31. <template v-slot:tools>
  32. <div class="tools">
  33. <div class="tool-block">
  34. <div class="legend bg-green"></div>
  35. <div class="legend-text">应发功率</div>
  36. </div>
  37. <div class="tool-block">
  38. <div class="legend bg-purple"></div>
  39. <div class="legend-text">实际功率</div>
  40. </div>
  41. <div class="tool-block">
  42. <div class="legend bg-orange"></div>
  43. <div class="legend-text">理论功率</div>
  44. </div>
  45. <div class="tool-block">
  46. <div class="legend bg-yellow"></div>
  47. <div class="legend-text">预测功率4小时</div>
  48. </div>
  49. <div class="tool-block">
  50. <div class="legend bg-blue"></div>
  51. <div class="legend-text">保证功率</div>
  52. </div>
  53. <div class="tool-block">
  54. <div class="legend bg-pink"></div>
  55. <div class="legend-text">风速</div>
  56. </div>
  57. </div>
  58. </template>
  59. <template v-slot:default>
  60. <!-- 日发电量 -->
  61. <multiple-line-chart :list="Powertrend.value" :units="Powertrend.units" height="28vh" />
  62. </template>
  63. </toolbar-panel>
  64. </div>
  65. </template>
  66. <script>
  67. import Wave from "@com/three/wave.vue";
  68. import Windmill from "../components/Windmill.vue";
  69. import ToolbarPanel from "@com/coms/panel/toolbar-panel.vue";
  70. import Panel from "@com/coms/panel/panel.vue";
  71. import MultipleLineChart from "@com/chart/line/multiple-line-chart.vue";
  72. import WindTower from "./Tower/WindTower.vue";
  73. import DashPieChart from "@com/chart/pie/dash-pie-chart.vue";
  74. import DirectionRadarChart from "@com/chart/radar/radar-chart.vue";
  75. export default {
  76. // 名称
  77. name: "Tower",
  78. // 使用组件
  79. components: {
  80. Wave,
  81. Windmill,
  82. ToolbarPanel,
  83. MultipleLineChart,
  84. WindTower,
  85. DashPieChart,
  86. Panel,
  87. DirectionRadarChart,
  88. },
  89. // 传入参数
  90. props: {},
  91. // 自定义事件
  92. emits: {},
  93. // 数据
  94. data() {
  95. return {
  96. timmer: null, // 计时器
  97. cftmap: {},
  98. glvos: [],
  99. rmgtmap: {
  100. indicator: ["N0", "N1", "N2", "N3", "N4", "N5"],
  101. data: [
  102. {
  103. value: [44200, 14200, 20000, 35000, 50000, 38000],
  104. name: "",
  105. },
  106. ],
  107. },
  108. rmgtTitle: "",
  109. ymgtmap: {
  110. indicator: ["N0", "N1", "N2", "N3", "N4", "N5"],
  111. data: [
  112. {
  113. value: [44200, 14200, 20000, 35000, 50000, 38000],
  114. name: "",
  115. },
  116. ],
  117. },
  118. ymgtTitle: "",
  119. // 日发电量
  120. Powertrend: {
  121. // 图表所用单位
  122. units: [""],
  123. value: [
  124. {
  125. title: "",
  126. yAxisIndex: 0, // 使用单位
  127. value: [],
  128. },
  129. ],
  130. },
  131. };
  132. },
  133. // 函数
  134. methods: {
  135. // 请求服务
  136. requestData(showLoading) {
  137. let that = this;
  138. that.API.requestData({
  139. showLoading,
  140. method: "POST",
  141. subUrl: "monitor/findCftInfo",
  142. data: {
  143. wpId: that.wpId,
  144. },
  145. success(res) {
  146. let rmgtmap = {
  147. indicator: [],
  148. data: [
  149. {
  150. value: [],
  151. name: "",
  152. },
  153. ],
  154. };
  155. let ymgtmap = {
  156. indicator: [],
  157. data: [
  158. {
  159. value: [],
  160. name: "",
  161. },
  162. ],
  163. };
  164. res.data.rmgtmap.data.forEach((ele) => {
  165. rmgtmap.indicator.push(ele.name);
  166. rmgtmap.data[0].value.push(ele.data1);
  167. });
  168. res.data.ymgtmap.data.forEach((ele) => {
  169. ymgtmap.indicator.push(ele.name);
  170. ymgtmap.data[0].value.push(ele.data1);
  171. });
  172. that.rmgtmap = rmgtmap;
  173. that.rmgtTitle = res.data.rmgtmap.jfpl;
  174. that.ymgtmap = ymgtmap;
  175. that.ymgtTitle = res.data.ymgtmap.jfpl;
  176. let units = ["(万kw)", "(米/s)"];
  177. let keyArray = ["value1", "value2", "value3", "value4", "value5", "value6"];
  178. let Powertrend = {
  179. units,
  180. value: [
  181. {
  182. title: "应发功率",
  183. yAxisIndex: 0, // 使用单位
  184. value: [],
  185. },
  186. {
  187. title: "实发功率",
  188. yAxisIndex: 0, // 使用单位
  189. value: [],
  190. },
  191. {
  192. title: "理论功率",
  193. yAxisIndex: 0, // 使用单位
  194. value: [],
  195. },
  196. {
  197. title: "预测功率",
  198. yAxisIndex: 0, // 使用单位
  199. value: [],
  200. },
  201. {
  202. title: "保证功率",
  203. yAxisIndex: 0, // 使用单位
  204. value: [],
  205. },
  206. {
  207. title: "保证功率",
  208. yAxisIndex: 0, // 使用单位
  209. value: [],
  210. },
  211. {
  212. title: "平均风速",
  213. yAxisIndex: 1, // 使用单位
  214. value: [],
  215. },
  216. ],
  217. };
  218. keyArray.forEach((key, keyIndex) => {
  219. res.data.glvos.forEach((ele) => {
  220. Powertrend.value[keyIndex].value.push({
  221. text: new Date(ele.time).formatDate("hh:mm"),
  222. value: ele[key],
  223. });
  224. });
  225. });
  226. that.cftmap = res.data.cftmap;
  227. that.Powertrend = Powertrend;
  228. },
  229. });
  230. },
  231. },
  232. created() {
  233. let that = this;
  234. that.wpId = that.$route.params.wpId;
  235. that.$nextTick(() => {
  236. that.requestData(false);
  237. that.timmer = setInterval(() => {
  238. that.requestData(false);
  239. }, that.$store.state.websocketTimeSec);
  240. });
  241. },
  242. unmounted() {
  243. clearInterval(this.timmer);
  244. this.timmer = null;
  245. },
  246. };
  247. </script>
  248. <style lang="less">
  249. .tower {
  250. position: relative;
  251. width: 100%;
  252. height: 100%;
  253. overflow: hidden;
  254. .windmill-1,
  255. .windmill-2,
  256. .windmill-3,
  257. .windmill-4,
  258. .windmill-5 {
  259. position: absolute;
  260. }
  261. .windmill-1 {
  262. top: 23.148vh;
  263. left: 28.333vh;
  264. width: 4.167vh;
  265. }
  266. .windmill-2 {
  267. top: 8.333vh;
  268. left: 11.111vh;
  269. width: 3.426vh;
  270. }
  271. .windmill-3 {
  272. top: 4.63vh;
  273. left: 38.889vh;
  274. width: 2.593vh;
  275. }
  276. .windmill-4 {
  277. top: 21.296vh;
  278. left: 122.87vh;
  279. width: 3.426vh;
  280. }
  281. .windmill-5 {
  282. top: 5.556vh;
  283. left: 121.296vh;
  284. width: 2.407vh;
  285. }
  286. .direction-chart {
  287. .legend {
  288. display: flex;
  289. align-items: center;
  290. justify-content: center;
  291. .dot {
  292. width: 7px;
  293. height: 7px;
  294. display: inline-block;
  295. margin-right: 8px;
  296. }
  297. }
  298. }
  299. .pie-left,
  300. .pie-right {
  301. position: fixed;
  302. top: 8vh;
  303. }
  304. .pie-left {
  305. left: 5vh;
  306. }
  307. .pie-right {
  308. left: 20vh;
  309. }
  310. .panel-top,
  311. .panel-bottom {
  312. position: fixed;
  313. right: 10vh;
  314. width: 36vh;
  315. height: 24vh;
  316. }
  317. .panel-top {
  318. top: 7vh;
  319. }
  320. .panel-bottom {
  321. top: 35vh;
  322. }
  323. .rose-chart {
  324. position: absolute;
  325. left: 0;
  326. bottom: 1.852vh;
  327. height: 31.481vh;
  328. width: 100%;
  329. }
  330. .tools {
  331. display: flex;
  332. .tool-block {
  333. display: flex;
  334. align-items: center;
  335. margin-left: 0.741vh;
  336. .legend {
  337. flex: auto;
  338. width: 0.741vh;
  339. height: 0.741vh;
  340. margin-right: 0.741vh;
  341. &.long {
  342. width: 2.963vh;
  343. height: 0.37vh;
  344. }
  345. }
  346. .legend-text {
  347. color: #ffffff4d;
  348. }
  349. }
  350. }
  351. }
  352. </style>