evCard.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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;'>{{shutDown(item.recommend.chillerNumSetL,true,null)}}</b>
  12. <b
  13. style='width:50px;display: inline-block;text-align: center;'
  14. >{{shutDown(item.recommend.chillerNumSetS,true,null)}}</b>小
  15. </span>
  16. <span>冷机出水温度</span>
  17. <span>
  18. <b style='width:50px;display: inline-block;text-align: center;'>{{shutDown(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. >{{shutDown(item.real.chillerNumSetLOrg,true,null)}}</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. >{{shutDown(item.real.chillerNumSetSOrg,true,null)}}</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. >{{shutDown(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. import { shutDown } from '@/utils/query.js'
  84. export default {
  85. data() {
  86. return {
  87. viewSnapshots: false,
  88. ids: [],
  89. titles: [],
  90. time: '',
  91. shutDown: shutDown
  92. }
  93. },
  94. props: ['cardList', 'date'],
  95. components: {
  96. EvSnapshotsDialog
  97. },
  98. methods: {
  99. lookQuickData(item) {
  100. console.log(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. crireria: {
  112. id: ids
  113. }
  114. }
  115. queryWorkflow({ postParams }).then(res => {
  116. this.titles = res.content
  117. })
  118. },
  119. getAppealId() {
  120. this.cardList.forEach(el => {
  121. if (!el.recommend.isExecuted) {
  122. console.log(el)
  123. this.ids.push(el.recommend.appealId)
  124. }
  125. console.log(this.ids)
  126. })
  127. this.queryFlow(this.ids)
  128. }
  129. },
  130. mounted() {
  131. this.getAppealId()
  132. }
  133. }
  134. </script>
  135. <style lang="scss" scoped>
  136. // 执行率
  137. .count-card-box {
  138. display: flex;
  139. flex-wrap: wrap;
  140. .count-card {
  141. min-width: 436px;
  142. margin-right: 6px;
  143. margin-top: 16px;
  144. padding: 16px 20px;
  145. background: rgba(255, 255, 255, 1);
  146. box-shadow: 0px 4px 12px -2px rgba(31, 36, 41, 0.1);
  147. border-radius: 4px;
  148. border: 1px solid rgba(228, 230, 231, 1);
  149. .card-div1,
  150. .card-div2,
  151. .card-div3,
  152. .card-div4,
  153. .card-div5 {
  154. display: flex;
  155. justify-content: space-between;
  156. align-items: center;
  157. }
  158. .card-div1 {
  159. height: 22px;
  160. font-size: 16px;
  161. font-family: PingFangSC-Regular, PingFang SC;
  162. font-weight: 400;
  163. color: rgba(31, 36, 41, 1);
  164. line-height: 22px;
  165. margin-bottom: 14px;
  166. }
  167. .card-div2,
  168. .card-div3 {
  169. height: 40px;
  170. background: rgba(245, 246, 247, 1);
  171. border-radius: 1px;
  172. padding-left: 16px;
  173. padding-right: 34px;
  174. span:nth-of-type(1) {
  175. height: 19px;
  176. font-size: 14px;
  177. color: rgba(31, 36, 41, 1);
  178. line-height: 19px;
  179. margin-right: 36px;
  180. }
  181. span:nth-of-type(2) {
  182. height: 18px;
  183. font-size: 12px;
  184. color: rgba(141, 147, 153, 1);
  185. line-height: 22px;
  186. margin-right: 8px;
  187. }
  188. span:nth-of-type(3) {
  189. height: 19px;
  190. font-size: 14px;
  191. color: rgba(31, 36, 41, 1);
  192. line-height: 19px;
  193. margin-right: 36px;
  194. }
  195. span:nth-of-type(4) {
  196. height: 18px;
  197. font-size: 12px;
  198. color: rgba(141, 147, 153, 1);
  199. line-height: 22px;
  200. margin-right: 8px;
  201. }
  202. span:nth-of-type(5) {
  203. height: 21px;
  204. font-size: 16px;
  205. color: rgba(31, 36, 41, 1);
  206. line-height: 21px;
  207. }
  208. }
  209. .card-div2 {
  210. margin-bottom: 4px;
  211. }
  212. .card-div3 {
  213. margin-bottom: 16px;
  214. }
  215. .card-div4 {
  216. height: 20px;
  217. font-size: 14px;
  218. font-family: PingFangSC-Regular, PingFang SC;
  219. font-weight: 400;
  220. color: rgba(100, 108, 115, 1);
  221. line-height: 20px;
  222. margin-bottom: 26px;
  223. }
  224. .card-div5 {
  225. span:nth-of-type(1) {
  226. justify-content: flex-start;
  227. img {
  228. width: 14px;
  229. height: 14px;
  230. margin-right: 4px;
  231. vertical-align: middle;
  232. }
  233. padding: 0 12px;
  234. display: flex;
  235. align-items: center;
  236. height: 22px;
  237. border-radius: 12px;
  238. font-size: 14px;
  239. font-family: MicrosoftYaHeiSemibold;
  240. }
  241. span:last-child {
  242. cursor: pointer;
  243. height: 22px;
  244. font-size: 14px;
  245. color: rgba(31, 35, 41, 1);
  246. line-height: 22px;
  247. background: rgba(255, 255, 255, 1);
  248. border-radius: 4px;
  249. border: 1px solid rgba(195, 199, 203, 1);
  250. padding: 0 12px;
  251. }
  252. }
  253. .card-div6 {
  254. color: rgba(245, 78, 69, 1);
  255. background: rgba(253, 227, 226, 1);
  256. }
  257. .card-div7 {
  258. color: rgba(52, 199, 36, 1);
  259. background: rgba(217, 245, 214, 1);
  260. }
  261. .card-div8 {
  262. border-radius: 12px;
  263. color: rgba(0, 145, 255, 1);
  264. background: rgba(225, 242, 255, 1);
  265. }
  266. .red {
  267. color: rgba(245, 78, 69, 1);
  268. }
  269. }
  270. }
  271. </style>
  272. <style lang="scss">
  273. .view-dialog {
  274. .el-dialog__header {
  275. padding: 16px 28px 0 32px;
  276. .el-dialog__title {
  277. height: 24px;
  278. font-size: 16px;
  279. font-family: PingFangSC-Medium, PingFang SC;
  280. font-weight: 500;
  281. color: rgba(31, 36, 41, 1);
  282. line-height: 24px;
  283. }
  284. }
  285. .el-dialog__body {
  286. padding-top: 0;
  287. }
  288. }
  289. </style>