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

@@ -3,3 +3,5 @@ import http from '@/api'
export const getMonitorResult = (devId: string) => http.post(`/result/getMonitorResult?devId=${devId}`) export const getMonitorResult = (devId: string) => http.post(`/result/getMonitorResult?devId=${devId}`)
export const getMonitorDataSourceResult = (monitorId: string) => export const getMonitorDataSourceResult = (monitorId: string) =>
http.get(`/result/getMonitorDataSourceResult?monitorId=${monitorId}`) http.get(`/result/getMonitorDataSourceResult?monitorId=${monitorId}`)
export const updateMonitorResult = (data: any) => http.post('/result/updateMonitorResult', data)

View File

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

View File

@@ -98,9 +98,8 @@
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.code || ''" :value="item.code || ''"
:disabled="(selectByMode && planType == 0) || allDisabled"> :disabled="(selectByMode && planType == 0) || allDisabled"
</el-option> ></el-option>
/>
</el-select> </el-select>
</el-form-item> </el-form-item>