index.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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="dateTime"
  23. size="mini"
  24. type="daterange"
  25. range-separator="-"
  26. format="YYYY-MM-DD"
  27. value-format="YYYY-MM-DD"
  28. start-placeholder="开始"
  29. end-placeholder="结束"
  30. popper-class="date-select"
  31. >
  32. </el-date-picker>
  33. </div>
  34. </div>
  35. <!-- <div class="station">
  36. <span class="timeaa">时间:</span>
  37. <el-date-picker
  38. v-model="pickerTimer"
  39. type="daterange"
  40. range-separator="To"
  41. start-placeholder="开始时间"
  42. end-placeholder="结束时间"
  43. size="mini"
  44. format="YYYY/MM/DD"
  45. value-format="YYYY-MM-DD"
  46. />
  47. </div> -->
  48. <el-button round size="mini" class="searchColor" @click="getTableDate"
  49. >搜 索</el-button
  50. >
  51. <!-- <el-button round size="mini">导出</el-button> -->
  52. </div>
  53. <div class="data-bodys">
  54. <div class="line clearfix">
  55. <div class="leftContent left"><span>复位及时率</span></div>
  56. </div>
  57. <div class="economicTable">
  58. <el-table
  59. :data="tableData"
  60. style="width: 100%"
  61. size="mini"
  62. stripe
  63. height="100%"
  64. >
  65. <el-table-column
  66. align="center"
  67. prop="unit"
  68. label="风场"
  69. width="200"
  70. sortable
  71. ></el-table-column>
  72. <el-table-column
  73. align="center"
  74. header-align="center"
  75. prop="five"
  76. label="5分钟 / 复位次数(次)"
  77. sortable
  78. ></el-table-column>
  79. <el-table-column
  80. align="center"
  81. header-align="center"
  82. prop="fives"
  83. label="5分钟 / 复位率(%)"
  84. sortable
  85. ></el-table-column>
  86. <el-table-column
  87. align="center"
  88. header-align="center"
  89. prop="ten"
  90. label="10分钟 / 复位次数(次)"
  91. sortable
  92. ></el-table-column>
  93. <el-table-column
  94. align="center"
  95. header-align="center"
  96. prop="tens"
  97. label="10分钟 / 复位率(%)"
  98. sortable
  99. ></el-table-column>
  100. <el-table-column
  101. align="center"
  102. header-align="center"
  103. prop="fifteen"
  104. label="15分钟 / 复位次数(次)"
  105. sortable
  106. ></el-table-column>
  107. <el-table-column
  108. align="center"
  109. header-align="center"
  110. prop="fifteens"
  111. label="15分钟 / 复位率(%)"
  112. sortable
  113. ></el-table-column>
  114. <el-table-column
  115. align="center"
  116. header-align="center"
  117. prop="twenty"
  118. label="20分钟 / 复位次数(次)"
  119. sortable
  120. ></el-table-column>
  121. <el-table-column
  122. align="center"
  123. header-align="center"
  124. prop="twentys"
  125. label="20分钟 / 复位率(%)"
  126. sortable
  127. ></el-table-column>
  128. </el-table>
  129. </div>
  130. </div>
  131. </div>
  132. </template>
  133. <script>
  134. import dayjs from "dayjs";
  135. import { companys, timelyRate } from "@/api/curveAnalyse";
  136. import dataJson from "./dataJson.json";
  137. export default {
  138. name: "restorationEfficiency",
  139. components: {},
  140. data() {
  141. return {
  142. dateTime: [],
  143. company: "",
  144. companyOptions: [],
  145. tableData: [],
  146. pickerTimer: [],
  147. };
  148. },
  149. watch: {},
  150. filters: {},
  151. computed: {},
  152. created() {
  153. this.dateTime = [
  154. dayjs().subtract(1, "week").format("YYYY-MM-DD"),
  155. dayjs().format("YYYY-MM-DD"),
  156. ];
  157. this.initialization();
  158. },
  159. methods: {
  160. initialization() {
  161. // this.dataChange(dataJson.data)
  162. companys().then(({ data: res }) => {
  163. this.companyOptions = res.data;
  164. this.company = res.data[0].id;
  165. this.getTableDate();
  166. });
  167. },
  168. getTableDate() {
  169. timelyRate({
  170. companyId: this.company,
  171. beginDate: this.dateTime[0],
  172. endDate: this.dateTime[1],
  173. }).then(({ data: res }) => {
  174. this.dataChange(res);
  175. });
  176. },
  177. dataChange(res) {
  178. if (res) {
  179. let data = [];
  180. res.data.forEach((item, index) => {
  181. data[index] = {
  182. unit: item.wpid,
  183. five: item.wfz,
  184. fives: item.wfzfwl,
  185. ten: item.sfz,
  186. tens: item.sfzfwl,
  187. fifteen: item.swfz,
  188. fifteens: item.swfzfwl,
  189. twenty: item.esfz,
  190. twentys: item.esfzfwl,
  191. is_light: false,
  192. };
  193. });
  194. this.tableData = data;
  195. }
  196. },
  197. },
  198. mounted() {},
  199. beforeUnmount() {},
  200. };
  201. </script>
  202. <style lang="less" scoped>
  203. .title {
  204. display: flex;
  205. flex-direction: row;
  206. align-items: center;
  207. margin-top: 10px;
  208. .station {
  209. display: flex;
  210. flex-direction: row;
  211. align-items: center;
  212. font-size: 14px;
  213. font-family: Microsoft YaHei;
  214. font-weight: 400;
  215. color: #b3b3b3;
  216. margin-left: 10px;
  217. }
  218. .el-date-editor--daterange {
  219. background: transparent;
  220. border: 1px solid #2a374f;
  221. border-radius: 30px;
  222. height: 25px;
  223. .el-range-input {
  224. background: transparent;
  225. color: #fff;
  226. }
  227. .el-range-separator {
  228. width: 10%;
  229. color: #fff;
  230. position: relative;
  231. }
  232. }
  233. .search-input {
  234. margin-left: 10px;
  235. }
  236. .but {
  237. display: flex;
  238. flex-direction: row;
  239. align-content: center;
  240. margin-left: 20px;
  241. }
  242. .buttons {
  243. background-color: rgba(5, 187, 76, 0.2);
  244. border: 1px solid #3b6c53;
  245. color: #b3b3b3;
  246. font-size: 14px;
  247. &:hover {
  248. background-color: rgba(5, 187, 76, 0.5);
  249. color: #ffffff;
  250. }
  251. }
  252. }
  253. .parcel-box {
  254. height: 100%;
  255. width: 100%;
  256. padding: 0 10px;
  257. padding-bottom: 10px;
  258. .line {
  259. padding-bottom: 5px;
  260. .leftContent {
  261. width: 242px;
  262. height: 41px;
  263. line-height: 41px;
  264. background: url("~@/assets/imgs/title_left_bg.png") no-repeat;
  265. span {
  266. font-size: 16px;
  267. font-family: Microsoft YaHei;
  268. font-weight: 400;
  269. color: #05bb4c;
  270. margin-left: 25px;
  271. }
  272. }
  273. .rightContent {
  274. width: 212px;
  275. height: 28px;
  276. margin-top: 13px;
  277. background: url("../../../../assets/imgs/title_right_bg.png");
  278. }
  279. }
  280. .data-bodys {
  281. display: flex;
  282. flex-direction: column;
  283. background-color: rgba(0, 0, 0, 0.45);
  284. border-radius: 5px;
  285. height: calc(100% - 45px);
  286. padding-top: 10px;
  287. .economicTable {
  288. width: 100%;
  289. height: calc(100% - 40px);
  290. }
  291. }
  292. }
  293. .clearfix::after {
  294. content: "";
  295. clear: both;
  296. height: 0;
  297. line-height: 0;
  298. visibility: hidden;
  299. display: block;
  300. }
  301. .clearfix {
  302. zoom: 1;
  303. }
  304. .left {
  305. float: left;
  306. }
  307. .right {
  308. float: right;
  309. }
  310. .searchColor {
  311. background-color: rgba(5, 187, 76, 0.2);
  312. border: 1px solid #3b6c53;
  313. color: #b3b3b3;
  314. font-size: 14px;
  315. margin-left: 10px;
  316. &:hover {
  317. background-color: rgba(5, 187, 76, 0.5);
  318. color: #ffffff;
  319. }
  320. }
  321. </style>
  322. <style lang="less" scoped>
  323. ::v-deep .el-table__body-wrapper {
  324. background: #142446 !important;
  325. }
  326. </style>