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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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-top: 16rpx;
  40. background: #FFFFFF;
  41. box-shadow: 0px 3rpx 29rpx 0px rgba(59, 74, 116, 0.14);
  42. border-radius: 20rpx;
  43. .title {
  44. line-height: 96rpx;
  45. text-align: center;
  46. font-size: 30rpx;
  47. font-family: PingFangSC-Regular, PingFang SC;
  48. font-weight: 400;
  49. color: #232627;
  50. .title_select{
  51. display: flex;
  52. justify-content: center;
  53. .icon{
  54. margin-left: 20rpx;
  55. }
  56. }
  57. }
  58. .inner {
  59. // height: 200rpx;
  60. }
  61. }
  62. </style>