<!-- 核查数据管理详情--核查项---第10套:信号发生器检定装置 -->
<script lang="ts" setup name="checkDataDetail">
import { ref, watch } from 'vue'
import { ElLoading, ElMessage } from 'element-plus'
import saveCheckRecord from '../../dialog/saveCheckRecord.vue'
import { clearDateValue, handleDetailTableTableHead, handleSaveDateParams, solveHistoryIndicationTableData } from '../useStabilityCaculate'
import type { IList } from './tenth-interface'
import type { TableColumn } from '@/components/NormalTable/table_interface'
import useUserStore from '@/store/modules/user'
import type { dictType } from '@/global'
import { getDictByCode } from '@/api/system/dict'
import { useCheckList } from '@/commonMethods/useCheckList'
import { useScientificNotation } from '@/commonMethods/useScientificNotation'
import multiTable from '@/components/MultiHeaderTable/index.vue'
import { addCheckData, calculateHandle, getHistoryIndication, getInfo, updateCheckData } from '@/api/equipment/standard/checkData'
import { getCheckItemDetail, getJobInstructionList } from '@/api/equipment/standard/book'
import { getDataNum, getDataUnit } from '@/utils/validate'
import { removeLetters } from '@/utils/String'
const props = defineProps({
selectStandardId: { // 选择的标准装置id
type: String,
},
pageType: { // 页面类型
type: String,
},
checkDate: { // 核查日期
type: String,
},
})
const emits = defineEmits(['isConfigCheck'])
const user = useUserStore() // 用户信息
const $router = useRouter() // 关闭页面使用
const $route = useRoute() // 路由参数
const infoId = ref('')
const belongStandardEquipment = ref('10')
const itemCategoryId = ref('') // 核查项分类id
const itemCategoryName = ref('') // 核查项分类名称
const form = ref({
remark: '/', // 备注
qualified: '', // 稳定性考核是否合格
})
const equipmentId = ref('') // 设备id
const dateArrStability = ref<string[]>([]) // 稳定性日期数组
const currentDate = ref('') // 要查询历史稳定性的日期
// ----------------------------------路由参数------------------------------------------------
if ($route.params && $route.params.type) {
if ($route.params.id) {
infoId.value = $route.params.id as string
}
}
// ----------------------------------------核查数据----------------------------------------------
const radioMenus = ref([ // 标签内容
{ name: '重复性', value: 'repeatability' },
{ name: '稳定性', value: 'stability' },
])
const current = ref('repeatability') // 选择的tab 默认基本信息
const columns_repeatability_frequency = ref<TableColumn[]>([ // 重复性表头--频率
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: 'indicatingValue',
align: 'center',
required: false,
width: '180',
children: [
{ text: 'X1', value: 'testValueOne', align: 'center', required: true, width: '220', type: 'inputNumber', showUnit: true },
{ text: 'X2', value: 'testValueTwo', align: 'center', required: true, width: '220', type: 'inputNumber', showUnit: true },
{ text: 'X3', value: 'testValueThree', align: 'center', required: true, width: '220', type: 'inputNumber', showUnit: true },
{ text: 'X4', value: 'testValueFour', align: 'center', required: true, width: '220', type: 'inputNumber', showUnit: true },
{ text: 'X5', value: 'testValueFive', align: 'center', required: true, width: '220', type: 'inputNumber', showUnit: true },
{ text: 'X6', value: 'testValueSix', align: 'center', required: true, width: '220', type: 'inputNumber', showUnit: true },
{ text: 'X7', value: 'testValueSeven', align: 'center', required: true, width: '220', type: 'inputNumber', showUnit: true },
{ text: 'X8', value: 'testValueEight', align: 'center', required: true, width: '220', type: 'inputNumber', showUnit: true },
{ text: 'X9', value: 'testValueNine', align: 'center', required: true, width: '220', type: 'inputNumber', showUnit: true },
{ text: 'X10', value: 'testValueTen', align: 'center', required: true, width: '220', type: 'inputNumber', showUnit: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '重复性S(x)/x', value: 'standardDeviation', align: 'center', required: false, type: 'text' },
])
const columns_repeatability_power_level = ref<TableColumn[]>([ // 重复性表头--功率
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{ text: '功率', value: 'powerDefineFront', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: 'indicatingValue',
align: 'center',
required: false,
width: '180',
children: [
{ text: 'X1', value: 'testValueOne', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X2', value: 'testValueTwo', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X3', value: 'testValueThree', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X4', value: 'testValueFour', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X5', value: 'testValueFive', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X6', value: 'testValueSix', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X7', value: 'testValueSeven', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X8', value: 'testValueEight', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X9', value: 'testValueNine', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X10', value: 'testValueTen', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '重复性S(x)/x', value: 'standardDeviation', align: 'center', required: false, type: 'text' },
])
const columns_repeatability_relative_level = ref<TableColumn[]>([ // 重复性表头--相对电平
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{ text: '相对电平', value: 'relativeLevelDefineFront', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: 'indicatingValue',
align: 'center',
required: false,
width: '180',
children: [
{ text: 'X1', value: 'testValueOne', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X2', value: 'testValueTwo', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X3', value: 'testValueThree', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X4', value: 'testValueFour', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X5', value: 'testValueFive', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X6', value: 'testValueSix', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X7', value: 'testValueSeven', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X8', value: 'testValueEight', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X9', value: 'testValueNine', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X10', value: 'testValueTen', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '重复性S(x)/x', value: 'standardDeviation', align: 'center', required: false, type: 'text' },
])
const columns_repeatability_AM_depth = ref<TableColumn[]>([ // 重复性表头--调幅度
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{ text: '调幅度', value: 'modulation', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: 'indicatingValue',
align: 'center',
required: false,
width: '180',
children: [
{ text: 'X1', value: 'testValueOne', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X2', value: 'testValueTwo', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X3', value: 'testValueThree', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X4', value: 'testValueFour', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X5', value: 'testValueFive', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X6', value: 'testValueSix', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X7', value: 'testValueSeven', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X8', value: 'testValueEight', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X9', value: 'testValueNine', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X10', value: 'testValueTen', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '重复性S(x)/x', value: 'standardDeviation', align: 'center', required: false, type: 'text' },
])
const columns_repeatability_frequency_modulation_deviation = ref<TableColumn[]>([ // 重复性表头--调频频偏
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{ text: '调频频偏', value: 'frequencyDeviationDefineFront', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: 'indicatingValue',
align: 'center',
required: false,
width: '180',
children: [
{ text: 'X1', value: 'testValueOne', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X2', value: 'testValueTwo', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X3', value: 'testValueThree', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X4', value: 'testValueFour', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X5', value: 'testValueFive', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X6', value: 'testValueSix', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X7', value: 'testValueSeven', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X8', value: 'testValueEight', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X9', value: 'testValueNine', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X10', value: 'testValueTen', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '重复性S(x)/x', value: 'standardDeviation', align: 'center', required: false, type: 'text' },
])
const columns_repeatability_phase = ref<TableColumn[]>([ // 重复性表头--调相相偏
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{ text: '调相相偏', value: 'phaseDeviationDefineFront', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: 'indicatingValue',
align: 'center',
required: false,
width: '180',
children: [
{ text: 'X1', value: 'testValueOne', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X2', value: 'testValueTwo', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X3', value: 'testValueThree', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X4', value: 'testValueFour', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X5', value: 'testValueFive', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X6', value: 'testValueSix', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X7', value: 'testValueSeven', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X8', value: 'testValueEight', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X9', value: 'testValueNine', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X10', value: 'testValueTen', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '重复性S(x)/x', value: 'standardDeviation', align: 'center', required: false, type: 'text' },
])
const columns_repeatability_frequency_spectrum = ref<TableColumn[]>([ // 重复性表头--谐波
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: 'indicatingValue',
align: 'center',
required: false,
width: '180',
children: [
{ text: 'X1', value: 'testValueOne', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X2', value: 'testValueTwo', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X3', value: 'testValueThree', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X4', value: 'testValueFour', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X5', value: 'testValueFive', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X6', value: 'testValueSix', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X7', value: 'testValueSeven', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X8', value: 'testValueEight', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X9', value: 'testValueNine', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
{ text: 'X10', value: 'testValueTen', align: 'center', required: true, width: '220', type: 'inputNumber', precision: 3, showUnit: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '重复性S(x)', value: 'standardDeviation', align: 'center', required: false, type: 'text' },
])
const columns_stability_frequency = ref<TableColumn[]>([ // 稳定性表头--频率
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: '-',
align: 'center',
required: false,
width: '180',
children: [
{ width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' },
{ text: 'U(k=2)', value: 'urel', align: 'center', required: true, type: 'text' },
{ text: '结论', value: 'lessThan', align: 'center', required: false, type: 'text' },
])
const columns_stability_frequency_checkDate = ref<TableColumn[]>([ // 稳定性表头--频率
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: '-',
align: 'center',
required: false,
width: '180',
children: [
{ width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' },
{ text: 'U(k=2)', value: 'urel', align: 'center', required: true, type: 'text' },
{ text: '结论', value: 'lessThan', align: 'center', required: false, type: 'text' },
])
const columns_stability_power_level = ref<TableColumn[]>([ // 稳定性表头--功率
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{ text: '功率', value: 'powerDefineFront', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: '-',
align: 'center',
required: false,
width: '180',
children: [
{ width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' },
{ text: 'U(k=2)', value: 'urel', align: 'center', required: true, type: 'text' },
{ text: '结论', value: 'lessThan', align: 'center', required: false, type: 'text' },
])
const columns_stability_power_level_checkDate = ref<TableColumn[]>([ // 稳定性表头--功率
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{ text: '功率', value: 'powerDefineFront', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: '-',
align: 'center',
required: false,
width: '180',
children: [
{ width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' },
{ text: 'U(k=2)', value: 'urel', align: 'center', required: true, type: 'text' },
{ text: '结论', value: 'lessThan', align: 'center', required: false, type: 'text' },
])
const columns_stability_relative_level = ref<TableColumn[]>([ // 稳定性表头--相对电平
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{ text: '相对电平', value: 'relativeLevelDefineFront', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: '-',
align: 'center',
required: false,
width: '180',
children: [
{ width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' },
{ text: 'U(k=2)', value: 'urel', align: 'center', required: true, type: 'text' },
{ text: '结论', value: 'lessThan', align: 'center', required: false, type: 'text' },
])
const columns_stability_relative_level_checkDate = ref<TableColumn[]>([ // 稳定性表头--相对电平
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{ text: '相对电平', value: 'relativeLevelDefineFront', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: '-',
align: 'center',
required: false,
width: '180',
children: [
{ width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' },
{ text: 'U(k=2)', value: 'urel', align: 'center', required: true, type: 'text' },
{ text: '结论', value: 'lessThan', align: 'center', required: false, type: 'text' },
])
const columns_stability_AM_depth = ref<TableColumn[]>([ // 稳定性表头--调幅度
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{ text: '调幅度', value: 'modulation', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: '-',
align: 'center',
required: false,
width: '180',
children: [
{ width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' },
{ text: 'U(k=2)/%', value: 'urel', align: 'center', required: true, type: 'text' },
{ text: '结论', value: 'lessThan', align: 'center', required: false, type: 'text' },
])
const columns_stability_AM_depth_checkDate = ref<TableColumn[]>([ // 稳定性表头--调幅度
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{ text: '调幅度', value: 'modulation', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: '-',
align: 'center',
required: false,
width: '180',
children: [
{ width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' },
{ text: 'U(k=2)/%', value: 'urel', align: 'center', required: true, type: 'text' },
{ text: '结论', value: 'lessThan', align: 'center', required: false, type: 'text' },
])
const columns_stability_frequency_modulation_deviation = ref<TableColumn[]>([ // 稳定性表头--调频频偏
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{ text: '调频频偏', value: 'frequencyDeviationDefineFront', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: '-',
align: 'center',
required: false,
width: '180',
children: [
{ width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' },
{ text: 'U(k=2)/%', value: 'urel', align: 'center', required: true, type: 'text' },
{ text: '结论', value: 'lessThan', align: 'center', required: false, type: 'text' },
])
const columns_stability_frequency_modulation_deviation_checkDate = ref<TableColumn[]>([ // 稳定性表头--调频频偏
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{ text: '调频频偏', value: 'frequencyDeviationDefineFront', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: '-',
align: 'center',
required: false,
width: '180',
children: [
{ width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' },
{ text: 'U(k=2)/%', value: 'urel', align: 'center', required: true, type: 'text' },
{ text: '结论', value: 'lessThan', align: 'center', required: false, type: 'text' },
])
const columns_stability_phase = ref<TableColumn[]>([ // 稳定性表头--调相相偏
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{ text: '调相相偏', value: 'phaseDeviationDefineFront', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: '-',
align: 'center',
required: false,
width: '180',
children: [
{ width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' },
{ text: 'U(k=2)/%', value: 'urel', align: 'center', required: true, type: 'text' },
{ text: '结论', value: 'lessThan', align: 'center', required: false, type: 'text' },
])
const columns_stability_phase_checkDate = ref<TableColumn[]>([ // 稳定性表头--调相相偏
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{ text: '调相相偏', value: 'phaseDeviationDefineFront', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: '-',
align: 'center',
required: false,
width: '180',
children: [
{ width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' },
{ text: 'U(k=2)/%', value: 'urel', align: 'center', required: true, type: 'text' },
{ text: '结论', value: 'lessThan', align: 'center', required: false, type: 'text' },
])
const columns_stability_frequency_spectrum = ref<TableColumn[]>([ // 稳定性表头--谐波
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: '-',
align: 'center',
required: false,
width: '180',
children: [
{ width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' },
{ text: 'U(k=2)', value: 'urel', align: 'center', required: true, type: 'text' },
{ text: '结论', value: 'lessThan', align: 'center', required: false, type: 'text' },
])
const columns_stability_frequency_spectrum_checkDate = ref<TableColumn[]>([ // 稳定性表头--谐波
{ text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' },
{
text: '测量值',
value: '-',
align: 'center',
required: false,
width: '180',
children: [
{ width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' },
{ text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' },
{ text: 'U(k=2)', value: 'urel', align: 'center', required: true, type: 'text' },
{ text: '结论', value: 'lessThan', align: 'center', required: false, type: 'text' },
])
// 重复性
const listFrequencyRepeatability = ref<IList[]>([]) // 频率-重复性
const listPowerLevelRepeatability = ref<IList[]>([]) // 功率-重复性
const listRelativeLevelRepeatability = ref<IList[]>([]) // 相对电平-重复性
const listAMDepthRepeatability = ref<IList[]>([]) // 调幅度-重复性
const listfrequencyModulationDeviationRepeatability = ref<IList[]>([]) // 调频频偏-重复性
const listPhaseRepeatability = ref<IList[]>([]) // 调相相偏-重复性
const listFrequencySpectrumRepeatability = ref<IList[]>([]) // 谐波-重复性
// 重复性checkDate
const listFrequencyRepeatabilityCheckDate = ref<IList[]>([]) // 频率-重复性
const listPowerLevelRepeatabilityCheckDate = ref<IList[]>([]) // 功率-重复性
const listRelativeLevelRepeatabilityCheckDate = ref<IList[]>([]) // 相对电平-重复性
const listAMDepthRepeatabilityCheckDate = ref<IList[]>([]) // 调幅度-重复性
const listfrequencyModulationDeviationRepeatabilityCheckDate = ref<IList[]>([]) // 调频频偏-重复性
const listPhaseRepeatabilityCheckDate = ref<IList[]>([]) // 调相相偏-重复性
const listFrequencySpectrumRepeatabilityCheckDate = ref<IList[]>([]) // 谐波-重复性
// 重复性Loading
const listFrequencyRepeatabilityLoading = ref(false) // 频率-重复性
const listPowerLevelRepeatabilityLoading = ref(false) // 功率-重复性
const listRelativeLevelRepeatabilityLoading = ref(false) // 相对电平-重复性
const listAMDepthRepeatabilityLoading = ref(false) // 调幅度-重复性
const listfrequencyModulationDeviationRepeatabilityLoading = ref(false) // 调频频偏-重复性
const listPhaseRepeatabilityLoading = ref(false) // 调相相偏-重复性
const listFrequencySpectrumRepeatabilityLoading = ref(false) // 谐波-重复性
// 稳定性
const listFrequencyStability = ref<any[]>([]) // 频率-稳定性
const listPowerLevelStability = ref<any[]>([]) // 功率-稳定性
const listRelativeLevelStability = ref<any[]>([]) // 相对电平-稳定性
const listAMDepthStability = ref<any[]>([]) // 调幅度-稳定性
const listfrequencyModulationDeviationStability = ref<any[]>([]) // 调频频偏-稳定性
const listPhaseStability = ref<any[]>([]) // 调相相偏-稳定性
const listFrequencySpectrumStability = ref<any[]>([]) // 谐波-稳定性
// 稳定性checkDate
const listFrequencyStabilityCheckDate = ref<any[]>([]) // 频率-稳定性
const listPowerLevelStabilityCheckDate = ref<any[]>([]) // 功率-稳定性
const listRelativeLevelStabilityCheckDate = ref<any[]>([]) // 相对电平-稳定性
const listAMDepthStabilityCheckDate = ref<any[]>([]) // 调幅度-稳定性
const listfrequencyModulationDeviationStabilityCheckDate = ref<any[]>([]) // 调频频偏-稳定性
const listPhaseStabilityCheckDate = ref<any[]>([]) // 调相相偏-稳定性
const listFrequencySpectrumStabilityCheckDate = ref<any[]>([]) // 谐波-稳定性
// 稳定性Loading
const listFrequencyStabilityLoading = ref(false) // 频率-稳定性
const listPowerLevelStabilityLoading = ref(false) // 功率-稳定性
const listRelativeLevelStabilityLoading = ref(false) // 相对电平-稳定性
const listAMDepthStabilityLoading = ref(false) // 调幅度-稳定性
const listfrequencyModulationDeviationStabilityLoading = ref(false) // 调频频偏-稳定性
const listPhaseStabilityLoading = ref(false) // 调相相偏-稳定性
const listFrequencySpectrumStabilityLoading = ref(false) // 谐波-稳定性
// 获取配置详情
function fetchCheckItemDetail(equipmentId: string, belongStandardEquipmentParam: string, itemCategoryIdParam: string, itemCategoryNameParam: string) {
belongStandardEquipment.value = belongStandardEquipmentParam // 检校标准装置
itemCategoryId.value = itemCategoryIdParam // 核查分类id
itemCategoryName.value = itemCategoryNameParam // 核查分类名称
const loading = ElLoading.service({
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
const params = {
equipmentId, // 设备id
belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置code
itemCategoryId: itemCategoryId.value, // 核查项分类id
itemCategoryName: itemCategoryName.value, // 核查项分类名称
}
getCheckItemDetail(params).then((res) => {
loading.close()
if (!res.data) {
emits('isConfigCheck', false)
}
else {
handleData(res.data.checkItemDataSignalGeneratorList)
fetchHistoryIndication() // 重新拉取稳定性
}
})
}
// 初始化数据(查询配置检定项)
function handleData(list: any, type = 'edit') {
// 频率
listFrequencyRepeatability.value = list.filter((item: { params: string }) => item.params === '频率')
// 频率重复性
listFrequencyRepeatability.value = listFrequencyRepeatability.value.map((e: any) => {
return {
editable: type === 'edit',
dataId: e.id, // 核查数据管理基础信息表id
id: '', // id,更新/删除使用参数
checkType: '重复性',
dataType: '1',
params: e.params, // 核查项目
checkPoint: e.checkPoint,
unit: e.unit, // 单位(直接存字典value)
checkPointDefineFront: e.checkPoint + e.unit, // 核查点
averageValue: '', // 平均值
standardDeviation: '', // 重复性
urel: e.urel, // u(k=2)
testValueOne: undefined, // 测量值1/测量值(上升时间)
testValueTwo: undefined, // 测量值2(示值)
testValueThree: undefined, // 测量值3(示值)
testValueFour: undefined, // 测量值4(示值)
testValueFive: undefined, // 测量值5(示值)
testValueSix: undefined, // 测量值6(本次示值)
testValueSeven: undefined, // 测量值7
testValueEight: undefined, // 测量值8
testValueNine: undefined, // 测量值9
testValueTen: undefined, // 测量值10
showUnitData: e.unit,
}
}) as any
// 频率稳定性
listFrequencyStability.value = listFrequencyRepeatability.value.map((e: any) => {
return {
editable: props.pageType !== 'detail',
dataId: e.dataId, // 核查数据管理基础信息表id
id: '', // id,更新/删除使用参数
params: e.params, // 核查项目
dataType: '1',
checkPoint: e.checkPoint,
unit: e.unit, // 单位(直接存字典value)
checkPointDefineFront: e.checkPoint + e.unit, // 核查点
checkType: '稳定性',
urel: e.urel, // u(k=2)
averageValue: '', // 平均值
stability: '', // 稳定性
lessThan: '', // 结论
}
})
// 功率
listPowerLevelRepeatability.value = list.filter((item: { params: string }) => item.params === '功率')
// 功率重复性
listPowerLevelRepeatability.value = listPowerLevelRepeatability.value.map((e: any) => {
return {
editable: type === 'edit',
dataId: e.id, // 核查数据管理基础信息表id
id: '', // id,更新/删除使用参数
checkType: '重复性',
dataType: '2',
params: e.params, // 核查项目
checkPoint: e.checkPoint,
unit: e.unit, // 单位(直接存字典value)
checkPointDefineFront: e.checkPoint + e.unit, // 核查点
power: e.power, // 功率
powerUnit: e.powerUnit, // 功率单位
powerDefineFront: e.power + e.powerUnit, // 功率
showUnitData: e.powerUnit,
averageValue: '', // 平均值
standardDeviation: '', // 重复性
urel: e.urel, // u(k=2)
testValueOne: undefined, // 测量值1/测量值(上升时间)
testValueTwo: undefined, // 测量值2(示值)
testValueThree: undefined, // 测量值3(示值)
testValueFour: undefined, // 测量值4(示值)
testValueFive: undefined, // 测量值5(示值)
testValueSix: undefined, // 测量值6(本次示值)
testValueSeven: undefined, // 测量值7
testValueEight: undefined, // 测量值8
testValueNine: undefined, // 测量值9
testValueTen: undefined, // 测量值10
}
}) as any
// 功率稳定性
listPowerLevelStability.value = listPowerLevelRepeatability.value.map((e: any) => {
return {
editable: props.pageType !== 'detail',
dataId: e.dataId, // 核查数据管理基础信息表id
id: '', // id,更新/删除使用参数
params: e.params, // 核查项目
dataType: '2',
checkPoint: e.checkPoint,
unit: e.unit, // 单位(直接存字典value)
checkPointDefineFront: e.checkPoint + e.unit, // 核查点
power: e.power, // 功率
powerUnit: e.powerUnit, // 功率单位
powerDefineFront: e.power + e.powerUnit, // 功率
checkType: '稳定性',
urel: e.urel, // u(k=2)
averageValue: '', // 平均值
stability: '', // 稳定性
lessThan: '', // 结论
}
}) as any
// 相对电平
listRelativeLevelRepeatability.value = list.filter((item: { params: string }) => item.params === '相对电平')
// 相对电平重复性
listRelativeLevelRepeatability.value = listRelativeLevelRepeatability.value.map((e: any) => {
return {
editable: type === 'edit',
dataId: e.id, // 核查数据管理基础信息表id
id: '', // id,更新/删除使用参数
checkType: '重复性',
dataType: '3',
params: e.params, // 核查项目
checkPoint: e.checkPoint,
unit: e.unit, // 单位(直接存字典value)
checkPointDefineFront: e.checkPoint + e.unit, // 核查点
relativeLevel: e.relativeLevel, // 相对电平
relativeLevelUnit: e.relativeLevelUnit, // 相对电平单位
showUnitData: e.relativeLevelUnit,
relativeLevelDefineFront: e.relativeLevel + e.relativeLevelUnit, // 相对电平
averageValue: '', // 平均值
standardDeviation: '', // 重复性
urel: e.urel, // u(k=2)
testValueOne: undefined, // 测量值1/测量值(上升时间)
testValueTwo: undefined, // 测量值2(示值)
testValueThree: undefined, // 测量值3(示值)
testValueFour: undefined, // 测量值4(示值)
testValueFive: undefined, // 测量值5(示值)
testValueSix: undefined, // 测量值6(本次示值)
testValueSeven: undefined, // 测量值7
testValueEight: undefined, // 测量值8
testValueNine: undefined, // 测量值9
testValueTen: undefined, // 测量值10
}
}) as any
// 相对电平稳定性
listRelativeLevelStability.value = listRelativeLevelRepeatability.value.map((e: any) => {
return {
editable: props.pageType !== 'detail',
dataId: e.dataId, // 核查数据管理基础信息表id
id: '', // id,更新/删除使用参数
params: e.params, // 核查项目
dataType: '3',
checkPoint: e.checkPoint,
unit: e.unit, // 单位(直接存字典value)
checkPointDefineFront: e.checkPoint + e.unit, // 核查点
relativeLevel: e.relativeLevel, // 相对电平
relativeLevelUnit: e.relativeLevelUnit, // 相对电平单位
relativeLevelDefineFront: e.relativeLevel + e.relativeLevelUnit, // 相对电平
checkType: '稳定性',
urel: e.urel, // u(k=2)
averageValue: '', // 平均值
stability: '', // 稳定性
lessThan: '', // 结论
}
}) as any
// 调幅度
listAMDepthRepeatability.value = list.filter((item: { params: string }) => item.params === '调幅度')
// 调幅度重复性
listAMDepthRepeatability.value = listAMDepthRepeatability.value.map((e: any) => {
return {
editable: type === 'edit',
dataId: e.id, // 核查数据管理基础信息表id
id: '', // id,更新/删除使用参数
checkType: '重复性',
dataType: '4',
params: e.params, // 核查项目
checkPoint: e.checkPoint,
unit: e.unit, // 单位(直接存字典value)
checkPointDefineFront: e.checkPoint + e.unit, // 核查点
modulation: e.modulation, // 调幅度
showUnitData: '%',
averageValue: '', // 平均值
standardDeviation: '', // 重复性
urel: e.urel, // u(k=2)
testValueOne: undefined, // 测量值1/测量值(上升时间)
testValueTwo: undefined, // 测量值2(示值)
testValueThree: undefined, // 测量值3(示值)
testValueFour: undefined, // 测量值4(示值)
testValueFive: undefined, // 测量值5(示值)
testValueSix: undefined, // 测量值6(本次示值)
testValueSeven: undefined, // 测量值7
testValueEight: undefined, // 测量值8
testValueNine: undefined, // 测量值9
testValueTen: undefined, // 测量值10
}
}) as any
// 调幅度稳定性
listAMDepthStability.value = listAMDepthRepeatability.value.map((e: any) => {
return {
editable: props.pageType !== 'detail',
dataId: e.dataId, // 核查数据管理基础信息表id
id: '', // id,更新/删除使用参数
params: e.params, // 核查项目
dataType: '4',
checkPoint: e.checkPoint,
unit: e.unit, // 单位(直接存字典value)
checkPointDefineFront: e.checkPoint + e.unit, // 核查点
modulation: e.modulation, // 调幅度
checkType: '稳定性',
urel: e.urel, // u(k=2)
averageValue: '', // 平均值
stability: '', // 稳定性
lessThan: '', // 结论
}
}) as any
// 调频频偏
listfrequencyModulationDeviationRepeatability.value = list.filter((item: { params: string }) => item.params === '调频频偏')
// 调频频偏重复性
listfrequencyModulationDeviationRepeatability.value = listfrequencyModulationDeviationRepeatability.value.map((e: any) => {
return {
editable: type === 'edit',
dataId: e.id, // 核查数据管理基础信息表id
id: '', // id,更新/删除使用参数
checkType: '重复性',
dataType: '5',
params: e.params, // 核查项目
checkPoint: e.checkPoint,
unit: e.unit, // 单位(直接存字典value)
checkPointDefineFront: e.checkPoint + e.unit, // 核查点
frequencyDeviation: e.frequencyDeviation, // 调频频偏
frequencyDeviationUnit: e.frequencyDeviationUnit, // 调频频偏单位
showUnitData: e.frequencyDeviationUni,
frequencyDeviationDefineFront: e.frequencyDeviation + e.frequencyDeviationUnit, // 调频频偏单位
averageValue: '', // 平均值
standardDeviation: '', // 重复性
urel: e.urel, // u(k=2)
testValueOne: undefined, // 测量值1/测量值(上升时间)
testValueTwo: undefined, // 测量值2(示值)
testValueThree: undefined, // 测量值3(示值)
testValueFour: undefined, // 测量值4(示值)
testValueFive: undefined, // 测量值5(示值)
testValueSix: undefined, // 测量值6(本次示值)
testValueSeven: undefined, // 测量值7
testValueEight: undefined, // 测量值8
testValueNine: undefined, // 测量值9
testValueTen: undefined, // 测量值10
}
}) as any
// 调频频偏稳定性
listfrequencyModulationDeviationStability.value = listfrequencyModulationDeviationRepeatability.value.map((e: any) => {
return {
editable: props.pageType !== 'detail',
dataId: e.dataId, // 核查数据管理基础信息表id
id: '', // id,更新/删除使用参数
params: e.params, // 核查项目
dataType: '5',
checkPoint: e.checkPoint,
unit: e.unit, // 单位(直接存字典value)
checkPointDefineFront: e.checkPoint + e.unit, // 核查点
frequencyDeviation: e.frequencyDeviation, // 调频频偏
frequencyDeviationUnit: e.frequencyDeviationUnit, // 调频频偏单位
frequencyDeviationDefineFront: e.frequencyDeviation + e.frequencyDeviationUnit, // 调频频偏单位
checkType: '稳定性',
urel: e.urel, // u(k=2)
averageValue: '', // 平均值
stability: '', // 稳定性
lessThan: '', // 结论
}
}) as any
// 调相相偏
listPhaseRepeatability.value = list.filter((item: { params: string }) => item.params === '调相相偏')
// 调相相偏重复性
listPhaseRepeatability.value = listPhaseRepeatability.value.map((e: any) => {
return {
editable: type === 'edit',
dataId: e.id, // 核查数据管理基础信息表id
id: '', // id,更新/删除使用参数
checkType: '重复性',
dataType: '6',
params: e.params, // 核查项目
checkPoint: e.checkPoint,
unit: e.unit, // 单位(直接存字典value)
checkPointDefineFront: e.checkPoint + e.unit, // 核查点
phaseDeviation: e.phaseDeviation, // 调相相偏
phaseDeviationUnit: e.phaseDeviationUnit, // 调相相偏单位
phaseDeviationDefineFront: e.phaseDeviation + e.phaseDeviationUnit, // 调相相偏单位
showUnitData: e.phaseDeviationUnit,
averageValue: '', // 平均值
standardDeviation: '', // 重复性
urel: e.urel, // u(k=2)
testValueOne: undefined, // 测量值1/测量值(上升时间)
testValueTwo: undefined, // 测量值2(示值)
testValueThree: undefined, // 测量值3(示值)
testValueFour: undefined, // 测量值4(示值)
testValueFive: undefined, // 测量值5(示值)
testValueSix: undefined, // 测量值6(本次示值)
testValueSeven: undefined, // 测量值7
testValueEight: undefined, // 测量值8
testValueNine: undefined, // 测量值9
testValueTen: undefined, // 测量值10
}
}) as any
// 调相相偏稳定性
listPhaseStability.value = listPhaseRepeatability.value.map((e: any) => {
return {
editable: props.pageType !== 'detail',
dataId: e.dataId, // 核查数据管理基础信息表id
id: '', // id,更新/删除使用参数
params: e.params, // 核查项目
dataType: '6',
checkPoint: e.checkPoint,
unit: e.unit, // 单位(直接存字典value)
checkPointDefineFront: e.checkPoint + e.unit, // 核查点
phaseDeviation: e.phaseDeviation, // 调相相偏
phaseDeviationUnit: e.phaseDeviationUnit, // 调相相偏单位
phaseDeviationDefineFront: e.phaseDeviation + e.phaseDeviationUnit, // 调相相偏单位
checkType: '稳定性',
urel: e.urel, // u(k=2)
averageValue: '', // 平均值
stability: '', // 稳定性
lessThan: '', // 结论
}
}) as any
// 谐波
listFrequencySpectrumRepeatability.value = list.filter((item: { params: string }) => item.params === '谐波')
// 谐波重复性
listFrequencySpectrumRepeatability.value = listFrequencySpectrumRepeatability.value.map((e: any) => {
return {
editable: type === 'edit',
dataId: e.id, // 核查数据管理基础信息表id
id: '', // id,更新/删除使用参数
checkType: '重复性',
dataType: '7',
params: e.params, // 核查项目
checkPoint: e.checkPoint,
unit: e.unit, // 单位(直接存字典value)
checkPointDefineFront: e.checkPoint + e.unit, // 核查点
showUnitData: 'dBc',
averageValue: '', // 平均值
standardDeviation: '', // 重复性
urel: e.urel, // u(k=2)
testValueOne: undefined, // 测量值1/测量值(上升时间)
testValueTwo: undefined, // 测量值2(示值)
testValueThree: undefined, // 测量值3(示值)
testValueFour: undefined, // 测量值4(示值)
testValueFive: undefined, // 测量值5(示值)
testValueSix: undefined, // 测量值6(本次示值)
testValueSeven: undefined, // 测量值7
testValueEight: undefined, // 测量值8
testValueNine: undefined, // 测量值9
testValueTen: undefined, // 测量值10
}
}) as any
// 谐波稳定性
listFrequencySpectrumStability.value = listFrequencySpectrumRepeatability.value.map((e: any) => {
return {
editable: props.pageType !== 'detail',
dataId: e.dataId, // 核查数据管理基础信息表id
id: '', // id,更新/删除使用参数
params: e.params, // 核查项目
dataType: '7',
checkPoint: e.checkPoint,
unit: e.unit, // 单位(直接存字典value)
checkPointDefineFront: e.checkPoint + e.unit, // 核查点
checkType: '稳定性',
urel: e.urel, // u(k=2)
averageValue: '', // 平均值
stability: '', // 稳定性
lessThan: '', // 结论
}
}) as any
}
// 点击计算结果
const createResult = (type: string) => {
let checkDataSignalGeneratorListParams: any // 要传的重复或者稳定性参数
if (current.value === 'stability') { // 计算稳定性先校验重复性
if (!checkList()) { return false }
const tempList = [] as any
checkDataSignalGeneratorListParams = tempList.concat(
listFrequencyStability.value,
listPowerLevelStability.value,
listRelativeLevelStability.value,
listAMDepthStability.value,
listfrequencyModulationDeviationStability.value,
listPhaseStability.value,
listFrequencySpectrumStability.value,
)
}
if (current.value === 'repeatability') {
switch (type) {
case '频率':
if (!useCheckList(listFrequencyRepeatability.value, columns_repeatability_frequency.value, `${type}-重复性`)) {
return false
}
checkDataSignalGeneratorListParams = listFrequencyRepeatability.value
break
case '功率':
if (!useCheckList(listPowerLevelRepeatability.value, columns_repeatability_power_level.value, `${type}-重复性`)) {
return false
}
checkDataSignalGeneratorListParams = listPowerLevelRepeatability.value
break
case '相对电平':
if (!useCheckList(listRelativeLevelRepeatability.value, columns_repeatability_relative_level.value, `${type}-重复性`)) {
return false
}
checkDataSignalGeneratorListParams = listRelativeLevelRepeatability.value
break
case '调幅度':
if (!useCheckList(listAMDepthRepeatability.value, columns_repeatability_AM_depth.value, `${type}-重复性`)) {
return false
}
checkDataSignalGeneratorListParams = listAMDepthRepeatability.value
break
case '调频频偏':
if (!useCheckList(listfrequencyModulationDeviationRepeatability.value, columns_repeatability_frequency_modulation_deviation.value, `${type}-重复性`)) {
return false
}
checkDataSignalGeneratorListParams = listfrequencyModulationDeviationRepeatability.value
break
case '调相相偏':
if (!useCheckList(listPhaseRepeatability.value, columns_repeatability_phase.value, `${type}-重复性`)) {
return false
}
checkDataSignalGeneratorListParams = listPhaseRepeatability.value
break
case '谐波':
if (!useCheckList(listFrequencySpectrumRepeatability.value, columns_repeatability_frequency_spectrum.value, `${type}-重复性`)) {
return false
}
checkDataSignalGeneratorListParams = listFrequencySpectrumRepeatability.value
break
default:
break
}
}
const params = {
belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置
checkDataSignalGeneratorList: checkDataSignalGeneratorListParams.map((item: any) => {
return {
...item,
conclusion: '',
lessThan: '',
testValueOne: getDataNum(item.testValueOne) == null ? '' : getDataNum(item.testValueOne), // 测量值1
testValueTwo: getDataNum(item.testValueTwo) == null ? '' : getDataNum(item.testValueTwo), // 测量值2
testValueThree: getDataNum(item.testValueThree) == null ? '' : getDataNum(item.testValueThree), // 测量值3
testValueFour: getDataNum(item.testValueFour) == null ? '' : getDataNum(item.testValueFour), // 测量值4
testValueFive: getDataNum(item.testValueFive) == null ? '' : getDataNum(item.testValueFive), // 测量值5
testValueSix: getDataNum(item.testValueSix) == null ? '' : getDataNum(item.testValueSix), // 测量值6
}
}),
itemCategoryId: itemCategoryId.value, // 核查项分类id
itemCategoryName: itemCategoryName.value, // 核查项分类id
}
// 重复性Loading
listFrequencyRepeatabilityLoading.value = type === '频率' && current.value === 'repeatability'
listPowerLevelRepeatabilityLoading.value = type === '功率' && current.value === 'repeatability'
listRelativeLevelRepeatabilityLoading.value = type === '相对电平' && current.value === 'repeatability'
listAMDepthRepeatabilityLoading.value = type === '调幅度' && current.value === 'repeatability'
listfrequencyModulationDeviationRepeatabilityLoading.value = type === '调频频偏' && current.value === 'repeatability'
listPhaseRepeatabilityLoading.value = type === '调相相偏' && current.value === 'repeatability'
listFrequencySpectrumRepeatabilityLoading.value = type === '谐波' && current.value === 'repeatability'
// 稳定性loading
listFrequencyStabilityLoading.value = true // 频率-稳定性
listPowerLevelStabilityLoading.value = true // 功率-稳定性
listRelativeLevelStabilityLoading.value = true // 相对电平-稳定性
listAMDepthStabilityLoading.value = true // 调幅度-稳定性
listfrequencyModulationDeviationStabilityLoading.value = true // 调频频偏-稳定性
listPhaseStabilityLoading.value = true // 调相相偏-稳定性
listFrequencySpectrumStabilityLoading.value = true // 谐波-稳定性
calculateHandle(params).then((res) => {
const result = res.data.filter((item: { params: string }) => item.params === type).map((item: any) => {
let unit = ''
switch (item.params) {
case '频率':
unit = item.unit
break
case '功率':
unit = item.powerUnit
break
case '相对电平':
unit = item.relativeLevelUnit
break
case '调幅度':
unit = '%'
break
case '调频频偏':
unit = item.frequencyDeviationUnit
break
case '调相相偏':
unit = item.phaseDeviationUnit
break
case '谐波':
unit = 'dBc'
break
}
return {
...item,
checkPointDefineFront: item.checkPoint + item.unit, // 核查点
powerDefineFront: item.power + item.powerUnit, // 功率
relativeLevelDefineFront: item.relativeLevel + item.relativeLevelUnit, // 相对电平
frequencyDeviationDefineFront: item.frequencyDeviation + item.frequencyDeviationUnit, // 调频频偏单位
phaseDeviationDefineFront: item.phaseDeviation + item.phaseDeviationUnit, // 调相相偏单位
editable: props.pageType !== 'detail',
showUnitData: unit,
averageValue: (current.value === 'repeatability' && `${item.averageValue}` !== '') ? useScientificNotation(item.averageValue) + unit : useScientificNotation(item.averageValue), // 平均值
averageValueNoUnit: useScientificNotation(item.averageValue), // 平均值
standardDeviation: useScientificNotation(item.standardDeviation), // 重复性S(x)/x
stability: useScientificNotation(item.standardDeviation), // 稳定性
}
})
if (current.value === 'repeatability') { // 重复性
switch (type) {
case '频率':
listFrequencyRepeatability.value = result
// 填充稳定性最后一列的日期和数值
listFrequencyStability.value = listFrequencyStability.value.map((item, index: number) => {
return {
...item,
testValueSix: listFrequencyRepeatability.value[index].averageValueNoUnit, // 测量差值
testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期)
}
})
break
case '功率':
listPowerLevelRepeatability.value = result
// 填充稳定性最后一列的日期和数值
listPowerLevelStability.value = listPowerLevelStability.value.map((item, index: number) => {
return {
...item,
testValueSix: listPowerLevelRepeatability.value[index].averageValueNoUnit, // 测量差值
testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期)
}
})
break
case '相对电平':
listRelativeLevelRepeatability.value = result
// 填充稳定性最后一列的日期和数值
listRelativeLevelStability.value = listRelativeLevelStability.value.map((item, index: number) => {
return {
...item,
testValueSix: listRelativeLevelRepeatability.value[index].averageValueNoUnit, // 测量差值
testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期)
}
})
break
case '调幅度':
listAMDepthRepeatability.value = result
// 填充稳定性最后一列的日期和数值
listAMDepthStability.value = listAMDepthStability.value.map((item, index: number) => {
return {
...item,
testValueSix: listAMDepthRepeatability.value[index].averageValueNoUnit, // 测量差值
testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期)
}
})
break
case '调频频偏':
listfrequencyModulationDeviationRepeatability.value = result
// 填充稳定性最后一列的日期和数值
listfrequencyModulationDeviationStability.value = listfrequencyModulationDeviationStability.value.map((item, index: number) => {
return {
...item,
testValueSix: listfrequencyModulationDeviationRepeatability.value[index].averageValueNoUnit, // 测量差值
testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期)
}
})
break
case '调相相偏':
listPhaseRepeatability.value = result
// 填充稳定性最后一列的日期和数值
listPhaseStability.value = listPhaseStability.value.map((item, index: number) => {
return {
...item,
testValueSix: listPhaseRepeatability.value[index].averageValueNoUnit, // 测量差值
testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期)
}
})
break
case '谐波':
listFrequencySpectrumRepeatability.value = result
// 填充稳定性最后一列的日期和数值
listFrequencySpectrumStability.value = listFrequencySpectrumStability.value.map((item, index: number) => {
return {
...item,
testValueSix: listFrequencySpectrumRepeatability.value[index].averageValueNoUnit, // 测量差值
testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期)
}
})
break
default:
break
}
}
else if (current.value === 'stability') { // 稳定性
const resultList = res.data.map((item: any) => {
return {
...item,
lessThan: (`${item.lessThan}` === '1' || `${item.lessThan}` === '') ? '合格' : '不合格',
checkPointDefineFront: item.checkPoint + item.unit, // 核查点
powerDefineFront: item.power + item.powerUnit, // 功率
relativeLevelDefineFront: item.relativeLevel + item.relativeLevelUnit, // 相对电平
frequencyDeviationDefineFront: item.frequencyDeviation + item.frequencyDeviationUnit, // 调频频偏单位
phaseDeviationDefineFront: item.phaseDeviation + item.phaseDeviationUnit, // 调相相偏单位
editable: props.pageType !== 'detail',
}
})
listFrequencyStability.value = resultList.filter((item: { params: string }) => item.params === '频率')
listPowerLevelStability.value = resultList.filter((item: { params: string }) => item.params === '功率')
listRelativeLevelStability.value = resultList.filter((item: { params: string }) => item.params === '相对电平')
listAMDepthStability.value = resultList.filter((item: { params: string }) => item.params === '调幅度')
listfrequencyModulationDeviationStability.value = resultList.filter((item: { params: string }) => item.params === '调频频偏')
listPhaseStability.value = resultList.filter((item: { params: string }) => item.params === '调相相偏')
listFrequencySpectrumStability.value = resultList.filter((item: { params: string }) => item.params === '谐波')
// 计算稳定性考核是否合格
if (resultList.every((item: { lessThan: string | number }) => item.lessThan === '合格')) {
form.value.qualified = '合格'
}
else {
form.value.qualified = '不合格'
}
}
// 重复性Loading
listFrequencyRepeatabilityLoading.value = false
listPowerLevelRepeatabilityLoading.value = false
listRelativeLevelRepeatabilityLoading.value = false
listAMDepthRepeatabilityLoading.value = false
listfrequencyModulationDeviationRepeatabilityLoading.value = false
listPhaseRepeatabilityLoading.value = false
listFrequencySpectrumRepeatabilityLoading.value = false
// 稳定性loading
listFrequencyStabilityLoading.value = false // 频率-稳定性
listPowerLevelStabilityLoading.value = false // 功率-稳定性
listRelativeLevelStabilityLoading.value = false // 相对电平-稳定性
listAMDepthStabilityLoading.value = false // 调幅度-稳定性
listfrequencyModulationDeviationStabilityLoading.value = false // 调频频偏-稳定性
listPhaseStabilityLoading.value = false // 调相相偏-稳定性
listFrequencySpectrumStabilityLoading.value = false // 谐波-稳定性
}).catch(() => {
// 重复性Loading
listFrequencyRepeatabilityLoading.value = false
listPowerLevelRepeatabilityLoading.value = false
listRelativeLevelRepeatabilityLoading.value = false
listAMDepthRepeatabilityLoading.value = false
listfrequencyModulationDeviationRepeatabilityLoading.value = false
listPhaseRepeatabilityLoading.value = false
listFrequencySpectrumRepeatabilityLoading.value = false
// 稳定性loading
listFrequencyStabilityLoading.value = false // 频率-稳定性
listPowerLevelStabilityLoading.value = false // 功率-稳定性
listRelativeLevelStabilityLoading.value = false // 相对电平-稳定性
listAMDepthStabilityLoading.value = false // 调幅度-稳定性
listfrequencyModulationDeviationStabilityLoading.value = false // 调频频偏-稳定性
listPhaseStabilityLoading.value = false // 调相相偏-稳定性
listFrequencySpectrumStabilityLoading.value = false // 谐波-稳定性
})
}
// ------------------------------------------------------------------------------------------
// 处理详情数据
const solveGetDetailData = (responseList: any) => {
console.log('处理详情数据', props.pageType)
const list = responseList.map((item: any) => {
let unit = ''
switch (item.params) {
case '频率':
unit = item.unit
break
case '功率':
unit = item.powerUnit
break
case '相对电平':
unit = item.relativeLevelUnit
break
case '调幅度':
unit = '%'
break
case '调频频偏':
unit = item.frequencyDeviationUnit
break
case '调相相偏':
unit = item.phaseDeviationUnit
break
case '谐波':
unit = 'dBc'
break
}
return {
...item,
editable: props.pageType !== 'detail',
checkPointDefineFront: item.checkPoint + item.unit, // 核查点
powerDefineFront: item.power + item.powerUnit, // 功率
relativeLevelDefineFront: item.relativeLevel + item.relativeLevelUnit, // 相对电平
frequencyDeviationDefineFront: item.frequencyDeviation + item.frequencyDeviationUnit, // 调频频偏单位
phaseDeviationDefineFront: item.phaseDeviation + item.phaseDeviationUnit, // 调相相偏单位
lessThan: `${item.lessThan}` === '1' ? '合格' : '不合格',
testValueOne: item.checkType === '稳定性' ? item.testValueOne : (item.checkType === '重复性' && `${item.testValueOne}` === '') ? undefined : Number(item.testValueOne), // 测量值1/测量值(上升时间)
testValueTwo: item.checkType === '稳定性' ? item.testValueTwo : (item.checkType === '重复性' && `${item.testValueTwo}` === '') ? undefined : Number(item.testValueTwo), // 测量值2(示值)
testValueThree: item.checkType === '稳定性' ? item.testValueThree : (item.checkType === '重复性' && `${item.testValueThree}` === '') ? undefined : Number(item.testValueThree), // 测量值3(示值)
testValueFour: item.checkType === '稳定性' ? item.testValueFour : (item.checkType === '重复性' && `${item.testValueFour}` === '') ? undefined : Number(item.testValueFour), // 测量值4(示值)
testValueFive: item.checkType === '稳定性' ? item.testValueFive : (item.checkType === '重复性' && `${item.testValueFive}` === '') ? undefined : Number(item.testValueFive), // 测量值5(示值)
testValueSix: item.checkType === '稳定性' ? item.testValueSix : (item.checkType === '重复性' && `${item.testValueSix}` === '') ? undefined : Number(item.testValueSix), // 测量值6(本次示值)
testValueSeven: item.checkType === '稳定性' ? item.testValueSeven : (item.checkType === '重复性' && `${item.testValueSeven}` === '') ? undefined : Number(item.testValueSeven), // 测量值7
testValueEight: item.checkType === '稳定性' ? item.testValueEight : (item.checkType === '重复性' && `${item.testValueEight}` === '') ? undefined : Number(item.testValueEight), // 测量值8
testValueNine: item.checkType === '稳定性' ? item.testValueNine : (item.checkType === '重复性' && `${item.testValueNine}` === '') ? undefined : Number(item.testValueNine), // 测量值9
testValueTen: item.checkType === '稳定性' ? item.testValueTen : (item.checkType === '重复性' && `${item.testValueTen}` === '') ? undefined : Number(item.testValueTen), // 测量值10
showUnitData: unit,
}
})
// 稳定性考核是否合格
let tempStabilityList = []
tempStabilityList = list.filter((item: { checkType: string }) => item.checkType === '稳定性')
if (tempStabilityList.length) {
form.value.qualified = tempStabilityList[0].qualified === 1 ? '合格' : '不合格'
}
const listFrequencyRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '频率') // 频率-重复性
const listPowerLevelRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '功率') // 功率-重复性
const listRelativeLevelRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '相对电平') // 相对电平-重复性
const listAMDepthRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '调幅度') // 调幅度-重复性
const listfrequencyModulationDeviationRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '调频频偏') // 调频频偏-重复性
const listPhaseRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '调相相偏') // 调相相偏-重复性
const listFrequencySpectrumRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '谐波') // 谐波-重复性
// 稳定性
const listFrequencyStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '频率').map((item: { standardDeviation: number }, index: number) => { item.standardDeviation = listFrequencyRepeatability[index].standardDeviation; return item }) // 频率-稳定性
const listPowerLevelStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '功率').map((item: { standardDeviation: number }, index: number) => { item.standardDeviation = listPowerLevelRepeatability[index].standardDeviation; return item }) // 功率-稳定性
const listRelativeLevelStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '相对电平').map((item: { standardDeviation: number }, index: number) => { item.standardDeviation = listRelativeLevelRepeatability[index].standardDeviation; return item }) // 相对电平 -稳定性
const listAMDepthStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '调幅度').map((item: { standardDeviation: number }, index: number) => { item.standardDeviation = listAMDepthRepeatability[index].standardDeviation; return item }) // 调幅度-稳定性
const listfrequencyModulationDeviationStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '调频频偏').map((item: { standardDeviation: number }, index: number) => { item.standardDeviation = listfrequencyModulationDeviationRepeatability[index].standardDeviation; return item }) // 调频频偏-稳定性
const listPhaseStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '调相相偏').map((item: { standardDeviation: number }, index: number) => { item.standardDeviation = listPhaseRepeatability[index].standardDeviation; return item }) // 调相相偏-稳定性
const listFrequencySpectrumStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '谐波').map((item: { standardDeviation: number }, index: number) => { item.standardDeviation = listFrequencySpectrumRepeatability[index].standardDeviation; return item }) // 谐波-稳定性
return {
templistFrequencyRepeatability: listFrequencyRepeatability,
templistPowerLevelRepeatability: listPowerLevelRepeatability,
templistRelativeLevelRepeatability: listRelativeLevelRepeatability,
templistAMDepthRepeatability: listAMDepthRepeatability,
templistfrequencyModulationDeviationRepeatability: listfrequencyModulationDeviationRepeatability,
templistPhaseRepeatability: listPhaseRepeatability,
templistFrequencySpectrumRepeatability: listFrequencySpectrumRepeatability,
templistFrequencyStability: listFrequencyStability,
templistPowerLevelStability: listPowerLevelStability,
templistRelativeLevelStability: listRelativeLevelStability,
templistAMDepthStability: listAMDepthStability,
templistfrequencyModulationDeviationStability: listfrequencyModulationDeviationStability,
templistPhaseStability: listPhaseStability,
templistFrequencySpectrumStability: listFrequencySpectrumStability,
}
}
// 获取详情
function fetchInfo(id = '') {
const loading = ElLoading.service({
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
getInfo({ id: id || infoId.value }).then((res) => {
form.value = { ...res.data }
equipmentId.value = res.data.equipmentId
const {
templistFrequencyRepeatability,
templistPowerLevelRepeatability,
templistRelativeLevelRepeatability,
templistAMDepthRepeatability,
templistfrequencyModulationDeviationRepeatability,
templistPhaseRepeatability,
templistFrequencySpectrumRepeatability,
templistFrequencyStability,
templistPowerLevelStability,
templistRelativeLevelStability,
templistAMDepthStability,
templistfrequencyModulationDeviationStability,
templistPhaseStability,
templistFrequencySpectrumStability,
} = solveGetDetailData(res.data.checkDataSignalGeneratorList)
if (id !== '') { // 查询的日期获得的数据
listFrequencyRepeatabilityCheckDate.value = templistFrequencyRepeatability// 频率-重复性
listPowerLevelRepeatabilityCheckDate.value = templistPowerLevelRepeatability// 功率-重复性
listRelativeLevelRepeatabilityCheckDate.value = templistRelativeLevelRepeatability// 相对电平-重复性
listAMDepthRepeatabilityCheckDate.value = templistAMDepthRepeatability// 调幅度-重复性
listfrequencyModulationDeviationRepeatabilityCheckDate.value = templistfrequencyModulationDeviationRepeatability// 调频频偏-重复性
listPhaseRepeatabilityCheckDate.value = templistPhaseRepeatability// 调相相偏-重复性
listFrequencySpectrumRepeatabilityCheckDate.value = templistFrequencySpectrumRepeatability// 谐波-重复性
listFrequencyStabilityCheckDate.value = templistFrequencyStability// 频率-稳定性
listPowerLevelStabilityCheckDate.value = templistPowerLevelStability// 功率-稳定性
listRelativeLevelStabilityCheckDate.value = templistRelativeLevelStability// 相对电平-稳定性
listAMDepthStabilityCheckDate.value = templistAMDepthStability// 调幅度-稳定性
listfrequencyModulationDeviationStabilityCheckDate.value = templistfrequencyModulationDeviationStability// 调频频偏-稳定性
listPhaseStabilityCheckDate.value = templistPhaseStability// 调相相偏-稳定性
listFrequencySpectrumStabilityCheckDate.value = templistFrequencySpectrumStability// 谐波-稳定性
}
else {
listFrequencyRepeatability.value = templistFrequencyRepeatability// 频率-重复性
listPowerLevelRepeatability.value = templistPowerLevelRepeatability// 功率-重复性
listRelativeLevelRepeatability.value = templistRelativeLevelRepeatability// 相对电平-重复性
listAMDepthRepeatability.value = templistAMDepthRepeatability// 调幅度-重复性
listfrequencyModulationDeviationRepeatability.value = templistfrequencyModulationDeviationRepeatability// 调频频偏-重复性
listPhaseRepeatability.value = templistPhaseRepeatability// 调相相偏-重复性
listFrequencySpectrumRepeatability.value = templistFrequencySpectrumRepeatability// 谐波-重复性
listFrequencyStability.value = templistFrequencyStability// 频率-稳定性
listPowerLevelStability.value = templistPowerLevelStability// 功率-稳定性
listRelativeLevelStability.value = templistRelativeLevelStability// 相对电平-稳定性
listAMDepthStability.value = templistAMDepthStability// 调幅度-稳定性
listfrequencyModulationDeviationStability.value = templistfrequencyModulationDeviationStability// 调频频偏-稳定性
listPhaseStability.value = templistPhaseStability// 调相相偏-稳定性
listFrequencySpectrumStability.value = templistFrequencySpectrumStability// 谐波-稳定性
}
nextTick(() => {
if (id !== '') { // 稳定性表头---查询历史的稳定性日期数据
initColumnsCheckDate()
fetchHistoryIndication(currentDate.value) // 获取稳定性
}
else { // 正常核查数据处理表头
columns_stability_frequency.value = handleDetailTableTableHead(columns_stability_frequency.value, listFrequencyStability.value, 2)
columns_stability_power_level.value = handleDetailTableTableHead(columns_stability_power_level.value, listPowerLevelStability.value, 2)
columns_stability_relative_level.value = handleDetailTableTableHead(columns_stability_relative_level.value, listRelativeLevelStability.value, 2)
columns_stability_AM_depth.value = handleDetailTableTableHead(columns_stability_AM_depth.value, listAMDepthStability.value, 2)
columns_stability_frequency_modulation_deviation.value = handleDetailTableTableHead(columns_stability_frequency_modulation_deviation.value, listfrequencyModulationDeviationStability.value, 2)
columns_stability_phase.value = handleDetailTableTableHead(columns_stability_phase.value, listPhaseStability.value, 2)
columns_stability_frequency_spectrum.value = handleDetailTableTableHead(columns_stability_frequency_spectrum.value, listFrequencySpectrumStability.value, 3)
}
})
if (props.pageType === 'edit' || props.pageType === 'detail') {
fetchHistoryIndication() // 重新拉取稳定性日期
}
loading.close()
})
}
/**
* 获取稳定性示值
* @param date 查询日期
*/
function fetchHistoryIndication(date = '') {
if (!equipmentId.value || !props.selectStandardId) { return false }
const params = {
belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置(字典code)
checkDate: date || props.checkDate!, // 核查日期
checkParam: '', // 核查参数((直流稳压电源-直接电流(间接测量))
conclusion: '合格', // 结论
equipmentId: equipmentId.value, // 被核查设备id
params: '', // 核查项目
stabilityExamine: '1', // 是否用于稳定性考核(1/0)
standardEquipmentId: props.selectStandardId!, // 被核查标准装置id
}
if (props.selectStandardId && equipmentId.value) {
// 稳定性Loading
listFrequencyStabilityLoading.value = true // 频率-稳定性
listPowerLevelStabilityLoading.value = true // 功率-稳定性
listRelativeLevelStabilityLoading.value = true // 相对电平-稳定性
listAMDepthStabilityLoading.value = true // 调幅度-稳定性
listfrequencyModulationDeviationStabilityLoading.value = true // 调频频偏-稳定性
listPhaseStabilityLoading.value = true // 调相相偏-稳定性
listFrequencySpectrumStabilityLoading.value = true // 谐波-稳定性
}
getHistoryIndication(params).then((res) => {
if (date === '') { // 正常核查数据
const num = (props.pageType === 'edit' || props.pageType === 'detail') ? 5 : 4
// '频率':
listFrequencyStability.value = listFrequencyStability.value.map((item) => {
const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '频率'), item, columns_stability_frequency.value, num, 2, '10')
columns_stability_frequency.value = columnsData
return item = itemData
})
listFrequencyStability.value = handleSaveDateParams(columns_stability_frequency.value, listFrequencyStability.value, 2)
// '功率':
listPowerLevelStability.value = listPowerLevelStability.value.map((item) => {
const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '功率'), item, columns_stability_power_level.value, num, 3, '10')
columns_stability_power_level.value = columnsData
return item = itemData
})
listPowerLevelStability.value = handleSaveDateParams(columns_stability_power_level.value, listPowerLevelStability.value, 3)
// '相对电平':
listRelativeLevelStability.value = listRelativeLevelStability.value.map((item) => {
const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '相对电平'), item, columns_stability_relative_level.value, num, 3, '10')
columns_stability_relative_level.value = columnsData
return item = itemData
})
listRelativeLevelStability.value = handleSaveDateParams(columns_stability_relative_level.value, listRelativeLevelStability.value, 3)
// '调幅度':
listAMDepthStability.value = listAMDepthStability.value.map((item) => {
const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '调幅度'), item, columns_stability_AM_depth.value, num, 3, '10')
columns_stability_AM_depth.value = columnsData
return item = itemData
})
listAMDepthStability.value = handleSaveDateParams(columns_stability_AM_depth.value, listAMDepthStability.value, 3)
// '调频频偏':
listfrequencyModulationDeviationStability.value = listfrequencyModulationDeviationStability.value.map((item) => {
const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '调频频偏'), item, columns_stability_frequency_modulation_deviation.value, num, 3, '10')
columns_stability_frequency_modulation_deviation.value = columnsData
return item = itemData
})
listfrequencyModulationDeviationStability.value = handleSaveDateParams(columns_stability_frequency_modulation_deviation.value, listfrequencyModulationDeviationStability.value, 3)
// '调相相偏':
listPhaseStability.value = listPhaseStability.value.map((item) => {
const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '调相相偏'), item, columns_stability_phase.value, num, 3, '10')
columns_stability_phase.value = columnsData
return item = itemData
})
listPhaseStability.value = handleSaveDateParams(columns_stability_phase.value, listPhaseStability.value, 3)
// '谐波':
listFrequencySpectrumStability.value = listFrequencySpectrumStability.value.map((item) => {
const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '谐波'), item, columns_stability_frequency_spectrum.value, num, 2, '10')
columns_stability_frequency_spectrum.value = columnsData
return item = itemData
})
listFrequencySpectrumStability.value = handleSaveDateParams(columns_stability_frequency_spectrum.value, listFrequencySpectrumStability.value, 2)
}
else {
initColumnsCheckDate()
const num = 5
// '频率':
if (listFrequencyRepeatability.value && listFrequencyRepeatability.value.length) {
listFrequencyStabilityCheckDate.value = listFrequencyStabilityCheckDate.value.map((item) => {
clearDateValue(item)
const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '频率'), item, columns_stability_frequency_checkDate.value, num, 2, '10')
columns_stability_frequency_checkDate.value = columnsData
return item = itemData
})
listFrequencyStabilityCheckDate.value = handleSaveDateParams(columns_stability_frequency_checkDate.value, listFrequencyStabilityCheckDate.value, 2)
}
// '功率':
if (listPowerLevelRepeatability.value && listPowerLevelRepeatability.value.length) {
listPowerLevelStabilityCheckDate.value = listPowerLevelStabilityCheckDate.value.map((item) => {
clearDateValue(item)
const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '功率'), item, columns_stability_power_level_checkDate.value, num, 3, '10')
columns_stability_power_level_checkDate.value = columnsData
return item = itemData
})
listPowerLevelStabilityCheckDate.value = handleSaveDateParams(columns_stability_power_level_checkDate.value, listPowerLevelStabilityCheckDate.value, 3)
}
// '相对电平':
if (listRelativeLevelRepeatability.value && listRelativeLevelRepeatability.value.length) {
listRelativeLevelStabilityCheckDate.value = listRelativeLevelStabilityCheckDate.value.map((item) => {
clearDateValue(item)
const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '相对电平'), item, columns_stability_relative_level_checkDate.value, num, 3, '10')
columns_stability_relative_level_checkDate.value = columnsData
return item = itemData
})
listRelativeLevelStabilityCheckDate.value = handleSaveDateParams(columns_stability_relative_level_checkDate.value, listRelativeLevelStabilityCheckDate.value, 3)
}
// '调幅度':
if (listAMDepthRepeatability.value && listAMDepthRepeatability.value.length) {
listAMDepthStabilityCheckDate.value = listAMDepthStabilityCheckDate.value.map((item) => {
clearDateValue(item)
const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '调幅度'), item, columns_stability_AM_depth_checkDate.value, num, 3, '10')
columns_stability_AM_depth_checkDate.value = columnsData
return item = itemData
})
listAMDepthStabilityCheckDate.value = handleSaveDateParams(columns_stability_AM_depth_checkDate.value, listAMDepthStabilityCheckDate.value, 3)
}
// '调频频偏':
if (listfrequencyModulationDeviationRepeatability.value && listfrequencyModulationDeviationRepeatability.value.length) {
listfrequencyModulationDeviationStabilityCheckDate.value = listfrequencyModulationDeviationStabilityCheckDate.value.map((item) => {
clearDateValue(item)
const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '调频频偏'), item, columns_stability_frequency_modulation_deviation_checkDate.value, num, 3, '10')
columns_stability_frequency_modulation_deviation_checkDate.value = columnsData
return item = itemData
})
listfrequencyModulationDeviationStabilityCheckDate.value = handleSaveDateParams(columns_stability_frequency_modulation_deviation_checkDate.value, listfrequencyModulationDeviationStabilityCheckDate.value, 3)
}
// '调相相偏':
if (listPhaseRepeatability.value && listPhaseRepeatability.value.length) {
listPhaseStabilityCheckDate.value = listPhaseStabilityCheckDate.value.map((item) => {
clearDateValue(item)
const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '调相相偏'), item, columns_stability_phase_checkDate.value, num, 3, '10')
columns_stability_phase_checkDate.value = columnsData
return item = itemData
})
listPhaseStabilityCheckDate.value = handleSaveDateParams(columns_stability_phase_checkDate.value, listPhaseStabilityCheckDate.value, 3)
}
// '谐波':
if (listFrequencySpectrumRepeatability.value && listFrequencySpectrumRepeatability.value.length) {
listFrequencySpectrumStabilityCheckDate.value = listFrequencySpectrumStabilityCheckDate.value.map((item) => {
clearDateValue(item)
const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '谐波'), item, columns_stability_frequency_spectrum_checkDate.value, num, 2, '10')
columns_stability_frequency_spectrum_checkDate.value = columnsData
return item = itemData
})
listFrequencySpectrumStabilityCheckDate.value = handleSaveDateParams(columns_stability_frequency_spectrum_checkDate.value, listFrequencySpectrumStabilityCheckDate.value, 2)
}
}
listFrequencyStabilityLoading.value = false // 频率-稳定性
listPowerLevelStabilityLoading.value = false // 功率-稳定性
listRelativeLevelStabilityLoading.value = false // 相对电平-稳定性
listAMDepthStabilityLoading.value = false // 调幅度-稳定性
listfrequencyModulationDeviationStabilityLoading.value = false // 调频频偏-稳定性
listPhaseStabilityLoading.value = false // 调相相偏-稳定性
listFrequencySpectrumStabilityLoading.value = false // 谐波-稳定性
}).catch(() => {
listFrequencyStabilityLoading.value = false // 频率-稳定性
listPowerLevelStabilityLoading.value = false // 功率-稳定性
listRelativeLevelStabilityLoading.value = false // 相对电平-稳定性
listAMDepthStabilityLoading.value = false // 调幅度-稳定性
listfrequencyModulationDeviationStabilityLoading.value = false // 调频频偏-稳定性
listPhaseStabilityLoading.value = false // 调相相偏-稳定性
listFrequencySpectrumStabilityLoading.value = false // 谐波-稳定性
})
}
/**
* 保存之前的校验
*/
function checkList() {
// 新建核查数据的时候,在保存之前要先校验一下本次核查日期有没有数据,没有不允许保存
if (listFrequencyRepeatability.value.length && `${listFrequencyRepeatability.value[0].averageValue}` === '') {
ElMessage.warning('请先计算 频率 的重复性')
return false
}
if (listPowerLevelRepeatability.value.length && `${listPowerLevelRepeatability.value[0].averageValue}` === '') {
ElMessage.warning('请先计算 功率 重复性')
return false
}
if (listRelativeLevelRepeatability.value.length && `${listRelativeLevelRepeatability.value[0].averageValue}` === '') {
ElMessage.warning('请先计算 相对电平 重复性')
return false
}
if (listAMDepthRepeatability.value.length && `${listAMDepthRepeatability.value[0].averageValue}` === '') {
ElMessage.warning('请先计算 调幅度 重复性')
return false
}
if (listfrequencyModulationDeviationRepeatability.value.length && `${listfrequencyModulationDeviationRepeatability.value[0].averageValue}` === '') {
ElMessage.warning('请先计算 调频频偏 重复性')
return false
}
if (listPhaseRepeatability.value.length && `${listPhaseRepeatability.value[0].averageValue}` === '') {
ElMessage.warning('请先计算 调相相偏 重复性')
return false
}
if (listFrequencySpectrumRepeatability.value.length && `${listFrequencySpectrumRepeatability.value[0].averageValue}` === '') {
ElMessage.warning('请先计算 谐波 重复性')
return false
}
return true
}
// 保存之前处理数据
const solveDataBeforeSave = () => {
// 数据处理
let tempList = [] as any
tempList = tempList.concat(
// 重复性
listFrequencyRepeatability.value, // 频率-重复性
listPowerLevelRepeatability.value, // 功率-重复性
listRelativeLevelRepeatability.value, // 相对电平-重复性
listAMDepthRepeatability.value, // 调幅度-重复性
listfrequencyModulationDeviationRepeatability.value, // 调频频偏-重复性
listPhaseRepeatability.value, // 调相相偏-重复性
listFrequencySpectrumRepeatability.value, // 谐波-重复性
listFrequencyStability.value, // 频率-稳定性
listPowerLevelStability.value, // 功率-稳定性
listRelativeLevelStability.value, // 相对电平-稳定性
listAMDepthStability.value, // 调幅度-稳定性
listfrequencyModulationDeviationStability.value, // 调频频偏-稳定性
listPhaseStability.value, // 调相相偏-稳定性
listFrequencySpectrumStability.value, // 谐波-稳定性
)
return tempList.map((item: any) => ({
...item,
averageValue: removeLetters(String(item.averageValue) || 'a'),
})).map((item: any) => {
const obj = {} as { [key: string]: string }
for (const i in item) {
if (i.includes('testValue') && !i.includes('Date')) {
obj[i] = removeLetters(String(item[i]) || 'a')
}
else {
obj[i] = item[i]
}
}
return obj
})
}
// 点击表头日期查询历史稳定性数据
const handleClickHeader = (val: any, checkDateDetailId: string) => {
dateArrStability.value = ['核查数据', val.label]
fetchInfo(checkDateDetailId) // 获取此次历史日期的详情
}
// 日期变化
const handleChangeRadio = (date: string) => {
currentDate.value = date
}
// -------------------------------------钩子-----------------------------------------------------
// 统计日期
const dateCount = (columns: TableColumn[]) => {
let dateNum = 0 // 稳定性表格有几个日期
// 统计有几个日期
columns[3].children?.forEach((item) => {
if (item.text !== '-' && item.text !== '') {
dateNum += 1
}
})
return dateNum
}
watch(() => props.pageType, (newValue) => {
if (newValue === 'detail') {
listFrequencyRepeatability.value = listFrequencyRepeatability.value.map((item) => { item.editable = false; return item })
listPowerLevelRepeatability.value = listPowerLevelRepeatability.value.map((item) => { item.editable = false; return item })
listRelativeLevelRepeatability.value = listRelativeLevelRepeatability.value.map((item) => { item.editable = false; return item })
listAMDepthRepeatability.value = listAMDepthRepeatability.value.map((item) => { item.editable = false; return item })
listfrequencyModulationDeviationRepeatability.value = listfrequencyModulationDeviationRepeatability.value.map((item) => { item.editable = false; return item })
listPhaseRepeatability.value = listPhaseRepeatability.value.map((item) => { item.editable = false; return item })
listFrequencySpectrumRepeatability.value = listFrequencySpectrumRepeatability.value.map((item) => { item.editable = false; return item })
}
})
/**
* 初始化表头
* @param soveLastColumnDate 是否处理最后一列
*/
function initColumns() {
const tempColumn_frequency = [
{ width: '220', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true, showUnit: true },
{ width: '220', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true, showUnit: true },
{ width: '220', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true, showUnit: true },
{ width: '220', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true, showUnit: true },
{ width: '220', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true, showUnit: true },
{ width: '220', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true, showUnit: true },
] as any
const tempColumn = [
{ width: '220', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true },
{ width: '220', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true },
{ width: '220', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true },
{ width: '220', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true },
{ width: '220', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true },
{ width: '220', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true },
] as any
if (listFrequencyRepeatability.value && listFrequencyRepeatability.value.length) {
columns_stability_frequency.value[2].children = [...tempColumn_frequency]
}
if (listPowerLevelRepeatability.value && listPowerLevelRepeatability.value.length) {
columns_stability_power_level.value[3].children = [...tempColumn]
}
if (listRelativeLevelRepeatability.value && listRelativeLevelRepeatability.value.length) {
columns_stability_relative_level.value[3].children = [...tempColumn]
}
if (listAMDepthRepeatability.value && listAMDepthRepeatability.value.length) {
columns_stability_AM_depth.value[3].children = [...tempColumn]
}
if (listfrequencyModulationDeviationRepeatability.value && listfrequencyModulationDeviationRepeatability.value.length) {
columns_stability_frequency_modulation_deviation.value[3].children = [...tempColumn]
}
if (listPhaseRepeatability.value && listPhaseRepeatability.value.length) {
columns_stability_phase.value[3].children = [...tempColumn]
}
if (listFrequencySpectrumRepeatability.value && listFrequencySpectrumRepeatability.value.length) {
columns_stability_frequency_spectrum.value[2].children = [...tempColumn]
}
if (props.pageType === 'add') {
columns_stability_frequency.value[2].children![5].text = props.checkDate! // 最后一列的表头日期
columns_stability_power_level.value[3].children![5].text = props.checkDate! // 最后一列的表头日期
columns_stability_relative_level.value[3].children![5].text = props.checkDate!
columns_stability_AM_depth.value[3].children![5].text = props.checkDate!
columns_stability_frequency_modulation_deviation.value[3].children![5].text = props.checkDate!
columns_stability_phase.value[3].children![5].text = props.checkDate!
columns_stability_frequency_spectrum.value[2].children![5].text = props.checkDate!
}
}
/**
* 初始化CheckDate表头
*/
function initColumnsCheckDate() {
const tempColumn_frequency = [
{ width: '220', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true, showUnit: true },
{ width: '220', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true, showUnit: true },
{ width: '220', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true, showUnit: true },
{ width: '220', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true, showUnit: true },
{ width: '220', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true, showUnit: true },
{ width: '220', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true, showUnit: true },
] as any
const tempColumn = [
{ width: '220', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true },
{ width: '220', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true },
{ width: '220', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true },
{ width: '220', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true },
{ width: '220', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true },
{ width: '220', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true },
] as any
if (listFrequencyRepeatability.value && listFrequencyRepeatability.value.length) {
columns_stability_frequency_checkDate.value[2].children = [...tempColumn_frequency]
}
if (listPowerLevelRepeatability.value && listPowerLevelRepeatability.value.length) {
columns_stability_power_level_checkDate.value[3].children = [...tempColumn]
}
if (listRelativeLevelRepeatability.value && listRelativeLevelRepeatability.value.length) {
columns_stability_relative_level_checkDate.value[3].children = [...tempColumn]
}
if (listAMDepthRepeatability.value && listAMDepthRepeatability.value.length) {
columns_stability_AM_depth_checkDate.value[3].children = [...tempColumn]
}
if (listfrequencyModulationDeviationRepeatability.value && listfrequencyModulationDeviationRepeatability.value.length) {
columns_stability_frequency_modulation_deviation_checkDate.value[3].children = [...tempColumn]
}
if (listPhaseRepeatability.value && listPhaseRepeatability.value.length) {
columns_stability_phase_checkDate.value[3].children = [...tempColumn]
}
if (listFrequencySpectrumRepeatability.value && listFrequencySpectrumRepeatability.value.length) {
columns_stability_frequency_spectrum_checkDate.value[2].children = [...tempColumn]
}
}
// 监听核查日期变化
watch(() => props.checkDate, (newValue) => {
initColumns()
nextTick(() => {
fetchHistoryIndication() // 重新拉取稳定性日期
})
}, { immediate: true })
onMounted(async () => {
belongStandardEquipment.value = $route.query.belongStandardEquipment as string // 检校标准装置
itemCategoryId.value = $route.query.itemCategoryId as string // 核查项分类id
itemCategoryName.value = $route.query.itemCategoryName as string // 核查项分类名称
if (props.pageType !== 'add') {
fetchInfo()
}
})
defineExpose({ fetchCheckItemDetail, checkList, solveDataBeforeSave, form })
</script>
<template>
<!-- 核查数据 -->
<detail-block
:title="dateArrStability.length > 1 ? ' ' : '核查数据'" :title-menus="dateArrStability"
@handle-change-radio="handleChangeRadio"
>
<div style="display: flex;justify-content: space-between;">
<el-radio-group v-model="current" style="margin-bottom: 20px;">
<el-radio-button v-for="item in radioMenus" :key="item.value" :label="item.value">
{{ item.name }}
</el-radio-button>
</el-radio-group>
</div>
<div style="display: flex;justify-content: space-between;align-items: center; position: absolute; right: 20px;">
<div />
<el-button
v-if="pageType !== 'detail' && current === 'stability'" type="primary"
@click="createResult('stability')"
>
计算结果
</el-button>
</div>
<!-- 频率 -->
<div style="display: flex;justify-content: space-between;align-items: center;">
<h5 v-if="listFrequencyRepeatability.length">
频率
</h5>
<div v-if="!listFrequencyRepeatability.length" />
<el-button
v-if="pageType !== 'detail' && current === 'repeatability' && listFrequencyRepeatability.length"
type="primary" @click="createResult('频率')"
>
计算结果
</el-button>
<!-- <el-button v-if="pageType !== 'detail' && current === 'stability' && currentDate === '核查数据'" type="primary" @click="createResult('stability')">
计算结果
</el-button> -->
</div>
<multi-table
v-show="current === 'repeatability' && (currentDate === '核查数据' || currentDate === '') && listFrequencyRepeatability.length"
v-loading="listFrequencyRepeatabilityLoading" :table-data="listFrequencyRepeatability"
:table-header="columns_repeatability_frequency" :merge-rows="[]" :need-index="true" max-height="300"
/>
<!-- 历史日期重复性数据 -->
<multi-table
v-show="current === 'repeatability' && (currentDate !== '核查数据' && currentDate !== '') && listFrequencyRepeatabilityCheckDate.length"
v-loading="listFrequencyRepeatabilityLoading" :table-data="listFrequencyRepeatabilityCheckDate"
:table-header="columns_repeatability_frequency" :merge-rows="[]" :need-index="true" max-height="300"
/>
<!-- 频率稳定性 -->
<multi-table
v-show="current === 'stability' && (currentDate === '核查数据' || currentDate === '') && listFrequencyStability.length"
v-loading="listFrequencyStabilityLoading" :table-data="listFrequencyStability"
:table-header="columns_stability_frequency" :merge-rows="[]" :need-index="true" max-height="500"
@handle-click-header="handleClickHeader"
/>
<!-- 历史日期稳定性数据 -->
<multi-table
v-show="current === 'stability' && (currentDate !== '核查数据' && currentDate !== '') && listFrequencyStabilityCheckDate.length"
v-loading="listFrequencyStabilityLoading" :table-data="listFrequencyStabilityCheckDate"
:table-header="columns_stability_frequency_checkDate" :merge-rows="[]" :need-index="true" max-height="500"
@handle-click-header="handleClickHeader"
/>
<!-- 功率 -->
<div
v-if="listPowerLevelRepeatability.length"
style="display: flex;justify-content: space-between;align-items: center;"
>
<h5>功率</h5>
<el-button v-if="pageType !== 'detail' && current === 'repeatability'" type="primary" @click="createResult('功率')">
计算结果
</el-button>
</div>
<multi-table
v-show="current === 'repeatability' && (currentDate === '核查数据' || currentDate === '') && listPowerLevelRepeatability.length"
v-loading="listPowerLevelRepeatabilityLoading" :table-data="listPowerLevelRepeatability"
:table-header="columns_repeatability_power_level" :merge-rows="[]" :need-index="true" max-height="300"
/>
<!-- 历史日期重复性数据 -->
<multi-table
v-show="current === 'repeatability' && (currentDate !== '核查数据' && currentDate !== '') && listPowerLevelRepeatabilityCheckDate.length"
v-loading="listPowerLevelRepeatabilityLoading" :table-data="listPowerLevelRepeatabilityCheckDate"
:table-header="columns_repeatability_power_level" :merge-rows="[]" :need-index="true" max-height="300"
/>
<!-- 功率稳定性 -->
<multi-table
v-show="current === 'stability' && (currentDate === '核查数据' || currentDate === '') && listPowerLevelStability.length"
v-loading="listPowerLevelStabilityLoading" :table-data="listPowerLevelStability"
:table-header="columns_stability_power_level" :merge-rows="[]" :need-index="true" max-height="500"
@handle-click-header="handleClickHeader"
/>
<!-- 历史日期稳定性数据 -->
<multi-table
v-show="current === 'stability' && (currentDate !== '核查数据' && currentDate !== '') && listPowerLevelStabilityCheckDate.length"
v-loading="listPowerLevelStabilityLoading" :table-data="listPowerLevelStabilityCheckDate"
:table-header="columns_stability_power_level_checkDate" :merge-rows="[]" :need-index="true" max-height="500"
@handle-click-header="handleClickHeader"
/>
<!-- 相对电平 -->
<div
v-if="listRelativeLevelRepeatability.length"
style="display: flex;justify-content: space-between;align-items: center;"
>
<h5>相对电平</h5>
<el-button
v-if="pageType !== 'detail' && current === 'repeatability'" type="primary"
@click="createResult('相对电平')"
>
计算结果
</el-button>
</div>
<multi-table
v-show="current === 'repeatability' && (currentDate === '核查数据' || currentDate === '') && listRelativeLevelRepeatability.length"
v-loading="listRelativeLevelRepeatabilityLoading" :table-data="listRelativeLevelRepeatability"
:table-header="columns_repeatability_relative_level" :merge-rows="[]" :need-index="true" max-height="300"
/>
<!-- 历史日期重复性数据 -->
<multi-table
v-show="current === 'repeatability' && (currentDate !== '核查数据' && currentDate !== '') && listRelativeLevelRepeatabilityCheckDate.length"
v-loading="listRelativeLevelRepeatabilityLoading" :table-data="listRelativeLevelRepeatabilityCheckDate"
:table-header="columns_repeatability_relative_level" :merge-rows="[]" :need-index="true" max-height="300"
/>
<!-- 稳定性 -->
<multi-table
v-show="current === 'stability' && (currentDate === '核查数据' || currentDate === '') && listRelativeLevelStability.length"
v-loading="listRelativeLevelStabilityLoading" :table-data="listRelativeLevelStability"
:table-header="columns_stability_relative_level" :merge-rows="[]" :need-index="true" max-height="500"
@handle-click-header="handleClickHeader"
/>
<!-- 历史日期稳定性数据 -->
<multi-table
v-show="current === 'stability' && (currentDate !== '核查数据' && currentDate !== '') && listRelativeLevelStabilityCheckDate.length"
v-loading="listRelativeLevelStabilityLoading" :table-data="listRelativeLevelStabilityCheckDate"
:table-header="columns_stability_relative_level_checkDate" :merge-rows="[]" :need-index="true" max-height="500"
@handle-click-header="handleClickHeader"
/>
<!-- 调幅度 -->
<div
v-if="listAMDepthRepeatability.length"
style="display: flex;justify-content: space-between;align-items: center;"
>
<h5>调幅度</h5>
<el-button
v-if="pageType !== 'detail' && current === 'repeatability'" type="primary"
@click="createResult('调幅度')"
>
计算结果
</el-button>
</div>
<multi-table
v-show="current === 'repeatability' && (currentDate === '核查数据' || currentDate === '') && listAMDepthRepeatability.length"
v-loading="listAMDepthRepeatabilityLoading" :table-data="listAMDepthRepeatability"
:table-header="columns_repeatability_AM_depth" :merge-rows="[]" :need-index="true" max-height="300"
/>
<!-- 历史日期重复性数据 -->
<multi-table
v-show="current === 'repeatability' && (currentDate !== '核查数据' && currentDate !== '') && listAMDepthRepeatabilityCheckDate.length"
v-loading="listAMDepthRepeatabilityLoading" :table-data="listAMDepthRepeatabilityCheckDate"
:table-header="columns_repeatability_AM_depth" :merge-rows="[]" :need-index="true" max-height="300"
/>
<!-- 稳定性 -->
<multi-table
v-show="current === 'stability' && (currentDate === '核查数据' || currentDate === '') && listAMDepthStability.length"
v-loading="listAMDepthStabilityLoading" :table-data="listAMDepthStability"
:table-header="columns_stability_AM_depth" :merge-rows="[]" :need-index="true" max-height="500"
@handle-click-header="handleClickHeader"
/>
<!-- 历史日期稳定性数据 -->
<multi-table
v-show="current === 'stability' && (currentDate !== '核查数据' && currentDate !== '') && listAMDepthStabilityCheckDate.length"
v-loading="listAMDepthStabilityLoading" :table-data="listAMDepthStabilityCheckDate"
:table-header="columns_stability_AM_depth_checkDate" :merge-rows="[]" :need-index="true" max-height="500"
@handle-click-header="handleClickHeader"
/>
<!-- 调频频偏 -->
<div
v-if="listfrequencyModulationDeviationRepeatability.length"
style="display: flex;justify-content: space-between;align-items: center;"
>
<h5>调频频偏</h5>
<el-button
v-if="pageType !== 'detail' && current === 'repeatability'" type="primary"
@click="createResult('调频频偏')"
>
计算结果
</el-button>
</div>
<multi-table
v-show="current === 'repeatability' && (currentDate === '核查数据' || currentDate === '') && listfrequencyModulationDeviationRepeatability.length"
v-loading="listfrequencyModulationDeviationRepeatabilityLoading"
:table-data="listfrequencyModulationDeviationRepeatability"
:table-header="columns_repeatability_frequency_modulation_deviation" :merge-rows="[]" :need-index="true"
max-height="300"
/>
<!-- 历史日期重复性数据 -->
<multi-table
v-show="current === 'repeatability' && (currentDate !== '核查数据' && currentDate !== '') && listfrequencyModulationDeviationRepeatabilityCheckDate.length"
v-loading="listfrequencyModulationDeviationRepeatabilityLoading"
:table-data="listfrequencyModulationDeviationRepeatabilityCheckDate"
:table-header="columns_repeatability_frequency_modulation_deviation" :merge-rows="[]" :need-index="true"
max-height="300"
/>
<!-- 稳定性 -->
<multi-table
v-show="current === 'stability' && (currentDate === '核查数据' || currentDate === '') && listfrequencyModulationDeviationStability.length"
v-loading="listfrequencyModulationDeviationStabilityLoading"
:table-data="listfrequencyModulationDeviationStability"
:table-header="columns_stability_frequency_modulation_deviation" :merge-rows="[]" :need-index="true"
max-height="500" @handle-click-header="handleClickHeader"
/>
<!-- 历史日期稳定性数据 -->
<multi-table
v-show="current === 'stability' && (currentDate !== '核查数据' && currentDate !== '') && listfrequencyModulationDeviationStabilityCheckDate.length"
v-loading="listfrequencyModulationDeviationStabilityLoading"
:table-data="listfrequencyModulationDeviationStabilityCheckDate"
:table-header="columns_stability_frequency_modulation_deviation_checkDate" :merge-rows="[]" :need-index="true"
max-height="500" @handle-click-header="handleClickHeader"
/>
<!-- 调相相偏 -->
<div v-if="listPhaseRepeatability.length" style="display: flex;justify-content: space-between;align-items: center;">
<h5>调相相偏</h5>
<el-button
v-if="pageType !== 'detail' && current === 'repeatability'" type="primary"
@click="createResult('调相相偏')"
>
计算结果
</el-button>
</div>
<multi-table
v-show="current === 'repeatability' && (currentDate === '核查数据' || currentDate === '') && listPhaseRepeatability.length"
v-loading="listPhaseRepeatabilityLoading" :table-data="listPhaseRepeatability"
:table-header="columns_repeatability_phase" :merge-rows="[]" :need-index="true" max-height="300"
/>
<!-- 历史日期重复性数据 -->
<multi-table
v-show="current === 'repeatability' && (currentDate !== '核查数据' && currentDate !== '') && listPhaseRepeatabilityCheckDate.length"
v-loading="listPhaseRepeatabilityLoading" :table-data="listPhaseRepeatabilityCheckDate"
:table-header="columns_repeatability_phase" :merge-rows="[]" :need-index="true" max-height="300"
/>
<!-- 稳定性 -->
<multi-table
v-show="current === 'stability' && (currentDate === '核查数据' || currentDate === '') && listPhaseStability.length"
v-loading="listPhaseStabilityLoading" :table-data="listPhaseStability" :table-header="columns_stability_phase"
:merge-rows="[]" :need-index="true" max-height="500" @handle-click-header="handleClickHeader"
/>
<!-- 历史日期稳定性数据 -->
<multi-table
v-show="current === 'stability' && (currentDate !== '核查数据' && currentDate !== '') && listPhaseStabilityCheckDate.length"
v-loading="listPhaseStabilityLoading" :table-data="listPhaseStabilityCheckDate"
:table-header="columns_stability_phase_checkDate" :merge-rows="[]" :need-index="true" max-height="500"
@handle-click-header="handleClickHeader"
/>
<!-- 谐波 -->
<div
v-if="listFrequencySpectrumRepeatability.length"
style="display: flex;justify-content: space-between;align-items: center;"
>
<h5>谐波</h5>
<el-button v-if="pageType !== 'detail' && current === 'repeatability'" type="primary" @click="createResult('谐波')">
计算结果
</el-button>
</div>
<multi-table
v-show="current === 'repeatability' && (currentDate === '核查数据' || currentDate === '') && listFrequencySpectrumRepeatability.length"
v-loading="listFrequencySpectrumRepeatabilityLoading" :table-data="listFrequencySpectrumRepeatability"
:table-header="columns_repeatability_frequency_spectrum" :merge-rows="[]" :need-index="true" max-height="300"
/>
<!-- 历史日期重复性数据 -->
<multi-table
v-show="current === 'repeatability' && (currentDate !== '核查数据' && currentDate !== '') && listFrequencySpectrumRepeatabilityCheckDate.length"
v-loading="listFrequencySpectrumRepeatabilityLoading" :table-data="listFrequencySpectrumRepeatabilityCheckDate"
:table-header="columns_repeatability_frequency_spectrum" :merge-rows="[]" :need-index="true" max-height="300"
/>
<!-- 稳定性 -->
<multi-table
v-show="current === 'stability' && (currentDate === '核查数据' || currentDate === '') && listFrequencySpectrumStability.length"
v-loading="listFrequencySpectrumStabilityLoading" :table-data="listFrequencySpectrumStability"
:table-header="columns_stability_frequency_spectrum" :merge-rows="[]" :need-index="true" max-height="500"
@handle-click-header="handleClickHeader"
/>
<!-- 历史日期稳定性数据 -->
<multi-table
v-show="current === 'stability' && (currentDate !== '核查数据' && currentDate !== '') && listFrequencySpectrumStabilityCheckDate.length"
v-loading="listFrequencySpectrumStabilityLoading" :table-data="listFrequencySpectrumStabilityCheckDate"
:table-header="columns_stability_frequency_spectrum_checkDate" :merge-rows="[]" :need-index="true"
max-height="500" @handle-click-header="handleClickHeader"
/>
<el-form
v-if="current === 'stability'" style="margin-top: 20px;" :model="form" label-width="160"
label-position="right"
>
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="稳定性考核是否合格:">
<el-input
v-model="form.qualified" class="full-width-input" disabled
:placeholder="pageType === 'detail' ? ' ' : '稳定性考核是否合格'"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注:" prop="remark">
<el-input v-model="form.remark" autosize type="textarea" :disabled="pageType === 'detail'" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- 保存核查记录 -->
<save-check-record ref="saveCheckRecordRef" />
</detail-block>
</template>
<style lang="scss" scoped>
.link {
text-decoration: underline;
color: #3d7eff;
cursor: pointer;
}
.file-area {
display: flex;
align-items: center;
font-size: 14px;
color: #60627f;
margin-bottom: 10px;
margin-left: 40px;
white-space: nowrap;
.tech-file {
display: flex;
align-items: center;
margin-left: 20px;
.file-text {
margin-right: 10px;
}
}
}
</style>