แก้การแสดงผล
This commit is contained in:
parent
f93f513e5b
commit
c5456f97f4
4 changed files with 23 additions and 13 deletions
|
|
@ -2,7 +2,7 @@ import type { StorageFile } from '@/interface/response/storage'
|
|||
import config from "@/api";
|
||||
|
||||
export async function getDocumentList(volume: string, id: string) {
|
||||
const res = await fetch(`${config.API_URI}/evaluation/document/${volume}/${id}`, {
|
||||
const res = await fetch(`${config.API_URI}/document/${volume}/${id}`, {
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
},
|
||||
|
|
@ -19,7 +19,7 @@ export async function getDocumentInfo(
|
|||
id: string,
|
||||
file: string
|
||||
) {
|
||||
const res = await fetch(`${config.API_URI}/evaluation/document/${volume}/${id}/${file}`, {
|
||||
const res = await fetch(`${config.API_URI}/document/${volume}/${id}/${file}`, {
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ export const apiUrlConfig = import.meta.env.VITE_API_PUBLISH_URL
|
|||
const config = ref<any>({
|
||||
development: {
|
||||
// API_URI: "https://localhost:7260/api",
|
||||
API_URI: 'https://bma-ehr.frappet.synology.me/api/v1',
|
||||
API_URI: 'https://bma-ehr.frappet.synology.me/api/v1/evaluation',
|
||||
},
|
||||
test: {
|
||||
API_URI: 'http://localhost:5010/api/v1',
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
export interface StorageFile {
|
||||
interface StorageFile {
|
||||
pathname: string
|
||||
|
||||
fileName: string
|
||||
|
|
@ -17,4 +17,17 @@ export interface StorageFile {
|
|||
updatedBy: string
|
||||
createdAt: string | Date
|
||||
createdBy: string
|
||||
author: string
|
||||
metadata: MetadataObject
|
||||
}
|
||||
|
||||
interface MetadataObject {
|
||||
subject: string
|
||||
author: string
|
||||
position: string
|
||||
additionalProp1: string
|
||||
additionalProp3: string
|
||||
additionalProp2: string
|
||||
}
|
||||
|
||||
export type { StorageFile, MetadataObject }
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<script setup lang="ts">
|
||||
import doc from '@/api/document'
|
||||
import cover from '@/assets/cover.png'
|
||||
import type { StorageFile } from '@/interface/response/storage'
|
||||
import type { StorageFile, MetadataObject } from '@/interface/response/storage'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
|
||||
const data = ref<StorageFile & { downloadUrl: string }>()
|
||||
const metadata = ref<{ [key: string]: string }>()
|
||||
const metadata = ref<MetadataObject>()
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
|
|
@ -19,9 +19,7 @@ onMounted(async () => {
|
|||
|
||||
if (result) {
|
||||
data.value = result
|
||||
metadata.value = result.description
|
||||
? JSON.parse(result.description)
|
||||
: undefined
|
||||
metadata.value = result.metadata
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
|
@ -40,17 +38,17 @@ onMounted(async () => {
|
|||
<div class="row col-xs-12 col-sm-10 q-col-gutter-y-lg text-left">
|
||||
<div class="row col-12 q-mt-sm">
|
||||
<div class="col-4 text-title">ชื่อเรื่อง</div>
|
||||
<div class="col-8 text-body">{{ metadata?.additionalProp1 || data?.fileName }}</div>
|
||||
<div class="col-8 text-body">{{ metadata?.subject || data?.fileName }}</div>
|
||||
</div>
|
||||
|
||||
<div class="row col-12">
|
||||
<div class="col-4 text-title">เจ้าของผลงาน</div>
|
||||
<div class="col-8 text-body">{{ metadata?.additionalProp2 || '-' }}</div>
|
||||
<div class="col-8 text-body">{{ metadata?.author || data?.author }}</div>
|
||||
</div>
|
||||
|
||||
<div class="row col-12">
|
||||
<div class="col-4 text-title">ตำแหน่งที่ได้รับ</div>
|
||||
<div class="col-8 text-body">{{ metadata?.additionalProp3 || '-' }}</div>
|
||||
<div class="col-8 text-body">{{ metadata?.position || '-' }}</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="row col-12">
|
||||
|
|
@ -111,7 +109,6 @@ onMounted(async () => {
|
|||
doc.util.download(
|
||||
data.downloadUrl,
|
||||
data.fileName,
|
||||
data.fileType
|
||||
)
|
||||
"
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue