Decision4Czzl.vue 8.6 KB

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