Index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <div class="Index">
  3. <header class="header">
  4. <div class="left">
  5. <chart-a class="chart_a"></chart-a>
  6. </div>
  7. <div class="right">
  8. <chart-b></chart-b>
  9. </div>
  10. </header>
  11. <section class="section">
  12. <ul class="ul">
  13. <li class="li">
  14. <span class="title">总产仔数</span>
  15. <span class="content">2141</span>
  16. </li>
  17. <li class="li">
  18. <span class="title">总活仔数</span>
  19. <span class="content">2035</span>
  20. </li>
  21. <li class="li">
  22. <span class="title">均产仔数</span>
  23. <span class="content">9</span>
  24. </li>
  25. <li class="li">
  26. <span class="title">均断奶活仔数</span>
  27. <span class="content">21</span>
  28. </li>
  29. <li class="li">
  30. <span class="title">均断奶天数</span>
  31. <span class="content">14</span>
  32. </li>
  33. <li class="li">
  34. <span class="title">均断奶活存活率</span>
  35. <span class="content">99%</span>
  36. </li>
  37. </ul>
  38. </section>
  39. <footer class="footer">
  40. <el-carousel height="150px" :interval="5000" direction="vertical" indicator-position="none">
  41. <el-carousel-item>
  42. <div class="item item_1">
  43. <div class="left el-icon-mobile-phone"></div>
  44. <div class="right">
  45. <p class="top">消息警报</p>
  46. <p class="middle">1耳标457865号母猪产仔存活率低于70%</p>
  47. <span class="bottom">查看详情</span>
  48. </div>
  49. </div>
  50. </el-carousel-item>
  51. <el-carousel-item>
  52. <div class="item item_2">
  53. <div class="left el-icon-mobile-phone"></div>
  54. <div class="right">
  55. <p class="top">消息警报</p>
  56. <p class="middle">2耳标457865号母猪产仔存活率低于70%</p>
  57. <span class="bottom">查看详情</span>
  58. </div>
  59. </div>
  60. </el-carousel-item>
  61. <el-carousel-item>
  62. <div class="item item_3">
  63. <div class="left el-icon-mobile-phone"></div>
  64. <div class="right">
  65. <p class="top">消息警报</p>
  66. <p class="middle">3耳标457865号母猪产仔存活率低于70%</p>
  67. <span class="bottom">查看详情</span>
  68. </div>
  69. </div>
  70. </el-carousel-item>
  71. </el-carousel>
  72. </footer>
  73. </div>
  74. </template>
  75. <script>
  76. import { mapActions } from "vuex";
  77. import chart_a from "./charts/chart_a";
  78. import chart_b from "./charts/chart_b";
  79. export default {
  80. name: "Index",
  81. components: {
  82. "chart-a": chart_a,
  83. "chart-b": chart_b
  84. },
  85. data() {
  86. return {};
  87. },
  88. created() {},
  89. methods: {
  90. ...mapActions(["fetch"]),
  91. get() {
  92. this.fetch({
  93. api: "aaa",
  94. method: "GET",
  95. data: {},
  96. success: res => {
  97. console.log(res);
  98. },
  99. fail: err => {
  100. console.log(err);
  101. if (err.errMsg) this.$message.error(err.errMsg);
  102. else this.$message.error("服务器发生异常");
  103. }
  104. });
  105. }
  106. }
  107. };
  108. </script>
  109. <style lang="scss" scoped>
  110. .Index {
  111. .header {
  112. display: flex;
  113. padding-right: 11%;
  114. .left {
  115. width: 50%;
  116. height: 400px;
  117. }
  118. .right {
  119. width: 50%;
  120. height: 400px;
  121. }
  122. }
  123. .section {
  124. margin: 60px 0;
  125. .ul {
  126. display: flex;
  127. justify-content: space-around;
  128. padding: 0 8%;
  129. .li {
  130. height: 80px;
  131. width: 170px;
  132. background-color: #ddd;
  133. border-radius: 10px;
  134. padding: 10px 0;
  135. display: flex;
  136. flex-direction: column;
  137. justify-content: space-around;
  138. align-items: center;
  139. .title {
  140. font-size: 22px;
  141. font-weight: 600;
  142. color: #444;
  143. }
  144. .content {
  145. font-size: 22px;
  146. font-weight: 600;
  147. color: rgb(48, 115, 240);
  148. }
  149. }
  150. }
  151. }
  152. .footer {
  153. .item{
  154. height: 100%;
  155. display: flex;
  156. box-sizing: border-box;
  157. border-radius: 10px;
  158. align-items: center;
  159. .left{
  160. font-size: 30px;
  161. margin-left: 20px;
  162. margin-right: 20px;
  163. }
  164. .right{
  165. .top{
  166. font-size: 20px;
  167. font-weight: 600;
  168. color: #746363;
  169. }
  170. .middle{
  171. font-size: 16px;
  172. color: #999;
  173. }
  174. .bottom{
  175. font-size: 16px;
  176. color: rgb(48, 115, 240);
  177. }
  178. }
  179. }
  180. .item_1{
  181. background-color: #EBF5FF;
  182. .left{
  183. color: #0079FE;
  184. }
  185. }
  186. .item_2{
  187. background-color: #E6FAF0;
  188. .left{
  189. color: #4BD863;
  190. }
  191. }
  192. .item_3{
  193. background-color: #FFEEE6;
  194. .left{
  195. color: #FF3B30;
  196. }
  197. }
  198. }
  199. }
  200. </style>