Decision4.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template>
  2. <div class="decision-page-4">
  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-date-picker v-model="value4" @change="BeginChange(value4)" type="date"
  9. value-format="YYYY-MM-DD" placeholder="选择日期" popper-class="date-select">
  10. </el-date-picker>
  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="value5" @change="EndChange(value5)" type="date"
  17. value-format="YYYY-MM-DD" placeholder="选择日期" popper-class="date-select">
  18. </el-date-picker>
  19. <div class="unit svg-icon svg-icon-gray">
  20. <svg-icon :svgid="''" />
  21. </div>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. <toolbar-panel title="值际对标" :showLine="false"></toolbar-panel>
  27. <div class="mg-b-16">
  28. <div class="project-table">
  29. <Table :data="tableData"></Table>
  30. </div>
  31. </div>
  32. </div>
  33. </template>
  34. <script>
  35. import MultipleBarChart from "../../components/chart/bar/multiple-bar-chart.vue";
  36. import SvgIcon from "../../components/coms/icon/svg-icon.vue";
  37. import Panel from "../../components/coms/panel/panel.vue";
  38. import ToolbarPanel from "../../components/coms/panel/toolbar-panel.vue";
  39. import Table from "../../components/coms/table/table.vue";
  40. export default {
  41. components: {
  42. Panel,
  43. Table,
  44. SvgIcon,
  45. MultipleBarChart,
  46. ToolbarPanel
  47. },
  48. data() {
  49. return {
  50. tableData: {
  51. column: [{
  52. name: "",
  53. field: "index",
  54. is_num: false,
  55. is_light: false,
  56. },
  57. {
  58. name: "值际",
  59. width:"200px",
  60. field: "dutyname",
  61. is_num: false,
  62. is_light: false,
  63. },
  64. {
  65. name: "理论发电量",
  66. field: "theoreticalgeneratity",
  67. is_num: false,
  68. is_light: false,
  69. },
  70. {
  71. name: "实际发电量",
  72. field: "generatity",
  73. is_num: false,
  74. is_light: false,
  75. },
  76. {
  77. name: "故障损失",
  78. field: "faultloss",
  79. is_num: false,
  80. is_light: false,
  81. },
  82. {
  83. name: "维护损失",
  84. field: "mainloss",
  85. is_num: false,
  86. is_light: false,
  87. },
  88. {
  89. name: "性能损失",
  90. field: "performanceloss",
  91. is_num: false,
  92. is_light: false,
  93. },
  94. {
  95. name: "限电损失",
  96. field: "rationingloss",
  97. is_num: false,
  98. is_light: false,
  99. },
  100. {
  101. name: "受累损失",
  102. field: "involvesloss",
  103. is_num: false,
  104. is_light: false,
  105. }
  106. ],
  107. data: []
  108. },
  109. value4: "",
  110. value5: "",
  111. };
  112. },
  113. created() {
  114. this.value4 = this.getTime(1);
  115. this.value5 = this.getTime(2);
  116. this.AjaxCommon();
  117. },
  118. methods: {
  119. BeginChange(val) {
  120. this.value4 = val;
  121. this.AjaxCommon();
  122. },
  123. EndChange(val) {
  124. this.value5 = val;
  125. this.AjaxCommon();
  126. },
  127. getTime(val) { //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
  128. var date = new Date();
  129. var year = date.getFullYear(),
  130. month = date.getMonth() + 1,
  131. day = date.getDate();
  132. month >= 1 && month <= 9 ? (month = '0' + month) : '';
  133. day >= 0 && day <= 9 ? (day = '0' + day) : '';
  134. var begin = year + '-' + month + '-01';
  135. var end = year + '-' + month + '-' + day;
  136. if (val == 1) {
  137. return begin;
  138. } else if (val == 2) {
  139. return end;
  140. }
  141. },
  142. AjaxCommon() {
  143. var that = this;
  144. that.API.requestData({
  145. method: "GET",
  146. baseURL : "http://10.155.32.4:9001/",
  147. subUrl: "benchmarking/zjwxssl",
  148. data: {
  149. beginDate: that.value4,
  150. endDate: that.value5,
  151. },
  152. success(res) {
  153. var data = [];
  154. res.data.forEach((item, index) => {
  155. data.push({
  156. index: index + 1,
  157. dutyname: item.dutyname,
  158. theoreticalgeneratity: item.theoreticalgeneratity,
  159. generatity: item.generatity,
  160. faultloss: item.faultloss,
  161. mainloss: item.mainloss,
  162. performanceloss: item.performanceloss,
  163. rationingloss: item.rationingloss,
  164. involvesloss: item.involvesloss,
  165. is_light: false
  166. })
  167. })
  168. that.tableData.data = data;
  169. }
  170. });
  171. },
  172. }
  173. };
  174. </script>
  175. <style lang="less">
  176. .decision-page-4 {
  177. .com-panel {
  178. .panel-title {
  179. color: @gray-l;
  180. }
  181. .tools {
  182. display: flex;
  183. .tool-block {
  184. display: flex;
  185. align-items: center;
  186. margin-left: 0.741vh;
  187. .legend {
  188. flex: auto;
  189. width: 0.741vh;
  190. height: 0.741vh;
  191. margin-right: 0.741vh;
  192. &.long {
  193. width: 2.963vh;
  194. height: 0.37vh;
  195. }
  196. }
  197. .legend-text {
  198. color: @gray-l;
  199. font-size: @fontsize-s;
  200. }
  201. }
  202. }
  203. }
  204. .project-table {
  205. overflow: auto;
  206. height:90vh;
  207. tbody {
  208. // height: 100vh;
  209. }
  210. th,
  211. td {
  212. color: #b2bdc0;
  213. &:nth-child(1) {
  214. width: 50px;
  215. }
  216. &:nth-child(2) {
  217. width: 50px;
  218. }
  219. }
  220. }
  221. }
  222. </style>