one-textarea.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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"
  12. :key="title"
  13. placeholder="请输入"
  14. placeholder-style="color: #B8BECC"
  15. :maxlength="-1"
  16. auto-height
  17. :value="label === '改善计划' ? planvalue : actionvalue"
  18. @input="changeVal"
  19. />
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. // 单个多行输入框 (改善计划(Plan)/oneTextarea)
  26. export default {
  27. props: {
  28. // 多行文本框标题
  29. title: {
  30. type: String,
  31. default: '改善计划(Plan)'
  32. },
  33. // 多行文本框子标题
  34. label: {
  35. type: String,
  36. default: '改善计划'
  37. },
  38. // 改善计划默认值
  39. defaultPlanValue: {
  40. type: String,
  41. default: ''
  42. },
  43. // 对策处置默认值
  44. defaultactionValue: {
  45. type: String,
  46. default: ''
  47. }
  48. },
  49. data() {
  50. return {
  51. planvalue: this.defaultPlanValue, // 改善计划
  52. actionvalue: this.defaultactionValue // 对策处置
  53. }
  54. },
  55. methods: {
  56. changeVal(e) {
  57. if(this.label === '改善计划'){
  58. this.planvalue = e.target.value;
  59. }else {
  60. this.actionvalue = e.target.value;
  61. }
  62. }
  63. },
  64. }
  65. </script>
  66. <style lang="less">
  67. .com-plan-content {
  68. height: 100%;
  69. padding-top: 35rpx;
  70. .title {
  71. line-height: 35rpx;
  72. padding: 0 25rpx;
  73. text {
  74. font-size: 35rpx;
  75. color: #292C33;
  76. }
  77. }
  78. .item-container {
  79. display: flex;
  80. margin-top: 25rpx;
  81. padding-left: 25rpx;
  82. background-color: #FFFFFF;
  83. .label-view {
  84. width: 175rpx;
  85. line-height: 37.5rpx;
  86. padding: 25rpx 0;
  87. >text {
  88. font-size: 22.5rpx;
  89. color: #666F80;
  90. }
  91. }
  92. .content {
  93. flex: 1;
  94. padding: 25rpx 0;
  95. .textarea {
  96. width: 100%;
  97. min-height: 810rpx;
  98. padding: 0 25rpx;
  99. line-height: 37.5rpx;
  100. font-size: 22.5rpx;
  101. color: #525866;
  102. box-sizing: border-box;
  103. }
  104. }
  105. }
  106. }
  107. </style>