石墨仪设备 前端仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
2.4 KiB

  1. <template>
  2. <div class="carf">
  3. <div class="carf_title">选择工艺</div>
  4. <div>
  5. <div class="carf_column_name">工艺名称</div>
  6. <div v-for="item in list" class="carf_item" @click="onChooseCarf(item)">
  7. <div :style="`background: ${currentItem?.id == item.id ? activeColor : ''}`" class="carf_li">{{ item.name }}</div>
  8. </div>
  9. </div>
  10. <div class="overlay_btn">
  11. <van-button type="primary" class="btn ok">确定</van-button>
  12. <van-button class="btn cancel" @click="onCancel">取消</van-button>
  13. </div>
  14. </div>
  15. </template>
  16. <script lang="ts" setup>
  17. import { ref, onMounted } from 'vue'
  18. const currentItem = ref()
  19. const activeColor = ref('#ffffff')
  20. const list = ref()
  21. const emits = defineEmits(['changeVisible'])
  22. onMounted(()=>{
  23. list.value = [{
  24. id: 10,
  25. name: '硫酸溶解法1'
  26. },{
  27. id: 20,
  28. name: '硫酸溶解法2'
  29. },{
  30. id: 30,
  31. name: '硫酸溶解法3'
  32. }]
  33. })
  34. const onChooseCarf = (data:any) => {
  35. activeColor.value = '#d9d9d9'
  36. currentItem.value = data
  37. }
  38. const onCancel = () => {
  39. emits('changeVisible')
  40. }
  41. </script>
  42. <style lang="scss" scoped>
  43. .carf{
  44. height: 27.5rem;
  45. width: 23.75rem;
  46. background: #ffffff;
  47. .carf_title{
  48. width: 5.25rem;
  49. height: 1.875rem;
  50. margin-left: 1.25rem;
  51. margin-top: 1.875rem;
  52. color: #40474E;
  53. font-weight: 500;
  54. font-size: 1.25rem;
  55. }
  56. }
  57. .carf_column_name{
  58. width: 5rem;
  59. height: 1.875rem;
  60. color: rgba(0, 0, 0, 0.85);
  61. margin-left: 2rem;
  62. margin-top: .625rem;
  63. }
  64. .carf_item{
  65. .carf_li{
  66. display: flex;
  67. align-items: center;
  68. width: 23.75rem;
  69. height: 3.125rem;
  70. padding-left: 1.875rem;
  71. font-size: 1.25rem;
  72. color: rgba(0, 0, 0, 0.85);
  73. }
  74. }
  75. .overlay_btn{
  76. .btn{
  77. width: 6.875rem;
  78. height: 2.875rem;
  79. font-size: 1.25rem;
  80. margin-top: 6.875rem;
  81. }
  82. .ok{
  83. margin-left: 5rem;
  84. }
  85. .cancel{
  86. margin-left: 2.375rem;
  87. }
  88. }
  89. </style>