animationBox.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. <template>
  2. <div class="an-content">
  3. <div class="snapshotss-center2">
  4. <div class="snapshotss-cont2-box1 MicrYaHei">
  5. <span>数据传输情况</span>
  6. <span :class="data.isExecuted==1?'span1':'span2'">
  7. 能耗
  8. <img v-if="data.energyErrorFlag==1" src="../../assets/finish.png" alt />
  9. <img v-else src="../../assets/wrong.png" alt />
  10. </span>
  11. <span :class="data.isExecuted==1?'span1':'span2'">
  12. 环境
  13. <img v-if="data.environmentErrorFlag==1" src="../../assets/finish.png" alt />
  14. <img v-else src="../../assets/wrong.png" alt />
  15. </span>
  16. <span :class="data.isExecuted==1?'span1':'span2'">
  17. BA
  18. <img v-if="data.baErrorFalg==1" src="../../assets/finish.png" alt />
  19. <img v-else src="../../assets/wrong.png" alt />
  20. </span>
  21. </div>
  22. <div class="snapshotss-cont2-box2 MicrYaHei">
  23. <span>实际冷量</span>
  24. <span>{{data.nowPlantLoad || 0}} KW</span>
  25. <span>未来1小时预测冷量</span>
  26. <span>{{data.predictedLoad1h || 0}} KW</span>
  27. </div>
  28. </div>
  29. <div class="an-bottom">
  30. <div class="leftL">
  31. <div class="leftLengend">
  32. <i class="outIcon"></i> 室外温度
  33. <i class="innerIcon"></i> 室内平均温度
  34. <i class="innerMax"></i> 室内最高温度
  35. </div>
  36. <div id="leftLine" style="width:100%;height:350px;margin-right:;24px;"></div>
  37. </div>
  38. <div class="rightL">
  39. <div class="rightLengend">
  40. <i class="reactCool"></i> 实际供冷量
  41. <i class="preCool"></i> 预测冷量
  42. </div>
  43. <div id="rightLine" style="width:100%;height:350px;"></div>
  44. </div>
  45. </div>
  46. <div class="side-r" v-if="data.isExecuted!=0">
  47. <div v-if="!showDraw" class="float-r" @click="showDraw = true">
  48. <img src="../../assets/open.png" alt />
  49. <p>当前策略</p>
  50. </div>
  51. </div>
  52. <bom-box v-if="Object.keys(chillerCommandQ).length>0" :class="['draw', {'open': showDraw}]" :data="chillerCommandQ" @close="showDraw = false"></bom-box>
  53. </div>
  54. </template>
  55. <script>
  56. import echarts from "echarts";
  57. import bomBox from "./bomBox";
  58. export default {
  59. data() {
  60. return {
  61. showDraw: false,
  62. dataX: [],
  63. dataY1: [],
  64. dataY2: [],
  65. dataY3: [],
  66. loadX: [],
  67. loadY1: [],
  68. loadY2: [],
  69. loadY3: []
  70. };
  71. },
  72. components: { bomBox },
  73. props: ["data", "chillerHourList",'chillerCommandQ'],
  74. methods: {
  75. getData() {
  76. this.chillerHourList.forEach(el => {
  77. el.value = el.time.slice(0, 2) + ":" + el.time.slice(2, 4);
  78. this.dataX.push(el.value);
  79. this.loadX.push(el.value);
  80. this.dataY1.push(el.tout);
  81. this.dataY2.push(el.meanTindoor);
  82. this.dataY3.push(el.maxTindoor);
  83. console.log(this.dataY3)
  84. this.loadY1.push(el.nowPlantLoad?(el.nowPlantLoad=='-9999'?0:el.nowPlantLoad):0);
  85. this.loadY2.push(el.predictedLoadUpLimit?el.predictedLoadUpLimit:0);
  86. this.loadY3.push(el.redictedLoadDownLimit?el.redictedLoadDownLimit:0);
  87. });
  88. },
  89. drawLeft() {
  90. var leftLine = echarts.init(document.getElementById("leftLine"));
  91. let option = {
  92. tooltip: {
  93. trigger: "axis"
  94. },
  95. title:{
  96. text:'室内外温度',
  97. fontSize:'16px',
  98. color:'#1F2429'
  99. },
  100. grid: {
  101. left: "3%",
  102. right: "4%",
  103. bottom: "3%",
  104. containLabel: true
  105. },
  106. xAxis: {
  107. type: "category",
  108. boundaryGap: false,
  109. data: this.dataX
  110. },
  111. yAxis: {
  112. type: "value",
  113. axisLabel:{formatter:'{value} ℃'}
  114. },
  115. series: [
  116. {
  117. name: "室外温度",
  118. type: "line",
  119. data: this.dataY1,
  120. color:'#0091FF'
  121. },
  122. {
  123. name: "室内平均温度",
  124. type: "line",
  125. data: this.dataY2,
  126. color:'#00D6B9'
  127. },
  128. {
  129. name: "室内最高温度",
  130. type: "line",
  131. data: this.dataY3,
  132. color:'#FFBA6B'
  133. }
  134. ]
  135. };
  136. leftLine.setOption(option);
  137. },
  138. drawRight() {
  139. var rightLine = echarts.init(document.getElementById("rightLine"));
  140. rightLine.setOption({
  141. tooltip: {
  142. trigger: "axis",
  143. axisPointer: {
  144. type: "cross",
  145. animation: false,
  146. label: {
  147. backgroundColor: "#ccc",
  148. borderColor: "#aaa",
  149. borderWidth: 1,
  150. shadowBlur: 0,
  151. shadowOffsetX: 0,
  152. shadowOffsetY: 0,
  153. color: "#222"
  154. }
  155. }
  156. // formatter: function (params) {
  157. // // return params[2].name + '<br />' + params[2].value;
  158. // }
  159. },
  160. grid: {
  161. left: "3%",
  162. right: "4%",
  163. bottom: "3%",
  164. containLabel: true
  165. },
  166. title:{
  167. text:'预测冷量',
  168. fontSize:'16px',
  169. color:'#1F2429'
  170. },
  171. xAxis: {
  172. type: "category",
  173. data: this.loadX
  174. },
  175. yAxis: {
  176. splitNumber: 3,
  177. splitLine: {
  178. show: false
  179. },
  180. axisLabel:{formatter:'{value} KW'}
  181. },
  182. series: [
  183. {
  184. name: "L",
  185. type: "line",
  186. data: this.loadY2,
  187. lineStyle: {
  188. opacity: 0
  189. },
  190. stack: "confidence-band",
  191. symbol: "none"
  192. },
  193. {
  194. name: "U",
  195. type: "line",
  196. data: this.loadY3,
  197. lineStyle: {
  198. opacity: 0
  199. },
  200. areaStyle: {
  201. color: "#ccc"
  202. },
  203. stack: "confidence-band",
  204. symbol: "none"
  205. },
  206. {
  207. type: "line",
  208. data: this.loadY1,
  209. hoverAnimation: false,
  210. symbolSize: 6,
  211. itemStyle: {
  212. color: "#0091FF"
  213. },
  214. showSymbol: false
  215. }
  216. ]
  217. });
  218. }
  219. },
  220. created() {
  221. this.getData();
  222. },
  223. mounted() {
  224. this.drawLeft();
  225. this.drawRight();
  226. }
  227. };
  228. </script>
  229. <style lang='scss' scoped>
  230. .an-content {
  231. .snapshotss-center2 {
  232. padding: 20px 0;
  233. margin-bottom: 44px;
  234. display: flex;
  235. align-items: center;
  236. overflow: hidden;
  237. .snapshotss-cont2-box1,
  238. .snapshotss-cont2-box2 {
  239. flex: 1;
  240. height: 80px;
  241. background: url("../../assets/copy.png");
  242. background-size: 100% 100%;
  243. display: flex;
  244. align-items: center;
  245. padding-left: 24px;
  246. }
  247. .snapshotss-cont2-box1 {
  248. margin-right: 12px;
  249. span:nth-of-type(1) {
  250. height: 22px;
  251. font-size: 14px;
  252. color: rgba(100, 108, 115, 1);
  253. line-height: 19px;
  254. margin-right: 20px;
  255. }
  256. span:not(:first-child) {
  257. height: 28px;
  258. background: rgba(255, 255, 255, 1);
  259. border-radius: 16px;
  260. font-size: 14px;
  261. color: rgba(31, 36, 41, 1);
  262. display: flex;
  263. justify-content: space-between;
  264. align-items: center;
  265. padding: 0 6px 0 12px;
  266. margin-right: 20px;
  267. img {
  268. width: 20px;
  269. height: 20px;
  270. margin-left: 8px;
  271. }
  272. }
  273. .span1 {
  274. border: 1px solid rgba(52, 199, 36, 1);
  275. }
  276. .span2 {
  277. border: 1px solid rgba(245, 78, 69, 1);
  278. }
  279. }
  280. .snapshotss-cont2-box2 {
  281. span:nth-of-type(1),
  282. span:nth-of-type(3) {
  283. height: 22px;
  284. font-size: 14px;
  285. color: rgba(100, 108, 115, 1);
  286. line-height: 19px;
  287. margin-right: 16px;
  288. }
  289. span:nth-of-type(2),
  290. span:nth-of-type(4) {
  291. height: 32px;
  292. font-size: 24px;
  293. font-family: Persagy;
  294. color: rgba(31, 36, 41, 1);
  295. line-height: 29px;
  296. margin-right: 64px;
  297. }
  298. span:nth-of-type(3) {
  299. margin-right: 16px;
  300. }
  301. }
  302. }
  303. .side-r {
  304. position: fixed;
  305. right: 0;
  306. top: 50%;
  307. transform: translateY(-50%);
  308. box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
  309. background: #ffffff;
  310. display: flex;
  311. .float-r {
  312. display: flex;
  313. align-items: center;
  314. padding: 60px 40px 60px 10px;
  315. cursor: pointer;
  316. img {
  317. height: 10px;
  318. margin-right: 10px;
  319. }
  320. p {
  321. width: 0;
  322. }
  323. &:hover {
  324. background: #efefef;
  325. }
  326. }
  327. }
  328. .draw {
  329. position: fixed;
  330. left: 100%;
  331. top: 50%;
  332. transform: translateY(-50%);
  333. box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
  334. background: #ffffff;
  335. transition: transform 0.3s ease-in-out;
  336. &.open {
  337. transform: translate(-100%, -50%);
  338. }
  339. }
  340. .an-bottom {
  341. margin-top: 45px;
  342. display: flex;
  343. .leftL{
  344. flex:1;
  345. .leftLengend{
  346. text-align: center;
  347. margin-bottom: 10px;
  348. i{
  349. display: inline-block;
  350. width:16px;
  351. height: 6px;
  352. border-radius:3px;
  353. vertical-align: middle;
  354. }
  355. .innerIcon{
  356. background:rgba(0,214,185,1);
  357. margin: 0 20px;
  358. }
  359. .outIcon{
  360. background:rgba(0,145,255,1);
  361. }
  362. .innerMax{
  363. background:rgba(255,186,107,1);
  364. }
  365. }
  366. }
  367. .rightL{
  368. flex:1;
  369. .rightLengend{
  370. text-align: center;
  371. margin-bottom: 10px;
  372. i{
  373. display: inline-block;
  374. width:16px;
  375. height: 6px;
  376. border-radius:3px;
  377. vertical-align: middle;
  378. }
  379. .reactCool{
  380. background:rgba(0,214,185,1);
  381. }
  382. .preCool{
  383. background:rgba(0,145,255,1);
  384. opacity:0.29;
  385. margin-left:20px;
  386. }
  387. }
  388. }
  389. }
  390. }
  391. </style>