Tower.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  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">保证功率</div>
  48. </div>
  49. <div class="tool-block">
  50. <div class="legend bg-blue"></div>
  51. <div class="legend-text">预测功率4小时</div>
  52. </div>
  53. <div class="tool-block">
  54. <div class="legend bg-pink"></div>
  55. <div class="legend-text">预测功率72小时</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. title: "",
  125. yAxisIndex: 0, // 使用单位
  126. value: []
  127. }],
  128. }
  129. };
  130. },
  131. // 函数
  132. methods: {
  133. // 请求服务
  134. requestData (showLoading) {
  135. let that = this;
  136. that.API.requestData({
  137. showLoading,
  138. method: "POST",
  139. subUrl: "monitor/findCftInfo",
  140. data: {
  141. wpId: "MHS_FDC"
  142. },
  143. success (res) {
  144. let rmgtmap = {
  145. indicator: [],
  146. data: [
  147. {
  148. value: [],
  149. name: "",
  150. },
  151. ],
  152. };
  153. let ymgtmap = {
  154. indicator: [],
  155. data: [
  156. {
  157. value: [],
  158. name: "",
  159. },
  160. ],
  161. };
  162. res.data.rmgtmap.data.forEach(ele => {
  163. rmgtmap.indicator.push(ele.name);
  164. rmgtmap.data[0].value.push(ele.data1);
  165. });
  166. res.data.ymgtmap.data.forEach(ele => {
  167. ymgtmap.indicator.push(ele.name);
  168. ymgtmap.data[0].value.push(ele.data1);
  169. });
  170. that.rmgtmap = rmgtmap;
  171. that.rmgtTitle = res.data.rmgtmap.jfpl;
  172. that.ymgtmap = ymgtmap;
  173. that.ymgtTitle = res.data.ymgtmap.jfpl;
  174. let units = ["(万kw)", "(米/s)"];
  175. let keyArray = ["value1", "value2", "value3", "value4", "value5", "value6"];
  176. let Powertrend = {
  177. units,
  178. value: [{
  179. title: "应发功率",
  180. yAxisIndex: 0, // 使用单位
  181. value: []
  182. }, {
  183. title: "实发功率",
  184. yAxisIndex: 0, // 使用单位
  185. value: []
  186. }, {
  187. title: "理论功率",
  188. yAxisIndex: 0, // 使用单位
  189. value: []
  190. }, {
  191. title: "预测功率",
  192. yAxisIndex: 0, // 使用单位
  193. value: []
  194. }, {
  195. title: "保证功率",
  196. yAxisIndex: 0, // 使用单位
  197. value: []
  198. }, {
  199. title: "保证功率",
  200. yAxisIndex: 0, // 使用单位
  201. value: []
  202. }, {
  203. title: "平均风速",
  204. yAxisIndex: 1, // 使用单位
  205. value: []
  206. }, {
  207. title: "72小时预测功率",
  208. yAxisIndex: 0, // 使用单位
  209. value: []
  210. }, {
  211. title: "最优功率",
  212. yAxisIndex: 0, // 使用单位
  213. value: []
  214. }]
  215. };
  216. keyArray.forEach((key, keyIndex) => {
  217. res.data.glvos.forEach(ele => {
  218. Powertrend.value[keyIndex].value.push({
  219. text: new Date(ele.time).formatDate("yyyy-MM-dd"),
  220. value: ele[key],
  221. })
  222. });
  223. });
  224. that.cftmap = res.data.cftmap;
  225. that.Powertrend = Powertrend;
  226. }
  227. });
  228. },
  229. },
  230. created () {
  231. let that = this;
  232. that.$nextTick(() => {
  233. that.requestData(false);
  234. that.timmer = setInterval(() => {
  235. that.requestData(false);
  236. }, that.$store.state.websocketTimeSec);
  237. });
  238. },
  239. unmounted () {
  240. clearInterval(this.timmer);
  241. this.timmer = null;
  242. },
  243. };
  244. </script>
  245. <style lang="less">
  246. .tower {
  247. position: relative;
  248. width: 100%;
  249. height: 100%;
  250. .windmill-1,
  251. .windmill-2,
  252. .windmill-3,
  253. .windmill-4,
  254. .windmill-5 {
  255. position: absolute;
  256. }
  257. .windmill-1 {
  258. top: 23.148vh;
  259. left: 28.333vh;
  260. width: 4.167vh;
  261. }
  262. .windmill-2 {
  263. top: 8.333vh;
  264. left: 11.111vh;
  265. width: 3.426vh;
  266. }
  267. .windmill-3 {
  268. top: 4.63vh;
  269. left: 38.889vh;
  270. width: 2.593vh;
  271. }
  272. .windmill-4 {
  273. top: 21.296vh;
  274. left: 122.87vh;
  275. width: 3.426vh;
  276. }
  277. .windmill-5 {
  278. top: 5.556vh;
  279. left: 121.296vh;
  280. width: 2.407vh;
  281. }
  282. .direction-chart {
  283. .legend {
  284. display: flex;
  285. align-items: center;
  286. justify-content: center;
  287. .dot {
  288. width: 7px;
  289. height: 7px;
  290. display: inline-block;
  291. margin-right: 8px;
  292. }
  293. }
  294. }
  295. .pie-left,
  296. .pie-right {
  297. position: fixed;
  298. top: 8vh;
  299. }
  300. .pie-left {
  301. left: 5vh;
  302. }
  303. .pie-right {
  304. left: 20vh;
  305. }
  306. .panel-top,
  307. .panel-bottom {
  308. position: fixed;
  309. right: 10vh;
  310. width: 36vh;
  311. height: 24vh;
  312. }
  313. .panel-top {
  314. top: 7vh;
  315. }
  316. .panel-bottom {
  317. top: 35vh;
  318. }
  319. .rose-chart {
  320. position: absolute;
  321. left: 0;
  322. bottom: 1.852vh;
  323. height: 31.481vh;
  324. width: 100%;
  325. }
  326. .tools {
  327. display: flex;
  328. .tool-block {
  329. display: flex;
  330. align-items: center;
  331. margin-left: 0.741vh;
  332. .legend {
  333. flex: auto;
  334. width: 0.741vh;
  335. height: 0.741vh;
  336. margin-right: 0.741vh;
  337. &.long {
  338. width: 2.963vh;
  339. height: 0.37vh;
  340. }
  341. }
  342. .legend-text {
  343. color: #ffffff4d;
  344. }
  345. }
  346. }
  347. }
  348. </style>