one-textarea.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view class="com-plan-content">
  3. <view class="title">
  4. <text>{{ title }}</text>
  5. </view>
  6. <view class="item-container">
  7. <view class="label-view">
  8. <text>{{ label }}</text>
  9. </view>
  10. <view class="content">
  11. <textarea class="textarea" :key="title" placeholder="请输入" placeholder-style="color: #B8BECC"
  12. :maxlength="500" auto-height :value="defaultValue" :disabled="disabled" @input="changeVal" />
  13. </view>
  14. </view>
  15. <view class="bottomBtn" @click="goToPrevPage" v-if="disabled">返回改善任务详情</view>
  16. </view>
  17. </template>
  18. <script>
  19. // 单个多行输入框 (改善计划(Plan)/oneTextarea)
  20. export default {
  21. props: {
  22. // 类型 (plan 和 action)
  23. type: {
  24. type: String,
  25. default: 'plan'
  26. },
  27. // 对策处置默认值
  28. defaultValue: {
  29. type: String,
  30. default: ''
  31. },
  32. // 是否禁用
  33. disabled: {
  34. type: Boolean,
  35. default: false
  36. },
  37. },
  38. computed: {
  39. // 多行文本框标题
  40. title() {
  41. return this.type === 'plan' ? '改善计划(Plan)' : '对策处置(Action)'
  42. },
  43. // 多行文本框子标题
  44. label() {
  45. return this.type === 'plan' ? '改善计划' : '对策处置'
  46. }
  47. },
  48. methods: {
  49. changeVal(e) {
  50. this.$emit('changeTextare', this.type, e.target.value);
  51. },
  52. goToPrevPage(){
  53. // window.history.back();
  54. uni.navigateBack({
  55. delta: 1
  56. });
  57. },
  58. },
  59. }
  60. </script>
  61. <style lang="less">
  62. .com-plan-content {
  63. height: 100%;
  64. padding-top: 35rpx;
  65. .bottomBtn {
  66. position: fixed;
  67. bottom: 0;
  68. width: 100%;
  69. height: 75rpx;
  70. line-height: 75rpx;
  71. text-align: center;
  72. font-size: 22.5rpx;
  73. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  74. font-weight: 400;
  75. color: #FFFFFF;
  76. background: #3377FF;
  77. }
  78. .title {
  79. line-height: 35rpx;
  80. padding: 0 25rpx;
  81. text {
  82. font-size: 35rpx;
  83. color: #292C33;
  84. }
  85. }
  86. .item-container {
  87. display: flex;
  88. margin-top: 25rpx;
  89. padding-left: 25rpx;
  90. background-color: #FFFFFF;
  91. .label-view {
  92. width: 175rpx;
  93. line-height: 37.5rpx;
  94. padding: 25rpx 0;
  95. >text {
  96. font-size: 22.5rpx;
  97. color: #666F80;
  98. }
  99. }
  100. .content {
  101. flex: 1;
  102. padding: 25rpx 0;
  103. .textarea {
  104. width: 100%;
  105. min-height: 810rpx;
  106. padding: 0 25rpx;
  107. line-height: 37.5rpx;
  108. font-size: 22.5rpx;
  109. color: #525866;
  110. box-sizing: border-box;
  111. }
  112. }
  113. }
  114. }
  115. </style>