ADD: 报告生成选择检测数据源并更新监测点结果。
This commit is contained in:
@@ -2,4 +2,6 @@ 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)
|
||||||
@@ -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
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,12 +98,11 @@
|
|||||||
: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>
|
||||||
|
|
||||||
<el-form-item v-if="!selectByMode" :label-width="110" label="检测脚本" prop="scriptId">
|
<el-form-item v-if="!selectByMode" :label-width="110" label="检测脚本" prop="scriptId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="formContent.scriptId"
|
v-model="formContent.scriptId"
|
||||||
@@ -885,7 +884,7 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan:
|
|||||||
if (Array.isArray(user_Result.data)) {
|
if (Array.isArray(user_Result.data)) {
|
||||||
if (user_Result.data.length > 0) {
|
if (user_Result.data.length > 0) {
|
||||||
// 为leaderData和memberData分别创建独立的对象数组
|
// 为leaderData和memberData分别创建独立的对象数组
|
||||||
|
|
||||||
leaderData.value = user_Result.data
|
leaderData.value = user_Result.data
|
||||||
.filter((user: any) => !user.roleCodes.includes('root'))
|
.filter((user: any) => !user.roleCodes.includes('root'))
|
||||||
.map((user: any) => ({
|
.map((user: any) => ({
|
||||||
|
|||||||
Reference in New Issue
Block a user