index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <template>
  2. <div class="parcel-box">
  3. <div class="title">
  4. <el-select
  5. size="mini"
  6. v-model="company"
  7. placeholder="请选择"
  8. @change="getTableDate"
  9. >
  10. <el-option
  11. v-for="item in companyOptions"
  12. :key="item.id"
  13. :label="item.aname"
  14. :value="item.id"
  15. >
  16. </el-option>
  17. </el-select>
  18. <div class="station">
  19. 开始日期
  20. <div class="search-input">
  21. <el-date-picker
  22. v-model="starTime"
  23. type="date"
  24. size="mini"
  25. value-format="YYYY-MM-DD"
  26. placeholder="选择日期"
  27. popper-class="date-select"
  28. >
  29. </el-date-picker>
  30. </div>
  31. </div>
  32. <div class="station">
  33. 结束日期
  34. <div class="search-input">
  35. <el-date-picker
  36. v-model="endTime"
  37. size="mini"
  38. type="date"
  39. value-format="YYYY-MM-DD"
  40. placeholder="选择日期"
  41. popper-class="date-select"
  42. >
  43. </el-date-picker>
  44. </div>
  45. </div>
  46. <el-button round size="mini" class="searchColor" @click="getTableDate"
  47. >搜索</el-button
  48. >
  49. <!-- <el-button round size="mini">导出</el-button> -->
  50. </div>
  51. <div class="data-bodys">
  52. <div class="line clearfix">
  53. <div class="leftContent left"><span>消缺及时率</span></div>
  54. </div>
  55. <div class="economicTable">
  56. <el-table
  57. :data="tableData"
  58. style="width: 100%"
  59. size="mini"
  60. stripe
  61. height="100%"
  62. >
  63. <el-table-column
  64. align="center"
  65. prop="wpid"
  66. label="风场"
  67. width="200"
  68. sortable
  69. ></el-table-column>
  70. <el-table-column
  71. align="center"
  72. prop="gzCount"
  73. label="故障次数(次)"
  74. sortable
  75. ></el-table-column>
  76. <el-table-column
  77. align="center"
  78. prop="xqCount"
  79. label="消缺及时次数(次)"
  80. sortable
  81. ></el-table-column>
  82. <el-table-column
  83. align="center"
  84. prop="xqjsl"
  85. label="消缺及时率(%)"
  86. sortable
  87. ></el-table-column>
  88. </el-table>
  89. </div>
  90. </div>
  91. </div>
  92. </template>
  93. <script>
  94. import dayjs from "dayjs";
  95. import { companys, eliminatRate } from "@/api/curveAnalyse";
  96. export default {
  97. name: "consumeEfficiency",
  98. components: {},
  99. data() {
  100. return {
  101. starTime: "",
  102. endTime: "",
  103. company: "",
  104. companyOptions: [],
  105. tableData: [],
  106. };
  107. },
  108. watch: {},
  109. filters: {},
  110. computed: {},
  111. created() {
  112. let date = new Date();
  113. date.setDate(1);
  114. let month = parseInt(date.getMonth() + 1);
  115. let day = date.getDate();
  116. if (month < 10) {
  117. month = "0" + month;
  118. }
  119. if (day < 10) {
  120. day = "0" + day;
  121. }
  122. this.starTime = dayjs().add(-1, "day").format("YYYY-MM-DD");
  123. this.endTime = dayjs().format("YYYY-MM-DD");
  124. this.initialization();
  125. },
  126. methods: {
  127. initialization() {
  128. companys().then(({ data: res }) => {
  129. this.companyOptions = res.data;
  130. this.company = res.data[0].id;
  131. this.getTableDate();
  132. });
  133. },
  134. getTableDate() {
  135. this.BASE.showLoading();
  136. eliminatRate({
  137. companyId: this.company,
  138. beginDate: this.starTime,
  139. endDate: this.endTime,
  140. }).then(({ data: res }) => {
  141. if (res) {
  142. this.BASE.closeLoading();
  143. this.tableData = res.data;
  144. }
  145. });
  146. },
  147. },
  148. mounted() {},
  149. beforeUnmount() {},
  150. };
  151. </script>
  152. <style lang="less" scoped>
  153. .title {
  154. display: flex;
  155. flex-direction: row;
  156. align-items: center;
  157. margin-top: 10px;
  158. .station {
  159. display: flex;
  160. flex-direction: row;
  161. align-items: center;
  162. font-size: 14px;
  163. font-family: Microsoft YaHei;
  164. font-weight: 400;
  165. color: #b3b3b3;
  166. margin-left: 10px;
  167. }
  168. .search-input {
  169. margin-left: 10px;
  170. }
  171. .but {
  172. display: flex;
  173. flex-direction: row;
  174. align-content: center;
  175. margin-left: 20px;
  176. }
  177. .buttons {
  178. background-color: rgba(5, 187, 76, 0.2);
  179. border: 1px solid #3b6c53;
  180. color: #b3b3b3;
  181. font-size: 14px;
  182. &:hover {
  183. background-color: rgba(5, 187, 76, 0.5);
  184. color: #ffffff;
  185. }
  186. }
  187. }
  188. .parcel-box {
  189. height: 100%;
  190. width: 100%;
  191. padding: 0 30px;
  192. padding-bottom: 10px;
  193. .line {
  194. padding-bottom: 5px;
  195. .leftContent {
  196. width: 242px;
  197. height: 41px;
  198. line-height: 41px;
  199. background: url("~@/assets/imgs/title_left_bg1.png") no-repeat;
  200. span {
  201. font-size: 16px;
  202. font-family: Microsoft YaHei;
  203. font-weight: 400;
  204. color: #05bb4c;
  205. margin-left: 25px;
  206. }
  207. }
  208. .rightContent {
  209. width: 212px;
  210. height: 28px;
  211. margin-top: 13px;
  212. background: url("../../../../assets/imgs/title_right_bg.png");
  213. }
  214. }
  215. .data-bodys {
  216. display: flex;
  217. flex-direction: column;
  218. background-color: rgba(0, 0, 0, 0.45);
  219. border-radius: 5px;
  220. height: calc(100% - 45px);
  221. padding-top: 10px;
  222. .economicTable {
  223. width: 100%;
  224. height: calc(100% - 40px);
  225. }
  226. }
  227. }
  228. .clearfix::after {
  229. content: "";
  230. clear: both;
  231. height: 0;
  232. line-height: 0;
  233. visibility: hidden;
  234. display: block;
  235. }
  236. .clearfix {
  237. zoom: 1;
  238. }
  239. .left {
  240. float: left;
  241. }
  242. .right {
  243. float: right;
  244. }
  245. .searchColor {
  246. background-color: rgba(5, 187, 76, 0.2);
  247. border: 1px solid #3b6c53;
  248. color: #b3b3b3;
  249. font-size: 14px;
  250. margin-left: 10px;
  251. &:hover {
  252. background-color: rgba(5, 187, 76, 0.5);
  253. color: #ffffff;
  254. }
  255. }
  256. </style>