index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <div>
  3. <Head :headText="headText"></Head>
  4. <div class="nav-right">
  5. <img class="nav-icon" v-if="navText" src="@/assets/shape.png" alt />
  6. <span class="nav-text1" v-if="navText">今日已收到 {{quickData.chillerCount || 0}} 条策略,其中有 {{quickData.hillerIsNotExecutedCount || 0}} 条未执行</span>
  7. <span class="nav-text" v-else>今天已收到 {{quickData.chillerCount || 0}} 条策略</span>
  8. <span class="nav-look MicrYaHei" @click="showTodayStrategy = true">查看</span>
  9. </div>
  10. <div class="strategyContainer">
  11. <div class="strate-left">
  12. <div class="strate-left-1">今天营业时间</div>
  13. <div class="strate-left-2">{{quickData.openTime || '--'}} - {{quickData.endTime || '--'}}</div>
  14. <div class="strate-left-1">当前运行模式</div>
  15. <div class="strate-left-2">{{quickData.model || '--'}}</div>
  16. <div class="strate-left-box">
  17. <div class="strate-left-info-1">通风策略</div>
  18. <div class="strate-left-info">开启时间:{{quickData.freshAirEqOpenTime || '--'}} - {{quickData.freshAirEqCloseTime || '--'}}</div>
  19. <div class="strate-left-info">新风机组:开启</div>
  20. <div class="strate-left-info">组合式空调机组:全新风</div>
  21. </div>
  22. </div>
  23. <div class="starte-right">
  24. <p class="strate-right-title">当前状态</p>
  25. <water-unit :data='quickData'></water-unit>
  26. <animation-box :data='quickData'></animation-box>
  27. </div>
  28. </div>
  29. <el-dialog title="提示" :visible.sync="showTodayStrategy" width="1260px">
  30. <today-strategy></today-strategy>
  31. </el-dialog>
  32. </div>
  33. </template>
  34. <script>
  35. import Head from "../main/index";
  36. import animationBox from "./animationBox";
  37. import waterUnit from "./waterUnit";
  38. import TodayStrategy from "@/components/todayStrategy.vue";
  39. import {queryCommand,getCommand} from '@/api/strategy/strategy.js'
  40. export default {
  41. data() {
  42. return {
  43. headText: "当日运行策略",
  44. navText: true,
  45. showTodayStrategy: false,
  46. data:{},
  47. quickData:{}
  48. };
  49. },
  50. components: {
  51. Head,
  52. animationBox,
  53. waterUnit,
  54. TodayStrategy
  55. },
  56. methods:{
  57. getQuickData(){
  58. let params = {
  59. postParams:{
  60. criteria:{
  61. projectId:"Pj4419000005",
  62. date:"20200219", //日期 yyyyMMdd
  63. time:"0015", //时间 H24mi (最近的一个15分钟时间点,例如现在是23点35分,应传2330)
  64. },
  65. withColumns: [
  66. chillerOrg,"chillerHourList"
  67. ]
  68. }
  69. }
  70. queryCommand(params).then(res=>{
  71. console.log(res)
  72. this.quickData = res.data.content?res.data.content[0]:{}
  73. })
  74. },
  75. getData(){
  76. let params = {
  77. postParams:{
  78. criteria:{
  79. projectId:"Pj4419000005",
  80. date:"202200219"
  81. }
  82. }
  83. }
  84. getCommand(params).then(res=>{
  85. console.log(res)
  86. this.data = res.data.content?res.data.content:{}
  87. })
  88. }
  89. },
  90. mounted(){
  91. let vm = this
  92. setInterval(function(){
  93. vm.getData()
  94. },1500)
  95. this.getQuickData()
  96. }
  97. };
  98. </script>
  99. <style lang="scss" scoped>
  100. .nav-right {
  101. height: 48px;
  102. position: fixed;
  103. right: 24px;
  104. top: 48px;
  105. z-index: 1;
  106. display: flex;
  107. align-items: center;
  108. .nav-text {
  109. height: 22px;
  110. font-size: 14px;
  111. font-family: PingFangSC-Regular, PingFang SC;
  112. font-weight: 400;
  113. color: rgba(31, 36, 41, 1);
  114. line-height: 20px;
  115. }
  116. .nav-text1 {
  117. margin: 0 4px;
  118. height: 20px;
  119. font-size: 14px;
  120. font-family: PingFangSC-Regular, PingFang SC;
  121. font-weight: 400;
  122. color: rgba(245, 78, 69, 1);
  123. line-height: 20px;
  124. }
  125. .nav-icon {
  126. width: 16px;
  127. height: 14px;
  128. }
  129. .nav-look {
  130. height: 22px;
  131. font-size: 14px;
  132. color: rgba(0, 145, 255, 1);
  133. line-height: 22px;
  134. margin: 0 12px;
  135. cursor: pointer;
  136. }
  137. }
  138. .strategyContainer {
  139. background: #fff;
  140. display: flex;
  141. .strate-left {
  142. min-width: 224px;
  143. background: #fff;
  144. border-right: 1px solid #f7f9fa;
  145. margin-left: 16px;
  146. .strate-left-1 {
  147. margin-top: 24px;
  148. color: #646c73;
  149. font-size: 14px;
  150. }
  151. .strate-left-2 {
  152. margin-top: 8px;
  153. font-size: 20px;
  154. }
  155. .strate-left-box {
  156. width: 192px;
  157. height: 150px;
  158. border-radius: 6px;
  159. background: #e4e5e7;
  160. margin-top: 67px;
  161. .strate-left-info-1 {
  162. padding-top: 20px;
  163. padding-left: 20px;
  164. font-size: 16px;
  165. color: #1f2429;
  166. }
  167. .strate-left-info {
  168. padding-left: 20px;
  169. font-size: 14px;
  170. margin-top: 8px;
  171. color: #646c73;
  172. }
  173. }
  174. }
  175. .starte-right {
  176. margin-right: 30px;
  177. flex: 1;
  178. .starte-right-title {
  179. height: 74px;
  180. line-height: 74px;
  181. color: #1f2429;
  182. font-size: 22px;
  183. }
  184. }
  185. }
  186. </style>