feat (soapi): adjust list
This commit is contained in:
@@ -9,7 +9,7 @@ import { toast } from '~/components/pub/ui/toast'
|
||||
import { handleActionSave, handleActionEdit } from '~/handlers/soapi-early.handler'
|
||||
|
||||
const { goToEntry, backToList } = useQueryCRUDMode('mode')
|
||||
const { recordId } = useQueryCRUDMode('record-id')
|
||||
const { recordId } = useQueryCRUDRecordId('record-id')
|
||||
const route = useRoute()
|
||||
const isOpenProcedure = ref(false)
|
||||
const isOpenDiagnose = ref(false)
|
||||
@@ -45,11 +45,24 @@ const isLoading = reactive<DataTableLoader>({
|
||||
isTableLoading: false,
|
||||
})
|
||||
|
||||
async function getDiagnoses() {
|
||||
async function getDetail() {
|
||||
isLoading.isTableLoading = true
|
||||
const resp = await xfetch(`/api/v1/soapi/${recordId}`)
|
||||
const resp = await xfetch(`/api/v1/soapi/${recordId.value}`)
|
||||
if (resp.success) {
|
||||
diagnoses.value = (resp.body as Record<string, any>).data
|
||||
const raw = (resp.body as Record<string, any>).data
|
||||
const values = JSON.parse(raw.value)
|
||||
console.log('values', values)
|
||||
model.value = values
|
||||
// diagnoses.value = (resp.body as Record<string, any>).data
|
||||
}
|
||||
isLoading.isTableLoading = false
|
||||
}
|
||||
|
||||
async function getDiagnose() {
|
||||
isLoading.isTableLoading = true
|
||||
const resp = await xfetch('/api/v1/diagnose-src')
|
||||
if (resp.success) {
|
||||
procedures.value = (resp.body as Record<string, any>).data
|
||||
}
|
||||
isLoading.isTableLoading = false
|
||||
}
|
||||
@@ -64,8 +77,7 @@ async function getProcedures() {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getProcedures()
|
||||
getDiagnoses()
|
||||
getDetail()
|
||||
})
|
||||
|
||||
function handleOpen(type: string) {
|
||||
@@ -124,6 +136,7 @@ provide('table_data_loader', isLoading)
|
||||
provide('icdPreview', icdPreview)
|
||||
</script>
|
||||
<template>
|
||||
{{ model }}
|
||||
<Entry
|
||||
ref="entryRef"
|
||||
v-model="model"
|
||||
|
||||
Reference in New Issue
Block a user