index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <view class="approve-container">
  3. <view class="approve-search">
  4. <u-search
  5. placeholder="查询流程"
  6. v-model="keyword"
  7. bg-color="#fff"
  8. margin="16rpx 24rpx"
  9. :input-style="{
  10. fontSize: variables.mainFontSize,
  11. padding: '0rpx 40rpx',
  12. }"
  13. :action-style="{fontSize: variables.mainFontSize}"
  14. :border-color="'#F2F2F2'"
  15. :bg-color="'#F2F2F2'"
  16. :height="74"
  17. @search="() => searchKeyWord = keyword"
  18. @custom="() => searchKeyWord = keyword"
  19. :show-action="false"
  20. input-align="center"
  21. />
  22. </view>
  23. <view class="approve-list">
  24. <todo-list :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" v-if="type === 'todo'"/>
  25. <done-list :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" v-else-if="type === 'done'"/>
  26. <cc-list :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" v-else-if="type === 'cc'"/>
  27. <manager-list :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" v-else-if="type === 'manager'"/>
  28. <launch-list :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" v-else/>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import variables from '@/styles/variables.scss'
  34. import doneList from './doneList'
  35. import launchList from './launchList'
  36. import todoList from './todoList'
  37. import ccList from './ccList'
  38. import managerList from './managerList'
  39. export default {
  40. components: {
  41. todoList,
  42. launchList,
  43. doneList,
  44. ccList,
  45. managerList,
  46. },
  47. data() {
  48. return {
  49. keyword: '',
  50. searchKeyWord: '',
  51. current: 0,
  52. variables,
  53. searchHeight: 0,
  54. approveContainerHeight: 0
  55. };
  56. },
  57. created() {
  58. this.computedHeight()
  59. },
  60. computed: {
  61. approveListHeight() {
  62. return this.approveContainerHeight - this.searchHeight
  63. }
  64. },
  65. props: {
  66. type: {
  67. type: String,
  68. required: true
  69. }
  70. },
  71. methods: {
  72. handleChange(index) {
  73. this.current = index
  74. this.keyword = ''
  75. this.searchKeyWord = ''
  76. },
  77. async computedHeight() {
  78. await this.$nextTick()
  79. const query = uni.createSelectorQuery().in(this)
  80. query.select(".approve-container")
  81. .boundingClientRect(data => {
  82. this.approveContainerHeight = data.height
  83. }).exec()
  84. query.select(".approve-search")
  85. .boundingClientRect(data => {
  86. this.searchHeight = data.height
  87. }).exec()
  88. }
  89. }
  90. }
  91. </script>
  92. <style lang="scss">
  93. .approve-container {
  94. height: 100%;
  95. display: flex;
  96. flex-direction: column;
  97. // background-color: #fff;
  98. // padding: 10rpx;
  99. .approve-search{
  100. background-color: #fff;
  101. padding: 0 10rpx;
  102. }
  103. }
  104. ::v-deep {
  105. .u-content {
  106. background-color: #F2F2F2 !important;
  107. }
  108. }
  109. </style>