ADD: 报告生成选择检测数据源并更新监测点结果。

This commit is contained in:
贾同学
2025-09-15 10:38:14 +08:00
parent b27615baaf
commit 09b54a29ab
3 changed files with 13 additions and 9 deletions

View File

@@ -104,7 +104,7 @@
</el-dialog>
</template>
<script setup lang="ts" name="reportPopup">
import { getMonitorDataSourceResult, getMonitorResult } from '@/api/result/result'
import { getMonitorDataSourceResult, getMonitorResult, updateMonitorResult } from '@/api/result/result'
import { type MonitorResult } from '@/api/result/interface'
const dialogVisible = ref(false)
@@ -117,6 +117,7 @@ const whichTimeData = ref<any>([])
const sourceData = ref<any>([])
const formRef = ref()
const submitSourceData = reactive({
monitorId: '',
whichTime: '',
resultType: '',
checkResult: -1
@@ -145,6 +146,7 @@ const handleTabClick = (tab: any) => {
const handleChooseClick = async () => {
const currentResult = resultData.value[activeName.value]
if (currentResult) {
submitSourceData.monitorId = currentResult.monitorId
submitSourceData.whichTime = currentResult.whichTime
submitSourceData.resultType = currentResult.resultType
submitSourceData.checkResult = currentResult.checkResult
@@ -169,8 +171,9 @@ const handleSourceChange = (value: any) => {
).checkResult
}
const handleSureChoose = () => {
formRef.value.validate().then(() => {
console.log(submitSourceData)
formRef.value.validate().then(async () => {
await updateMonitorResult(submitSourceData)
await getResultData()
dialogSourceVisible.value = false
})
}