index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <div style="height: 100%; padding: 10px 20px">
  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
  9. size="mini"
  10. v-model="value1"
  11. clearable
  12. placeholder="请选择"
  13. popper-class="select"
  14. >
  15. <el-option
  16. v-for="item in ChangZhan"
  17. :key="item.id"
  18. :value="item.id"
  19. :label="item.name"
  20. >
  21. </el-option>
  22. </el-select>
  23. </div>
  24. </div>
  25. <div class="query-item">
  26. <div class="lable">日期:</div>
  27. <div class="search-input">
  28. <el-date-picker
  29. size="mini"
  30. v-model="date"
  31. type="date"
  32. placeholder="选择日期"
  33. popper-class="date-select"
  34. value-format="YYYY-MM-DD"
  35. >
  36. </el-date-picker>
  37. </div>
  38. </div>
  39. <div class="query-actions">
  40. <el-button size="mini" round class="searchColor" @click="getTable"
  41. >查 询</el-button
  42. >
  43. </div>
  44. </div>
  45. </div>
  46. <div class="table-box">
  47. <div class="leftContent">
  48. <span>{{ showTitle }}</span>
  49. </div>
  50. <el-table
  51. :data="tableData.data"
  52. stripe
  53. height="calc(100% - 40px)"
  54. size="mini"
  55. >
  56. <el-table-column
  57. :sortable="item.field != 'nemCode' && item.field != 'recordDate'"
  58. header-align="center"
  59. :align="index < 2 ? 'center' : 'right'"
  60. v-for="(item, index) in tableData.column"
  61. :key="index"
  62. :prop="item.field"
  63. :label="item.name"
  64. >
  65. </el-table-column>
  66. </el-table>
  67. </div>
  68. </div>
  69. </template>
  70. <script>
  71. import api1 from "@api/economic/index.js";
  72. import { getCurveIntervalfittingmainList } from "@api/wisdomOverhaul/energy/index.js";
  73. export default {
  74. name: "Qxqjpcl",
  75. data() {
  76. return {
  77. ChangZhan: [],
  78. value1: "",
  79. date: "",
  80. showTitle: "曲线区间偏差率",
  81. tableLoading: true,
  82. tableData: {
  83. column: [
  84. {
  85. name: "风机",
  86. field: "nemCode",
  87. },
  88. {
  89. name: "日期",
  90. field: "recordDate",
  91. },
  92. {
  93. name: "3-5米",
  94. field: "y35mqxpcl",
  95. },
  96. {
  97. name: "5-11米",
  98. field: "y511mqxpcl",
  99. },
  100. {
  101. name: "11米以上",
  102. field: "y11mycqxpcl",
  103. },
  104. ],
  105. data: [],
  106. },
  107. };
  108. },
  109. created() {
  110. this.ChangZhanVal();
  111. this.date = new Date().formatDate("yyyy-MM-dd");
  112. },
  113. methods: {
  114. // 获取表格数据
  115. getTable() {
  116. this.tableLoading = true;
  117. const param = {
  118. wpId: this.value1,
  119. recorddate: this.date,
  120. };
  121. getCurveIntervalfittingmainList(param).then(({ data: res }) => {
  122. this.tableLoading = false;
  123. console.log(res.code);
  124. if (res.code === 200) {
  125. res.data.forEach((ele) => {
  126. ele.recordDate = this.date;
  127. });
  128. this.tableData.data = res.data || [];
  129. }
  130. });
  131. },
  132. // tab
  133. handleOpen(vl, index) {
  134. this.cur = index;
  135. this.showTitle = vl;
  136. this.date = new Date().formatDate(`yyyy-MM${index ? "-dd" : ""}`);
  137. this.getTable();
  138. },
  139. // 场站
  140. ChangZhanVal() {
  141. api1
  142. .getWpList({
  143. type: "-1",
  144. })
  145. .then((res) => {
  146. if (res.data.code === 200) {
  147. this.ChangZhan = res.data.data;
  148. this.value1 = res.data.data[0].id;
  149. this.getTable();
  150. }
  151. });
  152. },
  153. },
  154. };
  155. </script>
  156. <style scoped lang="less">
  157. .table-box {
  158. height: calc(100% - 80px);
  159. .leftContent {
  160. width: 242px;
  161. height: 45px;
  162. line-height: 45px;
  163. background: url("~@/assets/imgs/title_left_bg1.png") no-repeat;
  164. span {
  165. font-size: 16px;
  166. font-family: Microsoft YaHei;
  167. font-weight: 400;
  168. color: #05bb4c;
  169. margin-left: 25px;
  170. }
  171. }
  172. }
  173. .query-actions {
  174. margin-left: 0 !important;
  175. }
  176. button {
  177. margin-left: 10px;
  178. background: rgba(67, 81, 107, 0.3);
  179. border: 1px solid #274934;
  180. color: #b3b3b3;
  181. }
  182. .searchColor {
  183. background-color: rgba(5, 187, 76, 0.2);
  184. border: 1px solid #3b6c53;
  185. color: #b3b3b3;
  186. font-size: 14px;
  187. &:hover {
  188. background-color: rgba(5, 187, 76, 0.5);
  189. color: #ffffff;
  190. }
  191. }
  192. .newspan {
  193. line-height: 30px;
  194. cursor: pointer;
  195. padding: 0 1vw;
  196. margin: 0 2px;
  197. color: #9ca5a8;
  198. transition: color 0.2s ease-in-out;
  199. position: relative;
  200. }
  201. .newspan:hover {
  202. background: linear-gradient(
  203. to top,
  204. rgba(5, 187, 76, 0.5),
  205. rgba(5, 187, 76, 0)
  206. );
  207. color: white;
  208. position: relative;
  209. }
  210. .newspan:hover::after {
  211. content: "";
  212. position: absolute;
  213. width: 100%;
  214. height: 0.463vh;
  215. border: 0.093vh solid #05bb4c;
  216. border-top: 0;
  217. left: 0;
  218. bottom: 0;
  219. box-sizing: border-box;
  220. }
  221. .active {
  222. background: linear-gradient(
  223. to top,
  224. rgba(5, 187, 76, 0.5),
  225. rgba(5, 187, 76, 0)
  226. );
  227. color: white;
  228. position: relative;
  229. }
  230. .active::after {
  231. content: "";
  232. position: absolute;
  233. width: 100%;
  234. height: 4px;
  235. border: 1px solid #05bb4c;
  236. border-top: 0;
  237. left: 0;
  238. bottom: 0;
  239. box-sizing: border-box;
  240. }
  241. .title {
  242. background: rgba(255, 255, 255, 0.1);
  243. margin-bottom: 8px;
  244. padding: 8px;
  245. }
  246. </style>