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