Tower.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  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: "MHS_FDC",
  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.$nextTick(() => {
  235. that.requestData(false);
  236. that.timmer = setInterval(() => {
  237. that.requestData(false);
  238. }, that.$store.state.websocketTimeSec);
  239. });
  240. },
  241. unmounted() {
  242. clearInterval(this.timmer);
  243. this.timmer = null;
  244. },
  245. };
  246. </script>
  247. <style lang="less">
  248. .tower {
  249. position: relative;
  250. width: 100%;
  251. height: 100%;
  252. .windmill-1,
  253. .windmill-2,
  254. .windmill-3,
  255. .windmill-4,
  256. .windmill-5 {
  257. position: absolute;
  258. }
  259. .windmill-1 {
  260. top: 23.148vh;
  261. left: 28.333vh;
  262. width: 4.167vh;
  263. }
  264. .windmill-2 {
  265. top: 8.333vh;
  266. left: 11.111vh;
  267. width: 3.426vh;
  268. }
  269. .windmill-3 {
  270. top: 4.63vh;
  271. left: 38.889vh;
  272. width: 2.593vh;
  273. }
  274. .windmill-4 {
  275. top: 21.296vh;
  276. left: 122.87vh;
  277. width: 3.426vh;
  278. }
  279. .windmill-5 {
  280. top: 5.556vh;
  281. left: 121.296vh;
  282. width: 2.407vh;
  283. }
  284. .direction-chart {
  285. .legend {
  286. display: flex;
  287. align-items: center;
  288. justify-content: center;
  289. .dot {
  290. width: 7px;
  291. height: 7px;
  292. display: inline-block;
  293. margin-right: 8px;
  294. }
  295. }
  296. }
  297. .pie-left,
  298. .pie-right {
  299. position: fixed;
  300. top: 8vh;
  301. }
  302. .pie-left {
  303. left: 5vh;
  304. }
  305. .pie-right {
  306. left: 20vh;
  307. }
  308. .panel-top,
  309. .panel-bottom {
  310. position: fixed;
  311. right: 10vh;
  312. width: 36vh;
  313. height: 24vh;
  314. }
  315. .panel-top {
  316. top: 7vh;
  317. }
  318. .panel-bottom {
  319. top: 35vh;
  320. }
  321. .rose-chart {
  322. position: absolute;
  323. left: 0;
  324. bottom: 1.852vh;
  325. height: 31.481vh;
  326. width: 100%;
  327. }
  328. .tools {
  329. display: flex;
  330. .tool-block {
  331. display: flex;
  332. align-items: center;
  333. margin-left: 0.741vh;
  334. .legend {
  335. flex: auto;
  336. width: 0.741vh;
  337. height: 0.741vh;
  338. margin-right: 0.741vh;
  339. &.long {
  340. width: 2.963vh;
  341. height: 0.37vh;
  342. }
  343. }
  344. .legend-text {
  345. color: #ffffff4d;
  346. }
  347. }
  348. }
  349. }
  350. </style>