navigation.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <div class="navigation yes-events">
  3. <el-select class="select" v-model="value" size="large">
  4. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
  5. </el-select>
  6. <div class="tabs" v-for="(ele, idx) in list" :key="idx">
  7. <div
  8. class="tab-item"
  9. @click="handleTab(item)"
  10. :class="{ active: active === item.id }"
  11. v-for="(item, index) in ele"
  12. :key="index"
  13. >
  14. {{ item.name }}
  15. </div>
  16. </div>
  17. <el-checkbox-group
  18. v-show="childrenData"
  19. class="checkbox-group"
  20. v-model="checkedChildren"
  21. @change="handleCheckedChange"
  22. >
  23. <el-checkbox v-for="item in childrenData" :key="item" :label="item" :value="item">
  24. {{ item }}
  25. </el-checkbox>
  26. </el-checkbox-group>
  27. <!-- <div class="btn" @click="toPage">农场确权</div> -->
  28. </div>
  29. </template>
  30. <script setup>
  31. import { useRouter } from "vue-router";
  32. import { ref } from "vue";
  33. const router = useRouter();
  34. const value = ref("Option1");
  35. const options = [
  36. {
  37. value: "Option1",
  38. label: "2区",
  39. }
  40. ];
  41. const checkedChildren = ref(["树高"]);
  42. const childrenData = ref(["树高", "冠幅"]);
  43. const handleCheckedChange = (e) => {
  44. console.log("e", e);
  45. };
  46. const active = ref(1);
  47. const handleTab = ({ id, children }) => {
  48. active.value = id;
  49. childrenData.value = children;
  50. checkedChildren.value = [children[0]];
  51. };
  52. const list = ref([
  53. [
  54. {
  55. name: "基本指标",
  56. id: 1,
  57. children: ["品种", "树高", "冠幅"],
  58. },
  59. {
  60. name: "物候指标",
  61. id: 2,
  62. children: ["长穗长度", "单数华穗率"],
  63. },
  64. {
  65. name: "生态指标",
  66. id: 3,
  67. },
  68. {
  69. name: "生长指标",
  70. id: 4,
  71. },
  72. {
  73. name: "病虫指标",
  74. id: 5,
  75. },
  76. ],
  77. [
  78. {
  79. name: "处方图",
  80. id: 6,
  81. },
  82. ],
  83. ]);
  84. const toPage = () => {
  85. router.push("/authentic");
  86. };
  87. </script>
  88. <style lang="scss" scoped>
  89. .navigation {
  90. position: fixed;
  91. top: 34px;
  92. left: calc(50% - 470px);
  93. width: calc(100% - 430px * 2);
  94. display: flex;
  95. justify-content: center;
  96. align-items: center;
  97. .select{
  98. width: 120px;
  99. height: 50px;
  100. margin-right: 21px;
  101. ::v-deep{
  102. .el-select__wrapper{
  103. height: 100%;
  104. background: rgba(0, 0, 0, 0.3);
  105. box-shadow: 0 0 0 1px #F7BE5A;
  106. border-radius: 2px;
  107. text-align: center;
  108. }
  109. .el-select__placeholder{
  110. color: #F7BE5A;
  111. font-size: 20px;
  112. font-family: "PangMenZhengDao";
  113. }
  114. .el-select__caret{
  115. color: #F7BE5A;
  116. font-size: 20px;
  117. }
  118. }
  119. }
  120. .tabs {
  121. background: rgba(35, 35, 35, 0.8);
  122. border: 1px solid #555555;
  123. padding: 8px;
  124. border-radius: 8px;
  125. display: flex;
  126. justify-content: center;
  127. .tab-item {
  128. font-size: 16px;
  129. color: rgba(255, 255, 255, 0.8);
  130. padding: 7px 12px 9px 12px;
  131. font-family: "PangMenZhengDao";
  132. cursor: pointer;
  133. &.active {
  134. background: #ffd489;
  135. color: #1d1d1d;
  136. border-radius: 4px;
  137. }
  138. }
  139. .tab-item + .tab-item {
  140. margin-left: 25px;
  141. }
  142. }
  143. .tabs + .tabs {
  144. margin-left: 12px;
  145. }
  146. .checkbox-group {
  147. position: absolute;
  148. top: 74px;
  149. right: 30px;
  150. background: rgba(35, 35, 35, 0.8);
  151. border-radius: 8px;
  152. border: 1px solid #555555;
  153. padding: 10px 20px;
  154. display: flex;
  155. flex-direction: column;
  156. ::v-deep {
  157. .el-checkbox {
  158. margin-right: 0;
  159. }
  160. .el-checkbox__input.is-checked + .el-checkbox__label {
  161. color: #ffd489;
  162. }
  163. .el-checkbox__input.is-checked .el-checkbox__inner {
  164. background-color: #ffd489;
  165. border-color: #ffd489;
  166. &::after {
  167. border-color: #1d1d1d;
  168. }
  169. }
  170. .el-checkbox__label {
  171. color: #fff;
  172. }
  173. }
  174. }
  175. .btn {
  176. width: 80px;
  177. height: 30px;
  178. text-align: center;
  179. line-height: 28px;
  180. border-radius: 5px;
  181. cursor: pointer;
  182. background: rgba(255, 255, 255, 0.5);
  183. }
  184. }
  185. </style>