Detail.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <template>
  2. <div class="Detail">
  3. <header class="header">
  4. <el-page-header @back="goBack" content="产床信息" />
  5. <div class="title">
  6. <h4></h4>
  7. <span class="title">产床002</span>
  8. <el-date-picker
  9. v-model="date"
  10. @change="pickerChange"
  11. type="date"
  12. value-format="yyyy-MM-dd"
  13. :picker-options="pickerOptions"
  14. placeholder="选择日期"
  15. ></el-date-picker>
  16. </div>
  17. </header>
  18. <section class="section">
  19. <article class="left">
  20. <ul class="ul">
  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">9只</span>
  28. </li>
  29. <li class="li">
  30. <span class="title">存活率:</span>
  31. <span class="content">100%</span>
  32. </li>
  33. <li class="li">
  34. <span class="title">仔猪日龄:</span>
  35. <span class="content">12天</span>
  36. </li>
  37. <li class="li">
  38. <span class="title">产床状态:</span>
  39. <span class="content">已产仔</span>
  40. </li>
  41. <li class="li">
  42. <span class="title">出生日期:</span>
  43. <span class="content">2020-04-25</span>
  44. </li>
  45. <li class="li">
  46. <span class="title">预计断奶剩余天数:</span>
  47. <span class="content">16天</span>
  48. </li>
  49. </ul>
  50. </article>
  51. <article class="right">
  52. <div class="contianer">
  53. <el-carousel height="250px" indicator-position="none">
  54. <el-carousel-item>
  55. <img
  56. @click="toSowDetail"
  57. src="https://ns-strategy.cdn.bcebos.com/ns-strategy/upload/fc_big_pic/part-00044-516.jpg"
  58. />
  59. </el-carousel-item>
  60. <el-carousel-item>
  61. <img
  62. @click="toSowDetail"
  63. src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1451307779,3128056523&fm=26&gp=0.jpg"
  64. />
  65. </el-carousel-item>
  66. <el-carousel-item>
  67. <img
  68. @click="toSowDetail"
  69. src="https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1510260968,1676318121&fm=26&gp=0.jpg"
  70. />
  71. </el-carousel-item>
  72. <el-carousel-item>
  73. <img
  74. @click="toSowDetail"
  75. src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3523098162,3587342676&fm=26&gp=0.jpg"
  76. />
  77. </el-carousel-item>
  78. </el-carousel>
  79. </div>
  80. </article>
  81. </section>
  82. <footer class="footer">
  83. <div class="h">
  84. <chart-a></chart-a>
  85. </div>
  86. <div class="d">
  87. <chart-b></chart-b>
  88. </div>
  89. </footer>
  90. </div>
  91. </template>
  92. <script>
  93. import chart_a from "./charts/chart_a";
  94. import chart_b from "./charts/chart_b";
  95. // 时间选择器配置
  96. const pickerOptions = {
  97. // 禁用时间
  98. disabledDate(time) {
  99. return time.getTime() > Date.now();
  100. },
  101. shortcuts: [
  102. {
  103. text: "今天",
  104. onClick(picker) {
  105. picker.$emit("pick", new Date());
  106. }
  107. },
  108. {
  109. text: "昨天",
  110. onClick(picker) {
  111. const date = new Date();
  112. date.setTime(date.getTime() - 3600 * 1000 * 24);
  113. picker.$emit("pick", date);
  114. }
  115. },
  116. {
  117. text: "前天",
  118. onClick(picker) {
  119. const date = new Date();
  120. date.setTime(date.getTime() - 3600 * 1000 * 24 * 2);
  121. picker.$emit("pick", date);
  122. }
  123. }
  124. ]
  125. };
  126. export default {
  127. name: "Detail",
  128. components: {
  129. "chart-a": chart_a,
  130. "chart-b": chart_b
  131. },
  132. data() {
  133. return {
  134. date: "",
  135. pickerOptions
  136. };
  137. },
  138. created() {},
  139. methods: {
  140. pickerChange(value) {
  141. console.log(value);
  142. // this.date = Math.floor(new Date(value[0]).getTime() / 1000)
  143. // this.getReportList()
  144. },
  145. toSowDetail() {
  146. console.log(555);
  147. this.$message.warning("母猪详细信息正在开发中!!");
  148. },
  149. goBack() {
  150. this.$router.go(-1);
  151. }
  152. }
  153. };
  154. </script>
  155. <style lang="scss" scoped>
  156. .Detail {
  157. .header {
  158. > .title {
  159. display: flex;
  160. justify-content: space-between;
  161. align-items: center;
  162. padding: 0px 30% 10px 20px;
  163. margin: 0 0 10px 0;
  164. border-bottom: 2px solid #eee;
  165. > h4 {
  166. color: #777;
  167. }
  168. > .title {
  169. font-size: 20px;
  170. font-weight: 600;
  171. color: #444;
  172. }
  173. }
  174. }
  175. .section {
  176. display: flex;
  177. padding-bottom: 20px;
  178. border-bottom: 2px solid #eee;
  179. .left {
  180. padding-left: 70px;
  181. width: 40%;
  182. // border: 2px solid rgb(182, 63, 63);
  183. .ul {
  184. .li {
  185. margin: 5px 0 5px 10px;
  186. .title {
  187. font-size: 17px;
  188. font-weight: 600;
  189. color: rgb(136, 115, 115);
  190. }
  191. .content {
  192. font-size: 18px;
  193. font-weight: 600;
  194. color: rgb(139, 138, 138);
  195. }
  196. }
  197. }
  198. }
  199. .right {
  200. flex: 1;
  201. // border: 2px solid rgb(63, 182, 69);
  202. .contianer {
  203. width: 500px;
  204. height: 250px;
  205. border-radius: 6px;
  206. overflow: hidden;
  207. img {
  208. width: 100%;
  209. height: 250px;
  210. }
  211. }
  212. }
  213. }
  214. .footer {
  215. margin-top: 20px;
  216. .h {
  217. border-bottom: 2px solid #eee;
  218. }
  219. .d{
  220. padding-top: 15px;
  221. }
  222. }
  223. }
  224. // border: 1px solid #00f;
  225. </style>