| | |
| | | <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, |
| | |
| | | loading.value = true; |
| | | tabName.value = tab.props.name; |
| | | tableData.value = []; |
| | | |
| | | pageNum.value = 1; |
| | | pageSizes.value = 10; |
| | | total.value = 0; |
| | | queryParams.searchAll = ""; |
| | | // 根据标签页类型设置对应的列配置 |
| | | const tabConfig = { |
| | | supplier: () => { |
| | |
| | | ElMessage.error("删除接口未配置"); |
| | | return; |
| | | } |
| | | |
| | | console.log(deleteIds) |
| | | const res = await deleteApi(deleteIds); |
| | | |
| | | if (res.code !== 200 && res.msg !== "操作成功") { |