evCard.vue 11 KB

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