血透系统pad前端

CheckTab.vue 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <div class="fixedTop">
  3. <div class="nav">
  4. <!-- <ul style="width: 90%">
  5. <li
  6. v-for="(item,i) in inspectionDate"
  7. :key="i"
  8. :class="index == i? 'active':'' "
  9. @click="ClickTab(i,item)"
  10. >{{item.project_name}}</li>
  11. </ul>-->
  12. <van-tabs v-model="active" @change="onClick">
  13. <van-tab
  14. v-for="(item, i) in inspectionDate"
  15. :key="i"
  16. :title="item.project_name"
  17. ></van-tab>
  18. </van-tabs>
  19. <!-- <van-tabs v-model="active" ref="one">
  20. <van-tab title="标签 1">内容 1</van-tab>
  21. <van-tab title="标签 2">内容 2</van-tab>
  22. <van-tab title="标签 3">内容 3</van-tab>
  23. <van-tab title="标签 4">内容 4</van-tab>
  24. </van-tabs>-->
  25. </div>
  26. <div class="tab-content">
  27. <inspection-item-table ref="item"></inspection-item-table>
  28. </div>
  29. </div>
  30. </template>
  31. <script>
  32. import { GetInspection } from "@/api/check";
  33. import InspectionItemTable from "./InspectionItemTable";
  34. import $ from "jquery";
  35. export default {
  36. name: "CheckTab",
  37. created() {
  38. this.patient = this.$route.query.patient_id;
  39. this.GetList();
  40. this.$nextTick(() => {
  41. if (this.active === 0) {
  42. console.log();
  43. $(".van-tabs__line").addClass("intro");
  44. }
  45. });
  46. },
  47. data() {
  48. return {
  49. index: 0,
  50. inspectionDate: [],
  51. patient: 0,
  52. active: 0
  53. };
  54. },
  55. components: {
  56. InspectionItemTable
  57. },
  58. methods: {
  59. ClickTab: function(tabIndex, row) {
  60. this.index = tabIndex;
  61. this.$refs.item.GetList(row.project_id, row);
  62. },
  63. GetList: function() {
  64. let params = {
  65. patient: this.patient
  66. };
  67. GetInspection(params).then(response => {
  68. this.inspectionDate = [];
  69. if (response.data.state == 1) {
  70. // console.log(this.$refs.item);
  71. this.inspectionDate = response.data.data.reference;
  72. this.$refs.item.GetList(1, this.inspectionDate[0]);
  73. }
  74. });
  75. },
  76. onClick(num, title) {
  77. // console.log(this.inspectionDate);
  78. // console.log(num);
  79. // console.log(this.$refs.item);
  80. if ($(".van-tabs__line").is(".intro")) {
  81. $(".van-tabs__line").removeClass("intro");
  82. }
  83. this.inspectionDate.map((items, i) => {
  84. if (num == i) {
  85. this.index = i;
  86. this.$refs.item.GetList(items.project_id, items);
  87. }
  88. });
  89. }
  90. }
  91. };
  92. </script>
  93. <style style="stylesheet/scss" lang="scss" scoped>
  94. .nav {
  95. border-bottom: 1px #e5e5e5 solid;
  96. background: #fff;
  97. position: fixed;
  98. top: 76px;
  99. // @media only screen and (min-width: 376px) and (max-width: 668px) {
  100. // top: 84px !important;
  101. // }
  102. // @media only screen and (min-width: 415px) and (max-width: 736px) {
  103. // top: 88px !important;
  104. // }
  105. // @media only screen and (max-width: 767px) {
  106. // top: 76px !important;
  107. // }
  108. @media only screen and (min-width: 500px) {
  109. top: 124px !important;
  110. }
  111. // @media only screen and (min-width: 813px) and (max-width: 1024px) {
  112. // top: 117px !important;
  113. // }
  114. // @media only screen and (min-width: 1024px) {
  115. // top: 117px !important;
  116. // }
  117. right: 0;
  118. z-index: 55;
  119. left: 0;
  120. background: #fff;
  121. ul {
  122. width: 60%;
  123. margin: 0 auto;
  124. @include box-sizing;
  125. @include display-flex;
  126. @include align-items-center;
  127. @include text-align;
  128. @include justify-content-between;
  129. li {
  130. font-size: 0.32rem;
  131. float: left;
  132. color: $pgh-color;
  133. padding: 0.3rem 0;
  134. cursor: pointer;
  135. }
  136. .active {
  137. position: relative;
  138. &::before {
  139. width: 100%;
  140. height: 2px;
  141. color: $main-color;
  142. position: absolute;
  143. bottom: 0;
  144. left: 0;
  145. content: "";
  146. background: $main-color;
  147. }
  148. }
  149. }
  150. }
  151. </style>
  152. <style lang="scss">
  153. .intro {
  154. width: 41px !important;
  155. transform: translateX(20.5px) !important;
  156. @media only screen and (min-width: 415px) and (max-width: 668px) {
  157. width: 73px !important;
  158. transform: translateX(36.5px) !important;
  159. }
  160. @media only screen and (min-width: 376px) and (max-width: 415px) {
  161. width: 45.5px !important;
  162. transform: translateX(22.75px) !important;
  163. }
  164. @media only screen and (min-width: 668px) and (max-width: 735px) {
  165. width: 45.5px !important;
  166. transform: translateX(22.75px) !important;
  167. }
  168. @media only screen and (min-width: 668px) and (max-width: 736px) {
  169. width: 81px !important;
  170. transform: translateX(40.5px) !important;
  171. }
  172. @media only screen and (min-width: 737px) and (max-width: 812px) {
  173. width: 89px !important;
  174. transform: translateX(44.5px) !important;
  175. }
  176. @media only screen and (min-width: 813px) and (max-width: 1024px) {
  177. width: 113px !important;
  178. transform: translateX(56.5px) !important;
  179. }
  180. @media only screen and (min-width: 1025px) {
  181. width: 150.5px !important;
  182. transform: translateX(75.25px) !important;
  183. }
  184. }
  185. .nav {
  186. .van-tabs {
  187. height: 1.2rem !important;
  188. }
  189. .van-tabs--line .van-tabs__wrap {
  190. height: 1.2rem !important;
  191. }
  192. .van-tabs--line {
  193. padding-top: 1.2rem !important;
  194. }
  195. .van-tab {
  196. line-height: 1.2rem !important;
  197. }
  198. }
  199. </style>