fix bugs
This commit is contained in:
@@ -32,7 +32,7 @@ const getDisplayLabel = (index) => {
|
||||
if (index === 'MultiFileUpload') {
|
||||
return 'Files Uploaded';
|
||||
} else if (index === 'SingleFileUpload') {
|
||||
return 'Parameter';
|
||||
return 'File input';
|
||||
} else if (index.includes('input_multiselect') && index.endsWith('_name')) {
|
||||
return props.scenario.inputs && Array.isArray(props.scenario.inputs) ? props.scenario.inputs.find((i) => i.name === index.replace('_name', ''))?.label : null;
|
||||
} else {
|
||||
@@ -44,16 +44,29 @@ const getDisplayLabel = (index) => {
|
||||
<template>
|
||||
<div class="box p-4 border rounded-md shadow-sm" style="background-color: white">
|
||||
<table class="table-auto w-full border-collapse border border-gray-300">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="border border-gray-300 px-4 py-2 bg-gray-500 text-white">Field</th>
|
||||
<th class="border border-gray-300 px-4 py-2 bg-gray-500 text-white">Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(input, index) in filteredInputs" :key="index">
|
||||
<th class="border border-gray-300 px-4 py-2" :class="{ 'bg-gray-500 text-white': index === 'SingleFileUpload' }">
|
||||
<tr v-for="(input, index) in filteredInputs" :key="index" v-show="!(index === 'SingleFileUpload' && filteredInputs.MultiFileUpload)">
|
||||
<th class="border border-gray-300 px-4 py-2">
|
||||
{{ getDisplayLabel(index) }}
|
||||
</th>
|
||||
<td class="border border-gray-300 px-4 py-2">
|
||||
<!-- Show file download for MultiFileUpload -->
|
||||
<div v-if="index === 'MultiFileUpload'">
|
||||
{{ filteredInputs.SingleFileUpload.replace(/\\/g, '/').split('/').pop() }}
|
||||
<Button icon="pi pi-download" class="p-button-text p-button-sm" label="Download" @click="handleDownload(inputs['SingleFileUpload'])" />
|
||||
</div>
|
||||
<!-- Show file download for SingleFileUpload when MultiFileUpload doesn't exist -->
|
||||
<div v-else-if="index === 'SingleFileUpload' && !filteredInputs.MultiFileUpload">
|
||||
{{ input.replace(/\\/g, '/').split('/').pop() }}
|
||||
<Button icon="pi pi-download" class="p-button-text p-button-sm" label="Download" @click="handleDownload(inputs['SingleFileUpload'])" />
|
||||
</div>
|
||||
<!-- Show other inputs -->
|
||||
<div v-else-if="index !== 'SingleFileUpload'">{{ input }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user