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