evCard.vue 11 KB

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