feat: implement media download functionality and enhance case handling in reports
This commit is contained in:
@@ -11,6 +11,7 @@ import ReportSectionCard from '../../../components/dashboard/cases/ReportSection
|
||||
import FileUploadBox from '../../../components/dashboard/fastRequest/FileUploadBox.vue';
|
||||
import { modalityTitle } from '../../../data/fastRequestOptions';
|
||||
import { convertEnglishToPersian } from '../../../utils/numberUtils';
|
||||
import { downloadFiles } from '../../../utils/fileUtils';
|
||||
|
||||
const props = defineProps({
|
||||
case: {
|
||||
@@ -73,10 +74,6 @@ onMounted(() => {
|
||||
|
||||
onUnmounted(() => clearInterval(timerId));
|
||||
|
||||
const openFiles = (files) => {
|
||||
files.forEach((file) => window.open(file.url, '_blank'));
|
||||
};
|
||||
|
||||
const reportForm = useForm({
|
||||
document_id: props.case.id,
|
||||
technique: props.case.report?.technique || '',
|
||||
@@ -149,9 +146,9 @@ const submitReject = () => {
|
||||
<p class="font-normal text-[#3E4C63] whitespace-pre-line">{{ props.case.note || 'توضیحی ثبت نشده است.' }}</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-3 flex-wrap pt-2 border-t border-[#EBEBEB]">
|
||||
<UiButton label="دانلود فایل درخواست" severity="secondary" size="small" :disabled="!props.case.primary_files.length" @click="openFiles(props.case.primary_files)" />
|
||||
<UiButton label="دانلود سوابق پزشکی قبلی" severity="secondary" size="small" :disabled="!props.case.history_files.length" @click="openFiles(props.case.history_files)" />
|
||||
<UiButton v-if="!canReport && props.case.report" label="دانلود فایل گزارش" severity="secondary" size="small" :disabled="!props.case.report.attachments.length" @click="openFiles(props.case.report.attachments)" />
|
||||
<UiButton label="دانلود فایل درخواست" severity="secondary" size="small" :disabled="!props.case.primary_files.length" @click="downloadFiles(props.case.primary_files)" />
|
||||
<UiButton label="دانلود سوابق پزشکی قبلی" severity="secondary" size="small" :disabled="!props.case.history_files.length" @click="downloadFiles(props.case.history_files)" />
|
||||
<UiButton v-if="!canReport && props.case.report" label="دانلود فایل گزارش" severity="secondary" size="small" :disabled="!props.case.report.attachments.length" @click="downloadFiles(props.case.report.attachments)" />
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user