| | |
| | | <div> |
| | | <data-table :loading="loading" :table-data="tableData" :columns="columns" |
| | | @selection-change="handleSelectionChange" @edit="handleEdit" :show-selection="true" :border="true"> <!-- 字段名称列的自定义插槽 - 显示为标签 --> |
| | | <template v-if="tabName === 'coalQualityMaintenance'" #coalFields="{ row }"> |
| | | <template v-if="typeof row.coalFields === 'string' && row.coalFields.includes(',')"> |
| | | <el-tag v-for="(field, index) in row.coalFields.split(',')" :key="index" type="primary" size="small" |
| | | <template v-if="tabName === 'coalQualityMaintenance'" #fieldIds="{ row }"> |
| | | <template v-if="typeof row.fieldIds === 'string' && row.fieldIds.includes(',')"> |
| | | <el-tag v-for="(field, index) in row.fieldIds.split(',')" :key="index" type="primary" size="small" |
| | | style="margin-right: 4px; margin-bottom: 2px;"> |
| | | {{ getFieldDisplayName(field.trim()) }} |
| | | </el-tag> |
| | | </template> |
| | | <template v-else> |
| | | <el-tag type="primary" size="small"> |
| | | {{ getFieldDisplayName(row.coalFields) || '--' }} |
| | | {{ getFieldDisplayName(row.fieldIds) || '--' }} |
| | | </el-tag> |
| | | </template> |
| | | </template> |
| | |
| | | const coalQualityMaintenanceColumns = ref([ |
| | | { prop: "plan", label: "方案名称", minWidth: 100 }, |
| | | { |
| | | prop: "coalFields", |
| | | prop: "fieldIds", |
| | | label: "字段名称", |
| | | minWidth: 200, |
| | | showOverflowTooltip: true, |