Tower.vue 10 KB

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