tab1.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. <NormalScatterChart height="650px" :data="chartData" xTitle="风速" yTitle="功率" :showLegend="true" />
  26. </div>
  27. </template>
  28. <script>
  29. import NormalScatterChart from "@com/chart/scatter/normal-scatter-chart.vue";
  30. export default {
  31. // 名称
  32. name: "cutAnalyse",
  33. // 使用组件
  34. components: {
  35. NormalScatterChart
  36. },
  37. // 数据
  38. data () {
  39. return {
  40. isAsc: "asc",
  41. wpArray: [],
  42. wtArray: [],
  43. wpId: "",
  44. wtId: "MG01_01",
  45. recorddate: new Date((new Date().getTime() - 3600 * 1000 * 24)).formatDate("yyyy-MM-dd"),
  46. chartData: [{
  47. title: "风资源分析",
  48. value: []
  49. }]
  50. };
  51. },
  52. // 函数
  53. methods: {
  54. // 获取风场
  55. getWp (reGetWp) {
  56. let that = this;
  57. that.API.requestData({
  58. method: "GET",
  59. subUrl: "powercompare/windfarmAjax",
  60. success (res) {
  61. that.wpArray = res.data;
  62. that.wpId = res.data[0].id;
  63. that.getChartData();
  64. }
  65. });
  66. },
  67. // 获取图表数据
  68. getChartData () {
  69. let that = this;
  70. that.API.requestData({
  71. method: "POST",
  72. subUrl: "scatter/scatterAjax",
  73. data: {
  74. wpId: that.wpId,
  75. pjId: "",
  76. lnId: "",
  77. year: (that.recorddate ? new Date(that.recorddate).getFullYear() : ""),
  78. month: (that.recorddate ? (new Date(that.recorddate).getMonth() + 1) : ""),
  79. },
  80. success (res) {
  81. let chartData = [{
  82. title: "风资源分析",
  83. value: (res.data || [])
  84. }];
  85. that.$nextTick(()=>{
  86. that.chartData = chartData;
  87. });
  88. }
  89. });
  90. },
  91. search () {
  92. if (!this.wpId) {
  93. this.BASE.showMsg({
  94. msg: '场站为必选项'
  95. });
  96. } else {
  97. this.getChartData();
  98. }
  99. }
  100. },
  101. created () {
  102. this.getWp();
  103. },
  104. mounted () { },
  105. unmounted () { },
  106. };
  107. </script>
  108. <style lang="less" scoped>
  109. .draught-fan-list {
  110. width: 100%;
  111. height: 100%;
  112. display: flex;
  113. flex-direction: column;
  114. .btn-group-tabs {
  115. display: flex;
  116. flex-direction: row;
  117. .photovoltaic {
  118. margin-left: 1.481vh;
  119. }
  120. }
  121. .df-table {
  122. border: 0.093vh solid fade(@darkgray, 50%);
  123. position: relative;
  124. overflow: auto;
  125. flex-grow: 1;
  126. margin-top: 1.481vh;
  127. height: 30vh;
  128. &:before {
  129. content: '';
  130. width: 0.37vh;
  131. height: 0.37vh;
  132. background: @write;
  133. position: absolute;
  134. left: 0.278vh;
  135. top: 0.278vh;
  136. }
  137. tbody {
  138. height: calc(100vh - 166px);
  139. }
  140. }
  141. }
  142. </style>