比对模式根据配置文件动态展示原始数据、历史趋势图
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据原则">
|
||||
<!-- <el-input v-model="formContent.dataRule" :disabled="true" />-->
|
||||
<!-- <el-input v-model="formContent.dataRule" :disabled="true" />-->
|
||||
<el-select
|
||||
:disabled="checkStore.showDetailType === 2 || checkStore.showDetailType === 0"
|
||||
v-model="formContent.dataRule"
|
||||
@@ -45,11 +45,11 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称">
|
||||
<el-input v-model="formContent.deviceName" :disabled="true" />
|
||||
<el-input v-model="formContent.deviceName" :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="通道号">
|
||||
<el-select v-model="formContent.chnNum" @change="handleChnNumChange" :disabled="sourceKey == 1">
|
||||
<el-option v-for="item in chnList" :key="item" :label="item" :value="item" />
|
||||
<el-option v-for="item in chnList" :key="item" :label="item" :value="item"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="检测次数">
|
||||
@@ -115,7 +115,7 @@
|
||||
:value="item.value"
|
||||
>
|
||||
<div style="display: flex; align-items: center; justify-content: space-between">
|
||||
<span v-if="item.resultFlag === 1" >{{ item.label }}</span>
|
||||
<span v-if="item.resultFlag === 1">{{ item.label }}</span>
|
||||
<span v-else-if="item.resultFlag === 2" style="color: #ee6666;">{{ item.label }}</span>
|
||||
<span v-else-if="item.resultFlag === 4" style="color: #fac858;">{{ item.label }}</span>
|
||||
</div>
|
||||
@@ -137,7 +137,7 @@
|
||||
v-if="isWaveData"
|
||||
>
|
||||
<el-select v-model="waveNumber" @change="handleWaveNumberChange">
|
||||
<el-option v-for="i in waveNumCount" :key="i" :label="i" :value="i" />
|
||||
<el-option v-for="i in waveNumCount" :key="i" :label="i" :value="i"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
@@ -165,7 +165,7 @@
|
||||
:currentScriptTypeName="currentScriptTypeName"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="原始数据" name="rawDataTab">
|
||||
<el-tab-pane label="原始数据" name="rawDataTab" v-if="!isBusiness">
|
||||
<CompareDataCheckRawDataTable
|
||||
v-if="activeTab === 'rawDataTab'"
|
||||
:tableData="rawTableData.length == 0 ? [] : currentRawTableData"
|
||||
@@ -173,7 +173,7 @@
|
||||
:currentScriptTypeName="currentScriptTypeName"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="历史趋势" name="chartTab" v-if="!isWaveData">
|
||||
<el-tab-pane label="历史趋势" name="chartTab" v-if="!isWaveData&&!isBusiness">
|
||||
<CompareDataCheckChart
|
||||
v-if="activeTab === 'chartTab'"
|
||||
:tableData="rawTableData.length == 0 ? [] : currentRawTableData"
|
||||
@@ -187,29 +187,24 @@
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { dialogBig } from '@/utils/elementBind'
|
||||
import { computed, reactive, ref } from 'vue'
|
||||
import {dialogBig} from '@/utils/elementBind'
|
||||
import {computed, reactive, ref} from 'vue'
|
||||
import CompareDataCheckResultTable from './compareDataCheckResultTable.vue'
|
||||
import CompareDataCheckRawDataTable from './compareDataCheckRawDataTable.vue'
|
||||
import CompareDataCheckChart from './compareDataCheckChart.vue'
|
||||
import { CheckData } from '@/api/check/interface'
|
||||
import { useCheckStore } from '@/stores/modules/check'
|
||||
import { Histogram, Postcard } from '@element-plus/icons-vue'
|
||||
import {CheckData} from '@/api/check/interface'
|
||||
import {useCheckStore} from '@/stores/modules/check'
|
||||
import {Histogram, Postcard} from '@element-plus/icons-vue'
|
||||
import {generateDevReport, getPqErrSysList} from '@/api/plan/plan'
|
||||
import { useModeStore } from '@/stores/modules/mode' // 引入模式 store
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import {
|
||||
changeErrorSystem,
|
||||
deleteTempTable,
|
||||
getContrastFormContent,
|
||||
getContrastResult,
|
||||
getScriptList,
|
||||
reCalculate
|
||||
} from '@/api/check/test'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ResultEnum } from '@/enums/httpEnum'
|
||||
import {useModeStore} from '@/stores/modules/mode' // 引入模式 store
|
||||
import {useDictStore} from '@/stores/modules/dict'
|
||||
import {changeErrorSystem, deleteTempTable, getContrastFormContent, getContrastResult, getScriptList, reCalculate} from '@/api/check/test'
|
||||
import {ElMessage} from 'element-plus'
|
||||
import {ResultEnum} from '@/enums/httpEnum'
|
||||
|
||||
const { appendToBody = true } = defineProps<{
|
||||
const isShowRawData = import.meta.env.VITE_IS_SHOW_RAW_DATA
|
||||
|
||||
const {appendToBody = true} = defineProps<{
|
||||
appendToBody: boolean
|
||||
}>()
|
||||
|
||||
@@ -237,7 +232,7 @@ const selectedScriptName = ref('')
|
||||
const pattern = ref('')
|
||||
// 添加以下内容
|
||||
const isWaveData = ref(false)
|
||||
const scriptNameOptions = ref<{ label: string; value: string;resultFlag:number }[]>([])
|
||||
const scriptNameOptions = ref<{ label: string; value: string; resultFlag: number }[]>([])
|
||||
|
||||
// 表单数据
|
||||
const formContent = reactive<CheckData.DataCheck>({
|
||||
@@ -275,6 +270,11 @@ const currentRawTableData = computed(() => {
|
||||
return Array.isArray(data) ? data : []
|
||||
})
|
||||
|
||||
const isBusiness = computed(() => {
|
||||
console.log(isShowRawData)
|
||||
return modeStore.currentMode === '比对式' && isShowRawData
|
||||
})
|
||||
|
||||
const open = async (row: any, chnNum: string, deviceId: string | null, source: number) => {
|
||||
activeTab.value = 'resultTab'
|
||||
isWaveData.value = false
|
||||
@@ -302,7 +302,7 @@ const open = async (row: any, chnNum: string, deviceId: string | null, source: n
|
||||
|
||||
pqErrorList.length = 0
|
||||
// 获取误差体系
|
||||
let { data: resPqErrorList } = await getPqErrSysList()
|
||||
let {data: resPqErrorList} = await getPqErrSysList()
|
||||
Object.assign(pqErrorList, resPqErrorList)
|
||||
|
||||
initGetResult()
|
||||
@@ -319,7 +319,7 @@ const initGetResult = async () => {
|
||||
scriptNameOptions.value = selectScript.value.map(item => ({
|
||||
label: item.scriptName,
|
||||
value: item.scriptName,
|
||||
resultFlag: item.resultFlag?? 0
|
||||
resultFlag: item.resultFlag ?? 0
|
||||
}))
|
||||
|
||||
// 默认选中第一个选项
|
||||
@@ -345,7 +345,7 @@ const initScriptData = async () => {
|
||||
chnNum: formContent.chnNum,
|
||||
num: formContent.num,
|
||||
planId: checkStore.plan.id,
|
||||
code: checkStore.plan.code + (formContent.errorSysId!=checkStore.plan.errorSysId || formContent.dataRule!=checkStore.plan.dataRule? '_temp':'')
|
||||
code: checkStore.plan.code + (formContent.errorSysId != checkStore.plan.errorSysId || formContent.dataRule != checkStore.plan.dataRule ? '_temp' : '')
|
||||
})
|
||||
|
||||
// 格式化脚本数据
|
||||
@@ -539,7 +539,7 @@ const getResults = async (code: any) => {
|
||||
waveNum: isWaveDataRequest ? waveNumber.value : null,
|
||||
isWave: isWaveDataRequest,
|
||||
patternId: pattern.value,
|
||||
code: checkStore.plan.code + (formContent.errorSysId!=checkStore.plan.errorSysId || formContent.dataRule!=checkStore.plan.dataRule? '_temp':'')
|
||||
code: checkStore.plan.code + (formContent.errorSysId != checkStore.plan.errorSysId || formContent.dataRule != checkStore.plan.dataRule ? '_temp' : '')
|
||||
}).then((res: any) => {
|
||||
let list: string[] = []
|
||||
for (let key in res.data.resultMap) {
|
||||
@@ -580,7 +580,7 @@ const close = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const handleErrorSysChange = async (msg:string) => {
|
||||
const handleErrorSysChange = async (msg: string) => {
|
||||
changeErrorSystem({
|
||||
planId: checkStore.plan.id,
|
||||
scriptId: '',
|
||||
@@ -621,10 +621,10 @@ const handleGenerateReport = async () => {
|
||||
planId: checkStore.plan.id,
|
||||
devIdList: [formContent.deviceId],
|
||||
scriptId: checkStore.plan.scriptId,
|
||||
planCode: checkStore.plan.code + (formContent.errorSysId!=checkStore.plan.errorSysId||formContent.dataRule!=checkStore.plan.dataRule ? '_temp':'')
|
||||
planCode: checkStore.plan.code + (formContent.errorSysId != checkStore.plan.errorSysId || formContent.dataRule != checkStore.plan.dataRule ? '_temp' : '')
|
||||
}).then(res => {
|
||||
if (res.code === ResultEnum.SUCCESS) {
|
||||
ElMessage.success({ message: `报告生成成功!` })
|
||||
ElMessage.success({message: `报告生成成功!`})
|
||||
handleChnNumChange(formContent.chnNum)
|
||||
}
|
||||
})
|
||||
@@ -689,6 +689,7 @@ defineExpose({
|
||||
overflow-y: auto;
|
||||
overflow-x: auto;
|
||||
margin-right: 10px;
|
||||
|
||||
.content-tree {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@@ -725,10 +726,12 @@ defineExpose({
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
|
||||
.el-tabs {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.content-left {
|
||||
height: 100%;
|
||||
border: 1px solid #e0e0e0;
|
||||
@@ -740,6 +743,7 @@ defineExpose({
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-tabs--border-card > .el-tabs__content) {
|
||||
height: 367px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user