one-textarea.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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" placeholder-style="color: #B8BECC"
  12. :maxlength="500" :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. return ''
  43. },
  44. placeholder(){
  45. return this.type === 'plan' ? '**根据原因分析及改善目标拟定几个对策/方案/计划' : '**1.有效实施改善后将执行方式纳入标准规范内。 2.有些残余的问题是否需要在第二轮PDCA中改善。'
  46. },
  47. // 多行文本框子标题
  48. label() {
  49. return this.type === 'plan' ? '改善计划' : '对策处置'
  50. }
  51. },
  52. methods: {
  53. changeVal(e) {
  54. this.$emit('changeTextare', this.type, e.target.value);
  55. },
  56. goToPrevPage(){
  57. // window.history.back();
  58. uni.navigateBack({
  59. delta: 1
  60. });
  61. },
  62. },
  63. }
  64. </script>
  65. <style lang="less">
  66. .com-plan-content {
  67. height: 100%;
  68. padding-top: 35rpx;
  69. .bottomBtn {
  70. position: fixed;
  71. bottom: 0;
  72. width: 100%;
  73. height: 75rpx;
  74. line-height: 75rpx;
  75. text-align: center;
  76. font-size: 22.5rpx;
  77. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  78. font-weight: 400;
  79. color: #FFFFFF;
  80. background: #3377FF;
  81. }
  82. .title {
  83. line-height: 35rpx;
  84. padding: 0 25rpx;
  85. text {
  86. font-size: 35rpx;
  87. color: #292C33;
  88. }
  89. }
  90. .item-container {
  91. display: flex;
  92. margin-top: 25rpx;
  93. padding-left: 25rpx;
  94. background-color: #FFFFFF;
  95. .label-view {
  96. width: 175rpx;
  97. line-height: 37.5rpx;
  98. padding: 25rpx 0;
  99. >text {
  100. font-size: 22.5rpx;
  101. color: #666F80;
  102. }
  103. }
  104. .content {
  105. flex: 1;
  106. padding: 25rpx 0;
  107. .textarea {
  108. width: 100%;
  109. min-height: 810rpx;
  110. padding: 0 25rpx;
  111. line-height: 37.5rpx;
  112. font-size: 22.5rpx;
  113. color: #525866;
  114. box-sizing: border-box;
  115. }
  116. }
  117. }
  118. }
  119. </style>