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" :showLegend="true" />
  26. </div>
  27. </template>
  28. <script>
  29. import Mlc from "@com/chart/line/multiple-line-chart.vue";
  30. import NormalScatterChart from "@com/chart/scatter/normal-scatter-chart.vue";
  31. export default {
  32. // 名称
  33. name: "cutAnalyse",
  34. // 使用组件
  35. components: {
  36. NormalScatterChart
  37. },
  38. // 数据
  39. data () {
  40. return {
  41. isAsc: "asc",
  42. wpArray: [],
  43. wtArray: [],
  44. wpId: "",
  45. wtId: "MG01_01",
  46. recorddate: new Date((new Date().getTime() - 3600 * 1000 * 24)).formatDate("yyyy-MM-dd"),
  47. chartData: [{
  48. title: "风资源分析",
  49. value: []
  50. }]
  51. };
  52. },
  53. // 函数
  54. methods: {
  55. // 获取风场
  56. getWp (reGetWp) {
  57. let that = this;
  58. that.API.requestData({
  59. method: "GET",
  60. subUrl: "powercompare/windfarmAjax",
  61. success (res) {
  62. that.wpArray = res.data;
  63. that.wpId = res.data[0].id;
  64. that.getChartData();
  65. }
  66. });
  67. },
  68. // 获取图表数据
  69. getChartData () {
  70. let that = this;
  71. that.API.requestData({
  72. method: "POST",
  73. subUrl: "scatter/scatterAjax",
  74. data: {
  75. wpId: that.wpId,
  76. pjId: "",
  77. lnId: "",
  78. year: (that.recorddate ? new Date(that.recorddate).getFullYear() : ""),
  79. month: (that.recorddate ? (new Date(that.recorddate).getMonth() + 1) : ""),
  80. },
  81. success (res) {
  82. let ChartData = [{
  83. title: "风资源分析",
  84. value: (res.data || [])
  85. }];
  86. that.ChartData = ChartData;
  87. console.log(123123, ChartData);
  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>