tab1.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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.$nextTick(()=>{
  87. that.chartData = chartData;
  88. });
  89. }
  90. });
  91. },
  92. search () {
  93. if (!this.wpId) {
  94. this.BASE.showMsg({
  95. msg: '场站为必选项'
  96. });
  97. } else {
  98. this.getChartData();
  99. }
  100. }
  101. },
  102. created () {
  103. this.getWp();
  104. },
  105. mounted () { },
  106. unmounted () { },
  107. };
  108. </script>
  109. <style lang="less" scoped>
  110. .draught-fan-list {
  111. width: 100%;
  112. height: 100%;
  113. display: flex;
  114. flex-direction: column;
  115. .btn-group-tabs {
  116. display: flex;
  117. flex-direction: row;
  118. .photovoltaic {
  119. margin-left: 1.481vh;
  120. }
  121. }
  122. .df-table {
  123. border: 0.093vh solid fade(@darkgray, 50%);
  124. position: relative;
  125. overflow: auto;
  126. flex-grow: 1;
  127. margin-top: 1.481vh;
  128. height: 30vh;
  129. &:before {
  130. content: '';
  131. width: 0.37vh;
  132. height: 0.37vh;
  133. background: @write;
  134. position: absolute;
  135. left: 0.278vh;
  136. top: 0.278vh;
  137. }
  138. tbody {
  139. height: calc(100vh - 166px);
  140. }
  141. }
  142. }
  143. </style>