| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- <script lang="ts" setup>
- // @ts-ignore
- import { ElCard, ElDescriptions, ElDescriptionsItem } from 'element-plus';
- // @ts-ignore
- import { useVbenVxeGrid } from '#/adapter/vxe-table';
- // 定义组件的Props接口
- interface TankWaterProps {
- taskDetail: any;
- }
- // 接收父组件传递的任务详情数据
- const props = defineProps<TankWaterProps>();
- // 表格列配置
- const tableColumns: any = [
- {
- field: 'tankNumber',
- title: '罐号',
- minWidth: 100,
- fixed: 'left',
- editRender: { name: 'input' },
- },
- {
- field: 'oilProduct',
- title: '油品名称',
- minWidth: 120,
- },
- {
- field: 'levelGauge',
- title: '液位仪',
- minWidth: 200,
- children: [
- {
- field: 'levelGaugeOilHeightH1',
- title: '油高h1(mm)',
- minWidth: 150,
- },
- {
- field: 'levelGaugeWaterHeight',
- title: '水高(mm)',
- minWidth: 150,
- },
- ],
- },
- {
- field: 'manualTank',
- title: '手工量缸',
- minWidth: 250,
- children: [
- {
- field: 'manualTankOilHeightH2',
- title: '油高h2(mm)',
- minWidth: 150,
- editRender: {
- name: 'input',
- immediate: true,
- },
- },
- {
- field: 'manualTankWaterHeight',
- title: '水高(mm)',
- minWidth: 150,
- },
- ],
- },
- {
- field: 'heightDifference',
- title: '高度差(mm)(h2-h1)',
- minWidth: 250,
- },
- {
- field: 'tankTemperature',
- title: '油罐温度(℃)',
- minWidth: 100,
- },
- ];
- // 初始化表格配置
- const gridOptions: any = {
- size: 'medium',
- toolbarConfig: {
- custom: false,
- refresh: false,
- zoom: false,
- },
- pagerConfig: {
- enabled: false,
- },
- proxyConfig: {
- ajax: {
- query: async () => {
- return {
- items: props.taskDetail?.formTankWaterRecords || [],
- };
- },
- },
- },
- columns: tableColumns,
- };
- // 使用BasicTable组件
- const [BasicTable] = useVbenVxeGrid({
- gridOptions,
- });
- </script>
- <template>
- <ElCard>
- <template #header>
- <div class="flex items-center gap-4">
- <div style="width: 4px; height: 12px; background-color: #215acd"></div>
- <span
- class="text-lg font-bold text-gray-800"
- style="font-size: 14px; font-weight: 600"
- >
- 量缸试水详情
- </span>
- </div>
- </template>
- <div class="task-info">
- <ElDescriptions :column="1" class="mb-6">
- <ElDescriptionsItem label="开始测量时间:">
- {{ taskDetail?.measurementStartTime || '-' }}
- </ElDescriptionsItem>
- <ElDescriptionsItem label="异常记录:">
- {{ taskDetail?.abnormalDescription || '-' }}
- </ElDescriptionsItem>
- </ElDescriptions>
- <div class="section-title">
- <div class="section-bar"></div>
- <div class="section-text">测量信息</div>
- </div>
- <BasicTable table-title="" class="mt-4 w-full" />
- </div>
- </ElCard>
- </template>
- <style scoped lang="scss">
- .task-info {
- .section-title {
- display: flex;
- align-items: center;
- gap: 8px;
- margin: 20px 0 12px 0;
- .section-bar {
- width: 4px;
- height: 12px;
- background-color: #215acd;
- }
- .section-text {
- font-size: 14px;
- font-weight: 600;
- color: var(--text-color-primary);
- }
- }
- :deep(.el-descriptions) {
- margin-bottom: 0 !important;
- }
- :deep(.el-descriptions__label) {
- font-size: 14px;
- font-weight: 400;
- color: var(--text-color-secondary);
- }
- :deep(.el-descriptions__content) {
- font-size: 14px;
- font-weight: 500;
- color: var(--text-color-primary);
- }
- :deep(.el-descriptions__table) {
- background: transparent !important;
- }
- :deep(.el-table) {
- margin-top: 12px;
- }
- :deep(.el-table__header-wrapper) {
- background-color: #f5f7fa;
- }
- :deep(.el-table th) {
- font-weight: 600;
- color: var(--text-color-primary);
- }
- }
- </style>
|