index.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <div>
  3. <Head :headText='headText'></Head>
  4. <div class='nav-right'>
  5. <img class='nav-icon' v-if='chillerIsNotExecutedCount!=undefined' src='@/assets/shape.png' alt />
  6. <span class='nav-text1' v-if='chillerIsNotExecutedCount!=undefined'>今日已收到 {{chillerCount}} 条策略,其中有 {{chillerIsNotExecutedCount}} 条未执行</span>
  7. <span class='nav-text' v-else>今天已收到 {{chillerCommand.chillerCount || 0}} 条策略</span>
  8. <span class='nav-look MicrYaHei' @click='lookSnapshot' v-if='parseInt(chillerCommand.chillerCount)||parseInt(chillerCount )> 0'>查看</span>
  9. </div>
  10. <div class='strategyContainer'>
  11. <div class='strate-left'>
  12. <div class='strate-left-1'>今天营业时间</div>
  13. <div
  14. class='strate-left-2'
  15. >{{chillerOrg.openTime?( chillerOrg.openTime.slice(0,2)+':'+chillerOrg.openTime.slice(2,4)):"--"}} - {{chillerOrg.endTime?(chillerOrg.endTime.slice(0,2)+':'+chillerOrg.endTime.slice(2,4)):"--"}}</div>
  16. <div class='strate-left-1'>当前运行模式</div>
  17. <div class='strate-left-2'>{{chillerOrg.model || '--'}}</div>
  18. <div class='strate-left-box'>
  19. <div class='strate-left-info-1'>通风策略</div>
  20. <div
  21. class='strate-left-info'
  22. >开启时间:{{chillerOrg.freshAirEqOpenTime?(chillerOrg.freshAirEqOpenTime.slice(0,2)+":"+chillerOrg.freshAirEqOpenTime.slice(2,4)):"--"}} - {{chillerOrg.freshAirEqCloseTime?(chillerOrg.freshAirEqCloseTime.slice(0,2)+":"+chillerOrg.freshAirEqCloseTime.slice(2,4)):"--"}}</div>
  23. <div class='strate-left-info'>新风机组:{{chillerOrg.freshAirHandlingUnit}}</div>
  24. <div class='strate-left-info'>组合式空调机组:{{chillerOrg.airHandlingUnit}}</div>
  25. </div>
  26. </div>
  27. <div class='starte-right'>
  28. <p class='strate-right-title'>当前状态</p>
  29. <water-unit :data='chillerOrg ' :type='1'></water-unit>
  30. <animation-box
  31. v-if='Object.keys(chillerCommand).length>=0||chillerHourList.length>=0'
  32. :data='chillerOrg'
  33. :chillerHourList='chillerHourList'
  34. :chillerCommandQ='chillerCommand'
  35. ></animation-box>
  36. </div>
  37. </div>
  38. <el-dialog title='提示' :visible.sync='showTodayStrategy' width='1260px'>
  39. <today-strategy v-if='tableData.length>0 && idArr.length>0' :data='tableData' :idArr='idArr'></today-strategy>
  40. </el-dialog>
  41. </div>
  42. </template>
  43. <script>
  44. import Head from '../main/index'
  45. import animationBox from './animationBox'
  46. import waterUnit from './waterUnit'
  47. import TodayStrategy from '@/components/todayStrategy.vue'
  48. import { queryCommand, getCommand } from '@/api/strategy/strategy.js'
  49. export default {
  50. data() {
  51. return {
  52. headText: '当日运行策略',
  53. navText: true,
  54. showTodayStrategy: false,
  55. tableData: [],
  56. chillerCommand: {},
  57. chillerCount: 0,
  58. chillerIsNotExecutedCount: 0,
  59. today: '',
  60. now: '',
  61. chillerOrg: {},
  62. chillerHourList: [],
  63. idArr: [],
  64. clearId:null,
  65. }
  66. },
  67. components: {
  68. Head,
  69. animationBox,
  70. waterUnit,
  71. TodayStrategy
  72. },
  73. methods: {
  74. lookSnapshot() {
  75. this.showTodayStrategy = true
  76. this.getData()
  77. },
  78. formatTime() {
  79. let year = new Date().getFullYear()
  80. let month = new Date().getMonth() + 1 >= 10 ? new Date().getMonth() + 1 : '0' + (new Date().getMonth() + 1)
  81. let date = new Date().getDate() >= 10 ? new Date().getDate() : '0' + new Date().getDate()
  82. return (this.today = year + '' + month + '' + date)
  83. },
  84. getChiller() {
  85. let params = {
  86. getParams: {}
  87. }
  88. this.chillerHourList = []
  89. this.chillerCommand = {}
  90. this.chillerOrg = {}
  91. queryCommand(params).then(res => {
  92. console.log(res)
  93. this.chillerCount = res.chillerCount || 0
  94. this.chillerIsNotExecutedCount = res.chillerIsNotExecutedCount ? res.chillerIsNotExecutedCount : 0
  95. this.chillerOrg = res.chillerOrg || {}
  96. this.chillerCommand = res.chillerCommand || {}
  97. this.chillerHourList = res.chillerHourList || []
  98. })
  99. },
  100. getData() {
  101. this.idArr = []
  102. let params = {
  103. postParams: {
  104. criteria: {
  105. projectId: this.$store.state.projectId,
  106. date: this.today,
  107. status: {
  108. $in: [2, 4]
  109. }
  110. }
  111. }
  112. }
  113. getCommand(params).then(res => {
  114. this.tableData = res.content ? res.content : []
  115. if (this.tableData.length > 0) {
  116. this.tableData.forEach(el => {
  117. this.idArr.push(el.appealId)
  118. })
  119. }
  120. })
  121. }
  122. },
  123. mounted() {
  124. this.formatTime()
  125. let vm = this
  126. this.clearId = setInterval(function(){
  127. vm.getChiller()
  128. },10000*60)
  129. this.getChiller()
  130. },
  131. destroyed(){
  132. window.clearInterval(thius.clearId)
  133. }
  134. }
  135. </script>
  136. <style lang="scss" scoped>
  137. .nav-right {
  138. height: 48px;
  139. position: fixed;
  140. right: 24px;
  141. top: 48px;
  142. z-index: 1;
  143. display: flex;
  144. align-items: center;
  145. .nav-text {
  146. height: 22px;
  147. font-size: 14px;
  148. font-family: PingFangSC-Regular, PingFang SC;
  149. font-weight: 400;
  150. color: rgba(31, 36, 41, 1);
  151. line-height: 20px;
  152. }
  153. .nav-text1 {
  154. margin: 0 4px;
  155. height: 20px;
  156. font-size: 14px;
  157. font-family: PingFangSC-Regular, PingFang SC;
  158. font-weight: 400;
  159. color: rgba(245, 78, 69, 1);
  160. line-height: 20px;
  161. }
  162. .nav-icon {
  163. width: 16px;
  164. height: 14px;
  165. }
  166. .nav-look {
  167. height: 22px;
  168. font-size: 14px;
  169. color: rgba(0, 145, 255, 1);
  170. line-height: 22px;
  171. margin: 0 12px;
  172. cursor: pointer;
  173. }
  174. }
  175. .strategyContainer {
  176. background: #fff;
  177. display: flex;
  178. .strate-left {
  179. min-width: 224px;
  180. background: #fff;
  181. border-right: 1px solid #f7f9fa;
  182. margin-left: 16px;
  183. .strate-left-1 {
  184. margin-top: 24px;
  185. color: #646c73;
  186. font-size: 14px;
  187. }
  188. .strate-left-2 {
  189. margin-top: 8px;
  190. font-size: 20px;
  191. }
  192. .strate-left-box {
  193. width: 192px;
  194. height: 150px;
  195. border-radius: 6px;
  196. background: #e4e5e7;
  197. margin-top: 67px;
  198. .strate-left-info-1 {
  199. padding-top: 20px;
  200. padding-left: 20px;
  201. font-size: 16px;
  202. color: #1f2429;
  203. }
  204. .strate-left-info {
  205. padding-left: 20px;
  206. font-size: 14px;
  207. margin-top: 8px;
  208. color: #646c73;
  209. }
  210. }
  211. }
  212. .starte-right {
  213. margin-right: 30px;
  214. flex: 1;
  215. .starte-right-title {
  216. height: 74px;
  217. line-height: 74px;
  218. color: #1f2429;
  219. font-size: 22px;
  220. }
  221. }
  222. }
  223. </style>