Nav apraksta

tank-water.vue 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <script lang="ts" setup>
  2. // @ts-ignore
  3. import { ElCard, ElDescriptions, ElDescriptionsItem } from 'element-plus';
  4. // @ts-ignore
  5. import { useVbenVxeGrid } from '#/adapter/vxe-table';
  6. // 定义组件的Props接口
  7. interface TankWaterProps {
  8. taskDetail: any;
  9. }
  10. // 接收父组件传递的任务详情数据
  11. const props = defineProps<TankWaterProps>();
  12. // 表格列配置
  13. const tableColumns: any = [
  14. {
  15. field: 'tankNumber',
  16. title: '罐号',
  17. minWidth: 100,
  18. fixed: 'left',
  19. editRender: { name: 'input' },
  20. },
  21. {
  22. field: 'oilProduct',
  23. title: '油品名称',
  24. minWidth: 120,
  25. },
  26. {
  27. field: 'levelGauge',
  28. title: '液位仪',
  29. minWidth: 200,
  30. children: [
  31. {
  32. field: 'levelGaugeOilHeightH1',
  33. title: '油高h1(mm)',
  34. minWidth: 150,
  35. },
  36. {
  37. field: 'levelGaugeWaterHeight',
  38. title: '水高(mm)',
  39. minWidth: 150,
  40. },
  41. ],
  42. },
  43. {
  44. field: 'manualTank',
  45. title: '手工量缸',
  46. minWidth: 250,
  47. children: [
  48. {
  49. field: 'manualTankOilHeightH2',
  50. title: '油高h2(mm)',
  51. minWidth: 150,
  52. editRender: {
  53. name: 'input',
  54. immediate: true,
  55. },
  56. },
  57. {
  58. field: 'manualTankWaterHeight',
  59. title: '水高(mm)',
  60. minWidth: 150,
  61. },
  62. ],
  63. },
  64. {
  65. field: 'heightDifference',
  66. title: '高度差(mm)(h2-h1)',
  67. minWidth: 250,
  68. },
  69. {
  70. field: 'tankTemperature',
  71. title: '油罐温度(℃)',
  72. minWidth: 100,
  73. },
  74. ];
  75. // 初始化表格配置
  76. const gridOptions: any = {
  77. size: 'medium',
  78. toolbarConfig: {
  79. custom: false,
  80. refresh: false,
  81. zoom: false,
  82. },
  83. pagerConfig: {
  84. enabled: false,
  85. },
  86. proxyConfig: {
  87. ajax: {
  88. query: async () => {
  89. return {
  90. items: props.taskDetail?.formTankWaterRecords || [],
  91. };
  92. },
  93. },
  94. },
  95. columns: tableColumns,
  96. };
  97. // 使用BasicTable组件
  98. const [BasicTable] = useVbenVxeGrid({
  99. gridOptions,
  100. });
  101. </script>
  102. <template>
  103. <ElCard>
  104. <template #header>
  105. <div class="flex items-center gap-4">
  106. <div style="width: 4px; height: 12px; background-color: #215acd"></div>
  107. <span
  108. class="text-lg font-bold text-gray-800"
  109. style="font-size: 14px; font-weight: 600"
  110. >
  111. 量缸试水详情
  112. </span>
  113. </div>
  114. </template>
  115. <div class="task-info">
  116. <ElDescriptions :column="1" class="mb-6">
  117. <ElDescriptionsItem label="开始测量时间:">
  118. {{ taskDetail?.measurementStartTime || '-' }}
  119. </ElDescriptionsItem>
  120. <ElDescriptionsItem label="异常记录:">
  121. {{ taskDetail?.abnormalDescription || '-' }}
  122. </ElDescriptionsItem>
  123. </ElDescriptions>
  124. <div class="section-title">
  125. <div class="section-bar"></div>
  126. <div class="section-text">测量信息</div>
  127. </div>
  128. <BasicTable table-title="" class="mt-4 w-full" />
  129. </div>
  130. </ElCard>
  131. </template>
  132. <style scoped lang="scss">
  133. .task-info {
  134. .section-title {
  135. display: flex;
  136. align-items: center;
  137. gap: 8px;
  138. margin: 20px 0 12px 0;
  139. .section-bar {
  140. width: 4px;
  141. height: 12px;
  142. background-color: #215acd;
  143. }
  144. .section-text {
  145. font-size: 14px;
  146. font-weight: 600;
  147. color: var(--text-color-primary);
  148. }
  149. }
  150. :deep(.el-descriptions) {
  151. margin-bottom: 0 !important;
  152. }
  153. :deep(.el-descriptions__label) {
  154. font-size: 14px;
  155. font-weight: 400;
  156. color: var(--text-color-secondary);
  157. }
  158. :deep(.el-descriptions__content) {
  159. font-size: 14px;
  160. font-weight: 500;
  161. color: var(--text-color-primary);
  162. }
  163. :deep(.el-descriptions__table) {
  164. background: transparent !important;
  165. }
  166. :deep(.el-table) {
  167. margin-top: 12px;
  168. }
  169. :deep(.el-table__header-wrapper) {
  170. background-color: #f5f7fa;
  171. }
  172. :deep(.el-table th) {
  173. font-weight: 600;
  174. color: var(--text-color-primary);
  175. }
  176. }
  177. </style>