Decision4Czzl.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  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. <el-dialog :title="'操作:' + tabsTit" v-model="dialogVisible" width="20%" top="10vh" custom-class="modal"
  33. :close-on-click-modal="false">
  34. <div class="health-day-info">
  35. <div class="body">
  36. <div class="left">
  37. <table class="table-form">
  38. <tr>
  39. <td class="white">风机</td>
  40. <td class="white">时间</td>
  41. </tr>
  42. <tr v-for="item in tabs">
  43. <td class="white">{{item.wtid}}</td>
  44. <td class="white">{{item.time.substr(0, 10)}}</td>
  45. </tr>
  46. </table>
  47. </div>
  48. </div>
  49. </div>
  50. </el-dialog>
  51. <!-- 点击哪个显示哪个的操作记录 -->
  52. </div>
  53. </template>
  54. <script>
  55. import SvgIcon from "../../components/coms/icon/svg-icon.vue";
  56. import Panel from "../../components/coms/panel/panel.vue";
  57. import Table from "../../components/coms/table/table.vue";
  58. import ToolbarPanel from "../../components/coms/panel/toolbar-panel.vue";
  59. export default {
  60. components: {
  61. Panel,
  62. Table,
  63. SvgIcon,
  64. ToolbarPanel
  65. },
  66. data() {
  67. let that = this;
  68. return {
  69. tableData: {
  70. column: [{
  71. name: "",
  72. field: "index",
  73. is_num: false,
  74. is_light: false,
  75. },
  76. {
  77. name: "值际",
  78. field: "nameOfDuty",
  79. is_num: false,
  80. is_light: false,
  81. width: "250px",
  82. },
  83. {
  84. name: "启动",
  85. field: "startCount",
  86. is_num: false,
  87. is_light: false,
  88. param: 1,
  89. click: function(event, data) {
  90. that.ajaxClick(data.nameOfDuty, this.param)
  91. }
  92. },
  93. {
  94. name: "停机",
  95. field: "stopCount",
  96. is_num: false,
  97. is_light: false,
  98. param: 2,
  99. click: function(event, data) {
  100. that.ajaxClick(data.nameOfDuty, this.param)
  101. }
  102. },
  103. {
  104. name: "复位",
  105. field: "resetCount",
  106. is_num: false,
  107. is_light: false,
  108. param: 3,
  109. click: function(event, data) {
  110. that.ajaxClick(data.nameOfDuty, this.param)
  111. }
  112. },
  113. {
  114. name: "维护",
  115. field: "maintainCount",
  116. is_num: false,
  117. is_light: false,
  118. param: 4,
  119. click: function(event, data) {
  120. that.ajaxClick(data.nameOfDuty, this.param)
  121. }
  122. },
  123. {
  124. name: "取消维护",
  125. field: "unmaintainCount",
  126. is_num: false,
  127. is_light: false,
  128. param: 5,
  129. click: function(event, data) {
  130. that.ajaxClick(data.nameOfDuty, this.param)
  131. }
  132. },
  133. {
  134. name: "挂牌检修",
  135. field: "gpmaintainCount",
  136. is_num: false,
  137. is_light: false,
  138. param: 6,
  139. click: function(event, data) {
  140. that.ajaxClick(data.nameOfDuty, this.param)
  141. }
  142. },
  143. {
  144. name: "故障维修",
  145. field: "gpfaultCount",
  146. is_num: false,
  147. is_light: false,
  148. param: 7,
  149. click: function(event, data) {
  150. that.ajaxClick(data.nameOfDuty, this.param)
  151. }
  152. }, {
  153. name: "场内受累检修",
  154. field: "gponsiteinvolvementMaintainCount",
  155. is_num: false,
  156. is_light: false,
  157. param: 8,
  158. click: function(event, data) {
  159. that.ajaxClick(data.nameOfDuty, this.param)
  160. }
  161. }, {
  162. name: "场内受累故障",
  163. field: "gponsiteinvolvementFaultCount",
  164. is_num: false,
  165. is_light: false,
  166. param: 9,
  167. click: function(event, data) {
  168. that.ajaxClick(data.nameOfDuty, this.param)
  169. }
  170. }, {
  171. name: "场外受累电网",
  172. field: "gpoffsiteaffectedgridCount",
  173. is_num: false,
  174. is_light: false,
  175. param: 10,
  176. click: function(event, data) {
  177. that.ajaxClick(data.nameOfDuty, this.param)
  178. }
  179. }, {
  180. name: "场外受累天气",
  181. field: "gpweatherOutsideCount",
  182. is_num: false,
  183. is_light: false,
  184. param: 11,
  185. click: function(event, data) {
  186. that.ajaxClick(data.nameOfDuty, this.param)
  187. }
  188. }, {
  189. name: "取消挂牌",
  190. field: "ungpCount",
  191. is_num: false,
  192. is_light: false,
  193. param: 12,
  194. click: function(event, data) {
  195. that.ajaxClick(data.nameOfDuty, this.param)
  196. }
  197. }
  198. ],
  199. data: []
  200. },
  201. value4: "",
  202. value5: "",
  203. dialogVisible: false,
  204. tabs: [],
  205. tabsTit: "",
  206. tabsArr: ['启动', '停机', '复位', '维护', '取消维护', '挂牌检修', '故障维修', '场内受累检修', '场内受累故障', '场外受累电网', '场外受累天气', '取消挂牌'],
  207. };
  208. },
  209. created() {
  210. this.value4 = this.getTime(1);
  211. this.value5 = this.getTime(2);
  212. this.AjaxCommon();
  213. },
  214. methods: {
  215. BeginChange(val) {
  216. this.value4 = val;
  217. this.AjaxCommon();
  218. },
  219. EndChange(val) {
  220. this.value5 = val;
  221. this.AjaxCommon();
  222. },
  223. getTime(val) { //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
  224. var date = new Date();
  225. var year = date.getFullYear(),
  226. month = date.getMonth() + 1,
  227. day = date.getDate();
  228. month >= 1 && month <= 9 ? (month = '0' + month) : '';
  229. day >= 0 && day <= 9 ? (day = '0' + day) : '';
  230. var begin = year + '-' + month + '-01';
  231. var end = year + '-' + month + '-' + day;
  232. if (val == 1) {
  233. return begin;
  234. } else if (val == 2) {
  235. return end;
  236. }
  237. },
  238. AjaxCommon() {
  239. var that = this;
  240. that.API.requestData({
  241. method: "GET",
  242. baseURL: "http://10.155.32.4:9001/",
  243. subUrl: "benchmarking/zjlist",
  244. data: {
  245. beginDate: that.value4,
  246. endDate: that.value5,
  247. },
  248. success(res) {
  249. var data = [];
  250. res.data.forEach((item, index) => {
  251. data.push({
  252. index: index + 1,
  253. nameOfDuty: item.nameOfDuty,
  254. startCount: item.startCount,
  255. stopCount: item.stopCount,
  256. resetCount: item.resetCount,
  257. maintainCount: item.maintainCount,
  258. unmaintainCount: item.unmaintainCount,
  259. gpmaintainCount: item.gpmaintainCount,
  260. gpfaultCount: item.gpfaultCount,
  261. gponsiteinvolvementMaintainCount: item.gponsiteinvolvementMaintainCount,
  262. gponsiteinvolvementFaultCount: item.gponsiteinvolvementFaultCount,
  263. gpoffsiteaffectedgridCount: item.gpoffsiteaffectedgridCount,
  264. gpweatherOutsideCount: item.gpweatherOutsideCount,
  265. ungpCount: item.ungpCount,
  266. is_light: false
  267. })
  268. })
  269. that.tableData.data = data;
  270. }
  271. });
  272. },
  273. ajaxClick(dutyname, direct) {
  274. var that = this;
  275. that.tabsTit = that.tabsArr[direct - 1];
  276. that.API.requestData({
  277. method: "GET",
  278. baseURL: "http://10.155.32.4:9001/",
  279. subUrl: "benchmarking/zjdrill",
  280. data: {
  281. beginDate: that.value4,
  282. endDate: that.value5,
  283. dutyname: dutyname,
  284. direct: direct,
  285. },
  286. success(res) {
  287. if(res.data.length){
  288. that.tabs = res.data;
  289. }else{
  290. that.tabs=[{wtid:'暂无数据',time:'暂无数据'}];
  291. }
  292. that.dialogVisible = true;
  293. }
  294. });
  295. }
  296. }
  297. };
  298. </script>
  299. <style lang="less">
  300. .decision-page-4 {
  301. .com-panel {
  302. .panel-title {
  303. color: @gray-l;
  304. }
  305. .tools {
  306. display: flex;
  307. .tool-block {
  308. display: flex;
  309. align-items: center;
  310. margin-left: 0.741vh;
  311. .legend {
  312. flex: auto;
  313. width: 0.741vh;
  314. height: 0.741vh;
  315. margin-right: 0.741vh;
  316. &.long {
  317. width: 2.963vh;
  318. height: 0.37vh;
  319. }
  320. }
  321. .legend-text {
  322. color: @gray-l;
  323. font-size: @fontsize-s;
  324. }
  325. }
  326. }
  327. }
  328. .project-table {
  329. overflow: auto;
  330. height: 90vh;
  331. tbody {
  332. // height: 100vh;
  333. }
  334. th,
  335. td {
  336. color: #b2bdc0;
  337. &:nth-child(1) {
  338. width: 50px;
  339. }
  340. &:nth-child(2) {
  341. width: 50px;
  342. }
  343. }
  344. }
  345. .action {
  346. text-decoration: underline;
  347. color: @green;
  348. cursor: pointer;
  349. }
  350. .health-day-info .left {
  351. max-height: 75vh;
  352. overflow: auto;
  353. }
  354. }
  355. </style>