fxzstab1.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <div class="draught-fan-list">
  3. <div class="query mg-b-8">
  4. <div class="query-items">
  5. <div class="query-item">
  6. <div class="lable">场站:</div>
  7. <div class="search-input">
  8. <el-select v-model="wpId" clearable placeholder="请选择" popper-class="select">
  9. <el-option v-for="item in wpArray" :key="item.id" :value="item.id" :label="item.name" />
  10. </el-select>
  11. </div>
  12. </div>
  13. <div class="query-item">
  14. <div class="lable">日期:</div>
  15. <div class="search-input">
  16. <el-date-picker v-model="recorddate" type="date" value-format="YYYY-MM-DD" placeholder="选择日期" popper-class="date-select">
  17. </el-date-picker>
  18. </div>
  19. </div>
  20. </div>
  21. <div class="query-actions">
  22. <button class="btn green" @click="search">查询</button>
  23. </div>
  24. </div>
  25. <div class="mg-b-16 arrow-chart" >
  26. <panel :title="'场站风向24小时走向情况'" >
  27. <multi-arrow-line-chart :height="'41.296vh'" :showLine="true" :list="chartData" />
  28. </panel>
  29. </div>
  30. </div>
  31. </template>
  32. <script>
  33. import Panel from "../../components/coms/panel/panel.vue";
  34. import multiArrowLineChart from "../../components/chart/line/multi-arrow-line-chart.vue";
  35. import apis from "@api/wisdomOverhaul/health/index.js";
  36. import api from "@api/wisdomOverhaul/windResources/index.js";
  37. export default {
  38. setup() {},
  39. components: {
  40. Panel,
  41. multiArrowLineChart,
  42. },
  43. // 数据
  44. data () {
  45. return {
  46. wpArray: [],
  47. wtArray: [],
  48. wpId: "MHS_FDC",
  49. recorddate: new Date((new Date().getTime() - 3600 * 1000 * 24)).formatDate("yyyy-MM-dd"),
  50. chartData: [{
  51. title: "风速",
  52. value: []
  53. }]
  54. };
  55. },
  56. // 函数
  57. methods: {
  58. // 获取风场
  59. getWp (reGetWp) {
  60. apis.powercompareWindfarmAjax({}).then((res) => {
  61. this.wpArray = res.data;
  62. this.wpArray = res.data;
  63. this.wpId = res.data[0].id;
  64. this.getChartData();
  65. });
  66. },
  67. // 获取图表数据
  68. getChartData () {
  69. api.getWinddirection({
  70. wpId: this.wpId,
  71. recorddate: this.recorddate,
  72. }).then((res) => {
  73. const array = [];
  74. for (var {timestr: n, valueObjVo: {value: f,symbolRotate:r,symbolSize:s}} of res.data) {
  75. let obj = {'text':n , 'value': f ,'size': s,'route':r};
  76. // let temp = 'text: ' + n + ', value: ' + f+ ', size: ' + s+ ', route: ' + r;
  77. array.push(obj);
  78. }
  79. console.log(array);
  80. let chartData = [{
  81. title: "风速",
  82. value: (array || [])
  83. }];
  84. this.$nextTick(()=>{
  85. this.chartData = chartData;
  86. });
  87. });
  88. },
  89. search () {
  90. if (!this.wpId) {
  91. this.BASE.showMsg({
  92. msg: '场站为必选项'
  93. });
  94. } else {
  95. this.getChartData();
  96. }
  97. }
  98. },
  99. created () {
  100. this.getWp();
  101. },
  102. mounted () { },
  103. unmounted () { },
  104. };
  105. </script>
  106. <style lang="less" scoped>
  107. .draught-fan-list {
  108. width: 100%;
  109. height: 100%;
  110. display: flex;
  111. flex-direction: column;
  112. .btn-group-tabs {
  113. display: flex;
  114. flex-direction: row;
  115. .photovoltaic {
  116. margin-left: 1.481vh;
  117. }
  118. }
  119. .df-table {
  120. border: 0.093vh solid fade(@darkgray, 50%);
  121. position: relative;
  122. overflow: auto;
  123. flex-grow: 1;
  124. margin-top: 1.481vh;
  125. height: 30vh;
  126. &:before {
  127. content: '';
  128. width: 0.37vh;
  129. height: 0.37vh;
  130. background: @write;
  131. position: absolute;
  132. left: 0.278vh;
  133. top: 0.278vh;
  134. }
  135. tbody {
  136. height: calc(100vh - 166px);
  137. }
  138. }
  139. }
  140. </style>