tab3.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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" @change="(wpId) => { getLine(); }">
  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-select v-model="lineId" clearable placeholder="请选择" popper-class="select">
  17. <el-option v-for="item in lineArray" :key="item.id" :value="item.id" :label="item.name" />
  18. </el-select>
  19. </div>
  20. </div>
  21. <div class="query-item">
  22. <div class="lable">日期:</div>
  23. <div class="search-input">
  24. <el-date-picker v-model="recorddate" type="date"
  25. value-format="YYYY-MM-DD" placeholder="选择日期" popper-class="date-select">
  26. </el-date-picker>
  27. </div>
  28. </div>
  29. </div>
  30. <div class="query-actions">
  31. <button class="btn green" @click="search">搜索</button>
  32. </div>
  33. </div>
  34. <NormalScatterChart width="97%" height="650px" :data="chartData" xTitle="风速(m/s)" yTitle="功率(万kW)" :showLegend="true" />
  35. </div>
  36. </template>
  37. <script>
  38. import NormalScatterChart from "@com/chart/scatter/normal-scatter-chart.vue";
  39. import apis from "@api/wisdomOverhaul/health/index.js";
  40. import api from "@api/wisdomOverhaul/windResources/index.js";
  41. export default {
  42. // 名称
  43. name: "cutAnalyse",
  44. // 使用组件
  45. components: {
  46. NormalScatterChart
  47. },
  48. // 数据
  49. data () {
  50. return {
  51. isAsc: "asc",
  52. wpArray: [],
  53. lineArray: [],
  54. wpId: "",
  55. lineId:"",
  56. wtId: "MG01_01",
  57. recorddate:new Date((new Date().getTime() - 3600 * 1000 * 24)).formatDate("yyyy-MM-dd"),
  58. chartData: [{
  59. title: "风资源分析",
  60. value: []
  61. }]
  62. };
  63. },
  64. // 函数
  65. methods: {
  66. // 获取风场
  67. getWp (reGetWp) {
  68. apis.powercompareWindfarmAjax({}).then((res) => {
  69. this.wpArray = res.data;
  70. this.wpArray = res.data;
  71. this.wpId = res.data[0].id;
  72. this.getLine();
  73. });
  74. // let that = this;
  75. // that.API.requestData({
  76. // method: "GET",
  77. // subUrl: "powercompare/windfarmAjax",
  78. // success (res) {
  79. // that.wpArray = res.data;
  80. // that.wpId = res.data[0].id;
  81. // that.getLine();
  82. // }
  83. // });
  84. },
  85. // 获取线路
  86. getLine(){
  87. api.lineWpIdAjax({
  88. wpId: this.wpId
  89. }).then((res) => {
  90. this.wpArray = res.data;
  91. this.projectArray = res.data;
  92. this.projectId = res.data[0].id;
  93. this.getChartData();
  94. });
  95. // let that = this;
  96. // that.API.requestData({
  97. // method: "GET",
  98. // subUrl: "powercompare/lineWpIdAjax",
  99. // data:{
  100. // wpId: that.wpId
  101. // },
  102. // success (res) {
  103. // that.lineArray = res.data;
  104. // that.lineId = res.data[0].id;
  105. // that.getChartData();
  106. // }
  107. // });
  108. },
  109. // 获取图表数据
  110. getChartData () {
  111. api.scatterAjax({
  112. wpId: this.wpId,
  113. pjId: "",
  114. lnId: "",
  115. year: (this.recorddate ? new Date(this.recorddate).getFullYear() : ""),
  116. month: (this.recorddate ? (new Date(this.recorddate).getMonth() + 1) : ""),
  117. }).then((res) => {
  118. let chartData = [{
  119. title: "风资源分析",
  120. value: (res.data || [])
  121. }];
  122. this.$nextTick(()=>{
  123. this.chartData = chartData;
  124. });
  125. });
  126. },
  127. search () {
  128. if (!this.wpId || !this.lineId) {
  129. this.BASE.showMsg({
  130. msg: '场站与线路为必选项'
  131. });
  132. } else {
  133. this.getChartData();
  134. }
  135. }
  136. },
  137. created () {
  138. this.getWp();
  139. },
  140. mounted () { },
  141. unmounted () { },
  142. };
  143. </script>
  144. <style lang="less" scoped>
  145. .draught-fan-list {
  146. width: 100%;
  147. height: 100%;
  148. display: flex;
  149. flex-direction: column;
  150. .btn-group-tabs {
  151. display: flex;
  152. flex-direction: row;
  153. .photovoltaic {
  154. margin-left: 1.481vh;
  155. }
  156. }
  157. .df-table {
  158. border: 0.093vh solid fade(@darkgray, 50%);
  159. position: relative;
  160. overflow: auto;
  161. flex-grow: 1;
  162. margin-top: 1.481vh;
  163. height: 30vh;
  164. &:before {
  165. content: '';
  166. width: 0.37vh;
  167. height: 0.37vh;
  168. background: @write;
  169. position: absolute;
  170. left: 0.278vh;
  171. top: 0.278vh;
  172. }
  173. tbody {
  174. height: calc(100vh - 166px);
  175. }
  176. }
  177. }
  178. </style>