ADD: 报告生成选择检测数据源并更新监测点结果。
This commit is contained in:
@@ -3,3 +3,5 @@ import http from '@/api'
|
||||
export const getMonitorResult = (devId: string) => http.post(`/result/getMonitorResult?devId=${devId}`)
|
||||
export const getMonitorDataSourceResult = (monitorId: string) =>
|
||||
http.get(`/result/getMonitorDataSourceResult?monitorId=${monitorId}`)
|
||||
|
||||
export const updateMonitorResult = (data: any) => http.post('/result/updateMonitorResult', data)
|
||||
@@ -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
|
||||
})
|
||||
}
|
||||
|
||||
@@ -98,9 +98,8 @@
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.code || ''"
|
||||
:disabled="(selectByMode && planType == 0) || allDisabled">
|
||||
</el-option>
|
||||
/>
|
||||
:disabled="(selectByMode && planType == 0) || allDisabled"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user