fix(anesthesia): 修复Mapper XML缺失+recordId硬编码
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.healthlink.his.anesthesia.mapper.AnesAsaAssessmentMapper">
|
||||||
|
<select id="selectByRecordId" resultType="com.healthlink.his.anesthesia.domain.AnesAsaAssessment">
|
||||||
|
SELECT * FROM anes_asa_assessment WHERE record_id = #{recordId} AND delete_flag = '0' ORDER BY assessment_time DESC
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -191,10 +191,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted } from 'vue'
|
import { ref, reactive, onMounted, watch } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { saveAsaAssessment, getAsaAssessments } from '@/api/anesthesia'
|
import { saveAsaAssessment, getAsaAssessments } from '@/api/anesthesia'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
recordId: { type: [Number, String], default: null }
|
||||||
|
})
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const submitLoading = ref(false)
|
const submitLoading = ref(false)
|
||||||
const tableData = ref([])
|
const tableData = ref([])
|
||||||
@@ -313,8 +317,9 @@ function handleSave() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadData() {
|
function loadData() {
|
||||||
|
if (!props.recordId) return
|
||||||
loading.value = true
|
loading.value = true
|
||||||
getAsaAssessments(1).then(res => {
|
getAsaAssessments(props.recordId).then(res => {
|
||||||
tableData.value = res.data || []
|
tableData.value = res.data || []
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
ElMessage.error('查询失败')
|
ElMessage.error('查询失败')
|
||||||
@@ -323,6 +328,10 @@ function loadData() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(() => props.recordId, () => {
|
||||||
|
loadData()
|
||||||
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
loadData()
|
loadData()
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user