Zoology.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. <!--
  2. * @Author: your name
  3. * @Date: 2021-10-21 17:51:22
  4. * @LastEditTime: 2021-11-22 10:25:05
  5. * @LastEditors: Please set LastEditors
  6. * @Description: 生态监测页面
  7. * @FilePath: \hyyfScreen\src\views\Zoology\Zoology.vue
  8. -->
  9. <template>
  10. <div class="zoology">
  11. <div class="left">
  12. <div class="left-top">
  13. <!-- 左上标题 -->
  14. <div class="left-top-title">
  15. <div class="left-top-title-left"></div>
  16. <div class="left-top-title-center">
  17. <span>育肥一栋</span>
  18. <div class="left-top-title-icon" @click="leftTopSelect"></div>
  19. <!-- 可选择的栋 -->
  20. <div class="left-top-select" v-show="leftTopSelected">
  21. <select-block :title="'一栋'">
  22. <template v-slot:left>
  23. <select-column :list="simulatedData"></select-column>
  24. </template>
  25. <template v-slot:right>
  26. <select-column :floor="false" :type="1"></select-column>
  27. </template>
  28. </select-block>
  29. </div>
  30. </div>
  31. <div class="left-top-title-right"></div>
  32. </div>
  33. <!-- 左上循环滑动 -->
  34. <div class="left-top-content">
  35. <swiper style="height: 600px; margin-top: auto; margin-bottom: auto;" class="swiper" :options="swiperOption">
  36. <swiper-slide v-for="item in 10" :key="item">
  37. <swiper-content :list="swiperData"></swiper-content>
  38. </swiper-slide>
  39. </swiper>
  40. </div>
  41. </div>
  42. <div class="left-middle">
  43. <chart-board
  44. :title="'单元用水量'"
  45. :ifDate="true"
  46. @emitDates="getWaterDates">
  47. <chart-line :data="waterData" :id="1"></chart-line>
  48. </chart-board>
  49. </div>
  50. <div class="left-bottom">
  51. <chart-board
  52. :title="'整栋用电量'"
  53. :ifDate="true"
  54. @emitDates="getElecDates">
  55. <chart-line-and :data="waterData" :id="2"></chart-line-and>
  56. </chart-board>
  57. </div>
  58. </div>
  59. <div class="right">
  60. <div class="right-top">
  61. <div class="kuang"></div>
  62. </div>
  63. <div class="right-bottom">
  64. <div class="right-bottom-left">
  65. <chart-board
  66. :title="'单元用水量'"
  67. @emitDates="getWaterDates">
  68. <chart-line :data="waterData" :id="4"></chart-line>
  69. </chart-board>
  70. </div>
  71. <div class="right-bottom-right">
  72. <chart-board
  73. :title="'单元用水量'"
  74. @emitDates="getWaterDates">
  75. <chart-line :data="waterData" :id="5"></chart-line>
  76. </chart-board>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </template>
  82. <script>
  83. import SelectBlock from './leftTop/SelectBlock.vue'
  84. import SelectColumn from './leftTop/SelectColumn.vue'
  85. import { swiper, swiperSlide } from 'vue-awesome-swiper'
  86. import 'swiper/css/swiper.css'
  87. import SwiperContent from './leftTop/SwiperContent.vue'
  88. import ChartBoard from './charts/ChartBoard.vue'
  89. import ChartLine from './charts/ChartLine.vue'
  90. import ChartLineAnd from './charts/ChartLineAnd.vue'
  91. export default {
  92. name: "Zoology",
  93. components: {
  94. SelectBlock,
  95. SelectColumn,
  96. swiper,
  97. swiperSlide,
  98. SwiperContent,
  99. ChartBoard,
  100. ChartLine,
  101. ChartLineAnd
  102. },
  103. data() {
  104. return {
  105. leftTopSelected: false, // 左上是否点击了要选择
  106. simulatedData: [ // 左上 —— 模拟的数据
  107. { id: 1, name: '1' },
  108. { id: 2, name: '11' },
  109. { id: 3, name: '111' },
  110. { id: 4, name: '1111' },
  111. { id: 5, name: '1111' },
  112. { id: 6, name: '11111' },
  113. { id: 7, name: '111111' },
  114. { id: 8, name: '1111111' },
  115. ],
  116. swiperOption: { // 左上 —— 循环滑动
  117. direction: 'vertical',
  118. slidesPerView: 3,
  119. slidesPerColumn: 1,
  120. slidesPerGroup: 3,
  121. // spaceBetween: 30,
  122. autoplay: {
  123. delay: 3000,
  124. disableOnInteraction: false
  125. },
  126. // pagination: {
  127. // el: '.swiper-pagination',
  128. // clickable: true
  129. // }
  130. },
  131. swiperData: [
  132. {
  133. id: '121',
  134. title: '育肥1栋1单元',
  135. temp: 31.5,
  136. rh: 81
  137. },
  138. {
  139. id: '121a',
  140. title: '育肥1栋1单元',
  141. temp: 31.5,
  142. rh: 84
  143. },
  144. {
  145. id: '121s',
  146. title: '育肥1栋1单元',
  147. temp: 31.5,
  148. rh: 81
  149. },
  150. {
  151. id: '121d',
  152. title: '育肥1栋1单元',
  153. temp: 31.5,
  154. rh: 81
  155. }
  156. ],
  157. waterDates: [], // 用水量模拟
  158. waterData: { // 左中 —— 模拟数据
  159. xAxisName: '',
  160. xAxisData: ['07-01', '07-02', '07-03', '07-04', '07-05'],
  161. yAxisName: '吨',
  162. yAxisData: [37.1, 37.4, 36.8, 37.9, 34.2]
  163. },
  164. elecDates: [] // 用电量时间
  165. }
  166. },
  167. methods: {
  168. leftTopSelect() { // 左上角的选择是否显示
  169. this.leftTopSelected = !this.leftTopSelected
  170. },
  171. getWaterDates(value) { // 左中 获取时间
  172. this.waterDates = value
  173. },
  174. getElecDates(value) { // 左下 获取时间
  175. this.elecDates = value
  176. }
  177. },
  178. }
  179. </script>
  180. <style scoped>
  181. .zoology {
  182. width: 100%;
  183. height: 100%;
  184. display: flex;
  185. justify-content: space-around;
  186. padding-top: 20px;
  187. }
  188. /** 左边 */
  189. .left {
  190. /* background-color: #fff; */
  191. width: 40%;
  192. height: 100%;
  193. display: flex;
  194. flex-direction: column;
  195. justify-content: space-around;
  196. }
  197. /* 左上 */
  198. .left-top {
  199. width: 100%;
  200. height: 30%;
  201. background: linear-gradient(156deg, rgba(15, 21, 43, 1) 0%, rgba(0, 0, 0, 1) 100%);
  202. }
  203. /* 左上 - title */
  204. .left-top-title {
  205. width: 100%;
  206. height: 26px;
  207. display: flex;
  208. }
  209. .left-top-title-left {
  210. width: 325px;
  211. height: 26px;
  212. background: url("../../assets/BioSafety/u1717.svg") no-repeat;
  213. background-size: 100% 100%;
  214. position: relative;
  215. }
  216. .left-top-title-left::before {
  217. content: '';
  218. height: 85%;
  219. border: 2px solid #66FFFF;
  220. position: absolute;
  221. top: 0;
  222. left: 0;
  223. }
  224. .left-top-title-center {
  225. padding: 0 15px;
  226. width: 130px;
  227. height: 26px;
  228. background: url("../../assets/BioSafety/u1719.svg") no-repeat;
  229. background-size: 100% 100%;
  230. line-height: 26px;
  231. color: white;
  232. font-size: 16px;
  233. display: flex;
  234. justify-content: space-around;
  235. position: relative;
  236. }
  237. .left-top-title-icon {
  238. width: 20px;
  239. height: 20px;
  240. background: url("../../assets/Zoology/u5069.svg") no-repeat;
  241. position: relative;
  242. top: 5px;
  243. cursor: pointer;
  244. }
  245. .left-top-title-right {
  246. width: 325px;
  247. height: 26px;
  248. background: url("../../assets/BioSafety/u1718.svg") no-repeat;
  249. background-size: 100% 100%;
  250. position: relative;
  251. }
  252. .left-top-title-right::after{
  253. content: '';
  254. height: 85%;
  255. border: 2px solid #66FFFF;
  256. position: absolute;
  257. top: 0;
  258. right: 0;
  259. }
  260. /* 左上 - 点击下拉按钮后的选择框 */
  261. .left-top-select {
  262. position: absolute;
  263. top: 35px;
  264. left: -340px;
  265. border: 2px solid #66FFFF;
  266. border-radius: 5px;
  267. padding: 15px 10px;
  268. display: flex;
  269. z-index: 100;
  270. background-color: rgba(15,21,43, 0.6);
  271. }
  272. /* 左上 - 滑动 */
  273. .left-top-content {
  274. /* height: 90%; */
  275. height: calc(100% - 26px);
  276. overflow: hidden;
  277. }
  278. /* 左中 */
  279. .left-middle {
  280. width: 100%;
  281. height: 30%;
  282. }
  283. /* 左下 */
  284. .left-bottom {
  285. background-color: rgb(228, 32, 32);
  286. width: 100%;
  287. height: 30%;
  288. }
  289. /** 右边 */
  290. .right {
  291. width: 55%;
  292. height: 100%;
  293. }
  294. /* 右上 */
  295. .right-top {
  296. height: 70%;
  297. width: 100%;
  298. /* box-sizing: border-box; */
  299. /* background-color: red; */
  300. padding-left: 25px;
  301. }
  302. .kuang {
  303. width: 100%;
  304. height: 100%;
  305. background: url("../../assets/BioSafety/kuang.png") no-repeat;
  306. background-size: contain;
  307. }
  308. /* 右下 */
  309. .right-bottom {
  310. display: flex;
  311. background: rgb(3,16,50);
  312. }
  313. .right-bottom-left {
  314. width: 50%;
  315. border-right: 2px solid #66FFFF;
  316. }
  317. .right-bottom-right {
  318. margin-left: 10px;
  319. width: 50%;
  320. }
  321. </style>