evCard.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <template>
  2. <div class='count-card-box'>
  3. <div class='count-card' v-for='(item,index) in cardList' :key='index'>
  4. <div class='card-div1' v-if='item.recommend.onTime'>执行时间:{{item.recommend?formatterStr2(item.recommend.onTime):'--'}}</div>
  5. <div class='card-div1' v-else-if='item.recommend.offTime'>执行时间:{{item.recommend?formatterStr2(item.recommend.offTime):'--'}}</div>
  6. <div class='card-div1' v-else>执行时间:{{item.recommend?formatterStr2(item.recommend.time):'--'}}</div>
  7. <div class='card-div2 MicrYaHei'>
  8. <span>策略建议</span>
  9. <span>冷机台数</span>
  10. <span>
  11. <b style='width:50px;display: inline-block;text-align: center;'>{{formatterRes(item.recommend.chillerNumSetL,true,0)}}</b>
  12. <b
  13. style='width:50px;display: inline-block;text-align: center;'
  14. >{{formatterRes(item.recommend.chillerNumSetS,true,0)}}</b>小
  15. </span>
  16. <span>冷机出水温度</span>
  17. <span>
  18. <b style='width:50px;display: inline-block;text-align: center;'>{{formatterRes(item.recommend.chillWaterOutTempSet,false,1)}}</b> °C
  19. </span>
  20. </div>
  21. <div class='card-div3 MicrYaHei'>
  22. <span>实际执行</span>
  23. <span>冷机台数</span>
  24. <span>
  25. <b
  26. v-if='item.real'
  27. style='width:50px;display: inline-block;text-align: center;'
  28. :class='item.recommend.chillerNumSetL==item.real.chillerNumSetLOrg?"":"red"'
  29. >{{formatterRes(item.real.chillerNumSetLOrg,true,0)}}</b>大
  30. <b
  31. v-if='item.real'
  32. style='width:50px;display: inline-block;text-align: center;'
  33. :class='item.recommend.chillerNumSetS==item.real.chillerNumSetSOrg?"":"red"'
  34. >{{formatterRes(item.real.chillerNumSetSOrg,true,0)}}</b> 小
  35. </span>
  36. <span>冷机出水温度</span>
  37. <span>
  38. <b
  39. v-if='item.real'
  40. style='width:50px;display: inline-block;text-align: center;'
  41. :class='item.recommend.chillWaterOutTempSet==item.real.chillWaterOutTempSetOrg?"":"red"'
  42. >{{formatterRes(item.real.chillWaterOutTempSetOrg,false,1)}}</b>°C
  43. </span>
  44. </div>
  45. <div class='card-div4'>备注:{{item.h||'--'}}</div>
  46. <div class='card-div5'>
  47. <span class='card-div7' v-if='item.recommend.isExecuted'>
  48. <img src='../../assets/completed.png' alt />
  49. 已按策略执行
  50. </span>
  51. <template v-else-if='item.recommend.appealId' v-for='(item1,index) in titles'>
  52. <template v-if='item1.id==item.recommend.appealId'>
  53. <span class='card-div8' v-if='item1.status==302' :key='"l"+index'>
  54. <img src='../../assets/processing.png' alt />
  55. 申诉中
  56. </span>
  57. <span class='card-div6' v-else :key='"l"+index'>
  58. <img src='../../assets/error.png' alt />
  59. 未按策略执行
  60. </span>
  61. </template>
  62. </template>
  63. <template v-else>
  64. <span class='card-div6' :key='"l"+index'>
  65. <img src='../../assets/error.png' alt />
  66. 未按策略执行
  67. </span>
  68. </template>
  69. <span></span>
  70. <span class='MicrYaHei' @click='lookQuickData(item)' style>查看快照</span>
  71. </div>
  72. </div>
  73. <div class='view-dialog'>
  74. <el-dialog title='策略推出时状况' :visible.sync='viewSnapshots' :close-on-click-modal='false' width='1260px'>
  75. <ev-snapshots-dialog v-if='date && time' :appealsDate='date' :time='time'></ev-snapshots-dialog>
  76. </el-dialog>
  77. </div>
  78. </div>
  79. </template>
  80. <script>
  81. import EvSnapshotsDialog from './evSnapshotsDialog'
  82. import { queryWorkflow } from '@/api/appeal/appeal.js'
  83. export default {
  84. data() {
  85. return {
  86. viewSnapshots: false,
  87. ids: [],
  88. titles: [],
  89. time: ''
  90. }
  91. },
  92. props: ['cardList', 'date'],
  93. components: {
  94. EvSnapshotsDialog
  95. },
  96. methods: {
  97. lookQuickData(item) {
  98. this.time = item.recommend.time
  99. this.viewSnapshots = true
  100. },
  101. formatterStr2(str) {
  102. if (str) {
  103. return str.substring(0, 2) + ':' + str.substring(2, 4)
  104. }
  105. },
  106. queryFlow(ids) {
  107. let postParams = {
  108. crireria: {
  109. id: ids
  110. }
  111. }
  112. queryWorkflow({ postParams }).then(res => {
  113. this.titles = res.content
  114. })
  115. },
  116. formatterRes(res, type, num) {
  117. if (res == '-9999') {
  118. return 'x'
  119. } else if (res == '-9998') {
  120. if (type) {
  121. return 0
  122. } else {
  123. return '--'
  124. }
  125. } else {
  126. if (res != undefined) {
  127. res = res.toFixed(num)
  128. } else {
  129. return '--'
  130. }
  131. return res
  132. }
  133. },
  134. getAppealId() {
  135. this.cardList.forEach(el => {
  136. if (!el.recommend.isExecuted) {
  137. this.ids.push(el.recommend.appealId)
  138. }
  139. })
  140. this.queryFlow(this.ids)
  141. }
  142. },
  143. mounted() {
  144. this.getAppealId()
  145. }
  146. }
  147. </script>
  148. <style lang="scss" scoped>
  149. // 执行率
  150. .count-card-box {
  151. display: flex;
  152. flex-wrap: wrap;
  153. .count-card {
  154. min-width: 436px;
  155. margin-right: 6px;
  156. margin-top: 16px;
  157. padding: 16px 20px;
  158. background: rgba(255, 255, 255, 1);
  159. box-shadow: 0px 4px 12px -2px rgba(31, 36, 41, 0.1);
  160. border-radius: 4px;
  161. border: 1px solid rgba(228, 230, 231, 1);
  162. .card-div1,
  163. .card-div2,
  164. .card-div3,
  165. .card-div4,
  166. .card-div5 {
  167. display: flex;
  168. justify-content: space-between;
  169. align-items: center;
  170. }
  171. .card-div1 {
  172. height: 22px;
  173. font-size: 16px;
  174. font-family: PingFangSC-Regular, PingFang SC;
  175. font-weight: 400;
  176. color: rgba(31, 36, 41, 1);
  177. line-height: 22px;
  178. margin-bottom: 14px;
  179. }
  180. .card-div2,
  181. .card-div3 {
  182. height: 40px;
  183. background: rgba(245, 246, 247, 1);
  184. border-radius: 1px;
  185. padding-left: 16px;
  186. padding-right: 34px;
  187. span:nth-of-type(1) {
  188. height: 19px;
  189. font-size: 14px;
  190. color: rgba(31, 36, 41, 1);
  191. line-height: 19px;
  192. margin-right: 36px;
  193. }
  194. span:nth-of-type(2) {
  195. height: 18px;
  196. font-size: 12px;
  197. color: rgba(141, 147, 153, 1);
  198. line-height: 22px;
  199. margin-right: 8px;
  200. }
  201. span:nth-of-type(3) {
  202. height: 19px;
  203. font-size: 14px;
  204. color: rgba(31, 36, 41, 1);
  205. line-height: 19px;
  206. margin-right: 36px;
  207. }
  208. span:nth-of-type(4) {
  209. height: 18px;
  210. font-size: 12px;
  211. color: rgba(141, 147, 153, 1);
  212. line-height: 22px;
  213. margin-right: 8px;
  214. }
  215. span:nth-of-type(5) {
  216. height: 21px;
  217. font-size: 16px;
  218. color: rgba(31, 36, 41, 1);
  219. line-height: 21px;
  220. }
  221. }
  222. .card-div2 {
  223. margin-bottom: 4px;
  224. }
  225. .card-div3 {
  226. margin-bottom: 16px;
  227. }
  228. .card-div4 {
  229. height: 20px;
  230. font-size: 14px;
  231. font-family: PingFangSC-Regular, PingFang SC;
  232. font-weight: 400;
  233. color: rgba(100, 108, 115, 1);
  234. line-height: 20px;
  235. margin-bottom: 26px;
  236. }
  237. .card-div5 {
  238. span:nth-of-type(1) {
  239. justify-content: flex-start;
  240. img {
  241. width: 14px;
  242. height: 14px;
  243. margin-right: 4px;
  244. vertical-align: middle;
  245. }
  246. padding: 0 12px;
  247. display: flex;
  248. align-items: center;
  249. height: 22px;
  250. border-radius: 12px;
  251. font-size: 14px;
  252. font-family: MicrosoftYaHeiSemibold;
  253. }
  254. span:last-child {
  255. cursor: pointer;
  256. height: 22px;
  257. font-size: 14px;
  258. color: rgba(31, 35, 41, 1);
  259. line-height: 22px;
  260. background: rgba(255, 255, 255, 1);
  261. border-radius: 4px;
  262. border: 1px solid rgba(195, 199, 203, 1);
  263. padding: 0 12px;
  264. }
  265. }
  266. .card-div6 {
  267. color: rgba(245, 78, 69, 1);
  268. background: rgba(253, 227, 226, 1);
  269. }
  270. .card-div7 {
  271. color: rgba(52, 199, 36, 1);
  272. background: rgba(217, 245, 214, 1);
  273. }
  274. .card-div8 {
  275. border-radius: 12px;
  276. color: rgba(0, 145, 255, 1);
  277. background: rgba(225, 242, 255, 1);
  278. }
  279. .red {
  280. color: rgba(245, 78, 69, 1);
  281. }
  282. }
  283. }
  284. </style>
  285. <style lang="scss">
  286. .view-dialog {
  287. .el-dialog__header {
  288. padding: 16px 28px 0 32px;
  289. .el-dialog__title {
  290. height: 24px;
  291. font-size: 16px;
  292. font-family: PingFangSC-Medium, PingFang SC;
  293. font-weight: 500;
  294. color: rgba(31, 36, 41, 1);
  295. line-height: 24px;
  296. }
  297. }
  298. .el-dialog__body {
  299. padding-top: 0;
  300. }
  301. }
  302. </style>