tab1.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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>
  14. <div class="query-items">
  15. <div class="query-item">
  16. <div class="lable">风机:</div>
  17. <div class="search-input">
  18. <el-select v-model="wtId" clearable placeholder="请选择" popper-class="select">
  19. <el-option v-for="item in wtArray" :key="item.id" :value="item.id" :label="item.name" />
  20. </el-select>
  21. </div>
  22. </div>
  23. </div>
  24. <div class="query-actions">
  25. <button class="btn green" @click="search()">搜索</button>
  26. </div>
  27. </div>
  28. <div class="df-table">
  29. <ComTable :data="tableData"></ComTable>
  30. </div>
  31. <Mlc height="300px" :list="chartData" :units="chartUnit" :showLegend="true" />
  32. </div>
  33. </template>
  34. <script>
  35. import ComTable from "@com/coms/table/table.vue";
  36. import Mlc from "@com/chart/line/multiple-line-chart.vue";
  37. export default {
  38. // 名称
  39. name: "cutAnalyse",
  40. // 使用组件
  41. components: {
  42. ComTable,
  43. Mlc
  44. },
  45. // 数据
  46. data () {
  47. return {
  48. isAsc: "asc",
  49. wpArray: [],
  50. wtArray: [],
  51. wpId: "",
  52. wtId: "",
  53. tableData: {
  54. column: [
  55. {
  56. name: "风机",
  57. field: "windturbineid",
  58. is_num: false,
  59. is_light: false,
  60. },
  61. {
  62. name: "风速",
  63. field: "speed",
  64. is_num: false,
  65. is_light: false,
  66. },
  67. {
  68. name: "实际拟合功率",
  69. field: "actualpower",
  70. is_num: false,
  71. is_light: false,
  72. },
  73. {
  74. name: "最优拟合功率",
  75. field: "optimalpower",
  76. is_num: false,
  77. is_light: false,
  78. }
  79. ],
  80. data: [],
  81. },
  82. chartData: [{
  83. title: "",
  84. yAxisIndex: 0,
  85. value: []
  86. }],
  87. chartUnit: ["功率(MW)"]
  88. };
  89. },
  90. // 函数
  91. methods: {
  92. // 获取风场
  93. getWp () {
  94. let that = this;
  95. that.API.requestData({
  96. method: "GET",
  97. subUrl: "powercompare/windfarmAjax",
  98. success (res) {
  99. that.wpArray = res.data;
  100. that.wpId = res.data[0].id;
  101. that.getWt(that.wpId)
  102. }
  103. });
  104. },
  105. // 获取风机
  106. getWt (wpid) {
  107. let that = this;
  108. if (that.wpId) {
  109. that.API.requestData({
  110. method: "GET",
  111. baseURL: "http://10.155.32.4:9001",
  112. subUrl: "benchmarking/wtList",
  113. data: {
  114. wpid
  115. },
  116. success (res) {
  117. that.wtArray = res.data;
  118. that.wtId = res.data[0].id;
  119. that.getTab1Data();
  120. }
  121. });
  122. }
  123. },
  124. getTab1Data () {
  125. let that = this;
  126. that.API.requestData({
  127. method: "POST",
  128. subUrl: "powersaturation/powersaturationamonutlist",
  129. data: {
  130. wtId: that.wtId
  131. },
  132. success (res) {
  133. that.tableData.data = res.data.list;
  134. const key = ["actualpower", "optimalpower", "optmalpower"];
  135. let chartData = [{
  136. title: "实际拟合功率",
  137. yAxisIndex: 0,
  138. value: []
  139. }, {
  140. title: "最优拟合功率",
  141. yAxisIndex: 0,
  142. value: []
  143. }, {
  144. title: "保证功率",
  145. yAxisIndex: 0,
  146. value: []
  147. }];
  148. key.forEach((keyEle, keyIndex)=>{
  149. res.data.list.forEach(ele=>{
  150. chartData[keyIndex].value.push({
  151. text:ele.id,
  152. value:ele[keyEle]
  153. });
  154. });
  155. });
  156. that.chartData = chartData;
  157. }
  158. });
  159. },
  160. search () {
  161. if (!this.wpId || !this.wtId) {
  162. this.BASE.showMsg({
  163. msg: '场站与风机为必选项'
  164. });
  165. } else {
  166. this.getTab1Data();
  167. }
  168. }
  169. },
  170. created () {
  171. this.getWp();
  172. },
  173. mounted () { },
  174. unmounted () { },
  175. };
  176. </script>
  177. <style lang="less" scoped>
  178. .draught-fan-list {
  179. width: 100%;
  180. height: 100%;
  181. display: flex;
  182. flex-direction: column;
  183. .btn-group-tabs {
  184. display: flex;
  185. flex-direction: row;
  186. .photovoltaic {
  187. margin-left: 1.481vh;
  188. }
  189. }
  190. .df-table {
  191. border: 0.093vh solid fade(@darkgray, 50%);
  192. position: relative;
  193. overflow: auto;
  194. flex-grow: 1;
  195. margin-top: 1.481vh;
  196. height:60vh;
  197. &:before {
  198. content: '';
  199. width: 0.37vh;
  200. height: 0.37vh;
  201. background: @write;
  202. position: absolute;
  203. left: 0.278vh;
  204. top: 0.278vh;
  205. }
  206. tbody {
  207. height: calc(100vh - 166px);
  208. }
  209. }
  210. }
  211. </style>