Tower.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. <template>
  2. <div class="btn-group-tabs">
  3. <BtnGroup2 :btnGroups="btnGroupsss" :rowIndex="rowIndex" :index="selectIndex" @select="select"></BtnGroup2>
  4. </div>
  5. <div class="tower">
  6. <Wave></Wave>
  7. <Windmill class="windmill-1"></Windmill>
  8. <Windmill class="windmill-2"></Windmill>
  9. <Windmill class="windmill-3"></Windmill>
  10. <Windmill class="windmill-4"></Windmill>
  11. <Windmill class="windmill-5"></Windmill>
  12. <WindTower :data="cftmap"></WindTower>
  13. <dash-pie-chart
  14. class="pie-left"
  15. title="空气密度"
  16. :value="cftmap.KQMD || 0"
  17. height="9.722vh"
  18. width="9.722vh"
  19. />
  20. <dash-pie-chart
  21. class="pie-right"
  22. title="压强"
  23. :value="cftmap.FCCFTYQ || 0"
  24. height="9.722vh"
  25. width="9.722vh"
  26. max="500"
  27. />
  28. <Panel class="panel-top" title="日资源玫瑰图" :bgBlur="true">
  29. <div class="direction-chart">
  30. <DirectionRadarChart width="100%" height="23vh" :value="rmgtmap" />
  31. <div class="legend">
  32. <span class="dot bg-purple"></span>
  33. <span>{{ rmgtTitle || "" }}</span>
  34. </div>
  35. </div>
  36. </Panel>
  37. <Panel class="panel-bottom" title="月资源玫瑰图" :bgBlur="true">
  38. <div class="direction-chart">
  39. <DirectionRadarChart width="100%" height="23vh" :value="ymgtmap" />
  40. <div class="legend">
  41. <span class="dot bg-purple"></span>
  42. <span>{{ ymgtTitle || "" }}</span>
  43. </div>
  44. </div>
  45. </Panel>
  46. <toolbar-panel class="rose-chart" title="72小时功率曲线图">
  47. <!-- <template v-slot:tools>
  48. </template> -->
  49. <!-- <template v-slot:default> -->
  50. <multiple-line-chart
  51. height="220px"
  52. :list="Powertrend"
  53. :units="['(MW)']"
  54. :showLegend="true"
  55. :hoverType="'axis'"
  56. />
  57. <!-- </template> -->
  58. </toolbar-panel>
  59. </div>
  60. </template>
  61. <script>
  62. import Wave from "@com/three/wave.vue";
  63. import Windmill from "../components/Windmill.vue";
  64. import ToolbarPanel from "@com/coms/panel/toolbar-panel.vue";
  65. import Panel from "@com/coms/panel/panel.vue";
  66. import MultipleLineChart from "@com/chart/line/normal-line-chart";
  67. import WindTower from "./Tower/WindTower.vue";
  68. import DashPieChart from "@com/chart/pie/dash-pie-chart.vue";
  69. import DirectionRadarChart from "@com/chart/radar/radar-chart.vue";
  70. import BtnGroup2 from "@com/coms/btn/btn-group-double.vue";
  71. export default {
  72. // 名称
  73. name: "Tower",
  74. // 使用组件
  75. components: {
  76. BtnGroup2,
  77. Wave,
  78. Windmill,
  79. ToolbarPanel,
  80. MultipleLineChart,
  81. WindTower,
  82. DashPieChart,
  83. Panel,
  84. DirectionRadarChart,
  85. },
  86. // 传入参数
  87. props: {},
  88. // 自定义事件
  89. emits: {},
  90. // 数据
  91. data() {
  92. return {
  93. btnGroupsss: [],
  94. rowIndex:1,
  95. selectIndex:1,
  96. timmer: null, // 计时器
  97. cftmap: {},
  98. glvos: [],
  99. rmgtmap: {
  100. indicator: ["N0", "N1"],
  101. data: [
  102. {
  103. value: [44200, 14200],
  104. name: "",
  105. },
  106. ],
  107. },
  108. rmgtTitle: "",
  109. ymgtmap: {
  110. indicator: ["N0", "N1"],
  111. data: [
  112. {
  113. value: [0, 14200],
  114. name: "",
  115. },
  116. ],
  117. },
  118. ymgtTitle: "",
  119. DayPower: {
  120. // 图表所用单位
  121. units: [""],
  122. value: [
  123. {
  124. title: "",
  125. yAxisIndex: 0, // 使用单位
  126. value: [],
  127. },
  128. ],
  129. },
  130. // 72小时功率趋势图
  131. Powertrend: [
  132. {
  133. title: "",
  134. yAxisIndex: 0, // 使用单位
  135. value: [],
  136. },
  137. ],
  138. };
  139. },
  140. // 函数
  141. methods: {
  142. requestLine() {
  143. let that = this;
  144. that.API.requestData({
  145. method: "POST",
  146. subUrl: "/monitor/findCftInfo",
  147. timeout: 60000,
  148. data: {
  149. wpId: that.wpId,
  150. },
  151. success(res) {
  152. var data = res.data;
  153. that.cftmap = data.cftmap;
  154. // 日资源玫瑰图
  155. var rmgtmapIndicator = [],
  156. rmgtmapData = [];
  157. data.rmgtmap.data.forEach(item =>{
  158. rmgtmapIndicator.push(item.name);
  159. rmgtmapData.push(item.data1)
  160. })
  161. that.rmgtmap = {
  162. indicator: rmgtmapIndicator,
  163. data: [{value: rmgtmapData}]
  164. };
  165. // 月资源玫瑰图
  166. var ymgtmapIndicator = [],
  167. ymgtmapData = [];
  168. data.ymgtmap.data.forEach(item =>{
  169. ymgtmapIndicator.push(item.name);
  170. ymgtmapData.push(item.data1)
  171. })
  172. that.ymgtmap = {
  173. indicator: ymgtmapIndicator,
  174. data: [{value: ymgtmapData}]
  175. };
  176. // 72小时功率曲线图
  177. let glKey = ["value2","value1","value5","value4","value7","value6"];
  178. let Powertrend = [
  179. {
  180. title: "实发功率",
  181. smooth: true,
  182. value: [],
  183. },
  184. {
  185. title: "理论功率",
  186. smooth: true,
  187. value: [],
  188. },
  189. {
  190. title: "保证功率",
  191. smooth: true,
  192. value: [],
  193. },
  194. {
  195. title: "4小时预测功率",
  196. smooth: true,
  197. value: [],
  198. },
  199. {
  200. title: "24小时预测功率",
  201. smooth: true,
  202. value: [],
  203. },
  204. {
  205. title: "平均风速",
  206. smooth: true,
  207. value: [],
  208. },
  209. ];
  210. glKey.forEach((keyEle, keyIndex) => {
  211. res.data.glvos.forEach((cEle) => {
  212. Powertrend[keyIndex].value.push({
  213. text: new Date(cEle.time).formatDate("hh:mm"),
  214. value: cEle[keyEle],
  215. });
  216. });
  217. });
  218. that.Powertrend = Powertrend;
  219. }})
  220. },
  221. getWp () {
  222. let that = this;
  223. that.API.requestData({
  224. method: "GET",
  225. subUrl: "powercompare/windfarmAllAjax",
  226. success (res) {
  227. let btnGroups = [
  228. {
  229. icon: "svg-wind-site",
  230. btns: [],
  231. }
  232. ];
  233. res.data.forEach((ele, index) => {
  234. if (ele.id.indexOf("FDC") !== -1) {
  235. btnGroups[0].btns.push({
  236. text: ele.name,
  237. code: ele.id,
  238. });
  239. }
  240. });
  241. that.btnGroupsss = btnGroups;
  242. that.renderBtnActiveIndex();
  243. },
  244. });
  245. },
  246. renderBtnActiveIndex () {
  247. this.btnGroupsss.forEach((pEle, pIndex) => {
  248. pEle.btns.forEach((cEle, cIndex) => {
  249. if (cEle.code === this.wpId) {
  250. this.rowIndex = pIndex;
  251. this.selectIndex = cIndex;
  252. }
  253. });
  254. });
  255. },
  256. select (res) {
  257. this.$router.replace({
  258. path: `/monitor/windsite/tower/${res.code}`,
  259. });
  260. this.wpId = res.code;
  261. this.renderBtnActiveIndex ();
  262. // this.requestData(false);
  263. this.requestLine();
  264. },
  265. },
  266. created() {
  267. let that = this;
  268. that.wpId = that.$route.params.wpId;
  269. that.getWp();
  270. that.$nextTick(() => {
  271. // that.requestData(false);
  272. that.requestLine();
  273. that.timmer = setInterval(() => {
  274. // that.requestData(false);
  275. that.requestLine();
  276. }, 60 * 1000);
  277. });
  278. },
  279. unmounted() {
  280. clearInterval(this.timmer);
  281. this.timmer = null;
  282. },
  283. };
  284. </script>
  285. <style lang="less">
  286. .tower {
  287. position: relative;
  288. width: 100%;
  289. height: 100%;
  290. overflow: hidden;
  291. .windmill-1,
  292. .windmill-2,
  293. .windmill-3,
  294. .windmill-4,
  295. .windmill-5 {
  296. position: absolute;
  297. }
  298. .windmill-1 {
  299. top: 23.148vh;
  300. left: 28.333vh;
  301. width: 4.167vh;
  302. }
  303. .windmill-2 {
  304. top: 8.333vh;
  305. left: 11.111vh;
  306. width: 3.426vh;
  307. }
  308. .windmill-3 {
  309. top: 4.63vh;
  310. left: 38.889vh;
  311. width: 2.593vh;
  312. }
  313. .windmill-4 {
  314. top: 21.296vh;
  315. left: 122.87vh;
  316. width: 3.426vh;
  317. }
  318. .windmill-5 {
  319. top: 5.556vh;
  320. left: 121.296vh;
  321. width: 2.407vh;
  322. }
  323. .direction-chart {
  324. .legend {
  325. display: flex;
  326. align-items: center;
  327. justify-content: center;
  328. .dot {
  329. width: 7px;
  330. height: 7px;
  331. display: inline-block;
  332. margin-right: 8px;
  333. }
  334. .legend-text {
  335. font-size: @fontsize-s;
  336. color: #909ba9;
  337. }
  338. }
  339. }
  340. .pie-left,
  341. .pie-right {
  342. position: fixed;
  343. top: 11vh;
  344. }
  345. .pie-left {
  346. left: 5vh;
  347. }
  348. .pie-right {
  349. left: 20vh;
  350. }
  351. .thermometer-left,
  352. .thermometer-right {
  353. position: fixed;
  354. top: 20vh;
  355. }
  356. .thermometer-left {
  357. left: 5vh;
  358. }
  359. .thermometer-right {
  360. left: 20vh;
  361. }
  362. .panel-top,
  363. .panel-bottom {
  364. position: fixed;
  365. right: 10vh;
  366. width: 350px;
  367. // height: 24.352vh;
  368. }
  369. .panel-top {
  370. top: 7vh;
  371. }
  372. .panel-bottom {
  373. top: 37vh;
  374. }
  375. .rose-chart {
  376. position: absolute;
  377. left: 0;
  378. bottom: 1.852vh;
  379. height: 31.481vh;
  380. width: 100%;
  381. }
  382. .tools {
  383. display: flex;
  384. .tool-block {
  385. display: flex;
  386. align-items: center;
  387. margin-left: 0.741vh;
  388. .legend {
  389. flex: auto;
  390. width: 0.741vh;
  391. height: 0.741vh;
  392. margin-right: 0.741vh;
  393. &.long {
  394. width: 2.963vh;
  395. height: 0.37vh;
  396. }
  397. }
  398. .legend-text {
  399. color: #ffffff4d;
  400. }
  401. }
  402. }
  403. }
  404. </style>