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 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='100%' :key="time">
  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. console.log(411,this.time,this.date);
  104. this.viewSnapshots = true;
  105. },
  106. formatterStr2(str) {
  107. if (str) {
  108. return str.substring(0, 2) + ':' + str.substring(2, 4)
  109. }
  110. },
  111. queryFlow(ids) {
  112. let postParams = {
  113. criteria: {
  114. id: ids
  115. }
  116. }
  117. queryWorkflow({ postParams }).then(res => {
  118. this.titles = res.content
  119. })
  120. },
  121. getAppealId() {
  122. this.cardList.forEach(el => {
  123. if (!el.recommend.isExecuted) {
  124. this.ids.push(el.recommend.appealId)
  125. }
  126. })
  127. this.queryFlow(this.ids)
  128. }
  129. },
  130. mounted() {
  131. this.getAppealId()
  132. },
  133. watch: {
  134. cardList: {
  135. handler(n){
  136. this.cardList=n;
  137. this.getAppealId()
  138. },
  139. deep:true
  140. },
  141. date(n){
  142. this.date=n;
  143. }
  144. }
  145. }
  146. </script>
  147. <style lang="scss" scoped>
  148. // 执行率
  149. .count-card-box {
  150. display: flex;
  151. flex-wrap: wrap;
  152. .count-card {
  153. width: 530px;
  154. // min-width: 436px;
  155. // max-width: 510px;
  156. margin-right: 6px;
  157. margin-top: 16px;
  158. padding: 16px 20px;
  159. background: rgba(255, 255, 255, 1);
  160. box-shadow: 0px 4px 12px -2px rgba(31, 36, 41, 0.1);
  161. border-radius: 4px;
  162. border: 1px solid rgba(228, 230, 231, 1);
  163. .card-div1,
  164. .card-div2,
  165. .card-div3,
  166. .card-div4,
  167. .card-div5 {
  168. display: flex;
  169. justify-content: space-between;
  170. align-items: center;
  171. // width: 480px;
  172. }
  173. .card-div1 {
  174. height: 22px;
  175. font-size: 16px;
  176. font-family: PingFangSC-Regular, PingFang SC;
  177. font-weight: 400;
  178. color: rgba(31, 36, 41, 1);
  179. line-height: 22px;
  180. margin-bottom: 14px;
  181. }
  182. .card-div2,
  183. .card-div3 {
  184. height: 40px;
  185. background: rgba(245, 246, 247, 1);
  186. border-radius: 1px;
  187. padding-left: 16px;
  188. padding-right: 34px;
  189. span:nth-of-type(1) {
  190. height: 19px;
  191. font-size: 14px;
  192. color: rgba(31, 36, 41, 1);
  193. line-height: 19px;
  194. margin-right: 36px;
  195. }
  196. span:nth-of-type(2) {
  197. height: 18px;
  198. font-size: 12px;
  199. color: rgba(141, 147, 153, 1);
  200. line-height: 22px;
  201. margin-right: 8px;
  202. }
  203. span:nth-of-type(3) {
  204. height: 19px;
  205. font-size: 14px;
  206. color: rgba(31, 36, 41, 1);
  207. line-height: 19px;
  208. margin-right: 36px;
  209. }
  210. span:nth-of-type(4) {
  211. height: 18px;
  212. font-size: 12px;
  213. color: rgba(141, 147, 153, 1);
  214. line-height: 22px;
  215. margin-right: 8px;
  216. }
  217. span:nth-of-type(5) {
  218. height: 21px;
  219. font-size: 16px;
  220. color: rgba(31, 36, 41, 1);
  221. line-height: 21px;
  222. }
  223. }
  224. .card-div2 {
  225. margin-bottom: 4px;
  226. }
  227. .card-div3 {
  228. margin-bottom: 16px;
  229. }
  230. .card-div4 {
  231. // height: 20px;
  232. font-size: 14px;
  233. font-family: PingFangSC-Regular, PingFang SC;
  234. font-weight: 400;
  235. color: rgba(100, 108, 115, 1);
  236. line-height: 22px;
  237. margin-bottom: 26px;
  238. }
  239. .recommend-b {
  240. width: 50px;
  241. display: inline-block;
  242. text-align: center;
  243. }
  244. .card-div5 {
  245. span:nth-of-type(1) {
  246. justify-content: flex-start;
  247. img {
  248. width: 14px;
  249. height: 14px;
  250. margin-right: 4px;
  251. vertical-align: middle;
  252. }
  253. padding: 0 12px;
  254. display: flex;
  255. align-items: center;
  256. height: 22px;
  257. line-height: 22px;
  258. border-radius: 12px;
  259. font-size: 14px;
  260. font-family: MicrosoftYaHeiSemibold;
  261. }
  262. span:last-child {
  263. cursor: pointer;
  264. height: 22px;
  265. font-size: 14px;
  266. color: rgba(31, 35, 41, 1);
  267. line-height: 22px;
  268. background: rgba(255, 255, 255, 1);
  269. border-radius: 4px;
  270. border: 1px solid rgba(195, 199, 203, 1);
  271. padding: 0 12px;
  272. }
  273. }
  274. .card-div6 {
  275. color: rgba(245, 78, 69, 1);
  276. background: rgba(253, 227, 226, 1);
  277. }
  278. .card-div7 {
  279. color: rgba(52, 199, 36, 1);
  280. background: rgba(217, 245, 214, 1);
  281. }
  282. .card-div8 {
  283. border-radius: 12px;
  284. color: rgba(0, 145, 255, 1);
  285. background: rgba(225, 242, 255, 1);
  286. }
  287. }
  288. }
  289. .no-data {
  290. font-size: 14px;
  291. font-family: MicrosoftYaHei;
  292. color: rgba(100, 108, 115, 1);
  293. height: 100%;
  294. justify-content: center;
  295. align-items: center;
  296. display: flex;
  297. }
  298. </style>
  299. <style lang="scss">
  300. .view-dialog {
  301. .el-dialog__header {
  302. padding: 16px 28px 0 32px;
  303. .el-dialog__title {
  304. height: 24px;
  305. font-size: 16px;
  306. font-family: PingFangSC-Medium, PingFang SC;
  307. font-weight: 500;
  308. color: rgba(31, 36, 41, 1);
  309. line-height: 24px;
  310. }
  311. }
  312. .el-dialog__body {
  313. padding-top: 0;
  314. }
  315. }
  316. .el-dialog{
  317. margin: 0px !important;
  318. width: 100%;
  319. }
  320. </style>