one-textarea.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. },
  55. },
  56. }
  57. </script>
  58. <style lang="less">
  59. .com-plan-content {
  60. height: 100%;
  61. padding-top: 35rpx;
  62. .bottomBtn {
  63. position: fixed;
  64. bottom: 0;
  65. width: 100%;
  66. height: 75rpx;
  67. line-height: 75rpx;
  68. text-align: center;
  69. font-size: 22.5rpx;
  70. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  71. font-weight: 400;
  72. color: #FFFFFF;
  73. background: #3377FF;
  74. }
  75. .title {
  76. line-height: 35rpx;
  77. padding: 0 25rpx;
  78. text {
  79. font-size: 35rpx;
  80. color: #292C33;
  81. }
  82. }
  83. .item-container {
  84. display: flex;
  85. margin-top: 25rpx;
  86. padding-left: 25rpx;
  87. background-color: #FFFFFF;
  88. .label-view {
  89. width: 175rpx;
  90. line-height: 37.5rpx;
  91. padding: 25rpx 0;
  92. >text {
  93. font-size: 22.5rpx;
  94. color: #666F80;
  95. }
  96. }
  97. .content {
  98. flex: 1;
  99. padding: 25rpx 0;
  100. .textarea {
  101. width: 100%;
  102. min-height: 810rpx;
  103. padding: 0 25rpx;
  104. line-height: 37.5rpx;
  105. font-size: 22.5rpx;
  106. color: #525866;
  107. box-sizing: border-box;
  108. }
  109. }
  110. }
  111. }
  112. </style>