p-personnel-orientation-section-4.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <view>
  3. <view class="content">
  4. <view class="title">
  5. <picker mode="selector" :range="array" :value="index" @change="bindPickerChange">
  6. <view class="title_select">
  7. <view>{{array[index]}}</view>
  8. <view class="icon">
  9. <uni-icons type="arrowdown"></uni-icons>
  10. </view>
  11. </view>
  12. </picker>
  13. </view>
  14. <view class="inner">
  15. <slot></slot>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. data() {
  23. return {
  24. array: ['今日各科室下井人数', '当前各科室下井人数'],
  25. index: 0,
  26. };
  27. },
  28. methods: {
  29. bindPickerChange: function(e) {
  30. console.log('picker发送选择改变,携带值为', e.target.value)
  31. this.$emit("changeDepart",e.target.value)
  32. this.index = e.target.value
  33. },
  34. }
  35. }
  36. </script>
  37. <style lang="scss">
  38. .content {
  39. margin-bottom: 20rpx;
  40. margin-top: 16rpx;
  41. background: #FFFFFF;
  42. box-shadow: 0px 3rpx 29rpx 0px rgba(59, 74, 116, 0.14);
  43. border-radius: 20rpx;
  44. .title {
  45. line-height: 96rpx;
  46. text-align: center;
  47. font-size: 30rpx;
  48. font-family: PingFangSC-Regular, PingFang SC;
  49. font-weight: 400;
  50. color: #232627;
  51. .title_select{
  52. display: flex;
  53. justify-content: center;
  54. .icon{
  55. margin-left: 20rpx;
  56. }
  57. }
  58. }
  59. .inner {
  60. // height: 200rpx;
  61. }
  62. }
  63. </style>