report-detail.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <!-- -->
  2. <template>
  3. <hc-new-card>
  4. <template #header>
  5. <div class="header_box">
  6. <HcCardItem title="前言">
  7. <div style="height: 100%;">
  8. <el-input
  9. v-model="consolusionData.foreword"
  10. placeholder="请输入"
  11. show-word-limit
  12. type="textarea"
  13. class="inputbox"
  14. :disabled="state === 2"
  15. />
  16. </div>
  17. </HcCardItem>
  18. </div>
  19. </template>
  20. <el-container class="hc-table-layout">
  21. <el-container id="hc_table_container" class="hc-table-container">
  22. <HcCardItem id="hc_table_data" title="项目概况">
  23. <div style="height: 100%;">
  24. <el-input
  25. v-model="consolusionData.generalSituation"
  26. placeholder="请输入"
  27. show-word-limit
  28. type="textarea"
  29. class="inputbox"
  30. :disabled="state === 2"
  31. />
  32. </div>
  33. </HcCardItem>
  34. <HcCardItem id="hc_table_score" title="项目档案管理情况">
  35. <div style="height: 100%;">
  36. <el-input
  37. v-model="consolusionData.adminCondition"
  38. placeholder="请输入"
  39. show-word-limit
  40. type="textarea"
  41. class="inputbox"
  42. :disabled="state === 2"
  43. />
  44. </div>
  45. </HcCardItem>
  46. </el-container>
  47. <el-aside id="hc_table_aside" class="hc-table-aside">
  48. <HcCardItem title="存在问题及建议">
  49. <div style="height: 100%;">
  50. <el-input
  51. v-model="consolusionData.questionSuggest"
  52. placeholder="请输入"
  53. show-word-limit
  54. type="textarea"
  55. class="inputbox"
  56. :disabled="state === 2"
  57. />
  58. </div>
  59. </HcCardItem>
  60. </el-aside>
  61. </el-container>
  62. </hc-new-card>
  63. </template>
  64. <script setup>
  65. import { onMounted, ref, watch } from 'vue'
  66. const props = defineProps({
  67. consolusionData: {
  68. type: Object,
  69. default: () => ({
  70. foreword:'',
  71. generalSituation:'',
  72. questionSuggest:'',
  73. adminCondition :'',
  74. }),
  75. },
  76. state:{
  77. type:[String, Number],
  78. default:1,
  79. },
  80. })
  81. //事件
  82. const emit = defineEmits(['change'])
  83. const consolusionData = ref(props.consolusionData)
  84. const state = ref(props.state)
  85. //监听
  86. watch(() => [
  87. props.consolusionData,
  88. props.state,
  89. ], ([datas, state1]) => {
  90. consolusionData.value = datas
  91. state.value = state1
  92. })
  93. watch(() => [
  94. consolusionData.value,
  95. ], ([datas]) => {
  96. emit('change', datas)
  97. }, {
  98. deep: true,
  99. })
  100. //渲染完成
  101. onMounted(() => {
  102. setSplitRef()
  103. // getConclusion()
  104. })
  105. //初始化设置拖动分割线
  106. const setSplitRef = () => {
  107. //配置参考: https://split.js.org/#/?direction=vertical&snapOffset=0
  108. setTimeout(() => {
  109. window.$split(['#hc_table_container', '#hc_table_aside'], {
  110. sizes: [50, 50],
  111. snapOffset: 0,
  112. minSize: [400, 600],
  113. })
  114. window.$split(['#hc_table_data', '#hc_table_score'], {
  115. direction: 'vertical',
  116. snapOffset: 0,
  117. minSize: 200,
  118. })
  119. }, 800)
  120. }
  121. </script>
  122. <style lang='scss' scoped>
  123. .header_box{
  124. width: 100%;
  125. height: 200px;
  126. }
  127. .hc-table-layout {
  128. position: relative;
  129. height: 100%;
  130. .hc-table-aside {
  131. position: relative;
  132. height: 100%;
  133. }
  134. .hc-table-container {
  135. position: relative;
  136. display: block;
  137. height: 100%;
  138. .hc-card-item-box {
  139. height: 50%;
  140. }
  141. }
  142. }
  143. </style>
  144. <style lang="scss">
  145. .inputbox.el-textarea{
  146. height: 100%;
  147. }
  148. .inputbox .el-textarea__inner{
  149. height: 100%;
  150. }
  151. </style>